Add more check for cache invalidation & remove cubemap and cubemap array code for now

Also fix compressed 2d array
This commit is contained in:
Thog 2019-02-17 20:33:21 +01:00
commit 92b2fd3f6c
No known key found for this signature in database
GPG key ID: 0CD291558FAFDBC6
3 changed files with 5 additions and 61 deletions

View file

@ -74,7 +74,7 @@ namespace Ryujinx.Graphics.Gal
return false; return false;
} }
return Height == Image.Height; return Height == Image.Height && Depth == Image.Depth && LayerCount == Image.LayerCount;
} }
} }
} }

View file

@ -473,6 +473,8 @@ namespace Ryujinx.Graphics.Gal.OpenGL
if (NewImage.Format == OldImage.Format && if (NewImage.Format == OldImage.Format &&
NewImage.Width == OldImage.Width && NewImage.Width == OldImage.Width &&
NewImage.Height == OldImage.Height && NewImage.Height == OldImage.Height &&
NewImage.Depth == OldImage.Depth &&
NewImage.LayerCount == OldImage.LayerCount &&
NewImage.TextureTarget == OldImage.TextureTarget) NewImage.TextureTarget == OldImage.TextureTarget)
{ {
return; return;

View file

@ -108,24 +108,6 @@ namespace Ryujinx.Graphics.Gal.OpenGL
Type, Type,
IntPtr.Zero); IntPtr.Zero);
break; break;
case TextureTarget.TextureCubeMap:
int FaceSize = ImageUtils.GetSize(Image) / Image.Depth;
for (int Face = 0; Face < 6; Face++)
{
GL.TexImage2D(
TextureTarget.TextureCubeMapPositiveX + Face,
Level,
InternalFmt,
Image.Width,
Image.Height,
Border,
Format,
Type,
IntPtr.Zero);
}
break;
default: default:
throw new NotImplementedException($"Unsupported texture target type: {Target}"); throw new NotImplementedException($"Unsupported texture target type: {Target}");
} }
@ -171,7 +153,6 @@ namespace Ryujinx.Graphics.Gal.OpenGL
Data.Length, Data.Length,
Data); Data);
break; break;
case TextureTarget.Texture2DArray:
case TextureTarget.Texture3D: case TextureTarget.Texture3D:
GL.CompressedTexImage3D( GL.CompressedTexImage3D(
Target, Target,
@ -184,33 +165,14 @@ namespace Ryujinx.Graphics.Gal.OpenGL
Data.Length, Data.Length,
Data); Data);
break; break;
case TextureTarget.TextureCubeMap: case TextureTarget.Texture2DArray:
Span<byte> Array = new Span<byte>(Data);
// FIXME: wrong
int FaceSize = ImageUtils.GetSize(Image) / Image.Depth;
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;
case TextureTarget.TextureCubeMapArray:
GL.CompressedTexImage3D( GL.CompressedTexImage3D(
Target, Target,
Level, Level,
InternalFmt, InternalFmt,
Image.Width, Image.Width,
Image.Height, Image.Height,
Image.LayerCount * 6, Image.LayerCount,
Border, Border,
Data.Length, Data.Length,
Data); Data);
@ -296,26 +258,6 @@ namespace Ryujinx.Graphics.Gal.OpenGL
Type, Type,
Data); Data);
break; break;
case TextureTarget.TextureCubeMap:
Span<byte> Array = new Span<byte>(Data);
// FIXME: wrong
int FaceSize = ImageUtils.GetSize(Image) / Image.Depth;
for (int Face = 0; Face < 6; Face++)
{
GL.TexImage2D(
TextureTarget.TextureCubeMapPositiveX + Face,
Level,
InternalFmt,
Image.Width,
Image.Height,
Border,
Format,
Type,
Array.Slice(Face * FaceSize, FaceSize).ToArray());
}
break;
default: default:
throw new NotImplementedException($"Unsupported texture target type: {Target}"); throw new NotImplementedException($"Unsupported texture target type: {Target}");
} }