From c42b818cf94385d505cc43efbed14af0b766b1ab Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 4 Jul 2018 15:19:20 -0500 Subject: [PATCH 1/2] GPU: Corrected the decoding for the TEX shader instruction. --- src/video_core/engines/shader_bytecode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index c1226a6492..f277eaffac 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h @@ -641,7 +641,7 @@ private: INST("1110111111011---", Id::LD_A, Type::Memory, "LD_A"), INST("1110111110010---", Id::LD_C, Type::Memory, "LD_C"), INST("1110111111110---", Id::ST_A, Type::Memory, "ST_A"), - INST("1100000000111---", Id::TEX, Type::Memory, "TEX"), + INST("110000----111---", Id::TEX, Type::Memory, "TEX"), INST("1101111101001---", Id::TEXQ, Type::Memory, "TEXQ"), INST("1101100---------", Id::TEXS, Type::Memory, "TEXS"), INST("1101101---------", Id::TLDS, Type::Memory, "TLDS"), From 4bda9693be490cdca498483e2d196afb5d2294b5 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 4 Jul 2018 15:20:12 -0500 Subject: [PATCH 2/2] GPU: Ignore textures that the GLSL compiler deemed unused when binding textures to the shaders. --- src/video_core/renderer_opengl/gl_rasterizer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index e516eb1adf..8072c8cb21 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -686,7 +686,10 @@ u32 RasterizerOpenGL::SetupTextures(Maxwell::ShaderStage stage, GLuint program, // Bind the uniform to the sampler. GLint uniform = glGetUniformLocation(program, entry.GetName().c_str()); - ASSERT(uniform != -1); + if (uniform == -1) { + continue; + } + glProgramUniform1i(program, uniform, current_bindpoint); const auto texture = maxwell3d.GetStageTexture(entry.GetStage(), entry.GetOffset());