aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2018-07-14 13:08:39 -0300
committerGitHub <noreply@github.com>2018-07-14 13:08:39 -0300
commit2f37583ab3b49aa5064a72c8d3b4e8245ebb6b5b (patch)
tree08797d8b190c33cb942f96fb70fc5b18b995909c /Ryujinx.HLE
parent494f8f0248e7daf3fdfb89a6d90f1598232b6a87 (diff)
Some small shader related fixes (#258)
* Some small shader related fixes * Address PR feedback
Diffstat (limited to 'Ryujinx.HLE')
-rw-r--r--Ryujinx.HLE/Gpu/Engines/NvGpuEngine3d.cs10
-rw-r--r--Ryujinx.HLE/Gpu/Texture/TextureHelper.cs28
-rw-r--r--Ryujinx.HLE/Gpu/Texture/TextureReader.cs2
3 files changed, 21 insertions, 19 deletions
diff --git a/Ryujinx.HLE/Gpu/Engines/NvGpuEngine3d.cs b/Ryujinx.HLE/Gpu/Engines/NvGpuEngine3d.cs
index 2bacd71b..5c474ab0 100644
--- a/Ryujinx.HLE/Gpu/Engines/NvGpuEngine3d.cs
+++ b/Ryujinx.HLE/Gpu/Engines/NvGpuEngine3d.cs
@@ -172,6 +172,8 @@ namespace Ryujinx.HLE.Gpu.Engines
for (; Index < 6; Index++)
{
+ GalShaderType Type = GetTypeFromProgram(Index);
+
int Control = ReadRegister(NvGpuEngine3dReg.ShaderNControl + Index * 0x10);
int Offset = ReadRegister(NvGpuEngine3dReg.ShaderNOffset + Index * 0x10);
@@ -180,16 +182,16 @@ namespace Ryujinx.HLE.Gpu.Engines
if (!Enable)
{
+ Gpu.Renderer.Shader.Unbind(Type);
+
continue;
}
long Key = BasePosition + (uint)Offset;
- GalShaderType ShaderType = GetTypeFromProgram(Index);
-
- Keys[(int)ShaderType] = Key;
+ Keys[(int)Type] = Key;
- Gpu.Renderer.Shader.Create(Vmm, Key, ShaderType);
+ Gpu.Renderer.Shader.Create(Vmm, Key, Type);
Gpu.Renderer.Shader.Bind(Key);
}
diff --git a/Ryujinx.HLE/Gpu/Texture/TextureHelper.cs b/Ryujinx.HLE/Gpu/Texture/TextureHelper.cs
index 6b9a3063..c0749d6a 100644
--- a/Ryujinx.HLE/Gpu/Texture/TextureHelper.cs
+++ b/Ryujinx.HLE/Gpu/Texture/TextureHelper.cs
@@ -62,67 +62,67 @@ namespace Ryujinx.HLE.Gpu.Texture
{
return CompressedTextureSize(Texture.Width, Texture.Height, 4, 4, 16);
}
-
+
case GalTextureFormat.Astc2D5x5:
{
return CompressedTextureSize(Texture.Width, Texture.Height, 5, 5, 16);
}
-
+
case GalTextureFormat.Astc2D6x6:
{
return CompressedTextureSize(Texture.Width, Texture.Height, 6, 6, 16);
}
-
+
case GalTextureFormat.Astc2D8x8:
{
return CompressedTextureSize(Texture.Width, Texture.Height, 8, 8, 16);
}
-
+
case GalTextureFormat.Astc2D10x10:
{
return CompressedTextureSize(Texture.Width, Texture.Height, 10, 10, 16);
}
-
+
case GalTextureFormat.Astc2D12x12:
{
return CompressedTextureSize(Texture.Width, Texture.Height, 12, 12, 16);
}
-
+
case GalTextureFormat.Astc2D5x4:
{
return CompressedTextureSize(Texture.Width, Texture.Height, 5, 4, 16);
}
-
+
case GalTextureFormat.Astc2D6x5:
{
return CompressedTextureSize(Texture.Width, Texture.Height, 6, 5, 16);
}
-
+
case GalTextureFormat.Astc2D8x6:
{
return CompressedTextureSize(Texture.Width, Texture.Height, 8, 6, 16);
}
-
+
case GalTextureFormat.Astc2D10x8:
{
return CompressedTextureSize(Texture.Width, Texture.Height, 10, 8, 16);
}
-
+
case GalTextureFormat.Astc2D12x10:
{
return CompressedTextureSize(Texture.Width, Texture.Height, 12, 10, 16);
}
-
+
case GalTextureFormat.Astc2D8x5:
{
return CompressedTextureSize(Texture.Width, Texture.Height, 8, 5, 16);
}
-
+
case GalTextureFormat.Astc2D10x5:
{
return CompressedTextureSize(Texture.Width, Texture.Height, 10, 5, 16);
}
-
+
case GalTextureFormat.Astc2D10x6:
{
return CompressedTextureSize(Texture.Width, Texture.Height, 10, 6, 16);
@@ -139,7 +139,7 @@ namespace Ryujinx.HLE.Gpu.Texture
return W * H * Bpb;
}
-
+
public static (AMemory Memory, long Position) GetMemoryAndPosition(
IAMemory Memory,
long Position)
diff --git a/Ryujinx.HLE/Gpu/Texture/TextureReader.cs b/Ryujinx.HLE/Gpu/Texture/TextureReader.cs
index 8bd4dbcb..6c08cd6c 100644
--- a/Ryujinx.HLE/Gpu/Texture/TextureReader.cs
+++ b/Ryujinx.HLE/Gpu/Texture/TextureReader.cs
@@ -30,7 +30,7 @@ namespace Ryujinx.HLE.Gpu.Texture
case GalTextureFormat.Astc2D5x5: return Read16BptCompressedTexture(Memory, Texture, 5, 5);
case GalTextureFormat.Astc2D6x6: return Read16BptCompressedTexture(Memory, Texture, 6, 6);
case GalTextureFormat.Astc2D8x8: return Read16BptCompressedTexture(Memory, Texture, 8, 8);
- case GalTextureFormat.Astc2D10x10: return Read16BptCompressedTexture(Memory, Texture, 10, 10);
+ case GalTextureFormat.Astc2D10x10: return Read16BptCompressedTexture(Memory, Texture, 10, 10);
case GalTextureFormat.Astc2D12x12: return Read16BptCompressedTexture(Memory, Texture, 12, 12);
case GalTextureFormat.Astc2D5x4: return Read16BptCompressedTexture(Memory, Texture, 5, 4);
case GalTextureFormat.Astc2D6x5: return Read16BptCompressedTexture(Memory, Texture, 6, 5);