From a2a46501084d3463203da970632640a95e32e423 Mon Sep 17 00:00:00 2001 From: BaronKiko Date: Mon, 4 Mar 2019 02:51:23 +0000 Subject: [PATCH] Rebased, in theory (#610) --- Ryujinx.Graphics/Gal/OpenGL/OglTexture.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Ryujinx.Graphics/Gal/OpenGL/OglTexture.cs b/Ryujinx.Graphics/Gal/OpenGL/OglTexture.cs index f836702f5..21edd89ee 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OglTexture.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OglTexture.cs @@ -177,6 +177,24 @@ namespace Ryujinx.Graphics.Gal.OpenGL data.Length, data); break; + case TextureTarget.TextureCubeMap: + Span array = new Span(data); + + int faceSize = ImageUtils.GetSize(image) / 6; + + for (int Face = 0; Face < 6; Face++) + { + GL.CompressedTexImage2D( + TextureTarget.TextureCubeMapPositiveX + Face, + level, + internalFmt, + image.Width, + image.Height, + border, + faceSize, + array.Slice(Face * faceSize, faceSize).ToArray()); + } + break; default: throw new NotImplementedException($"Unsupported texture target type: {target}"); }