etnaviv: correct PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE handling
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Wed, 14 Aug 2019 09:56:02 +0000 (11:56 +0200)
committerChristian Gmeiner <christian.gmeiner@gmail.com>
Wed, 14 Aug 2019 10:29:56 +0000 (12:29 +0200)
Have a correct answer to GL_MAX_FRAGMENT_UNIFORM_VECTORS and
GL_MAX_VERTEX_UNIFORM_VECTORS.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach l.stach@pengutronix.de
src/gallium/drivers/etnaviv/etnaviv_screen.c

index e392f575e712c0f183ad36e71e6ed588b3f46062..3c28a9f11014bdb2d8a316912d3d017a11b991d0 100644 (file)
@@ -331,7 +331,9 @@ etna_screen_get_shader_param(struct pipe_screen *pscreen,
    case PIPE_SHADER_CAP_PREFERRED_IR:
       return DBG_ENABLED(ETNA_DBG_NIR) ? PIPE_SHADER_IR_NIR : PIPE_SHADER_IR_TGSI;
    case PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE:
-      return 4096;
+      return shader == PIPE_SHADER_FRAGMENT
+                ? screen->specs.max_ps_uniforms * sizeof(float[4])
+                : screen->specs.max_vs_uniforms * sizeof(float[4]);
    case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED:
    case PIPE_SHADER_CAP_TGSI_DFRACEXP_DLDEXP_SUPPORTED:
    case PIPE_SHADER_CAP_TGSI_LDEXP_SUPPORTED: