src/third_party/angle/src/libANGLE/renderer/vulkan/UtilsVk.cpp
// Sets the appropriate settings in the pipeline for the shader to output stencil.  Requires the
// shader stencil export extension.
Sets the appropriate settings in the pipeline for the shader to output stencil.  Requires the
shader stencil export extension.
Sets the appropriate settings in the pipeline for the shader to output stencil . Requires the shader stencil export extension .
void SetStencilForShaderExport(ContextVk *contextVk, vk::GraphicsPipelineDesc *desc)
{
    ASSERT(contextVk->getRenderer()->getFeatures().supportsShaderStencilExport.enabled);
    const uint8_t completeMask    = 0xFF;
    const uint8_t unusedReference = 0x00;
    desc->setStencilTestEnabled(true);
    desc->setStencilFrontFuncs(unusedReference, VK_COMPARE_OP_ALWAYS, completeMask);
    desc->setStencilBackFuncs(unusedReference, VK_COMPARE_OP_ALWAYS, completeMask);
    desc->setStencilFrontOps(VK_STENCIL_OP_REPLACE, VK_STENCIL_OP_REPLACE, VK_STENCIL_OP_REPLACE);
    desc->setStencilBackOps(VK_STENCIL_OP_REPLACE, VK_STENCIL_OP_REPLACE, VK_STENCIL_OP_REPLACE);
    desc->setStencilFrontWriteMask(completeMask);
    desc->setStencilBackWriteMask(completeMask);
}
void SetStencilForShaderExport ( ContextVk * contextVk , vk :: GraphicsPipelineDesc * desc ) { ASSERT ( contextVk -> getRenderer ( ) -> getFeatures ( ) . supportsShaderStencilExport . enabled ) ; const uint8_t completeMask = 0xFF ; const uint8_t unusedReference = 0x00 ; desc -> setStencilTestEnabled ( true ) ; desc -> setStencilFrontFuncs ( unusedReference , VK_COMPARE_OP_ALWAYS , completeMask ) ; desc -> setStencilBackFuncs ( unusedReference , VK_COMPARE_OP_ALWAYS , completeMask ) ; desc -> setStencilFrontOps ( VK_STENCIL_OP_REPLACE , VK_STENCIL_OP_REPLACE , VK_STENCIL_OP_REPLACE ) ; desc -> setStencilBackOps ( VK_STENCIL_OP_REPLACE , VK_STENCIL_OP_REPLACE , VK_STENCIL_OP_REPLACE ) ; desc -> setStencilFrontWriteMask ( completeMask ) ; desc -> setStencilBackWriteMask ( completeMask ) ; }
Sets the appropriate settings in the pipeline for the shader to output stencil.
Sets the appropriate settings in the pipeline for the shader to output stencil .