summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/glsl/emit_glsl_not_implemented.cpp
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-05-27 03:18:17 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:36 +0200
commitd171083d53e106c8c5131522fdc81d51360c562d (patch)
tree282cbd1306616e969166e9ddc926bc51c1c15803 /src/shader_recompiler/backend/glsl/emit_glsl_not_implemented.cpp
parentglsl: Implement some attribute getters and setters (diff)
downloadyuzu-d171083d53e106c8c5131522fdc81d51360c562d.tar
yuzu-d171083d53e106c8c5131522fdc81d51360c562d.tar.gz
yuzu-d171083d53e106c8c5131522fdc81d51360c562d.tar.bz2
yuzu-d171083d53e106c8c5131522fdc81d51360c562d.tar.lz
yuzu-d171083d53e106c8c5131522fdc81d51360c562d.tar.xz
yuzu-d171083d53e106c8c5131522fdc81d51360c562d.tar.zst
yuzu-d171083d53e106c8c5131522fdc81d51360c562d.zip
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_glsl_not_implemented.cpp')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_not_implemented.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_not_implemented.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_not_implemented.cpp
index 14a2edd74..42b1e8764 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_not_implemented.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_not_implemented.cpp
@@ -39,17 +39,26 @@ void EmitReference(EmitContext&) {
}
void EmitPhiMove(EmitContext& ctx, const IR::Value& phi_value, const IR::Value& value) {
- IR::Inst& phi{RegAlloc::AliasInst(*phi_value.Inst())};
+ IR::Inst& phi{*phi_value.InstRecursive()};
+ const auto phi_type{phi.Arg(0).Type()};
if (!phi.Definition<Id>().is_valid) {
// The phi node wasn't forward defined
- ctx.Add("{};", ctx.reg_alloc.Define(phi, phi.Arg(0).Type()));
+ ctx.Add("{};", ctx.reg_alloc.Define(phi, phi_type));
}
const auto phi_reg{ctx.reg_alloc.Consume(IR::Value{&phi})};
const auto val_reg{ctx.reg_alloc.Consume(value)};
if (phi_reg == val_reg) {
return;
}
- ctx.Add("{}={};", phi_reg, val_reg);
+ if (phi_type == value.Type()) {
+ ctx.Add("{}={}; // PHI MOVE", phi_reg, val_reg);
+ } else if (phi_type == IR::Type::U32 && value.Type() == IR::Type::F32) {
+ ctx.Add("{}=floatBitsToUint({}); // CAST PHI MOVE", phi_reg, val_reg);
+ } else {
+ throw NotImplementedException("{} to {} move", phi_type, value.Type());
+ const auto cast{ctx.reg_alloc.GetGlslType(phi_type)};
+ ctx.Add("{}={}({}); // CAST PHI MOVE", phi_reg, cast, val_reg);
+ }
}
void EmitBranch(EmitContext& ctx, std::string_view label) {
@@ -235,23 +244,23 @@ void EmitWriteLocal(EmitContext& ctx, std::string_view word_offset, std::string_
NotImplemented();
}
-void EmitUndefU1(EmitContext& ctx) {
+void EmitUndefU1(EmitContext& ctx, IR::Inst& inst) {
NotImplemented();
}
-void EmitUndefU8(EmitContext& ctx) {
+void EmitUndefU8(EmitContext& ctx, IR::Inst& inst) {
NotImplemented();
}
-void EmitUndefU16(EmitContext& ctx) {
+void EmitUndefU16(EmitContext& ctx, IR::Inst& inst) {
NotImplemented();
}
-void EmitUndefU32(EmitContext& ctx) {
- NotImplemented();
+void EmitUndefU32(EmitContext& ctx, IR::Inst& inst) {
+ ctx.AddU32("{}=0u;", inst);
}
-void EmitUndefU64(EmitContext& ctx) {
+void EmitUndefU64(EmitContext& ctx, IR::Inst& inst) {
NotImplemented();
}