pub unsafe fn demote_to_helper_invocation()
Expand description

Demote fragment shader invocation to a helper invocation. Equivalvent to discard() in HLSL. Any stores to memory after this instruction are suppressed and the fragment does not write outputs to the framebuffer.

Unlike super::kill, this does not necessarily terminate the invocation. It is not considered a flow control instruction (flow control does not become non-uniform) and does not terminate the block.

  • Required Capabilities DemoteToHelperInvocationEXT
  • Required Extensions SPV_EXT_demote_to_helper_invocation

Safety

After this instruction executes, the value of a helper_invocation builtin variable is undefined. Use is_helper_invocation to determine whether invocations are helper invocations in the presence of demote_to_helper_invocation.