v3d: delay offset/counter values with primitive restart

Some values like the transform feedback offset or the number of output
vertices in VS can be obtained knowing how many vertices and primitive
type are used in the drawcall.

But when the primitive restart is enabled, doing this is quite more
complex, as we should parse the vertex buffer to know where is the
restart values, and so on.

In this case, delay this computation after the drawcall is executed, by
querying the GPU to know these values.

Similarly, this delay is also applied to compute the transform feedback
buffer offsets when there is a geometry shader, as we don't know
beforehand how many vertices it is going to output.

This fixes `spec@!opengl 3.1@primitive-restart-xfb flush` and
`spec@!opengl 3.1@primitive-restart-xfb generated`.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22716>
This commit is contained in:
Juan A. Suarez Romero
2023-04-26 16:17:27 +02:00
committed by Marge Bot
parent b4c4d28263
commit 975a2c17a4
4 changed files with 28 additions and 9 deletions
-2
View File
@@ -98,8 +98,6 @@ spec@!opengl 2.0@gl-2.0-edgeflag-immediate,Fail
spec@!opengl 2.1@pbo,Fail
spec@!opengl 2.1@pbo@test_polygon_stip,Fail
spec@!opengl 2.1@polygon-stipple-fs,Fail
spec@!opengl 3.1@primitive-restart-xfb flush,Fail
spec@!opengl 3.1@primitive-restart-xfb generated,Fail
spec@arb_color_buffer_float@gl_rgba32f-render,Fail
spec@arb_color_buffer_float@gl_rgba32f-render-fog,Fail
spec@arb_color_buffer_float@gl_rgba32f-render-sanity,Fail