Mesa (master): glsl: Add support for representing framebuffer fetch in the GLSL IR.

Francisco Jerez currojerez at kemper.freedesktop.org
Wed Aug 24 20:31:43 UTC 2016


Module: Mesa
Branch: master
Commit: b49d8f20f43ec429e6c17e7d92c7c2d3f926ee5e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b49d8f20f43ec429e6c17e7d92c7c2d3f926ee5e

Author: Francisco Jerez <currojerez at riseup.net>
Date:   Tue Jul 19 20:07:47 2016 -0700

glsl: Add support for representing framebuffer fetch in the GLSL IR.

The GLSL IR representation of framebuffer fetch amounts to a single
bit in the ir_variable object applicable to fragment shader outputs.
The flag indicates that the variable will be implicitly initialized to
the previous contents of the render buffer at the same fragment
coordinates and sample index.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/compiler/glsl/ir.cpp | 1 +
 src/compiler/glsl/ir.h   | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/src/compiler/glsl/ir.cpp b/src/compiler/glsl/ir.cpp
index 2aa4aff..4dadfd2 100644
--- a/src/compiler/glsl/ir.cpp
+++ b/src/compiler/glsl/ir.cpp
@@ -1686,6 +1686,7 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name,
    this->data.image_volatile = false;
    this->data.image_restrict = false;
    this->data.from_ssbo_unsized_array = false;
+   this->data.fb_fetch_output = false;
 
    if (type != NULL) {
       if (type->base_type == GLSL_TYPE_SAMPLER)
diff --git a/src/compiler/glsl/ir.h b/src/compiler/glsl/ir.h
index 68e774c..5e1e9bf 100644
--- a/src/compiler/glsl/ir.h
+++ b/src/compiler/glsl/ir.h
@@ -831,6 +831,14 @@ public:
       unsigned from_ssbo_unsized_array:1; /**< unsized array buffer variable. */
 
       unsigned implicit_sized_array:1;
+
+      /**
+       * Whether this is a fragment shader output implicitly initialized with
+       * the previous contents of the specified render target at the
+       * framebuffer location corresponding to this shader invocation.
+       */
+      unsigned fb_fetch_output:1;
+
       /**
        * Emit a warning if this variable is accessed.
        */




More information about the mesa-commit mailing list