summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-11-30 17:20:49 -0800
committerJason Ekstrand <[email protected]>2015-12-03 13:43:52 -0800
commit9fa6e328ebac4616148a23a7a4fbe7ed25ec315f (patch)
tree5d0347ea3125c13760fd96f83c747f038fd4c2ce /src
parentf97c3b6d58b1f875b89744cb6adaed87c4d88414 (diff)
vk/0.210.0: Move alphaToOne and alphaToCoverate to multisample state
Diffstat (limited to 'src')
-rw-r--r--src/vulkan/anv_meta_clear.c6
-rw-r--r--src/vulkan/anv_pipeline.c3
-rw-r--r--src/vulkan/gen7_pipeline.c8
-rw-r--r--src/vulkan/gen8_pipeline.c10
4 files changed, 15 insertions, 12 deletions
diff --git a/src/vulkan/anv_meta_clear.c b/src/vulkan/anv_meta_clear.c
index 9f3085005f4..1403d7d0c3d 100644
--- a/src/vulkan/anv_meta_clear.c
+++ b/src/vulkan/anv_meta_clear.c
@@ -188,6 +188,8 @@ create_pipeline(struct anv_device *device,
.rasterSamples = 1, /* FINISHME: Multisampling */
.sampleShadingEnable = false,
.pSampleMask = (VkSampleMask[]) { UINT32_MAX },
+ .alphaToCoverageEnable = false,
+ .alphaToOneEnable = false,
},
.pDepthStencilState = ds_state,
.pColorBlendState = cb_state,
@@ -285,8 +287,6 @@ init_color_pipeline(struct anv_device *device)
const VkPipelineColorBlendStateCreateInfo cb_state = {
.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO,
- .alphaToCoverageEnable = false,
- .alphaToOneEnable = false,
.logicOpEnable = false,
.attachmentCount = 1,
.pAttachments = (VkPipelineColorBlendAttachmentState []) {
@@ -469,8 +469,6 @@ create_depthstencil_pipeline(struct anv_device *device,
const VkPipelineColorBlendStateCreateInfo cb_state = {
.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO,
- .alphaToCoverageEnable = false,
- .alphaToOneEnable = false,
.logicOpEnable = false,
.attachmentCount = 0,
.pAttachments = NULL,
diff --git a/src/vulkan/anv_pipeline.c b/src/vulkan/anv_pipeline.c
index 41a26c70d85..47c62754a8a 100644
--- a/src/vulkan/anv_pipeline.c
+++ b/src/vulkan/anv_pipeline.c
@@ -311,7 +311,8 @@ populate_wm_prog_key(const struct brw_device_info *devinfo,
key->nr_color_regions = render_pass->subpasses[info->subpass].color_count;
key->replicate_alpha = key->nr_color_regions > 1 &&
- info->pColorBlendState->alphaToCoverageEnable;
+ info->pMultisampleState &&
+ info->pMultisampleState->alphaToCoverageEnable;
if (info->pMultisampleState && info->pMultisampleState->rasterSamples > 1) {
/* We should probably pull this out of the shader, but it's fairly
diff --git a/src/vulkan/gen7_pipeline.c b/src/vulkan/gen7_pipeline.c
index f63ca4dcb4f..872025c7367 100644
--- a/src/vulkan/gen7_pipeline.c
+++ b/src/vulkan/gen7_pipeline.c
@@ -248,7 +248,8 @@ gen7_emit_ds_state(struct anv_pipeline *pipeline,
static void
gen7_emit_cb_state(struct anv_pipeline *pipeline,
- const VkPipelineColorBlendStateCreateInfo *info)
+ const VkPipelineColorBlendStateCreateInfo *info,
+ const VkPipelineMultisampleStateCreateInfo *ms_info)
{
struct anv_device *device = pipeline->device;
@@ -283,7 +284,7 @@ gen7_emit_cb_state(struct anv_pipeline *pipeline,
.ColorBlendFunction = vk_to_gen_blend_op[a->colorBlendOp],
.SourceBlendFactor = vk_to_gen_blend[a->srcColorBlendFactor],
.DestinationBlendFactor = vk_to_gen_blend[a->dstColorBlendFactor],
- .AlphaToCoverageEnable = info->alphaToCoverageEnable,
+ .AlphaToCoverageEnable = ms_info && ms_info->alphaToCoverageEnable,
# if 0
bool AlphaToOneEnable;
@@ -355,7 +356,8 @@ genX(graphics_pipeline_create)(
gen7_emit_ds_state(pipeline, pCreateInfo->pDepthStencilState);
- gen7_emit_cb_state(pipeline, pCreateInfo->pColorBlendState);
+ gen7_emit_cb_state(pipeline, pCreateInfo->pColorBlendState,
+ pCreateInfo->pMultisampleState);
anv_batch_emit(&pipeline->batch, GEN7_3DSTATE_VF_STATISTICS,
.StatisticsEnable = true);
diff --git a/src/vulkan/gen8_pipeline.c b/src/vulkan/gen8_pipeline.c
index 9bf7d2d555e..8abd29c71e8 100644
--- a/src/vulkan/gen8_pipeline.c
+++ b/src/vulkan/gen8_pipeline.c
@@ -148,7 +148,8 @@ emit_rs_state(struct anv_pipeline *pipeline,
static void
emit_cb_state(struct anv_pipeline *pipeline,
- const VkPipelineColorBlendStateCreateInfo *info)
+ const VkPipelineColorBlendStateCreateInfo *info,
+ const VkPipelineMultisampleStateCreateInfo *ms_info)
{
struct anv_device *device = pipeline->device;
@@ -206,8 +207,8 @@ emit_cb_state(struct anv_pipeline *pipeline,
anv_state_pool_alloc(&device->dynamic_state_pool, num_dwords * 4, 64);
struct GENX(BLEND_STATE) blend_state = {
- .AlphaToCoverageEnable = info->alphaToCoverageEnable,
- .AlphaToOneEnable = info->alphaToOneEnable,
+ .AlphaToCoverageEnable = ms_info && ms_info->alphaToCoverageEnable,
+ .AlphaToOneEnable = ms_info && ms_info->alphaToOneEnable,
};
for (uint32_t i = 0; i < info->attachmentCount; i++) {
@@ -365,7 +366,8 @@ genX(graphics_pipeline_create)(
assert(pCreateInfo->pRasterState);
emit_rs_state(pipeline, pCreateInfo->pRasterState, extra);
emit_ds_state(pipeline, pCreateInfo->pDepthStencilState);
- emit_cb_state(pipeline, pCreateInfo->pColorBlendState);
+ emit_cb_state(pipeline, pCreateInfo->pColorBlendState,
+ pCreateInfo->pMultisampleState);
anv_batch_emit(&pipeline->batch, GENX(3DSTATE_VF_STATISTICS),
.StatisticsEnable = true);