From 0ca8fce9d0a073ee07818691cbc6534e9af5fc7a Mon Sep 17 00:00:00 2001 From: bunnei Date: Sun, 8 Apr 2018 00:36:19 -0400 Subject: [PATCH] gl_shader_manager: Implement SetShaderSamplerBindings. --- src/video_core/renderer_opengl/gl_shader_manager.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/video_core/renderer_opengl/gl_shader_manager.cpp b/src/video_core/renderer_opengl/gl_shader_manager.cpp index a5835f2b1..67f2be056 100644 --- a/src/video_core/renderer_opengl/gl_shader_manager.cpp +++ b/src/video_core/renderer_opengl/gl_shader_manager.cpp @@ -38,6 +38,14 @@ void SetShaderSamplerBindings(GLuint shader) { cur_state.Apply(); // Set the texture samplers to correspond to different texture units + for (u32 texture = 0; texture < 32; ++texture) { + // Set the texture samplers to correspond to different texture units + std::string uniform_name = "tex[" + std::to_string(texture) + "]"; + GLint uniform_tex = glGetUniformLocation(shader, uniform_name.c_str()); + if (uniform_tex != -1) { + glUniform1i(uniform_tex, TextureUnits::MaxwellTexture(texture).id); + } + } cur_state.draw.shader_program = old_program; cur_state.Apply();