mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-23 04:16:57 +02:00
shader: correlate masked first-lane material rows
This commit is contained in:
@@ -178,8 +178,9 @@ bool IsRuntimeUniformOp(ValueOpcode op) {
|
||||
|
||||
class RuntimeValidator {
|
||||
public:
|
||||
explicit RuntimeValidator(const ResourcePlan& program, RuntimeValueType type)
|
||||
: m_program(program), m_type(type) {}
|
||||
explicit RuntimeValidator(const ResourcePlan& program, RuntimeValueType type,
|
||||
bool wave_uniform = false)
|
||||
: m_program(program), m_type(type), m_wave_uniform(wave_uniform) {}
|
||||
|
||||
bool Run(Value value) { return Validate(value); }
|
||||
|
||||
@@ -278,6 +279,12 @@ private:
|
||||
}
|
||||
return finish(true);
|
||||
}
|
||||
if (m_wave_uniform && op == ValueOpcode::GetBuiltin) {
|
||||
const auto axis = inst->NumArgs() == 2u ? inst->Arg(1).Resolve() : Value {};
|
||||
return finish(m_program.stage == ShaderType::Compute && inst->NumArgs() == 2u &&
|
||||
inst->Arg(0) == Value(static_cast<uint32_t>(StageInputKind::WorkgroupId)) &&
|
||||
axis.IsImmediate() && axis.GetType() == Type::U32 && axis.U32() < 3u);
|
||||
}
|
||||
if (op == ValueOpcode::Phi) {
|
||||
if (m_type != RuntimeValueType::Any && !ValidateArguments(*inst, false)) {
|
||||
return finish(false);
|
||||
@@ -357,6 +364,7 @@ private:
|
||||
|
||||
const ResourcePlan& m_program;
|
||||
RuntimeValueType m_type;
|
||||
bool m_wave_uniform;
|
||||
Value m_active_mask;
|
||||
std::unordered_set<const Inst*> m_visiting;
|
||||
std::unordered_set<const Inst*> m_validated_dependencies;
|
||||
@@ -1153,5 +1161,9 @@ bool ValidateRuntimeValue(const ResourcePlan& program, Value value, RuntimeValue
|
||||
return RuntimeValidator(program, type).Run(value);
|
||||
}
|
||||
|
||||
bool ValidateWaveUniformValue(const ResourcePlan& program, Value value) {
|
||||
return RuntimeValidator(program, RuntimeValueType::Any, true).Run(value);
|
||||
}
|
||||
|
||||
|
||||
} // namespace Libs::Graphics::ShaderRecompiler::IR
|
||||
|
||||
Reference in New Issue
Block a user