[Mesa-dev] [PATCH] radv: only bind specified layer subset to color/depth buffers.

Dave Airlie airlied at gmail.com
Wed Sep 20 05:39:04 UTC 2017


From: Dave Airlie <airlied at redhat.com>

This just fixes something I saw while reading vega traces, but
since we never bind a 3D texture for rendering, we only ever
want to bind the sublevels here.

This causes no regressions on cts on tahiti.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/amd/vulkan/radv_device.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index e6d595d..a16472c 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -3016,9 +3016,8 @@ radv_initialise_color_surface(struct radv_device *device,
 	cb->cb_dcc_base = va >> 8;
 	cb->cb_dcc_base |= iview->image->surface.tile_swizzle;
 
-	uint32_t max_slice = radv_surface_layer_count(iview);
 	cb->cb_color_view = S_028C6C_SLICE_START(iview->base_layer) |
-		S_028C6C_SLICE_MAX(iview->base_layer + max_slice - 1);
+		S_028C6C_SLICE_MAX(iview->base_layer + iview->layer_count - 1);
 
 	if (iview->image->info.samples > 1) {
 		unsigned log_samples = util_logbase2(iview->image->info.samples);
@@ -3166,9 +3165,8 @@ radv_initialise_ds_surface(struct radv_device *device,
 	stencil_format = iview->image->surface.has_stencil ?
 		V_028044_STENCIL_8 : V_028044_STENCIL_INVALID;
 
-	uint32_t max_slice = radv_surface_layer_count(iview);
 	ds->db_depth_view = S_028008_SLICE_START(iview->base_layer) |
-		S_028008_SLICE_MAX(iview->base_layer + max_slice - 1);
+		S_028008_SLICE_MAX(iview->base_layer + iview->layer_count - 1);
 
 	ds->db_htile_data_base = 0;
 	ds->db_htile_surface = 0;
-- 
2.9.4



More information about the mesa-dev mailing list