From 9d42171013b689911e82bbc5b9c4f4da0b5018e9 Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Thu, 25 Jan 2024 15:24:49 -0800 Subject: [PATCH] dzn: Don't set view instancing mask until after the PSO Part-of: (cherry picked from commit fa1c9618f970ffd5e1ddf1fc0a4783bbee1d911e) --- .pick_status.json | 2 +- src/microsoft/vulkan/dzn_cmd_buffer.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 78f5be7b920..135fe50c62d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -8244,7 +8244,7 @@ "description": "dzn: Don't set view instancing mask until after the PSO", "nominated": false, "nomination_type": 3, - "resolution": 4, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/microsoft/vulkan/dzn_cmd_buffer.c b/src/microsoft/vulkan/dzn_cmd_buffer.c index 8f3b114064f..d251d3fe653 100644 --- a/src/microsoft/vulkan/dzn_cmd_buffer.c +++ b/src/microsoft/vulkan/dzn_cmd_buffer.c @@ -3100,6 +3100,7 @@ dzn_cmd_buffer_update_pipeline(struct dzn_cmd_buffer *cmdbuf, uint32_t bindpoint ID3D12PipelineState *old_pipeline_state = cmdbuf->state.pipeline ? cmdbuf->state.pipeline->state : NULL; + uint32_t view_instance_mask = 0; if (cmdbuf->state.bindpoint[bindpoint].dirty & DZN_CMD_BINDPOINT_DIRTY_PIPELINE) { if (cmdbuf->state.bindpoint[bindpoint].root_sig != pipeline->root.sig) { cmdbuf->state.bindpoint[bindpoint].root_sig = pipeline->root.sig; @@ -3135,9 +3136,9 @@ dzn_cmd_buffer_update_pipeline(struct dzn_cmd_buffer *cmdbuf, uint32_t bindpoint ID3D12GraphicsCommandList1_IASetPrimitiveTopology(cmdbuf->cmdlist, gfx->ia.topology); dzn_graphics_pipeline_get_state(gfx, &cmdbuf->state.pipeline_variant); if (gfx->multiview.native_view_instancing) - ID3D12GraphicsCommandList1_SetViewInstanceMask(cmdbuf->cmdlist, gfx->multiview.view_mask); + view_instance_mask = gfx->multiview.view_mask; else - ID3D12GraphicsCommandList1_SetViewInstanceMask(cmdbuf->cmdlist, 1); + view_instance_mask = 1; if (gfx->zsa.dynamic_depth_bias && gfx->use_gs_for_polygon_mode_point) cmdbuf->state.bindpoint[bindpoint].dirty |= DZN_CMD_BINDPOINT_DIRTY_SYSVALS; @@ -3150,6 +3151,11 @@ dzn_cmd_buffer_update_pipeline(struct dzn_cmd_buffer *cmdbuf, uint32_t bindpoint ID3D12GraphicsCommandList1_SetPipelineState(cmdbuf->cmdlist, pipeline->state); cmdbuf->state.pipeline = pipeline; } + + /* Deferring this until after the pipeline has been set due to an NVIDIA driver bug + * when view instancing mask is set with no pipeline bound. */ + if (view_instance_mask) + ID3D12GraphicsCommandList1_SetViewInstanceMask(cmdbuf->cmdlist, view_instance_mask); } static void