fix potential problem with determining passthrough

This commit is contained in:
Frodo Baggins 2024-12-14 01:26:16 -08:00
parent 34463e53c4
commit f917b7fef6
2 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,9 @@
namespace Shader::Optimiation::PatternMatching {
// Bad pattern matching attempt
// Attempt at pattern matching for Insts and Values
// Needs improvement, mostly a convenience
template <typename Derived>
struct MatchObject {
inline bool Match(IR::Value v) {
@ -50,7 +52,6 @@ private:
IR::Value& return_val;
};
// Specific
struct MatchAttribute : MatchObject<MatchAttribute> {
MatchAttribute(IR::Attribute attribute_) : attribute(attribute_) {}
@ -62,7 +63,6 @@ private:
IR::Attribute attribute;
};
// Specific
struct MatchU32 : MatchObject<MatchU32> {
MatchU32(u32 imm_) : imm(imm_) {}

View File

@ -120,7 +120,7 @@ struct HullRuntimeInfo {
// In that case, it should be fine to assume passthrough and declare some extra
// output control points and attributes that shouldnt be read by the TES anyways
bool IsPassthrough() const {
return hs_output_base == 0 && num_threads == 1;
return hs_output_base == 0 && ls_stride == hs_output_cp_stride && num_threads == 1;
};
// regs.ls_hs_config.hs_output_control_points contains the number of threads, which