[Mesa-dev] [PATCH 1/2] gallium: remove PIPE_CAP_MAX_COMBINED_SAMPLERS
Brian Paul
brianp at vmware.com
Mon Jan 20 06:35:57 PST 2014
On 01/18/2014 05:40 AM, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> This can be derived from the shader caps.
> ---
> src/gallium/docs/source/screen.rst | 2 --
> src/gallium/drivers/freedreno/freedreno_screen.c | 2 --
> src/gallium/drivers/i915/i915_screen.c | 7 -------
> 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/include/pipe/p_defines.h | 3 ---
> src/mesa/state_tracker/st_extensions.c | 10 ++++++----
> 15 files changed, 6 insertions(+), 38 deletions(-)
>
...
> diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
> index c17601a..4231d4c 100644
> --- a/src/mesa/state_tracker/st_extensions.c
> +++ b/src/mesa/state_tracker/st_extensions.c
> @@ -89,10 +89,6 @@ void st_init_limits(struct st_context *st)
> c->MaxArrayTextureLayers
> = screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS);
>
> - c->MaxCombinedTextureImageUnits
> - = _min(screen->get_param(screen, PIPE_CAP_MAX_COMBINED_SAMPLERS),
> - MAX_COMBINED_TEXTURE_IMAGE_UNITS);
> -
> /* Define max viewport size and max renderbuffer size in terms of
> * max texture size (note: max tex RECT size = max tex 2D size).
> * If this isn't true for some hardware we'll need new PIPE_CAP_ queries.
> @@ -243,6 +239,12 @@ void st_init_limits(struct st_context *st)
> options->LowerClipDistance = true;
> }
>
> + c->MaxCombinedTextureImageUnits =
> + _min(c->Program[MESA_SHADER_VERTEX].MaxTextureImageUnits +
> + c->Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits +
> + c->Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits,
> + MAX_COMBINED_TEXTURE_IMAGE_UNITS);
> +
> /* This depends on program constants. */
> c->MaxTextureCoordUnits
> = _min(c->Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits, MAX_TEXTURE_COORD_UNITS);
>
I'm not sure about this. The concept of
MAX_COMBINED_TEXTURE_IMAGE_UNITS goes back to the first shader hardware
where texture image units might be shared between the VS and FS.
The question is whether any of the hardware we care about has that
restriction.
-Brian
More information about the mesa-dev
mailing list