[Mesa-dev] [RFC 2/3] u_vbuf: add logic to use a limited number of vbufs

Marek Olšák maraeo at gmail.com
Mon Jun 13 12:48:46 UTC 2016


On Sat, Jun 11, 2016 at 9:21 PM, Christian Gmeiner
<christian.gmeiner at gmail.com> wrote:
> From: "Wladimir J. van der Laan" <laanwj at gmail.com>
>
> Make it possible to limit the number of vertex buffers as there exist
> GPUs with less then 32 supported vertex buffers.
>
> Signed-off-by: Wladimir J. van der Laan <laanwj at gmail.com>
> ---
>  src/gallium/auxiliary/util/u_vbuf.c | 45 +++++++++++++++++++++++++++++++------
>  src/gallium/auxiliary/util/u_vbuf.h |  3 +++
>  2 files changed, 41 insertions(+), 7 deletions(-)
>
> diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c
> index 5b4e527..464c279 100644
> --- a/src/gallium/auxiliary/util/u_vbuf.c
> +++ b/src/gallium/auxiliary/util/u_vbuf.c
> @@ -184,6 +184,8 @@ struct u_vbuf {
>     uint32_t incompatible_vb_mask; /* each bit describes a corresp. buffer */
>     /* Which buffer has a non-zero stride. */
>     uint32_t nonzero_stride_vb_mask; /* each bit describes a corresp. buffer */
> +   /* Which buffers are allowed (supported by hardware). */
> +   uint32_t allowed_vb_mask;
>  };
>
>  static void *
> @@ -291,10 +293,14 @@ boolean u_vbuf_get_caps(struct pipe_screen *screen, struct u_vbuf_caps *caps)
>     caps->user_vertex_buffers =
>        screen->get_param(screen, PIPE_CAP_USER_VERTEX_BUFFERS);
>
> +   caps->max_vertex_buffers =
> +      screen->get_param(screen, PIPE_CAP_MAX_VERTEX_BUFFERS);
> +
>     if (!caps->buffer_offset_unaligned ||
>         !caps->buffer_stride_unaligned ||
>         !caps->velem_src_offset_unaligned ||
> -       !caps->user_vertex_buffers) {
> +       !caps->user_vertex_buffers ||
> +       !caps->max_vertex_buffers) {

When is max_vertex_buffers zero, really?

Marek


More information about the mesa-dev mailing list