ID2D1DrawInfo::SetPixelShader method

Applies to: desktop apps only

Sets the shader instructions for this transform.

Syntax

HRESULT SetPixelShader(
  [in]  REFGUID shaderId,
  D2D1_PIXEL_OPTIONS pixelOptions
);

Parameters

  • shaderId [in]
    Type: REFGUID

    The resource ID of the corresponding shader.

  • pixelOptions
    Type: D2D1_PIXEL_OPTIONS

    Additional information provided to the renderer to indicate what the pixel shader does. The default value is D2D1_PIXEL_OPTIONS_NONE.

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_INVALIDARG One or more arguments are not valid.

 

Remarks

The resource must be loaded before this call is made.

If this call fails, the corresponding ID2D1Effect instance is placed into an error state and fails to draw.

Specifying pixelOptions other than D2D1_PIXEL_OPTIONS_NONE can enable the renderer to perform certain optimizations such as combining various parts of the effect graph together. If this information does not accurately describe the shader, indeterminate rendering artifacts can result.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Header

D2d1effectauthor.h

Library

D2d1.lib

See also

ID2D1DrawInfo

ID2D1ComputeRenderInfo

 

 

Send comments about this topic to Microsoft

Build date: 9/5/2012