diff options
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_glsl.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/glsl/emit_glsl.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl.cpp b/src/shader_recompiler/backend/glsl/emit_glsl.cpp index 6d64913bb..9f8cf659f 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl.cpp +++ b/src/shader_recompiler/backend/glsl/emit_glsl.cpp | |||
| @@ -156,8 +156,7 @@ void EmitCode(EmitContext& ctx, const IR::Program& program) { | |||
| 156 | ctx.Add("for(;;){{"); | 156 | ctx.Add("for(;;){{"); |
| 157 | break; | 157 | break; |
| 158 | case IR::AbstractSyntaxNode::Type::Repeat: | 158 | case IR::AbstractSyntaxNode::Type::Repeat: |
| 159 | ctx.Add("if({}){{continue;}}else{{break;}}}}", | 159 | ctx.Add("if(!{}){{break;}}}}", ctx.var_alloc.Consume(node.data.repeat.cond)); |
| 160 | ctx.var_alloc.Consume(node.data.repeat.cond)); | ||
| 161 | break; | 160 | break; |
| 162 | default: | 161 | default: |
| 163 | throw NotImplementedException("AbstractSyntaxNode Type {}", node.type); | 162 | throw NotImplementedException("AbstractSyntaxNode Type {}", node.type); |
| @@ -166,7 +165,7 @@ void EmitCode(EmitContext& ctx, const IR::Program& program) { | |||
| 166 | } | 165 | } |
| 167 | 166 | ||
| 168 | std::string GlslVersionSpecifier(const EmitContext& ctx) { | 167 | std::string GlslVersionSpecifier(const EmitContext& ctx) { |
| 169 | if (ctx.uses_y_direction || ctx.info.stores_legacy_varyings) { | 168 | if (ctx.uses_y_direction || ctx.info.stores_legacy_varyings || ctx.info.loads_legacy_varyings) { |
| 170 | return " compatibility"; | 169 | return " compatibility"; |
| 171 | } | 170 | } |
| 172 | return ""; | 171 | return ""; |
| @@ -187,7 +186,8 @@ void DefineVariables(const EmitContext& ctx, std::string& header) { | |||
| 187 | const auto type{static_cast<GlslVarType>(i)}; | 186 | const auto type{static_cast<GlslVarType>(i)}; |
| 188 | const auto& tracker{ctx.var_alloc.GetUseTracker(type)}; | 187 | const auto& tracker{ctx.var_alloc.GetUseTracker(type)}; |
| 189 | const auto type_name{ctx.var_alloc.GetGlslType(type)}; | 188 | const auto type_name{ctx.var_alloc.GetGlslType(type)}; |
| 190 | const auto precise{IsPreciseType(type) ? "precise " : ""}; | 189 | const bool has_precise_bug{ctx.stage == Stage::Fragment && ctx.profile.has_gl_precise_bug}; |
| 190 | const auto precise{!has_precise_bug && IsPreciseType(type) ? "precise " : ""}; | ||
| 191 | // Temps/return types that are never used are stored at index 0 | 191 | // Temps/return types that are never used are stored at index 0 |
| 192 | if (tracker.uses_temp) { | 192 | if (tracker.uses_temp) { |
| 193 | header += fmt::format("{}{} t{}={}(0);", precise, type_name, | 193 | header += fmt::format("{}{} t{}={}(0);", precise, type_name, |