[Mesa-dev] [PATCH] i965/vec4: Only zero out unused message components when there are any.
Chris Forbes
chrisf at ijw.co.nz
Mon Sep 9 13:21:33 PDT 2013
Thanks Ken -- I should have spotted this but was being blind.
Does the GPU generally hang if the destination writemask has all
channels disabled? That sounds like something that could be worth
sanity-checking for in the backend.
Confirmed this fixes the hangs in the textureGather vs tests.
Reviewed-by: Chris Forbes <chrisf at ijw.co.nz>
On Tue, Sep 10, 2013 at 6:38 AM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> Otherwise, coordinates with four components would result in a MOV
> with a destination writemask that has no channels enabled:
>
> mov(8) g115<1>.F 0D { align16 WE_normal NoDDChk 1Q };
>
> At best, this is stupid: we emit code that shouldn't do anything.
> Worse, it apparently causes GPU hangs (observable with Chris's
> textureGather test on CubeArrays.)
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> Cc: Chris Forbes <chrisf at ijw.co.nz>
> Cc: mesa-stable at lists.freedesktop.org
> ---
> src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
> index ca52fd3..8cfe4e3 100644
> --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
> @@ -2245,8 +2245,10 @@ vec4_visitor::visit(ir_texture *ir)
> emit(MOV(dst_reg(MRF, param_base, ir->coordinate->type, coord_mask),
> coordinate));
> }
> - emit(MOV(dst_reg(MRF, param_base, ir->coordinate->type, zero_mask),
> - src_reg(0)));
> + if (zero_mask != 0) {
> + emit(MOV(dst_reg(MRF, param_base, ir->coordinate->type, zero_mask),
> + src_reg(0)));
> + }
> /* Load the shadow comparitor */
> if (ir->shadow_comparitor && ir->op != ir_txd) {
> emit(MOV(dst_reg(MRF, param_base + 1, ir->shadow_comparitor->type,
> --
> 1.8.3.4
>
More information about the mesa-dev
mailing list