nir: Add members for the explicit XFB properties to nir_variable
authorNeil Roberts <nroberts@igalia.com>
Tue, 12 Dec 2017 16:09:19 +0000 (17:09 +0100)
committerAlejandro Piñeiro <apinheiro@igalia.com>
Tue, 31 Jul 2018 11:18:28 +0000 (13:18 +0200)
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 <tarceri@itsqueeze.com>
src/compiler/glsl/glsl_to_nir.cpp
src/compiler/nir/nir.h

index 2d76c7e6cfec656c74f0b97913bd51f087aed018..1e4d9f9d3c83b0e8d3e5c0d07140434d6dd95a83 100644 (file)
@@ -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) {
index 2ca92e8f34e90d58b0f66497f074d51c37754bd7..bca6a32c95650d3ec55a034580eb6de7c857c77f 100644 (file)
@@ -259,6 +259,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.
        *
@@ -320,10 +335,20 @@ 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.
        */