From 1f61d8b7a6d39ff393fe94f3a0e47858ae824f47 Mon Sep 17 00:00:00 2001 From: "Wu, Irene W" Date: Wed, 4 Oct 2023 19:59:47 +0000 Subject: [PATCH] Support platform specific KeepTileYForFlattened setting Change KeepTileYForFlattened regkey to allow platform default setting. --- IGC/Compiler/CISACodeGen/ComputeShaderBase.cpp | 7 ++++++- IGC/Compiler/CISACodeGen/Platform.hpp | 5 +++++ IGC/common/igc_flags.h | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/IGC/Compiler/CISACodeGen/ComputeShaderBase.cpp b/IGC/Compiler/CISACodeGen/ComputeShaderBase.cpp index 13d5f1d6273b..879c7435d986 100644 --- a/IGC/Compiler/CISACodeGen/ComputeShaderBase.cpp +++ b/IGC/Compiler/CISACodeGen/ComputeShaderBase.cpp @@ -66,7 +66,12 @@ namespace IGC MMD->csInfo.neededThreadIdLayout == ThreadIDLayout::X; if (m_Platform->supportHWGenerateTID() && m_DriverInfo->SupportHWGenerateTID()) { - if (IGC_IS_FLAG_DISABLED(KeepTileYForFlattened) && useLinearWalk) + // If KeepTileYForFlattened == 2, use the platform default value. + // Otherwise 0 is forced off, 1 is forced on. + bool KeepTileYForFlattenedValue = IGC_GET_FLAG_VALUE(KeepTileYForFlattened) == 2 ? + m_Platform->EnableKeepTileYForFlattenedDefault() : + IGC_IS_FLAG_ENABLED(KeepTileYForFlattened); + if (!KeepTileYForFlattenedValue && useLinearWalk) { needsLinearWalk = true; } diff --git a/IGC/Compiler/CISACodeGen/Platform.hpp b/IGC/Compiler/CISACodeGen/Platform.hpp index 17e02f690dde..e7ca083d59ca 100644 --- a/IGC/Compiler/CISACodeGen/Platform.hpp +++ b/IGC/Compiler/CISACodeGen/Platform.hpp @@ -964,6 +964,11 @@ bool EnableNewTileYCheckDefault() const return (m_platformInfo.eProductFamily == IGFX_DG2); } +bool EnableKeepTileYForFlattenedDefault() const +{ + return false; +} + bool needsWAForThreadsUtilization() const { return (m_platformInfo.eProductFamily == IGFX_DG2 || diff --git a/IGC/common/igc_flags.h b/IGC/common/igc_flags.h index 8ade82940717..20584e05b8f7 100644 --- a/IGC/common/igc_flags.h +++ b/IGC/common/igc_flags.h @@ -241,7 +241,7 @@ DECLARE_IGC_REGKEY(bool, ForceAddressArithSinking, false, "Force sinking DECLARE_IGC_REGKEY(bool, SetDefaultTileYWalk, true, "Use TileY walk as default for HW generating threadID", true) DECLARE_IGC_REGKEY(bool, ForceTileY, false, "Force TileY mode on DG2", false) DECLARE_IGC_REGKEY(DWORD, EnableNewTileYCheck, 2, "Enable new TileY check. 0 - off, 1 - on, 2 - platform default", false) -DECLARE_IGC_REGKEY(bool, KeepTileYForFlattened, false, "Keep TileY for FlattenedThreadIdInGroup on DG2", false) +DECLARE_IGC_REGKEY(DWORD, KeepTileYForFlattened, 2, "Keep TileY for FlattenedThreadIdInGroup. 0 - off, 1 - on, 2 - platform default", false) DECLARE_IGC_REGKEY(bool, DisableDynamicTextureFolding, false, "Disable Dynamic Texture Folding", false) DECLARE_IGC_REGKEY(bool, DisableDynamicResInfoFolding, true, "Disable Dynamic ResInfo Instruction Folding", false)