XMConvertFloatToHalfStream
XMConvertHalfToFloatStream
XMMatrixDecompose
XMPlaneTransformStream
XMVector2TransformCoordStream
XMVector2TransformNormalStream
XMVector2TransformStream
XMVector3ProjectStream
XMVector3TransformCoordStream
XMVector3TransformNormalStream
XMVector3TransformStream
XMVector3UnprojectStream
XMVector4TransformStream
Expand Minimize

D3DPreprocess function

Preprocesses uncompiled HLSL code.

Syntax

HRESULT WINAPI D3DPreprocess(
  in   LPCVOID pSrcData,
  in   SIZE_T SrcDataSize,
  in   LPCSTR pSourceName,
  in   const D3D_SHADER_MACRO *pDefines,
  in   ID3DInclude pInclude,
  out  ID3DBlob *ppCodeText,
  out  ID3DBlob *ppErrorMsgs
);

Parameters

pSrcData [in]

Type: LPCVOID

A pointer to uncompiled shader data; either ASCII HLSL code or a compiled effect.

SrcDataSize [in]

Type: SIZE_T

Length of pSrcData.

pSourceName [in]

Type: LPCSTR

Optional. The name of the file that contains the uncompiled HLSL code.

pDefines [in]

Type: const D3D_SHADER_MACRO*

Optional. An array of NULL-terminated macro definitions (see D3D_SHADER_MACRO).

pInclude [in]

Type: ID3DInclude

Optional. A pointer to an ID3DInclude for handling include files. Setting this to NULL will cause a compile error if a shader contains a #include. You can pass the D3D_COMPILE_STANDARD_FILE_INCLUDE macro, which is a pointer to a default include handler. This default include handler includes files that are relative to the current directory and files that are relative to the directory of the initial source file. When you use D3D_COMPILE_STANDARD_FILE_INCLUDE, you must specify the source file name in the pSourceName parameter; the compiler will derive the initial relative directory from pSourceName.


#define D3D_COMPILE_STANDARD_FILE_INCLUDE ((ID3DInclude*)(UINT_PTR)1)


ppCodeText [out]

Type: ID3DBlob*

The address of a ID3DBlob that contains the compiled code.

ppErrorMsgs [out]

Type: ID3DBlob*

Optional. A pointer to an ID3DBlob that contains compiler error messages, or NULL if there were no errors.

Return value

Type: HRESULT

Returns one of the Direct3D 11 return codes.

Remarks

D3DPreprocess outputs #line directives and preserves line numbering of source input so that output line numbering can be properly related to the input source.

Windows Phone 8.1: This API is supported.

Requirements

Header

D3Dcompiler.h

Library

D3dcompiler_xx.dll

See also

Functions

 

 

Community Additions

ADD
Show:
© 2014 Microsoft