ID3D11Device::CreateComputeShader method (d3d11.h)

Create a compute shader.

Syntax

HRESULT CreateComputeShader(
  [in]            const void          *pShaderBytecode,
  [in]            SIZE_T              BytecodeLength,
  [in, optional]  ID3D11ClassLinkage  *pClassLinkage,
  [out, optional] ID3D11ComputeShader **ppComputeShader
);

Parameters

[in] pShaderBytecode

Type: const void*

A pointer to a compiled shader.

[in] BytecodeLength

Type: SIZE_T

Size of the compiled shader in pShaderBytecode.

[in, optional] pClassLinkage

Type: ID3D11ClassLinkage*

A pointer to a ID3D11ClassLinkage, which represents class linkage interface; the value can be NULL.

[out, optional] ppComputeShader

Type: ID3D11ComputeShader**

Address of a pointer to an ID3D11ComputeShader interface. If this is NULL, all other parameters will be validated; if validation passes, CreateComputeShader returns S_FALSE instead of S_OK.

Return value

Type: HRESULT

This method returns E_OUTOFMEMORY if there is insufficient memory to create the compute shader.
See Direct3D 11 Return Codes for other possible return values.

Remarks

For an example, see How To: Create a Compute Shader and HDRToneMappingCS11 Sample.

Requirements

Requirement Value
Target Platform Windows
Header d3d11.h
Library D3D11.lib

See also

ID3D11Device