Mesa (master): freedreno: move a2xx specific hack out of core

Rob Clark robclark at kemper.freedesktop.org
Tue Apr 18 20:51:09 UTC 2017


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

Author: Rob Clark <robdclark at gmail.com>
Date:   Sun Apr 16 11:57:04 2017 -0400

freedreno: move a2xx specific hack out of core

Signed-off-by: Rob Clark <robdclark at gmail.com>

---

 src/gallium/drivers/freedreno/a2xx/fd2_texture.c  | 21 ++++++++++++++++++++-
 src/gallium/drivers/freedreno/freedreno_texture.c |  9 ---------
 2 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_texture.c b/src/gallium/drivers/freedreno/a2xx/fd2_texture.c
index c500fbc9b8..089c337118 100644
--- a/src/gallium/drivers/freedreno/a2xx/fd2_texture.c
+++ b/src/gallium/drivers/freedreno/a2xx/fd2_texture.c
@@ -151,6 +151,25 @@ fd2_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc,
 	return &so->base;
 }
 
+static void
+fd2_set_sampler_views(struct pipe_context *pctx, enum pipe_shader_type shader,
+		unsigned start, unsigned nr,
+		struct pipe_sampler_view **views)
+{
+	if (shader == PIPE_SHADER_FRAGMENT) {
+		struct fd_context *ctx = fd_context(pctx);
+
+		/* on a2xx, since there is a flat address space for textures/samplers,
+		 * a change in # of fragment textures/samplers will trigger patching and
+		 * re-emitting the vertex shader:
+		 */
+		if (nr != ctx->tex[PIPE_SHADER_FRAGMENT].num_textures)
+			ctx->dirty |= FD_DIRTY_TEXSTATE;
+	}
+
+	fd_set_sampler_views(pctx, shader, start, nr, views);
+}
+
 /* map gallium sampler-id to hw const-idx.. adreno uses a flat address
  * space of samplers (const-idx), so we need to map the gallium sampler-id
  * which is per-shader to a global const-idx space.
@@ -177,5 +196,5 @@ fd2_texture_init(struct pipe_context *pctx)
 	pctx->create_sampler_state = fd2_sampler_state_create;
 	pctx->bind_sampler_states = fd2_sampler_states_bind;
 	pctx->create_sampler_view = fd2_sampler_view_create;
-	pctx->set_sampler_views = fd_set_sampler_views;
+	pctx->set_sampler_views = fd2_set_sampler_views;
 }
diff --git a/src/gallium/drivers/freedreno/freedreno_texture.c b/src/gallium/drivers/freedreno/freedreno_texture.c
index d27f47eb29..e9d90aa3a7 100644
--- a/src/gallium/drivers/freedreno/freedreno_texture.c
+++ b/src/gallium/drivers/freedreno/freedreno_texture.c
@@ -112,15 +112,6 @@ fd_set_sampler_views(struct pipe_context *pctx, enum pipe_shader_type shader,
 
 	switch (shader) {
 	case PIPE_SHADER_FRAGMENT:
-		/* on a2xx, since there is a flat address space for textures/samplers,
-		 * a change in # of fragment textures/samplers will trigger patching
-		 * and re-emitting the vertex shader:
-		 *
-		 * (note: later gen's ignore FD_DIRTY_TEXSTATE so fine to set it)
-		 */
-		if (nr != ctx->tex[PIPE_SHADER_FRAGMENT].num_textures)
-			ctx->dirty |= FD_DIRTY_TEXSTATE;
-
 		ctx->dirty |= FD_DIRTY_FRAGTEX;
 		break;
 	case PIPE_SHADER_VERTEX:




More information about the mesa-commit mailing list