[Mesa-dev] [PATCH v2] i965/vec4/nir: add nir_intrinsic_memory_barrier support

Francisco Jerez currojerez at riseup.net
Tue Sep 29 02:23:37 PDT 2015


Samuel Iglesias Gonsalvez <siglesias at igalia.com> writes:

> Fix OpenGL ES 3.1 conformance tests: advanced-readWrite-case1-vsfs
> and advanced-matrix-vsfs.
>
> v2:
> - Fix SHADER_OPCODE_MEMORY_FENCE emission and the allocation of 'tmp'
>   (Francisco).
>
> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias at igalia.com>
> Tested-by: Tapani Pälli <tapani.palli at intel.com>
> Cc: Francisco Jerez <currojerez at riseup.net>
> ---
>  src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
> index 94906d2..71a4dd2 100644
> --- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
> @@ -921,6 +921,15 @@ vec4_visitor::nir_emit_intrinsic(nir_intrinsic_instr *instr)
>        break;
>     }
>  
> +   case nir_intrinsic_memory_barrier: {
> +      const vec4_builder bld =
> +         vec4_builder(this).at_end().annotate(current_annotation, base_ir);
> +      dst_reg tmp = bld.vgrf(BRW_REGISTER_TYPE_UD, 2);

This could be declared const, with that fixed:

Reviewed-by: Francisco Jerez <currojerez at riseup.net>

> +      bld.emit(SHADER_OPCODE_MEMORY_FENCE, tmp)
> +         ->regs_written = 2;
> +      break;
> +   }
> +
>     default:
>        unreachable("Unknown intrinsic");
>     }
> -- 
> 2.1.4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150929/4d4b16ca/attachment.sig>


More information about the mesa-dev mailing list