forked from GPUOpen-Tools/gpu_performance_api
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGPACounterGeneratorDX11Base.h
67 lines (53 loc) · 2.74 KB
/
GPACounterGeneratorDX11Base.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//==============================================================================
// Copyright (c) 2016-2018 Advanced Micro Devices, Inc. All rights reserved.
/// \author AMD Developer Tools Team
/// \file
/// \brief Base class for DX11 counter generation -- add D3D11 Query counters which are supported on all hardware
//==============================================================================
#ifndef _GPA_COUNTER_GENERATOR_DX11_BASE_H_
#define _GPA_COUNTER_GENERATOR_DX11_BASE_H_
#include "GPACounterGeneratorBase.h"
/// Base class for DX11 counter generation -- add D3D11 Query counters which are supported on all hardware
class GPA_CounterGeneratorDX11Base : public GPA_CounterGeneratorBase
{
public:
/// Constructor
GPA_CounterGeneratorDX11Base();
/// \copydoc GPA_CounterGeneratorBase::GeneratePublicCounters
virtual GPA_Status GeneratePublicCounters(
GDT_HW_GENERATION desiredGeneration,
GDT_HW_ASIC_TYPE asicType,
gpa_uint8 generateAsicSpecificCounters,
GPA_PublicCounters* pPublicCounters) override;
/// \copydoc GPA_CounterGeneratorBase::GenerateHardwareCounters
virtual GPA_Status GenerateHardwareCounters(
GDT_HW_GENERATION desiredGeneration,
GDT_HW_ASIC_TYPE asicType,
gpa_uint8 generateAsicSpecificCounters,
GPA_HardwareCounters* pHardwareCounters) override;
/// \copydoc GPA_CounterGeneratorBase::GenerateSoftwareCounters
virtual GPA_Status GenerateSoftwareCounters(
GDT_HW_GENERATION desiredGeneration,
GDT_HW_ASIC_TYPE asicType,
gpa_uint8 generateAsicSpecificCounters,
GPA_SoftwareCounters* pSoftwareCounters) override;
/// \copydoc IGPACounterAccessor::ComputeSWCounterValue()
void ComputeSWCounterValue(gpa_uint32 softwareCounterIndex,
gpa_uint64 value,
void* pResult,
const GPA_HWInfo* pHwInfo) const override;
/// Get the D3D11_QUERY enum value based on our own software counter index
/// \param index Our SW counter index
/// \return a D3D11_QUERY enum value
gpa_uint32 GetD3D11Enum(gpa_uint32 index) const;
/// Add D3D software counters
/// \param desiredGeneration of GDT_HW_GENERATION
void GenerateD3DSoftwareCounters(GDT_HW_GENERATION desiredGeneration);
/// Helper function to indicates whether the specified HW generation represents an AMD GPU
/// \param generation the hw generation to check
/// \return true if the specified HW generation represents an AMD GPU
static bool IsAMDGPU(GDT_HW_GENERATION generation);
private:
GPA_CounterGroupDesc m_d3dCounterGroup = {0, "D3D11", 0, 0, 0}; ///< description for D3D11 counter group
};
#endif //_GPA_COUNTER_GENERATOR_DX11_BASE_H_