[Mesa-dev] [PATCH] nv50: report only 16 texure_samplers

Brian Paul brianp at vmware.com
Sat Oct 12 02:02:44 CEST 2013


On 10/11/2013 10:44 AM, Emil Velikov wrote:
> Current mesa code(cso and drivers) expect and use only up-to 16
> texture samplers.
>
> Verbatum copy from the nvc0 driver.
>
> Cc "9.1" <mesa-stable at lists.freedesktop.org>
> Cc "9.2" <mesa-stable at lists.freedesktop.org>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70212
> Reported-by: Aaron Watry <awatry at gmail.com>
> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
> ---
>   src/gallium/drivers/nouveau/nv50/nv50_screen.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> index f454ec7..3f81cc4 100644
> --- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> +++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> @@ -249,7 +249,11 @@ nv50_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader,
>      case PIPE_SHADER_CAP_INTEGERS:
>         return 1;
>      case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
> +      return 16; /* would be 32 in linked (OpenGL-style) mode */
> +      /*
> +   case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLER_VIEWS:
>         return 32;
> +      */
>      default:
>         NOUVEAU_ERR("unknown PIPE_SHADER_CAP %d\n", param);
>         return 0;
>

Since PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLER_VIEWS doesn't really exist, 
I'd rather see it removed entirely.

If you wanted to future-proof the code you could do
    return MIN2(32, PIPE_MAX_SAMPLERS);

in case we bump PIPE_MAX_SAMPLERS to 32 one of these days.


In any case, Reviewed-by: Brian Paul <brianp at vmware.com>



More information about the mesa-dev mailing list