Add more check for cache invalidation & remove cubemap and cubemap array code for now
Also fix compressed 2d array
This commit is contained in:
parent
065d3b89bb
commit
92b2fd3f6c
3 changed files with 5 additions and 61 deletions
|
@ -74,7 +74,7 @@ namespace Ryujinx.Graphics.Gal
|
|||
return false;
|
||||
}
|
||||
|
||||
return Height == Image.Height;
|
||||
return Height == Image.Height && Depth == Image.Depth && LayerCount == Image.LayerCount;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -473,6 +473,8 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
|||
if (NewImage.Format == OldImage.Format &&
|
||||
NewImage.Width == OldImage.Width &&
|
||||
NewImage.Height == OldImage.Height &&
|
||||
NewImage.Depth == OldImage.Depth &&
|
||||
NewImage.LayerCount == OldImage.LayerCount &&
|
||||
NewImage.TextureTarget == OldImage.TextureTarget)
|
||||
{
|
||||
return;
|
||||
|
|
|
@ -108,24 +108,6 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
|||
Type,
|
||||
IntPtr.Zero);
|
||||
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:
|
||||
throw new NotImplementedException($"Unsupported texture target type: {Target}");
|
||||
}
|
||||
|
@ -171,7 +153,6 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
|||
Data.Length,
|
||||
Data);
|
||||
break;
|
||||
case TextureTarget.Texture2DArray:
|
||||
case TextureTarget.Texture3D:
|
||||
GL.CompressedTexImage3D(
|
||||
Target,
|
||||
|
@ -184,33 +165,14 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
|||
Data.Length,
|
||||
Data);
|
||||
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.CompressedTexImage2D(
|
||||
TextureTarget.TextureCubeMapPositiveX + Face,
|
||||
Level,
|
||||
InternalFmt,
|
||||
Image.Width,
|
||||
Image.Height,
|
||||
Border,
|
||||
FaceSize,
|
||||
Array.Slice(Face * FaceSize, FaceSize).ToArray());
|
||||
}
|
||||
break;
|
||||
case TextureTarget.TextureCubeMapArray:
|
||||
case TextureTarget.Texture2DArray:
|
||||
GL.CompressedTexImage3D(
|
||||
Target,
|
||||
Level,
|
||||
InternalFmt,
|
||||
Image.Width,
|
||||
Image.Height,
|
||||
Image.LayerCount * 6,
|
||||
Image.LayerCount,
|
||||
Border,
|
||||
Data.Length,
|
||||
Data);
|
||||
|
@ -296,26 +258,6 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
|||
Type,
|
||||
Data);
|
||||
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:
|
||||
throw new NotImplementedException($"Unsupported texture target type: {Target}");
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue