summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-12-12 02:47:10 +0100
committerGitHub <noreply@github.com>2018-12-12 02:47:10 +0100
commite1f28afb98b9005df3e12d61007aa18b1da7b6af (patch)
tree50eb0316213a37baedf94f494a857ec56e0597c6 /src/video_core
parentMerge pull request #1895 from lioncash/uninit (diff)
parentgl_shader_cache: Dehardcode constant in CalculateProgramSize() (diff)
downloadyuzu-e1f28afb98b9005df3e12d61007aa18b1da7b6af.tar
yuzu-e1f28afb98b9005df3e12d61007aa18b1da7b6af.tar.gz
yuzu-e1f28afb98b9005df3e12d61007aa18b1da7b6af.tar.bz2
yuzu-e1f28afb98b9005df3e12d61007aa18b1da7b6af.tar.lz
yuzu-e1f28afb98b9005df3e12d61007aa18b1da7b6af.tar.xz
yuzu-e1f28afb98b9005df3e12d61007aa18b1da7b6af.tar.zst
yuzu-e1f28afb98b9005df3e12d61007aa18b1da7b6af.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_cache.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp
index a4265f498..aea6bf1af 100644
--- a/src/video_core/renderer_opengl/gl_shader_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp
@@ -145,7 +145,7 @@ GLuint CachedShader::LazyGeometryProgram(OGLProgram& target_program,
return target_program.handle;
};
-static bool IsSchedInstruction(u32 offset, u32 main_offset) {
+static bool IsSchedInstruction(std::size_t offset, std::size_t main_offset) {
// sched instructions appear once every 4 instructions.
static constexpr std::size_t SchedPeriod = 4;
const std::size_t absolute_offset = offset - main_offset;
@@ -153,7 +153,7 @@ static bool IsSchedInstruction(u32 offset, u32 main_offset) {
}
static std::size_t CalculateProgramSize(const GLShader::ProgramCode& program) {
- const std::size_t start_offset = 10;
+ constexpr std::size_t start_offset = 10;
std::size_t offset = start_offset;
std::size_t size = start_offset * sizeof(u64);
while (offset < program.size()) {
@@ -163,7 +163,7 @@ static std::size_t CalculateProgramSize(const GLShader::ProgramCode& program) {
break;
}
}
- size += 8;
+ size += sizeof(inst);
offset++;
}
return size;