[Mesa-dev] [PATCH 21/23] i965: Hook up image and memory barrier built-in translation to the GLSL visitor.

Francisco Jerez currojerez at riseup.net
Tue Apr 28 11:44:32 PDT 2015


---
 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp   | 15 +++++++++++++++
 src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 17 ++++++++++++++++-
 2 files changed, 31 insertions(+), 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 db4d42c..003b2b8 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -3177,6 +3177,21 @@ fs_visitor::visit(ir_call *ir)
        !strcmp("__intrinsic_atomic_predecrement", callee)) {
       brw::visit_atomic_counter_intrinsic(this, bld, ir);
 
+   } else if (!strcmp("__intrinsic_image_load", callee) ||
+              !strcmp("__intrinsic_image_store", callee) ||
+              !strcmp("__intrinsic_image_atomic_add", callee) ||
+              !strcmp("__intrinsic_image_atomic_min", callee) ||
+              !strcmp("__intrinsic_image_atomic_max", callee) ||
+              !strcmp("__intrinsic_image_atomic_and", callee) ||
+              !strcmp("__intrinsic_image_atomic_or", callee) ||
+              !strcmp("__intrinsic_image_atomic_xor", callee) ||
+              !strcmp("__intrinsic_image_atomic_exchange", callee) ||
+              !strcmp("__intrinsic_image_atomic_comp_swap", callee)) {
+      brw::visit_image_intrinsic(this, bld, ir);
+
+   } else if (!strcmp("__intrinsic_memory_barrier", callee)) {
+      brw::visit_barrier_intrinsic(this, bld, ir);
+
    } else {
       unreachable("Unsupported intrinsic.");
    }
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index 90cf583..93dc78e 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -2447,7 +2447,22 @@ vec4_visitor::visit(ir_call *ir)
        !strcmp("__intrinsic_atomic_predecrement", callee)) {
       brw::visit_atomic_counter_intrinsic(this, bld, ir);
 
-   } else {
+    } else if (!strcmp("__intrinsic_image_load", callee) ||
+              !strcmp("__intrinsic_image_store", callee) ||
+              !strcmp("__intrinsic_image_atomic_add", callee) ||
+              !strcmp("__intrinsic_image_atomic_min", callee) ||
+              !strcmp("__intrinsic_image_atomic_max", callee) ||
+              !strcmp("__intrinsic_image_atomic_and", callee) ||
+              !strcmp("__intrinsic_image_atomic_or", callee) ||
+              !strcmp("__intrinsic_image_atomic_xor", callee) ||
+              !strcmp("__intrinsic_image_atomic_exchange", callee) ||
+              !strcmp("__intrinsic_image_atomic_comp_swap", callee)) {
+      brw::visit_image_intrinsic(this, bld, ir);
+
+   } else if (!strcmp("__intrinsic_memory_barrier", callee)) {
+      brw::visit_barrier_intrinsic(this, bld, ir);
+
+  } else {
       unreachable("Unsupported intrinsic.");
    }
 }
-- 
2.3.5



More information about the mesa-dev mailing list