diff options
| author | bunnei <bunneidev@gmail.com> | 2015-11-25 22:43:28 -0500 |
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2015-11-25 22:43:28 -0500 |
| commit | 913be807828f27647db6ed99602fb1acf5b5b451 (patch) | |
| tree | 79ae175c9c92eb477f34cbe1c1e72ee6ad6085e5 /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
| parent | ff502a51c58f9cad98a67cc86f2cfec2a5c1988a (diff) | |
| parent | f008dfbaca376c7b52b4c79edd0e5b8a302cfa3f (diff) | |
Merge pull request #1254 from bunnei/fix-gl-uniforms
renderer_opengl: Fix uniform issues with #1253
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 2a8949198..822739088 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -492,10 +492,12 @@ void RasterizerOpenGL::SetShader() { state.Apply(); // Set the texture samplers to correspond to different texture units - GLuint uniform_tex = glGetUniformLocation(shader->shader.handle, "tex"); - glUniform1i(uniform_tex, 0); - glUniform1i(uniform_tex + 1, 1); - glUniform1i(uniform_tex + 2, 2); + GLuint uniform_tex = glGetUniformLocation(shader->shader.handle, "tex[0]"); + if (uniform_tex != -1) { glUniform1i(uniform_tex, 0); } + uniform_tex = glGetUniformLocation(shader->shader.handle, "tex[1]"); + if (uniform_tex != -1) { glUniform1i(uniform_tex, 1); } + uniform_tex = glGetUniformLocation(shader->shader.handle, "tex[2]"); + if (uniform_tex != -1) { glUniform1i(uniform_tex, 2); } current_shader = shader_cache.emplace(config, std::move(shader)).first->second.get(); |
