ID2D1EffectContext::LoadVertexShader method (d2d1effectauthor.h)

Loads the given shader by its unique ID. Loading the shader multiple times is ignored. When the shader is loaded it is also handed to the driver to JIT, if it hasn’t been already.

Syntax

HRESULT LoadVertexShader(
  REFGUID    resourceId,
  const BYTE *shaderBuffer,
  UINT32     shaderBufferCount
);

Parameters

resourceId

Type: REFGUID

The unique id that identifies the shader.

shaderBuffer

Type: BYTE*

The buffer that contains the shader to register.

shaderBufferCount

Type: UINT32

The size of the shader buffer in bytes.

Return value

Type: HRESULT

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

HRESULT Description
S_OK No error occurred.
E_OUTOFMEMORY Direct2D could not allocate sufficient memory to complete the call.
E_INVALIDARG An invalid parameter was passed to the returning function.

Remarks

The shader you specify must be compiled, not in raw HLSL code.

Requirements

Requirement Value
Minimum supported client Windows 8 and Platform Update for Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header d2d1effectauthor.h
Library D2D1.lib

See also

ID2D1EffectContext