Browse Source

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 <alyssa@rosenzweig.io>
tags/19.1-branchpoint
Alyssa Rosenzweig 6 years ago
parent
commit
fb3bbd0c1c

+ 23
- 4
src/gallium/drivers/panfrost/pan_resource.c View File

@@ -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,

+ 2
- 0
src/gallium/drivers/panfrost/pan_resource.h View File

@@ -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 *

Loading…
Cancel
Save