diff options
| author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-02-08 02:54:35 -0300 |
|---|---|---|
| committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-22 21:51:22 -0400 |
| commit | 5ee600cf641ae039f497dfee0feb41af2db3e6b5 (patch) | |
| tree | ec4aa48062f8a2fcba31b1c64f769ddf25a87832 /src/shader_recompiler/backend/spirv/emit_spirv_control_flow.cpp | |
| parent | 8e9207253c61ad0ada030002c00845939aabf1b1 (diff) | |
spirv: Initial SPIR-V support
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_spirv_control_flow.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_control_flow.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_control_flow.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_control_flow.cpp new file mode 100644 index 0000000000..770fe113c8 --- /dev/null +++ b/src/shader_recompiler/backend/spirv/emit_spirv_control_flow.cpp @@ -0,0 +1,30 @@ +// Copyright 2021 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "shader_recompiler/backend/spirv/emit_spirv.h" + +namespace Shader::Backend::SPIRV { + +void EmitSPIRV::EmitBranch(EmitContext& ctx, IR::Inst* inst) { + ctx.OpBranch(ctx.BlockLabel(inst->Arg(0).Label())); +} + +void EmitSPIRV::EmitBranchConditional(EmitContext& ctx, IR::Inst* inst) { + ctx.OpBranchConditional(ctx.Def(inst->Arg(0)), ctx.BlockLabel(inst->Arg(1).Label()), + ctx.BlockLabel(inst->Arg(2).Label())); +} + +void EmitSPIRV::EmitExit(EmitContext& ctx) { + ctx.OpReturn(); +} + +void EmitSPIRV::EmitReturn(EmitContext&) { + throw NotImplementedException("SPIR-V Instruction"); +} + +void EmitSPIRV::EmitUnreachable(EmitContext&) { + throw NotImplementedException("SPIR-V Instruction"); +} + +} // namespace Shader::Backend::SPIRV |
