mirror of
https://github.com/yuzu-emu/yuzu-android
synced 2024-12-25 20:51:20 -08:00
Merge pull request #1893 from lioncash/warn
gl_shader_cache: Resolve truncation compiler warning
This commit is contained in:
commit
e1f28afb98
@ -145,7 +145,7 @@ GLuint CachedShader::LazyGeometryProgram(OGLProgram& target_program,
|
|||||||
return target_program.handle;
|
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.
|
// sched instructions appear once every 4 instructions.
|
||||||
static constexpr std::size_t SchedPeriod = 4;
|
static constexpr std::size_t SchedPeriod = 4;
|
||||||
const std::size_t absolute_offset = offset - main_offset;
|
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) {
|
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 offset = start_offset;
|
||||||
std::size_t size = start_offset * sizeof(u64);
|
std::size_t size = start_offset * sizeof(u64);
|
||||||
while (offset < program.size()) {
|
while (offset < program.size()) {
|
||||||
@ -163,7 +163,7 @@ static std::size_t CalculateProgramSize(const GLShader::ProgramCode& program) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
size += 8;
|
size += sizeof(inst);
|
||||||
offset++;
|
offset++;
|
||||||
}
|
}
|
||||||
return size;
|
return size;
|
||||||
|
Loading…
Reference in New Issue
Block a user