ReactOS  0.4.15-dev-3287-gfec35dc
d3dx9shader.h File Reference
#include "d3dx9.h"
Include dependency graph for d3dx9shader.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _D3DXCONSTANTTABLE_DESC
 
struct  _D3DXCONSTANT_DESC
 
struct  _D3DXMACRO
 
struct  _D3DXSEMANTIC
 
struct  _D3DXFRAGMENT_DESC
 
struct  _D3DXSHADER_CONSTANTTABLE
 
struct  _D3DXSHADER_CONSTANTINFO
 
struct  _D3DXSHADER_TYPEINFO
 
struct  _D3DXSHADER_STRUCTMEMBERINFO
 

Macros

#define D3DXSHADER_DEBUG   0x1
 
#define D3DXSHADER_SKIPVALIDATION   0x2
 
#define D3DXSHADER_SKIPOPTIMIZATION   0x4
 
#define D3DXSHADER_PACKMATRIX_ROWMAJOR   0x8
 
#define D3DXSHADER_PACKMATRIX_COLUMNMAJOR   0x10
 
#define D3DXSHADER_PARTIALPRECISION   0x20
 
#define D3DXSHADER_FORCE_VS_SOFTWARE_NOOPT   0x40
 
#define D3DXSHADER_FORCE_PS_SOFTWARE_NOOPT   0x80
 
#define D3DXSHADER_NO_PRESHADER   0x100
 
#define D3DXSHADER_AVOID_FLOW_CONTROL   0x200
 
#define D3DXSHADER_PREFER_FLOW_CONTROL   0x400
 
#define D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY   0x1000
 
#define D3DXSHADER_IEEE_STRICTNESS   0x2000
 
#define D3DXSHADER_OPTIMIZATION_LEVEL0   0x4000
 
#define D3DXSHADER_OPTIMIZATION_LEVEL1   0x0
 
#define D3DXSHADER_OPTIMIZATION_LEVEL2   0xC000
 
#define D3DXSHADER_OPTIMIZATION_LEVEL3   0x8000
 
#define D3DXSHADER_USE_LEGACY_D3DX9_31_DLL   0x10000
 
#define D3DXCONSTTABLE_LARGEADDRESSAWARE   0x20000
 
#define INTERFACE   ID3DXConstantTable
 
#define ID3DXConstantTable_QueryInterface(p, a, b)   (p)->lpVtbl->QueryInterface(p,a,b)
 
#define ID3DXConstantTable_AddRef(p)   (p)->lpVtbl->AddRef(p)
 
#define ID3DXConstantTable_Release(p)   (p)->lpVtbl->Release(p)
 
#define ID3DXConstantTable_GetBufferPointer(p)   (p)->lpVtbl->GetBufferPointer(p)
 
#define ID3DXConstantTable_GetBufferSize(p)   (p)->lpVtbl->GetBufferSize(p)
 
#define ID3DXConstantTable_GetDesc(p, a)   (p)->lpVtbl->GetDesc(p,a)
 
#define ID3DXConstantTable_GetConstantDesc(p, a, b, c)   (p)->lpVtbl->GetConstantDesc(p,a,b,c)
 
#define ID3DXConstantTable_GetSamplerIndex(p, a)   (p)->lpVtbl->GetSamplerIndex(p,a)
 
#define ID3DXConstantTable_GetConstant(p, a, b)   (p)->lpVtbl->GetConstant(p,a,b)
 
#define ID3DXConstantTable_GetConstantByName(p, a, b)   (p)->lpVtbl->GetConstantByName(p,a,b)
 
#define ID3DXConstantTable_GetConstantElement(p, a, b)   (p)->lpVtbl->GetConstantElement(p,a,b)
 
#define ID3DXConstantTable_SetDefaults(p, a)   (p)->lpVtbl->SetDefaults(p,a)
 
#define ID3DXConstantTable_SetValue(p, a, b, c, d)   (p)->lpVtbl->SetValue(p,a,b,c,d)
 
#define ID3DXConstantTable_SetBool(p, a, b, c)   (p)->lpVtbl->SetBool(p,a,b,c)
 
#define ID3DXConstantTable_SetBoolArray(p, a, b, c, d)   (p)->lpVtbl->SetBoolArray(p,a,b,c,d)
 
#define ID3DXConstantTable_SetInt(p, a, b, c)   (p)->lpVtbl->SetInt(p,a,b,c)
 
#define ID3DXConstantTable_SetIntArray(p, a, b, c, d)   (p)->lpVtbl->SetIntArray(p,a,b,c,d)
 
#define ID3DXConstantTable_SetFloat(p, a, b, c)   (p)->lpVtbl->SetFloat(p,a,b,c)
 
#define ID3DXConstantTable_SetFloatArray(p, a, b, c, d)   (p)->lpVtbl->SetFloatArray(p,a,b,c,d)
 
#define ID3DXConstantTable_SetVector(p, a, b, c)   (p)->lpVtbl->SetVector(p,a,b,c)
 
#define ID3DXConstantTable_SetVectorArray(p, a, b, c, d)   (p)->lpVtbl->SetVectorArray(p,a,b,c,d)
 
#define ID3DXConstantTable_SetMatrix(p, a, b, c)   (p)->lpVtbl->SetMatrix(p,a,b,c)
 
#define ID3DXConstantTable_SetMatrixArray(p, a, b, c, d)   (p)->lpVtbl->SetMatrixArray(p,a,b,c,d)
 
#define ID3DXConstantTable_SetMatrixPointerArray(p, a, b, c, d)   (p)->lpVtbl->SetMatrixPointerArray(p,a,b,c,d)
 
#define ID3DXConstantTable_SetMatrixTranspose(p, a, b, c)   (p)->lpVtbl->SetMatrixTranspose(p,a,b,c)
 
#define ID3DXConstantTable_SetMatrixTransposeArray(p, a, b, c, d)   (p)->lpVtbl->SetMatrixTransposeArray(p,a,b,c,d)
 
#define ID3DXConstantTable_SetMatrixTransposePointerArray(p, a, b, c, d)   (p)->lpVtbl->SetMatrixTransposePointerArray(p,a,b,c,d)
 
#define INTERFACE   ID3DXTextureShader
 
#define INTERFACE   ID3DXInclude
 
#define ID3DXInclude_Open(p, a, b, c, d, e)   (p)->lpVtbl->Open(p,a,b,c,d,e)
 
#define ID3DXInclude_Close(p, a)   (p)->lpVtbl->Close(p,a)
 
#define INTERFACE   ID3DXFragmentLinker
 
#define D3DXAssembleShaderFromFile   WINELIB_NAME_AW(D3DXAssembleShaderFromFile)
 
#define D3DXAssembleShaderFromResource   WINELIB_NAME_AW(D3DXAssembleShaderFromResource)
 
#define D3DXCompileShaderFromFile   WINELIB_NAME_AW(D3DXCompileShaderFromFile)
 
#define D3DXCompileShaderFromResource   WINELIB_NAME_AW(D3DXCompileShaderFromResource)
 
#define D3DXPreprocessShaderFromFile   WINELIB_NAME_AW(D3DXPreprocessShaderFromFile)
 
#define D3DXPreprocessShaderFromResource   WINELIB_NAME_AW(D3DXPreprocessShaderFromResource)
 

Typedefs

typedef const charD3DXHANDLE
 
typedef D3DXHANDLELPD3DXHANDLE
 
typedef enum _D3DXREGISTER_SET D3DXREGISTER_SET
 
typedef enum _D3DXREGISTER_SETLPD3DXREGISTER_SET
 
typedef enum D3DXPARAMETER_CLASS D3DXPARAMETER_CLASS
 
typedef enum D3DXPARAMETER_CLASSLPD3DXPARAMETER_CLASS
 
typedef enum D3DXPARAMETER_TYPE D3DXPARAMETER_TYPE
 
typedef enum D3DXPARAMETER_TYPELPD3DXPARAMETER_TYPE
 
typedef struct _D3DXCONSTANTTABLE_DESC D3DXCONSTANTTABLE_DESC
 
typedef struct _D3DXCONSTANTTABLE_DESCLPD3DXCONSTANTTABLE_DESC
 
typedef struct _D3DXCONSTANT_DESC D3DXCONSTANT_DESC
 
typedef struct _D3DXCONSTANT_DESCLPD3DXCONSTANT_DESC
 
typedef struct ID3DXConstantTable * LPD3DXCONSTANTTABLE
 
typedef interface ID3DXTextureShader * LPD3DXTEXTURESHADER
 
typedef struct _D3DXMACRO D3DXMACRO
 
typedef struct _D3DXMACROLPD3DXMACRO
 
typedef struct _D3DXSEMANTIC D3DXSEMANTIC
 
typedef struct _D3DXSEMANTICLPD3DXSEMANTIC
 
typedef enum _D3DXINCLUDE_TYPE D3DXINCLUDE_TYPE
 
typedef enum _D3DXINCLUDE_TYPELPD3DXINCLUDE_TYPE
 
typedef struct ID3DXInclude * LPD3DXINCLUDE
 
typedef struct _D3DXFRAGMENT_DESC D3DXFRAGMENT_DESC
 
typedef struct _D3DXFRAGMENT_DESCLPD3DXFRAGMENT_DESC
 
typedef struct _D3DXSHADER_CONSTANTTABLE D3DXSHADER_CONSTANTTABLE
 
typedef struct _D3DXSHADER_CONSTANTTABLELPD3DXSHADER_CONSTANTTABLE
 
typedef struct _D3DXSHADER_CONSTANTINFO D3DXSHADER_CONSTANTINFO
 
typedef struct _D3DXSHADER_CONSTANTINFOLPD3DXSHADER_CONSTANTINFO
 
typedef struct _D3DXSHADER_TYPEINFO D3DXSHADER_TYPEINFO
 
typedef struct _D3DXSHADER_TYPEINFOLPD3DXSHADER_TYPEINFO
 
typedef struct _D3DXSHADER_STRUCTMEMBERINFO D3DXSHADER_STRUCTMEMBERINFO
 
typedef struct _D3DXSHADER_STRUCTMEMBERINFOLPD3DXSHADER_STRUCTMEMBERINFO
 

Enumerations

enum  _D3DXREGISTER_SET {
  D3DXRS_BOOL, D3DXRS_INT4, D3DXRS_FLOAT4, D3DXRS_SAMPLER,
  D3DXRS_FORCE_DWORD = 0x7fffffff
}
 
enum  D3DXPARAMETER_CLASS {
  D3DXPC_SCALAR, D3DXPC_VECTOR, D3DXPC_MATRIX_ROWS, D3DXPC_MATRIX_COLUMNS,
  D3DXPC_OBJECT, D3DXPC_STRUCT, D3DXPC_FORCE_DWORD = 0x7fffffff
}
 
enum  D3DXPARAMETER_TYPE {
  D3DXPT_VOID, D3DXPT_BOOL, D3DXPT_INT, D3DXPT_FLOAT,
  D3DXPT_STRING, D3DXPT_TEXTURE, D3DXPT_TEXTURE1D, D3DXPT_TEXTURE2D,
  D3DXPT_TEXTURE3D, D3DXPT_TEXTURECUBE, D3DXPT_SAMPLER, D3DXPT_SAMPLER1D,
  D3DXPT_SAMPLER2D, D3DXPT_SAMPLER3D, D3DXPT_SAMPLERCUBE, D3DXPT_PIXELSHADER,
  D3DXPT_VERTEXSHADER, D3DXPT_PIXELFRAGMENT, D3DXPT_VERTEXFRAGMENT, D3DXPT_UNSUPPORTED,
  D3DXPT_FORCE_DWORD = 0x7fffffff
}
 
enum  _D3DXINCLUDE_TYPE { D3DXINC_LOCAL, D3DXINC_SYSTEM, D3DXINC_FORCE_DWORD = 0x7fffffff }
 

Functions

 DEFINE_GUID (IID_ID3DXConstantTable, 0x9dca3190, 0x38b9, 0x4fc3, 0x92, 0xe3, 0x39, 0xc6, 0xdd, 0xfb, 0x35, 0x8b)
 
 DECLARE_INTERFACE_ (ID3DXConstantTable, ID3DXBuffer)
 
 DEFINE_GUID (IID_ID3DXTextureShader, 0x3e3d67f8, 0xaa7a, 0x405d, 0xa8, 0x57, 0xba, 0x1, 0xd4, 0x75, 0x84, 0x26)
 
 DECLARE_INTERFACE_ (ID3DXTextureShader, IUnknown)
 
 DECLARE_INTERFACE (ID3DXInclude)
 
 DEFINE_GUID (IID_ID3DXFragmentLinker, 0x1a2c0cc2, 0xe5b6, 0x4ebc, 0x9e, 0x8d, 0x39, 0xe, 0x5, 0x78, 0x11, 0xb6)
 
 DECLARE_INTERFACE_ (ID3DXFragmentLinker, IUnknown)
 
const char *WINAPI D3DXGetPixelShaderProfile (struct IDirect3DDevice9 *device)
 
UINT WINAPI D3DXGetShaderSize (const DWORD *byte_code)
 
DWORD WINAPI D3DXGetShaderVersion (const DWORD *byte_code)
 
const char *WINAPI D3DXGetVertexShaderProfile (struct IDirect3DDevice9 *device)
 
HRESULT WINAPI D3DXFindShaderComment (const DWORD *byte_code, DWORD fourcc, const void **data, UINT *size)
 
HRESULT WINAPI D3DXGetShaderSamplers (const DWORD *byte_code, const char **samplers, UINT *count)
 
HRESULT WINAPI D3DXGetShaderInputSemantics (const DWORD *byte_code, D3DXSEMANTIC *semantics, UINT *count)
 
HRESULT WINAPI D3DXGetShaderOuputSemantics (const DWORD *byte_code, D3DXSEMANTIC *semantics, UINT *count)
 
HRESULT WINAPI D3DXAssembleShaderFromFileA (const char *filename, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
 
HRESULT WINAPI D3DXAssembleShaderFromFileW (const WCHAR *filename, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
 
HRESULT WINAPI D3DXAssembleShaderFromResourceA (HMODULE module, const char *resource, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
 
HRESULT WINAPI D3DXAssembleShaderFromResourceW (HMODULE module, const WCHAR *resource, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
 
HRESULT WINAPI D3DXAssembleShader (const char *data, UINT data_len, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
 
HRESULT WINAPI D3DXCompileShader (const char *src_data, UINT data_len, const D3DXMACRO *defines, ID3DXInclude *include, const char *function_name, const char *profile, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages, ID3DXConstantTable **constant_table)
 
HRESULT WINAPI D3DXDisassembleShader (const DWORD *pShader, BOOL EnableColorCode, const char *pComments, struct ID3DXBuffer **ppDisassembly)
 
HRESULT WINAPI D3DXCompileShaderFromFileA (const char *filename, const D3DXMACRO *defines, ID3DXInclude *include, const char *entrypoint, const char *profile, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages, ID3DXConstantTable **constant_table)
 
HRESULT WINAPI D3DXCompileShaderFromFileW (const WCHAR *filename, const D3DXMACRO *defines, ID3DXInclude *include, const char *entrypoint, const char *profile, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages, ID3DXConstantTable **constant_table)
 
HRESULT WINAPI D3DXCompileShaderFromResourceA (HMODULE module, const char *resource, const D3DXMACRO *defines, ID3DXInclude *include, const char *entrypoint, const char *profile, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages, ID3DXConstantTable **constant_table)
 
HRESULT WINAPI D3DXCompileShaderFromResourceW (HMODULE module, const WCHAR *resource, const D3DXMACRO *defines, ID3DXInclude *include, const char *entrypoint, const char *profile, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages, ID3DXConstantTable **constant_table)
 
HRESULT WINAPI D3DXPreprocessShader (const char *data, UINT data_len, const D3DXMACRO *defines, ID3DXInclude *include, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
 
HRESULT WINAPI D3DXPreprocessShaderFromFileA (const char *filename, const D3DXMACRO *defines, ID3DXInclude *include, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
 
HRESULT WINAPI D3DXPreprocessShaderFromFileW (const WCHAR *filename, const D3DXMACRO *defines, ID3DXInclude *include, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
 
HRESULT WINAPI D3DXPreprocessShaderFromResourceA (HMODULE module, const char *resource, const D3DXMACRO *defines, ID3DXInclude *include, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
 
HRESULT WINAPI D3DXPreprocessShaderFromResourceW (HMODULE module, const WCHAR *resource, const D3DXMACRO *defines, ID3DXInclude *include, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
 
HRESULT WINAPI D3DXGetShaderConstantTableEx (const DWORD *byte_code, DWORD flags, ID3DXConstantTable **constant_table)
 
HRESULT WINAPI D3DXGetShaderConstantTable (const DWORD *byte_code, ID3DXConstantTable **constant_table)
 
HRESULT WINAPI D3DXGetShaderOutputSemantics (const DWORD *pFunction, D3DXSEMANTIC *pSemantics, UINT *pCount)
 
HRESULT WINAPI D3DXCreateTextureShader (const DWORD *pFunction, ID3DXTextureShader **ppTextureShader)
 
HRESULT WINAPI D3DXCreateFragmentLinker (IDirect3DDevice9 *device, UINT size, ID3DXFragmentLinker **linker)
 
HRESULT WINAPI D3DXCreateFragmentLinkerEx (IDirect3DDevice9 *device, UINT size, DWORD flags, ID3DXFragmentLinker **linker)
 

Macro Definition Documentation

◆ D3DXAssembleShaderFromFile

#define D3DXAssembleShaderFromFile   WINELIB_NAME_AW(D3DXAssembleShaderFromFile)

Definition at line 362 of file d3dx9shader.h.

◆ D3DXAssembleShaderFromResource

#define D3DXAssembleShaderFromResource   WINELIB_NAME_AW(D3DXAssembleShaderFromResource)

Definition at line 368 of file d3dx9shader.h.

◆ D3DXCompileShaderFromFile

#define D3DXCompileShaderFromFile   WINELIB_NAME_AW(D3DXCompileShaderFromFile)

Definition at line 385 of file d3dx9shader.h.

◆ D3DXCompileShaderFromResource

#define D3DXCompileShaderFromResource   WINELIB_NAME_AW(D3DXCompileShaderFromResource)

Definition at line 393 of file d3dx9shader.h.

◆ D3DXCONSTTABLE_LARGEADDRESSAWARE

#define D3DXCONSTTABLE_LARGEADDRESSAWARE   0x20000

Definition at line 46 of file d3dx9shader.h.

◆ D3DXPreprocessShaderFromFile

#define D3DXPreprocessShaderFromFile   WINELIB_NAME_AW(D3DXPreprocessShaderFromFile)

Definition at line 402 of file d3dx9shader.h.

◆ D3DXPreprocessShaderFromResource

#define D3DXPreprocessShaderFromResource   WINELIB_NAME_AW(D3DXPreprocessShaderFromResource)

Definition at line 408 of file d3dx9shader.h.

◆ D3DXSHADER_AVOID_FLOW_CONTROL

#define D3DXSHADER_AVOID_FLOW_CONTROL   0x200

Definition at line 34 of file d3dx9shader.h.

◆ D3DXSHADER_DEBUG

#define D3DXSHADER_DEBUG   0x1

Definition at line 25 of file d3dx9shader.h.

◆ D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY

#define D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY   0x1000

Definition at line 36 of file d3dx9shader.h.

◆ D3DXSHADER_FORCE_PS_SOFTWARE_NOOPT

#define D3DXSHADER_FORCE_PS_SOFTWARE_NOOPT   0x80

Definition at line 32 of file d3dx9shader.h.

◆ D3DXSHADER_FORCE_VS_SOFTWARE_NOOPT

#define D3DXSHADER_FORCE_VS_SOFTWARE_NOOPT   0x40

Definition at line 31 of file d3dx9shader.h.

◆ D3DXSHADER_IEEE_STRICTNESS

#define D3DXSHADER_IEEE_STRICTNESS   0x2000

Definition at line 37 of file d3dx9shader.h.

◆ D3DXSHADER_NO_PRESHADER

#define D3DXSHADER_NO_PRESHADER   0x100

Definition at line 33 of file d3dx9shader.h.

◆ D3DXSHADER_OPTIMIZATION_LEVEL0

#define D3DXSHADER_OPTIMIZATION_LEVEL0   0x4000

Definition at line 39 of file d3dx9shader.h.

◆ D3DXSHADER_OPTIMIZATION_LEVEL1

#define D3DXSHADER_OPTIMIZATION_LEVEL1   0x0

Definition at line 40 of file d3dx9shader.h.

◆ D3DXSHADER_OPTIMIZATION_LEVEL2

#define D3DXSHADER_OPTIMIZATION_LEVEL2   0xC000

Definition at line 41 of file d3dx9shader.h.

◆ D3DXSHADER_OPTIMIZATION_LEVEL3

#define D3DXSHADER_OPTIMIZATION_LEVEL3   0x8000

Definition at line 42 of file d3dx9shader.h.

◆ D3DXSHADER_PACKMATRIX_COLUMNMAJOR

#define D3DXSHADER_PACKMATRIX_COLUMNMAJOR   0x10

Definition at line 29 of file d3dx9shader.h.

◆ D3DXSHADER_PACKMATRIX_ROWMAJOR

#define D3DXSHADER_PACKMATRIX_ROWMAJOR   0x8

Definition at line 28 of file d3dx9shader.h.

◆ D3DXSHADER_PARTIALPRECISION

#define D3DXSHADER_PARTIALPRECISION   0x20

Definition at line 30 of file d3dx9shader.h.

◆ D3DXSHADER_PREFER_FLOW_CONTROL

#define D3DXSHADER_PREFER_FLOW_CONTROL   0x400

Definition at line 35 of file d3dx9shader.h.

◆ D3DXSHADER_SKIPOPTIMIZATION

#define D3DXSHADER_SKIPOPTIMIZATION   0x4

Definition at line 27 of file d3dx9shader.h.

◆ D3DXSHADER_SKIPVALIDATION

#define D3DXSHADER_SKIPVALIDATION   0x2

Definition at line 26 of file d3dx9shader.h.

◆ D3DXSHADER_USE_LEGACY_D3DX9_31_DLL

#define D3DXSHADER_USE_LEGACY_D3DX9_31_DLL   0x10000

Definition at line 44 of file d3dx9shader.h.

◆ ID3DXConstantTable_AddRef

#define ID3DXConstantTable_AddRef (   p)    (p)->lpVtbl->AddRef(p)

Definition at line 176 of file d3dx9shader.h.

◆ ID3DXConstantTable_GetBufferPointer

#define ID3DXConstantTable_GetBufferPointer (   p)    (p)->lpVtbl->GetBufferPointer(p)

Definition at line 179 of file d3dx9shader.h.

◆ ID3DXConstantTable_GetBufferSize

#define ID3DXConstantTable_GetBufferSize (   p)    (p)->lpVtbl->GetBufferSize(p)

Definition at line 180 of file d3dx9shader.h.

◆ ID3DXConstantTable_GetConstant

#define ID3DXConstantTable_GetConstant (   p,
  a,
  b 
)    (p)->lpVtbl->GetConstant(p,a,b)

Definition at line 185 of file d3dx9shader.h.

◆ ID3DXConstantTable_GetConstantByName

#define ID3DXConstantTable_GetConstantByName (   p,
  a,
  b 
)    (p)->lpVtbl->GetConstantByName(p,a,b)

Definition at line 186 of file d3dx9shader.h.

◆ ID3DXConstantTable_GetConstantDesc

#define ID3DXConstantTable_GetConstantDesc (   p,
  a,
  b,
  c 
)    (p)->lpVtbl->GetConstantDesc(p,a,b,c)

Definition at line 183 of file d3dx9shader.h.

◆ ID3DXConstantTable_GetConstantElement

#define ID3DXConstantTable_GetConstantElement (   p,
  a,
  b 
)    (p)->lpVtbl->GetConstantElement(p,a,b)

Definition at line 187 of file d3dx9shader.h.

◆ ID3DXConstantTable_GetDesc

#define ID3DXConstantTable_GetDesc (   p,
  a 
)    (p)->lpVtbl->GetDesc(p,a)

Definition at line 182 of file d3dx9shader.h.

◆ ID3DXConstantTable_GetSamplerIndex

#define ID3DXConstantTable_GetSamplerIndex (   p,
  a 
)    (p)->lpVtbl->GetSamplerIndex(p,a)

Definition at line 184 of file d3dx9shader.h.

◆ ID3DXConstantTable_QueryInterface

#define ID3DXConstantTable_QueryInterface (   p,
  a,
  b 
)    (p)->lpVtbl->QueryInterface(p,a,b)

Definition at line 175 of file d3dx9shader.h.

◆ ID3DXConstantTable_Release

#define ID3DXConstantTable_Release (   p)    (p)->lpVtbl->Release(p)

Definition at line 177 of file d3dx9shader.h.

◆ ID3DXConstantTable_SetBool

#define ID3DXConstantTable_SetBool (   p,
  a,
  b,
  c 
)    (p)->lpVtbl->SetBool(p,a,b,c)

Definition at line 190 of file d3dx9shader.h.

◆ ID3DXConstantTable_SetBoolArray

#define ID3DXConstantTable_SetBoolArray (   p,
  a,
  b,
  c,
  d 
)    (p)->lpVtbl->SetBoolArray(p,a,b,c,d)

Definition at line 191 of file d3dx9shader.h.

◆ ID3DXConstantTable_SetDefaults

#define ID3DXConstantTable_SetDefaults (   p,
  a 
)    (p)->lpVtbl->SetDefaults(p,a)

Definition at line 188 of file d3dx9shader.h.

◆ ID3DXConstantTable_SetFloat

#define ID3DXConstantTable_SetFloat (   p,
  a,
  b,
  c 
)    (p)->lpVtbl->SetFloat(p,a,b,c)

Definition at line 194 of file d3dx9shader.h.

◆ ID3DXConstantTable_SetFloatArray

#define ID3DXConstantTable_SetFloatArray (   p,
  a,
  b,
  c,
  d 
)    (p)->lpVtbl->SetFloatArray(p,a,b,c,d)

Definition at line 195 of file d3dx9shader.h.

◆ ID3DXConstantTable_SetInt

#define ID3DXConstantTable_SetInt (   p,
  a,
  b,
  c 
)    (p)->lpVtbl->SetInt(p,a,b,c)

Definition at line 192 of file d3dx9shader.h.

◆ ID3DXConstantTable_SetIntArray

#define ID3DXConstantTable_SetIntArray (   p,
  a,
  b,
  c,
  d 
)    (p)->lpVtbl->SetIntArray(p,a,b,c,d)

Definition at line 193 of file d3dx9shader.h.

◆ ID3DXConstantTable_SetMatrix

#define ID3DXConstantTable_SetMatrix (   p,
  a,
  b,
  c 
)    (p)->lpVtbl->SetMatrix(p,a,b,c)

Definition at line 198 of file d3dx9shader.h.

◆ ID3DXConstantTable_SetMatrixArray

#define ID3DXConstantTable_SetMatrixArray (   p,
  a,
  b,
  c,
  d 
)    (p)->lpVtbl->SetMatrixArray(p,a,b,c,d)

Definition at line 199 of file d3dx9shader.h.

◆ ID3DXConstantTable_SetMatrixPointerArray

#define ID3DXConstantTable_SetMatrixPointerArray (   p,
  a,
  b,
  c,
  d 
)    (p)->lpVtbl->SetMatrixPointerArray(p,a,b,c,d)

Definition at line 200 of file d3dx9shader.h.

◆ ID3DXConstantTable_SetMatrixTranspose

#define ID3DXConstantTable_SetMatrixTranspose (   p,
  a,
  b,
  c 
)    (p)->lpVtbl->SetMatrixTranspose(p,a,b,c)

Definition at line 201 of file d3dx9shader.h.

◆ ID3DXConstantTable_SetMatrixTransposeArray

#define ID3DXConstantTable_SetMatrixTransposeArray (   p,
  a,
  b,
  c,
  d 
)    (p)->lpVtbl->SetMatrixTransposeArray(p,a,b,c,d)

Definition at line 202 of file d3dx9shader.h.

◆ ID3DXConstantTable_SetMatrixTransposePointerArray

#define ID3DXConstantTable_SetMatrixTransposePointerArray (   p,
  a,
  b,
  c,
  d 
)    (p)->lpVtbl->SetMatrixTransposePointerArray(p,a,b,c,d)

Definition at line 203 of file d3dx9shader.h.

◆ ID3DXConstantTable_SetValue

#define ID3DXConstantTable_SetValue (   p,
  a,
  b,
  c,
  d 
)    (p)->lpVtbl->SetValue(p,a,b,c,d)

Definition at line 189 of file d3dx9shader.h.

◆ ID3DXConstantTable_SetVector

#define ID3DXConstantTable_SetVector (   p,
  a,
  b,
  c 
)    (p)->lpVtbl->SetVector(p,a,b,c)

Definition at line 196 of file d3dx9shader.h.

◆ ID3DXConstantTable_SetVectorArray

#define ID3DXConstantTable_SetVectorArray (   p,
  a,
  b,
  c,
  d 
)    (p)->lpVtbl->SetVectorArray(p,a,b,c,d)

Definition at line 197 of file d3dx9shader.h.

◆ ID3DXInclude_Close

#define ID3DXInclude_Close (   p,
  a 
)    (p)->lpVtbl->Close(p,a)

Definition at line 304 of file d3dx9shader.h.

◆ ID3DXInclude_Open

#define ID3DXInclude_Open (   p,
  a,
  b,
  c,
  d,
  e 
)    (p)->lpVtbl->Open(p,a,b,c,d,e)

Definition at line 303 of file d3dx9shader.h.

◆ INTERFACE [1/4]

#define INTERFACE   ID3DXConstantTable

Definition at line 318 of file d3dx9shader.h.

◆ INTERFACE [2/4]

#define INTERFACE   ID3DXTextureShader

Definition at line 318 of file d3dx9shader.h.

◆ INTERFACE [3/4]

#define INTERFACE   ID3DXInclude

Definition at line 318 of file d3dx9shader.h.

◆ INTERFACE [4/4]

#define INTERFACE   ID3DXFragmentLinker

Definition at line 318 of file d3dx9shader.h.

Typedef Documentation

◆ D3DXCONSTANT_DESC

◆ D3DXCONSTANTTABLE_DESC

◆ D3DXFRAGMENT_DESC

◆ D3DXHANDLE

typedef const char* D3DXHANDLE

Definition at line 48 of file d3dx9shader.h.

◆ D3DXINCLUDE_TYPE

◆ D3DXMACRO

◆ D3DXPARAMETER_CLASS

◆ D3DXPARAMETER_TYPE

◆ D3DXREGISTER_SET

◆ D3DXSEMANTIC

◆ D3DXSHADER_CONSTANTINFO

◆ D3DXSHADER_CONSTANTTABLE

◆ D3DXSHADER_STRUCTMEMBERINFO

◆ D3DXSHADER_TYPEINFO

◆ LPD3DXCONSTANT_DESC

◆ LPD3DXCONSTANTTABLE

typedef struct ID3DXConstantTable* LPD3DXCONSTANTTABLE

Definition at line 237 of file d3dx9shader.h.

◆ LPD3DXCONSTANTTABLE_DESC

◆ LPD3DXFRAGMENT_DESC

◆ LPD3DXHANDLE

Definition at line 49 of file d3dx9shader.h.

◆ LPD3DXINCLUDE

typedef struct ID3DXInclude* LPD3DXINCLUDE

Definition at line 306 of file d3dx9shader.h.

◆ LPD3DXINCLUDE_TYPE

◆ LPD3DXMACRO

◆ LPD3DXPARAMETER_CLASS

◆ LPD3DXPARAMETER_TYPE

◆ LPD3DXREGISTER_SET

◆ LPD3DXSEMANTIC

◆ LPD3DXSHADER_CONSTANTINFO

◆ LPD3DXSHADER_CONSTANTTABLE

◆ LPD3DXSHADER_STRUCTMEMBERINFO

◆ LPD3DXSHADER_TYPEINFO

◆ LPD3DXTEXTURESHADER

typedef interface ID3DXTextureShader* LPD3DXTEXTURESHADER

Definition at line 239 of file d3dx9shader.h.

Enumeration Type Documentation

◆ _D3DXINCLUDE_TYPE

Enumerator
D3DXINC_LOCAL 
D3DXINC_SYSTEM 
D3DXINC_FORCE_DWORD 

Definition at line 286 of file d3dx9shader.h.

287 {
290  D3DXINC_FORCE_DWORD = 0x7fffffff,
enum _D3DXINCLUDE_TYPE D3DXINCLUDE_TYPE
enum _D3DXINCLUDE_TYPE * LPD3DXINCLUDE_TYPE

◆ _D3DXREGISTER_SET

Enumerator
D3DXRS_BOOL 
D3DXRS_INT4 
D3DXRS_FLOAT4 
D3DXRS_SAMPLER 
D3DXRS_FORCE_DWORD 

Definition at line 51 of file d3dx9shader.h.

52 {
57  D3DXRS_FORCE_DWORD = 0x7fffffff
enum _D3DXREGISTER_SET * LPD3DXREGISTER_SET
enum _D3DXREGISTER_SET D3DXREGISTER_SET

◆ D3DXPARAMETER_CLASS

Enumerator
D3DXPC_SCALAR 
D3DXPC_VECTOR 
D3DXPC_MATRIX_ROWS 
D3DXPC_MATRIX_COLUMNS 
D3DXPC_OBJECT 
D3DXPC_STRUCT 
D3DXPC_FORCE_DWORD 

Definition at line 60 of file d3dx9shader.h.

◆ D3DXPARAMETER_TYPE

Enumerator
D3DXPT_VOID 
D3DXPT_BOOL 
D3DXPT_INT 
D3DXPT_FLOAT 
D3DXPT_STRING 
D3DXPT_TEXTURE 
D3DXPT_TEXTURE1D 
D3DXPT_TEXTURE2D 
D3DXPT_TEXTURE3D 
D3DXPT_TEXTURECUBE 
D3DXPT_SAMPLER 
D3DXPT_SAMPLER1D 
D3DXPT_SAMPLER2D 
D3DXPT_SAMPLER3D 
D3DXPT_SAMPLERCUBE 
D3DXPT_PIXELSHADER 
D3DXPT_VERTEXSHADER 
D3DXPT_PIXELFRAGMENT 
D3DXPT_VERTEXFRAGMENT 
D3DXPT_UNSUPPORTED 
D3DXPT_FORCE_DWORD 

Definition at line 71 of file d3dx9shader.h.

72 {
75  D3DXPT_INT,
93  D3DXPT_FORCE_DWORD = 0x7fffffff,
D3DXPARAMETER_TYPE
Definition: d3dx9shader.h:71
enum D3DXPARAMETER_TYPE * LPD3DXPARAMETER_TYPE

Function Documentation

◆ D3DXAssembleShader()

HRESULT WINAPI D3DXAssembleShader ( const char data,
UINT  data_len,
const D3DXMACRO defines,
ID3DXInclude *  include,
DWORD  flags,
ID3DXBuffer **  shader,
ID3DXBuffer **  error_messages 
)

Definition at line 200 of file shader.c.

202 {
203  HRESULT hr;
204 
205  TRACE("data %p, data_len %u, defines %p, include %p, flags %#x, shader %p, error_messages %p\n",
206  data, data_len, defines, include, flags, shader, error_messages);
207 
208  /* Forward to d3dcompiler: the parameter types aren't really different,
209  the actual data types are equivalent */
210  hr = D3DAssemble(data, data_len, NULL, (D3D_SHADER_MACRO *)defines,
213 
214  if(hr == E_FAIL) hr = D3DXERR_INVALIDDATA;
215  return hr;
216 }
HRESULT hr
Definition: shlfolder.c:183
#define E_FAIL
Definition: ddrawi.h:102
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
Definition: asm.c:30
LONG HRESULT
Definition: typedefs.h:79
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ID3DBlob ** error_messages
Definition: asm.c:30
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLbitfield flags
Definition: glext.h:7161
HRESULT WINAPI D3DAssemble(const void *data, SIZE_T datasize, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, UINT flags, ID3DBlob **shader, ID3DBlob **error_messages)
Definition: compiler.c:630
#define NULL
Definition: types.h:112
static SIZE_T const char const D3D_SHADER_MACRO * defines
Definition: asm.c:30

Referenced by assembleshader_test(), D3DXAssembleShaderFromFileW(), D3DXAssembleShaderFromResourceA(), and D3DXAssembleShaderFromResourceW().

◆ D3DXAssembleShaderFromFileA()

HRESULT WINAPI D3DXAssembleShaderFromFileA ( const char filename,
const D3DXMACRO defines,
ID3DXInclude *  include,
DWORD  flags,
ID3DXBuffer **  shader,
ID3DXBuffer **  error_messages 
)

Definition at line 321 of file shader.c.

323 {
324  WCHAR *filename_w;
325  DWORD len;
326  HRESULT ret;
327 
328  TRACE("filename %s, defines %p, include %p, flags %#x, shader %p, error_messages %p.\n",
330 
331  if (!filename) return D3DXERR_INVALIDDATA;
332 
333  len = MultiByteToWideChar(CP_ACP, 0, filename, -1, NULL, 0);
334  filename_w = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
335  if (!filename_w) return E_OUTOFMEMORY;
336  MultiByteToWideChar(CP_ACP, 0, filename, -1, filename_w, len);
337 
339 
340  HeapFree(GetProcessHeap(), 0, filename_w);
341  return ret;
342 }
#define CP_ACP
Definition: compat.h:109
const char * filename
Definition: ioapi.h:135
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
HRESULT WINAPI D3DXAssembleShaderFromFileW(const WCHAR *filename, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
Definition: shader.c:344
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
Definition: asm.c:30
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:79
unsigned long DWORD
Definition: ntddk_ex.h:95
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ID3DBlob ** error_messages
Definition: asm.c:30
GLbitfield flags
Definition: glext.h:7161
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
static SIZE_T const char const D3D_SHADER_MACRO * defines
Definition: asm.c:30
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by assembleshader_test().

◆ D3DXAssembleShaderFromFileW()

HRESULT WINAPI D3DXAssembleShaderFromFileW ( const WCHAR filename,
const D3DXMACRO defines,
ID3DXInclude *  include,
DWORD  flags,
ID3DXBuffer **  shader,
ID3DXBuffer **  error_messages 
)

Definition at line 344 of file shader.c.

346 {
347  const void *buffer;
348  DWORD len;
349  HRESULT hr;
350  struct d3dx_include_from_file include_from_file;
351  char *filename_a;
352 
353  TRACE("filename %s, defines %p, include %p, flags %#x, shader %p, error_messages %p.\n",
355 
356  if(!include)
357  {
358  include_from_file.ID3DXInclude_iface.lpVtbl = &d3dx_include_from_file_vtbl;
359  include = &include_from_file.ID3DXInclude_iface;
360  }
361 
363  filename_a = HeapAlloc(GetProcessHeap(), 0, len * sizeof(char));
364  if (!filename_a)
365  return E_OUTOFMEMORY;
366  WideCharToMultiByte(CP_ACP, 0, filename, -1, filename_a, len, NULL, NULL);
367 
369  hr = ID3DXInclude_Open(include, D3DXINC_LOCAL, filename_a, NULL, &buffer, &len);
370  if (FAILED(hr))
371  {
373  HeapFree(GetProcessHeap(), 0, filename_a);
374  return D3DXERR_INVALIDDATA;
375  }
376 
378 
381  HeapFree(GetProcessHeap(), 0, filename_a);
382  return hr;
383 }
#define ID3DXInclude_Open(p, a, b, c, d, e)
Definition: d3dx9shader.h:303
const struct ID3DXIncludeVtbl d3dx_include_from_file_vtbl
Definition: shader.c:315
#define WideCharToMultiByte
Definition: compat.h:111
HRESULT hr
Definition: shlfolder.c:183
CRITICAL_SECTION from_file_mutex
Definition: shader.c:229
#define CP_ACP
Definition: compat.h:109
GLuint buffer
Definition: glext.h:5915
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
const char * filename
Definition: ioapi.h:135
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define debugstr_w
Definition: kernel32.h:32
#define ID3DXInclude_Close(p, a)
Definition: d3dx9shader.h:304
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
Definition: asm.c:30
LONG HRESULT
Definition: typedefs.h:79
unsigned long DWORD
Definition: ntddk_ex.h:95
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ID3DBlob ** error_messages
Definition: asm.c:30
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722
#define NULL
Definition: types.h:112
static SIZE_T const char const D3D_SHADER_MACRO * defines
Definition: asm.c:30
HRESULT WINAPI D3DXAssembleShader(const char *data, UINT data_len, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
Definition: shader.c:200
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by assembleshader_test(), and D3DXAssembleShaderFromFileA().

◆ D3DXAssembleShaderFromResourceA()

HRESULT WINAPI D3DXAssembleShaderFromResourceA ( HMODULE  module,
const char resource,
const D3DXMACRO defines,
ID3DXInclude *  include,
DWORD  flags,
ID3DXBuffer **  shader,
ID3DXBuffer **  error_messages 
)

Definition at line 385 of file shader.c.

387 {
388  void *buffer;
389  HRSRC res;
390  DWORD len;
391 
392  TRACE("module %p, resource %s, defines %p, include %p, flags %#x, shader %p, error_messages %p.\n",
394 
395  if (!(res = FindResourceA(module, resource, (const char *)RT_RCDATA)))
396  return D3DXERR_INVALIDDATA;
398  return D3DXERR_INVALIDDATA;
401 }
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
GLuint buffer
Definition: glext.h:5915
HRESULT load_resource_into_memory(HMODULE module, HRSRC resinfo, void **buffer, DWORD *length) DECLSPEC_HIDDEN
Definition: util.c:170
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
Definition: asm.c:30
#define debugstr_a
Definition: kernel32.h:31
unsigned long DWORD
Definition: ntddk_ex.h:95
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ID3DBlob ** error_messages
Definition: asm.c:30
GLbitfield flags
Definition: glext.h:7161
#define RT_RCDATA
Definition: pedump.c:372
GLenum GLsizei len
Definition: glext.h:6722
static SIZE_T const char const D3D_SHADER_MACRO * defines
Definition: asm.c:30
GLuint res
Definition: glext.h:9613
HRESULT WINAPI D3DXAssembleShader(const char *data, UINT data_len, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
Definition: shader.c:200

Referenced by assembleshader_test().

◆ D3DXAssembleShaderFromResourceW()

HRESULT WINAPI D3DXAssembleShaderFromResourceW ( HMODULE  module,
const WCHAR resource,
const D3DXMACRO defines,
ID3DXInclude *  include,
DWORD  flags,
ID3DXBuffer **  shader,
ID3DXBuffer **  error_messages 
)

Definition at line 403 of file shader.c.

405 {
406  void *buffer;
407  HRSRC res;
408  DWORD len;
409 
410  TRACE("module %p, resource %s, defines %p, include %p, flags %#x, shader %p, error_messages %p.\n",
412 
413  if (!(res = FindResourceW(module, resource, (const WCHAR *)RT_RCDATA)))
414  return D3DXERR_INVALIDDATA;
416  return D3DXERR_INVALIDDATA;
419 }
GLuint buffer
Definition: glext.h:5915
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
#define debugstr_w
Definition: kernel32.h:32
HRESULT load_resource_into_memory(HMODULE module, HRSRC resinfo, void **buffer, DWORD *length) DECLSPEC_HIDDEN
Definition: util.c:170
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
Definition: asm.c:30
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ID3DBlob ** error_messages
Definition: asm.c:30
GLbitfield flags
Definition: glext.h:7161
#define RT_RCDATA
Definition: pedump.c:372
GLenum GLsizei len
Definition: glext.h:6722
static SIZE_T const char const D3D_SHADER_MACRO * defines
Definition: asm.c:30
GLuint res
Definition: glext.h:9613
HRESULT WINAPI D3DXAssembleShader(const char *data, UINT data_len, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
Definition: shader.c:200

◆ D3DXCompileShader()

HRESULT WINAPI D3DXCompileShader ( const char src_data,
UINT  data_len,
const D3DXMACRO defines,
ID3DXInclude *  include,
const char function_name,
const char profile,
DWORD  flags,
ID3DXBuffer **  shader,
ID3DXBuffer **  error_messages,
ID3DXConstantTable **  constant_table 
)

Definition at line 421 of file shader.c.

424 {
425  HRESULT hr;
426 
427  TRACE("data %s, length %u, defines %p, include %p, function %s, profile %s, "
428  "flags %#x, shader %p, error_msgs %p, constant_table %p.\n",
430  flags, shader, error_msgs, constant_table);
431 
432  if (D3DX_SDK_VERSION <= 36)
434 
436  function, profile, flags, 0, (ID3DBlob **)shader, (ID3DBlob **)error_msgs);
437 
438  if (SUCCEEDED(hr) && constant_table)
439  {
441  if (FAILED(hr))
442  {
444  *shader = NULL;
445  }
446  }
447 
448  /* Filter out D3DCompile warning messages that are not present with D3DCompileShader */
449  if (SUCCEEDED(hr) && error_msgs && *error_msgs)
450  {
451  char *messages = ID3DXBuffer_GetBufferPointer(*error_msgs);
452  DWORD size = ID3DXBuffer_GetBufferSize(*error_msgs);
453 
454  /* Ensure messages are null terminated for safe processing */
455  if (size) messages[size - 1] = 0;
456 
457  while (size > 1)
458  {
459  char *prev, *next;
460 
461  /* Warning has the form "warning X3206: ... implicit truncation of vector type"
462  but we only search for "X3206:" in case d3dcompiler_43 has localization */
463  prev = next = strstr(messages, "X3206:");
464  if (!prev) break;
465 
466  /* get pointer to beginning and end of current line */
467  while (prev > messages && *(prev - 1) != '\n') prev--;
468  while (next < messages + size - 1 && *next != '\n') next++;
469  if (next < messages + size - 1 && *next == '\n') next++;
470 
471  memmove(prev, next, messages + size - next);
472  size -= (next - prev);
473  }
474 
475  /* Only return a buffer if the resulting string is not empty as some apps depend on that */
476  if (size <= 1)
477  {
478  ID3DXBuffer_Release(*error_msgs);
479  *error_msgs = NULL;
480  }
481  }
482 
483  return hr;
484 }
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI D3DXGetShaderConstantTable(const DWORD *byte_code, ID3DXConstantTable **constant_table)
Definition: shader.c:2111
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
#define D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY
Definition: d3dcompiler.h:51
if SUCCEEDED(hr)
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
WDF_DMA_PROFILE profile
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
#define ID3DXBuffer_GetBufferSize(p)
Definition: d3dx9core.h:86
GLsizeiptr size
Definition: glext.h:5919
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
Definition: asm.c:30
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:79
HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint, const char *target, UINT sflags, UINT eflags, ID3DBlob **shader, ID3DBlob **error_messages)
Definition: compiler.c:889
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLbitfield flags
Definition: glext.h:7161
static unsigned __int64 next
Definition: rand_nt.c:6
#define ID3DXBuffer_Release(p)
Definition: d3dx9core.h:83
#define NULL
Definition: types.h:112
static SIZE_T const char const D3D_SHADER_MACRO * defines
Definition: asm.c:30
#define ID3DXBuffer_GetBufferPointer(p)
Definition: d3dx9core.h:85

Referenced by D3DXCompileShaderFromResourceA(), and D3DXCompileShaderFromResourceW().

◆ D3DXCompileShaderFromFileA()

HRESULT WINAPI D3DXCompileShaderFromFileA ( const char filename,
const D3DXMACRO defines,
ID3DXInclude *  include,
const char entrypoint,
const char profile,
DWORD  flags,
ID3DXBuffer **  shader,
ID3DXBuffer **  error_messages,
ID3DXConstantTable **  constant_table 
)

Definition at line 486 of file shader.c.

489 {
490  WCHAR *filename_w;
491  DWORD len;
492  HRESULT ret;
493 
494  TRACE("filename %s, defines %p, include %p, entrypoint %s, profile %s, "
495  "flags %#x, shader %p, error_messages %p, constant_table %p.\n",
496  debugstr_a(filename), defines, include, debugstr_a(entrypoint),
497  debugstr_a(profile), flags, shader, error_messages, constant_table);
498 
499  if (!filename) return D3DXERR_INVALIDDATA;
500 
501  len = MultiByteToWideChar(CP_ACP, 0, filename, -1, NULL, 0);
502  filename_w = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
503  if (!filename_w) return E_OUTOFMEMORY;
504  MultiByteToWideChar(CP_ACP, 0, filename, -1, filename_w, len);
505 
507  entrypoint, profile, flags,
508  shader, error_messages, constant_table);
509 
510  HeapFree(GetProcessHeap(), 0, filename_w);
511  return ret;
512 }
#define CP_ACP
Definition: compat.h:109
const char * filename
Definition: ioapi.h:135
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
HRESULT WINAPI D3DXCompileShaderFromFileW(const WCHAR *filename, const D3DXMACRO *defines, ID3DXInclude *include, const char *entrypoint, const char *profile, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages, ID3DXConstantTable **constant_table)
Definition: shader.c:514
WDF_DMA_PROFILE profile
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
Definition: asm.c:30
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:79
unsigned long DWORD
Definition: ntddk_ex.h:95
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ID3DBlob ** error_messages
Definition: asm.c:30
GLbitfield flags
Definition: glext.h:7161
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
static SIZE_T const char const D3D_SHADER_MACRO * defines
Definition: asm.c:30
#define HeapFree(x, y, z)
Definition: compat.h:594

◆ D3DXCompileShaderFromFileW()

HRESULT WINAPI D3DXCompileShaderFromFileW ( const WCHAR filename,
const D3DXMACRO defines,
ID3DXInclude *  include,
const char entrypoint,
const char profile,
DWORD  flags,
ID3DXBuffer **  shader,
ID3DXBuffer **  error_messages,
ID3DXConstantTable **  constant_table 
)

Definition at line 514 of file shader.c.

517 {
518  const void *buffer;
519  DWORD len, filename_len;
520  HRESULT hr;
521  struct d3dx_include_from_file include_from_file;
522  char *filename_a;
523 
524  TRACE("filename %s, defines %p, include %p, entrypoint %s, profile %s, "
525  "flags %#x, shader %p, error_messages %p, constant_table %p.\n",
527  flags, shader, error_messages, constant_table);
528 
529  if (!include)
530  {
531  include_from_file.ID3DXInclude_iface.lpVtbl = &d3dx_include_from_file_vtbl;
532  include = &include_from_file.ID3DXInclude_iface;
533  }
534 
535  filename_len = WideCharToMultiByte(CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL);
536  filename_a = HeapAlloc(GetProcessHeap(), 0, filename_len * sizeof(char));
537  if (!filename_a)
538  return E_OUTOFMEMORY;
539  WideCharToMultiByte(CP_ACP, 0, filename, -1, filename_a, filename_len, NULL, NULL);
540 
542  hr = ID3DXInclude_Open(include, D3DXINC_LOCAL, filename_a, NULL, &buffer, &len);
543  if (FAILED(hr))
544  {
546  HeapFree(GetProcessHeap(), 0, filename_a);
547  return D3DXERR_INVALIDDATA;
548  }
549 
550  if (D3DX_SDK_VERSION <= 36)
552 
553  hr = D3DCompile(buffer, len, filename_a, (const D3D_SHADER_MACRO *)defines,
554  (ID3DInclude *)include, entrypoint, profile, flags, 0,
556 
557  if (SUCCEEDED(hr) && constant_table)
559  constant_table);
560 
563  HeapFree(GetProcessHeap(), 0, filename_a);
564  return hr;
565 }
#define ID3DXInclude_Open(p, a, b, c, d, e)
Definition: d3dx9shader.h:303
const struct ID3DXIncludeVtbl d3dx_include_from_file_vtbl
Definition: shader.c:315
#define WideCharToMultiByte
Definition: compat.h:111
HRESULT hr
Definition: shlfolder.c:183
CRITICAL_SECTION from_file_mutex
Definition: shader.c:229
HRESULT WINAPI D3DXGetShaderConstantTable(const DWORD *byte_code, ID3DXConstantTable **constant_table)
Definition: shader.c:2111
#define CP_ACP
Definition: compat.h:109
GLuint buffer
Definition: glext.h:5915
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
const char * filename
Definition: ioapi.h:135
#define D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY
Definition: d3dcompiler.h:51
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
if SUCCEEDED(hr)
#define debugstr_w
Definition: kernel32.h:32
#define ID3DXInclude_Close(p, a)
Definition: d3dx9shader.h:304
WDF_DMA_PROFILE profile
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
Definition: asm.c:30
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:79
HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint, const char *target, UINT sflags, UINT eflags, ID3DBlob **shader, ID3DBlob **error_messages)
Definition: compiler.c:889
unsigned long DWORD
Definition: ntddk_ex.h:95
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ID3DBlob ** error_messages
Definition: asm.c:30
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722
#define NULL
Definition: types.h:112
static SIZE_T const char const D3D_SHADER_MACRO * defines
Definition: asm.c:30
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define HeapFree(x, y, z)
Definition: compat.h:594
#define ID3DXBuffer_GetBufferPointer(p)
Definition: d3dx9core.h:85

Referenced by D3DXCompileShaderFromFileA().

◆ D3DXCompileShaderFromResourceA()

HRESULT WINAPI D3DXCompileShaderFromResourceA ( HMODULE  module,
const char resource,
const D3DXMACRO defines,
ID3DXInclude *  include,
const char entrypoint,
const char profile,
DWORD  flags,
ID3DXBuffer **  shader,
ID3DXBuffer **  error_messages,
ID3DXConstantTable **  constant_table 
)

Definition at line 567 of file shader.c.

570 {
571  void *buffer;
572  HRSRC res;
573  DWORD len;
574 
575  TRACE("module %p, resource %s, defines %p, include %p, entrypoint %s, profile %s, "
576  "flags %#x, shader %p, error_messages %p, constant_table %p.\n",
578  flags, shader, error_messages, constant_table);
579 
580  if (!(res = FindResourceA(module, resource, (const char *)RT_RCDATA)))
581  return D3DXERR_INVALIDDATA;
583  return D3DXERR_INVALIDDATA;
584  return D3DXCompileShader(buffer, len, defines, include, entrypoint, profile,
585  flags, shader, error_messages, constant_table);
586 }
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
GLuint buffer
Definition: glext.h:5915
HRESULT load_resource_into_memory(HMODULE module, HRSRC resinfo, void **buffer, DWORD *length) DECLSPEC_HIDDEN
Definition: util.c:170
WDF_DMA_PROFILE profile
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
Definition: asm.c:30
#define debugstr_a
Definition: kernel32.h:31
unsigned long DWORD
Definition: ntddk_ex.h:95
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ID3DBlob ** error_messages
Definition: asm.c:30
GLbitfield flags
Definition: glext.h:7161
#define RT_RCDATA
Definition: pedump.c:372
GLenum GLsizei len
Definition: glext.h:6722
HRESULT WINAPI D3DXCompileShader(const char *data, UINT length, const D3DXMACRO *defines, ID3DXInclude *include, const char *function, const char *profile, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_msgs, ID3DXConstantTable **constant_table)
Definition: shader.c:421
static SIZE_T const char const D3D_SHADER_MACRO * defines
Definition: asm.c:30
GLuint res
Definition: glext.h:9613

◆ D3DXCompileShaderFromResourceW()

HRESULT WINAPI D3DXCompileShaderFromResourceW ( HMODULE  module,
const WCHAR resource,
const D3DXMACRO defines,
ID3DXInclude *  include,
const char entrypoint,
const char profile,
DWORD  flags,
ID3DXBuffer **  shader,
ID3DXBuffer **  error_messages,
ID3DXConstantTable **  constant_table 
)

Definition at line 588 of file shader.c.

591 {
592  void *buffer;
593  HRSRC res;
594  DWORD len;
595 
596  TRACE("module %p, resource %s, defines %p, include %p, entrypoint %s, profile %s, "
597  "flags %#x, shader %p, error_messages %p, constant_table %p.\n",
599  flags, shader, error_messages, constant_table);
600 
601  if (!(res = FindResourceW(module, resource, (const WCHAR *)RT_RCDATA)))
602  return D3DXERR_INVALIDDATA;
604  return D3DXERR_INVALIDDATA;
605  return D3DXCompileShader(buffer, len, defines, include, entrypoint, profile,
606  flags, shader, error_messages, constant_table);
607 }
GLuint buffer
Definition: glext.h:5915
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
#define debugstr_w
Definition: kernel32.h:32
HRESULT load_resource_into_memory(HMODULE module, HRSRC resinfo, void **buffer, DWORD *length) DECLSPEC_HIDDEN
Definition: util.c:170
WDF_DMA_PROFILE profile
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
Definition: asm.c:30
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
unsigned long DWORD
Definition: ntddk_ex.h:95
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ID3DBlob ** error_messages
Definition: asm.c:30
GLbitfield flags
Definition: glext.h:7161
#define RT_RCDATA
Definition: pedump.c:372
GLenum GLsizei len
Definition: glext.h:6722
HRESULT WINAPI D3DXCompileShader(const char *data, UINT length, const D3DXMACRO *defines, ID3DXInclude *include, const char *function, const char *profile, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_msgs, ID3DXConstantTable **constant_table)
Definition: shader.c:421
static SIZE_T const char const D3D_SHADER_MACRO * defines
Definition: asm.c:30
GLuint res
Definition: glext.h:9613

◆ D3DXCreateFragmentLinker()

HRESULT WINAPI D3DXCreateFragmentLinker ( IDirect3DDevice9 *  device,
UINT  size,
ID3DXFragmentLinker **  linker 
)

Definition at line 2325 of file shader.c.

2326 {
2327  TRACE("device %p, size %u, linker %p.\n", device, size, linker);
2328 
2329  return D3DXCreateFragmentLinkerEx(device, size, 0, linker);
2330 }
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
HRESULT WINAPI D3DXCreateFragmentLinkerEx(IDirect3DDevice9 *device, UINT size, DWORD flags, ID3DXFragmentLinker **linker)
Definition: shader.c:2302

Referenced by test_fragment_linker().

◆ D3DXCreateFragmentLinkerEx()

HRESULT WINAPI D3DXCreateFragmentLinkerEx ( IDirect3DDevice9 *  device,
UINT  size,
DWORD  flags,
ID3DXFragmentLinker **  linker 
)

Definition at line 2302 of file shader.c.

2304 {
2305  struct d3dx9_fragment_linker *object;
2306 
2307  TRACE("device %p, size %u, flags %#x, linker %p.\n", device, size, flags, linker);
2308 
2309  object = heap_alloc(sizeof(*object));
2310  if (!object)
2311  return E_OUTOFMEMORY;
2312 
2313  object->ID3DXFragmentLinker_iface.lpVtbl = &d3dx9_fragment_linker_vtbl;
2314  object->ref = 1;
2315 
2317  object->device = device;
2318  object->flags = flags;
2319 
2320  *linker = &object->ID3DXFragmentLinker_iface;
2321 
2322  return S_OK;
2323 }
coclass MSXML2::XSLTemplate40 object
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
FxDevice * device
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define IDirect3DDevice9_AddRef(p)
Definition: d3d9.h:1507
GLbitfield flags
Definition: glext.h:7161
static const struct ID3DXFragmentLinkerVtbl d3dx9_fragment_linker_vtbl
Definition: shader.c:2283
#define S_OK
Definition: intsafe.h:52

Referenced by D3DXCreateFragmentLinker(), and test_fragment_linker().

◆ D3DXCreateTextureShader()

HRESULT WINAPI D3DXCreateTextureShader ( const DWORD pFunction,
ID3DXTextureShader **  ppTextureShader 
)

Definition at line 2956 of file shader.c.

2957 {
2958  struct d3dx9_texture_shader *object;
2959 
2960  TRACE("function %p, texture_shader %p.\n", function, texture_shader);
2961 
2962  if (!function || !texture_shader)
2963  return D3DERR_INVALIDCALL;
2964 
2965  object = HeapAlloc(GetProcessHeap(), 0, sizeof(*object));
2966  if (!object)
2967  return E_OUTOFMEMORY;
2968 
2969  object->ID3DXTextureShader_iface.lpVtbl = &d3dx9_texture_shader_vtbl;
2970  object->ref = 1;
2971 
2972  *texture_shader = &object->ID3DXTextureShader_iface;
2973 
2974  return D3D_OK;
2975 }
coclass MSXML2::XSLTemplate40 object
#define D3DERR_INVALIDCALL
static const struct ID3DXTextureShaderVtbl d3dx9_texture_shader_vtbl
Definition: shader.c:2924
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define D3D_OK
Definition: d3d.h:106

Referenced by test_texture_shader().

◆ D3DXDisassembleShader()

HRESULT WINAPI D3DXDisassembleShader ( const DWORD pShader,
BOOL  EnableColorCode,
const char pComments,
struct ID3DXBuffer **  ppDisassembly 
)

Definition at line 2645 of file shader.c.

2646 {
2647  DWORD *ptr = (DWORD *)shader;
2648  char *buffer, *buf;
2649  UINT capacity = 4096;
2650  BOOL ps;
2651  WORD version;
2652  HRESULT hr;
2653 
2654  TRACE("%p %d %s %p\n", shader, colorcode, debugstr_a(comments), disassembly);
2655 
2656  if (!shader || !disassembly)
2657  return D3DERR_INVALIDCALL;
2658 
2659  buf = buffer = HeapAlloc(GetProcessHeap(), 0, capacity);
2660  if (!buffer)
2661  return E_OUTOFMEMORY;
2662 
2663  ps = (*ptr >> 16) & 1;
2664  version = *ptr & 0xFFFF;
2665  buf += sprintf(buf, " %s_%d_%d\n", ps ? "ps" : "vs", D3DSHADER_VERSION_MAJOR(*ptr), D3DSHADER_VERSION_MINOR(*ptr));
2666  ptr++;
2667 
2668  while (*ptr != D3DSIO_END)
2669  {
2670  DWORD index;
2671 
2672  if ((buf - buffer + 128) > capacity)
2673  {
2674  UINT count = buf - buffer;
2675  char *new_buffer = HeapReAlloc(GetProcessHeap(), 0, buffer, capacity * 2);
2676  if (!new_buffer)
2677  {
2679  return E_OUTOFMEMORY;
2680  }
2681  capacity *= 2;
2682  buffer = new_buffer;
2683  buf = buffer + count;
2684  }
2685 
2686  for (index = 0; index < sizeof(instructions)/sizeof(instructions[0]); index++)
2687  if (((*ptr & D3DSI_OPCODE_MASK) == instructions[index].opcode) &&
2688  (version >= instructions[index].min_version) && (version <= instructions[index].max_version))
2689  break;
2690 
2691  if (index != sizeof(instructions)/sizeof(instructions[0]))
2692  {
2693  buf += instructions[index].function(&(instructions[index]), &ptr, buf, ps);
2694  }
2695  else
2696  {
2697  buf += sprintf(buf, " ??? (Unknown opcode %x)\n", *ptr);
2698  while (*++ptr & (1u << 31));
2699  }
2700  }
2701 
2702  hr = D3DXCreateBuffer(buf - buffer + 1 , disassembly);
2703  if (SUCCEEDED(hr))
2704  strcpy(ID3DXBuffer_GetBufferPointer(*disassembly), buffer);
2706 
2707  return hr;
2708 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
#define D3DSHADER_VERSION_MAJOR(version)
Definition: d3d8types.h:476
HRESULT hr
Definition: shlfolder.c:183
GLuint GLuint GLsizei count
Definition: gl.h:1545
HRESULT WINAPI D3DXCreateBuffer(DWORD size, ID3DXBuffer **buffer)
Definition: core.c:131
#define D3DERR_INVALIDCALL
GLuint buffer
Definition: glext.h:5915
#define sprintf(buf, format,...)
Definition: sprintf.c:55
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
unsigned int BOOL
Definition: ntddk_ex.h:94
if SUCCEEDED(hr)
static PVOID ptr
Definition: dispmode.c:27
const struct instr_info instructions[]
Definition: shader.c:2553
static const WCHAR version[]
Definition: asmname.c:66
GLuint index
Definition: glext.h:6031
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:79
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#define index(s, c)
Definition: various.h:29
char comments[4096]
#define HeapReAlloc
Definition: compat.h:593
#define D3DSHADER_VERSION_MINOR(version)
Definition: d3d8types.h:477
unsigned int UINT
Definition: ndis.h:50
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define D3DSI_OPCODE_MASK
Definition: d3d8types.h:306
#define HeapFree(x, y, z)
Definition: compat.h:594
#define ID3DXBuffer_GetBufferPointer(p)
Definition: d3dx9core.h:85

Referenced by test_disassemble_shader().

◆ D3DXFindShaderComment()

HRESULT WINAPI D3DXFindShaderComment ( const DWORD byte_code,
DWORD  fourcc,
const void **  data,
UINT size 
)

Definition at line 150 of file shader.c.

151 {
152  const DWORD *ptr = byte_code;
153  DWORD version;
154 
155  TRACE("byte_code %p, fourcc %x, data %p, size %p\n", byte_code, fourcc, data, size);
156 
157  if (data) *data = NULL;
158  if (size) *size = 0;
159 
160  if (!byte_code) return D3DERR_INVALIDCALL;
161 
162  version = *ptr >> 16;
163  if (version != 0x4658 /* FX */
164  && version != 0x5458 /* TX */
165  && version != 0x7ffe
166  && version != 0x7fff
167  && version != 0xfffe /* VS */
168  && version != 0xffff) /* PS */
169  {
170  WARN("Invalid data supplied\n");
171  return D3DXERR_INVALIDDATA;
172  }
173 
174  while (*++ptr != D3DSIO_END)
175  {
176  /* Check if it is a comment */
178  {
180 
181  /* Check if this is the comment we are looking for */
182  if (*(ptr + 1) == fourcc)
183  {
184  UINT ctab_size = (comment_size - 1) * sizeof(DWORD);
185  const void *ctab_data = ptr + 2;
186  if (size)
187  *size = ctab_size;
188  if (data)
189  *data = ctab_data;
190  TRACE("Returning comment data at %p with size %d\n", ctab_data, ctab_size);
191  return D3D_OK;
192  }
193  ptr += comment_size;
194  }
195  }
196 
197  return S_FALSE;
198 }
#define WARN(fmt,...)
Definition: debug.h:112
#define D3DERR_INVALIDCALL
static PVOID ptr
Definition: dispmode.c:27
#define D3DSI_COMMENTSIZE_SHIFT
Definition: d3d8types.h:479
#define S_FALSE
Definition: winerror.h:2357
static const WCHAR version[]
Definition: asmname.c:66
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define D3DSI_COMMENTSIZE_MASK
Definition: d3d8types.h:480
#define D3D_OK
Definition: d3d.h:106
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define D3DSI_OPCODE_MASK
Definition: d3d8types.h:306

Referenced by D3DXGetShaderConstantTableEx(), D3DXGetShaderSamplers(), and test_find_shader_comment().

◆ D3DXGetPixelShaderProfile()

const char* WINAPI D3DXGetPixelShaderProfile ( struct IDirect3DDevice9 *  device)

Definition at line 43 of file shader.c.

44 {
45  D3DCAPS9 caps;
46 
47  TRACE("device %p\n", device);
48 
49  if (!device) return NULL;
50 
52 
53  switch (caps.PixelShaderVersion)
54  {
55  case D3DPS_VERSION(1, 1):
56  return "ps_1_1";
57 
58  case D3DPS_VERSION(1, 2):
59  return "ps_1_2";
60 
61  case D3DPS_VERSION(1, 3):
62  return "ps_1_3";
63 
64  case D3DPS_VERSION(1, 4):
65  return "ps_1_4";
66 
67  case D3DPS_VERSION(2, 0):
68  if ((caps.PS20Caps.NumTemps>=22) &&
69  (caps.PS20Caps.Caps&D3DPS20CAPS_ARBITRARYSWIZZLE) &&
70  (caps.PS20Caps.Caps&D3DPS20CAPS_GRADIENTINSTRUCTIONS) &&
71  (caps.PS20Caps.Caps&D3DPS20CAPS_PREDICATION) &&
72  (caps.PS20Caps.Caps&D3DPS20CAPS_NODEPENDENTREADLIMIT) &&
73  (caps.PS20Caps.Caps&D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT))
74  {
75  return "ps_2_a";
76  }
77  if ((caps.PS20Caps.NumTemps>=32) &&
79  {
80  return "ps_2_b";
81  }
82  return "ps_2_0";
83 
84  case D3DPS_VERSION(3, 0):
85  return "ps_3_0";
86  }
87 
88  return NULL;
89 }
D3DPSHADERCAPS2_0 PS20Caps
Definition: d3d9caps.h:327
#define D3DPS20CAPS_GRADIENTINSTRUCTIONS
Definition: d3d9caps.h:226
return
Definition: dirsup.c:529
#define D3DPS20CAPS_PREDICATION
Definition: d3d9caps.h:227
if(dx==0 &&dy==0)
Definition: linetemp.h:174
#define D3DPS_VERSION(major, minor)
Definition: d3d8types.h:474
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
#define D3DPS20CAPS_NODEPENDENTREADLIMIT
Definition: d3d9caps.h:228
#define D3DPS20CAPS_ARBITRARYSWIZZLE
Definition: d3d9caps.h:225
DWORD PixelShaderVersion
Definition: d3d9caps.h:315
#define D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT
Definition: d3d9caps.h:229
#define IDirect3DDevice9_GetDeviceCaps(p, a)
Definition: d3d9.h:1514
#define NULL
Definition: types.h:112

◆ D3DXGetShaderConstantTable()

HRESULT WINAPI D3DXGetShaderConstantTable ( const DWORD byte_code,
ID3DXConstantTable **  constant_table 
)

Definition at line 2111 of file shader.c.

2112 {
2113  TRACE("(%p, %p): Forwarded to D3DXGetShaderConstantTableEx\n", byte_code, constant_table);
2114 
2115  return D3DXGetShaderConstantTableEx(byte_code, 0, constant_table);
2116 }
HRESULT WINAPI D3DXGetShaderConstantTableEx(const DWORD *byte_code, DWORD flags, ID3DXConstantTable **constant_table)
Definition: shader.c:1993
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by compile_pixel_shader9(), D3DXCompileShader(), D3DXCompileShaderFromFileW(), get_constants_desc(), test_constant_table(), test_get_sampler_index(), test_get_shader_constant_variables(), test_registerset(), test_registerset_defaults(), test_SetDefaults(), test_setting_arrays_table(), test_setting_basic_table(), test_setting_matrices_table(), and test_SetValue().

◆ D3DXGetShaderConstantTableEx()

HRESULT WINAPI D3DXGetShaderConstantTableEx ( const DWORD byte_code,
DWORD  flags,
ID3DXConstantTable **  constant_table 
)

Definition at line 1993 of file shader.c.

1994 {
1995  struct ID3DXConstantTableImpl *object = NULL;
1996  const void *data;
1997  HRESULT hr;
1998  UINT size;
1999  const D3DXSHADER_CONSTANTTABLE *ctab_header;
2000  const D3DXSHADER_CONSTANTINFO *constant_info;
2001  DWORD i;
2002 
2003  TRACE("byte_code %p, flags %x, constant_table %p\n", byte_code, flags, constant_table);
2004 
2005  if (constant_table) *constant_table = NULL;
2006 
2007  if (!byte_code || !constant_table)
2008  {
2009  WARN("Invalid argument specified.\n");
2010  return D3DERR_INVALIDCALL;
2011  }
2012 
2013  if (!is_valid_bytecode(*byte_code))
2014  {
2015  WARN("Invalid byte_code specified.\n");
2016  return D3D_OK;
2017  }
2018 
2019  if (flags) FIXME("Flags (%#x) are not handled, yet!\n", flags);
2020 
2021  hr = D3DXFindShaderComment(byte_code, MAKEFOURCC('C','T','A','B'), &data, &size);
2022  if (hr != D3D_OK)
2023  {
2024  WARN("CTAB not found.\n");
2025  return D3DXERR_INVALIDDATA;
2026  }
2027 
2028  if (size < sizeof(*ctab_header))
2029  {
2030  WARN("Invalid CTAB size.\n");
2031  return D3DXERR_INVALIDDATA;
2032  }
2033 
2034  ctab_header = (const D3DXSHADER_CONSTANTTABLE *)data;
2035  if (ctab_header->Size != sizeof(*ctab_header))
2036  {
2037  WARN("Invalid D3DXSHADER_CONSTANTTABLE size.\n");
2038  return D3DXERR_INVALIDDATA;
2039  }
2040 
2041  object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
2042  if (!object)
2043  return E_OUTOFMEMORY;
2044 
2045  object->ID3DXConstantTable_iface.lpVtbl = &ID3DXConstantTable_Vtbl;
2046  object->ref = 1;
2047 
2048  object->ctab = HeapAlloc(GetProcessHeap(), 0, size);
2049  if (!object->ctab)
2050  {
2051  ERR("Out of memory\n");
2052  HeapFree(GetProcessHeap(), 0, object);
2053  return E_OUTOFMEMORY;
2054  }
2055  object->size = size;
2056  memcpy(object->ctab, data, object->size);
2057 
2058  object->desc.Creator = ctab_header->Creator ? object->ctab + ctab_header->Creator : NULL;
2059  object->desc.Version = ctab_header->Version;
2060  object->desc.Constants = ctab_header->Constants;
2061  TRACE("Creator %s, Version %x, Constants %u, Target %s\n",
2062  debugstr_a(object->desc.Creator), object->desc.Version, object->desc.Constants,
2063  debugstr_a(ctab_header->Target ? object->ctab + ctab_header->Target : NULL));
2064 
2065  object->constants = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
2066  sizeof(*object->constants) * object->desc.Constants);
2067  if (!object->constants)
2068  {
2069  ERR("Out of memory\n");
2070  hr = E_OUTOFMEMORY;
2071  goto error;
2072  }
2073 
2074  constant_info = (const D3DXSHADER_CONSTANTINFO *)(object->ctab + ctab_header->ConstantInfo);
2075  for (i = 0; i < ctab_header->Constants; i++)
2076  {
2077  DWORD offset = constant_info[i].DefaultValue;
2078 
2079  hr = parse_ctab_constant_type(object->ctab, constant_info[i].TypeInfo,
2080  &object->constants[i], FALSE, constant_info[i].RegisterIndex,
2081  constant_info[i].RegisterIndex + constant_info[i].RegisterCount,
2082  offset ? &offset : NULL, constant_info[i].Name, constant_info[i].RegisterSet);
2083  if (hr != D3D_OK)
2084  goto error;
2085 
2086  /*
2087  * Set the register count, it may differ for D3DXRS_INT4, because somehow
2088  * it makes the assumption that the register size is 1 instead of 4, so the
2089  * count is 4 times bigger. This holds true only for toplevel shader
2090  * constants. The count of elements and members is always based on a
2091  * register size of 4.
2092  */
2093  if (object->constants[i].desc.RegisterSet == D3DXRS_INT4)
2094  {
2095  object->constants[i].desc.RegisterCount = constant_info[i].RegisterCount;
2096  }
2097  object->constants[i].constantinfo_reserved = constant_info[i].Reserved;
2098  }
2099 
2100  *constant_table = &object->ID3DXConstantTable_iface;
2101 
2102  return D3D_OK;
2103 
2104 error:
2105  free_constant_table(object);
2106  HeapFree(GetProcessHeap(), 0, object);
2107 
2108  return hr;
2109 }
static void free_constant_table(struct ID3DXConstantTableImpl *table)
Definition: shader.c:747
HRESULT hr
Definition: shlfolder.c:183
#define error(str)
Definition: mkdosfs.c:1605
#define WARN(fmt,...)
Definition: debug.h:112
#define D3DERR_INVALIDCALL
HRESULT WINAPI D3DXFindShaderComment(const DWORD *byte_code, DWORD fourcc, const void **data, UINT *size)
Definition: shader.c:150
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define FALSE
Definition: types.h:117
#define FIXME(fmt,...)
Definition: debug.h:111
static const struct ID3DXConstantTableVtbl ID3DXConstantTable_Vtbl
Definition: shader.c:1821
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:79
GLintptr offset
Definition: glext.h:5920
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLbitfield flags
Definition: glext.h:7161
static BOOL is_valid_bytecode(DWORD token)
Definition: shader.c:38
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ERR(fmt,...)
Definition: debug.h:110
#define D3D_OK
Definition: d3d.h:106
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static HRESULT parse_ctab_constant_type(const char *ctab, DWORD typeoffset, struct ctab_constant *constant, BOOL is_element, WORD index, WORD max_index, DWORD *offset, DWORD nameoffset, UINT regset)
Definition: shader.c:1855
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define MAKEFOURCC(ch0, ch1, ch2, ch3)
Definition: dmdls.h:24
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by D3DXGetShaderConstantTable(), and test_get_shader_constant_table_ex().

◆ D3DXGetShaderInputSemantics()

HRESULT WINAPI D3DXGetShaderInputSemantics ( const DWORD byte_code,
D3DXSEMANTIC semantics,
UINT count 
)

Definition at line 3211 of file shader.c.

3212 {
3213  TRACE("byte_code %p, semantics %p, count %p.\n", byte_code, semantics, count);
3214 
3215  return get_shader_semantics(byte_code, semantics, count, FALSE);
3216 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define FALSE
Definition: types.h:117
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT get_shader_semantics(const DWORD *byte_code, D3DXSEMANTIC *semantics, UINT *count, BOOL output)
Definition: shader.c:3010

Referenced by test_shader_semantics().

◆ D3DXGetShaderOuputSemantics()

HRESULT WINAPI D3DXGetShaderOuputSemantics ( const DWORD byte_code,
D3DXSEMANTIC semantics,
UINT count 
)

◆ D3DXGetShaderOutputSemantics()

HRESULT WINAPI D3DXGetShaderOutputSemantics ( const DWORD pFunction,
D3DXSEMANTIC pSemantics,
UINT pCount 
)

Definition at line 3218 of file shader.c.

3219 {
3220  TRACE("byte_code %p, semantics %p, count %p.\n", byte_code, semantics, count);
3221 
3222  return get_shader_semantics(byte_code, semantics, count, TRUE);
3223 }
#define TRUE
Definition: types.h:120
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT get_shader_semantics(const DWORD *byte_code, D3DXSEMANTIC *semantics, UINT *count, BOOL output)
Definition: shader.c:3010

Referenced by test_shader_semantics().

◆ D3DXGetShaderSamplers()

HRESULT WINAPI D3DXGetShaderSamplers ( const DWORD byte_code,
const char **  samplers,
UINT count 
)

Definition at line 2332 of file shader.c.

2333 {
2334  UINT i, sampler_count = 0;
2335  UINT size;
2336  const char *data;
2337  const D3DXSHADER_CONSTANTTABLE *ctab_header;
2338  const D3DXSHADER_CONSTANTINFO *constant_info;
2339 
2340  TRACE("byte_code %p, samplers %p, count %p\n", byte_code, samplers, count);
2341 
2342  if (count) *count = 0;
2343 
2344  if (D3DXFindShaderComment(byte_code, MAKEFOURCC('C','T','A','B'), (const void **)&data, &size) != D3D_OK)
2345  return D3D_OK;
2346 
2347  if (size < sizeof(*ctab_header)) return D3D_OK;
2348 
2349  ctab_header = (const D3DXSHADER_CONSTANTTABLE *)data;
2350  if (ctab_header->Size != sizeof(*ctab_header)) return D3D_OK;
2351 
2352  constant_info = (const D3DXSHADER_CONSTANTINFO *)(data + ctab_header->ConstantInfo);
2353  for (i = 0; i < ctab_header->Constants; i++)
2354  {
2355  const D3DXSHADER_TYPEINFO *type;
2356 
2357  TRACE("name = %s\n", data + constant_info[i].Name);
2358 
2359  type = (const D3DXSHADER_TYPEINFO *)(data + constant_info[i].TypeInfo);
2360 
2361  if (type->Type == D3DXPT_SAMPLER
2362  || type->Type == D3DXPT_SAMPLER1D
2363  || type->Type == D3DXPT_SAMPLER2D
2364  || type->Type == D3DXPT_SAMPLER3D
2365  || type->Type == D3DXPT_SAMPLERCUBE)
2366  {
2367  if (samplers) samplers[sampler_count] = data + constant_info[i].Name;
2368 
2369  ++sampler_count;
2370  }
2371  }
2372 
2373  TRACE("Found %u samplers\n", sampler_count);
2374 
2375  if (count) *count = sampler_count;
2376 
2377  return D3D_OK;
2378 }
__in WDFOBJECT __in PCWDF_OBJECT_CONTEXT_TYPE_INFO TypeInfo
Definition: handleapi.cpp:601
GLuint GLuint GLsizei count
Definition: gl.h:1545
HRESULT WINAPI D3DXFindShaderComment(const DWORD *byte_code, DWORD fourcc, const void **data, UINT *size)
Definition: shader.c:150
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define D3D_OK
Definition: d3d.h:106
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: ndis.h:50
GLuint * samplers
Definition: glext.h:7280
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define MAKEFOURCC(ch0, ch1, ch2, ch3)
Definition: dmdls.h:24

Referenced by test_get_shader_samplers().

◆ D3DXGetShaderSize()

UINT WINAPI D3DXGetShaderSize ( const DWORD byte_code)

Definition at line 91 of file shader.c.

92 {
93  const DWORD *ptr = byte_code;
94 
95  TRACE("byte_code %p\n", byte_code);
96 
97  if (!ptr) return 0;
98 
99  /* Look for the END token, skipping the VERSION token */
100  while (*++ptr != D3DSIO_END)
101  {
102  /* Skip comments */
104  {
106  }
107  }
108  ++ptr;
109 
110  /* Return the shader size in bytes */
111  return (ptr - byte_code) * sizeof(*ptr);
112 }
static PVOID ptr
Definition: dispmode.c:27
#define D3DSI_COMMENTSIZE_SHIFT
Definition: d3d8types.h:479
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define D3DSI_COMMENTSIZE_MASK
Definition: d3d8types.h:480
#define D3DSI_OPCODE_MASK
Definition: d3d8types.h:306

Referenced by test_get_shader_size().

◆ D3DXGetShaderVersion()

DWORD WINAPI D3DXGetShaderVersion ( const DWORD byte_code)

Definition at line 114 of file shader.c.

115 {
116  TRACE("byte_code %p\n", byte_code);
117 
118  return byte_code ? *byte_code : 0;
119 }
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by test_get_shader_version().

◆ D3DXGetVertexShaderProfile()

const char* WINAPI D3DXGetVertexShaderProfile ( struct IDirect3DDevice9 *  device)

Definition at line 121 of file shader.c.

122 {
123  D3DCAPS9 caps;
124 
125  TRACE("device %p\n", device);
126 
127  if (!device) return NULL;
128 
130 
131  switch (caps.VertexShaderVersion)
132  {
133  case D3DVS_VERSION(1, 1):
134  return "vs_1_1";
135  case D3DVS_VERSION(2, 0):
136  if ((caps.VS20Caps.NumTemps>=13) &&
137  (caps.VS20Caps.DynamicFlowControlDepth==24) &&
138  (caps.VS20Caps.Caps&D3DPS20CAPS_PREDICATION))
139  {
140  return "vs_2_a";
141  }
142  return "vs_2_0";
143  case D3DVS_VERSION(3, 0):
144  return "vs_3_0";
145  }
146 
147  return NULL;
148 }
return
Definition: dirsup.c:529
#define D3DPS20CAPS_PREDICATION
Definition: d3d9caps.h:227
DWORD VertexShaderVersion
Definition: d3d9caps.h:313
if(dx==0 &&dy==0)
Definition: linetemp.h:174
#define D3DVS_VERSION(major, minor)
Definition: d3d8types.h:475
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
#define IDirect3DDevice9_GetDeviceCaps(p, a)
Definition: d3d9.h:1514
#define NULL
Definition: types.h:112

◆ D3DXPreprocessShader()

HRESULT WINAPI D3DXPreprocessShader ( const char data,
UINT  data_len,
const D3DXMACRO defines,
ID3DXInclude *  include,
ID3DXBuffer **  shader,
ID3DXBuffer **  error_messages 
)

Definition at line 609 of file shader.c.

611 {
612  TRACE("data %s, data_len %u, defines %p, include %p, shader %p, error_messages %p.\n",
614 
615  return D3DPreprocess(data, data_len, NULL,
618 }
HRESULT WINAPI D3DPreprocess(const void *data, SIZE_T size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, ID3DBlob **shader, ID3DBlob **error_messages)
Definition: compiler.c:902
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
Definition: asm.c:30
#define debugstr_a
Definition: kernel32.h:31
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ID3DBlob ** error_messages
Definition: asm.c:30
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define NULL
Definition: types.h:112
static SIZE_T const char const D3D_SHADER_MACRO * defines
Definition: asm.c:30

Referenced by D3DXPreprocessShaderFromResourceA(), and D3DXPreprocessShaderFromResourceW().

◆ D3DXPreprocessShaderFromFileA()

HRESULT WINAPI D3DXPreprocessShaderFromFileA ( const char filename,
const D3DXMACRO defines,
ID3DXInclude *  include,
ID3DXBuffer **  shader,
ID3DXBuffer **  error_messages 
)

Definition at line 620 of file shader.c.

622 {
623  WCHAR *filename_w = NULL;
624  DWORD len;
625  HRESULT ret;
626 
627  TRACE("filename %s, defines %p, include %p, shader %p, error_messages %p.\n",
629 
630  if (!filename) return D3DXERR_INVALIDDATA;
631 
632  len = MultiByteToWideChar(CP_ACP, 0, filename, -1, NULL, 0);
633  filename_w = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
634  if (!filename_w) return E_OUTOFMEMORY;
635  MultiByteToWideChar(CP_ACP, 0, filename, -1, filename_w, len);
636 
638 
639  HeapFree(GetProcessHeap(), 0, filename_w);
640  return ret;
641 }
#define CP_ACP
Definition: compat.h:109
const char * filename
Definition: ioapi.h:135
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
Definition: asm.c:30
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:79
unsigned long DWORD
Definition: ntddk_ex.h:95
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ID3DBlob ** error_messages
Definition: asm.c:30
int ret
GLenum GLsizei len
Definition: glext.h:6722
HRESULT WINAPI D3DXPreprocessShaderFromFileW(const WCHAR *filename, const D3DXMACRO *defines, ID3DXInclude *include, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
Definition: shader.c:643
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
static SIZE_T const char const D3D_SHADER_MACRO * defines
Definition: asm.c:30
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by d3dxpreprocess_test().

◆ D3DXPreprocessShaderFromFileW()

HRESULT WINAPI D3DXPreprocessShaderFromFileW ( const WCHAR filename,
const D3DXMACRO defines,
ID3DXInclude *  include,
ID3DXBuffer **  shader,
ID3DXBuffer **  error_messages 
)

Definition at line 643 of file shader.c.

645 {
646  const void *buffer;
647  DWORD len;
648  HRESULT hr;
649  struct d3dx_include_from_file include_from_file;
650  char *filename_a;
651 
652  TRACE("filename %s, defines %p, include %p, shader %p, error_messages %p.\n",
654 
655  if (!include)
656  {
657  include_from_file.ID3DXInclude_iface.lpVtbl = &d3dx_include_from_file_vtbl;
658  include = &include_from_file.ID3DXInclude_iface;
659  }
660 
662  filename_a = HeapAlloc(GetProcessHeap(), 0, len * sizeof(char));
663  if (!filename_a)
664  return E_OUTOFMEMORY;
665  WideCharToMultiByte(CP_ACP, 0, filename, -1, filename_a, len, NULL, NULL);
666 
668  hr = ID3DXInclude_Open(include, D3DXINC_LOCAL, filename_a, NULL, &buffer, &len);
669  if (FAILED(hr))
670  {
672  HeapFree(GetProcessHeap(), 0, filename_a);
673  return D3DXERR_INVALIDDATA;
674  }
675 
677  (const D3D_SHADER_MACRO *)defines,
678  (ID3DInclude *) include,
680 
683  HeapFree(GetProcessHeap(), 0, filename_a);
684  return hr;
685 }
#define ID3DXInclude_Open(p, a, b, c, d, e)
Definition: d3dx9shader.h:303
const struct ID3DXIncludeVtbl d3dx_include_from_file_vtbl
Definition: shader.c:315
#define WideCharToMultiByte
Definition: compat.h:111
HRESULT hr
Definition: shlfolder.c:183
CRITICAL_SECTION from_file_mutex
Definition: shader.c:229
#define CP_ACP
Definition: compat.h:109
GLuint buffer
Definition: glext.h:5915
HRESULT WINAPI D3DPreprocess(const void *data, SIZE_T size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, ID3DBlob **shader, ID3DBlob **error_messages)
Definition: compiler.c:902
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
const char * filename
Definition: ioapi.h:135
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define debugstr_w
Definition: kernel32.h:32
#define ID3DXInclude_Close(p, a)
Definition: d3dx9shader.h:304
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
Definition: asm.c:30
LONG HRESULT
Definition: typedefs.h:79
unsigned long DWORD
Definition: ntddk_ex.h:95
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ID3DBlob ** error_messages
Definition: asm.c:30
GLenum GLsizei len
Definition: glext.h:6722
#define NULL
Definition: types.h:112
static SIZE_T const char const D3D_SHADER_MACRO * defines
Definition: asm.c:30
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by d3dxpreprocess_test(), and D3DXPreprocessShaderFromFileA().

◆ D3DXPreprocessShaderFromResourceA()

HRESULT WINAPI D3DXPreprocessShaderFromResourceA ( HMODULE  module,
const char resource,
const D3DXMACRO defines,
ID3DXInclude *  include,
ID3DXBuffer **  shader,
ID3DXBuffer **  error_messages 
)

Definition at line 687 of file shader.c.

689 {
690  void *buffer;
691  HRSRC res;
692  DWORD len;
693 
694  TRACE("module %p, resource %s, defines %p, include %p, shader %p, error_messages %p.\n",
696 
697  if (!(res = FindResourceA(module, resource, (const char *)RT_RCDATA)))
698  return D3DXERR_INVALIDDATA;
700  return D3DXERR_INVALIDDATA;
703 }
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
GLuint buffer
Definition: glext.h:5915
HRESULT load_resource_into_memory(HMODULE module, HRSRC resinfo, void **buffer, DWORD *length) DECLSPEC_HIDDEN
Definition: util.c:170
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
Definition: asm.c:30
#define debugstr_a
Definition: kernel32.h:31
unsigned long DWORD
Definition: ntddk_ex.h:95
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ID3DBlob ** error_messages
Definition: asm.c:30
#define RT_RCDATA
Definition: pedump.c:372
HRESULT WINAPI D3DXPreprocessShader(const char *data, UINT data_len, const D3DXMACRO *defines, ID3DXInclude *include, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
Definition: shader.c:609
GLenum GLsizei len
Definition: glext.h:6722
static SIZE_T const char const D3D_SHADER_MACRO * defines
Definition: asm.c:30
GLuint res
Definition: glext.h:9613

Referenced by d3dxpreprocess_test().

◆ D3DXPreprocessShaderFromResourceW()

HRESULT WINAPI D3DXPreprocessShaderFromResourceW ( HMODULE  module,
const WCHAR resource,
const D3DXMACRO defines,
ID3DXInclude *  include,
ID3DXBuffer **  shader,
ID3DXBuffer **  error_messages 
)

Definition at line 705 of file shader.c.

707 {
708  void *buffer;
709  HRSRC res;
710  DWORD len;
711 
712  TRACE("module %p, resource %s, defines %p, include %p, shader %p, error_messages %p.\n",
714 
715  if (!(res = FindResourceW(module, resource, (const WCHAR *)RT_RCDATA)))
716  return D3DXERR_INVALIDDATA;
718  return D3DXERR_INVALIDDATA;
721 
722 }
GLuint buffer
Definition: glext.h:5915
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
#define debugstr_w
Definition: kernel32.h:32
HRESULT load_resource_into_memory(HMODULE module, HRSRC resinfo, void **buffer, DWORD *length) DECLSPEC_HIDDEN
Definition: util.c:170
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
Definition: asm.c:30
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ID3DBlob ** error_messages
Definition: asm.c:30
#define RT_RCDATA
Definition: pedump.c:372
HRESULT WINAPI D3DXPreprocessShader(const char *data, UINT data_len, const D3DXMACRO *defines, ID3DXInclude *include, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
Definition: shader.c:609
GLenum GLsizei len
Definition: glext.h:6722
static SIZE_T const char const D3D_SHADER_MACRO * defines
Definition: asm.c:30
GLuint res
Definition: glext.h:9613

◆ DECLARE_INTERFACE()

DECLARE_INTERFACE ( ID3DXInclude  )

Definition at line 295 of file d3dx9shader.h.

296 {
297  STDMETHOD(Open)(THIS_ D3DXINCLUDE_TYPE include_type, const char *filename,
298  const void *parent_data, const void **data, UINT *bytes) PURE;
299  STDMETHOD(Close)(THIS_ const void *data) PURE;
300 };
#define THIS_
Definition: basetyps.h:65
const char * filename
Definition: ioapi.h:135
#define STDMETHOD(m)
Definition: basetyps.h:62
#define Open
Definition: syshdrs.h:62
static unsigned char bytes[4]
Definition: adnsresfilter.c:74
enum _D3DXINCLUDE_TYPE D3DXINCLUDE_TYPE
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
Definition: sacdrv.h:267
#define PURE
Definition: basetyps.h:64
unsigned int UINT
Definition: ndis.h:50

◆ DECLARE_INTERFACE_() [1/3]

DECLARE_INTERFACE_ ( ID3DXConstantTable  ,
ID3DXBuffer   
)

Definition at line 128 of file d3dx9shader.h.

129 {
130  /*** IUnknown methods ***/
134  /*** ID3DXBuffer methods ***/
135  STDMETHOD_(void *, GetBufferPointer)(THIS) PURE;
136  STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE;
137  /*** ID3DXConstantTable methods ***/
138  STDMETHOD(GetDesc)(THIS_ D3DXCONSTANTTABLE_DESC *pDesc) PURE;
139  STDMETHOD(GetConstantDesc)(THIS_ D3DXHANDLE hConstant, D3DXCONSTANT_DESC *pConstantDesc, UINT *pCount) PURE;
140  STDMETHOD_(UINT, GetSamplerIndex)(THIS_ D3DXHANDLE hConstant) PURE;
141  STDMETHOD_(D3DXHANDLE, GetConstant)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE;
142  STDMETHOD_(D3DXHANDLE, GetConstantByName)(THIS_ D3DXHANDLE constant, const char *name) PURE;
143  STDMETHOD_(D3DXHANDLE, GetConstantElement)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE;
144  STDMETHOD(SetDefaults)(THIS_ struct IDirect3DDevice9 *device) PURE;
145  STDMETHOD(SetValue)(THIS_ struct IDirect3DDevice9 *device, D3DXHANDLE constant,
146  const void *data, UINT data_size) PURE;
147  STDMETHOD(SetBool)(THIS_ struct IDirect3DDevice9 *device, D3DXHANDLE constant, BOOL value) PURE;
148  STDMETHOD(SetBoolArray)(THIS_ struct IDirect3DDevice9 *device, D3DXHANDLE constant,
149  const BOOL *values, UINT value_count) PURE;
150  STDMETHOD(SetInt)(THIS_ struct IDirect3DDevice9 *device, D3DXHANDLE constant, INT value) PURE;
151  STDMETHOD(SetIntArray)(THIS_ struct IDirect3DDevice9 *device, D3DXHANDLE constant,
152  const INT *values, UINT value_count) PURE;
153  STDMETHOD(SetFloat)(THIS_ struct IDirect3DDevice9 *device, D3DXHANDLE constant, float value) PURE;
154  STDMETHOD(SetFloatArray)(THIS_ struct IDirect3DDevice9 *device, D3DXHANDLE constant,
155  const float *values, UINT value_count) PURE;
156  STDMETHOD(SetVector)(THIS_ struct IDirect3DDevice9 *device, D3DXHANDLE constant, const D3DXVECTOR4 *value) PURE;
157  STDMETHOD(SetVectorArray)(THIS_ struct IDirect3DDevice9 *device, D3DXHANDLE constant,
158  const D3DXVECTOR4 *values, UINT value_count) PURE;
159  STDMETHOD(SetMatrix)(THIS_ struct IDirect3DDevice9 *device, D3DXHANDLE constant, const D3DXMATRIX *value) PURE;
160  STDMETHOD(SetMatrixArray)(THIS_ struct IDirect3DDevice9 *device, D3DXHANDLE constant,
161  const D3DXMATRIX *values, UINT value_count) PURE;
162  STDMETHOD(SetMatrixPointerArray)(THIS_ struct IDirect3DDevice9 *device, D3DXHANDLE constant,
163  const D3DXMATRIX **values, UINT value_count) PURE;
164  STDMETHOD(SetMatrixTranspose)(THIS_ struct IDirect3DDevice9 *device, D3DXHANDLE constant,
165  const D3DXMATRIX *value) PURE;
167  const D3DXMATRIX *values, UINT value_count) PURE;
169  const D3DXMATRIX **values, UINT value_count) PURE;
170 };
#define REFIID
Definition: guiddef.h:118
#define THIS_
Definition: basetyps.h:65
const char * D3DXHANDLE
Definition: d3dx9shader.h:48
#define THIS
Definition: basetyps.h:66
static HRESULT QueryInterface(REFIID, void **)
Definition: events.c:2587
GLboolean GLenum GLenum GLvoid * values
Definition: glext.h:5666
int32_t INT
Definition: typedefs.h:58
#define STDMETHOD(m)
Definition: basetyps.h:62
FxDevice * device
unsigned int BOOL
Definition: ntddk_ex.h:94
_In_ WDFCOLLECTION _In_ ULONG Index
static FILE * out
Definition: regtests2xml.c:44
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizei const GLfloat * value
Definition: glext.h:6069
void SetDefaults()
Definition: butterflies.c:36
_In_ BOOLEAN Release
Definition: cdrom.h:920
#define PURE
Definition: basetyps.h:64
unsigned int UINT
Definition: ndis.h:50
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
unsigned int ULONG
Definition: retypes.h:1
#define STDMETHOD_(t, m)
Definition: basetyps.h:63
GLuint const GLchar * name
Definition: glext.h:6031

◆ DECLARE_INTERFACE_() [2/3]

DECLARE_INTERFACE_ ( ID3DXTextureShader  ,
IUnknown   
)

Definition at line 244 of file d3dx9shader.h.

245 {
249  STDMETHOD(GetFunction)(THIS_ struct ID3DXBuffer **ppFunction) PURE;
250  STDMETHOD(GetConstantBuffer)(THIS_ struct ID3DXBuffer **ppConstantBuffer) PURE;
251  STDMETHOD(GetDesc)(THIS_ D3DXCONSTANTTABLE_DESC *pDesc) PURE;
252  STDMETHOD(GetConstantDesc)(THIS_ D3DXHANDLE hConstant, D3DXCONSTANT_DESC *pConstantDesc, UINT *pCount) PURE;
253  STDMETHOD_(D3DXHANDLE, GetConstant)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE;
254  STDMETHOD_(D3DXHANDLE, GetConstantByName)(THIS_ D3DXHANDLE hConstant, const char *pName) PURE;
255  STDMETHOD_(D3DXHANDLE, GetConstantElement)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE;
257  STDMETHOD(SetValue)(THIS_ D3DXHANDLE hConstant, const void *pData, UINT Bytes) PURE;
258  STDMETHOD(SetBool)(THIS_ D3DXHANDLE hConstant, BOOL b) PURE;
259  STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hConstant, const BOOL *pb, UINT Count) PURE;
260  STDMETHOD(SetInt)(THIS_ D3DXHANDLE hConstant, INT n) PURE;
261  STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hConstant, const INT *pn, UINT Count) PURE;
263  STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hConstant, const FLOAT *pf, UINT Count) PURE;
264  STDMETHOD(SetVector)(THIS_ D3DXHANDLE hConstant, const D3DXVECTOR4 *pVector) PURE;
265  STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hConstant, const D3DXVECTOR4 *pVector, UINT Count) PURE;
266  STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hConstant, const D3DXMATRIX *pMatrix) PURE;
267  STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hConstant, const D3DXMATRIX *pMatrix, UINT Count) PURE;
268  STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hConstant, const D3DXMATRIX **ppMatrix, UINT Count) PURE;
269  STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hConstant, const D3DXMATRIX *pMatrix) PURE;
272 };
#define REFIID
Definition: guiddef.h:118
#define THIS_
Definition: basetyps.h:65
const char * D3DXHANDLE
Definition: d3dx9shader.h:48
#define THIS
Definition: basetyps.h:66
REFIID riid
Definition: precomp.h:44
static HRESULT QueryInterface(REFIID, void **)
Definition: events.c:2587
REFIID LPVOID * ppv
Definition: atlbase.h:39
_In_ UINT Bytes
Definition: mmcopy.h:9
GLdouble n
Definition: glext.h:7729
int32_t INT
Definition: typedefs.h:58
#define STDMETHOD(m)
Definition: basetyps.h:62
unsigned int BOOL
Definition: ntddk_ex.h:94
struct ID3DXBuffer ID3DXBuffer
Definition: d3dx8core.h:51
#define b
Definition: ke_i.h:79
static int pints_t pn[]
Definition: server.c:129
int Count
Definition: noreturn.cpp:7
static LPSTR pName
Definition: security.c:75
_In_ WDFCOLLECTION _In_ ULONG Index
void SetDefaults()
Definition: butterflies.c:36
_In_ BOOLEAN Release
Definition: cdrom.h:920
#define f
Definition: ke_i.h:83
#define PURE
Definition: basetyps.h:64
unsigned int UINT
Definition: ndis.h:50
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
float FLOAT
Definition: typedefs.h:69
unsigned int ULONG
Definition: retypes.h:1
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
#define STDMETHOD_(t, m)
Definition: basetyps.h:63

◆ DECLARE_INTERFACE_() [3/3]

DECLARE_INTERFACE_ ( ID3DXFragmentLinker  ,
IUnknown   
)

Definition at line 319 of file d3dx9shader.h.

320 {
324 
325  STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9 **device) PURE;
326  STDMETHOD_(UINT, GetNumberOfFragments)(THIS) PURE;
327 
328  STDMETHOD_(D3DXHANDLE, GetFragmentHandleByIndex)(THIS_ UINT index) PURE;
329  STDMETHOD_(D3DXHANDLE, GetFragmentHandleByName)(THIS_ const char *name) PURE;
330  STDMETHOD(GetFragmentDesc)(THIS_ D3DXHANDLE name, D3DXFRAGMENT_DESC *frag_desc) PURE;
331 
332  STDMETHOD(AddFragments)(THIS_ const DWORD *fragments) PURE;
333 
334  STDMETHOD(GetAllFragments)(THIS_ ID3DXBuffer **buffer) PURE;
336 
337  STDMETHOD(LinkShader)(THIS_ const char *profile, DWORD flags, const D3DXHANDLE *fragmenthandles, UINT fragments, ID3DXBuffer **buffer, ID3DXBuffer **errors) PURE;
338  STDMETHOD(LinkVertexShader)(THIS_ const char *profile, DWORD flags, const D3DXHANDLE *fragment_handles, UINT fragments, IDirect3DVertexShader9 **shader, ID3DXBuffer **errors) PURE;
339  STDMETHOD(LinkPixelShader)(THIS_ const char *profile, DWORD flags, const D3DXHANDLE *fragment_handles, UINT fragments, IDirect3DPixelShader9 **shader, ID3DXBuffer **errors) PURE;
340 
341  STDMETHOD(ClearCache)(THIS) PURE;
342 };
#define REFIID
Definition: guiddef.h:118
#define THIS_
Definition: basetyps.h:65
const char * D3DXHANDLE
Definition: d3dx9shader.h:48
#define THIS
Definition: basetyps.h:66
static HRESULT QueryInterface(REFIID, void **)
Definition: events.c:2587
REFIID LPVOID * ppv
Definition: atlbase.h:39
GLuint buffer
Definition: glext.h:5915
#define STDMETHOD(m)
Definition: basetyps.h:62
FxDevice * device
struct ID3DXBuffer ID3DXBuffer
Definition: d3dx8core.h:51
WDF_DMA_PROFILE profile
GLuint shader
Definition: glext.h:6030
return pList GetDevice()
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
#define index(s, c)
Definition: various.h:29
_In_ BOOLEAN Release
Definition: cdrom.h:920
#define PURE
Definition: basetyps.h:64
unsigned int UINT
Definition: ndis.h:50
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
unsigned int ULONG
Definition: retypes.h:1
#define STDMETHOD_(t, m)
Definition: basetyps.h:63
GLuint const GLchar * name
Definition: glext.h:6031

◆ DEFINE_GUID() [1/3]

DEFINE_GUID ( IID_ID3DXConstantTable  ,
0x9dca3190  ,
0x38b9  ,
0x4fc3  ,
0x92  ,
0xe3  ,
0x39  ,
0xc6  ,
0xdd  ,
0xfb  ,
0x35  ,
0x8b   
)

◆ DEFINE_GUID() [2/3]

DEFINE_GUID ( IID_ID3DXTextureShader  ,
0x3e3d67f8  ,
0xaa7a  ,
0x405d  ,
0xa8  ,
0x57  ,
0xba  ,
0x1  ,
0xd4  ,
0x75  ,
0x84  ,
0x26   
)

◆ DEFINE_GUID() [3/3]

DEFINE_GUID ( IID_ID3DXFragmentLinker  ,
0x1a2c0cc2  ,
0xe5b6  ,
0x4ebc  ,
0x9e  ,
0x8d  ,
0x39  ,
0xe  ,
0x5  ,
0x78  ,
0x11  ,
0xb6   
)