llvmpipe: Faithfully honour pipe_rasterizer_state::rasterizer_discard flag.
authorJose Fonseca <jfonseca@vmware.com>
Mon, 5 Dec 2022 10:29:28 +0000 (10:29 +0000)
committerMarge Bot <emma+marge@anholt.net>
Tue, 6 Dec 2022 11:44:11 +0000 (11:44 +0000)
commitda5840f3857664848b58e193c5ba56dac355860c
treed94c89f5c20c0dfee64fab3df212da30d7d8f07f
parent36a7d6788c92f69e7463fb7e3cd4f1154dea767d
llvmpipe: Faithfully honour pipe_rasterizer_state::rasterizer_discard flag.

D3D10 established that rasterization should be discarded when a null PS was
bound, and depth/stencil state was disabled, and llvmpipe followed those
semantics.  Nowadays all APIs have explicit rasterization discard flag,
and so does Gallium, so it's better for llvmpipe to faithfully follow
that flag, and trust the state tracker to follow the right semantics.

Second guessing pipe_rasterizer_state::rasterizer_discard actually
causes problems, specially when no depth-stencil surface is bound, as
D3D10 mandates rasterization should still happen, yet among all the
translation layers it often happens depth-stencil enablement is
optimized away when no depth-stencil is bound, which in turn was causing
llvmpipe to disable rasterization when it shouldn't.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20155>
src/gallium/drivers/llvmpipe/lp_state_derived.c