nir: pack the rest of nir_variable::data

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
This commit is contained in:
Marek Olšák 2019-10-25 15:21:30 -04:00
parent 442ef8c3e3
commit 96e6ef80d9
1 changed files with 34 additions and 33 deletions

View File

@ -62,6 +62,7 @@ extern "C" {
#define NIR_MAX_MATRIX_COLUMNS 4 #define NIR_MAX_MATRIX_COLUMNS 4
#define NIR_STREAM_PACKED (1 << 8) #define NIR_STREAM_PACKED (1 << 8)
typedef uint8_t nir_component_mask_t; typedef uint8_t nir_component_mask_t;
typedef unsigned short GLenum16;
/** Defines a cast function /** Defines a cast function
* *
@ -107,7 +108,7 @@ typedef enum {
nir_var_mem_ssbo = (1 << 7), nir_var_mem_ssbo = (1 << 7),
nir_var_mem_shared = (1 << 8), nir_var_mem_shared = (1 << 8),
nir_var_mem_global = (1 << 9), nir_var_mem_global = (1 << 9),
nir_var_all = ~0, nir_var_all = (1 << 10) - 1,
} nir_variable_mode; } nir_variable_mode;
/** /**
@ -314,7 +315,7 @@ typedef struct nir_variable {
* *
* \sa nir_variable_mode * \sa nir_variable_mode
*/ */
nir_variable_mode mode; nir_variable_mode mode:10;
/** /**
* Is the variable read-only? * Is the variable read-only?
@ -419,7 +420,32 @@ typedef struct nir_variable {
* This is not equal to \c ir_depth_layout_none if and only if this * 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. * 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 * Storage location of the base of this variable
@ -443,35 +469,10 @@ typedef struct nir_variable {
int location; int location;
/** /**
* The actual location of the variable in the IR. Only valid for inputs * The actual location of the variable in the IR. Only valid for inputs,
* and outputs. * outputs, and uniforms (including samplers and images).
*/ */
unsigned int driver_location; unsigned 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.
*/
unsigned binding;
/** /**
* Location an atomic counter or transform feedback is stored at. * Location an atomic counter or transform feedback is stored at.
@ -483,10 +484,10 @@ typedef struct nir_variable {
* ARB_shader_image_load_store qualifiers. * ARB_shader_image_load_store qualifiers.
*/ */
struct { struct {
enum gl_access_qualifier access; enum gl_access_qualifier access:8;
/** Image internal format if specified explicitly, otherwise GL_NONE. */ /** Image internal format if specified explicitly, otherwise GL_NONE. */
GLenum format; GLenum16 format;
} image; } image;
struct { struct {