Mesa (master): radeonsi: drop support for NULL sampler views

Marek Olšák mareko at kemper.freedesktop.org
Tue Oct 4 14:13:48 UTC 2016


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

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Sun Oct  2 15:40:10 2016 +0200

radeonsi: drop support for NULL sampler views

not used anymore. It was used when the polygon stipple texture was constant.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor at folklore1984.net>

---

 src/gallium/drivers/radeonsi/si_descriptors.c |  5 +++--
 src/gallium/drivers/radeonsi/si_state.c       | 11 +----------
 2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index 21dad3c..3066323 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -410,10 +410,11 @@ static void si_set_sampler_view(struct si_context *sctx,
 		struct r600_texture *rtex = (struct r600_texture *)view->texture;
 		uint32_t *desc = descs->list + slot * 16;
 
+		assert(rtex); /* views with texture == NULL aren't supported */
 		pipe_sampler_view_reference(&views->views[slot], view);
 		memcpy(desc, rview->state, 8*4);
 
-		if (view->texture && view->texture->target != PIPE_BUFFER) {
+		if (rtex->resource.b.b.target != PIPE_BUFFER) {
 			bool is_separate_stencil =
 				rtex->db_compatible &&
 				rview->is_stencil_sampler;
@@ -427,7 +428,7 @@ static void si_set_sampler_view(struct si_context *sctx,
 						       desc);
 		}
 
-		if (view->texture && view->texture->target != PIPE_BUFFER &&
+		if (rtex->resource.b.b.target != PIPE_BUFFER &&
 		    rtex->fmask.size) {
 			memcpy(desc + 8,
 			       rview->fmask_state, 8*4);
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 04b57dc..0376693 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -2950,16 +2950,7 @@ si_create_sampler_view_custom(struct pipe_context *ctx,
 	view->base.reference.count = 1;
 	view->base.context = ctx;
 
-	/* NULL resource, obey swizzle (only ZERO and ONE make sense). */
-	if (!texture) {
-		view->state[3] = S_008F1C_DST_SEL_X(si_map_swizzle(state->swizzle_r)) |
-				 S_008F1C_DST_SEL_Y(si_map_swizzle(state->swizzle_g)) |
-				 S_008F1C_DST_SEL_Z(si_map_swizzle(state->swizzle_b)) |
-				 S_008F1C_DST_SEL_W(si_map_swizzle(state->swizzle_a)) |
-				 S_008F1C_TYPE(V_008F1C_SQ_RSRC_IMG_1D);
-		return &view->base;
-	}
-
+	assert(texture);
 	pipe_resource_reference(&view->base.texture, texture);
 
 	if (state->format == PIPE_FORMAT_X24S8_UINT ||




More information about the mesa-commit mailing list