diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-06-28 18:47:10 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-06-28 18:48:13 -0700 |
commit | f8fca4fe611de875fbac379430237e47ce054460 (patch) | |
tree | 7afc5d9767bcceddef23bd6279d97d9c89302d92 /src | |
parent | 7692ad19fb617b1d37486d50da3be4bf9c3b722d (diff) |
panfrost: Allow R11G11B10 rendering
Doesn't fully work yet, but better than crashing.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_mfbd.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/pan_screen.c | 13 |
2 files changed, 15 insertions, 4 deletions
diff --git a/src/gallium/drivers/panfrost/pan_mfbd.c b/src/gallium/drivers/panfrost/pan_mfbd.c index 91e04a34e80..b209ecbf580 100644 --- a/src/gallium/drivers/panfrost/pan_mfbd.c +++ b/src/gallium/drivers/panfrost/pan_mfbd.c @@ -81,10 +81,14 @@ panfrost_mfbd_format(struct pipe_surface *surf) /* Set flags for alternative formats */ - if (surf->texture->format == PIPE_FORMAT_B5G6R5_UNORM) { + if (surf->format == PIPE_FORMAT_B5G6R5_UNORM) { fmt.unk1 = 0x14000000; fmt.nr_channels = MALI_POSITIVE(2); fmt.unk3 |= 0x1; + } else if (surf->format == PIPE_FORMAT_R11G11B10_FLOAT) { + fmt.unk1 = 0x88000000; + fmt.unk3 = 0x0; + fmt.nr_channels = MALI_POSITIVE(4); } return fmt; diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c index ddb0b7f75fd..f8463d2b3f8 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -458,13 +458,20 @@ panfrost_is_format_supported( struct pipe_screen *screen, if (format == PIPE_FORMAT_A1B5G5R5_UNORM || format == PIPE_FORMAT_X1B5G5R5_UNORM) return FALSE; + /* Allow through special formats */ + + switch (format) { + case PIPE_FORMAT_R11G11B10_FLOAT: + case PIPE_FORMAT_B5G6R5_UNORM: + return TRUE; + default: + break; + } + if (bind & PIPE_BIND_RENDER_TARGET) { if (format_desc->colorspace == UTIL_FORMAT_COLORSPACE_ZS) return FALSE; - if (format == PIPE_FORMAT_B5G6R5_UNORM) - return TRUE; - /* Check for vaguely 8UNORM formats. Looser than * util_format_is_rgba8_variant, since it permits R8 (for * instance) */ |