gallium/util: Add u_stream_outputs_for_vertices helper
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 8 Aug 2019 21:27:41 +0000 (14:27 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 12 Aug 2019 19:22:54 +0000 (12:22 -0700)
commite881aa8c12c1447423c4acee4bbaaf503b19b057
tree63891d50de2750d692508277b148f023ba4530b8
parent8ce4f9bbc3bfda6542a2c5a320f14f968c03bbbc
gallium/util: Add u_stream_outputs_for_vertices helper

This u_prim.h helper determines the number of outputs for stream output,
given a particular primitive type and a vertex count. This is useful for
statically calculating sizes of stream output buffers (i.e. when there
is no geometry/tessellation shader in use).

This helper will be used in Panfrost's transform feedback
implementation, as you can probably guess since why else would I be
submitting it....

See also dEQP's getTransformFeedbackOutputCount routine.

v2: Simplify definition using new helpers, which also extends to non-ES2
primitive types (Eric).

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/gallium/auxiliary/util/u_prim.h