mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 16:28:08 +02:00
radeonsi: fix a crash in gfx10_sh_query_get_result_resource
If tmp_buffer (in ssbo[1]) is NULL, setting the writable bit causes the called function to access the NULL buffer. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16885>
This commit is contained in:
parent
fc392ff104
commit
0f4f98ea50
1 changed files with 3 additions and 1 deletions
|
|
@ -403,9 +403,11 @@ static void gfx10_sh_query_get_result_resource(struct si_context *sctx, struct s
|
|||
si_cp_wait_mem(sctx, &sctx->gfx_cs, va, 0x00000001, 0x00000001, 0);
|
||||
}
|
||||
|
||||
/* ssbo[2] is either tmp_buffer or resource */
|
||||
assert(ssbo[2].buffer);
|
||||
si_launch_grid_internal_ssbos(sctx, &grid, sctx->sh_query_result_shader,
|
||||
SI_OP_SYNC_PS_BEFORE | SI_OP_SYNC_AFTER, SI_COHERENCY_SHADER,
|
||||
3, ssbo, 0x6);
|
||||
3, ssbo, (1 << 2) | (ssbo[1].buffer ? 1 << 1 : 0));
|
||||
|
||||
if (qbuf == query->last)
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue