D3D10PreprocessShader function (d3d10shader.h)

Generate a shader-text string that contains the shader tokens that would be found in a compiled shader.

Syntax

HRESULT D3D10PreprocessShader(
  [in]  LPCSTR                   pSrcData,
  [in]  SIZE_T                   SrcDataSize,
  [in]  LPCSTR                   pFileName,
  [in]  const D3D10_SHADER_MACRO *pDefines,
  [in]  LPD3D10INCLUDE           pInclude,
  [out] ID3D10Blob               **ppShaderText,
  [out] ID3D10Blob               **ppErrorMsgs
);

Parameters

[in] pSrcData

Type: LPCSTR

Pointer to a string containing the shader source code.

[in] SrcDataSize

Type: SIZE_T

Size of pSrcData, in bytes.

[in] pFileName

Type: LPCSTR

The name of the file that contains the shader code.

[in] pDefines

Type: const D3D10_SHADER_MACRO*

Optional. Pointer to an array of macro definitions (see D3D10_SHADER_MACRO). The last structure in the array serves as a terminator and must have all members set to 0.
If not used, set pDefines to NULL.

[in] pInclude

Type: LPD3D10INCLUDE

Optional. Pointer to an ID3D10Include Interface interface for handling include files. Setting this to NULL will cause a compile error if a shader contains a #include.

[out] ppShaderText

Type: ID3D10Blob**

A pointer to a buffer that receives a pointer to an ID3D10Blob Interface that contains a single string containing shader-tokens.

[out] ppErrorMsgs

Type: ID3D10Blob**

A pointer to a buffer that receives a pointer to an ID3D10Blob Interface that contains a listing of errors and warnings that occurred during compilation. These errors and warnings are identical to the debug output from a debugger.

Return value

Type: HRESULT

Returns one of the following Direct3D 10 Return Codes.

Remarks

Use this function to generate a shader-token stream, which is the compiled output of the shader compiler.

Requirements

Requirement Value
Target Platform Windows
Header d3d10shader.h
Library D3D10.lib
DLL D3D10.dll

See also

Shader Functions