Преглед изворни кода

gl_shader_cache: Disable fastmath on Nvidia

ReinUsesLisp пре 6 година
родитељ
комит
3ce28342a2
1 измењених фајлова са 4 додато и 0 уклоњено
  1. 4 0
      src/video_core/renderer_opengl/gl_shader_cache.cpp

+ 4 - 0
src/video_core/renderer_opengl/gl_shader_cache.cpp

@@ -260,6 +260,10 @@ CachedProgram BuildShader(const Device& device, u64 unique_identifier, ShaderTyp
                   "#extension GL_NV_shader_thread_group : require\n"
                   "#extension GL_NV_shader_thread_shuffle : require\n";
     }
+    // This pragma stops Nvidia's driver from over optimizing math (probably using fp16 operations)
+    // on places where we don't want to.
+    // Thanks to Ryujinx for finding this workaround.
+    source += "#pragma optionNV(fastmath off)\n";
 
     if (shader_type == ShaderType::Geometry) {
         const auto [glsl_topology, max_vertices] = GetPrimitiveDescription(variant.primitive_mode);