diff options
| author | 2018-12-11 20:47:10 -0500 | |
|---|---|---|
| committer | 2018-12-11 20:47:10 -0500 | |
| commit | e1f28afb98b9005df3e12d61007aa18b1da7b6af (patch) | |
| tree | 50eb0316213a37baedf94f494a857ec56e0597c6 /src | |
| parent | Merge pull request #1895 from lioncash/uninit (diff) | |
| parent | gl_shader_cache: Dehardcode constant in CalculateProgramSize() (diff) | |
| download | yuzu-e1f28afb98b9005df3e12d61007aa18b1da7b6af.tar.gz yuzu-e1f28afb98b9005df3e12d61007aa18b1da7b6af.tar.xz yuzu-e1f28afb98b9005df3e12d61007aa18b1da7b6af.zip | |
Merge pull request #1893 from lioncash/warn
gl_shader_cache: Resolve truncation compiler warning
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_cache.cpp | 6 |
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, | |||
| 145 | return target_program.handle; | 145 | return target_program.handle; |
| 146 | }; | 146 | }; |
| 147 | 147 | ||
| 148 | static bool IsSchedInstruction(u32 offset, u32 main_offset) { | 148 | static bool IsSchedInstruction(std::size_t offset, std::size_t main_offset) { |
| 149 | // sched instructions appear once every 4 instructions. | 149 | // sched instructions appear once every 4 instructions. |
| 150 | static constexpr std::size_t SchedPeriod = 4; | 150 | static constexpr std::size_t SchedPeriod = 4; |
| 151 | const std::size_t absolute_offset = offset - main_offset; | 151 | const std::size_t absolute_offset = offset - main_offset; |
| @@ -153,7 +153,7 @@ static bool IsSchedInstruction(u32 offset, u32 main_offset) { | |||
| 153 | } | 153 | } |
| 154 | 154 | ||
| 155 | static std::size_t CalculateProgramSize(const GLShader::ProgramCode& program) { | 155 | static std::size_t CalculateProgramSize(const GLShader::ProgramCode& program) { |
| 156 | const std::size_t start_offset = 10; | 156 | constexpr std::size_t start_offset = 10; |
| 157 | std::size_t offset = start_offset; | 157 | std::size_t offset = start_offset; |
| 158 | std::size_t size = start_offset * sizeof(u64); | 158 | std::size_t size = start_offset * sizeof(u64); |
| 159 | while (offset < program.size()) { | 159 | while (offset < program.size()) { |
| @@ -163,7 +163,7 @@ static std::size_t CalculateProgramSize(const GLShader::ProgramCode& program) { | |||
| 163 | break; | 163 | break; |
| 164 | } | 164 | } |
| 165 | } | 165 | } |
| 166 | size += 8; | 166 | size += sizeof(inst); |
| 167 | offset++; | 167 | offset++; |
| 168 | } | 168 | } |
| 169 | return size; | 169 | return size; |