RetroArch
d3d10_1shader.h
Go to the documentation of this file.
1 //
3 // Copyright (c) Microsoft Corporation. All rights reserved.
4 //
5 // File: D3D10_1Shader.h
6 // Content: D3D10.1 Shader Types and APIs
7 //
9 
10 #ifndef __D3D10_1SHADER_H__
11 #define __D3D10_1SHADER_H__
12 
13 #include "d3d10shader.h"
14 
15 /*#include <winapifamily.h>*/
16 
17 
18 
19 //----------------------------------------------------------------------------
20 // Shader debugging structures
21 //----------------------------------------------------------------------------
22 
24 {
40 
42 {
53 
55 {
60 
62 // These are the serialized structures that get written to the file
64 
66 {
67  UINT File; // offset into file list
68  UINT Line; // line #
69  UINT Column; // column #
70 
72  UINT TokenId; // offset to LPCSTR of length TokenLength in string datastore
74 
75 // Variable list
77 {
78  // Index into token list for declaring identifier
81  // register and component for this variable, only valid/necessary for arrays
84  // gives the original variable that declared this variable
86  // this variable's offset in its ScopeVar
89 
91 {
92  // index into array of variables of variable to initialize
94  // input, cbuffer, tbuffer
96  // set to cbuffer or tbuffer slot, geometry shader input primitive #,
97  // identifying register for indexable temp, or -1
99  // -1 if temp, otherwise gives register in register set
101  // -1 if temp, otherwise gives component
103  // initial value if literal
106 
108 {
109  // Index into variable token
111 
112  D3D10_SHADER_DEBUG_VARTYPE VarType; // variable or function (different namespaces)
114  UINT Rows; // number of rows (matrices)
115  UINT Columns; // number of columns (vectors and matrices)
116 
117  // In an array of structures, one struct member scope is provided, and
118  // you'll have to add the array stride times the index to the variable
119  // index you find, then find that variable in this structure's list of
120  // variables.
121 
122  // gives a scope to look up struct members. -1 if not a struct
124 
125  // number of array indices
126  UINT uArrayIndices; // a[3][2][1] has 3 indices
127  // maximum array index for each index
128  // offset to UINT[uArrayIndices] in UINT datastore
129  UINT ArrayElements; // a[3][2][1] has {3, 2, 1}
130  // how many variables each array index moves
131  // offset to UINT[uArrayIndices] in UINT datastore
132  UINT ArrayStrides; // a[3][2][1] has {2, 1, 1}
133 
135  // index of the first variable, later variables are offsets from this one
138 
139 // scope data, this maps variable names to debug variables (useful for the watch window)
141 {
143  UINT Name; // offset to name of scope in strings list
144  UINT uNameLen; // length of name string
146  UINT VariableData; // Offset to UINT[uVariables] indexing the Scope Variable list
148 
149 // instruction outputs
151 {
152  // index variable being written to, if -1 it's not going to a variable
154  // range data that the compiler expects to be true
158 
161 
163 {
164  // Only temp, indexable temp, and output are valid here
166  // -1 means no output
168  // if a temp array, identifier for which one
170  // -1 means masked out
173  // when indexing the output, get the value of this register, then add
174  // that to uOutputReg. If uIndexReg is -1, then there is no index.
175  // find the variable whose register is the sum (by looking in the ScopeVar)
176  // and component matches, then set it. This should only happen for indexable
177  // temps and outputs.
181 
182 // per instruction data
184 {
185  UINT Id; // Which instruction this is in the bytecode
186  UINT Opcode; // instruction type
187 
188  // 0, 1, or 2
190 
191  // up to two outputs per instruction
193 
194  // index into the list of tokens for this instruction's token
196 
197  // how many function calls deep this instruction is
199 
200  // list of scopes from outer-most to inner-most
201  // Number of scopes
203  UINT ScopeInfo; // Offset to UINT[uScopes] specifying indices of the ScopeInfo Array
204 
205  // list of variables accessed by this instruction
206  // Number of variables
208  UINT AccessedVarsInfo; // Offset to UINT[AccessedVars] specifying indices of the ScopeVariableInfo Array
210 
212 {
213  UINT FileName; // Offset to LPCSTR for file name
214  UINT FileNameLen; // Length of file name
215  UINT FileData; // Offset to LPCSTR of length FileLen
216  UINT FileLen; // Length of file
218 
220 {
221  UINT Size; // sizeof(D3D10_SHADER_DEBUG_INFO)
222  UINT Creator; // Offset to LPCSTR for compiler version
223  UINT EntrypointName; // Offset to LPCSTR for Entry point name
224  UINT ShaderTarget; // Offset to LPCSTR for shader target
225  UINT CompileFlags; // flags used to compile
226  UINT Files; // number of included files
227  UINT FileInfo; // Offset to D3D10_SHADER_DEBUG_FILE_INFO[Files]
228  UINT Instructions; // number of instructions
229  UINT InstructionInfo; // Offset to D3D10_SHADER_DEBUG_INST_INFO[Instructions]
230  UINT Variables; // number of variables
231  UINT VariableInfo; // Offset to D3D10_SHADER_DEBUG_VAR_INFO[Variables]
232  UINT InputVariables; // number of variables to initialize before running
233  UINT InputVariableInfo; // Offset to D3D10_SHADER_DEBUG_INPUT_INFO[InputVariables]
234  UINT Tokens; // number of tokens to initialize
235  UINT TokenInfo; // Offset to D3D10_SHADER_DEBUG_TOKEN_INFO[Tokens]
236  UINT Scopes; // number of scopes
237  UINT ScopeInfo; // Offset to D3D10_SHADER_DEBUG_SCOPE_INFO[Scopes]
238  UINT ScopeVariables; // number of variables declared
239  UINT ScopeVariableInfo; // Offset to D3D10_SHADER_DEBUG_SCOPEVAR_INFO[Scopes]
240  UINT UintOffset; // Offset to the UINT datastore, all UINT offsets are from this offset
241  UINT StringOffset; // Offset to the string datastore, all string offsets are from this offset
243 
244 //----------------------------------------------------------------------------
245 // ID3D10ShaderReflection1:
246 //----------------------------------------------------------------------------
247 
248 //
249 // Interface definitions
250 //
251 
252 
255 
256 // {C3457783-A846-47CE-9520-CEA6F66E7447}
257 DEFINE_GUID(IID_ID3D10ShaderReflection1,
258 0xc3457783, 0xa846, 0x47ce, 0x95, 0x20, 0xce, 0xa6, 0xf6, 0x6e, 0x74, 0x47);
259 
260 #undef INTERFACE
261 #define INTERFACE ID3D10ShaderReflection1
262 
264 {
265  STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
266  STDMETHOD_(ULONG, AddRef)(THIS) PURE;
267  STDMETHOD_(ULONG, Release)(THIS) PURE;
268 
269  STDMETHOD(GetDesc)(THIS_ _Out_ D3D10_SHADER_DESC *pDesc) PURE;
270 
271  STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ UINT Index) PURE;
272  STDMETHOD_(ID3D10ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ LPCSTR Name) PURE;
273 
274  STDMETHOD(GetResourceBindingDesc)(THIS_ UINT ResourceIndex, _Out_ D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE;
275 
276  STDMETHOD(GetInputParameterDesc)(THIS_ UINT ParameterIndex, _Out_ D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
277  STDMETHOD(GetOutputParameterDesc)(THIS_ UINT ParameterIndex, _Out_ D3D10_SIGNATURE_PARAMETER_DESC *pDesc) PURE;
278 
279  STDMETHOD_(ID3D10ShaderReflectionVariable*, GetVariableByName)(THIS_ LPCSTR Name) PURE;
280 
281  STDMETHOD(GetResourceBindingDescByName)(THIS_ LPCSTR Name, _Out_ D3D10_SHADER_INPUT_BIND_DESC *pDesc) PURE;
282 
283  STDMETHOD(GetMovInstructionCount)(THIS_ _Out_ UINT* pCount) PURE;
284  STDMETHOD(GetMovcInstructionCount)(THIS_ _Out_ UINT* pCount) PURE;
285  STDMETHOD(GetConversionInstructionCount)(THIS_ _Out_ UINT* pCount) PURE;
286  STDMETHOD(GetBitwiseInstructionCount)(THIS_ _Out_ UINT* pCount) PURE;
287 
288  STDMETHOD(GetGSInputPrimitive)(THIS_ _Out_ D3D10_PRIMITIVE* pPrim) PURE;
289  STDMETHOD(IsLevel9Shader)(THIS_ _Out_ BOOL* pbLevel9Shader) PURE;
290  STDMETHOD(IsSampleFrequencyShader)(THIS_ _Out_ BOOL* pbSampleFrequency) PURE;
291 };
292 
294 // APIs //////////////////////////////////////////////////////////////////////
296 
297 #ifdef __cplusplus
298 extern "C" {
299 #endif //__cplusplus
300 
301 #ifdef __cplusplus
302 }
303 #endif //__cplusplus
304 
305 #endif //__D3D10_1SHADER_H__
306 
struct _D3D10_SHADER_DEBUG_OUTPUTVAR D3D10_SHADER_DEBUG_OUTPUTVAR
enum _D3D10_SHADER_DEBUG_VARTYPE D3D10_SHADER_DEBUG_VARTYPE
UINT ScopeVar
Definition: d3d10_1shader.h:85
struct _D3D10_SHADER_DEBUG_TOKEN_INFO D3D10_SHADER_DEBUG_TOKEN_INFO
INT iValueMax
Definition: d3d10_1shader.h:156
UINT ScopeVariables
Definition: d3d10_1shader.h:238
UINT EntrypointName
Definition: d3d10_1shader.h:223
Definition: d3d10_1shader.h:58
UINT Scopes
Definition: d3d10_1shader.h:202
Definition: d3d10_1shader.h:65
Definition: d3d10_1shader.h:26
D3D10_SHADER_DEBUG_SCOPETYPE ScopeType
Definition: d3d10_1shader.h:142
Definition: d3d10_1shader.h:48
struct _D3D10_SHADER_DEBUG_INFO D3D10_SHADER_DEBUG_INFO
UINT FileData
Definition: d3d10_1shader.h:215
UINT uValueMax
Definition: d3d10_1shader.h:155
Definition: d3d10shader.h:240
UINT InitialValue
Definition: d3d10_1shader.h:104
Definition: glslang_tab.cpp:129
UINT InitialBank
Definition: d3d10_1shader.h:98
UINT TokenId
Definition: d3d10_1shader.h:79
UINT Rows
Definition: d3d10_1shader.h:114
UINT Instructions
Definition: d3d10_1shader.h:228
D3D10_SHADER_DEBUG_OUTPUTVAR OutputVars[4]
Definition: d3d10_1shader.h:172
Definition: d3d10_1shader.h:25
UINT uOutputs
Definition: d3d10_1shader.h:189
D3D_PRIMITIVE
Definition: d3dcommon.h:207
D3D_SHADER_VARIABLE_CLASS D3D10_SHADER_VARIABLE_CLASS
Definition: d3d10shader.h:134
UINT TokenId
Definition: d3d10_1shader.h:72
struct _D3D10_SHADER_DEBUG_VAR_INFO D3D10_SHADER_DEBUG_VAR_INFO
Definition: d3d10_1shader.h:36
UINT UintOffset
Definition: d3d10_1shader.h:240
UINT StringOffset
Definition: d3d10_1shader.h:241
enum _D3D10_SHADER_DEBUG_SCOPETYPE D3D10_SHADER_DEBUG_SCOPETYPE
Definition: d3d10_1shader.h:32
Definition: d3d10_1shader.h:46
D3D10_SHADER_DEBUG_OUTPUTREG_INFO pOutputs[2]
Definition: d3d10_1shader.h:192
Definition: d3d10shader.h:177
UINT ScopeVarOffset
Definition: d3d10_1shader.h:87
UINT TokenId
Definition: d3d10_1shader.h:110
_D3D10_SHADER_DEBUG_VARTYPE
Definition: d3d10_1shader.h:54
UINT FileInfo
Definition: d3d10_1shader.h:227
UINT uVariables
Definition: d3d10_1shader.h:134
FLOAT fValueMax
Definition: d3d10_1shader.h:157
Definition: d3d10_1shader.h:38
UINT FileNameLen
Definition: d3d10_1shader.h:214
UINT uNameLen
Definition: d3d10_1shader.h:144
UINT Tokens
Definition: d3d10_1shader.h:234
UINT Columns
Definition: d3d10_1shader.h:115
UINT Opcode
Definition: d3d10_1shader.h:186
UINT ArrayStrides
Definition: d3d10_1shader.h:132
Definition: d3d10_1shader.h:31
struct _D3D10_SHADER_DEBUG_INST_INFO D3D10_SHADER_DEBUG_INST_INFO
UINT AccessedVarsInfo
Definition: d3d10_1shader.h:208
UINT AccessedVars
Definition: d3d10_1shader.h:207
UINT TokenLength
Definition: d3d10_1shader.h:71
_D3D10_SHADER_DEBUG_REGTYPE
Definition: d3d10_1shader.h:23
UINT InitialComponent
Definition: d3d10_1shader.h:102
UINT InstructionInfo
Definition: d3d10_1shader.h:229
UINT IndexReg
Definition: d3d10_1shader.h:178
Definition: d3d10_1shader.h:44
Definition: d3d10_1shader.h:49
Definition: d3d10_1shader.h:107
struct _D3D10_SHADER_DEBUG_FILE_INFO D3D10_SHADER_DEBUG_FILE_INFO
UINT TokenInfo
Definition: d3d10_1shader.h:235
UINT Name
Definition: d3d10_1shader.h:143
Definition: d3d10_1shader.h:56
DEFINE_GUID(IID_ID3D10ShaderReflection1, 0xc3457783, 0xa846, 0x47ce, 0x95, 0x20, 0xce, 0xa6, 0xf6, 0x6e, 0x74, 0x47)
Definition: d3d10_1shader.h:50
Definition: d3d10_1shader.h:211
Definition: d3d10shader.h:253
struct _D3D10_SHADER_DEBUG_INPUT_INFO D3D10_SHADER_DEBUG_INPUT_INFO
Definition: d3d10_1shader.h:30
INT iValueMin
Definition: d3d10_1shader.h:156
UINT OutputComponents[4]
Definition: d3d10_1shader.h:171
UINT VariableData
Definition: d3d10_1shader.h:146
UINT ScopeVariableInfo
Definition: d3d10_1shader.h:239
Definition: d3d10_1shader.h:28
UINT Size
Definition: d3d10_1shader.h:221
D3D10_SHADER_DEBUG_REGTYPE OutputRegisterSet
Definition: d3d10_1shader.h:165
UINT InputVariables
Definition: d3d10_1shader.h:232
interface ID3D10ShaderReflectionConstantBuffer ID3D10ShaderReflectionConstantBuffer
Definition: d3d10shader.h:313
struct _D3D10_SHADER_DEBUG_SCOPEVAR_INFO D3D10_SHADER_DEBUG_SCOPEVAR_INFO
UINT InitialRegister
Definition: d3d10_1shader.h:100
interface ID3D10ShaderReflectionVariable ID3D10ShaderReflectionVariable
Definition: d3d10shader.h:295
UINT Id
Definition: d3d10_1shader.h:185
UINT uVariables
Definition: d3d10_1shader.h:145
UINT IndexComp
Definition: d3d10_1shader.h:179
UINT TempArrayReg
Definition: d3d10_1shader.h:169
interface ID3D10ShaderReflection1 * LPD3D10SHADERREFLECTION1
Definition: d3d10_1shader.h:254
UINT ScopeInfo
Definition: d3d10_1shader.h:203
D3D10_SHADER_DEBUG_VARTYPE VarType
Definition: d3d10_1shader.h:112
static INLINE ULONG Release(void *object)
Definition: dxgi_common.h:253
interface ID3D10ShaderReflection1 ID3D10ShaderReflection1
Definition: d3d10_1shader.h:253
Definition: d3d10_1shader.h:37
UINT FileLen
Definition: d3d10_1shader.h:216
UINT TokenId
Definition: d3d10_1shader.h:195
Definition: d3d10_1shader.h:150
unsigned int BOOL
Definition: gctypes.h:51
D3D_SHADER_VARIABLE_TYPE D3D10_SHADER_VARIABLE_TYPE
Definition: d3d10shader.h:140
D3D10_SHADER_VARIABLE_TYPE Type
Definition: d3d10_1shader.h:80
Definition: d3d10_1shader.h:90
UINT Scopes
Definition: d3d10_1shader.h:236
UINT FileName
Definition: d3d10_1shader.h:213
struct _D3D10_SHADER_DEBUG_SCOPE_INFO D3D10_SHADER_DEBUG_SCOPE_INFO
UINT VariableInfo
Definition: d3d10_1shader.h:231
UINT NestingLevel
Definition: d3d10_1shader.h:198
UINT StructMemberScope
Definition: d3d10_1shader.h:123
UINT CompileFlags
Definition: d3d10_1shader.h:225
Definition: d3d10_1shader.h:35
UINT Files
Definition: d3d10_1shader.h:226
UINT Line
Definition: d3d10_1shader.h:68
Definition: d3d10_1shader.h:34
Definition: glslang_tab.cpp:135
enum _D3D10_SHADER_DEBUG_REGTYPE D3D10_SHADER_DEBUG_REGTYPE
UINT uArrayIndices
Definition: d3d10_1shader.h:126
UINT Column
Definition: d3d10_1shader.h:69
UINT Variables
Definition: d3d10_1shader.h:230
Definition: glslang_tab.cpp:136
D3D10_SHADER_DEBUG_REGTYPE InitialRegisterSet
Definition: d3d10_1shader.h:95
Definition: d3d10_1shader.h:183
FLOAT fValueMin
Definition: d3d10_1shader.h:157
UINT Var
Definition: d3d10_1shader.h:153
UINT ScopeInfo
Definition: d3d10_1shader.h:237
Definition: d3d10_1shader.h:140
DECLARE_INTERFACE_(ID3D10ShaderReflection1, IUnknown)
Definition: d3d10_1shader.h:263
UINT Creator
Definition: d3d10_1shader.h:222
Definition: d3d10_1shader.h:76
Definition: d3d10_1shader.h:57
UINT Var
Definition: d3d10_1shader.h:93
BOOL bNaNPossible
Definition: d3d10_1shader.h:159
UINT File
Definition: d3d10_1shader.h:67
UINT InputVariableInfo
Definition: d3d10_1shader.h:233
UINT uFirstVariable
Definition: d3d10_1shader.h:136
Definition: d3d10_1shader.h:51
struct _D3D10_SHADER_DEBUG_OUTPUTREG_INFO D3D10_SHADER_DEBUG_OUTPUTREG_INFO
UINT ArrayElements
Definition: d3d10_1shader.h:129
UINT ShaderTarget
Definition: d3d10_1shader.h:224
Definition: d3d10_1shader.h:27
D3D10_SHADER_VARIABLE_CLASS Class
Definition: d3d10_1shader.h:113
Definition: d3d10_1shader.h:219
Definition: d3d10_1shader.h:47
UINT OutputReg
Definition: d3d10_1shader.h:167
_D3D10_SHADER_DEBUG_SCOPETYPE
Definition: d3d10_1shader.h:41
BOOL bInfPossible
Definition: d3d10_1shader.h:159
Definition: d3d10_1shader.h:162
UINT Register
Definition: d3d10_1shader.h:82
Definition: d3d10_1shader.h:33
UINT Component
Definition: d3d10_1shader.h:83
Definition: d3d10_1shader.h:29
UINT uValueMin
Definition: d3d10_1shader.h:155
Definition: d3d10_1shader.h:43
Definition: d3d10_1shader.h:45