Module: Mesa Branch: main Commit: 1929c0d954579f1045d0ae3e9b032d1bdad8bb48 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1929c0d954579f1045d0ae3e9b032d1bdad8bb48
Author: Faith Ekstrand <[email protected]> Date: Fri Oct 6 18:46:07 2023 -0500 nvk: Invalidate SKED caches at the top of command buffers This is the cache that caches QMDs. We need to invalidate it or else we can end up with cache collisions and end up running the wrong shader. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25595> --- src/nouveau/vulkan/nvk_cmd_dispatch.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/nouveau/vulkan/nvk_cmd_dispatch.c b/src/nouveau/vulkan/nvk_cmd_dispatch.c index 035a9c9e431..26cc86eb1c6 100644 --- a/src/nouveau/vulkan/nvk_cmd_dispatch.c +++ b/src/nouveau/vulkan/nvk_cmd_dispatch.c @@ -20,6 +20,7 @@ #include "clc5c0.h" #include "nvk_cl9097.h" #include "nvk_cla0c0.h" +#include "nvk_clb1c0.h" #include "nvk_clc3c0.h" #include "nvk_clc597.h" #include "nvk_clc6c0.h" @@ -50,7 +51,10 @@ nvk_cmd_buffer_begin_compute(struct nvk_cmd_buffer *cmd, const VkCommandBufferBeginInfo *pBeginInfo) { if (cmd->vk.level == VK_COMMAND_BUFFER_LEVEL_PRIMARY) { - struct nv_push *p = nvk_cmd_buffer_push(cmd, 4); + struct nv_push *p = nvk_cmd_buffer_push(cmd, 6); + if (nvk_cmd_buffer_compute_cls(cmd) >= MAXWELL_COMPUTE_B) { + P_IMMD(p, NVB1C0, INVALIDATE_SKED_CACHES, 0); + } P_IMMD(p, NVA0C0, INVALIDATE_SAMPLER_CACHE_NO_WFI, { .lines = LINES_ALL, });
