mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-19 01:44:53 +00:00
shader_recompiler: Add more instructions and fix a few thinhs
This commit is contained in:
parent
728249f58d
commit
ae7e6dafd5
18 changed files with 245 additions and 78 deletions
|
@ -95,9 +95,14 @@ Id EmitGetAttribute(EmitContext& ctx, IR::Attribute attr, u32 comp) {
|
|||
}
|
||||
}
|
||||
switch (attr) {
|
||||
case IR::Attribute::FragCoord:
|
||||
return ctx.OpLoad(ctx.F32[1],
|
||||
ctx.OpAccessChain(ctx.input_f32, ctx.frag_coord, ctx.ConstU32(comp)));
|
||||
case IR::Attribute::FragCoord: {
|
||||
const Id coord = ctx.OpLoad(
|
||||
ctx.F32[1], ctx.OpAccessChain(ctx.input_f32, ctx.frag_coord, ctx.ConstU32(comp)));
|
||||
if (comp == 3) {
|
||||
return ctx.OpFDiv(ctx.F32[1], ctx.ConstF32(1.f), coord);
|
||||
}
|
||||
return coord;
|
||||
}
|
||||
default:
|
||||
throw NotImplementedException("Read attribute {}", attr);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue