mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-12-24 10:23:01 -06:00
shader_ir/other: Implement IPA.IDX
This commit is contained in:
parent
5321cdd276
commit
d4df803b2b
2 changed files with 9 additions and 5 deletions
|
@ -596,6 +596,7 @@ union Instruction {
|
||||||
} alu;
|
} alu;
|
||||||
|
|
||||||
union {
|
union {
|
||||||
|
BitField<38, 1, u64> idx;
|
||||||
BitField<51, 1, u64> saturate;
|
BitField<51, 1, u64> saturate;
|
||||||
BitField<52, 2, IpaSampleMode> sample_mode;
|
BitField<52, 2, IpaSampleMode> sample_mode;
|
||||||
BitField<54, 2, IpaInterpMode> interp_mode;
|
BitField<54, 2, IpaInterpMode> interp_mode;
|
||||||
|
|
|
@ -130,15 +130,18 @@ u32 ShaderIR::DecodeOther(NodeBlock& bb, u32 pc) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case OpCode::Id::IPA: {
|
case OpCode::Id::IPA: {
|
||||||
const auto& attribute = instr.attribute.fmt28;
|
const bool is_physical = instr.ipa.idx && instr.gpr8.Value() != 0xff;
|
||||||
|
|
||||||
|
const auto attribute = instr.attribute.fmt28;
|
||||||
const Tegra::Shader::IpaMode input_mode{instr.ipa.interp_mode.Value(),
|
const Tegra::Shader::IpaMode input_mode{instr.ipa.interp_mode.Value(),
|
||||||
instr.ipa.sample_mode.Value()};
|
instr.ipa.sample_mode.Value()};
|
||||||
|
|
||||||
const Node attr = GetInputAttribute(attribute.index, attribute.element);
|
Node value = is_physical ? GetPhysicalInputAttribute(instr.gpr8)
|
||||||
Node value = attr;
|
: GetInputAttribute(attribute.index, attribute.element);
|
||||||
const Tegra::Shader::Attribute::Index index = attribute.index.Value();
|
const Tegra::Shader::Attribute::Index index = attribute.index.Value();
|
||||||
if (index >= Tegra::Shader::Attribute::Index::Attribute_0 &&
|
const bool is_generic = index >= Tegra::Shader::Attribute::Index::Attribute_0 &&
|
||||||
index <= Tegra::Shader::Attribute::Index::Attribute_31) {
|
index <= Tegra::Shader::Attribute::Index::Attribute_31;
|
||||||
|
if (is_generic || is_physical) {
|
||||||
// TODO(Blinkhawk): There are cases where a perspective attribute use PASS.
|
// TODO(Blinkhawk): There are cases where a perspective attribute use PASS.
|
||||||
// In theory by setting them as perspective, OpenGL does the perspective correction.
|
// In theory by setting them as perspective, OpenGL does the perspective correction.
|
||||||
// A way must figured to reverse the last step of it.
|
// A way must figured to reverse the last step of it.
|
||||||
|
|
Loading…
Reference in a new issue