[Mesa-dev] [PATCH 2/3] radeonsi: return_INVALID if the color buffer is invalid

Marek Olšák maraeo at gmail.com
Wed Nov 14 13:04:04 PST 2012


I think this just hides a bug elsewhere. If a colorbuffer format is
unsupported, it should never appear in set_framebuffer_state. We
should add assert(format != ~0U) everywhere we use the return value of
si_translate_colorformat and fix any issue that leads to an assertion failure.

Marek

On Wed, Nov 14, 2012 at 8:14 PM,  <alexdeucher at gmail.com> wrote:
> From: Alex Deucher <alexander.deucher at amd.com>
>
> setting the CB format to Z_INVALID disables the color buffer.
>
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> ---
>  src/gallium/drivers/radeonsi/si_state.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
> index 1f76788..a41bcf0 100644
> --- a/src/gallium/drivers/radeonsi/si_state.c
> +++ b/src/gallium/drivers/radeonsi/si_state.c
> @@ -831,7 +831,7 @@ static uint32_t si_translate_colorformat(enum pipe_format format)
>         case PIPE_FORMAT_R4A4_UNORM:
>         case PIPE_FORMAT_A4R4_UNORM:
>         default:
> -               return ~0U; /* Unsupported. */
> +               return V_028C70_COLOR_INVALID; /* Unsupported. */
>         }
>  }
>
> @@ -1432,7 +1432,7 @@ static bool si_is_vertex_format_supported(struct pipe_screen *screen, enum pipe_
>
>  static bool si_is_colorbuffer_format_supported(enum pipe_format format)
>  {
> -       return si_translate_colorformat(format) != ~0U &&
> +       return si_translate_colorformat(format) != V_028C70_COLOR_INVALID &&
>                 si_translate_colorswap(format) != ~0U;
>  }
>
> --
> 1.7.7.5
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list