i965/vec4/nir: add nir_intrinsic_memory_barrier support
authorSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Tue, 15 Sep 2015 09:16:29 +0000 (11:16 +0200)
committerSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Wed, 30 Sep 2015 06:13:07 +0000 (08:13 +0200)
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@igalia.com>
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/mesa/drivers/dri/i965/brw_vec4_nir.cpp

index 94906d2e70505d6d34d1221703edad9194531fce..2555038f2215d5f8286a8ab51d21557e18dca2d3 100644 (file)
@@ -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);
+      const dst_reg tmp = bld.vgrf(BRW_REGISTER_TYPE_UD, 2);
+      bld.emit(SHADER_OPCODE_MEMORY_FENCE, tmp)
+         ->regs_written = 2;
+      break;
+   }
+
    default:
       unreachable("Unknown intrinsic");
    }