[Mesa-dev] [PATCH] i965/gen5: Fix crash with fragment programs and texture rectangle.

Kenneth Graunke kenneth at whitecape.org
Mon Nov 19 20:21:41 PST 2012


On 11/18/2012 03:05 PM, Eric Anholt wrote:
> This was a regression in the brw_fs_fp.cpp change.  We just need to return
> something good enough to get the visitor to the end without crashing, but
> ir->type isn't initialized and we wanted something of the coordinate's type
> anyway.
>
> Fixes around 30 piglit cases on my ilk system in drawpixels and framebuffer
> blit.
> ---
>   src/mesa/drivers/dri/i965/brw_fs_visitor.cpp |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
> index edadd35..1b797b5 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
> @@ -1175,7 +1175,7 @@ fs_visitor::rescale_texcoord(ir_texture *ir, fs_reg coordinate,
>
>         if (c->dispatch_width == 16) {
>   	 fail("rectangle scale uniform setup not supported on 16-wide\n");
> -	 return fs_reg(this, ir->type);
> +	 return coordinate;
>         }
>
>         scale_x = fs_reg(UNIFORM, c->prog_data.nr_params);

Uh...yeah.  fs_reg(this, ir->type) is awful...we want something of the 
coordinate's type, not the type of the texturing result.  Obvious 
improvement.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>



More information about the mesa-dev mailing list