D3DX11PreprocessShaderFromMemory function

Note

The D3DX (D3DX 9, D3DX 10, and D3DX 11) utility library is deprecated for Windows 8 and is not supported for Windows Store apps.

Note

Instead of using this function, we recommend that you use the D3DPreprocess API.

Create a shader from memory without compiling it.

Syntax

HRESULT D3DX11PreprocessShaderFromMemory(
  _In_        LPCSTR             pSrcData,
  _In_        SIZE_T             SrcDataSize,
  _In_        LPCSTR             pFileName,
  _In_  const D3D11_SHADER_MACRO *pDefines,
  _In_        LPD3D10INCLUDE     pInclude,
  _In_        ID3DX11ThreadPump  *pPump,
  _Out_       ID3D10Blob         **ppShaderText,
  _Out_       ID3D10Blob         **ppErrorMsgs,
  _Out_       HRESULT            *pHResult
);

Parameters

pSrcData [in]

Type: LPCSTR

Pointer to the memory containing the shader.

SrcDataSize [in]

Type: SIZE_T

Size of the shader.

pFileName [in]

Type: LPCSTR

Name of the shader.

pDefines [in]

Type: const D3D11_SHADER_MACRO*

A NULL-terminated array of shader macros; set this to NULL to specify no macros.

pInclude [in]

Type: LPD3D10INCLUDE

A pointer to an include interface; set this to NULL to specify there is no include file.

pPump [in]

Type: ID3DX11ThreadPump*

A pointer to a thread pump interface (see ID3DX11ThreadPump Interface). Use NULL to specify that this function should not return until it is completed.

ppShaderText [out]

Type: ID3D10Blob**

A pointer to memory that contains the uncompiled shader.

ppErrorMsgs [out]

Type: ID3D10Blob**

The address of a pointer to memory that contains effect-creation errors, if any occurred.

pHResult [out]

Type: HRESULT*

A pointer to the return value. May be NULL. If pPump is not NULL, then pHResult must be a valid memory location until the asynchronous execution completes.

Return value

Type: HRESULT

The return value is one of the values listed in Direct3D 11 Return Codes.

Requirements

Requirement Value
Header
D3DX11async.h
Library
D3DX11.lib

See also

D3DX Functions