[Mesa-dev] [PATCH v5 01/70] mesa: set MAX_SHADER_STORAGE_BUFFERS to 15.

Kristian Høgsberg krh at bitplanet.net
Tue Sep 15 11:25:57 PDT 2015


On Fri, Sep 11, 2015 at 08:12:13AM +0200, Iago Toral wrote:
> On Thu, 2015-09-10 at 15:17 -0400, Ilia Mirkin wrote:
> > On Thu, Sep 10, 2015 at 2:52 PM, Ian Romanick <idr at freedesktop.org> wrote:
> > > On 09/10/2015 10:45 AM, Ilia Mirkin wrote:
> > >> On Thu, Sep 10, 2015 at 9:35 AM, Iago Toral Quiroga <itoral at igalia.com> wrote:
> > >>> From: Samuel Iglesias Gonsalvez <siglesias at igalia.com>
> > >>>
> > >>> This patch sets the same value used for uniform buffers.
> > >>>
> > >>> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias at igalia.com>
> > >>> ---
> > >>>  src/mesa/main/config.h | 2 +-
> > >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> > >>>
> > >>> diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
> > >>> index b35031d..69acd7d 100644
> > >>> --- a/src/mesa/main/config.h
> > >>> +++ b/src/mesa/main/config.h
> > >>> @@ -171,7 +171,7 @@
> > >>>  #define MAX_PROGRAM_LOCAL_PARAMS       4096
> > >>>  #define MAX_UNIFORMS                   4096
> > >>>  #define MAX_UNIFORM_BUFFERS            15 /* + 1 default uniform buffer */
> > >>> -#define MAX_SHADER_STORAGE_BUFFERS     7  /* + 1 default shader storage buffer */
> > >>> +#define MAX_SHADER_STORAGE_BUFFERS     15  /* + 1 default shader storage buffer */
> > >>
> > >> Is there such a thing as a default shader storage buffer? I would have
> > >> assumed not, but haven't read the spec.
> > >
> > > Technically no, but I think (and I'm sure Ken will correct me) i965 uses
> > > one for register spilling.  Or is "scratch space" a different sort of thing?
> > 
> > Sure, but that's a driver-specific thing. The MAX_UNIFORM_BUFFERS
> > thing is in reference to the number of uniform buffers in the GL.
> > MAX_SHADER_STORAGE_BUFFERS seems like it should be the same thing. Why
> > not make it 16? Or perhaps leave it at 15 and remove the comment?
> 
> Right, this is used to define the maximum number of binding points
> available per shader stage. There is no such thing as a default shader
> storage buffer that is different from the others, I think that comment
> is just a copy&paste mistake. We can remove the comment and leave this
> at 15, or round it up to 16 as you suggest. I'd go with the latter.
> 
> Iago

Yes, there's nothing in our hardware that limits the number of SSBOs,
except the ~256 total entries limit in the binding table.  I agree, go
with 16 and drop the comment.

Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

> > With uniform buffers, there's a "default" uniform buffer, and then
> > there are actual user ones.
> 
> 
> 
> > >
> > >>>  /* 6 is for vertex, hull, domain, geometry, fragment, and compute shader. */
> > >>>  #define MAX_COMBINED_UNIFORM_BUFFERS   (MAX_UNIFORM_BUFFERS * 6)
> > >>>  #define MAX_COMBINED_SHADER_STORAGE_BUFFERS   (MAX_SHADER_STORAGE_BUFFERS * 6)
> > >>> --
> > >>> 1.9.1
> > >>>
> > >>> _______________________________________________
> > >>> mesa-dev mailing list
> > >>> mesa-dev at lists.freedesktop.org
> > >>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> > >> _______________________________________________
> > >> mesa-dev mailing list
> > >> mesa-dev at lists.freedesktop.org
> > >> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> > >
> > 
> 
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list