diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-07-01 09:44:40 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-07-10 06:12:03 -0700 |
commit | 21c863a695bfcb3c19ee1e1c84ecab67f49553eb (patch) | |
tree | ce1fea81b139ff4234b93c191b9e2ac6f429ee40 /src/gallium/drivers | |
parent | 36b3e7ea90ee275451184b287577f4b88962df81 (diff) |
panfrost/mfbd: Include codes for float framebuffers
We see the hardware doesn't actually support float framebuffers in the
native sense -- rather, it just allows higher bpp framebuffers and lets
a blend shader / additional clear_color fields sort out the formats.
This will be.. interesting.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_mfbd.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/gallium/drivers/panfrost/pan_mfbd.c b/src/gallium/drivers/panfrost/pan_mfbd.c index b435d20b758..72f938713b1 100644 --- a/src/gallium/drivers/panfrost/pan_mfbd.c +++ b/src/gallium/drivers/panfrost/pan_mfbd.c @@ -81,14 +81,41 @@ panfrost_mfbd_format(struct pipe_surface *surf) /* Set flags for alternative formats */ + bool float_16 = + surf->format == PIPE_FORMAT_R16_FLOAT; + + bool float_32 = + surf->format == PIPE_FORMAT_R11G11B10_FLOAT || + surf->format == PIPE_FORMAT_R32_FLOAT || + surf->format == PIPE_FORMAT_R16G16_FLOAT; + + bool float_64 = + surf->format == PIPE_FORMAT_R32G32_FLOAT || + surf->format == PIPE_FORMAT_R16G16B16A16_FLOAT; + + bool float_128 = + surf->format == PIPE_FORMAT_R32G32B32A32_FLOAT; + 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) { + } else if (float_32) { fmt.unk1 = 0x88000000; fmt.unk3 = 0x0; fmt.nr_channels = MALI_POSITIVE(4); + } else if (float_16) { + fmt.unk1 = 0x84000000; + fmt.unk3 = 0x0; + fmt.nr_channels = MALI_POSITIVE(2); + } else if (float_64) { + fmt.unk1 = 0x8c000000; + fmt.unk3 = 0x1; + fmt.nr_channels = MALI_POSITIVE(2); + } else if (float_128) { + fmt.unk1 = 0x90000000; + fmt.unk3 = 0x1; + fmt.nr_channels = MALI_POSITIVE(4); } return fmt; |