Implement CubeMap textures in OGLTexture.Create

This commit is contained in:
Thog 2018-11-29 15:47:15 +01:00
parent be47d4d16c
commit 82e10ad3ad
No known key found for this signature in database
GPG key ID: 0CD291558FAFDBC6

View file

@ -88,6 +88,24 @@ namespace Ryujinx.Graphics.Gal.OpenGL
Type,
IntPtr.Zero);
break;
case TextureTarget.TextureCubeMap:
int FaceSize = ImageUtils.GetSize(Image) / Image.Depth;
for (int i = 0; i < 6; i++)
{
GL.TexImage2D(
TextureTarget.TextureCubeMapPositiveX + i,
Level,
InternalFmt,
Image.Width,
Image.Height,
Border,
Format,
Type,
IntPtr.Zero);
}
break;
default:
Logger.PrintWarning(LogClass.Gpu, $"Unsupported texture target type: {Target}");
throw new InvalidOperationException();