On Wed, May 1, 2019 at 12:30 AM Dave Airlie <[email protected]> wrote:
>
> From: Dave Airlie <[email protected]>
>
> If no view is bound we still should reset the override to 0
> and array mode.
>
> This should fix misrendering in firefox WebRender since
> the pbo sampler was removed.
>
> Fixes: 1250383e36 (st/mesa: remove sampler associated with buffer texture in
> pbo logic)
> ---
> src/gallium/drivers/r600/r600_state.c | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/src/gallium/drivers/r600/r600_state.c
> b/src/gallium/drivers/r600/r600_state.c
> index f86764f5220..86c1ca96e0f 100644
> --- a/src/gallium/drivers/r600/r600_state.c
> +++ b/src/gallium/drivers/r600/r600_state.c
> @@ -1839,16 +1839,16 @@ static void r600_emit_sampler_states(struct
> r600_context *rctx,
> * filtering between layers.
> * Don't update TEX_ARRAY_OVERRIDE if we don't have the
> sampler view.
> */
Probably want to update this comment... I guess the issue is a
transition of 2D_ARRAY -> nothing -> TBO. The sampler is unset at the
-> nothing transition but the TEX_ARRAY_OVERRIDE isn't reset since
rview is NULL at that point. And then when setting the TBO, the rview
exists, but this logic doesn't get hit since the sampler isn't dirty.
Seems right otherwise, keeping in mind that I know nothing about the HW itself.
> - if (rview) {
> - enum pipe_texture_target target =
> rview->base.texture->target;
> - if (target == PIPE_TEXTURE_1D_ARRAY ||
> - target == PIPE_TEXTURE_2D_ARRAY) {
> - rstate->tex_sampler_words[0] |=
> S_03C000_TEX_ARRAY_OVERRIDE(1);
> - texinfo->is_array_sampler[i] = true;
> - } else {
> - rstate->tex_sampler_words[0] &=
> C_03C000_TEX_ARRAY_OVERRIDE;
> - texinfo->is_array_sampler[i] = false;
> - }
> + enum pipe_texture_target target = PIPE_BUFFER;
> + if (rview)
> + target = rview->base.texture->target;
> + if (target == PIPE_TEXTURE_1D_ARRAY ||
> + target == PIPE_TEXTURE_2D_ARRAY) {
> + rstate->tex_sampler_words[0] |=
> S_03C000_TEX_ARRAY_OVERRIDE(1);
> + texinfo->is_array_sampler[i] = true;
> + } else {
> + rstate->tex_sampler_words[0] &=
> C_03C000_TEX_ARRAY_OVERRIDE;
> + texinfo->is_array_sampler[i] = false;
> }
>
> radeon_emit(cs, PKT3(PKT3_SET_SAMPLER, 3, 0));
> --
> 2.20.1
>
> _______________________________________________
> mesa-dev mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev