Mesa (master): panfrost: Implement command stream for linear cubemaps

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Mar 31 02:38:34 UTC 2019


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

Author: Alyssa Rosenzweig <alyssa at rosenzweig.io>
Date:   Thu Mar 28 04:33:28 2019 +0000

panfrost: Implement command stream for linear cubemaps

Signed-off-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>

---

 src/gallium/drivers/panfrost/pan_context.c  | 12 +++++++-----
 src/gallium/drivers/panfrost/pan_resource.c |  2 +-
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index afef5d01515..65019f8566e 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -1020,10 +1020,12 @@ panfrost_emit_for_draw(struct panfrost_context *ctx, bool with_vertex_data)
                                 struct pipe_resource *tex_rsrc = ctx->sampler_views[t][i]->base.texture;
                                 struct panfrost_resource *rsrc = (struct panfrost_resource *) tex_rsrc;
 
-                                /* Inject the address in. */
-                                for (int f = 0; f < tex_rsrc->array_size; ++f) {
-                                        for (int l = 0; l <= tex_rsrc->last_level; ++l) {
-                                                unsigned idx = f * (tex_rsrc->last_level + 1) + l;
+                                /* Inject the addresses in, interleaving cube
+                                 * faces and mip levels appropriately. */
+
+                                for (int l = 0; l <= tex_rsrc->last_level; ++l) {
+                                        for (int f = 0; f < tex_rsrc->array_size; ++f) {
+                                                unsigned idx = (l * tex_rsrc->array_size) + f;
 
                                                 ctx->sampler_views[t][i]->hw.swizzled_bitmaps[idx] =
                                                         rsrc->bo->gpu +
@@ -1958,7 +1960,7 @@ panfrost_create_sampler_view(
                         .format = format,
 
                         .usage1 = 0x0,
-                        .is_not_cubemap = 1,
+                        .is_not_cubemap = texture->target != PIPE_TEXTURE_CUBE,
 
                         .usage2 = usage2_layout
                 },
diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c
index a1285f21541..e217b358ecf 100644
--- a/src/gallium/drivers/panfrost/pan_resource.c
+++ b/src/gallium/drivers/panfrost/pan_resource.c
@@ -391,7 +391,7 @@ panfrost_transfer_map(struct pipe_context *pctx,
         transfer->base.usage = usage;
         transfer->base.box = *box;
         transfer->base.stride = bo->slices[level].stride;
-        transfer->base.layer_stride = bytes_per_pixel * resource->width0; /* TODO: Cubemaps */
+        transfer->base.layer_stride = bo->cubemap_stride;
 
         pipe_resource_reference(&transfer->base.resource, resource);
 




More information about the mesa-commit mailing list