[gtk+/wip/otte/vulkan: 57/62] vulkan: Enable alpha blending
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/otte/vulkan: 57/62] vulkan: Enable alpha blending
- Date: Fri, 9 Dec 2016 17:39:44 +0000 (UTC)
commit 93448b8c7e76979cc26e0f804a783494cb637ca6
Author: Benjamin Otte <otte redhat com>
Date: Fri Dec 9 05:51:51 2016 +0100
vulkan: Enable alpha blending
We will need that once we actually composite stuff.
gsk/gskvulkanpipeline.c | 17 +++++++++++++----
gsk/gskvulkanrender.c | 2 +-
2 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/gsk/gskvulkanpipeline.c b/gsk/gskvulkanpipeline.c
index 25e81f5..a0b43fd 100644
--- a/gsk/gskvulkanpipeline.c
+++ b/gsk/gskvulkanpipeline.c
@@ -178,10 +178,19 @@ gsk_vulkan_pipeline_new (GdkVulkanContext *context,
.sType =
VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO,
.attachmentCount = 1,
.pAttachments = (VkPipelineColorBlendAttachmentState []) {
- { .colorWriteMask = VK_COLOR_COMPONENT_A_BIT |
- VK_COLOR_COMPONENT_R_BIT |
- VK_COLOR_COMPONENT_G_BIT |
- VK_COLOR_COMPONENT_B_BIT },
+ {
+ .blendEnable = VK_TRUE,
+ .colorBlendOp = VK_BLEND_OP_ADD,
+ .srcColorBlendFactor = VK_BLEND_FACTOR_ONE,
+ .dstColorBlendFactor =
VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA,
+ .alphaBlendOp = VK_BLEND_OP_ADD,
+ .srcAlphaBlendFactor = VK_BLEND_FACTOR_ONE,
+ .dstAlphaBlendFactor =
VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA,
+ .colorWriteMask = VK_COLOR_COMPONENT_A_BIT
+ | VK_COLOR_COMPONENT_R_BIT
+ | VK_COLOR_COMPONENT_G_BIT
+ | VK_COLOR_COMPONENT_B_BIT
+ },
}
},
.pDynamicState = &(VkPipelineDynamicStateCreateInfo) {
diff --git a/gsk/gskvulkanrender.c b/gsk/gskvulkanrender.c
index 68f43ad..626f638 100644
--- a/gsk/gskvulkanrender.c
+++ b/gsk/gskvulkanrender.c
@@ -127,7 +127,7 @@ gsk_vulkan_render_new (GskRenderer *renderer,
{
.format = gdk_vulkan_context_get_image_format (self->vulkan),
.samples = VK_SAMPLE_COUNT_1_BIT,
- .loadOp = VK_ATTACHMENT_LOAD_OP_LOAD,
+ .loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR,
.storeOp = VK_ATTACHMENT_STORE_OP_STORE,
.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED,
.finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]