From 99a71580c4356c51bcb5f18b10be55f1e62a65e5 Mon Sep 17 00:00:00 2001 From: Markus Wick Date: Tue, 4 Sep 2018 20:55:34 +0200 Subject: gl_shader_cache: Use an u32 for the binding point cache. The std::string generation with its malloc and free requirement was a noticeable overhead. Also switch to an ordered_map to avoid the std::hash call. As those maps usually have a size of two elements, the lookup time shall not matter. --- src/video_core/renderer_opengl/gl_rasterizer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp') diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index e260c9140..7ee3f2ae7 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -709,7 +709,7 @@ std::tuple RasterizerOpenGL::SetupConstBuffers(u8* buffer_pt // Now configure the bindpoint of the buffer inside the shader glUniformBlockBinding(shader->GetProgramHandle(), - shader->GetProgramResourceIndex(used_buffer.GetName()), + shader->GetProgramResourceIndex(used_buffer), current_bindpoint + bindpoint); } @@ -733,7 +733,7 @@ u32 RasterizerOpenGL::SetupTextures(Maxwell::ShaderStage stage, Shader& shader, // Bind the uniform to the sampler. - glProgramUniform1i(shader->GetProgramHandle(), shader->GetUniformLocation(entry.GetName()), + glProgramUniform1i(shader->GetProgramHandle(), shader->GetUniformLocation(entry), current_bindpoint); const auto texture = maxwell3d.GetStageTexture(entry.GetStage(), entry.GetOffset()); -- cgit v1.2.3