panfrost: Support RGB565 FBOs

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
This commit is contained in:
Alyssa Rosenzweig
2019-05-02 02:27:04 +00:00
parent f8c7ffa07a
commit 31f5a43bf0
4 changed files with 80 additions and 29 deletions

View File

@@ -416,16 +416,25 @@ panfrost_transfer_map(struct pipe_context *pctx,
*out_transfer = &transfer->base;
if (resource->bind & PIPE_BIND_DISPLAY_TARGET ||
resource->bind & PIPE_BIND_SCANOUT ||
resource->bind & PIPE_BIND_SHARED) {
/* Mipmapped readpixels?! */
assert(level == 0);
/* Check if we're bound for rendering and this is a read pixels. If so,
* we need to flush */
/* Force a flush -- kill the pipeline */
struct panfrost_context *ctx = pan_context(pctx);
struct pipe_framebuffer_state *fb = &ctx->pipe_framebuffer;
bool is_bound = false;
for (unsigned c = 0; c < fb->nr_cbufs; ++c) {
is_bound |= fb->cbufs[c]->texture == resource;
}
if (is_bound && (usage & PIPE_TRANSFER_READ)) {
assert(level == 0);
panfrost_flush(pctx, NULL, PIPE_FLUSH_END_OF_FRAME);
}
/* TODO: Respect usage flags */
if (usage & PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE) {
/* TODO: reallocate */
//printf("debug: Missed reallocate\n");