소스 검색

gl_shader_manager: Take ShaderSetup instances by const reference in UseProgrammableVertexShader() and UseProgrammableFragmentShader()

Avoids performing unnecessary copies of 65560 byte sized ShaderSetup
instances, considering it's only used as part of lookup and not
modified.

Given the parameters were already const, it's likely taking these
parameters by reference was intended but the ampersand was forgotten.
Lioncash 8 년 전
부모
커밋
d92e8ab062
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/video_core/renderer_opengl/gl_shader_manager.h

+ 2 - 2
src/video_core/renderer_opengl/gl_shader_manager.h

@@ -105,14 +105,14 @@ public:
     }
 
     ShaderEntries UseProgrammableVertexShader(const MaxwellVSConfig& config,
-                                              const ShaderSetup setup) {
+                                              const ShaderSetup& setup) {
         ShaderEntries result;
         std::tie(current.vs, result) = vertex_shaders.Get(config, setup);
         return result;
     }
 
     ShaderEntries UseProgrammableFragmentShader(const MaxwellFSConfig& config,
-                                                const ShaderSetup setup) {
+                                                const ShaderSetup& setup) {
         ShaderEntries result;
         std::tie(current.fs, result) = fragment_shaders.Get(config, setup);
         return result;