forked from ShuriZma/suyu
1
0
Fork 0

Merge pull request #10234 from Kelebek1/clouds_depth

Fix Tears of the Kingdom flickering clouds and depths geometry.
This commit is contained in:
liamwhite 2023-05-15 12:03:31 -04:00 committed by GitHub
commit 736a31e4ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 12 deletions

View File

@ -339,9 +339,7 @@ Id EmitGetAttribute(EmitContext& ctx, IR::Attribute attr, Id vertex) {
if (ctx.profile.support_vertex_instance_id) { if (ctx.profile.support_vertex_instance_id) {
return ctx.OpBitcast(ctx.F32[1], ctx.OpLoad(ctx.U32[1], ctx.vertex_id)); return ctx.OpBitcast(ctx.F32[1], ctx.OpLoad(ctx.U32[1], ctx.vertex_id));
} else { } else {
const Id index{ctx.OpLoad(ctx.U32[1], ctx.vertex_index)}; return ctx.OpBitcast(ctx.F32[1], ctx.OpLoad(ctx.U32[1], ctx.vertex_index));
const Id base{ctx.OpLoad(ctx.U32[1], ctx.base_vertex)};
return ctx.OpBitcast(ctx.F32[1], ctx.OpISub(ctx.U32[1], index, base));
} }
case IR::Attribute::BaseInstance: case IR::Attribute::BaseInstance:
return ctx.OpBitcast(ctx.F32[1], ctx.OpLoad(ctx.U32[1], ctx.base_instance)); return ctx.OpBitcast(ctx.F32[1], ctx.OpLoad(ctx.U32[1], ctx.base_instance));
@ -386,9 +384,7 @@ Id EmitGetAttributeU32(EmitContext& ctx, IR::Attribute attr, Id) {
if (ctx.profile.support_vertex_instance_id) { if (ctx.profile.support_vertex_instance_id) {
return ctx.OpLoad(ctx.U32[1], ctx.vertex_id); return ctx.OpLoad(ctx.U32[1], ctx.vertex_id);
} else { } else {
const Id index{ctx.OpLoad(ctx.U32[1], ctx.vertex_index)}; return ctx.OpLoad(ctx.U32[1], ctx.vertex_index);
const Id base{ctx.OpLoad(ctx.U32[1], ctx.base_vertex)};
return ctx.OpISub(ctx.U32[1], index, base);
} }
case IR::Attribute::BaseInstance: case IR::Attribute::BaseInstance:
return ctx.OpLoad(ctx.U32[1], ctx.base_instance); return ctx.OpLoad(ctx.U32[1], ctx.base_instance);

View File

@ -102,12 +102,7 @@ void Impl(TranslatorVisitor& v, u64 insn, bool is_bindless) {
} }
IR::F32 value{v.ir.CompositeExtract(sample, element)}; IR::F32 value{v.ir.CompositeExtract(sample, element)};
if (element < 2) { if (element < 2) {
IR::U32 casted_value; IR::U32 casted_value = v.ir.ConvertFToU(32, value);
if (element == 0) {
casted_value = v.ir.ConvertFToU(32, value);
} else {
casted_value = v.ir.ConvertFToS(16, value);
}
v.X(dest_reg, v.ir.ShiftLeftLogical(casted_value, v.ir.Imm32(8))); v.X(dest_reg, v.ir.ShiftLeftLogical(casted_value, v.ir.Imm32(8)));
} else { } else {
v.F(dest_reg, value); v.F(dest_reg, value);