ReactOS  0.4.13-dev-242-g611e6d7
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 199 of file shader.c.

201 {
202  HRESULT hr;
203 
204  TRACE("data %p, data_len %u, defines %p, include %p, flags %#x, shader %p, error_messages %p\n",
205  data, data_len, defines, include, flags, shader, error_messages);
206 
207  /* Forward to d3dcompiler: the parameter types aren't really different,
208  the actual data types are equivalent */
209  hr = D3DAssemble(data, data_len, NULL, (D3D_SHADER_MACRO *)defines,
210  (ID3DInclude *)include, flags, (ID3DBlob **)shader,
211  (ID3DBlob **)error_messages);
212 
213  if(hr == E_FAIL) hr = D3DXERR_INVALIDDATA;
214  return hr;
215 }
HRESULT hr
Definition: shlfolder.c:183
#define E_FAIL
Definition: ddrawi.h:102
smooth NULL
Definition: ftsmooth.c:416
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
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:468
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLbitfield flags
Definition: glext.h:7161

Referenced by 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 320 of file shader.c.

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

◆ D3DXAssembleShaderFromFileW()

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

Definition at line 343 of file shader.c.

345 {
346  const void *buffer;
347  DWORD len;
348  HRESULT hr;
349  struct d3dx_include_from_file include_from_file;
350  char *filename_a;
351 
352  TRACE("filename %s, defines %p, include %p, flags %#x, shader %p, error_messages %p.\n",
353  debugstr_w(filename), defines, include, flags, shader, error_messages);
354 
355  if(!include)
356  {
357  include_from_file.ID3DXInclude_iface.lpVtbl = &d3dx_include_from_file_vtbl;
358  include = &include_from_file.ID3DXInclude_iface;
359  }
360 
362  filename_a = HeapAlloc(GetProcessHeap(), 0, len * sizeof(char));
363  if (!filename_a)
364  return E_OUTOFMEMORY;
365  WideCharToMultiByte(CP_ACP, 0, filename, -1, filename_a, len, NULL, NULL);
366 
368  hr = ID3DXInclude_Open(include, D3DXINC_LOCAL, filename_a, NULL, &buffer, &len);
369  if (FAILED(hr))
370  {
372  HeapFree(GetProcessHeap(), 0, filename_a);
373  return D3DXERR_INVALIDDATA;
374  }
375 
376  hr = D3DXAssembleShader(buffer, len, defines, include, flags, shader, error_messages);
377 
378  ID3DXInclude_Close(include, buffer);
380  HeapFree(GetProcessHeap(), 0, filename_a);
381  return hr;
382 }
#define ID3DXInclude_Open(p, a, b, c, d, e)
Definition: d3dx9shader.h:303
#define WideCharToMultiByte
Definition: compat.h:101
HRESULT hr
Definition: shlfolder.c:183
#define CP_ACP
Definition: compat.h:99
const struct ID3DXIncludeVtbl d3dx_include_from_file_vtbl
Definition: shader.c:314
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
smooth NULL
Definition: ftsmooth.c:416
#define ID3DXInclude_Close(p, a)
Definition: d3dx9shader.h:304
HRESULT WINAPI D3DXAssembleShader(const char *data, UINT data_len, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
Definition: shader.c:199
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722
CRITICAL_SECTION from_file_mutex
Definition: shader.c:228
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by 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 384 of file shader.c.

386 {
387  void *buffer;
388  HRSRC res;
389  DWORD len;
390 
391  TRACE("module %p, resource %s, defines %p, include %p, flags %#x, shader %p, error_messages %p.\n",
392  module, debugstr_a(resource), defines, include, flags, shader, error_messages);
393 
394  if (!(res = FindResourceA(module, resource, (const char *)RT_RCDATA)))
395  return D3DXERR_INVALIDDATA;
397  return D3DXERR_INVALIDDATA;
398  return D3DXAssembleShader(buffer, len, defines, include, flags,
399  shader, error_messages);
400 }
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:166
HRESULT WINAPI D3DXAssembleShader(const char *data, UINT data_len, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
Definition: shader.c:199
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
#define RT_RCDATA
Definition: pedump.c:372
GLenum GLsizei len
Definition: glext.h:6722
GLuint res
Definition: glext.h:9613

◆ D3DXAssembleShaderFromResourceW()

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

Definition at line 402 of file shader.c.

404 {
405  void *buffer;
406  HRSRC res;
407  DWORD len;
408 
409  TRACE("module %p, resource %s, defines %p, include %p, flags %#x, shader %p, error_messages %p.\n",
410  module, debugstr_w(resource), defines, include, flags, shader, error_messages);
411 
412  if (!(res = FindResourceW(module, resource, (const WCHAR *)RT_RCDATA)))
413  return D3DXERR_INVALIDDATA;
415  return D3DXERR_INVALIDDATA;
416  return D3DXAssembleShader(buffer, len, defines, include, flags,
417  shader, error_messages);
418 }
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:166
HRESULT WINAPI D3DXAssembleShader(const char *data, UINT data_len, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
Definition: shader.c:199
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
#define RT_RCDATA
Definition: pedump.c:372
GLenum GLsizei len
Definition: glext.h:6722
GLuint res
Definition: glext.h:9613

◆ 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 420 of file shader.c.

423 {
424  HRESULT hr;
425 
426  TRACE("data %s, length %u, defines %p, include %p, function %s, profile %s, "
427  "flags %#x, shader %p, error_msgs %p, constant_table %p.\n",
428  debugstr_a(data), length, defines, include, debugstr_a(function), debugstr_a(profile),
429  flags, shader, error_msgs, constant_table);
430 
431  hr = D3DCompile(data, length, NULL, (D3D_SHADER_MACRO *)defines, (ID3DInclude *)include,
432  function, profile, flags, 0, (ID3DBlob **)shader, (ID3DBlob **)error_msgs);
433 
434  if (SUCCEEDED(hr) && constant_table)
435  {
437  if (FAILED(hr))
438  {
440  *shader = NULL;
441  }
442  }
443 
444  /* Filter out D3DCompile warning messages that are not present with D3DCompileShader */
445  if (SUCCEEDED(hr) && error_msgs && *error_msgs)
446  {
447  char *messages = ID3DXBuffer_GetBufferPointer(*error_msgs);
448  DWORD size = ID3DXBuffer_GetBufferSize(*error_msgs);
449 
450  /* Ensure messages are null terminated for safe processing */
451  if (size) messages[size - 1] = 0;
452 
453  while (size > 1)
454  {
455  char *prev, *next;
456 
457  /* Warning has the form "warning X3206: ... implicit truncation of vector type"
458  but we only search for "X3206:" in case d3dcompiler_43 has localization */
459  prev = next = strstr(messages, "X3206:");
460  if (!prev) break;
461 
462  /* get pointer to beginning and end of current line */
463  while (prev > messages && *(prev - 1) != '\n') prev--;
464  while (next < messages + size - 1 && *next != '\n') next++;
465  if (next < messages + size - 1 && *next == '\n') next++;
466 
467  memmove(prev, next, messages + size - next);
468  size -= (next - prev);
469  }
470 
471  /* Only return a buffer if the resulting string is not empty as some apps depend on that */
472  if (size <= 1)
473  {
474  ID3DXBuffer_Release(*error_msgs);
475  *error_msgs = NULL;
476  }
477  }
478 
479  return hr;
480 }
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
HRESULT hr
Definition: shlfolder.c:183
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
smooth NULL
Definition: ftsmooth.c:416
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
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:77
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
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:727
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
HRESULT WINAPI D3DXGetShaderConstantTable(const DWORD *byte_code, ID3DXConstantTable **constant_table)
Definition: shader.c:2104
GLbitfield flags
Definition: glext.h:7161
static unsigned __int64 next
Definition: rand_nt.c:6
#define ID3DXBuffer_Release(p)
Definition: d3dx9core.h:83
#define profile
Definition: kernel32.h:12
#define ID3DXBuffer_GetBufferPointer(p)
Definition: d3dx9core.h:85
#define SUCCEEDED(hr)
Definition: intsafe.h:57

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 482 of file shader.c.

485 {
486  WCHAR *filename_w;
487  DWORD len;
488  HRESULT ret;
489 
490  TRACE("filename %s, defines %p, include %p, entrypoint %s, profile %s, "
491  "flags %#x, shader %p, error_messages %p, constant_table %p.\n",
492  debugstr_a(filename), defines, include, debugstr_a(entrypoint),
493  debugstr_a(profile), flags, shader, error_messages, constant_table);
494 
495  if (!filename) return D3DXERR_INVALIDDATA;
496 
497  len = MultiByteToWideChar(CP_ACP, 0, filename, -1, NULL, 0);
498  filename_w = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
499  if (!filename_w) return E_OUTOFMEMORY;
500  MultiByteToWideChar(CP_ACP, 0, filename, -1, filename_w, len);
501 
502  ret = D3DXCompileShaderFromFileW(filename_w, defines, include,
503  entrypoint, profile, flags,
504  shader, error_messages, constant_table);
505 
506  HeapFree(GetProcessHeap(), 0, filename_w);
507  return ret;
508 }
#define CP_ACP
Definition: compat.h:99
const char * filename
Definition: ioapi.h:135
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
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:510
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define MultiByteToWideChar
Definition: compat.h:100
#define profile
Definition: kernel32.h:12
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ 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 510 of file shader.c.

513 {
514  const void *buffer;
515  DWORD len, filename_len;
516  HRESULT hr;
517  struct d3dx_include_from_file include_from_file;
518  char *filename_a;
519 
520  TRACE("filename %s, defines %p, include %p, entrypoint %s, profile %s, "
521  "flags %#x, shader %p, error_messages %p, constant_table %p.\n",
522  debugstr_w(filename), defines, include, debugstr_a(entrypoint), debugstr_a(profile),
523  flags, shader, error_messages, constant_table);
524 
525  if (!include)
526  {
527  include_from_file.ID3DXInclude_iface.lpVtbl = &d3dx_include_from_file_vtbl;
528  include = &include_from_file.ID3DXInclude_iface;
529  }
530 
531  filename_len = WideCharToMultiByte(CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL);
532  filename_a = HeapAlloc(GetProcessHeap(), 0, filename_len * sizeof(char));
533  if (!filename_a)
534  return E_OUTOFMEMORY;
535  WideCharToMultiByte(CP_ACP, 0, filename, -1, filename_a, filename_len, NULL, NULL);
536 
538  hr = ID3DXInclude_Open(include, D3DXINC_LOCAL, filename_a, NULL, &buffer, &len);
539  if (FAILED(hr))
540  {
542  HeapFree(GetProcessHeap(), 0, filename_a);
543  return D3DXERR_INVALIDDATA;
544  }
545 
546  hr = D3DCompile(buffer, len, filename_a, (const D3D_SHADER_MACRO *)defines,
547  (ID3DInclude *)include, entrypoint, profile, flags, 0,
548  (ID3DBlob **)shader, (ID3DBlob **)error_messages);
549 
550  if (SUCCEEDED(hr) && constant_table)
552  constant_table);
553 
554  ID3DXInclude_Close(include, buffer);
556  HeapFree(GetProcessHeap(), 0, filename_a);
557  return hr;
558 }
#define ID3DXInclude_Open(p, a, b, c, d, e)
Definition: d3dx9shader.h:303
#define WideCharToMultiByte
Definition: compat.h:101
HRESULT hr
Definition: shlfolder.c:183
#define CP_ACP
Definition: compat.h:99
const struct ID3DXIncludeVtbl d3dx_include_from_file_vtbl
Definition: shader.c:314
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
smooth NULL
Definition: ftsmooth.c:416
#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:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:77
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:727
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT WINAPI D3DXGetShaderConstantTable(const DWORD *byte_code, ID3DXConstantTable **constant_table)
Definition: shader.c:2104
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722
CRITICAL_SECTION from_file_mutex
Definition: shader.c:228
#define profile
Definition: kernel32.h:12
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define HeapFree(x, y, z)
Definition: compat.h:394
#define ID3DXBuffer_GetBufferPointer(p)
Definition: d3dx9core.h:85
#define SUCCEEDED(hr)
Definition: intsafe.h:57

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 560 of file shader.c.

563 {
564  void *buffer;
565  HRSRC res;
566  DWORD len;
567 
568  TRACE("module %p, resource %s, defines %p, include %p, entrypoint %s, profile %s, "
569  "flags %#x, shader %p, error_messages %p, constant_table %p.\n",
570  module, debugstr_a(resource), defines, include, debugstr_a(entrypoint), debugstr_a(profile),
571  flags, shader, error_messages, constant_table);
572 
573  if (!(res = FindResourceA(module, resource, (const char *)RT_RCDATA)))
574  return D3DXERR_INVALIDDATA;
576  return D3DXERR_INVALIDDATA;
577  return D3DXCompileShader(buffer, len, defines, include, entrypoint, profile,
578  flags, shader, error_messages, constant_table);
579 }
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:166
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
unsigned long DWORD
Definition: ntddk_ex.h:95
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:420
GLbitfield flags
Definition: glext.h:7161
#define RT_RCDATA
Definition: pedump.c:372
GLenum GLsizei len
Definition: glext.h:6722
GLuint res
Definition: glext.h:9613
#define profile
Definition: kernel32.h:12

◆ 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 581 of file shader.c.

584 {
585  void *buffer;
586  HRSRC res;
587  DWORD len;
588 
589  TRACE("module %p, resource %s, defines %p, include %p, entrypoint %s, profile %s, "
590  "flags %#x, shader %p, error_messages %p, constant_table %p.\n",
591  module, debugstr_w(resource), defines, include, debugstr_a(entrypoint), debugstr_a(profile),
592  flags, shader, error_messages, constant_table);
593 
594  if (!(res = FindResourceW(module, resource, (const WCHAR *)RT_RCDATA)))
595  return D3DXERR_INVALIDDATA;
597  return D3DXERR_INVALIDDATA;
598  return D3DXCompileShader(buffer, len, defines, include, entrypoint, profile,
599  flags, shader, error_messages, constant_table);
600 }
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:166
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
unsigned long DWORD
Definition: ntddk_ex.h:95
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:420
GLbitfield flags
Definition: glext.h:7161
#define RT_RCDATA
Definition: pedump.c:372
GLenum GLsizei len
Definition: glext.h:6722
GLuint res
Definition: glext.h:9613
#define profile
Definition: kernel32.h:12

◆ D3DXCreateFragmentLinker()

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

Definition at line 2111 of file shader.c.

2112 {
2113  FIXME("device %p, size %u, linker %p: stub.\n", device, size, linker);
2114 
2115  if (linker)
2116  *linker = NULL;
2117 
2118 
2119  return E_NOTIMPL;
2120 }
Definition: devices.h:37
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ D3DXCreateFragmentLinkerEx()

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

Definition at line 2122 of file shader.c.

2123 {
2124  FIXME("device %p, size %u, flags %#x, linker %p: stub.\n", device, size, flags, linker);
2125 
2126  if (linker)
2127  *linker = NULL;
2128 
2129  return E_NOTIMPL;
2130 }
Definition: devices.h:37
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
GLbitfield flags
Definition: glext.h:7161
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ D3DXCreateTextureShader()

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

Definition at line 2756 of file shader.c.

2757 {
2758  struct d3dx9_texture_shader *object;
2759 
2760  TRACE("function %p, texture_shader %p.\n", function, texture_shader);
2761 
2762  if (!function || !texture_shader)
2763  return D3DERR_INVALIDCALL;
2764 
2765  object = HeapAlloc(GetProcessHeap(), 0, sizeof(*object));
2766  if (!object)
2767  return E_OUTOFMEMORY;
2768 
2769  object->ID3DXTextureShader_iface.lpVtbl = &d3dx9_texture_shader_vtbl;
2770  object->ref = 1;
2771 
2772  *texture_shader = &object->ID3DXTextureShader_iface;
2773 
2774  return D3D_OK;
2775 }
#define D3DERR_INVALIDCALL
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define D3D_OK
Definition: d3d.h:106
static const struct ID3DXTextureShaderVtbl d3dx9_texture_shader_vtbl
Definition: shader.c:2724
void * object
Definition: jmemsys.h:48

◆ D3DXDisassembleShader()

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

Definition at line 2445 of file shader.c.

2446 {
2447  DWORD *ptr = (DWORD *)shader;
2448  char *buffer, *buf;
2449  UINT capacity = 4096;
2450  BOOL ps;
2451  WORD version;
2452  HRESULT hr;
2453 
2454  TRACE("%p %d %s %p\n", shader, colorcode, debugstr_a(comments), disassembly);
2455 
2456  if (!shader || !disassembly)
2457  return D3DERR_INVALIDCALL;
2458 
2459  buf = buffer = HeapAlloc(GetProcessHeap(), 0, capacity);
2460  if (!buffer)
2461  return E_OUTOFMEMORY;
2462 
2463  ps = (*ptr >> 16) & 1;
2464  version = *ptr & 0xFFFF;
2465  buf += sprintf(buf, " %s_%d_%d\n", ps ? "ps" : "vs", D3DSHADER_VERSION_MAJOR(*ptr), D3DSHADER_VERSION_MINOR(*ptr));
2466  ptr++;
2467 
2468  while (*ptr != D3DSIO_END)
2469  {
2470  DWORD index;
2471 
2472  if ((buf - buffer + 128) > capacity)
2473  {
2474  UINT count = buf - buffer;
2475  char *new_buffer = HeapReAlloc(GetProcessHeap(), 0, buffer, capacity * 2);
2476  if (!new_buffer)
2477  {
2479  return E_OUTOFMEMORY;
2480  }
2481  capacity *= 2;
2482  buffer = new_buffer;
2483  buf = buffer + count;
2484  }
2485 
2486  for (index = 0; index < sizeof(instructions)/sizeof(instructions[0]); index++)
2487  if (((*ptr & D3DSI_OPCODE_MASK) == instructions[index].opcode) &&
2488  (version >= instructions[index].min_version) && (version <= instructions[index].max_version))
2489  break;
2490 
2491  if (index != sizeof(instructions)/sizeof(instructions[0]))
2492  {
2493  buf += instructions[index].function(&(instructions[index]), &ptr, buf, ps);
2494  }
2495  else
2496  {
2497  buf += sprintf(buf, " ??? (Unknown opcode %x)\n", *ptr);
2498  while (*++ptr & (1u << 31));
2499  }
2500  }
2501 
2502  hr = D3DXCreateBuffer(buf - buffer + 1 , disassembly);
2503  if (SUCCEEDED(hr))
2504  strcpy(ID3DXBuffer_GetBufferPointer(*disassembly), buffer);
2506 
2507  return hr;
2508 }
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
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define D3DERR_INVALIDCALL
GLuint buffer
Definition: glext.h:5915
#define sprintf(buf, format,...)
Definition: sprintf.c:55
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
unsigned int BOOL
Definition: ntddk_ex.h:94
static PVOID ptr
Definition: dispmode.c:27
static const WCHAR version[]
Definition: asmname.c:64
GLuint index
Definition: glext.h:6031
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:77
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:393
const struct instr_info instructions[]
Definition: shader.c:2353
#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:394
HRESULT WINAPI D3DXCreateBuffer(DWORD size, ID3DXBuffer **buffer)
Definition: core.c:129
#define ID3DXBuffer_GetBufferPointer(p)
Definition: d3dx9core.h:85
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ D3DXFindShaderComment()

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

Definition at line 149 of file shader.c.

150 {
151  const DWORD *ptr = byte_code;
152  DWORD version;
153 
154  TRACE("byte_code %p, fourcc %x, data %p, size %p\n", byte_code, fourcc, data, size);
155 
156  if (data) *data = NULL;
157  if (size) *size = 0;
158 
159  if (!byte_code) return D3DERR_INVALIDCALL;
160 
161  version = *ptr >> 16;
162  if (version != 0x4658 /* FX */
163  && version != 0x5458 /* TX */
164  && version != 0x7ffe
165  && version != 0x7fff
166  && version != 0xfffe /* VS */
167  && version != 0xffff) /* PS */
168  {
169  WARN("Invalid data supplied\n");
170  return D3DXERR_INVALIDDATA;
171  }
172 
173  while (*++ptr != D3DSIO_END)
174  {
175  /* Check if it is a comment */
177  {
179 
180  /* Check if this is the comment we are looking for */
181  if (*(ptr + 1) == fourcc)
182  {
183  UINT ctab_size = (comment_size - 1) * sizeof(DWORD);
184  const void *ctab_data = ptr + 2;
185  if (size)
186  *size = ctab_size;
187  if (data)
188  *data = ctab_data;
189  TRACE("Returning comment data at %p with size %d\n", ctab_data, ctab_size);
190  return D3D_OK;
191  }
192  ptr += comment_size;
193  }
194  }
195 
196  return S_FALSE;
197 }
#define WARN(fmt,...)
Definition: debug.h:111
#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
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR version[]
Definition: asmname.c:64
#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 D3DSI_OPCODE_MASK
Definition: d3d8types.h:306

Referenced by D3DXGetShaderConstantTableEx(), and D3DXGetShaderSamplers().

◆ D3DXGetPixelShaderProfile()

const char* WINAPI D3DXGetPixelShaderProfile ( struct IDirect3DDevice9 *  device)

Definition at line 42 of file shader.c.

43 {
44  D3DCAPS9 caps;
45 
46  TRACE("device %p\n", device);
47 
48  if (!device) return NULL;
49 
51 
52  switch (caps.PixelShaderVersion)
53  {
54  case D3DPS_VERSION(1, 1):
55  return "ps_1_1";
56 
57  case D3DPS_VERSION(1, 2):
58  return "ps_1_2";
59 
60  case D3DPS_VERSION(1, 3):
61  return "ps_1_3";
62 
63  case D3DPS_VERSION(1, 4):
64  return "ps_1_4";
65 
66  case D3DPS_VERSION(2, 0):
67  if ((caps.PS20Caps.NumTemps>=22) &&
68  (caps.PS20Caps.Caps&D3DPS20CAPS_ARBITRARYSWIZZLE) &&
69  (caps.PS20Caps.Caps&D3DPS20CAPS_GRADIENTINSTRUCTIONS) &&
70  (caps.PS20Caps.Caps&D3DPS20CAPS_PREDICATION) &&
71  (caps.PS20Caps.Caps&D3DPS20CAPS_NODEPENDENTREADLIMIT) &&
72  (caps.PS20Caps.Caps&D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT))
73  {
74  return "ps_2_a";
75  }
76  if ((caps.PS20Caps.NumTemps>=32) &&
78  {
79  return "ps_2_b";
80  }
81  return "ps_2_0";
82 
83  case D3DPS_VERSION(3, 0):
84  return "ps_3_0";
85  }
86 
87  return NULL;
88 }
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
#define D3DPS_VERSION(major, minor)
Definition: d3d8types.h:474
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
if(!(yy_init))
Definition: macro.lex.yy.c:714
#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

◆ D3DXGetShaderConstantTable()

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

Definition at line 2104 of file shader.c.

2105 {
2106  TRACE("(%p, %p): Forwarded to D3DXGetShaderConstantTableEx\n", byte_code, constant_table);
2107 
2108  return D3DXGetShaderConstantTableEx(byte_code, 0, constant_table);
2109 }
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT WINAPI D3DXGetShaderConstantTableEx(const DWORD *byte_code, DWORD flags, ID3DXConstantTable **constant_table)
Definition: shader.c:1986

Referenced by D3DXCompileShader(), D3DXCompileShaderFromFileW(), and get_constants_desc().

◆ D3DXGetShaderConstantTableEx()

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

Definition at line 1986 of file shader.c.

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

Referenced by D3DXGetShaderConstantTable().

◆ D3DXGetShaderInputSemantics()

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

Definition at line 3011 of file shader.c.

3012 {
3013  TRACE("byte_code %p, semantics %p, count %p.\n", byte_code, semantics, count);
3014 
3015  return get_shader_semantics(byte_code, semantics, count, FALSE);
3016 }
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:2810

◆ 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 3018 of file shader.c.

3019 {
3020  TRACE("byte_code %p, semantics %p, count %p.\n", byte_code, semantics, count);
3021 
3022  return get_shader_semantics(byte_code, semantics, count, TRUE);
3023 }
#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:2810

◆ D3DXGetShaderSamplers()

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

Definition at line 2132 of file shader.c.

2133 {
2134  UINT i, sampler_count = 0;
2135  UINT size;
2136  const char *data;
2137  const D3DXSHADER_CONSTANTTABLE *ctab_header;
2138  const D3DXSHADER_CONSTANTINFO *constant_info;
2139 
2140  TRACE("byte_code %p, samplers %p, count %p\n", byte_code, samplers, count);
2141 
2142  if (count) *count = 0;
2143 
2144  if (D3DXFindShaderComment(byte_code, MAKEFOURCC('C','T','A','B'), (const void **)&data, &size) != D3D_OK)
2145  return D3D_OK;
2146 
2147  if (size < sizeof(*ctab_header)) return D3D_OK;
2148 
2149  ctab_header = (const D3DXSHADER_CONSTANTTABLE *)data;
2150  if (ctab_header->Size != sizeof(*ctab_header)) return D3D_OK;
2151 
2152  constant_info = (const D3DXSHADER_CONSTANTINFO *)(data + ctab_header->ConstantInfo);
2153  for (i = 0; i < ctab_header->Constants; i++)
2154  {
2155  const D3DXSHADER_TYPEINFO *type;
2156 
2157  TRACE("name = %s\n", data + constant_info[i].Name);
2158 
2159  type = (const D3DXSHADER_TYPEINFO *)(data + constant_info[i].TypeInfo);
2160 
2161  if (type->Type == D3DXPT_SAMPLER
2162  || type->Type == D3DXPT_SAMPLER1D
2163  || type->Type == D3DXPT_SAMPLER2D
2164  || type->Type == D3DXPT_SAMPLER3D
2165  || type->Type == D3DXPT_SAMPLERCUBE)
2166  {
2167  if (samplers) samplers[sampler_count] = data + constant_info[i].Name;
2168 
2169  ++sampler_count;
2170  }
2171  }
2172 
2173  TRACE("Found %u samplers\n", sampler_count);
2174 
2175  if (count) *count = sampler_count;
2176 
2177  return D3D_OK;
2178 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
HRESULT WINAPI D3DXFindShaderComment(const DWORD *byte_code, DWORD fourcc, const void **data, UINT *size)
Definition: shader.c:149
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
#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
unsigned int UINT
Definition: ndis.h:50
GLuint * samplers
Definition: glext.h:7280
#define MAKEFOURCC(ch0, ch1, ch2, ch3)
Definition: dmdls.h:24

◆ D3DXGetShaderSize()

UINT WINAPI D3DXGetShaderSize ( const DWORD byte_code)

Definition at line 90 of file shader.c.

91 {
92  const DWORD *ptr = byte_code;
93 
94  TRACE("byte_code %p\n", byte_code);
95 
96  if (!ptr) return 0;
97 
98  /* Look for the END token, skipping the VERSION token */
99  while (*++ptr != D3DSIO_END)
100  {
101  /* Skip comments */
103  {
105  }
106  }
107  ++ptr;
108 
109  /* Return the shader size in bytes */
110  return (ptr - byte_code) * sizeof(*ptr);
111 }
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

◆ D3DXGetShaderVersion()

DWORD WINAPI D3DXGetShaderVersion ( const DWORD byte_code)

Definition at line 113 of file shader.c.

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

◆ D3DXGetVertexShaderProfile()

const char* WINAPI D3DXGetVertexShaderProfile ( struct IDirect3DDevice9 *  device)

Definition at line 120 of file shader.c.

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

◆ D3DXPreprocessShader()

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

Definition at line 602 of file shader.c.

604 {
605  TRACE("data %s, data_len %u, defines %p, include %p, shader %p, error_messages %p.\n",
606  debugstr_a(data), data_len, defines, include, shader, error_messages);
607 
608  return D3DPreprocess(data, data_len, NULL,
609  (const D3D_SHADER_MACRO *)defines, (ID3DInclude *)include,
610  (ID3DBlob **)shader, (ID3DBlob **)error_messages);
611 }
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:740
smooth NULL
Definition: ftsmooth.c:416
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

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 613 of file shader.c.

615 {
616  WCHAR *filename_w = NULL;
617  DWORD len;
618  HRESULT ret;
619 
620  TRACE("filename %s, defines %p, include %p, shader %p, error_messages %p.\n",
621  debugstr_a(filename), defines, include, shader, error_messages);
622 
623  if (!filename) return D3DXERR_INVALIDDATA;
624 
625  len = MultiByteToWideChar(CP_ACP, 0, filename, -1, NULL, 0);
626  filename_w = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
627  if (!filename_w) return E_OUTOFMEMORY;
628  MultiByteToWideChar(CP_ACP, 0, filename, -1, filename_w, len);
629 
630  ret = D3DXPreprocessShaderFromFileW(filename_w, defines, include, shader, error_messages);
631 
632  HeapFree(GetProcessHeap(), 0, filename_w);
633  return ret;
634 }
HRESULT WINAPI D3DXPreprocessShaderFromFileW(const WCHAR *filename, const D3DXMACRO *defines, ID3DXInclude *include, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
Definition: shader.c:636
#define CP_ACP
Definition: compat.h:99
const char * filename
Definition: ioapi.h:135
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define MultiByteToWideChar
Definition: compat.h:100
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ D3DXPreprocessShaderFromFileW()

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

Definition at line 636 of file shader.c.

638 {
639  const void *buffer;
640  DWORD len;
641  HRESULT hr;
642  struct d3dx_include_from_file include_from_file;
643  char *filename_a;
644 
645  TRACE("filename %s, defines %p, include %p, shader %p, error_messages %p.\n",
646  debugstr_w(filename), defines, include, shader, error_messages);
647 
648  if (!include)
649  {
650  include_from_file.ID3DXInclude_iface.lpVtbl = &d3dx_include_from_file_vtbl;
651  include = &include_from_file.ID3DXInclude_iface;
652  }
653 
655  filename_a = HeapAlloc(GetProcessHeap(), 0, len * sizeof(char));
656  if (!filename_a)
657  return E_OUTOFMEMORY;
658  WideCharToMultiByte(CP_ACP, 0, filename, -1, filename_a, len, NULL, NULL);
659 
661  hr = ID3DXInclude_Open(include, D3DXINC_LOCAL, filename_a, NULL, &buffer, &len);
662  if (FAILED(hr))
663  {
665  HeapFree(GetProcessHeap(), 0, filename_a);
666  return D3DXERR_INVALIDDATA;
667  }
668 
670  (const D3D_SHADER_MACRO *)defines,
671  (ID3DInclude *) include,
672  (ID3DBlob **)shader, (ID3DBlob **)error_messages);
673 
674  ID3DXInclude_Close(include, buffer);
676  HeapFree(GetProcessHeap(), 0, filename_a);
677  return hr;
678 }
#define ID3DXInclude_Open(p, a, b, c, d, e)
Definition: d3dx9shader.h:303
#define WideCharToMultiByte
Definition: compat.h:101
HRESULT hr
Definition: shlfolder.c:183
#define CP_ACP
Definition: compat.h:99
const struct ID3DXIncludeVtbl d3dx_include_from_file_vtbl
Definition: shader.c:314
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:740
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
smooth NULL
Definition: ftsmooth.c:416
#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:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
CRITICAL_SECTION from_file_mutex
Definition: shader.c:228
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by D3DXPreprocessShaderFromFileA().

◆ D3DXPreprocessShaderFromResourceA()

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

Definition at line 680 of file shader.c.

682 {
683  void *buffer;
684  HRSRC res;
685  DWORD len;
686 
687  TRACE("module %p, resource %s, defines %p, include %p, shader %p, error_messages %p.\n",
688  module, debugstr_a(resource), defines, include, shader, error_messages);
689 
690  if (!(res = FindResourceA(module, resource, (const char *)RT_RCDATA)))
691  return D3DXERR_INVALIDDATA;
693  return D3DXERR_INVALIDDATA;
694  return D3DXPreprocessShader(buffer, len, defines, include,
695  shader, error_messages);
696 }
HRESULT WINAPI D3DXPreprocessShader(const char *data, UINT data_len, const D3DXMACRO *defines, ID3DXInclude *include, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
Definition: shader.c:602
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:166
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
unsigned long DWORD
Definition: ntddk_ex.h:95
#define RT_RCDATA
Definition: pedump.c:372
GLenum GLsizei len
Definition: glext.h:6722
GLuint res
Definition: glext.h:9613

◆ D3DXPreprocessShaderFromResourceW()

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

Definition at line 698 of file shader.c.

700 {
701  void *buffer;
702  HRSRC res;
703  DWORD len;
704 
705  TRACE("module %p, resource %s, defines %p, include %p, shader %p, error_messages %p.\n",
706  module, debugstr_w(resource), defines, include, shader, error_messages);
707 
708  if (!(res = FindResourceW(module, resource, (const WCHAR *)RT_RCDATA)))
709  return D3DXERR_INVALIDDATA;
711  return D3DXERR_INVALIDDATA;
712  return D3DXPreprocessShader(buffer, len, defines, include,
713  shader, error_messages);
714 
715 }
HRESULT WINAPI D3DXPreprocessShader(const char *data, UINT data_len, const D3DXMACRO *defines, ID3DXInclude *include, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
Definition: shader.c:602
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:166
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#define RT_RCDATA
Definition: pedump.c:372
GLenum GLsizei len
Definition: glext.h:6722
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;
166  STDMETHOD(SetMatrixTransposeArray)(THIS_ struct IDirect3DDevice9 *device, D3DXHANDLE constant,
167  const D3DXMATRIX *values, UINT value_count) PURE;
168  STDMETHOD(SetMatrixTransposePointerArray)(THIS_ struct IDirect3DDevice9 *device, D3DXHANDLE constant,
169  const D3DXMATRIX **values, UINT value_count) PURE;
170 };
#define REFIID
Definition: guiddef.h:113
#define THIS_
Definition: basetyps.h:65
_In_ BOOLEAN Release
Definition: classpnp.h:929
const char * D3DXHANDLE
Definition: d3dx9shader.h:48
#define THIS
Definition: basetyps.h:66
GLboolean GLenum GLenum GLvoid * values
Definition: glext.h:5666
NTSTATUS QueryInterface(IN PDEVICE_OBJECT DeviceObject, IN CONST GUID InterfaceType, IN LONG Size, IN LONG Version, OUT PVOID Interface)
Definition: fdo.c:532
int32_t INT
Definition: typedefs.h:56
#define STDMETHOD(m)
Definition: basetyps.h:62
unsigned int BOOL
Definition: ntddk_ex.h:94
Definition: devices.h:37
void SetMatrix(HWND hwnd, MATRIX *matrix)
Definition: matrix.c:294
static const UCHAR Index[8]
Definition: usbohci.c:18
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
#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;
262  STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hConstant, FLOAT f) 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;
270  STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hConstant, const D3DXMATRIX *pMatrix, UINT Count) PURE;
271  STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hConstant, const D3DXMATRIX **ppMatrix, UINT Count) PURE;
272 };
#define REFIID
Definition: guiddef.h:113
#define THIS_
Definition: basetyps.h:65
_In_ BOOLEAN Release
Definition: classpnp.h:929
const char * D3DXHANDLE
Definition: d3dx9shader.h:48
#define THIS
Definition: basetyps.h:66
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
_In_ UINT Bytes
Definition: mmcopy.h:9
GLdouble n
Definition: glext.h:7729
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
NTSTATUS QueryInterface(IN PDEVICE_OBJECT DeviceObject, IN CONST GUID InterfaceType, IN LONG Size, IN LONG Version, OUT PVOID Interface)
Definition: fdo.c:532
int32_t INT
Definition: typedefs.h:56
#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 LPSTR pName
Definition: security.c:75
void SetMatrix(HWND hwnd, MATRIX *matrix)
Definition: matrix.c:294
static const UCHAR Index[8]
Definition: usbohci.c:18
void SetDefaults()
Definition: butterflies.c:36
#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:67
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:113
#define THIS_
Definition: basetyps.h:65
_In_ BOOLEAN Release
Definition: classpnp.h:929
const char * D3DXHANDLE
Definition: d3dx9shader.h:48
#define THIS
Definition: basetyps.h:66
REFIID LPVOID * ppv
Definition: atlbase.h:39
GLuint buffer
Definition: glext.h:5915
NTSTATUS QueryInterface(IN PDEVICE_OBJECT DeviceObject, IN CONST GUID InterfaceType, IN LONG Size, IN LONG Version, OUT PVOID Interface)
Definition: fdo.c:532
#define STDMETHOD(m)
Definition: basetyps.h:62
Definition: devices.h:37
struct ID3DXBuffer ID3DXBuffer
Definition: d3dx8core.h:51
GLuint shader
Definition: glext.h:6030
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
#define index(s, c)
Definition: various.h:29
#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 profile
Definition: kernel32.h:12
#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   
)