<div dir="auto">R-b for the series</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 13, 2019, 5:14 PM Samuel Pitoiset <<a href="mailto:samuel.pitoiset@gmail.com">samuel.pitoiset@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Instead of re-computing in the driver. The 3d and cube flags<br>
are correctly set, so the same values should returned by<br>
ac_compute_surface().<br>
<br>
Signed-off-by: Samuel Pitoiset <<a href="mailto:samuel.pitoiset@gmail.com" target="_blank" rel="noreferrer">samuel.pitoiset@gmail.com</a>><br>
---<br>
 src/amd/vulkan/radv_image.c | 45 +++----------------------------------<br>
 1 file changed, 3 insertions(+), 42 deletions(-)<br>
<br>
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c<br>
index d8dc2dfabde..909145e1e75 100644<br>
--- a/src/amd/vulkan/radv_image.c<br>
+++ b/src/amd/vulkan/radv_image.c<br>
@@ -885,10 +885,6 @@ radv_image_get_cmask_info(struct radv_device *device,<br>
                          struct radv_image *image,<br>
                          struct radv_cmask_info *out)<br>
 {<br>
-       unsigned pipe_interleave_bytes = device->physical_device->rad_info.pipe_interleave_bytes;<br>
-       unsigned num_pipes = device->physical_device->rad_info.num_tile_pipes;<br>
-       unsigned cl_width, cl_height;<br>
-<br>
        assert(image->plane_count == 1);<br>
<br>
        if (device->physical_device->rad_info.chip_class >= GFX9) {<br>
@@ -897,44 +893,9 @@ radv_image_get_cmask_info(struct radv_device *device,<br>
                return;<br>
        }<br>
<br>
-       switch (num_pipes) {<br>
-       case 2:<br>
-               cl_width = 32;<br>
-               cl_height = 16;<br>
-               break;<br>
-       case 4:<br>
-               cl_width = 32;<br>
-               cl_height = 32;<br>
-               break;<br>
-       case 8:<br>
-               cl_width = 64;<br>
-               cl_height = 32;<br>
-               break;<br>
-       case 16: /* Hawaii */<br>
-               cl_width = 64;<br>
-               cl_height = 64;<br>
-               break;<br>
-       default:<br>
-               assert(0);<br>
-               return;<br>
-       }<br>
-<br>
-       unsigned base_align = num_pipes * pipe_interleave_bytes;<br>
-<br>
-       unsigned width = align(image->planes[0].surface.u.legacy.level[0].nblk_x, cl_width*8);<br>
-       unsigned height = align(image->planes[0].surface.u.legacy.level[0].nblk_y, cl_height*8);<br>
-       unsigned slice_elements = (width * height) / (8*8);<br>
-<br>
-       /* Each element of CMASK is a nibble. */<br>
-       unsigned slice_bytes = slice_elements / 2;<br>
-<br>
-       out->slice_tile_max = (width * height) / (128*128);<br>
-       if (out->slice_tile_max)<br>
-               out->slice_tile_max -= 1;<br>
-<br>
-       out->alignment = MAX2(256, base_align);<br>
-       out->size = (image->type == VK_IMAGE_TYPE_3D ? image->info.depth : image->info.array_size) *<br>
-                   align(slice_bytes, base_align);<br>
+       out->slice_tile_max = image->planes[0].surface.u.legacy.cmask_slice_tile_max;<br>
+       out->alignment = image->planes[0].surface.cmask_alignment;<br>
+       out->size = image->planes[0].surface.cmask_size;<br>
 }<br>
<br>
 static void<br>
-- <br>
2.22.0<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank" rel="noreferrer">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a></blockquote></div>