mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
radv: fix determining needed dynamic states when rasterization is disabled
The vertex input state can be NULL if rasterization is disabled with
dynamic vertex inputs.
The input assembly state can be NULL if rasterization is disabled
and both states are dynamic (primive topology and primitive restart
enable).
This fixes a segfault with gpu-ratemeter vk_dyn.prim
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41335>
(cherry picked from commit 87be392251)
This commit is contained in:
parent
640b982864
commit
e8aecda11a
2 changed files with 8 additions and 4 deletions
|
|
@ -784,7 +784,7 @@
|
|||
"description": "radv: fix determining needed dynamic states when rasterization is disabled",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -399,9 +399,13 @@ radv_pipeline_needed_dynamic_state(const struct radv_device *device, const struc
|
|||
|
||||
/* Disable dynamic states that are useless when rasterization is disabled. */
|
||||
if (!raster_enabled) {
|
||||
states = RADV_DYNAMIC_PRIMITIVE_TOPOLOGY | RADV_DYNAMIC_VERTEX_INPUT_BINDING_STRIDE |
|
||||
RADV_DYNAMIC_PRIMITIVE_RESTART_ENABLE | RADV_DYNAMIC_RASTERIZER_DISCARD_ENABLE |
|
||||
RADV_DYNAMIC_VERTEX_INPUT;
|
||||
states = RADV_DYNAMIC_RASTERIZER_DISCARD_ENABLE;
|
||||
|
||||
if (state->ia)
|
||||
states |= RADV_DYNAMIC_PRIMITIVE_TOPOLOGY | RADV_DYNAMIC_PRIMITIVE_RESTART_ENABLE;
|
||||
|
||||
if (state->vi)
|
||||
states |= RADV_DYNAMIC_VERTEX_INPUT | RADV_DYNAMIC_VERTEX_INPUT_BINDING_STRIDE;
|
||||
|
||||
if (pipeline->active_stages & VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT)
|
||||
states |= RADV_DYNAMIC_PATCH_CONTROL_POINTS | RADV_DYNAMIC_TESS_DOMAIN_ORIGIN;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue