summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-02-15 23:59:58 +0000
committerAlyssa Rosenzweig <[email protected]>2019-02-21 06:58:50 +0000
commitfb3bbd0c1cc115d477ce13a8e0af1bba20624bda (patch)
treee567c545b9cca6a827a8082181517b3d518d2b92
parentedbd2c1ff559cde1d9e22a9fb9059747782a72a7 (diff)
panfrost: Stub out separate stencil functions
This is not yet functional, but it resolves a crash in various apps and provides a framework for further work. Signed-off-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r--src/gallium/drivers/panfrost/pan_resource.c27
-rw-r--r--src/gallium/drivers/panfrost/pan_resource.h2
2 files changed, 25 insertions, 4 deletions
diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c
index ce603dfac92..f26f33db96b 100644
--- a/src/gallium/drivers/panfrost/pan_resource.c
+++ b/src/gallium/drivers/panfrost/pan_resource.c
@@ -527,15 +527,34 @@ panfrost_invalidate_resource(struct pipe_context *pctx, struct pipe_resource *pr
//fprintf(stderr, "TODO %s\n", __func__);
}
+static enum pipe_format
+panfrost_resource_get_internal_format(struct pipe_resource *prsrc)
+{
+ return prsrc->format;
+}
+
+static void
+panfrost_resource_set_stencil(struct pipe_resource *prsrc,
+ struct pipe_resource *stencil)
+{
+ pan_resource(prsrc)->separate_stencil = pan_resource(stencil);
+}
+
+static struct pipe_resource *
+panfrost_resource_get_stencil(struct pipe_resource *prsrc)
+{
+ return &pan_resource(prsrc)->separate_stencil->base;
+}
+
static const struct u_transfer_vtbl transfer_vtbl = {
.resource_create = panfrost_resource_create,
.resource_destroy = panfrost_resource_destroy,
.transfer_map = panfrost_transfer_map,
.transfer_unmap = panfrost_transfer_unmap,
.transfer_flush_region = u_default_transfer_flush_region,
- //.get_internal_format = panfrost_resource_get_internal_format,
- //.set_stencil = panfrost_resource_set_stencil,
- //.get_stencil = panfrost_resource_get_stencil,
+ .get_internal_format = panfrost_resource_get_internal_format,
+ .set_stencil = panfrost_resource_set_stencil,
+ .get_stencil = panfrost_resource_get_stencil,
};
void
@@ -548,7 +567,7 @@ panfrost_resource_screen_init(struct panfrost_screen *pscreen)
pscreen->base.resource_from_handle = panfrost_resource_from_handle;
pscreen->base.resource_get_handle = panfrost_resource_get_handle;
pscreen->base.transfer_helper = u_transfer_helper_create(&transfer_vtbl,
- true, true,
+ true, false,
true, true);
pb_slabs_init(&pscreen->slabs,
diff --git a/src/gallium/drivers/panfrost/pan_resource.h b/src/gallium/drivers/panfrost/pan_resource.h
index dea2332dbfa..b0b5cc15a0c 100644
--- a/src/gallium/drivers/panfrost/pan_resource.h
+++ b/src/gallium/drivers/panfrost/pan_resource.h
@@ -76,6 +76,8 @@ struct panfrost_resource {
struct panfrost_bo *bo;
struct renderonly_scanout *scanout;
+
+ struct panfrost_resource *separate_stencil;
};
static inline struct panfrost_resource *