[Mesa-dev] [PATCH] i965: Increase BRW_MAX_UBO to 15.

Ilia Mirkin imirkin at alum.mit.edu
Mon Nov 30 16:55:02 PST 2015


How sure are you about this? This would make it very annoying to
implement on recent (kepler+) nvidia hardware... there are 16 constbuf
positions total, of which one has to contain texture descriptor data
(mandated by the hw), and it's common to have at least one
driver-internal one. If you're careful it could be shared with the
texture one, but iirc nvidia isn't too careful about it. FWIW nouveau
currently exposes 13, while nvidia apparently does 14.

On Mon, Nov 30, 2015 at 7:49 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> I believe that DirectX offers 16 UBOs, with one reserved for special
> purposes.  This means that the practical lower bound is 15, even if
> OpenGL only mandates 12.
>
> Without this, Shadow of Mordor shaders fail to work because of limit
> checking around GL_MAX_UNIFORM_BUFFER_BINDINGS.
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/mesa/drivers/dri/i965/brw_context.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Shadow of Mordor also needs tessellation, so backporting this wouldn't
> help the game any.
>
> diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
> index e45df46..e20082f 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.h
> +++ b/src/mesa/drivers/dri/i965/brw_context.h
> @@ -414,7 +414,7 @@ struct brw_ff_gs_prog_data {
>  #define BRW_MAX_DRAW_BUFFERS 8
>
>  /** Max number of UBOs in a shader */
> -#define BRW_MAX_UBO 12
> +#define BRW_MAX_UBO 15
>
>  /** Max number of SSBOs in a shader */
>  #define BRW_MAX_SSBO 12
> --
> 2.6.2
>
> _______________________________________________
> 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