[Mesa-dev] [PATCH 02/14] mesa: bump GL_MAX_ELEMENTS_INDICES and GL_MAX_ELEMENTS_VERTICES

Mathias Fröhlich Mathias.Froehlich at gmx.net
Fri Aug 10 14:18:37 UTC 2018


Hi Marek,

On Thursday, 9 August 2018 01:55:11 CEST Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> same number as our closed GL driver
> ---
>  src/mesa/main/config.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
> index 6a2f766222a..fdf90d8956f 100644
> --- a/src/mesa/main/config.h
> +++ b/src/mesa/main/config.h
> @@ -131,22 +131,22 @@
>   * used almost everywhere else.
>   */
>  #define MAX_TEXTURE_UNITS ((MAX_TEXTURE_COORD_UNITS > MAX_TEXTURE_IMAGE_UNITS) ? MAX_TEXTURE_COORD_UNITS : MAX_TEXTURE_IMAGE_UNITS)
>  
>  /** Maximum number of viewports supported with ARB_viewport_array */
>  #define MAX_VIEWPORTS 16
>  
>  /** Maximum number of window rectangles supported with EXT_window_rectangles */
>  #define MAX_WINDOW_RECTANGLES 8
>  
> -/** Maximum size for CVA.  May be overridden by the drivers.  */
> -#define MAX_ARRAY_LOCK_SIZE 3000
> +/** Default for GL_MAX_ELEMENTS_INDICES and GL_MAX_ELEMENTS_VERTICES.  */
> +#define MAX_ARRAY_LOCK_SIZE (512 * 1024 * 1024)

While I really appreciate to return something sensible at max GL_MAX_ELEMENTS_INDICES
and GL_MAX_ELEMENTS_VERTICES, I think that extending 
gl_constants::MaxArrayLockSize breaks some drivers using tnl.

The gl_constants::MaxArrayLockSize value is given to a lot of _tnl_init_vertices
calls that allocates an array of size gl_constants::MaxArrayLockSize*<max/typical? vertex size>.
That one probably fails in a too large malloc with the new constant.

May be you can introduce a new value in gl_constants that is used for GL_MAX_ELEMENTS_INDICES
and GL_MAX_ELEMENTS_VERTICES.
Alternatively, you may look for drivers using  _tnl_init_vertices and leave those drivers
values of gl_constants::MaxArrayLockSize at a reasonable size for tnl drivers.
... or some other solution not blowing up tnl drivers.

best
Mathias

>  
>  /** Subpixel precision for antialiasing, window coordinate snapping */
>  #define SUB_PIXEL_BITS 4
>  
>  /** For GL_ARB_texture_compression */
>  #define MAX_COMPRESSED_TEXTURE_FORMATS 25
>  
>  /** For GL_EXT_texture_filter_anisotropic */
>  #define MAX_TEXTURE_MAX_ANISOTROPY 16.0
>  
> 






More information about the mesa-dev mailing list