VkBool32 sampleShadingEnable;
float minSampleShading;
const VkSampleMask* pSampleMask;
+ VkBool32 alphaToCoverageEnable;
+ VkBool32 alphaToOneEnable;
} VkPipelineMultisampleStateCreateInfo;
typedef struct VkStencilOpState {
VkStructureType sType;
const void* pNext;
VkPipelineColorBlendStateCreateFlags flags;
- VkBool32 alphaToCoverageEnable;
- VkBool32 alphaToOneEnable;
VkBool32 logicOpEnable;
VkLogicOp logicOp;
uint32_t attachmentCount;
.rasterSamples = 1, /* FINISHME: Multisampling */
.sampleShadingEnable = false,
.pSampleMask = (VkSampleMask[]) { UINT32_MAX },
+ .alphaToCoverageEnable = false,
+ .alphaToOneEnable = false,
},
.pDepthStencilState = ds_state,
.pColorBlendState = cb_state,
const VkPipelineColorBlendStateCreateInfo cb_state = {
.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO,
- .alphaToCoverageEnable = false,
- .alphaToOneEnable = false,
.logicOpEnable = false,
.attachmentCount = 1,
.pAttachments = (VkPipelineColorBlendAttachmentState []) {
const VkPipelineColorBlendStateCreateInfo cb_state = {
.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO,
- .alphaToCoverageEnable = false,
- .alphaToOneEnable = false,
.logicOpEnable = false,
.attachmentCount = 0,
.pAttachments = NULL,
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
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;
.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;
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);
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;
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++) {
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);