summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Roberts <[email protected]>2017-12-12 17:09:19 +0100
committerAlejandro PiƱeiro <[email protected]>2018-07-31 13:18:28 +0200
commit3fd5b4c7aa467d160b9a57c47239d90950346aad (patch)
treee1ebcd30ca212801f78d1167b6c51acee498ac09
parente1d4882d05dab49395be459f34b1559292d5b6f6 (diff)
nir: Add members for the explicit XFB properties to nir_variable
These are copied from the from the corresponding values in ir_variable. The intention is to eventually use them in a pure-NIR linker. Reviewed-by: Timothy Arceri <[email protected]>
-rw-r--r--src/compiler/glsl/glsl_to_nir.cpp4
-rw-r--r--src/compiler/nir/nir.h27
2 files changed, 30 insertions, 1 deletions
diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp
index 2d76c7e6cfe..1e4d9f9d3c8 100644
--- a/src/compiler/glsl/glsl_to_nir.cpp
+++ b/src/compiler/glsl/glsl_to_nir.cpp
@@ -440,6 +440,10 @@ nir_visitor::visit(ir_variable *ir)
var->data.image.restrict_flag = ir->data.memory_restrict;
var->data.image.format = ir->data.image_format;
var->data.fb_fetch_output = ir->data.fb_fetch_output;
+ var->data.explicit_xfb_buffer = ir->data.explicit_xfb_buffer;
+ var->data.explicit_xfb_stride = ir->data.explicit_xfb_stride;
+ var->data.xfb_buffer = ir->data.xfb_buffer;
+ var->data.xfb_stride = ir->data.xfb_stride;
var->num_state_slots = ir->get_num_state_slots();
if (var->num_state_slots > 0) {
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 2ca92e8f34e..bca6a32c956 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -260,6 +260,21 @@ typedef struct nir_variable {
unsigned explicit_binding:1;
/**
+ * Was a transfer feedback buffer set in the shader?
+ */
+ unsigned explicit_xfb_buffer:1;
+
+ /**
+ * Was a transfer feedback stride set in the shader?
+ */
+ unsigned explicit_xfb_stride:1;
+
+ /**
+ * Was an explicit offset set in the shader?
+ */
+ unsigned explicit_offset:1;
+
+ /**
* \brief Layout qualifier for gl_FragDepth.
*
* This is not equal to \c ir_depth_layout_none if and only if this
@@ -320,11 +335,21 @@ typedef struct nir_variable {
int binding;
/**
- * Location an atomic counter is stored at.
+ * Location an atomic counter or transform feedback is stored at.
*/
unsigned offset;
/**
+ * Transform feedback buffer.
+ */
+ unsigned xfb_buffer;
+
+ /**
+ * Transform feedback stride.
+ */
+ unsigned xfb_stride;
+
+ /**
* ARB_shader_image_load_store qualifiers.
*/
struct {