diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-06-20 21:02:53 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-06-21 02:38:34 +0200 |
commit | 51ba60b27e54beec476416cd0c7334110bcdb274 (patch) | |
tree | 188677f8edf3f463e82a31324db89ab358e87d89 /src/video_core | |
parent | texture_cache: Eliminate linear textures fallthrough (diff) | |
download | yuzu-51ba60b27e54beec476416cd0c7334110bcdb274.tar yuzu-51ba60b27e54beec476416cd0c7334110bcdb274.tar.gz yuzu-51ba60b27e54beec476416cd0c7334110bcdb274.tar.bz2 yuzu-51ba60b27e54beec476416cd0c7334110bcdb274.tar.lz yuzu-51ba60b27e54beec476416cd0c7334110bcdb274.tar.xz yuzu-51ba60b27e54beec476416cd0c7334110bcdb274.tar.zst yuzu-51ba60b27e54beec476416cd0c7334110bcdb274.zip |
Diffstat (limited to 'src/video_core')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_cache.cpp | 7 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_disk_cache.cpp | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp index 67789db73..02e217b8c 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp @@ -103,15 +103,20 @@ constexpr std::tuple<const char*, const char*, u32> GetPrimitiveDescription(GLen /// Calculates the size of a program stream std::size_t CalculateProgramSize(const GLShader::ProgramCode& program) { constexpr std::size_t start_offset = 10; + constexpr u64 key = 0xE2400FFFFF07000FULL; + constexpr u64 mask =0xFFFFFFFFFF7FFFFFULL; std::size_t offset = start_offset; std::size_t size = start_offset * sizeof(u64); while (offset < program.size()) { const u64 instruction = program[offset]; if (!IsSchedInstruction(offset, start_offset)) { - if (instruction == 0 || (instruction >> 52) == 0x50b) { + if ((instruction & mask) == key) { // End on Maxwell's "nop" instruction break; } + if (instruction == 0) { + break; + } } size += sizeof(u64); offset++; diff --git a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp index 5ec911adc..922c72590 100644 --- a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp @@ -34,7 +34,7 @@ enum class PrecompiledEntryKind : u32 { Dump, }; -constexpr u32 NativeVersion = 3; +constexpr u32 NativeVersion = 4; // Making sure sizes doesn't change by accident static_assert(sizeof(BaseBindings) == 16); |