summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_state.c
diff options
context:
space:
mode:
authorAxel Davy <axel.davy@ens.fr>2016-03-07 22:26:22 +0100
committerAxel Davy <axel.davy@ens.fr>2016-05-18 23:37:14 +0200
commit11e49871352cdb5d0fa5338a0be4995f7393b06f (patch)
treea6192b6e1f5611e663254b4a8bdf95be9a1f97d4 /src/gallium/drivers/radeonsi/si_state.c
parentfc3533c088d61888f5eae8e11fff2e1120d21777 (diff)
downloadexternal_mesa3d-11e49871352cdb5d0fa5338a0be4995f7393b06f.zip
external_mesa3d-11e49871352cdb5d0fa5338a0be4995f7393b06f.tar.gz
external_mesa3d-11e49871352cdb5d0fa5338a0be4995f7393b06f.tar.bz2
radeonsi: Mixed colorbuffer formats are unsupported
Besides depth/stencil, the hardware doesn't support mixed formats. The GL state tracker doesn't make use of them. Signed-off-by: Axel Davy <axel.davy@ens.fr> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 85d8509..aefa336 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -1145,6 +1145,11 @@ static uint32_t si_translate_colorformat(enum pipe_format format)
if (desc->layout != UTIL_FORMAT_LAYOUT_PLAIN)
return V_028C70_COLOR_INVALID;
+ /* hw cannot support mixed formats (except depth/stencil, since
+ * stencil is not written to). */
+ if (desc->is_mixed && desc->colorspace != UTIL_FORMAT_COLORSPACE_ZS)
+ return V_028C70_COLOR_INVALID;
+
switch (desc->nr_channels) {
case 1:
switch (desc->channel[0].size) {
@@ -1423,6 +1428,11 @@ static uint32_t si_translate_texformat(struct pipe_screen *screen,
/* R8G8Bx_SNORM - TODO CxV8U8 */
+ /* hw cannot support mixed formats (except depth/stencil, since only
+ * depth is read).*/
+ if (desc->is_mixed && desc->colorspace != UTIL_FORMAT_COLORSPACE_ZS)
+ goto out_unknown;
+
/* See whether the components are of the same size. */
for (i = 1; i < desc->nr_channels; i++) {
uniform = uniform && desc->channel[0].size == desc->channel[i].size;