llvmpipe: reset viewport_index_slot in fb bind
authorDave Airlie <airlied@redhat.com>
Tue, 26 Sep 2023 01:40:18 +0000 (11:40 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 26 Sep 2023 22:25:28 +0000 (08:25 +1000)
commit8791aab20f21bf206cbd187840fea327a5942af5
treedb7ff7a72ff869e2af94f9a32bbd39fe8b3fe954
parent5b233d5184f12f493f2a71cd0a6c9137169741f4
llvmpipe: reset viewport_index_slot in fb bind

I hit a problem running a set of lvp caselists with
dEQP-VK.transform_feedback.simple.draw_indirect_endqueryindexed_streamid_0_16,Crash

This was crashing due to
 assert(setup->viewport_index_slot < 0);
in try_update_scene_state

This was because a previous draw had set viewport index slot to 2,
but a clear then draw sequence never resets it, so the clear gets
a scene, and when the subsequent flush happens for that scene,
the viewport_index_slot is never updated. It only gets updated on
draws.

This just resets it as lp_setup_update_state will always pick up
the correct one for the next draw.

Cc: mesa-stable
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25387>
src/gallium/drivers/llvmpipe/lp_setup.c