[Mesa-dev] [PATCH] i965/fs: Allow array dereference of HW_REG.

Kenneth Graunke kenneth at whitecape.org
Wed Jun 4 08:00:09 PDT 2014


On Wednesday, June 04, 2014 09:06:31 PM Chris Forbes wrote:
> When dereferencing an element of gl_SampleMaskIn[], the source register
> here will be a HW_REG rather than a VGRF because the payload slot is
> now exposed directly.
> 
> Fixes an assertion failure in the Piglit test:
> 
>    tests/spec/arb_gpu_shader5/execution/samplemaskin-basic
> 
> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
> Cc: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  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 04b9f21..0b4fbb7 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
> @@ -189,7 +189,7 @@ fs_visitor::visit(ir_dereference_array *ir)
>     src.type = brw_type_for_base_type(ir->type);
>  
>     if (constant_index) {
> -      assert(src.file == UNIFORM || src.file == GRF);
> +      assert(src.file == UNIFORM || src.file == GRF || src.file == HW_REG);
>        src.reg_offset += constant_index->value.i[0] * element_size;
>     } else {
>        /* Variable index array dereference.  We attach the variable index
> 

Oops - thanks for fixing this!  Seems reasonable to me.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140604/a3ead439/attachment.sig>


More information about the mesa-dev mailing list