diff --git a/src/amd/addrlib/inc/addrinterface.h b/src/amd/addrlib/inc/addrinterface.h index 807098fae1f..657cbeb56dc 100644 --- a/src/amd/addrlib/inc/addrinterface.h +++ b/src/amd/addrlib/inc/addrinterface.h @@ -2785,6 +2785,10 @@ typedef struct _ADDR2_COMPUTE_HTILE_INFO_OUTPUT UINT_32 metaBlkNumPerSlice; ///< Number of metablock within one slice ADDR2_META_MIP_INFO* pMipInfo; ///< HTILE mip information + + struct { + UINT_16* gfx10_bits; /* 72 2-byte elements */ + } equation; } ADDR2_COMPUTE_HTILE_INFO_OUTPUT; /** diff --git a/src/amd/addrlib/src/gfx10/gfx10addrlib.cpp b/src/amd/addrlib/src/gfx10/gfx10addrlib.cpp index 4ded4c3b50a..2171577616c 100644 --- a/src/amd/addrlib/src/gfx10/gfx10addrlib.cpp +++ b/src/amd/addrlib/src/gfx10/gfx10addrlib.cpp @@ -252,6 +252,14 @@ ADDR_E_RETURNCODE Gfx10Lib::HwlComputeHtileInfo( pOut->pMipInfo[0].sliceSize = pOut->sliceSize; } } + + // Get the HTILE address equation (copied from HtileAddrFromCoord). + // Note that HTILE doesn't depend on the number of samples. + const UINT_32 index = m_xmaskBaseIndex; + const UINT_8* patIdxTable = m_settings.supportRbPlus ? GFX10_HTILE_RBPLUS_PATIDX : GFX10_HTILE_PATIDX; + + ADDR_C_ASSERT(sizeof(GFX10_HTILE_SW_PATTERN[patIdxTable[index]]) == 72 * 2); + pOut->equation.gfx10_bits = (UINT_16 *)GFX10_HTILE_SW_PATTERN[patIdxTable[index]]; } return ret;