From f917b7fef637d6063fd4ebe6506cb5f6d506e3e9 Mon Sep 17 00:00:00 2001 From: Frodo Baggins Date: Sat, 14 Dec 2024 01:26:16 -0800 Subject: [PATCH] fix potential problem with determining passthrough --- src/shader_recompiler/ir/pattern_matching.h | 6 +++--- src/shader_recompiler/runtime_info.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/shader_recompiler/ir/pattern_matching.h b/src/shader_recompiler/ir/pattern_matching.h index 228d12514..1279f14c3 100644 --- a/src/shader_recompiler/ir/pattern_matching.h +++ b/src/shader_recompiler/ir/pattern_matching.h @@ -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 struct MatchObject { inline bool Match(IR::Value v) { @@ -50,7 +52,6 @@ private: IR::Value& return_val; }; -// Specific struct MatchAttribute : MatchObject { MatchAttribute(IR::Attribute attribute_) : attribute(attribute_) {} @@ -62,7 +63,6 @@ private: IR::Attribute attribute; }; -// Specific struct MatchU32 : MatchObject { MatchU32(u32 imm_) : imm(imm_) {} diff --git a/src/shader_recompiler/runtime_info.h b/src/shader_recompiler/runtime_info.h index e3851ab9f..23e23c118 100644 --- a/src/shader_recompiler/runtime_info.h +++ b/src/shader_recompiler/runtime_info.h @@ -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