[Mesa-dev] [RFC 1/3] gallium: add PIPE_CAP_MAX_VERTEX_BUFFERS
Marek Olšák
maraeo at gmail.com
Mon Jun 13 09:54:55 UTC 2016
Most drivers actually support 16.
If you look at what various drivers return for
(PIPE_SHADER_VERTEX, PIPE_SHADER_CAP_MAX_INPUTS), that's the number of
vertex buffers, vertex elements, and vertex shader inputs they
support.
Marek
On Sat, Jun 11, 2016 at 9:21 PM, Christian Gmeiner
<christian.gmeiner at gmail.com> wrote:
> Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
> ---
> src/gallium/docs/source/screen.rst | 1 +
> src/gallium/drivers/freedreno/freedreno_screen.c | 2 ++
> src/gallium/drivers/i915/i915_screen.c | 2 ++
> src/gallium/drivers/ilo/ilo_screen.c | 2 ++
> src/gallium/drivers/llvmpipe/lp_screen.c | 2 ++
> src/gallium/drivers/nouveau/nv30/nv30_screen.c | 2 ++
> src/gallium/drivers/nouveau/nv50/nv50_screen.c | 2 ++
> src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 2 ++
> src/gallium/drivers/r300/r300_screen.c | 2 ++
> src/gallium/drivers/r600/r600_pipe.c | 2 ++
> src/gallium/drivers/radeonsi/si_pipe.c | 2 ++
> src/gallium/drivers/softpipe/sp_screen.c | 2 ++
> src/gallium/drivers/svga/svga_screen.c | 2 ++
> src/gallium/drivers/swr/swr_screen.cpp | 2 ++
> src/gallium/drivers/vc4/vc4_screen.c | 2 ++
> src/gallium/drivers/virgl/virgl_screen.c | 2 ++
> src/gallium/include/pipe/p_defines.h | 1 +
> 17 files changed, 32 insertions(+)
>
> diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst
> index 979b6c1..6c91c66 100644
> --- a/src/gallium/docs/source/screen.rst
> +++ b/src/gallium/docs/source/screen.rst
> @@ -341,6 +341,7 @@ The integer capabilities:
> * ``PIPE_CAP_PRIMITIVE_RESTART_FOR_PATCHES``: Whether primitive restart is
> supported for patch primitives.
> * ``PIPE_CAP_TGSI_VOTE``: Whether the ``VOTE_*`` ops can be used in shaders.
> +* ``PIPE_CAP_MAX_VERTEX_BUFFERS`: Number of supported vertex buffers.
>
>
> .. _pipe_capf:
> diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c
> index c258074..3672c9d 100644
> --- a/src/gallium/drivers/freedreno/freedreno_screen.c
> +++ b/src/gallium/drivers/freedreno/freedreno_screen.c
> @@ -351,6 +351,8 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
> return 10;
> case PIPE_CAP_UMA:
> return 1;
> + case PIPE_CAP_MAX_VERTEX_BUFFERS:
> + return 32;
> }
> debug_printf("unknown param %d\n", param);
> return 0;
> diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c
> index a7ee381..e7d72d1 100644
> --- a/src/gallium/drivers/i915/i915_screen.c
> +++ b/src/gallium/drivers/i915/i915_screen.c
> @@ -366,6 +366,8 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
> }
> case PIPE_CAP_UMA:
> return 1;
> + case PIPE_CAP_MAX_VERTEX_BUFFERS:
> + return 32;
>
> default:
> debug_printf("%s: Unknown cap %u.\n", __FUNCTION__, cap);
> diff --git a/src/gallium/drivers/ilo/ilo_screen.c b/src/gallium/drivers/ilo/ilo_screen.c
> index 1ae0327..026cd6c 100644
> --- a/src/gallium/drivers/ilo/ilo_screen.c
> +++ b/src/gallium/drivers/ilo/ilo_screen.c
> @@ -532,6 +532,8 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap param)
> return false;
> case PIPE_CAP_POLYGON_OFFSET_CLAMP:
> return true;
> + case PIPE_CAP_MAX_VERTEX_BUFFERS:
> + return 32;
>
> default:
> return 0;
> diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
> index f2a12a0..5beb746 100644
> --- a/src/gallium/drivers/llvmpipe/lp_screen.c
> +++ b/src/gallium/drivers/llvmpipe/lp_screen.c
> @@ -326,6 +326,8 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
> case PIPE_CAP_PRIMITIVE_RESTART_FOR_PATCHES:
> case PIPE_CAP_TGSI_VOTE:
> return 0;
> + case PIPE_CAP_MAX_VERTEX_BUFFERS:
> + return 32;
> }
> /* should only get here on unhandled cases */
> debug_printf("Unexpected PIPE_CAP %d query\n", param);
> diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
> index de798cf..763926a 100644
> --- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
> +++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
> @@ -75,6 +75,8 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
> return 1;
> case PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE:
> return 2048;
> + case PIPE_CAP_MAX_VERTEX_BUFFERS:
> + return 32;
> /* supported capabilities */
> case PIPE_CAP_TWO_SIDED_STENCIL:
> case PIPE_CAP_ANISOTROPIC_FILTER:
> diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> index bcb1ae9..35cda61 100644
> --- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> +++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> @@ -141,6 +141,8 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
> return PIPE_ENDIAN_LITTLE;
> case PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS:
> return (class_3d >= NVA3_3D_CLASS) ? 4 : 0;
> + case PIPE_CAP_MAX_VERTEX_BUFFERS:
> + return 32;
>
> /* supported caps */
> case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
> diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
> index b9437b2..d9c8545 100644
> --- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
> +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
> @@ -157,6 +157,8 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
> return PIPE_ENDIAN_LITTLE;
> case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
> return 30;
> + case PIPE_CAP_MAX_VERTEX_BUFFERS:
> + return 32;
>
> /* supported caps */
> case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
> diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
> index 681681b..1d34cc3 100644
> --- a/src/gallium/drivers/r300/r300_screen.c
> +++ b/src/gallium/drivers/r300/r300_screen.c
> @@ -272,6 +272,8 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
> return r300screen->info.pci_dev;
> case PIPE_CAP_PCI_FUNCTION:
> return r300screen->info.pci_func;
> + case PIPE_CAP_MAX_VERTEX_BUFFERS:
> + return 32;
> }
> return 0;
> }
> diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
> index a49b00f..d85c7f7 100644
> --- a/src/gallium/drivers/r600/r600_pipe.c
> +++ b/src/gallium/drivers/r600/r600_pipe.c
> @@ -458,6 +458,8 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
> return rscreen->b.info.pci_dev;
> case PIPE_CAP_PCI_FUNCTION:
> return rscreen->b.info.pci_func;
> + case PIPE_CAP_MAX_VERTEX_BUFFERS:
> + return 32;
> }
> return 0;
> }
> diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
> index 5d7d2f3..f3f0fd5 100644
> --- a/src/gallium/drivers/radeonsi/si_pipe.c
> +++ b/src/gallium/drivers/radeonsi/si_pipe.c
> @@ -481,6 +481,8 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
> return sscreen->b.info.pci_dev;
> case PIPE_CAP_PCI_FUNCTION:
> return sscreen->b.info.pci_func;
> + case PIPE_CAP_MAX_VERTEX_BUFFERS:
> + return 32;
> }
> return 0;
> }
> diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c
> index 0c87f69..b229950 100644
> --- a/src/gallium/drivers/softpipe/sp_screen.c
> +++ b/src/gallium/drivers/softpipe/sp_screen.c
> @@ -278,6 +278,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
> return 0;
> case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
> return 4;
> + case PIPE_CAP_MAX_VERTEX_BUFFERS:
> + return 32;
> }
> /* should only get here on unhandled cases */
> debug_printf("Unexpected PIPE_CAP %d query\n", param);
> diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c
> index 2432523..75ee50a 100644
> --- a/src/gallium/drivers/svga/svga_screen.c
> +++ b/src/gallium/drivers/svga/svga_screen.c
> @@ -410,6 +410,8 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
> case PIPE_CAP_PRIMITIVE_RESTART_FOR_PATCHES:
> case PIPE_CAP_TGSI_VOTE:
> return 0;
> + case PIPE_CAP_MAX_VERTEX_BUFFERS:
> + return 32;
> }
>
> debug_printf("Unexpected PIPE_CAP_ query %u\n", param);
> diff --git a/src/gallium/drivers/swr/swr_screen.cpp b/src/gallium/drivers/swr/swr_screen.cpp
> index ca39202..e69c51d 100644
> --- a/src/gallium/drivers/swr/swr_screen.cpp
> +++ b/src/gallium/drivers/swr/swr_screen.cpp
> @@ -362,6 +362,8 @@ swr_get_param(struct pipe_screen *screen, enum pipe_cap param)
> case PIPE_CAP_PRIMITIVE_RESTART_FOR_PATCHES:
> case PIPE_CAP_TGSI_VOTE:
> return 0;
> + case PIPE_CAP_MAX_VERTEX_BUFFERS:
> + return 32;
> }
>
> /* should only get here on unhandled cases */
> diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c
> index ecc797c..6644a5a 100644
> --- a/src/gallium/drivers/vc4/vc4_screen.c
> +++ b/src/gallium/drivers/vc4/vc4_screen.c
> @@ -274,6 +274,8 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
> }
> case PIPE_CAP_UMA:
> return 1;
> + case PIPE_CAP_MAX_VERTEX_BUFFERS:
> + return 32;
>
> default:
> fprintf(stderr, "unknown param %d\n", param);
> diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c
> index 919b64e..d2ccfaf 100644
> --- a/src/gallium/drivers/virgl/virgl_screen.c
> +++ b/src/gallium/drivers/virgl/virgl_screen.c
> @@ -254,6 +254,8 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
> case PIPE_CAP_UMA:
> case PIPE_CAP_VIDEO_MEMORY:
> return 0;
> + case PIPE_CAP_MAX_VERTEX_BUFFERS:
> + return 32;
> }
> /* should only get here on unhandled cases */
> debug_printf("Unexpected PIPE_CAP %d query\n", param);
> diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
> index 569725f..4891f7b 100644
> --- a/src/gallium/include/pipe/p_defines.h
> +++ b/src/gallium/include/pipe/p_defines.h
> @@ -730,6 +730,7 @@ enum pipe_cap
> PIPE_CAP_CULL_DISTANCE,
> PIPE_CAP_PRIMITIVE_RESTART_FOR_PATCHES,
> PIPE_CAP_TGSI_VOTE,
> + PIPE_CAP_MAX_VERTEX_BUFFERS,
> };
>
> #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)
> --
> 2.5.5
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list