summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/amd/addrlib/core/addrlib.cpp2
-rw-r--r--src/amd/addrlib/r800/ciaddrlib.cpp122
2 files changed, 59 insertions, 65 deletions
diff --git a/src/amd/addrlib/core/addrlib.cpp b/src/amd/addrlib/core/addrlib.cpp
index 1df693e5be5..b829eec474b 100644
--- a/src/amd/addrlib/core/addrlib.cpp
+++ b/src/amd/addrlib/core/addrlib.cpp
@@ -542,6 +542,8 @@ ADDR_E_RETURNCODE AddrLib::ComputeSurfaceInfo(
{
ADDR_ASSERT(!IsMacroTiled(localIn.tileMode));
}
+
+ pOut->macroModeIndex = macroModeIndex;
}
}
diff --git a/src/amd/addrlib/r800/ciaddrlib.cpp b/src/amd/addrlib/r800/ciaddrlib.cpp
index ae91e44eb99..26c4e056177 100644
--- a/src/amd/addrlib/r800/ciaddrlib.cpp
+++ b/src/amd/addrlib/r800/ciaddrlib.cpp
@@ -1455,96 +1455,88 @@ INT_32 CiAddrLib::HwlComputeMacroModeIndex(
{
INT_32 macroModeIndex = TileIndexInvalid;
- if (flags.tcCompatible && flags.stencil)
+ AddrTileMode tileMode = m_tileTable[tileIndex].mode;
+ AddrTileType tileType = m_tileTable[tileIndex].type;
+ UINT_32 thickness = ComputeSurfaceThickness(tileMode);
+
+ if (!IsMacroTiled(tileMode))
{
- // Don't compute macroModeIndex for tc compatible stencil surface
+ *pTileInfo = m_tileTable[tileIndex].info;
macroModeIndex = TileIndexNoMacroIndex;
}
else
{
- AddrTileMode tileMode = m_tileTable[tileIndex].mode;
- AddrTileType tileType = m_tileTable[tileIndex].type;
- UINT_32 thickness = ComputeSurfaceThickness(tileMode);
+ UINT_32 tileBytes1x = BITS_TO_BYTES(bpp * MicroTilePixels * thickness);
+ UINT_32 tileSplit;
- if (!IsMacroTiled(tileMode))
+ if (m_tileTable[tileIndex].type == ADDR_DEPTH_SAMPLE_ORDER)
{
- *pTileInfo = m_tileTable[tileIndex].info;
- macroModeIndex = TileIndexNoMacroIndex;
+ // Depth entries store real tileSplitBytes
+ tileSplit = m_tileTable[tileIndex].info.tileSplitBytes;
}
else
{
- UINT_32 tileBytes1x = BITS_TO_BYTES(bpp * MicroTilePixels * thickness);
- UINT_32 tileSplit;
+ // Non-depth entries store a split factor
+ UINT_32 sampleSplit = m_tileTable[tileIndex].info.tileSplitBytes;
+ UINT_32 colorTileSplit = Max(256u, sampleSplit * tileBytes1x);
- if (m_tileTable[tileIndex].type == ADDR_DEPTH_SAMPLE_ORDER)
- {
- // Depth entries store real tileSplitBytes
- tileSplit = m_tileTable[tileIndex].info.tileSplitBytes;
- }
- else
- {
- // Non-depth entries store a split factor
- UINT_32 sampleSplit = m_tileTable[tileIndex].info.tileSplitBytes;
- UINT_32 colorTileSplit = Max(256u, sampleSplit * tileBytes1x);
-
- tileSplit = colorTileSplit;
- }
-
- UINT_32 tileSplitC = Min(m_rowSize, tileSplit);
- UINT_32 tileBytes;
-
- if (flags.fmask)
- {
- tileBytes = Min(tileSplitC, tileBytes1x);
- }
- else
- {
- tileBytes = Min(tileSplitC, numSamples * tileBytes1x);
- }
+ tileSplit = colorTileSplit;
+ }
- if (tileBytes < 64)
- {
- tileBytes = 64;
- }
+ UINT_32 tileSplitC = Min(m_rowSize, tileSplit);
+ UINT_32 tileBytes;
- macroModeIndex = Log2(tileBytes / 64);
+ if (flags.fmask)
+ {
+ tileBytes = Min(tileSplitC, tileBytes1x);
+ }
+ else
+ {
+ tileBytes = Min(tileSplitC, numSamples * tileBytes1x);
+ }
- if (flags.prt || IsPrtTileMode(tileMode))
- {
- // Unknown - assume it is 1/2 of table size
- const UINT_32 PrtMacroModeOffset = MacroTileTableSize / 2;
+ if (tileBytes < 64)
+ {
+ tileBytes = 64;
+ }
- macroModeIndex += PrtMacroModeOffset;
- *pTileInfo = m_macroTileTable[macroModeIndex];
- }
- else
- {
- *pTileInfo = m_macroTileTable[macroModeIndex];
- }
+ macroModeIndex = Log2(tileBytes / 64);
- pTileInfo->pipeConfig = m_tileTable[tileIndex].info.pipeConfig;
+ if (flags.prt || IsPrtTileMode(tileMode))
+ {
+ // Unknown - assume it is 1/2 of table size
+ const UINT_32 PrtMacroModeOffset = MacroTileTableSize / 2;
- if (m_tileTable[tileIndex].type != ADDR_DEPTH_SAMPLE_ORDER)
- {
- pTileInfo->tileSplitBytes = tileSplitC;
- }
- else
- {
- pTileInfo->tileSplitBytes = m_tileTable[tileIndex].info.tileSplitBytes;
- }
+ macroModeIndex += PrtMacroModeOffset;
+ *pTileInfo = m_macroTileTable[macroModeIndex];
}
-
- if (NULL != pTileMode)
+ else
{
- *pTileMode = tileMode;
+ *pTileInfo = m_macroTileTable[macroModeIndex];
}
- if (NULL != pTileType)
+ pTileInfo->pipeConfig = m_tileTable[tileIndex].info.pipeConfig;
+
+ if (m_tileTable[tileIndex].type != ADDR_DEPTH_SAMPLE_ORDER)
+ {
+ pTileInfo->tileSplitBytes = tileSplitC;
+ }
+ else
{
- *pTileType = tileType;
+ pTileInfo->tileSplitBytes = m_tileTable[tileIndex].info.tileSplitBytes;
}
}
+ if (NULL != pTileMode)
+ {
+ *pTileMode = tileMode;
+ }
+
+ if (NULL != pTileType)
+ {
+ *pTileType = tileType;
+ }
+
return macroModeIndex;
}