D3DXAssembleShaderFromResource
Assembles an ASCII description of a shader into binary form.
HRESULT D3DXAssembleShaderFromResource(
HMODULE hSrcModule,
LPCTSTR pSrcResource,
DWORD Flags,
LPD3DXBUFFER* ppConstants,
LPD3DXBUFFER* ppCompiledShader,
LPD3DXBUFFER* ppCompilationErrors
);
Parameters
- hSrcModule
- [in] Handle to the module where the resource is located, or NULL for the module associated with the image the operating system used to create the current process.
- pSrcResource
- [in] Pointer to the resource name.
- Flags
- [in] A combination of the D3DXASM flags, specifying assembly options.
- ppConstants
- [out] Returns a pointer to an ID3DXBuffer interface, representing the returned constant declarations. These constants are returned as a vertex shader declaration fragment. It is up to the application to insert the contents of this buffer into their declaration. For pixel shaders this parameter is meaningless because constant declarations are included in the assembled shader. This parameter is ignored if it is NULL.
- ppCompiledShader
- [out] Returns a pointer to an ID3DXBuffer interface, representing the returned compiled object code. This parameter is ignored if it is NULL.
- ppCompilationErrors
- [out] Returns a pointer to an ID3DXBuffer interface, representing the returned ASCII error messages. This parameter is ignored if it is NULL.
Return Values
If the function succeeds, the return value is D3D_OK.
If the function fails, the return value can be one of the following values.
Remarks
This function supports both Unicode and ANSI strings.
Requirements
Header: Declared in D3dx8core.h.
Import Library: Use D3dx8.lib.