mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 15:48:36 +02:00
radv: fix hashing graphics pipeline when no stages are compiled
It's possible with GPL.
This fixes a NULL pointer dereference with updated pipeline binaries
tests in VKCTS.
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36999>
(cherry picked from commit 944e26eae7)
This commit is contained in:
parent
1da029bcdf
commit
387a1c2c08
2 changed files with 9 additions and 7 deletions
|
|
@ -4434,7 +4434,7 @@
|
|||
"description": "radv: fix hashing graphics pipeline when no stages are compiled",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -2953,14 +2953,16 @@ radv_graphics_pipeline_hash(const struct radv_device *device, const struct radv_
|
|||
|
||||
_mesa_sha1_update(&ctx, &gfx_state->key.gfx_state, sizeof(gfx_state->key.gfx_state));
|
||||
|
||||
for (unsigned s = 0; s < MESA_VULKAN_SHADER_STAGES; s++) {
|
||||
const struct radv_shader_stage *stage = &gfx_state->stages[s];
|
||||
if (gfx_state->stages) {
|
||||
for (unsigned s = 0; s < MESA_VULKAN_SHADER_STAGES; s++) {
|
||||
const struct radv_shader_stage *stage = &gfx_state->stages[s];
|
||||
|
||||
if (stage->stage == MESA_SHADER_NONE)
|
||||
continue;
|
||||
if (stage->stage == MESA_SHADER_NONE)
|
||||
continue;
|
||||
|
||||
_mesa_sha1_update(&ctx, stage->shader_sha1, sizeof(stage->shader_sha1));
|
||||
_mesa_sha1_update(&ctx, &stage->key, sizeof(stage->key));
|
||||
_mesa_sha1_update(&ctx, stage->shader_sha1, sizeof(stage->shader_sha1));
|
||||
_mesa_sha1_update(&ctx, &stage->key, sizeof(stage->key));
|
||||
}
|
||||
}
|
||||
|
||||
_mesa_sha1_final(&ctx, hash);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue