From 119435c8778dd26cb7c8bcde9f04b3982239fe60 Mon Sep 17 00:00:00 2001
From: Kevin Rogovin <kevin.rogovin@intel.com>
Date: Mon, 27 Aug 2018 09:54:23 +0300
Subject: mesa: Add GL/GLSL plumbing for INTEL_fragment_shader_ordering

This extension provides new GLSL built-in function
beginFragmentShaderOrderingIntel() that guarantees
(taking wording of GL_INTEL_fragment_shader_ordering
extension) that any memory transactions issued by
shader invocations from previous primitives mapped to
same xy window coordinates (and same sample when
per-sample shading is active), complete and are visible
to the shader invocation that called
beginFragmentShaderOrderingINTEL().

One advantage of INTEL_fragment_shader_ordering over
ARB_fragment_shader_interlock is that it provides a
function that operates as a memory barrie (instead
of a defining a critcial section) that can be called
under arbitary control flow from any function (in
contrast the begin/end of ARB_fragment_shader_interlock
may only be called once, from main(), under no control
flow.

Signed-off-by: Kevin Rogovin <kevin.rogovin@intel.com>
Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
---
 src/compiler/nir/nir_intrinsics.py | 1 +
 1 file changed, 1 insertion(+)

(limited to 'src/compiler/nir')

diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py
index 8c9bc3bbc9a..67d336fd536 100644
--- a/src/compiler/nir/nir_intrinsics.py
+++ b/src/compiler/nir/nir_intrinsics.py
@@ -191,6 +191,7 @@ barrier("memory_barrier_image")
 barrier("memory_barrier_shared")
 barrier("begin_invocation_interlock")
 barrier("end_invocation_interlock")
+barrier("begin_fragment_shader_ordering")
 
 # A conditional discard, with a single boolean source.
 intrinsic("discard_if", src_comp=[1])
-- 
cgit v1.2.3