[Mesa-dev] [PATCH 4/5] radeonsi: rename si_textures_info -> si_samplers, si_images_info -> si_images

Marek Olšák maraeo at gmail.com
Tue Oct 3 17:30:44 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

---
 src/gallium/drivers/radeonsi/si_blit.c        | 10 +++++-----
 src/gallium/drivers/radeonsi/si_descriptors.c | 22 +++++++++++-----------
 src/gallium/drivers/radeonsi/si_pipe.h        |  8 ++++----
 3 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c
index b8ff67d..957254b 100644
--- a/src/gallium/drivers/radeonsi/si_blit.c
+++ b/src/gallium/drivers/radeonsi/si_blit.c
@@ -414,21 +414,21 @@ si_decompress_depth(struct si_context *sctx,
 	/* set_framebuffer_state takes care of coherency for single-sample.
 	 * The DB->CB copy uses CB for the final writes.
 	 */
 	if (copy_planes && tex->resource.b.b.nr_samples > 1)
 		si_make_CB_shader_coherent(sctx, tex->resource.b.b.nr_samples,
 					   false);
 }
 
 static void
 si_decompress_sampler_depth_textures(struct si_context *sctx,
-				     struct si_textures_info *textures)
+				     struct si_samplers *textures)
 {
 	unsigned i;
 	unsigned mask = textures->needs_depth_decompress_mask;
 
 	while (mask) {
 		struct pipe_sampler_view *view;
 		struct si_sampler_view *sview;
 		struct r600_texture *tex;
 
 		i = u_bit_scan(&mask);
@@ -541,21 +541,21 @@ si_decompress_color_texture(struct si_context *sctx, struct r600_texture *tex,
 	if (!tex->cmask.size && !tex->fmask.size && !tex->dcc_offset)
 		return;
 
 	si_blit_decompress_color(&sctx->b.b, tex, first_level, last_level, 0,
 				 util_max_layer(&tex->resource.b.b, first_level),
 				 false);
 }
 
 static void
 si_decompress_sampler_color_textures(struct si_context *sctx,
-				     struct si_textures_info *textures)
+				     struct si_samplers *textures)
 {
 	unsigned i;
 	unsigned mask = textures->needs_color_decompress_mask;
 
 	while (mask) {
 		struct pipe_sampler_view *view;
 		struct r600_texture *tex;
 
 		i = u_bit_scan(&mask);
 
@@ -564,21 +564,21 @@ si_decompress_sampler_color_textures(struct si_context *sctx,
 
 		tex = (struct r600_texture *)view->texture;
 
 		si_decompress_color_texture(sctx, tex, view->u.tex.first_level,
 					    view->u.tex.last_level);
 	}
 }
 
 static void
 si_decompress_image_color_textures(struct si_context *sctx,
-				   struct si_images_info *images)
+				   struct si_images *images)
 {
 	unsigned i;
 	unsigned mask = images->needs_color_decompress_mask;
 
 	while (mask) {
 		const struct pipe_image_view *view;
 		struct r600_texture *tex;
 
 		i = u_bit_scan(&mask);
 
@@ -620,21 +620,21 @@ static void si_check_render_feedback_texture(struct si_context *sctx,
 			render_feedback = true;
 			break;
 		}
 	}
 
 	if (render_feedback)
 		si_texture_disable_dcc(&sctx->b, tex);
 }
 
 static void si_check_render_feedback_textures(struct si_context *sctx,
-                                              struct si_textures_info *textures)
+                                              struct si_samplers *textures)
 {
 	uint32_t mask = textures->views.enabled_mask;
 
 	while (mask) {
 		const struct pipe_sampler_view *view;
 		struct r600_texture *tex;
 
 		unsigned i = u_bit_scan(&mask);
 
 		view = textures->views.views[i];
@@ -645,21 +645,21 @@ static void si_check_render_feedback_textures(struct si_context *sctx,
 
 		si_check_render_feedback_texture(sctx, tex,
 						 view->u.tex.first_level,
 						 view->u.tex.last_level,
 						 view->u.tex.first_layer,
 						 view->u.tex.last_layer);
 	}
 }
 
 static void si_check_render_feedback_images(struct si_context *sctx,
-                                            struct si_images_info *images)
+                                            struct si_images *images)
 {
 	uint32_t mask = images->enabled_mask;
 
 	while (mask) {
 		const struct pipe_image_view *view;
 		struct r600_texture *tex;
 
 		unsigned i = u_bit_scan(&mask);
 
 		view = &images->views[i];
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index 3835046..788e7c3 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -458,21 +458,21 @@ static bool depth_needs_decompression(struct r600_texture *rtex)
 	 * doesn't flush DB caches in any other case.
 	 */
 	return rtex->db_compatible;
 }
 
 static void si_set_sampler_view(struct si_context *sctx,
 				unsigned shader,
 				unsigned slot, struct pipe_sampler_view *view,
 				bool disallow_early_out)
 {
-	struct si_textures_info *samplers = &sctx->samplers[shader];
+	struct si_samplers *samplers = &sctx->samplers[shader];
 	struct si_sampler_views *views = &samplers->views;
 	struct si_sampler_view *rview = (struct si_sampler_view*)view;
 	struct si_descriptors *descs = si_sampler_and_image_descriptors(sctx, shader);
 	unsigned desc_slot = si_get_sampler_slot(slot);
 	uint32_t *desc = descs->list + desc_slot * 16;
 
 	if (views->views[slot] == view && !disallow_early_out)
 		return;
 
 	if (view) {
@@ -524,21 +524,21 @@ static void si_set_sampler_view(struct si_context *sctx,
 		samplers->needs_depth_decompress_mask &= ~(1u << slot);
 		samplers->needs_color_decompress_mask &= ~(1u << slot);
 	}
 
 	sctx->descriptors_dirty |= 1u << si_sampler_and_image_descriptors_idx(shader);
 }
 
 static void si_update_shader_needs_decompress_mask(struct si_context *sctx,
 						   unsigned shader)
 {
-	struct si_textures_info *samplers = &sctx->samplers[shader];
+	struct si_samplers *samplers = &sctx->samplers[shader];
 	unsigned shader_bit = 1 << shader;
 
 	if (samplers->needs_depth_decompress_mask ||
 	    samplers->needs_color_decompress_mask ||
 	    sctx->images[shader].needs_color_decompress_mask)
 		sctx->shader_needs_decompress_mask |= shader_bit;
 	else
 		sctx->shader_needs_decompress_mask &= ~shader_bit;
 }
 
@@ -558,21 +558,21 @@ static void si_set_sampler_views(struct pipe_context *ctx,
 			si_set_sampler_view(sctx, shader, start + i, views[i], false);
 	} else {
 		for (i = 0; i < count; i++)
 			si_set_sampler_view(sctx, shader, start + i, NULL, false);
 	}
 
 	si_update_shader_needs_decompress_mask(sctx, shader);
 }
 
 static void
-si_samplers_update_needs_color_decompress_mask(struct si_textures_info *samplers)
+si_samplers_update_needs_color_decompress_mask(struct si_samplers *samplers)
 {
 	unsigned mask = samplers->views.enabled_mask;
 
 	while (mask) {
 		int i = u_bit_scan(&mask);
 		struct pipe_resource *res = samplers->views.views[i]->texture;
 
 		if (res && res->target != PIPE_BUFFER) {
 			struct r600_texture *rtex = (struct r600_texture *)res;
 
@@ -581,52 +581,52 @@ si_samplers_update_needs_color_decompress_mask(struct si_textures_info *samplers
 			} else {
 				samplers->needs_color_decompress_mask &= ~(1u << i);
 			}
 		}
 	}
 }
 
 /* IMAGE VIEWS */
 
 static void
-si_release_image_views(struct si_images_info *images)
+si_release_image_views(struct si_images *images)
 {
 	unsigned i;
 
 	for (i = 0; i < SI_NUM_IMAGES; ++i) {
 		struct pipe_image_view *view = &images->views[i];
 
 		pipe_resource_reference(&view->resource, NULL);
 	}
 }
 
 static void
-si_image_views_begin_new_cs(struct si_context *sctx, struct si_images_info *images)
+si_image_views_begin_new_cs(struct si_context *sctx, struct si_images *images)
 {
 	uint mask = images->enabled_mask;
 
 	/* Add buffers to the CS. */
 	while (mask) {
 		int i = u_bit_scan(&mask);
 		struct pipe_image_view *view = &images->views[i];
 
 		assert(view->resource);
 
 		si_sampler_view_add_buffer(sctx, view->resource,
 					   RADEON_USAGE_READWRITE, false, false);
 	}
 }
 
 static void
 si_disable_shader_image(struct si_context *ctx, unsigned shader, unsigned slot)
 {
-	struct si_images_info *images = &ctx->images[shader];
+	struct si_images *images = &ctx->images[shader];
 
 	if (images->enabled_mask & (1u << slot)) {
 		struct si_descriptors *descs = si_sampler_and_image_descriptors(ctx, shader);
 		unsigned desc_slot = si_get_image_slot(slot);
 
 		pipe_resource_reference(&images->views[slot].resource, NULL);
 		images->needs_color_decompress_mask &= ~(1 << slot);
 
 		memcpy(descs->list + desc_slot*8, null_image_descriptor, 8*4);
 		images->enabled_mask &= ~(1u << slot);
@@ -721,21 +721,21 @@ static void si_set_shader_image_desc(struct si_context *ctx,
 					       util_format_get_blockwidth(view->format),
 					       false, desc);
 	}
 }
 
 static void si_set_shader_image(struct si_context *ctx,
 				unsigned shader,
 				unsigned slot, const struct pipe_image_view *view,
 				bool skip_decompress)
 {
-	struct si_images_info *images = &ctx->images[shader];
+	struct si_images *images = &ctx->images[shader];
 	struct si_descriptors *descs = si_sampler_and_image_descriptors(ctx, shader);
 	struct r600_resource *res;
 	unsigned desc_slot = si_get_image_slot(slot);
 	uint32_t *desc = descs->list + desc_slot * 8;
 
 	if (!view || !view->resource) {
 		si_disable_shader_image(ctx, shader, slot);
 		return;
 	}
 
@@ -795,21 +795,21 @@ si_set_shader_images(struct pipe_context *pipe,
 			si_set_shader_image(ctx, shader, slot, &views[i], false);
 	} else {
 		for (i = 0, slot = start_slot; i < count; ++i, ++slot)
 			si_set_shader_image(ctx, shader, slot, NULL, false);
 	}
 
 	si_update_shader_needs_decompress_mask(ctx, shader);
 }
 
 static void
-si_images_update_needs_color_decompress_mask(struct si_images_info *images)
+si_images_update_needs_color_decompress_mask(struct si_images *images)
 {
 	unsigned mask = images->enabled_mask;
 
 	while (mask) {
 		int i = u_bit_scan(&mask);
 		struct pipe_resource *res = images->views[i].resource;
 
 		if (res && res->target != PIPE_BUFFER) {
 			struct r600_texture *rtex = (struct r600_texture *)res;
 
@@ -822,21 +822,21 @@ si_images_update_needs_color_decompress_mask(struct si_images_info *images)
 	}
 }
 
 /* SAMPLER STATES */
 
 static void si_bind_sampler_states(struct pipe_context *ctx,
                                    enum pipe_shader_type shader,
                                    unsigned start, unsigned count, void **states)
 {
 	struct si_context *sctx = (struct si_context *)ctx;
-	struct si_textures_info *samplers = &sctx->samplers[shader];
+	struct si_samplers *samplers = &sctx->samplers[shader];
 	struct si_descriptors *desc = si_sampler_and_image_descriptors(sctx, shader);
 	struct si_sampler_state **sstates = (struct si_sampler_state**)states;
 	int i;
 
 	if (!count || shader >= SI_NUM_SHADERS)
 		return;
 
 	for (i = 0; i < count; i++) {
 		unsigned slot = start + i;
 		unsigned desc_slot = si_get_sampler_slot(slot);
@@ -1705,21 +1705,21 @@ static void si_rebind_buffer(struct pipe_context *ctx, struct pipe_resource *buf
 									    RADEON_PRIO_SAMPLER_BUFFER,
 									    true);
 				}
 			}
 		}
 	}
 
 	/* Shader images */
 	if (rbuffer->bind_history & PIPE_BIND_SHADER_IMAGE) {
 		for (shader = 0; shader < SI_NUM_SHADERS; ++shader) {
-			struct si_images_info *images = &sctx->images[shader];
+			struct si_images *images = &sctx->images[shader];
 			struct si_descriptors *descs =
 				si_sampler_and_image_descriptors(sctx, shader);
 			unsigned mask = images->enabled_mask;
 
 			while (mask) {
 				unsigned i = u_bit_scan(&mask);
 
 				if (images->views[i].resource == buf) {
 					unsigned desc_slot = si_get_image_slot(i);
 
@@ -1942,21 +1942,21 @@ static void si_update_all_resident_texture_descriptors(struct si_context *sctx)
 	si_upload_bindless_descriptors(sctx);
 }
 
 /* Update mutable image descriptor fields of all bound textures. */
 void si_update_all_texture_descriptors(struct si_context *sctx)
 {
 	unsigned shader;
 
 	for (shader = 0; shader < SI_NUM_SHADERS; shader++) {
 		struct si_sampler_views *samplers = &sctx->samplers[shader].views;
-		struct si_images_info *images = &sctx->images[shader];
+		struct si_images *images = &sctx->images[shader];
 		unsigned mask;
 
 		/* Images. */
 		mask = images->enabled_mask;
 		while (mask) {
 			unsigned i = u_bit_scan(&mask);
 			struct pipe_image_view *view = &images->views[i];
 
 			if (!view->resource ||
 			    view->resource->target == PIPE_BUFFER)
diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
index ed88aa0..212d163 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -174,27 +174,27 @@ struct si_sampler_state {
 };
 
 struct si_cs_shader_state {
 	struct si_compute		*program;
 	struct si_compute		*emitted_program;
 	unsigned			offset;
 	bool				initialized;
 	bool				uses_scratch;
 };
 
-struct si_textures_info {
+struct si_samplers {
 	struct si_sampler_views		views;
 	uint32_t			needs_depth_decompress_mask;
 	uint32_t			needs_color_decompress_mask;
 };
 
-struct si_images_info {
+struct si_images {
 	struct pipe_image_view		views[SI_NUM_IMAGES];
 	uint32_t			needs_color_decompress_mask;
 	unsigned			enabled_mask;
 };
 
 struct si_framebuffer {
 	struct r600_atom		atom;
 	struct pipe_framebuffer_state	state;
 	unsigned			colorbuf_enabled_4bit;
 	unsigned			spi_shader_col_format;
@@ -372,22 +372,22 @@ struct si_context {
 	bool				do_update_shaders;
 
 	/* shader descriptors */
 	struct si_descriptors		vertex_buffers;
 	struct si_descriptors		descriptors[SI_NUM_DESCS];
 	unsigned			descriptors_dirty;
 	unsigned			shader_pointers_dirty;
 	unsigned			shader_needs_decompress_mask;
 	struct si_buffer_resources	rw_buffers;
 	struct si_buffer_resources	const_and_shader_buffers[SI_NUM_SHADERS];
-	struct si_textures_info		samplers[SI_NUM_SHADERS];
-	struct si_images_info		images[SI_NUM_SHADERS];
+	struct si_samplers		samplers[SI_NUM_SHADERS];
+	struct si_images		images[SI_NUM_SHADERS];
 
 	/* other shader resources */
 	struct pipe_constant_buffer	null_const_buf; /* used for set_constant_buffer(NULL) on CIK */
 	struct pipe_resource		*esgs_ring;
 	struct pipe_resource		*gsvs_ring;
 	struct pipe_resource		*tf_ring;
 	struct pipe_resource		*tess_offchip_ring;
 	union pipe_color_union		*border_color_table; /* in CPU memory, any endian */
 	struct r600_resource		*border_color_buffer;
 	union pipe_color_union		*border_color_map; /* in VRAM (slow access), little endian */
-- 
2.7.4



More information about the mesa-dev mailing list