summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_shader_cache.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/renderer_opengl/gl_shader_cache.h')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_cache.h19
1 files changed, 10 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 6bd7c9cf1..7b1470db3 100644
--- a/src/video_core/renderer_opengl/gl_shader_cache.h
+++ b/src/video_core/renderer_opengl/gl_shader_cache.h
@@ -17,6 +17,7 @@
#include <glad/glad.h>
#include "common/common_types.h"
+#include "video_core/engines/shader_type.h"
#include "video_core/rasterizer_cache.h"
#include "video_core/renderer_opengl/gl_resource_manager.h"
#include "video_core/renderer_opengl/gl_shader_decompiler.h"
@@ -47,7 +48,7 @@ using PrecompiledVariants = std::vector<PrecompiledPrograms::iterator>;
struct UnspecializedShader {
GLShader::ShaderEntries entries;
- ProgramType program_type;
+ Tegra::Engines::ShaderType type;
ProgramCode code;
ProgramCode code_b;
};
@@ -77,7 +78,7 @@ public:
}
std::size_t GetSizeInBytes() const override {
- return program_code.size() * sizeof(u64);
+ return code.size() * sizeof(u64);
}
/// Gets the shader entries for the shader
@@ -86,7 +87,7 @@ public:
}
/// Gets the GL program handle for the shader
- std::tuple<GLuint, BaseBindings> GetProgramHandle(const ProgramVariant& variant);
+ GLuint GetHandle(const ProgramVariant& variant);
private:
struct LockerVariant {
@@ -94,11 +95,11 @@ private:
std::unordered_map<ProgramVariant, CachedProgram> programs;
};
- explicit CachedShader(const ShaderParameters& params, ProgramType program_type,
+ explicit CachedShader(const ShaderParameters& params, Tegra::Engines::ShaderType shader_type,
GLShader::ShaderEntries entries, ProgramCode program_code,
ProgramCode program_code_b);
- void UpdateVariant();
+ bool EnsureValidLockerVariant();
ShaderDiskCacheUsage GetUsage(const ProgramVariant& variant,
const VideoCommon::Shader::ConstBufferLocker& locker) const;
@@ -110,14 +111,14 @@ private:
VAddr cpu_addr{};
u64 unique_identifier{};
- ProgramType program_type{};
+ Tegra::Engines::ShaderType shader_type{};
GLShader::ShaderEntries entries;
- ProgramCode program_code;
- ProgramCode program_code_b;
+ ProgramCode code;
+ ProgramCode code_b;
- LockerVariant* curr_variant = nullptr;
+ LockerVariant* curr_locker_variant = nullptr;
std::vector<std::unique_ptr<LockerVariant>> locker_variants;
};