mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-12 10:00:17 +01:00
anv: dynamic multisample sample mask
This affects following packets: 3DSTATE_SAMPLE_MASK Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18879>
This commit is contained in:
parent
8e0377dcf3
commit
9f6af43743
2 changed files with 27 additions and 15 deletions
|
|
@ -736,21 +736,6 @@ emit_ms_state(struct anv_graphics_pipeline *pipeline,
|
|||
/* On Gfx8+ 3DSTATE_MULTISAMPLE only holds the number of samples. */
|
||||
genX(emit_multisample)(&pipeline->base.batch,
|
||||
pipeline->rasterization_samples);
|
||||
|
||||
/* From the Vulkan 1.0 spec:
|
||||
* If pSampleMask is NULL, it is treated as if the mask has all bits
|
||||
* enabled, i.e. no coverage is removed from fragments.
|
||||
*
|
||||
* 3DSTATE_SAMPLE_MASK.SampleMask is 16 bits.
|
||||
*/
|
||||
uint32_t sample_mask = 0xffff;
|
||||
|
||||
if (ms != NULL)
|
||||
sample_mask &= ms->sample_mask;
|
||||
|
||||
anv_batch_emit(&pipeline->base.batch, GENX(3DSTATE_SAMPLE_MASK), sm) {
|
||||
sm.SampleMask = sample_mask;
|
||||
}
|
||||
}
|
||||
|
||||
const uint32_t genX(vk_to_intel_logic_op)[] = {
|
||||
|
|
|
|||
|
|
@ -254,6 +254,29 @@ genX(cmd_emit_te)(struct anv_cmd_buffer *cmd_buffer)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
genX(cmd_emit_sample_mask)(struct anv_cmd_buffer *cmd_buffer)
|
||||
{
|
||||
struct anv_graphics_pipeline *pipeline = cmd_buffer->state.gfx.pipeline;
|
||||
const struct vk_dynamic_graphics_state *dyn =
|
||||
&cmd_buffer->vk.dynamic_graphics_state;
|
||||
|
||||
if (!anv_pipeline_has_stage(pipeline, MESA_SHADER_FRAGMENT))
|
||||
return;
|
||||
|
||||
/* From the Vulkan 1.0 spec:
|
||||
* If pSampleMask is NULL, it is treated as if the mask has all bits
|
||||
* enabled, i.e. no coverage is removed from fragments.
|
||||
*
|
||||
* 3DSTATE_SAMPLE_MASK.SampleMask is 16 bits.
|
||||
*/
|
||||
uint32_t sample_mask = 0xffff;
|
||||
|
||||
anv_batch_emit(&cmd_buffer->batch, GENX(3DSTATE_SAMPLE_MASK), sm) {
|
||||
sm.SampleMask = dyn->ms.sample_mask & sample_mask;
|
||||
}
|
||||
}
|
||||
|
||||
const uint32_t genX(vk_to_intel_blend)[] = {
|
||||
[VK_BLEND_FACTOR_ZERO] = BLENDFACTOR_ZERO,
|
||||
[VK_BLEND_FACTOR_ONE] = BLENDFACTOR_ONE,
|
||||
|
|
@ -403,6 +426,10 @@ genX(cmd_buffer_flush_dynamic_state)(struct anv_cmd_buffer *cmd_buffer)
|
|||
}
|
||||
}
|
||||
|
||||
if ((cmd_buffer->state.gfx.dirty & (ANV_CMD_DIRTY_PIPELINE) ||
|
||||
BITSET_TEST(dyn->dirty, MESA_VK_DYNAMIC_MS_SAMPLE_MASK)))
|
||||
genX(cmd_emit_sample_mask)(cmd_buffer);
|
||||
|
||||
if ((cmd_buffer->state.gfx.dirty & (ANV_CMD_DIRTY_PIPELINE |
|
||||
ANV_CMD_DIRTY_RENDER_TARGETS)) ||
|
||||
BITSET_TEST(dyn->dirty, MESA_VK_DYNAMIC_DS_DEPTH_TEST_ENABLE) ||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue