diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-07-14 22:06:37 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-07-14 22:06:37 +0200 |
| commit | 155dc1476f2dc67dd880555ebf9bc0d2bcb9b509 (patch) | |
| tree | ad30dd564eeb771321c801cdf117ceec8dfd8201 /src | |
| parent | 9b3030f45f69a376603ad57d8b5acb4b0ba57c1b (diff) | |
implement clear operator with substract blending
Diffstat (limited to 'src')
| -rw-r--r-- | src/vkvg_context_internal.c | 3 | ||||
| -rw-r--r-- | src/vkvg_device_internal.c | 9 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/vkvg_context_internal.c b/src/vkvg_context_internal.c index f06245f..48daab0 100644 --- a/src/vkvg_context_internal.c +++ b/src/vkvg_context_internal.c @@ -491,7 +491,7 @@ void _bind_draw_pipeline (VkvgContext ctx) { case VKVG_OPERATOR_OVER: CmdBindPipeline(ctx->cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, ctx->pSurf->dev->pipe_OVER); break; - case VKVG_OPERATOR_CLEAR: + case VKVG_OPERATOR_CLEAR: CmdBindPipeline(ctx->cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, ctx->pSurf->dev->pipe_CLEAR); break; case VKVG_OPERATOR_DIFFERENCE: @@ -583,7 +583,6 @@ void _update_cur_pattern (VkvgContext ctx, VkvgPattern pat) { //flush ctx in two steps to add the src transitioning in the cmd buff if (ctx->cmdStarted){//transition of img without appropriate dependencies in subpass must be done outside renderpass. - //_flush_undrawn_vertices (ctx);//ensure all vertices are flushed _end_render_pass (ctx); _flush_vertices_caches (ctx); }else { diff --git a/src/vkvg_device_internal.c b/src/vkvg_device_internal.c index fb199c9..f99b6a1 100644 --- a/src/vkvg_device_internal.c +++ b/src/vkvg_device_internal.c @@ -347,11 +347,12 @@ void _setupPipelines(VkvgDevice dev) blendAttachmentState.alphaBlendOp = blendAttachmentState.colorBlendOp = VK_BLEND_OP_SUBTRACT; VK_CHECK_RESULT(vkCreateGraphicsPipelines(dev->vkDev, dev->pipelineCache, 1, &pipelineCreateInfo, NULL, &dev->pipe_SUB)); - //blendAttachmentState.blendEnable = VK_FALSE; - //rasterizationState.polygonMode = VK_POLYGON_MODE_POINT; //shaderStages[1].pName = "op_CLEAR"; - blendAttachmentState.srcAlphaBlendFactor = blendAttachmentState.dstAlphaBlendFactor = - blendAttachmentState.srcColorBlendFactor = blendAttachmentState.dstColorBlendFactor = VK_BLEND_FACTOR_ZERO; + blendAttachmentState.colorBlendOp = blendAttachmentState.alphaBlendOp = VK_BLEND_OP_SUBTRACT; + blendAttachmentState.srcColorBlendFactor = VK_BLEND_FACTOR_ONE; + blendAttachmentState.dstColorBlendFactor = VK_BLEND_FACTOR_ONE; + blendAttachmentState.srcAlphaBlendFactor = VK_BLEND_FACTOR_ONE; + blendAttachmentState.dstAlphaBlendFactor = VK_BLEND_FACTOR_ONE; VK_CHECK_RESULT(vkCreateGraphicsPipelines(dev->vkDev, dev->pipelineCache, 1, &pipelineCreateInfo, NULL, &dev->pipe_CLEAR)); |