Src/GPUPerfAPICounterGenerator/GPACounterGeneratorDX11.cpp
/// Function to encode the DX11 GPU timing counters for the driver
/// \param generation the hardware generation
/// \param globalCounterIndex the global counter index of the gpu timing counter being encoded
/// \return the encoded counter value
Function to encode the DX11 GPU timing counters for the driver
\param generation the hardware generation
\param globalCounterIndex the global counter index of the gpu timing counter being encoded
\return the encoded counter value
Function to encode the DX11 GPU timing counters for the driver \ param generation the hardware generation \ param globalCounterIndex the global counter index of the gpu timing counter being encoded \ return the encoded counter value
static UINT EncodeGPUTimeCounter(GDT_HW_GENERATION generation, unsigned int globalCounterIndex)
{
    unsigned int firstGPUTimeCounter = 0;
    if (GPA_CounterGeneratorDX11Base::IsAMDGPU(generation))
    {
        if (generation == GDT_HW_GENERATION_SOUTHERNISLAND)
        {
            firstGPUTimeCounter = HWDX11FirstGPUTimeCounterIndexGfx6;
        }
        else if (generation == GDT_HW_GENERATION_SEAISLAND)
        {
            firstGPUTimeCounter = HWDX11FirstGPUTimeCounterIndexGfx7;
        }
        else if (generation == GDT_HW_GENERATION_VOLCANICISLAND)
        {
            firstGPUTimeCounter = HWDX11FirstGPUTimeCounterIndexGfx8;
        }
        else if (generation == GDT_HW_GENERATION_GFX9)
        {
            firstGPUTimeCounter = HWDX11FirstGPUTimeCounterIndexGfx9;
        }
        else
        {
            assert(generation == GDT_HW_GENERATION_SOUTHERNISLAND);
            return 0;
        }
    }
    assert(globalCounterIndex >= firstGPUTimeCounter);
    return AmdCtrEncodeApiCounter((AmdApiCounterId)(globalCounterIndex - firstGPUTimeCounter));
}
static UINT EncodeGPUTimeCounter ( GDT_HW_GENERATION generation , unsigned int globalCounterIndex ) { unsigned int firstGPUTimeCounter = 0 ; if ( GPA_CounterGeneratorDX11Base :: IsAMDGPU ( generation ) ) { if ( generation == GDT_HW_GENERATION_SOUTHERNISLAND ) { firstGPUTimeCounter = HWDX11FirstGPUTimeCounterIndexGfx6 ; } else if ( generation == GDT_HW_GENERATION_SEAISLAND ) { firstGPUTimeCounter = HWDX11FirstGPUTimeCounterIndexGfx7 ; } else if ( generation == GDT_HW_GENERATION_VOLCANICISLAND ) { firstGPUTimeCounter = HWDX11FirstGPUTimeCounterIndexGfx8 ; } else if ( generation == GDT_HW_GENERATION_GFX9 ) { firstGPUTimeCounter = HWDX11FirstGPUTimeCounterIndexGfx9 ; } else { assert ( generation == GDT_HW_GENERATION_SOUTHERNISLAND ) ; return 0 ; } } assert ( globalCounterIndex >= firstGPUTimeCounter ) ; return AmdCtrEncodeApiCounter ( ( AmdApiCounterId ) ( globalCounterIndex - firstGPUTimeCounter ) ) ; }
Function to encode the DX11 GPU timing counters for the driver
\param generation the hardware generation
\param globalCounterIndex the global counter index of the gpu timing counter being encoded
\return the encoded counter value
Function to encode the DX11 GPU timing counters for the driver \ param generation the hardware generation \ param globalCounterIndex the global counter index of the gpu timing counter being encoded \ return the encoded counter value
// don't recognize the specified hardware generation. // need to add support or fix a bug.