[Mesa-dev] [PATCH 1/3] r600: Change default behaviour for undefined COLOR0

Marek Olšák maraeo at gmail.com
Sun Apr 3 17:37:01 UTC 2016


r600_state.c only applies to r600-r700. evergreen_state.c is for EG
and NI. Did you want to update that as well?

Marek

On Sun, Apr 3, 2016 at 10:11 AM, Axel Davy <axel.davy at ens.fr> wrote:
> d3d 9 needs COLOR0 to be 1.0 on all channels when
> undefined. 0.0 for the others is fine.
> GL behaviour is undefined.
>
> Signed-off-by: Axel Davy <axel.davy at ens.fr>
> ---
>  src/gallium/drivers/r600/r600_state.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c
> index 3189a13..d448d90 100644
> --- a/src/gallium/drivers/r600/r600_state.c
> +++ b/src/gallium/drivers/r600/r600_state.c
> @@ -2518,6 +2518,10 @@ void r600_update_ps_state(struct pipe_context *ctx, struct r600_pipe_shader *sha
>
>                 tmp = S_028644_SEMANTIC(sid);
>
> +               /* D3D 9 behaviour. GL is undefined */
> +               if (rshader->input[i].name == TGSI_SEMANTIC_COLOR && rshader->input[i].sid == 0)
> +                       tmp |= S_028644_DEFAULT_VAL(3);
> +
>                 if (rshader->input[i].name == TGSI_SEMANTIC_POSITION ||
>                         rshader->input[i].interpolate == TGSI_INTERPOLATE_CONSTANT ||
>                         (rshader->input[i].interpolate == TGSI_INTERPOLATE_COLOR &&
> --
> 2.7.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list