summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-03-14 07:41:05 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:23 +0200
commit71f96fa6366dc6dd306a953bca1b958fb32bc55a (patch)
tree12e13f9502e4b9510446c967a831e5d4bacb729e /src/shader_recompiler/backend
parentspirv: Add SignedZeroInfNanPreserve logic (diff)
downloadyuzu-71f96fa6366dc6dd306a953bca1b958fb32bc55a.tar
yuzu-71f96fa6366dc6dd306a953bca1b958fb32bc55a.tar.gz
yuzu-71f96fa6366dc6dd306a953bca1b958fb32bc55a.tar.bz2
yuzu-71f96fa6366dc6dd306a953bca1b958fb32bc55a.tar.lz
yuzu-71f96fa6366dc6dd306a953bca1b958fb32bc55a.tar.xz
yuzu-71f96fa6366dc6dd306a953bca1b958fb32bc55a.tar.zst
yuzu-71f96fa6366dc6dd306a953bca1b958fb32bc55a.zip
Diffstat (limited to 'src/shader_recompiler/backend')
-rw-r--r--src/shader_recompiler/backend/spirv/emit_context.cpp6
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv.cpp17
2 files changed, 8 insertions, 15 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_context.cpp b/src/shader_recompiler/backend/spirv/emit_context.cpp
index 278b26b50..f848c6175 100644
--- a/src/shader_recompiler/backend/spirv/emit_context.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_context.cpp
@@ -262,10 +262,8 @@ void EmitContext::DefineTextures(const Info& info, u32& binding) {
}
void EmitContext::DefineLabels(IR::Program& program) {
- for (const IR::Function& function : program.functions) {
- for (IR::Block* const block : function.blocks) {
- block->SetDefinition(OpLabel());
- }
+ for (IR::Block* const block : program.blocks) {
+ block->SetDefinition(OpLabel());
}
}
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.cpp b/src/shader_recompiler/backend/spirv/emit_spirv.cpp
index c7cba6279..7e7db9161 100644
--- a/src/shader_recompiler/backend/spirv/emit_spirv.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_spirv.cpp
@@ -10,7 +10,6 @@
#include "shader_recompiler/backend/spirv/emit_spirv.h"
#include "shader_recompiler/frontend/ir/basic_block.h"
-#include "shader_recompiler/frontend/ir/function.h"
#include "shader_recompiler/frontend/ir/microinstruction.h"
#include "shader_recompiler/frontend/ir/program.h"
@@ -199,18 +198,14 @@ Id PhiArgDef(EmitContext& ctx, IR::Inst* inst, size_t index) {
std::vector<u32> EmitSPIRV(const Profile& profile, Environment& env, IR::Program& program) {
EmitContext ctx{profile, program};
const Id void_function{ctx.TypeFunction(ctx.void_id)};
- // FIXME: Forward declare functions (needs sirit support)
- Id func{};
- for (IR::Function& function : program.functions) {
- func = ctx.OpFunction(ctx.void_id, spv::FunctionControlMask::MaskNone, void_function);
- for (IR::Block* const block : function.blocks) {
- ctx.AddLabel(block->Definition<Id>());
- for (IR::Inst& inst : block->Instructions()) {
- EmitInst(ctx, &inst);
- }
+ const Id func{ctx.OpFunction(ctx.void_id, spv::FunctionControlMask::MaskNone, void_function)};
+ for (IR::Block* const block : program.blocks) {
+ ctx.AddLabel(block->Definition<Id>());
+ for (IR::Inst& inst : block->Instructions()) {
+ EmitInst(ctx, &inst);
}
- ctx.OpFunctionEnd();
}
+ ctx.OpFunctionEnd();
boost::container::small_vector<Id, 32> interfaces;
const Info& info{program.info};
if (info.uses_workgroup_id) {