diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-08-31 08:03:35 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-09-04 06:54:00 +0200 |
commit | 9cf52d027d5c1bc1bde71cd6c18b3646b102e7a1 (patch) | |
tree | c8bd026b5ab2596e9f758144f7bee3d0786fa5b2 /src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |
parent | gl_shader_decompiler: Fixup AMD's slow path type (diff) | |
download | yuzu-9cf52d027d5c1bc1bde71cd6c18b3646b102e7a1.tar yuzu-9cf52d027d5c1bc1bde71cd6c18b3646b102e7a1.tar.gz yuzu-9cf52d027d5c1bc1bde71cd6c18b3646b102e7a1.tar.bz2 yuzu-9cf52d027d5c1bc1bde71cd6c18b3646b102e7a1.tar.lz yuzu-9cf52d027d5c1bc1bde71cd6c18b3646b102e7a1.tar.xz yuzu-9cf52d027d5c1bc1bde71cd6c18b3646b102e7a1.tar.zst yuzu-9cf52d027d5c1bc1bde71cd6c18b3646b102e7a1.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 9e050347a..50aa73d0e 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -957,8 +957,15 @@ private: if (!IsPrecise(operation)) { return {std::move(value), type}; } + // Old Nvidia drivers have a bug with precise and texture sampling. These are more likely to + // be found in fragment shaders, so we disable precise there. There are vertex shaders that + // also fail to build but nobody seems to care about those. + // Note: Only bugged drivers will skip precise. + const bool disable_precise = device.HasPreciseBug() && stage == ProgramType::Fragment; + std::string temporary = code.GenerateTemporary(); - code.AddLine("precise {} {} = {};", GetTypeString(type), temporary, value); + code.AddLine("{}{} {} = {};", disable_precise ? "" : "precise ", GetTypeString(type), + temporary, value); return {std::move(temporary), type}; } |