anv: fix 3DSTATE_MULTISAMPLE emission on gen8+

When pipeline->dynamic_state.sample_locations.samples is not set
because the state is dynamic, we're currently calling
genX(emit_multisample) with a 0 samples value which is incorrect.

Found when using renderdoc with the drawing overlay.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4ad4cd8906 ("anv: Enabled the VK_EXT_sample_locations extension")
Cc: <mesa-stable>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10282>
This commit is contained in:
Lionel Landwerlin
2021-04-16 11:08:46 +03:00
committed by Marge Bot
parent d29b5b9f20
commit 30bc562bda
2 changed files with 22 additions and 20 deletions

View File

@@ -755,16 +755,16 @@ emit_ms_state(struct anv_graphics_pipeline *pipeline,
const VkPipelineMultisampleStateCreateInfo *info,
uint32_t dynamic_states)
{
/* If the sample locations are dynamic, 3DSTATE_MULTISAMPLE on Gfx7/7.5
* will be emitted dynamically, so skip it here. On Gfx8+
* 3DSTATE_SAMPLE_PATTERN will be emitted dynamically, so skip it here.
/* Only lookup locations if the extensions is active, otherwise the default
* ones will be used either at device initialization time or through
* 3DSTATE_MULTISAMPLE on Gfx7/7.5 by passing NULL locations.
*/
if (!(dynamic_states & ANV_CMD_DIRTY_DYNAMIC_SAMPLE_LOCATIONS)) {
/* Only lookup locations if the extensions is active, otherwise the
* default ones will be used either at device initialization time or
* through 3DSTATE_MULTISAMPLE on Gfx7/7.5 by passing NULL locations.
if (pipeline->base.device->vk.enabled_extensions.EXT_sample_locations) {
/* If the sample locations are dynamic, 3DSTATE_MULTISAMPLE on Gfx7/7.5
* will be emitted dynamically, so skip it here. On Gfx8+
* 3DSTATE_SAMPLE_PATTERN will be emitted dynamically, so skip it here.
*/
if (pipeline->base.device->vk.enabled_extensions.EXT_sample_locations) {
if (!(dynamic_states & ANV_CMD_DIRTY_DYNAMIC_SAMPLE_LOCATIONS)) {
#if GFX_VER >= 8
genX(emit_sample_pattern)(&pipeline->base.batch,
pipeline->dynamic_state.sample_locations.samples,