mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-10 20:48:10 -05:00
shader: Misc fixes
This commit is contained in:
@ -25,6 +25,9 @@ EmitContext::EmitContext(IR::Program& program) {
|
||||
f16.Define(*this, TypeFloat(16), "f16");
|
||||
f64.Define(*this, TypeFloat(64), "f64");
|
||||
|
||||
true_value = ConstantTrue(u1);
|
||||
false_value = ConstantFalse(u1);
|
||||
|
||||
for (const IR::Function& function : program.functions) {
|
||||
for (IR::Block* const block : function.blocks) {
|
||||
block_label_map.emplace_back(block, OpLabel());
|
||||
@ -58,6 +61,7 @@ EmitSPIRV::EmitSPIRV(IR::Program& program) {
|
||||
std::fclose(file);
|
||||
std::system("spirv-dis shader.spv");
|
||||
std::system("spirv-val shader.spv");
|
||||
std::system("spirv-cross shader.spv");
|
||||
}
|
||||
|
||||
template <auto method>
|
||||
@ -109,6 +113,8 @@ static Id TypeId(const EmitContext& ctx, IR::Type type) {
|
||||
switch (type) {
|
||||
case IR::Type::U1:
|
||||
return ctx.u1;
|
||||
case IR::Type::U32:
|
||||
return ctx.u32[1];
|
||||
default:
|
||||
throw NotImplementedException("Phi node type {}", type);
|
||||
}
|
||||
|
@ -79,6 +79,8 @@ public:
|
||||
return def_map.Consume(value.Inst());
|
||||
}
|
||||
switch (value.Type()) {
|
||||
case IR::Type::U1:
|
||||
return value.U1() ? true_value : false_value;
|
||||
case IR::Type::U32:
|
||||
return Constant(u32[1], value.U32());
|
||||
case IR::Type::F32:
|
||||
@ -108,6 +110,9 @@ public:
|
||||
VectorTypes f16;
|
||||
VectorTypes f64;
|
||||
|
||||
Id true_value{};
|
||||
Id false_value{};
|
||||
|
||||
Id workgroup_id{};
|
||||
Id local_invocation_id{};
|
||||
|
||||
|
Reference in New Issue
Block a user