mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-27 16:02:37 +00:00
shader: interpolate f16 parameter halves (V_INTERP_P1LL_F16, V_INTERP_P2_F16) (#1792)
shader: interpolate packed f16 attributes for v_interp_p1ll_f16 and v_interp_p2_f16 Co-authored-by: nmzik <Nmzik@mail.ru>
This commit is contained in:
1 parent
8502d8a77d
commit
d7c1896647
10 files changed
+181
-75
No files matched your search
@@ -373,7 +373,8 @@ void Visit(Program& program, ShaderStageInputInfo input_info, InputUsage& inputs
|
||||
}
|
||||
}
|
||||
switch (inst.GetOpcode()) {
|
||||
case ValueOpcode::GetAttribute: {
|
||||
case ValueOpcode::GetAttribute:
|
||||
case ValueOpcode::GetAttributeF16: {
|
||||
if (!inst.Arg(0).IsImmediate() || inst.Arg(0).GetType() != Type::U32 ||
|
||||
!inst.Arg(1).IsImmediate() || inst.Arg(1).GetType() != Type::U32) {
|
||||
return Fail("typed attribute reference is not constant");
|
||||
@@ -395,6 +396,15 @@ void Visit(Program& program, ShaderStageInputInfo input_info, InputUsage& inputs
|
||||
auto& components = inputs.components[inst.Arg(0).U32()];
|
||||
components = std::max(components, static_cast<uint8_t>(inst.Arg(1).U32() + 1u));
|
||||
}
|
||||
if (inst.GetOpcode() == ValueOpcode::GetAttributeF16) {
|
||||
if (program.stage != ShaderType::Pixel || !inst.Arg(2).IsImmediate()) {
|
||||
return Fail("f16 attribute reference is invalid");
|
||||
}
|
||||
// FP16_INTERP_MODE packs two halves per dword, so smooth inputs blend unpacked
|
||||
// vertices; flat inputs unpack the provoking vertex.
|
||||
const auto input = inst.Arg(0).U32();
|
||||
inputs.per_vertex[input] |= !ShaderPixelParameterIsFlat(*input_info.pixel, input);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ValueOpcode::GetInterpolationParameter: {
|
||||
|
||||
Reference in new issue
Block a user