diff options
Diffstat (limited to 'src/video_core/renderer_opengl/gl_shader_cache.h')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_cache.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.h b/src/video_core/renderer_opengl/gl_shader_cache.h index 01af9b28a..bbb53cdf4 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.h +++ b/src/video_core/renderer_opengl/gl_shader_cache.h @@ -6,6 +6,7 @@ #include <array> #include <atomic> +#include <bitset> #include <memory> #include <set> #include <tuple> @@ -74,8 +75,7 @@ public: } /// Gets the GL program handle for the shader - std::tuple<GLuint, BaseBindings> GetProgramHandle(GLenum primitive_mode, - BaseBindings base_bindings); + std::tuple<GLuint, BaseBindings> GetProgramHandle(const ProgramVariant& variant); private: explicit CachedShader(const ShaderParameters& params, Maxwell::ShaderProgram program_type, @@ -92,15 +92,14 @@ private: CachedProgram triangles_adjacency; }; - GLuint GetGeometryShader(GLenum primitive_mode, BaseBindings base_bindings); + GLuint GetGeometryShader(const ProgramVariant& variant); /// Generates a geometry shader or returns one that already exists. - GLuint LazyGeometryProgram(CachedProgram& target_program, BaseBindings base_bindings, - GLenum primitive_mode); + GLuint LazyGeometryProgram(CachedProgram& target_program, const ProgramVariant& variant); - CachedProgram TryLoadProgram(GLenum primitive_mode, BaseBindings base_bindings) const; + CachedProgram TryLoadProgram(const ProgramVariant& variant) const; - ShaderDiskCacheUsage GetUsage(GLenum primitive_mode, BaseBindings base_bindings) const; + ShaderDiskCacheUsage GetUsage(const ProgramVariant& variant) const; u8* host_ptr{}; VAddr cpu_addr{}; @@ -113,8 +112,8 @@ private: std::string code; std::size_t shader_length{}; - std::unordered_map<BaseBindings, CachedProgram> programs; - std::unordered_map<BaseBindings, GeometryPrograms> geometry_programs; + std::unordered_map<ProgramVariant, CachedProgram> programs; + std::unordered_map<ProgramVariant, GeometryPrograms> geometry_programs; std::unordered_map<u32, GLuint> cbuf_resource_cache; std::unordered_map<u32, GLuint> gmem_resource_cache; |