diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-03-28 04:33:28 +0000 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-03-31 02:36:38 +0000 |
commit | c87f3ce97f69212d27ac830d5c37ac0f55e892f8 (patch) | |
tree | 03126c312c165c03197c68087b3e3300973edbdb | |
parent | 70b3e5db7d46b172a3f9d290cf7850bb6d797ea0 (diff) |
panfrost: Implement command stream for linear cubemaps
Signed-off-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r-- | src/gallium/drivers/panfrost/pan_context.c | 12 | ||||
-rw-r--r-- | 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); |