etnaviv: increase number of supported varyings to 16
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Fri, 14 Feb 2020 10:43:11 +0000 (11:43 +0100)
committerMarge Bot <eric+marge@anholt.net>
Sun, 8 Mar 2020 11:08:59 +0000 (11:08 +0000)
No deqp regressions.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3827>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3827>

src/gallium/drivers/etnaviv/etnaviv_context.c
src/gallium/drivers/etnaviv/etnaviv_emit.c
src/gallium/drivers/etnaviv/etnaviv_internal.h
src/gallium/drivers/etnaviv/etnaviv_shader.c

index 388f9d1306a1b1386ff0c7bc3105ceaa98af92db..76d80589950dde8ca423a0e89e8bad45b35b8e5f 100644 (file)
@@ -399,7 +399,6 @@ etna_reset_gpu_state(struct etna_context *ctx)
       etna_set_state(stream, VIVS_VS_SAMPLER_BASE, 0x00000020);
       etna_set_state(stream, VIVS_SH_CONFIG, VIVS_SH_CONFIG_RTNE_ROUNDING);
    } else { /* Only on pre-HALTI5 */
-      etna_set_state(stream, VIVS_GL_UNK03834, 0x00000000);
       etna_set_state(stream, VIVS_GL_UNK03838, 0x00000000);
       etna_set_state(stream, VIVS_GL_UNK03854, 0x00000000);
    }
index 46e1719ad71054d18a0d57d249b94a1ed6defd38..839361ec2d4f938ba294cfaf56f43d09ccbbf222 100644 (file)
@@ -145,9 +145,11 @@ emit_halti5_only_state(struct etna_context *ctx, int vs_output_count)
       }
    }
    if (unlikely(dirty & (ETNA_DIRTY_SHADER))) {
-      /*00A90*/ EMIT_STATE(PA_VARYING_NUM_COMPONENTS(0), ctx->shader_state.GL_VARYING_NUM_COMPONENTS);
+      /*00A90*/ EMIT_STATE(PA_VARYING_NUM_COMPONENTS(0), ctx->shader_state.GL_VARYING_NUM_COMPONENTS[0]);
+      /*00A94*/ EMIT_STATE(PA_VARYING_NUM_COMPONENTS(1), ctx->shader_state.GL_VARYING_NUM_COMPONENTS[1]);
       /*00AA8*/ EMIT_STATE(PA_VS_OUTPUT_COUNT, vs_output_count);
-      /*01080*/ EMIT_STATE(PS_VARYING_NUM_COMPONENTS(0), ctx->shader_state.GL_VARYING_NUM_COMPONENTS);
+      /*01080*/ EMIT_STATE(PS_VARYING_NUM_COMPONENTS(0), ctx->shader_state.GL_VARYING_NUM_COMPONENTS[0]);
+      /*01084*/ EMIT_STATE(PS_VARYING_NUM_COMPONENTS(1), ctx->shader_state.GL_VARYING_NUM_COMPONENTS[1]);
       /*03888*/ EMIT_STATE(GL_HALTI5_SH_SPECIALS, ctx->shader_state.GL_HALTI5_SH_SPECIALS);
    }
    etna_coalesce_end(stream, &coalesce);
@@ -199,10 +201,11 @@ emit_pre_halti5_state(struct etna_context *ctx)
       /*01018*/ EMIT_STATE(PS_START_PC, ctx->shader_state.PS_START_PC);
    }
    if (unlikely(dirty & (ETNA_DIRTY_SHADER))) {
-      /*03820*/ EMIT_STATE(GL_VARYING_NUM_COMPONENTS, ctx->shader_state.GL_VARYING_NUM_COMPONENTS);
+      /*03820*/ EMIT_STATE(GL_VARYING_NUM_COMPONENTS, ctx->shader_state.GL_VARYING_NUM_COMPONENTS[0]);
       for (int x = 0; x < 2; ++x) {
          /*03828*/ EMIT_STATE(GL_VARYING_COMPONENT_USE(x), ctx->shader_state.GL_VARYING_COMPONENT_USE[x]);
       }
+      /*03834*/ EMIT_STATE(GL_VARYING_NUM_COMPONENTS2, ctx->shader_state.GL_VARYING_NUM_COMPONENTS[1]);
    }
    etna_coalesce_end(stream, &coalesce);
 }
index 22f6d2cd9fadb4e1e31be6c85cb8f0c864bc0611..bdaa7ad65211b9a771ec8df2a0d57ce36b6f4a28 100644 (file)
@@ -34,7 +34,7 @@
 #include "drm/etnaviv_drmif.h"
 
 #define ETNA_NUM_INPUTS (16)
-#define ETNA_NUM_VARYINGS 8
+#define ETNA_NUM_VARYINGS 16
 #define ETNA_NUM_LOD (14)
 #define ETNA_NUM_LAYERS (6)
 #define ETNA_MAX_UNIFORMS (256)
@@ -263,7 +263,7 @@ struct compiled_shader_state {
    uint32_t PS_START_PC;
    uint32_t PE_DEPTH_CONFIG;
    uint32_t GL_VARYING_TOTAL_COMPONENTS;
-   uint32_t GL_VARYING_NUM_COMPONENTS;
+   uint32_t GL_VARYING_NUM_COMPONENTS[2];
    uint32_t GL_VARYING_COMPONENT_USE[2];
    uint32_t GL_HALTI5_SH_SPECIALS;
    uint32_t FE_HALTI5_ID_CONFIG;
index 6f6f8d2b9f4ad71eb9e9009f347253215047d307..8d288aa6632dceb7d00105ae65397471f96acdbd 100644 (file)
@@ -190,7 +190,8 @@ etna_link_shaders(struct etna_context *ctx, struct compiled_shader_state *cs,
 
    cs->GL_VARYING_TOTAL_COMPONENTS =
       VIVS_GL_VARYING_TOTAL_COMPONENTS_NUM(align(total_components, 2));
-   cs->GL_VARYING_NUM_COMPONENTS = num_components[0];
+   cs->GL_VARYING_NUM_COMPONENTS[0] = num_components[0];
+   cs->GL_VARYING_NUM_COMPONENTS[1] = num_components[1];
    cs->GL_VARYING_COMPONENT_USE[0] = component_use[0];
    cs->GL_VARYING_COMPONENT_USE[1] = component_use[1];