#define NIR_MAX_MATRIX_COLUMNS 4
#define NIR_STREAM_PACKED (1 << 8)
typedef uint8_t nir_component_mask_t;
+typedef unsigned short GLenum16;
/** Defines a cast function
*
nir_var_mem_ssbo = (1 << 7),
nir_var_mem_shared = (1 << 8),
nir_var_mem_global = (1 << 9),
- nir_var_all = ~0,
+ nir_var_all = (1 << 10) - 1,
} nir_variable_mode;
/**
*
* \sa nir_variable_mode
*/
- nir_variable_mode mode;
+ nir_variable_mode mode:10;
/**
* Is the variable read-only?
* This is not equal to \c ir_depth_layout_none if and only if this
* variable is \c gl_FragDepth and a layout qualifier is specified.
*/
- nir_depth_layout depth_layout;
+ nir_depth_layout depth_layout:3;
+
+ /**
+ * Vertex stream output identifier.
+ *
+ * For packed outputs, NIR_STREAM_PACKED is set and bits [2*i+1,2*i]
+ * indicate the stream of the i-th component.
+ */
+ unsigned stream:9;
+
+ /**
+ * output index for dual source blending.
+ */
+ unsigned index;
+
+ /**
+ * Descriptor set binding for sampler or UBO.
+ */
+ int descriptor_set:5;
+
+ /**
+ * Initial binding point for a sampler or UBO.
+ *
+ * For array types, this represents the binding point for the first element.
+ */
+ unsigned binding:5;
/**
* Storage location of the base of this variable
int location;
/**
- * The actual location of the variable in the IR. Only valid for inputs
- * and outputs.
- */
- unsigned int driver_location;
-
- /**
- * Vertex stream output identifier.
- *
- * For packed outputs, NIR_STREAM_PACKED is set and bits [2*i+1,2*i]
- * indicate the stream of the i-th component.
- */
- unsigned stream:9;
-
- /**
- * output index for dual source blending.
- */
- int index;
-
- /**
- * Descriptor set binding for sampler or UBO.
- */
- int descriptor_set;
-
- /**
- * Initial binding point for a sampler or UBO.
- *
- * For array types, this represents the binding point for the first element.
+ * The actual location of the variable in the IR. Only valid for inputs,
+ * outputs, and uniforms (including samplers and images).
*/
- unsigned binding;
+ unsigned driver_location;
/**
* Location an atomic counter or transform feedback is stored at.
* ARB_shader_image_load_store qualifiers.
*/
struct {
- enum gl_access_qualifier access;
+ enum gl_access_qualifier access:8;
/** Image internal format if specified explicitly, otherwise GL_NONE. */
- GLenum format;
+ GLenum16 format;
} image;
struct {