D3DX11PreprocessShaderFromResource 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 a resource without compiling it.

Syntax


HRESULT D3DX11PreprocessShaderFromResource(
  _In_        HMODULE            hModule,
  _In_        LPCTSTR            pResourceName,
  _In_        LPCTSTR            pSrcFileName,
  _In_  const D3D11_SHADER_MACRO *pDefines,
  _In_        LPD3D10INCLUDE     pInclude,
  _In_        ID3DX11ThreadPump  *pPump,
  _Out_       ID3D10Blob         **ppShaderText,
  _Out_       ID3D10Blob         **ppErrorMsgs,
  _Out_       HRESULT            *pHResult
);

Parameters

hModule [in]

Type: HMODULE

Handle to the resource module containing the shader. HMODULE can be obtained with GetModuleHandle Function.

pResourceName [in]

Type: LPCTSTR

The name of the resource in side hModule containing the shader. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the data type resolves to LPCSTR.

pSrcFileName [in]

Type: LPCTSTR

Optional. Effect file name, which is used for error messages only. Can be NULL.

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

Header

D3DX11async.h

Library

D3DX11.lib

See also

D3DX Functions

 

 

Show: