ReactOS  0.4.14-dev-358-gbef841c
d3dcompiler.h File Reference
#include "d3d11shader.h"
Include dependency graph for d3dcompiler.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define D3DCOMPILER_DLL_A   "d3dcompiler_43.dll"
 
#define D3DCOMPILER_DLL   WINELIB_NAME_AW(D3DCOMPILER_DLL_)
 
#define D3DCOMPILE_DEBUG   0x00000001
 
#define D3DCOMPILE_SKIP_VALIDATION   0x00000002
 
#define D3DCOMPILE_SKIP_OPTIMIZATION   0x00000004
 
#define D3DCOMPILE_PACK_MATRIX_ROW_MAJOR   0x00000008
 
#define D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR   0x00000010
 
#define D3DCOMPILE_PARTIAL_PRECISION   0x00000020
 
#define D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT   0x00000040
 
#define D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT   0x00000080
 
#define D3DCOMPILE_NO_PRESHADER   0x00000100
 
#define D3DCOMPILE_AVOID_FLOW_CONTROL   0x00000200
 
#define D3DCOMPILE_PREFER_FLOW_CONTROL   0x00000400
 
#define D3DCOMPILE_ENABLE_STRICTNESS   0x00000800
 
#define D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY   0x00001000
 
#define D3DCOMPILE_IEEE_STRICTNESS   0x00002000
 
#define D3DCOMPILE_OPTIMIZATION_LEVEL0   0x00004000
 
#define D3DCOMPILE_OPTIMIZATION_LEVEL1   0x00000000
 
#define D3DCOMPILE_OPTIMIZATION_LEVEL2   0x0000c000
 
#define D3DCOMPILE_OPTIMIZATION_LEVEL3   0x00008000
 
#define D3DCOMPILE_RESERVED16   0x00010000
 
#define D3DCOMPILE_RESERVED17   0x00020000
 
#define D3DCOMPILE_WARNINGS_ARE_ERRORS   0x00040000
 
#define D3DCOMPILE_RESOURCES_MAY_ALIAS   0x00080000
 
#define D3D_DISASM_ENABLE_COLOR_CODE   0x00000001
 
#define D3D_DISASM_ENABLE_DEFAULT_VALUE_PRINTS   0x00000002
 
#define D3D_DISASM_ENABLE_INSTRUCTION_NUMBERING   0x00000004
 
#define D3D_DISASM_ENABLE_INSTRUCTION_CYCLE   0x00000008
 
#define D3D_DISASM_DISABLE_DEBUG_INFO   0x00000010
 

Typedefs

typedef HRESULT(WINAPIpD3DCompile) (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)
 
typedef enum D3DCOMPILER_STRIP_FLAGS D3DCOMPILER_STRIP_FLAGS
 
typedef enum D3D_BLOB_PART D3D_BLOB_PART
 
typedef HRESULT(WINAPIpD3DDisassemble) (const void *data, SIZE_T data_size, UINT flags, const char *comments, ID3DBlob **disassembly)
 
typedef HRESULT(WINAPIpD3DPreprocess) (const void *data, SIZE_T size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, ID3DBlob **shader, ID3DBlob **error_messages)
 

Enumerations

enum  D3DCOMPILER_STRIP_FLAGS { D3DCOMPILER_STRIP_REFLECTION_DATA = 1, D3DCOMPILER_STRIP_DEBUG_INFO = 2, D3DCOMPILER_STRIP_TEST_BLOBS = 4, D3DCOMPILER_STRIP_FORCE_DWORD = 0x7fffffff }
 
enum  D3D_BLOB_PART {
  D3D_BLOB_INPUT_SIGNATURE_BLOB, D3D_BLOB_OUTPUT_SIGNATURE_BLOB, D3D_BLOB_INPUT_AND_OUTPUT_SIGNATURE_BLOB, D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB,
  D3D_BLOB_ALL_SIGNATURE_BLOB, D3D_BLOB_DEBUG_INFO, D3D_BLOB_LEGACY_SHADER, D3D_BLOB_XNA_PREPASS_SHADER,
  D3D_BLOB_XNA_SHADER, D3D_BLOB_TEST_ALTERNATE_SHADER = 0x8000, D3D_BLOB_TEST_COMPILE_DETAILS, D3D_BLOB_TEST_COMPILE_PERF
}
 

Functions

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)
 
HRESULT WINAPI D3DStripShader (const void *data, SIZE_T data_size, UINT flags, ID3DBlob **blob)
 
HRESULT WINAPI D3DDisassemble (const void *data, SIZE_T data_size, UINT flags, const char *comments, ID3DBlob **disassembly)
 
HRESULT WINAPI D3DGetBlobPart (const void *data, SIZE_T data_size, D3D_BLOB_PART part, UINT flags, ID3DBlob **blob)
 
HRESULT WINAPI D3DGetInputSignatureBlob (const void *data, SIZE_T data_size, ID3DBlob **blob)
 
HRESULT WINAPI D3DGetOutputSignatureBlob (const void *data, SIZE_T data_size, ID3DBlob **blob)
 
HRESULT WINAPI D3DGetInputAndOutputSignatureBlob (const void *data, SIZE_T data_size, ID3DBlob **blob)
 
HRESULT WINAPI D3DGetDebugInfo (const void *data, SIZE_T data_size, ID3DBlob **blob)
 
HRESULT WINAPI D3DReadFileToBlob (const WCHAR *filename, ID3DBlob **contents)
 
HRESULT WINAPI D3DWriteBlobToFile (ID3DBlob *blob, const WCHAR *filename, BOOL overwrite)
 
HRESULT WINAPI D3DReflect (const void *data, SIZE_T data_size, REFIID riid, void **reflector)
 
HRESULT WINAPI D3DCreateBlob (SIZE_T data_size, ID3DBlob **blob)
 
HRESULT WINAPI D3DPreprocess (const void *data, SIZE_T size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, ID3DBlob **shader, ID3DBlob **error_messages)
 

Variables

static const WCHAR D3DCOMPILER_DLL_W [] = {'d','3','d','c','o','m','p','i','l','e','r','_','4','3','.','d','l','l',0}
 

Macro Definition Documentation

◆ D3D_DISASM_DISABLE_DEBUG_INFO

#define D3D_DISASM_DISABLE_DEBUG_INFO   0x00000010

Definition at line 66 of file d3dcompiler.h.

◆ D3D_DISASM_ENABLE_COLOR_CODE

#define D3D_DISASM_ENABLE_COLOR_CODE   0x00000001

Definition at line 62 of file d3dcompiler.h.

◆ D3D_DISASM_ENABLE_DEFAULT_VALUE_PRINTS

#define D3D_DISASM_ENABLE_DEFAULT_VALUE_PRINTS   0x00000002

Definition at line 63 of file d3dcompiler.h.

◆ D3D_DISASM_ENABLE_INSTRUCTION_CYCLE

#define D3D_DISASM_ENABLE_INSTRUCTION_CYCLE   0x00000008

Definition at line 65 of file d3dcompiler.h.

◆ D3D_DISASM_ENABLE_INSTRUCTION_NUMBERING

#define D3D_DISASM_ENABLE_INSTRUCTION_NUMBERING   0x00000004

Definition at line 64 of file d3dcompiler.h.

◆ D3DCOMPILE_AVOID_FLOW_CONTROL

#define D3DCOMPILE_AVOID_FLOW_CONTROL   0x00000200

Definition at line 48 of file d3dcompiler.h.

◆ D3DCOMPILE_DEBUG

#define D3DCOMPILE_DEBUG   0x00000001

Definition at line 39 of file d3dcompiler.h.

◆ D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY

#define D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY   0x00001000

Definition at line 51 of file d3dcompiler.h.

◆ D3DCOMPILE_ENABLE_STRICTNESS

#define D3DCOMPILE_ENABLE_STRICTNESS   0x00000800

Definition at line 50 of file d3dcompiler.h.

◆ D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT

#define D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT   0x00000080

Definition at line 46 of file d3dcompiler.h.

◆ D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT

#define D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT   0x00000040

Definition at line 45 of file d3dcompiler.h.

◆ D3DCOMPILE_IEEE_STRICTNESS

#define D3DCOMPILE_IEEE_STRICTNESS   0x00002000

Definition at line 52 of file d3dcompiler.h.

◆ D3DCOMPILE_NO_PRESHADER

#define D3DCOMPILE_NO_PRESHADER   0x00000100

Definition at line 47 of file d3dcompiler.h.

◆ D3DCOMPILE_OPTIMIZATION_LEVEL0

#define D3DCOMPILE_OPTIMIZATION_LEVEL0   0x00004000

Definition at line 53 of file d3dcompiler.h.

◆ D3DCOMPILE_OPTIMIZATION_LEVEL1

#define D3DCOMPILE_OPTIMIZATION_LEVEL1   0x00000000

Definition at line 54 of file d3dcompiler.h.

◆ D3DCOMPILE_OPTIMIZATION_LEVEL2

#define D3DCOMPILE_OPTIMIZATION_LEVEL2   0x0000c000

Definition at line 55 of file d3dcompiler.h.

◆ D3DCOMPILE_OPTIMIZATION_LEVEL3

#define D3DCOMPILE_OPTIMIZATION_LEVEL3   0x00008000

Definition at line 56 of file d3dcompiler.h.

◆ D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR

#define D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR   0x00000010

Definition at line 43 of file d3dcompiler.h.

◆ D3DCOMPILE_PACK_MATRIX_ROW_MAJOR

#define D3DCOMPILE_PACK_MATRIX_ROW_MAJOR   0x00000008

Definition at line 42 of file d3dcompiler.h.

◆ D3DCOMPILE_PARTIAL_PRECISION

#define D3DCOMPILE_PARTIAL_PRECISION   0x00000020

Definition at line 44 of file d3dcompiler.h.

◆ D3DCOMPILE_PREFER_FLOW_CONTROL

#define D3DCOMPILE_PREFER_FLOW_CONTROL   0x00000400

Definition at line 49 of file d3dcompiler.h.

◆ D3DCOMPILE_RESERVED16

#define D3DCOMPILE_RESERVED16   0x00010000

Definition at line 57 of file d3dcompiler.h.

◆ D3DCOMPILE_RESERVED17

#define D3DCOMPILE_RESERVED17   0x00020000

Definition at line 58 of file d3dcompiler.h.

◆ D3DCOMPILE_RESOURCES_MAY_ALIAS

#define D3DCOMPILE_RESOURCES_MAY_ALIAS   0x00080000

Definition at line 60 of file d3dcompiler.h.

◆ D3DCOMPILE_SKIP_OPTIMIZATION

#define D3DCOMPILE_SKIP_OPTIMIZATION   0x00000004

Definition at line 41 of file d3dcompiler.h.

◆ D3DCOMPILE_SKIP_VALIDATION

#define D3DCOMPILE_SKIP_VALIDATION   0x00000002

Definition at line 40 of file d3dcompiler.h.

◆ D3DCOMPILE_WARNINGS_ARE_ERRORS

#define D3DCOMPILE_WARNINGS_ARE_ERRORS   0x00040000

Definition at line 59 of file d3dcompiler.h.

◆ D3DCOMPILER_DLL

#define D3DCOMPILER_DLL   WINELIB_NAME_AW(D3DCOMPILER_DLL_)

Definition at line 37 of file d3dcompiler.h.

◆ D3DCOMPILER_DLL_A

#define D3DCOMPILER_DLL_A   "d3dcompiler_43.dll"

Definition at line 36 of file d3dcompiler.h.

Typedef Documentation

◆ D3D_BLOB_PART

◆ D3DCOMPILER_STRIP_FLAGS

◆ pD3DCompile

◆ pD3DDisassemble

typedef HRESULT(WINAPI * pD3DDisassemble) (const void *data, SIZE_T data_size, UINT flags, const char *comments, ID3DBlob **disassembly)

Definition at line 103 of file d3dcompiler.h.

◆ pD3DPreprocess

Enumeration Type Documentation

◆ D3D_BLOB_PART

Enumerator
D3D_BLOB_INPUT_SIGNATURE_BLOB 
D3D_BLOB_OUTPUT_SIGNATURE_BLOB 
D3D_BLOB_INPUT_AND_OUTPUT_SIGNATURE_BLOB 
D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB 
D3D_BLOB_ALL_SIGNATURE_BLOB 
D3D_BLOB_DEBUG_INFO 
D3D_BLOB_LEGACY_SHADER 
D3D_BLOB_XNA_PREPASS_SHADER 
D3D_BLOB_XNA_SHADER 
D3D_BLOB_TEST_ALTERNATE_SHADER 
D3D_BLOB_TEST_COMPILE_DETAILS 
D3D_BLOB_TEST_COMPILE_PERF 

Definition at line 85 of file d3dcompiler.h.

◆ D3DCOMPILER_STRIP_FLAGS

Enumerator
D3DCOMPILER_STRIP_REFLECTION_DATA 
D3DCOMPILER_STRIP_DEBUG_INFO 
D3DCOMPILER_STRIP_TEST_BLOBS 
D3DCOMPILER_STRIP_FORCE_DWORD 

Definition at line 75 of file d3dcompiler.h.

Function Documentation

◆ D3DCompile()

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 at line 889 of file compiler.c.

892 {
893  TRACE("data %p, data_size %lu, filename %s, defines %p, include %p, entrypoint %s, "
894  "target %s, sflags %#x, eflags %#x, shader %p, error_messages %p.\n",
895  data, data_size, debugstr_a(filename), defines, include, debugstr_a(entrypoint),
897 
898  return D3DCompile2(data, data_size, filename, defines, include, entrypoint, target, sflags,
899  eflags, 0, NULL, 0, shader, error_messages);
900 }
static SIZE_T const char const D3D_SHADER_MACRO * defines
Definition: asm.c:30
const char * filename
Definition: ioapi.h:135
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
Definition: asm.c:30
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
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ID3DBlob ** error_messages
Definition: asm.c:30
GLenum target
Definition: glext.h:7315
HRESULT WINAPI D3DCompile2(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, UINT secondary_flags, const void *secondary_data, SIZE_T secondary_data_size, ID3DBlob **shader, ID3DBlob **error_messages)
Definition: compiler.c:857

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

◆ D3DCreateBlob()

HRESULT WINAPI D3DCreateBlob ( SIZE_T  data_size,
ID3DBlob **  blob 
)

Definition at line 133 of file blob.c.

134 {
135  struct d3dcompiler_blob *object;
136  HRESULT hr;
137 
138  TRACE("data_size %lu, blob %p\n", data_size, blob);
139 
140  if (!blob)
141  {
142  WARN("Invalid blob specified.\n");
143  return D3DERR_INVALIDCALL;
144  }
145 
146  object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
147  if (!object)
148  return E_OUTOFMEMORY;
149 
150  hr = d3dcompiler_blob_init(object, data_size);
151  if (FAILED(hr))
152  {
153  WARN("Failed to initialize blob, hr %#x.\n", hr);
154  HeapFree(GetProcessHeap(), 0, object);
155  return hr;
156  }
157 
158  *blob = &object->ID3DBlob_iface;
159 
160  TRACE("Created ID3DBlob %p\n", *blob);
161 
162  return S_OK;
163 }
HRESULT hr
Definition: shlfolder.c:183
Definition: image.c:133
#define WARN(fmt,...)
Definition: debug.h:111
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define D3DERR_INVALIDCALL
Definition: blob.c:34
static HRESULT d3dcompiler_blob_init(struct d3dcompiler_blob *blob, SIZE_T data_size)
Definition: blob.c:117
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define HeapFree(x, y, z)
Definition: compat.h:402
void * object
Definition: jmemsys.h:48

Referenced by assemble_shader(), compile_shader(), d3dcompiler_get_blob_part(), D3DPreprocess(), dxbc_write_blob(), and preprocess_shader().

◆ D3DDisassemble()

HRESULT WINAPI D3DDisassemble ( const void data,
SIZE_T  data_size,
UINT  flags,
const char comments,
ID3DBlob **  disassembly 
)

Definition at line 942 of file compiler.c.

943 {
944  FIXME("data %p, size %lu, flags %#x, comments %p, disassembly %p stub!\n",
945  data, size, flags, comments, disassembly);
946  return E_NOTIMPL;
947 }
#define FIXME(fmt,...)
Definition: debug.h:110
GLsizeiptr size
Definition: glext.h:5919
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLbitfield flags
Definition: glext.h:7161
char comments[4096]
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ D3DGetBlobPart()

HRESULT WINAPI D3DGetBlobPart ( const void data,
SIZE_T  data_size,
D3D_BLOB_PART  part,
UINT  flags,
ID3DBlob **  blob 
)

Definition at line 421 of file blob.c.

422 {
423  TRACE("data %p, data_size %lu, part %s, flags %#x, blob %p\n", data,
424  data_size, debug_d3dcompiler_d3d_blob_part(part), flags, blob);
425 
426  return d3dcompiler_get_blob_part(data, data_size, part, flags, blob);
427 }
const char * debug_d3dcompiler_d3d_blob_part(D3D_BLOB_PART part) DECLSPEC_HIDDEN
Definition: utils.c:106
Definition: image.c:133
static HRESULT d3dcompiler_get_blob_part(const void *data, SIZE_T data_size, D3D_BLOB_PART part, UINT flags, ID3DBlob **blob)
Definition: blob.c:217
#define TRACE(s)
Definition: solgame.cpp:4
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLbitfield flags
Definition: glext.h:7161

◆ D3DGetDebugInfo()

HRESULT WINAPI D3DGetDebugInfo ( const void data,
SIZE_T  data_size,
ID3DBlob **  blob 
)

Definition at line 450 of file blob.c.

451 {
452  TRACE("data %p, data_size %lu, blob %p\n", data, data_size, blob);
453 
454  return d3dcompiler_get_blob_part(data, data_size, D3D_BLOB_DEBUG_INFO, 0, blob);
455 }
Definition: image.c:133
static HRESULT d3dcompiler_get_blob_part(const void *data, SIZE_T data_size, D3D_BLOB_PART part, UINT flags, ID3DBlob **blob)
Definition: blob.c:217
#define TRACE(s)
Definition: solgame.cpp:4
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

◆ D3DGetInputAndOutputSignatureBlob()

HRESULT WINAPI D3DGetInputAndOutputSignatureBlob ( const void data,
SIZE_T  data_size,
ID3DBlob **  blob 
)

Definition at line 443 of file blob.c.

444 {
445  TRACE("data %p, data_size %lu, blob %p\n", data, data_size, blob);
446 
448 }
Definition: image.c:133
static HRESULT d3dcompiler_get_blob_part(const void *data, SIZE_T data_size, D3D_BLOB_PART part, UINT flags, ID3DBlob **blob)
Definition: blob.c:217
#define TRACE(s)
Definition: solgame.cpp:4
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

◆ D3DGetInputSignatureBlob()

HRESULT WINAPI D3DGetInputSignatureBlob ( const void data,
SIZE_T  data_size,
ID3DBlob **  blob 
)

Definition at line 429 of file blob.c.

430 {
431  TRACE("data %p, data_size %lu, blob %p\n", data, data_size, blob);
432 
434 }
Definition: image.c:133
static HRESULT d3dcompiler_get_blob_part(const void *data, SIZE_T data_size, D3D_BLOB_PART part, UINT flags, ID3DBlob **blob)
Definition: blob.c:217
#define TRACE(s)
Definition: solgame.cpp:4
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

◆ D3DGetOutputSignatureBlob()

HRESULT WINAPI D3DGetOutputSignatureBlob ( const void data,
SIZE_T  data_size,
ID3DBlob **  blob 
)

Definition at line 436 of file blob.c.

437 {
438  TRACE("data %p, data_size %lu, blob %p\n", data, data_size, blob);
439 
441 }
Definition: image.c:133
static HRESULT d3dcompiler_get_blob_part(const void *data, SIZE_T data_size, D3D_BLOB_PART part, UINT flags, ID3DBlob **blob)
Definition: blob.c:217
#define TRACE(s)
Definition: solgame.cpp:4
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

◆ D3DPreprocess()

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 at line 902 of file compiler.c.

905 {
906  HRESULT hr;
907  ID3DBlob *buffer;
908 
909  TRACE("data %p, size %lu, filename %s, defines %p, include %p, shader %p, error_messages %p\n",
911 
912  if (!data)
913  return E_INVALIDARG;
914 
916 
917  if (shader) *shader = NULL;
919 
921 
922  if (SUCCEEDED(hr))
923  {
924  if (shader)
925  {
927  if (FAILED(hr))
928  goto cleanup;
929  CopyMemory(ID3D10Blob_GetBufferPointer(buffer), wpp_output, wpp_output_size);
930  *shader = buffer;
931  }
932  else
933  hr = E_INVALIDARG;
934  }
935 
936 cleanup:
939  return hr;
940 }
static char * wpp_output
Definition: compiler.c:57
static SIZE_T const char const D3D_SHADER_MACRO * defines
Definition: asm.c:30
HRESULT hr
Definition: shlfolder.c:183
static int wpp_output_size
Definition: compiler.c:58
static CRITICAL_SECTION wpp_mutex
Definition: compiler.c:75
GLuint buffer
Definition: glext.h:5915
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
const char * filename
Definition: ioapi.h:135
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
Definition: asm.c:30
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
GLuint shader
Definition: glext.h:6030
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:403
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:77
#define CopyMemory
Definition: winbase.h:1640
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static HRESULT preprocess_shader(const void *data, SIZE_T data_size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, ID3DBlob **error_messages)
Definition: compiler.c:484
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ID3DBlob ** error_messages
Definition: asm.c:30
char * cleanup(char *str)
Definition: wpickclick.c:99
HRESULT WINAPI D3DCreateBlob(SIZE_T data_size, ID3DBlob **blob)
Definition: blob.c:133
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define HeapFree(x, y, z)
Definition: compat.h:402
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by D3DXPreprocessShader(), and D3DXPreprocessShaderFromFileW().

◆ D3DReadFileToBlob()

HRESULT WINAPI D3DReadFileToBlob ( const WCHAR filename,
ID3DBlob **  contents 
)

Definition at line 464 of file blob.c.

465 {
466  struct d3dcompiler_blob *object;
467  SIZE_T data_size;
468  DWORD read_size;
469  HANDLE file;
470  HRESULT hr;
471 
472  TRACE("filename %s, contents %p.\n", debugstr_w(filename), contents);
473 
475  if (file == INVALID_HANDLE_VALUE)
477 
478  data_size = GetFileSize(file, NULL);
479  if (data_size == INVALID_FILE_SIZE)
480  {
481  CloseHandle(file);
483  }
484 
485  if (!(object = heap_alloc_zero(sizeof(*object))))
486  {
487  CloseHandle(file);
488  return E_OUTOFMEMORY;
489  }
490 
491  if (FAILED(hr = d3dcompiler_blob_init(object, data_size)))
492  {
493  WARN("Failed to initialize blob, hr %#x.\n", hr);
494  CloseHandle(file);
495  heap_free(object);
496  return hr;
497  }
498 
499  if (!ReadFile(file, object->data, data_size, &read_size, NULL) || (read_size != data_size))
500  {
501  WARN("Failed to read file contents.\n");
502  CloseHandle(file);
503  heap_free(object->data);
504  heap_free(object);
505  return E_FAIL;
506  }
507  CloseHandle(file);
508  object->size = read_size;
509 
510  *contents = &object->ID3DBlob_iface;
511 
512  TRACE("Returning ID3DBlob %p.\n", *contents);
513 
514  return S_OK;
515 }
#define CloseHandle
Definition: compat.h:406
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define INVALID_FILE_SIZE
Definition: winbase.h:529
const char * filename
Definition: ioapi.h:135
#define E_FAIL
Definition: ddrawi.h:102
#define FILE_SHARE_READ
Definition: compat.h:125
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define OPEN_EXISTING
Definition: compat.h:434
static HRESULT d3dcompiler_blob_init(struct d3dcompiler_blob *blob, SIZE_T data_size)
Definition: blob.c:117
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
const char file[]
Definition: icontest.c:11
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:481
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
#define GENERIC_READ
Definition: compat.h:124
ULONG_PTR SIZE_T
Definition: typedefs.h:78
#define S_OK
Definition: intsafe.h:59
#define CreateFileW
Definition: compat.h:408
BOOL WINAPI ReadFile(IN HANDLE hFile, IN LPVOID lpBuffer, IN DWORD nNumberOfBytesToRead, OUT LPDWORD lpNumberOfBytesRead OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:123
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
Definition: fci.c:126

◆ D3DReflect()

HRESULT WINAPI D3DReflect ( const void data,
SIZE_T  data_size,
REFIID  riid,
void **  reflector 
)

Definition at line 1851 of file reflection.c.

1852 {
1854  HRESULT hr;
1855  const DWORD *temp = data;
1856 
1857  TRACE("data %p, data_size %lu, riid %s, blob %p\n", data, data_size, debugstr_guid(riid), reflector);
1858 
1859  if (!data || data_size < 32)
1860  {
1861  WARN("Invalid argument supplied.\n");
1862  return D3DERR_INVALIDCALL;
1863  }
1864 
1865  if (temp[6] != data_size)
1866  {
1867  WARN("Wrong size supplied.\n");
1868  return E_FAIL;
1869  }
1870 
1871  if (!IsEqualGUID(riid, &IID_ID3D11ShaderReflection))
1872  {
1873  WARN("Wrong riid %s, accept only %s!\n", debugstr_guid(riid), debugstr_guid(&IID_ID3D11ShaderReflection));
1874  return E_NOINTERFACE;
1875  }
1876 
1877  object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
1878  if (!object)
1879  return E_OUTOFMEMORY;
1880 
1881  hr = d3dcompiler_shader_reflection_init(object, data, data_size);
1882  if (FAILED(hr))
1883  {
1884  WARN("Failed to initialize shader reflection\n");
1885  HeapFree(GetProcessHeap(), 0, object);
1886  return hr;
1887  }
1888 
1889  *reflector = object;
1890 
1891  TRACE("Created ID3D11ShaderReflection %p\n", object);
1892 
1893  return S_OK;
1894 }
#define E_NOINTERFACE
Definition: winerror.h:2364
static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_reflection *reflection, const void *data, SIZE_T data_size)
Definition: reflection.c:1729
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:111
#define E_FAIL
Definition: ddrawi.h:102
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define S_OK
Definition: intsafe.h:59
static calc_node_t temp
Definition: rpn_ieee.c:38
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define HeapFree(x, y, z)
Definition: compat.h:402
void * object
Definition: jmemsys.h:48
#define D3DERR_INVALIDCALL
Definition: reflection.c:41

◆ D3DStripShader()

HRESULT WINAPI D3DStripShader ( const void data,
SIZE_T  data_size,
UINT  flags,
ID3DBlob **  blob 
)

Definition at line 457 of file blob.c.

458 {
459  TRACE("data %p, data_size %lu, flags %#x, blob %p\n", data, data_size, flags, blob);
460 
461  return d3dcompiler_strip_shader(data, data_size, flags, blob);
462 }
Definition: image.c:133
static HRESULT d3dcompiler_strip_shader(const void *data, SIZE_T data_size, UINT flags, ID3DBlob **blob)
Definition: blob.c:358
#define TRACE(s)
Definition: solgame.cpp:4
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLbitfield flags
Definition: glext.h:7161

◆ D3DWriteBlobToFile()

HRESULT WINAPI D3DWriteBlobToFile ( ID3DBlob blob,
const WCHAR filename,
BOOL  overwrite 
)

Definition at line 517 of file blob.c.

518 {
519  FIXME("blob %p, filename %s, overwrite %d\n", blob, debugstr_w(filename), overwrite);
520 
521  return E_NOTIMPL;
522 }
Definition: image.c:133
const char * filename
Definition: ioapi.h:135
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

Variable Documentation

◆ D3DCOMPILER_DLL_W

const WCHAR D3DCOMPILER_DLL_W[] = {'d','3','d','c','o','m','p','i','l','e','r','_','4','3','.','d','l','l',0}
static

Definition at line 33 of file d3dcompiler.h.