diff options
| author | 2021-05-18 02:04:22 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:32 -0400 | |
| commit | 9bb3e008c9f4bbdd35c095b506c3a3312d17e383 (patch) | |
| tree | 320cc594970b6ef658d8bed88ceabded0f84caea /src/shader_recompiler/backend/spirv | |
| parent | glasm: Implement InstanceId and VertexId (diff) | |
| download | yuzu-9bb3e008c9f4bbdd35c095b506c3a3312d17e383.tar.gz yuzu-9bb3e008c9f4bbdd35c095b506c3a3312d17e383.tar.xz yuzu-9bb3e008c9f4bbdd35c095b506c3a3312d17e383.zip | |
shader: Read branch conditions from an instruction
Fixes the identity removal pass.
Diffstat (limited to 'src/shader_recompiler/backend/spirv')
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv.cpp | 10 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_instructions.h | 3 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.cpp b/src/shader_recompiler/backend/spirv/emit_spirv.cpp index 9ed2af991..3e20ac3b9 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv.cpp | |||
| @@ -469,7 +469,15 @@ Id EmitIdentity(EmitContext& ctx, const IR::Value& value) { | |||
| 469 | return id; | 469 | return id; |
| 470 | } | 470 | } |
| 471 | 471 | ||
| 472 | void EmitDummyReference(EmitContext&) {} | 472 | Id EmitConditionRef(EmitContext& ctx, const IR::Value& value) { |
| 473 | const Id id{ctx.Def(value)}; | ||
| 474 | if (!Sirit::ValidId(id)) { | ||
| 475 | throw NotImplementedException("Forward identity declaration"); | ||
| 476 | } | ||
| 477 | return id; | ||
| 478 | } | ||
| 479 | |||
| 480 | void EmitReference(EmitContext&) {} | ||
| 473 | 481 | ||
| 474 | void EmitPhiMove(EmitContext&) { | 482 | void EmitPhiMove(EmitContext&) { |
| 475 | throw LogicError("Unreachable instruction"); | 483 | throw LogicError("Unreachable instruction"); |
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h b/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h index 22260d2a9..1181e7b4f 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h +++ b/src/shader_recompiler/backend/spirv/emit_spirv_instructions.h | |||
| @@ -23,7 +23,8 @@ class EmitContext; | |||
| 23 | Id EmitPhi(EmitContext& ctx, IR::Inst* inst); | 23 | Id EmitPhi(EmitContext& ctx, IR::Inst* inst); |
| 24 | void EmitVoid(EmitContext& ctx); | 24 | void EmitVoid(EmitContext& ctx); |
| 25 | Id EmitIdentity(EmitContext& ctx, const IR::Value& value); | 25 | Id EmitIdentity(EmitContext& ctx, const IR::Value& value); |
| 26 | void EmitDummyReference(EmitContext&); | 26 | Id EmitConditionRef(EmitContext& ctx, const IR::Value& value); |
| 27 | void EmitReference(EmitContext&); | ||
| 27 | void EmitPhiMove(EmitContext&); | 28 | void EmitPhiMove(EmitContext&); |
| 28 | void EmitJoin(EmitContext& ctx); | 29 | void EmitJoin(EmitContext& ctx); |
| 29 | void EmitDemoteToHelperInvocation(EmitContext& ctx); | 30 | void EmitDemoteToHelperInvocation(EmitContext& ctx); |