panfrost: Take into account texture layers in SFBD
authorTomeu Vizoso <tomeu.vizoso@collabora.com>
Tue, 5 Nov 2019 10:21:47 +0000 (11:21 +0100)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Wed, 6 Nov 2019 15:18:46 +0000 (16:18 +0100)
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_sfbd.c

index 2be48e7155f1a458127d59ce6d9508819a0f3c19..9fa806a8a1a1312751df261f7dcaee417edbd973 100644 (file)
@@ -130,14 +130,15 @@ panfrost_sfbd_set_cbuf(
         struct panfrost_resource *rsrc = pan_resource(surf->texture);
 
         unsigned level = surf->u.tex.level;
-        assert(surf->u.tex.first_layer == 0);
+        unsigned first_layer = surf->u.tex.first_layer;
+        assert(surf->u.tex.last_layer == first_layer);
+        signed stride = rsrc->slices[level].stride;
 
-        fb->format = panfrost_sfbd_format(surf);
+        mali_ptr base = panfrost_get_texture_address(rsrc, level, first_layer);
 
-        unsigned offset = rsrc->slices[level].offset;
-        signed stride = rsrc->slices[level].stride;
+        fb->format = panfrost_sfbd_format(surf);
 
-        fb->framebuffer = rsrc->bo->gpu + offset;
+        fb->framebuffer = base;
         fb->stride = stride;
 
         if (rsrc->layout == PAN_LINEAR)