vk/0.210.0: Move alphaToOne and alphaToCoverate to multisample state

This commit is contained in:
Jason Ekstrand 2015-11-30 17:20:49 -08:00
parent f97c3b6d58
commit 9fa6e328eb
5 changed files with 17 additions and 14 deletions

View File

@ -1703,6 +1703,8 @@ typedef struct VkPipelineMultisampleStateCreateInfo {
VkBool32 sampleShadingEnable;
float minSampleShading;
const VkSampleMask* pSampleMask;
VkBool32 alphaToCoverageEnable;
VkBool32 alphaToOneEnable;
} VkPipelineMultisampleStateCreateInfo;
typedef struct VkStencilOpState {
@ -1745,8 +1747,6 @@ typedef struct VkPipelineColorBlendStateCreateInfo {
VkStructureType sType;
const void* pNext;
VkPipelineColorBlendStateCreateFlags flags;
VkBool32 alphaToCoverageEnable;
VkBool32 alphaToOneEnable;
VkBool32 logicOpEnable;
VkLogicOp logicOp;
uint32_t attachmentCount;

View File

@ -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,

View File

@ -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

View File

@ -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);

View File

@ -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);