summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-04-08 00:36:19 -0400
committerGravatar bunnei2018-04-13 23:48:30 -0400
commit0ca8fce9d0a073ee07818691cbc6534e9af5fc7a (patch)
tree9c218f72c4d6fcb6cae1a6491580b4036bbe98fd /src
parentgl_rasterizer: Generate shaders and upload uniforms. (diff)
downloadyuzu-0ca8fce9d0a073ee07818691cbc6534e9af5fc7a.tar.gz
yuzu-0ca8fce9d0a073ee07818691cbc6534e9af5fc7a.tar.xz
yuzu-0ca8fce9d0a073ee07818691cbc6534e9af5fc7a.zip
gl_shader_manager: Implement SetShaderSamplerBindings.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_manager.cpp8
1 files changed, 8 insertions, 0 deletions
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) {
38 cur_state.Apply(); 38 cur_state.Apply();
39 39
40 // Set the texture samplers to correspond to different texture units 40 // Set the texture samplers to correspond to different texture units
41 for (u32 texture = 0; texture < 32; ++texture) {
42 // Set the texture samplers to correspond to different texture units
43 std::string uniform_name = "tex[" + std::to_string(texture) + "]";
44 GLint uniform_tex = glGetUniformLocation(shader, uniform_name.c_str());
45 if (uniform_tex != -1) {
46 glUniform1i(uniform_tex, TextureUnits::MaxwellTexture(texture).id);
47 }
48 }
41 49
42 cur_state.draw.shader_program = old_program; 50 cur_state.draw.shader_program = old_program;
43 cur_state.Apply(); 51 cur_state.Apply();