Mesa (master): etnaviv: factor out TS state emitting

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Mar 20 10:11:02 UTC 2021


Module: Mesa
Branch: master
Commit: a9494a8b9c3c66eaf5d8451d2905a00516151356
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a9494a8b9c3c66eaf5d8451d2905a00516151356

Author: Christian Gmeiner <christian.gmeiner at gmail.com>
Date:   Sat Dec 12 15:24:21 2020 +0100

etnaviv: factor out TS state emitting

Will be reused in NTE path.

Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
Reviewed-by: Lucas Stach <l.stach at pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8103>

---

 .../drivers/etnaviv/etnaviv_texture_state.c        | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/etnaviv/etnaviv_texture_state.c b/src/gallium/drivers/etnaviv/etnaviv_texture_state.c
index 56597089d55..ac2a1d1e967 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_texture_state.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_texture_state.c
@@ -282,12 +282,10 @@ etna_sampler_view_state_destroy(struct pipe_context *pctx,
 #define EMIT_STATE_RELOC(state_name, src_value) \
    etna_coalsence_emit_reloc(stream, &coalesce, VIVS_##state_name, src_value)
 
-/* Emit plain (non-descriptor) texture state */
 static void
-etna_emit_texture_state(struct etna_context *ctx)
+etna_emit_ts_state(struct etna_context *ctx)
 {
    struct etna_cmd_stream *stream = ctx->stream;
-   struct etna_screen *screen = ctx->screen;
    uint32_t active_samplers = active_samplers_bits(ctx);
    uint32_t dirty = ctx->dirty;
    struct etna_coalesce coalesce;
@@ -320,6 +318,24 @@ etna_emit_texture_state(struct etna_context *ctx)
          }
       }
    }
+
+   etna_coalesce_end(stream, &coalesce);
+}
+
+/* Emit plain (non-descriptor) texture state */
+static void
+etna_emit_texture_state(struct etna_context *ctx)
+{
+   struct etna_cmd_stream *stream = ctx->stream;
+   struct etna_screen *screen = ctx->screen;
+   uint32_t active_samplers = active_samplers_bits(ctx);
+   uint32_t dirty = ctx->dirty;
+   struct etna_coalesce coalesce;
+
+   etna_emit_ts_state(ctx);
+
+   etna_coalesce_start(stream, &coalesce);
+
    if (unlikely(dirty & (ETNA_DIRTY_SAMPLER_VIEWS | ETNA_DIRTY_SAMPLERS))) {
       for (int x = 0; x < VIVS_TE_SAMPLER__LEN; ++x) {
          uint32_t val = 0; /* 0 == sampler inactive */



More information about the mesa-commit mailing list