UINT_32 isT : 1; // T mode
UINT_32 isRtOpt : 1; // mode opt for render target
+
+ UINT_32 reserved : 20; // Reserved bits
};
struct Dim2d
enum AddrBlockType
{
AddrBlockMicro = 0, // Resource uses 256B block
- AddrBlock4KB = 1, // Resource uses 4KB block
- AddrBlock64KB = 2, // Resource uses 64KB block
- AddrBlockVar = 3, // Resource uses var block, only valid for GFX9
- AddrBlockLinear = 4, // Resource uses linear swizzle mode
-
- AddrBlockMaxTiledType = AddrBlock64KB + 1,
-};
-
-enum AddrBlockSet
-{
- AddrBlockSetMicro = 1 << AddrBlockMicro,
- AddrBlockSetMacro4KB = 1 << AddrBlock4KB,
- AddrBlockSetMacro64KB = 1 << AddrBlock64KB,
- AddrBlockSetVar = 1 << AddrBlockVar,
- AddrBlockSetLinear = 1 << AddrBlockLinear,
-
- AddrBlockSetMacro = AddrBlockSetMacro4KB | AddrBlockSetMacro64KB,
- AddrBlockSet2dGfx10 = AddrBlockSetMicro | AddrBlockSetMacro,
- AddrBlockSet3dGfx10 = AddrBlockSetMacro,
+ AddrBlockThin4KB = 1, // Resource uses thin 4KB block
+ AddrBlockThick4KB = 2, // Resource uses thick 4KB block
+ AddrBlockThin64KB = 3, // Resource uses thin 64KB block
+ AddrBlockThick64KB = 4, // Resource uses thick 64KB block
+ AddrBlockVar = 5, // Resource uses var block, only valid for GFX9
+ AddrBlockLinear = 6, // Resource uses linear swizzle mode
+
+ AddrBlockMaxTiledType = AddrBlockVar + 1,
};
enum AddrSwSet
AddrSwSetD = 1 << ADDR_SW_D,
AddrSwSetR = 1 << ADDR_SW_R,
- AddrSwSetAll = AddrSwSetZ | AddrSwSetS | AddrSwSetD | AddrSwSetR,
- AddrSwSet3dThinGfx10 = AddrSwSetZ | AddrSwSetR,
- AddrSwSetColorGfx10 = AddrSwSetS | AddrSwSetD | AddrSwSetR,
+ AddrSwSetAll = AddrSwSetZ | AddrSwSetS | AddrSwSetD | AddrSwSetR,
};
+const UINT_32 Size256 = 256u;
+const UINT_32 Size4K = 4096u;
+const UINT_32 Size64K = 65536u;
+
+const UINT_32 Log2Size256 = 8u;
+const UINT_32 Log2Size4K = 12u;
+const UINT_32 Log2Size64K = 16u;
+
/**
************************************************************************************************************************
* @brief This class contains asic independent address lib functionalities
static const UINT_32 MaxMipLevels = 16;
+ BOOL_32 IsValidSwMode(AddrSwizzleMode swizzleMode) const
+ {
+ // Don't dereference a reinterpret_cast pointer so as not to break
+ // strict-aliasing rules.
+ UINT_32 mode;
+ memcpy(&mode, &m_swizzleModeTable[swizzleMode], sizeof(UINT_32));
+ return mode != 0;
+ }
+
// Checking block size
BOOL_32 IsBlock256b(AddrSwizzleMode swizzleMode) const
{
{
blockSizeLog2 = 16;
}
- else if (IsBlockVariable(swizzleMode))
+ else if (IsBlockVariable(swizzleMode) && (m_blockVarSizeLog2 != 0))
{
blockSizeLog2 = m_blockVarSizeLog2;
}
AddrSwizzleMode swizzleMode) const;
ADDR_E_RETURNCODE ComputeBlockDimension(
- UINT_32* pWidth,
- UINT_32* pHeight,
- UINT_32* pDepth,
- UINT_32 bpp,
- AddrResourceType resourceType,
- AddrSwizzleMode swizzleMode) const;
+ UINT_32* pWidth,
+ UINT_32* pHeight,
+ UINT_32* pDepth,
+ UINT_32 bpp,
+ AddrResourceType resourceType,
+ AddrSwizzleMode swizzleMode) const;
+
+ virtual VOID ComputeThinBlockDimension(
+ UINT_32* pWidth,
+ UINT_32* pHeight,
+ UINT_32* pDepth,
+ UINT_32 bpp,
+ UINT_32 numSamples,
+ AddrResourceType resourceType,
+ AddrSwizzleMode swizzleMode) const;
+
+ VOID ComputeThickBlockDimension(
+ UINT_32* pWidth,
+ UINT_32* pHeight,
+ UINT_32* pDepth,
+ UINT_32 bpp,
+ AddrResourceType resourceType,
+ AddrSwizzleMode swizzleMode) const;
static UINT_64 ComputePadSize(
const Dim3d* pBlkDim,
VOID ComputeQbStereoInfo(ADDR2_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const;
+ VOID FilterInvalidEqSwizzleMode(
+ ADDR2_SWMODE_SET& allowedSwModeSet,
+ AddrResourceType resourceType,
+ UINT_32 elemLog2) const;
+
UINT_32 m_se; ///< Number of shader engine
UINT_32 m_rbPerSe; ///< Number of render backend per shader engine
UINT_32 m_maxCompFrag; ///< Number of max compressed fragment
SwizzleModeFlags m_swizzleModeTable[ADDR_SW_MAX_TYPE]; ///< Swizzle mode table
+ // Max number of swizzle mode supported for equation
+ static const UINT_32 MaxSwModeType = 32;
+ // Max number of resource type (2D/3D) supported for equation
+ static const UINT_32 MaxRsrcType = 2;
+ // Max number of bpp (8bpp/16bpp/32bpp/64bpp/128bpp)
+ static const UINT_32 MaxElementBytesLog2 = 5;
+ // Almost all swizzle mode + resource type support equation
+ static const UINT_32 EquationTableSize = MaxElementBytesLog2 * MaxSwModeType * MaxRsrcType;
+ // Equation table
+ ADDR_EQUATION m_equationTable[EquationTableSize];
+
+ // Number of equation entries in the table
+ UINT_32 m_numEquations;
+ // Equation lookup table according to bpp and tile index
+ UINT_32 m_equationLookupTable[MaxRsrcType][MaxSwModeType][MaxElementBytesLog2];
+
private:
// Disallow the copy constructor
Lib(const Lib& a);