Src/GPUPerfAPICounterGenerator/GPACounterGeneratorDX11.cpp
/// Function translates between GPA's block id and the DX11 driver's PE_BLOCK_ID enum
/// The driver gives each block an ID, but ignores the instance. GPA treats each instance as a different
/// block, so we need to translate.
/// \param generation the generation whose block id needs to be calculated
/// \param pGroup the group for which the block id needs to be calculated
/// \return the block id according to the driver
Function translates between GPA's block id and the DX11 driver's PE_BLOCK_ID enum
The driver gives each block an ID, but ignores the instance. GPA treats each instance as a different
block, so we need to translate.
\param generation the generation whose block id needs to be calculated
\param pGroup the group for which the block id needs to be calculated
\return the block id according to the driver
Function translates between GPA ' s block id and the DX11 driver ' s PE_BLOCK_ID enum The driver gives each block an ID but ignores the instance . GPA treats each instance as a different block so we need to translate . \ param generation the generation whose block id needs to be calculated \ param pGroup the group for which the block id needs to be calculated \ return the block id according to the driver
static UINT CalculateBlockIdDX11(GDT_HW_GENERATION generation, GPA_CounterGroupDesc* pGroup)
{
    UINT groupIndex = (UINT)pGroup->m_groupIndex;
    if (GPA_CounterGeneratorDX11Base::IsAMDGPU(generation))
    {
        if (generation == GDT_HW_GENERATION_SOUTHERNISLAND)
        {
            return HWDX11DriverEnumGfx6[groupIndex];
        }
        else if (generation == GDT_HW_GENERATION_SEAISLAND)
        {
            return HWDX11DriverEnumGfx7[groupIndex];
        }
        else if (generation == GDT_HW_GENERATION_VOLCANICISLAND)
        {
            return HWDX11DriverEnumGfx8[groupIndex];
        }
        else if (generation == GDT_HW_GENERATION_GFX9)
        {
            return HWDX11DriverEnumGfx9[groupIndex];
        }
        else
        {
            assert(generation == GDT_HW_GENERATION_SOUTHERNISLAND);
        }
    }
    return groupIndex;
}
static UINT CalculateBlockIdDX11 ( GDT_HW_GENERATION generation , GPA_CounterGroupDesc * pGroup ) { UINT groupIndex = ( UINT ) pGroup -> m_groupIndex ; if ( GPA_CounterGeneratorDX11Base :: IsAMDGPU ( generation ) ) { if ( generation == GDT_HW_GENERATION_SOUTHERNISLAND ) { return HWDX11DriverEnumGfx6 [ groupIndex ] ; } else if ( generation == GDT_HW_GENERATION_SEAISLAND ) { return HWDX11DriverEnumGfx7 [ groupIndex ] ; } else if ( generation == GDT_HW_GENERATION_VOLCANICISLAND ) { return HWDX11DriverEnumGfx8 [ groupIndex ] ; } else if ( generation == GDT_HW_GENERATION_GFX9 ) { return HWDX11DriverEnumGfx9 [ groupIndex ] ; } else { assert ( generation == GDT_HW_GENERATION_SOUTHERNISLAND ) ; } } return groupIndex ; }
Function translates between GPA's block id and the DX11 driver's PE_BLOCK_ID enum
The driver gives each block an ID, but ignores the instance.
Function translates between GPA ' s block id and the DX11 driver ' s PE_BLOCK_ID enum The driver gives each block an ID but ignores the instance .
// don't recognize the specified hardware generation. // need to add support or fix a bug.