ID3D11ClassLinkage::CreateClassInstance method (d3d11.h)

Initializes a class-instance object that represents an HLSL class instance.

Syntax

HRESULT CreateClassInstance(
  [in]  LPCSTR              pClassTypeName,
  [in]  UINT                ConstantBufferOffset,
  [in]  UINT                ConstantVectorOffset,
  [in]  UINT                TextureOffset,
  [in]  UINT                SamplerOffset,
  [out] ID3D11ClassInstance **ppInstance
);

Parameters

[in] pClassTypeName

Type: LPCSTR

The type name of a class to initialize.

[in] ConstantBufferOffset

Type: UINT

Identifies the constant buffer that contains the class data.

[in] ConstantVectorOffset

Type: UINT

The four-component vector offset from the start of the constant buffer where the class data will begin. Consequently, this is not a byte offset.

[in] TextureOffset

Type: UINT

The texture slot for the first texture; there may be multiple textures following the offset.

[in] SamplerOffset

Type: UINT

The sampler slot for the first sampler; there may be multiple samplers following the offset.

[out] ppInstance

Type: ID3D11ClassInstance**

The address of a pointer to an ID3D11ClassInstance interface to initialize.

Return value

Type: HRESULT

Returns S_OK if successful; otherwise, returns one of the following Direct3D 11 Return Codes.

Remarks

Instances can be created (or gotten) before or after a shader is created. Use the same shader linkage object to acquire a class instance and create the shader the instance is going to be used in.

For more information about using the ID3D11ClassLinkage interface, see Dynamic Linking.

Windows Phone 8: This API is supported.

Requirements

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

See also

ID3D11ClassLinkage