-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathAmdDxExtApi.h
86 lines (73 loc) · 3.57 KB
/
AmdDxExtApi.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
***************************************************************************************************
*
* Copyright (c) 2008-2016 Advanced Micro Devices, Inc. All rights reserved.
*
***************************************************************************************************
*/
/**
***************************************************************************************************
* @file amddxextapi.h
* @brief AMD D3D Exension API include file. This is the main include file for apps using extensions.
***************************************************************************************************
*/
#ifndef _AMDDXEXTAPI_H_
#define _AMDDXEXTAPI_H_
#include "AmdDxExt.h"
#include "AmdDxExtIface.h"
// forward declaration of main extension interface defined lower in file
class IAmdDxExt;
// forward declaration for d3d specific interfaces
interface ID3D10Device;
interface ID3D11Device;
interface ID3D10Resource;
interface ID3D11Resource;
// App must use GetProcAddress, etc. to retrive this exported function
// The associated typedef provides a convenient way to define the function pointer
HRESULT __cdecl AmdDxExtCreate(ID3D10Device* pDevice, IAmdDxExt** ppExt);
typedef HRESULT (__cdecl *PFNAmdDxExtCreate)(ID3D10Device* pDevice, IAmdDxExt** ppExt);
HRESULT __cdecl AmdDxExtCreate11(ID3D11Device* pDevice, IAmdDxExt** ppExt);
typedef HRESULT (__cdecl *PFNAmdDxExtCreate11)(ID3D11Device* pDevice, IAmdDxExt** ppExt);
// Extension version information
struct AmdDxExtVersion
{
unsigned int majorVersion;
unsigned int minorVersion;
};
// forward declaration of classes referenced by IAmdDxExt
class IAmdDxExtInterface;
/**
***************************************************************************************************
* @brief This class serves as the main extension interface.
*
* AmdDxExtCreate returns a pointer to an instantiation of this interface.
* This object is used to retrieve extension version information
* and to get specific extension interfaces desired.
***************************************************************************************************
*/
class IAmdDxExt : public IAmdDxExtInterface
{
public:
virtual HRESULT GetVersion(AmdDxExtVersion* pExtVer) = 0;
virtual IAmdDxExtInterface* GetExtInterface(unsigned int iface) = 0;
// General extensions
virtual HRESULT IaSetPrimitiveTopology(unsigned int topology) = 0;
virtual HRESULT IaGetPrimitiveTopology(AmdDxExtPrimitiveTopology* pExtTopology) = 0;
virtual HRESULT SetSingleSampleRead(ID3D10Resource* pResource,
BOOL singleSample) = 0;
virtual HRESULT SetSingleSampleRead11(ID3D11Resource* pResource,
BOOL singleSample) = 0;
// Supported in version 9.0 and above.
virtual HRESULT QueryFeatureSupport(unsigned int featureToken,
void* pData, unsigned int dataSize) = 0;
// Supported in version 9.1 and above.
// Only works if QueryFeatureSupport() says AmdDxExtFeature_DeviceCtxSupport is true.
virtual HRESULT IaSetPrimitiveTopologyCtx(unsigned int topology,
ID3D11DeviceContext* pCtx) = 0;
virtual HRESULT IaGetPrimitiveTopologyCtx(AmdDxExtPrimitiveTopology* pExtTopology,
ID3D11DeviceContext* pCtx) = 0;
protected:
IAmdDxExt() {};
virtual ~IAmdDxExt() = 0 {};
};
#endif // _AMDDXEXTAPI_H_