diff options
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_context.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/glsl/emit_context.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_context.cpp b/src/shader_recompiler/backend/glsl/emit_context.cpp index a413219e3..9c3fd44ba 100644 --- a/src/shader_recompiler/backend/glsl/emit_context.cpp +++ b/src/shader_recompiler/backend/glsl/emit_context.cpp | |||
| @@ -78,32 +78,32 @@ void EmitContext::DefineHelperFunctions() { | |||
| 78 | "uint CasDecrement(uint op_a,uint op_b){return(op_a==0||op_a>op_b)?op_b:(op_a-1u);}\n"; | 78 | "uint CasDecrement(uint op_a,uint op_b){return(op_a==0||op_a>op_b)?op_b:(op_a-1u);}\n"; |
| 79 | } | 79 | } |
| 80 | if (info.uses_atomic_f32_add) { | 80 | if (info.uses_atomic_f32_add) { |
| 81 | code += "uint CasFloatAdd(uint op_a,uint op_b){return " | 81 | code += "uint CasFloatAdd(uint op_a,float op_b){return " |
| 82 | "floatBitsToUint(uintBitsToFloat(op_a)+uintBitsToFloat(op_b));}\n"; | 82 | "floatBitsToUint(uintBitsToFloat(op_a)+op_b);}\n"; |
| 83 | } | 83 | } |
| 84 | if (info.uses_atomic_f32x2_add) { | 84 | if (info.uses_atomic_f32x2_add) { |
| 85 | code += "uint CasFloatAdd32x2(uint op_a,uint op_b){return " | 85 | code += "uint CasFloatAdd32x2(uint op_a,vec2 op_b){return " |
| 86 | "packHalf2x16(unpackHalf2x16(op_a)+unpackHalf2x16(op_b));}\n"; | 86 | "packHalf2x16(unpackHalf2x16(op_a)+op_b);}\n"; |
| 87 | } | 87 | } |
| 88 | if (info.uses_atomic_f32x2_min) { | 88 | if (info.uses_atomic_f32x2_min) { |
| 89 | code += "uint CasFloatMin32x2(uint op_a,uint op_b){return " | 89 | code += "uint CasFloatMin32x2(uint op_a,vec2 op_b){return " |
| 90 | "packHalf2x16(min(unpackHalf2x16(op_a),unpackHalf2x16(op_b)));}\n"; | 90 | "packHalf2x16(min(unpackHalf2x16(op_a),op_b));}\n"; |
| 91 | } | 91 | } |
| 92 | if (info.uses_atomic_f32x2_max) { | 92 | if (info.uses_atomic_f32x2_max) { |
| 93 | code += "uint CasFloatMax32x2(uint op_a,uint op_b){return " | 93 | code += "uint CasFloatMax32x2(uint op_a,vec2 op_b){return " |
| 94 | "packHalf2x16(max(unpackHalf2x16(op_a),unpackHalf2x16(op_b)));}\n"; | 94 | "packHalf2x16(max(unpackHalf2x16(op_a),op_b));}\n"; |
| 95 | } | 95 | } |
| 96 | if (info.uses_atomic_f16x2_add) { | 96 | if (info.uses_atomic_f16x2_add) { |
| 97 | code += "uint CasFloatAdd16x2(uint op_a,uint op_b){return " | 97 | code += "uint CasFloatAdd16x2(uint op_a,f16vec2 op_b){return " |
| 98 | "packFloat2x16(unpackFloat2x16(op_a)+unpackFloat2x16(op_b));}\n"; | 98 | "packFloat2x16(unpackFloat2x16(op_a)+op_b);}\n"; |
| 99 | } | 99 | } |
| 100 | if (info.uses_atomic_f16x2_min) { | 100 | if (info.uses_atomic_f16x2_min) { |
| 101 | code += "uint CasFloatMin16x2(uint op_a,uint op_b){return " | 101 | code += "uint CasFloatMin16x2(uint op_a,f16vec2 op_b){return " |
| 102 | "packFloat2x16(min(unpackFloat2x16(op_a),unpackFloat2x16(op_b)));}\n"; | 102 | "packFloat2x16(min(unpackFloat2x16(op_a),op_b));}\n"; |
| 103 | } | 103 | } |
| 104 | if (info.uses_atomic_f16x2_max) { | 104 | if (info.uses_atomic_f16x2_max) { |
| 105 | code += "uint CasFloatMax16x2(uint op_a,uint op_b){return " | 105 | code += "uint CasFloatMax16x2(uint op_a,f16vec2 op_b){return " |
| 106 | "packFloat2x16(max(unpackFloat2x16(op_a),unpackFloat2x16(op_b)));}\n"; | 106 | "packFloat2x16(max(unpackFloat2x16(op_a),op_b));}\n"; |
| 107 | } | 107 | } |
| 108 | // TODO: Track this usage | 108 | // TODO: Track this usage |
| 109 | code += "uint CasMinS32(uint op_a,uint op_b){return uint(min(int(op_a),int(op_b)));}"; | 109 | code += "uint CasMinS32(uint op_a,uint op_b){return uint(min(int(op_a),int(op_b)));}"; |