diff options
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_spirv.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.cpp b/src/shader_recompiler/backend/spirv/emit_spirv.cpp index 5022b5159..e29e448c7 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv.cpp | |||
| @@ -25,6 +25,9 @@ EmitContext::EmitContext(IR::Program& program) { | |||
| 25 | f16.Define(*this, TypeFloat(16), "f16"); | 25 | f16.Define(*this, TypeFloat(16), "f16"); |
| 26 | f64.Define(*this, TypeFloat(64), "f64"); | 26 | f64.Define(*this, TypeFloat(64), "f64"); |
| 27 | 27 | ||
| 28 | true_value = ConstantTrue(u1); | ||
| 29 | false_value = ConstantFalse(u1); | ||
| 30 | |||
| 28 | for (const IR::Function& function : program.functions) { | 31 | for (const IR::Function& function : program.functions) { |
| 29 | for (IR::Block* const block : function.blocks) { | 32 | for (IR::Block* const block : function.blocks) { |
| 30 | block_label_map.emplace_back(block, OpLabel()); | 33 | block_label_map.emplace_back(block, OpLabel()); |
| @@ -58,6 +61,7 @@ EmitSPIRV::EmitSPIRV(IR::Program& program) { | |||
| 58 | std::fclose(file); | 61 | std::fclose(file); |
| 59 | std::system("spirv-dis shader.spv"); | 62 | std::system("spirv-dis shader.spv"); |
| 60 | std::system("spirv-val shader.spv"); | 63 | std::system("spirv-val shader.spv"); |
| 64 | std::system("spirv-cross shader.spv"); | ||
| 61 | } | 65 | } |
| 62 | 66 | ||
| 63 | template <auto method> | 67 | template <auto method> |
| @@ -109,6 +113,8 @@ static Id TypeId(const EmitContext& ctx, IR::Type type) { | |||
| 109 | switch (type) { | 113 | switch (type) { |
| 110 | case IR::Type::U1: | 114 | case IR::Type::U1: |
| 111 | return ctx.u1; | 115 | return ctx.u1; |
| 116 | case IR::Type::U32: | ||
| 117 | return ctx.u32[1]; | ||
| 112 | default: | 118 | default: |
| 113 | throw NotImplementedException("Phi node type {}", type); | 119 | throw NotImplementedException("Phi node type {}", type); |
| 114 | } | 120 | } |