panvk: revised occlusion query pointer fix
It turns out that the `occlusion_query.syncobj` is used to set
state that later code relies on, and setting it to NULL causes
some Vulkan CTS tests to fail. Instead, we should explicitly check
for the mode being `MALI_OCCLUSION_MODE_DISABLED` to avoid using
an invalid `ptr` field.
Fixes: 24c692c981 ("panvk: fix a NULL pointer dereference in occlusion queries")
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36794>
This commit is contained in:
@@ -1916,6 +1916,7 @@ static VkResult
|
||||
prepare_oq(struct panvk_cmd_buffer *cmdbuf)
|
||||
{
|
||||
if (!gfx_state_dirty(cmdbuf, OQ) ||
|
||||
cmdbuf->state.gfx.occlusion_query.mode == MALI_OCCLUSION_MODE_DISABLED ||
|
||||
cmdbuf->state.gfx.occlusion_query.syncobj ==
|
||||
cmdbuf->state.gfx.render.oq.last)
|
||||
return VK_SUCCESS;
|
||||
|
||||
@@ -123,9 +123,6 @@ panvk_per_arch(cmd_meta_gfx_start)(
|
||||
save_ctx->occlusion_query = cmdbuf->state.gfx.occlusion_query;
|
||||
|
||||
/* Ensure occlusion queries are disabled */
|
||||
#if PAN_ARCH >= 10
|
||||
cmdbuf->state.gfx.occlusion_query.syncobj = 0;
|
||||
#endif
|
||||
cmdbuf->state.gfx.occlusion_query.ptr = 0;
|
||||
cmdbuf->state.gfx.occlusion_query.mode = MALI_OCCLUSION_MODE_DISABLED;
|
||||
gfx_state_set_dirty(cmdbuf, OQ);
|
||||
|
||||
Reference in New Issue
Block a user