summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-05-26 04:13:50 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:36 +0200
commit5399906c26292634ab3eec5fce88640092e9c4c2 (patch)
tree1205e3116c0592a42a4ad5173cbf9716372489ac /src/shader_recompiler/backend
parentglsl: Update phi node management (diff)
downloadyuzu-5399906c26292634ab3eec5fce88640092e9c4c2.tar
yuzu-5399906c26292634ab3eec5fce88640092e9c4c2.tar.gz
yuzu-5399906c26292634ab3eec5fce88640092e9c4c2.tar.bz2
yuzu-5399906c26292634ab3eec5fce88640092e9c4c2.tar.lz
yuzu-5399906c26292634ab3eec5fce88640092e9c4c2.tar.xz
yuzu-5399906c26292634ab3eec5fce88640092e9c4c2.tar.zst
yuzu-5399906c26292634ab3eec5fce88640092e9c4c2.zip
Diffstat (limited to 'src/shader_recompiler/backend')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_context.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_context.cpp b/src/shader_recompiler/backend/glsl/emit_context.cpp
index 6f769fa10..7b6c6d22b 100644
--- a/src/shader_recompiler/backend/glsl/emit_context.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_context.cpp
@@ -110,9 +110,12 @@ void EmitContext::DefineHelperFunctions() {
code += "uint CasFloatMax16x2(uint op_a,f16vec2 op_b){return "
"packFloat2x16(max(unpackFloat2x16(op_a),op_b));}\n";
}
- // TODO: Track this usage
- code += "uint CasMinS32(uint op_a,uint op_b){return uint(min(int(op_a),int(op_b)));}";
- code += "uint CasMaxS32(uint op_a,uint op_b){return uint(max(int(op_a),int(op_b)));}";
+ if (info.uses_atomic_s32_min) {
+ code += "uint CasMinS32(uint op_a,uint op_b){return uint(min(int(op_a),int(op_b)));}";
+ }
+ if (info.uses_atomic_s32_max) {
+ code += "uint CasMaxS32(uint op_a,uint op_b){return uint(max(int(op_a),int(op_b)));}";
+ }
}
} // namespace Shader::Backend::GLSL