Initializes a class-instance object that represents an HLSL class instance.
public:
HRESULT CreateClassInstance(
LPCSTR pClassTypeName,
UINT ConstantBufferOffset,
UINT ConstantVectorOffset,
UINT TextureOffset,
UINT SamplerOffset,
ID3D11ClassInstance **ppInstance
)
pClassTypeName
Type: LPCSTR
[in] The type name of a class to initialize.
ConstantBufferOffset
Type: UINT
[in] Identifies the constant buffer that contains the class data.
ConstantVectorOffset
Type: UINT
[in] 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.
TextureOffset
Type: UINT
[in] The texture slot for the first texture; there may be multiple textures following the offset.
SamplerOffset
Type: UINT
[in] The sampler slot for the first sampler; there may be multiple samplers following the offset.
ppInstance
Type: ID3D11ClassInstance **
[out] The address of a pointer to an ID3D11ClassInstance interface to initialize.
Type: HRESULT
Returns S_OK if successful; otherwise, returns one of the following Direct3D 11 return codes.
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.
Header: Declared in d3d11_x.h (d3d11.h on other Windows platforms).
Library: Use d3d11_x.lib (d3d11.lib on other Windows platforms).