summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/panfrost
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu.vizoso@collabora.com>2020-01-02 16:44:18 +0100
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2020-01-02 12:41:17 -0500
commit829f338a592c711f3f588afea148db66c8b108c0 (patch)
tree49ef25e7313fd395232a75879b0866077207d145 /src/gallium/drivers/panfrost
parent14bc4c7cce6dccca6efed5207f7d38d5d654999a (diff)
panfrost: Store internal format
It's needed by u_transfer_helper to know when the depth+stencil buffer has been split. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Diffstat (limited to 'src/gallium/drivers/panfrost')
-rw-r--r--src/gallium/drivers/panfrost/pan_resource.c7
-rw-r--r--src/gallium/drivers/panfrost/pan_resource.h2
2 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c
index 1de9d5acf2d..0d49d2bb4f7 100644
--- a/src/gallium/drivers/panfrost/pan_resource.c
+++ b/src/gallium/drivers/panfrost/pan_resource.c
@@ -83,6 +83,7 @@ panfrost_resource_from_handle(struct pipe_screen *pscreen,
prsc->screen = pscreen;
rsc->bo = panfrost_bo_import(screen, whandle->handle);
+ rsc->internal_format = templat->format;
rsc->slices[0].stride = whandle->stride;
rsc->slices[0].offset = whandle->offset;
rsc->slices[0].initialized = true;
@@ -515,6 +516,7 @@ panfrost_resource_create(struct pipe_screen *screen,
so->base = *template;
so->base.screen = screen;
+ so->internal_format = template->format;
pipe_reference_init(&so->base.reference, 1);
@@ -755,8 +757,9 @@ panfrost_invalidate_resource(struct pipe_context *pctx, struct pipe_resource *pr
}
static enum pipe_format
-panfrost_resource_get_internal_format(struct pipe_resource *prsrc) {
- return prsrc->format;
+panfrost_resource_get_internal_format(struct pipe_resource *rsrc) {
+ struct panfrost_resource *prsrc = (struct panfrost_resource *) rsrc;
+ return prsrc->internal_format;
}
static bool
diff --git a/src/gallium/drivers/panfrost/pan_resource.h b/src/gallium/drivers/panfrost/pan_resource.h
index 0dcfbbd3a18..107c08dc628 100644
--- a/src/gallium/drivers/panfrost/pan_resource.h
+++ b/src/gallium/drivers/panfrost/pan_resource.h
@@ -83,6 +83,8 @@ struct panfrost_resource {
/* Is transaciton elimination enabled? */
bool checksummed;
+
+ enum pipe_format internal_format;
};
static inline struct panfrost_resource *