mtypes: move gl_shader_variable to shader_types.h
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14437>
This commit is contained in:
parent
79834f4def
commit
a7b9b4086c
|
@ -2158,105 +2158,6 @@ struct gl_ati_fragment_shader_state
|
|||
struct ati_fragment_shader *Current;
|
||||
};
|
||||
|
||||
/**
|
||||
* Data container for shader queries. This holds only the minimal
|
||||
* amount of required information for resource queries to work.
|
||||
*/
|
||||
struct gl_shader_variable
|
||||
{
|
||||
/**
|
||||
* Declared type of the variable
|
||||
*/
|
||||
const struct glsl_type *type;
|
||||
|
||||
/**
|
||||
* If the variable is in an interface block, this is the type of the block.
|
||||
*/
|
||||
const struct glsl_type *interface_type;
|
||||
|
||||
/**
|
||||
* For variables inside structs (possibly recursively), this is the
|
||||
* outermost struct type.
|
||||
*/
|
||||
const struct glsl_type *outermost_struct_type;
|
||||
|
||||
/**
|
||||
* Declared name of the variable
|
||||
*/
|
||||
struct gl_resource_name name;
|
||||
|
||||
/**
|
||||
* Storage location of the base of this variable
|
||||
*
|
||||
* The precise meaning of this field depends on the nature of the variable.
|
||||
*
|
||||
* - Vertex shader input: one of the values from \c gl_vert_attrib.
|
||||
* - Vertex shader output: one of the values from \c gl_varying_slot.
|
||||
* - Geometry shader input: one of the values from \c gl_varying_slot.
|
||||
* - Geometry shader output: one of the values from \c gl_varying_slot.
|
||||
* - Fragment shader input: one of the values from \c gl_varying_slot.
|
||||
* - Fragment shader output: one of the values from \c gl_frag_result.
|
||||
* - Uniforms: Per-stage uniform slot number for default uniform block.
|
||||
* - Uniforms: Index within the uniform block definition for UBO members.
|
||||
* - Non-UBO Uniforms: explicit location until linking then reused to
|
||||
* store uniform slot number.
|
||||
* - Other: This field is not currently used.
|
||||
*
|
||||
* If the variable is a uniform, shader input, or shader output, and the
|
||||
* slot has not been assigned, the value will be -1.
|
||||
*/
|
||||
int location;
|
||||
|
||||
/**
|
||||
* Specifies the first component the variable is stored in as per
|
||||
* ARB_enhanced_layouts.
|
||||
*/
|
||||
unsigned component:2;
|
||||
|
||||
/**
|
||||
* Output index for dual source blending.
|
||||
*
|
||||
* \note
|
||||
* The GLSL spec only allows the values 0 or 1 for the index in \b dual
|
||||
* source blending.
|
||||
*/
|
||||
unsigned index:1;
|
||||
|
||||
/**
|
||||
* Specifies whether a shader input/output is per-patch in tessellation
|
||||
* shader stages.
|
||||
*/
|
||||
unsigned patch:1;
|
||||
|
||||
/**
|
||||
* Storage class of the variable.
|
||||
*
|
||||
* \sa (n)ir_variable_mode
|
||||
*/
|
||||
unsigned mode:4;
|
||||
|
||||
/**
|
||||
* Interpolation mode for shader inputs / outputs
|
||||
*
|
||||
* \sa glsl_interp_mode
|
||||
*/
|
||||
unsigned interpolation:2;
|
||||
|
||||
/**
|
||||
* Was the location explicitly set in the shader?
|
||||
*
|
||||
* If the location is explicitly set in the shader, it \b cannot be changed
|
||||
* by the linker or by the API (e.g., calls to \c glBindAttribLocation have
|
||||
* no effect).
|
||||
*/
|
||||
unsigned explicit_location:1;
|
||||
|
||||
/**
|
||||
* Precision qualifier.
|
||||
*/
|
||||
unsigned precision:2;
|
||||
};
|
||||
|
||||
#define GLSL_DUMP 0x1 /**< Dump shaders to stdout */
|
||||
#define GLSL_LOG 0x2 /**< Write shaders to files */
|
||||
#define GLSL_UNIFORMS 0x4 /**< Print glUniform calls */
|
||||
|
|
|
@ -914,4 +914,103 @@ struct gl_bindless_image
|
|||
GLvoid *data;
|
||||
};
|
||||
|
||||
/**
|
||||
* Data container for shader queries. This holds only the minimal
|
||||
* amount of required information for resource queries to work.
|
||||
*/
|
||||
struct gl_shader_variable
|
||||
{
|
||||
/**
|
||||
* Declared type of the variable
|
||||
*/
|
||||
const struct glsl_type *type;
|
||||
|
||||
/**
|
||||
* If the variable is in an interface block, this is the type of the block.
|
||||
*/
|
||||
const struct glsl_type *interface_type;
|
||||
|
||||
/**
|
||||
* For variables inside structs (possibly recursively), this is the
|
||||
* outermost struct type.
|
||||
*/
|
||||
const struct glsl_type *outermost_struct_type;
|
||||
|
||||
/**
|
||||
* Declared name of the variable
|
||||
*/
|
||||
struct gl_resource_name name;
|
||||
|
||||
/**
|
||||
* Storage location of the base of this variable
|
||||
*
|
||||
* The precise meaning of this field depends on the nature of the variable.
|
||||
*
|
||||
* - Vertex shader input: one of the values from \c gl_vert_attrib.
|
||||
* - Vertex shader output: one of the values from \c gl_varying_slot.
|
||||
* - Geometry shader input: one of the values from \c gl_varying_slot.
|
||||
* - Geometry shader output: one of the values from \c gl_varying_slot.
|
||||
* - Fragment shader input: one of the values from \c gl_varying_slot.
|
||||
* - Fragment shader output: one of the values from \c gl_frag_result.
|
||||
* - Uniforms: Per-stage uniform slot number for default uniform block.
|
||||
* - Uniforms: Index within the uniform block definition for UBO members.
|
||||
* - Non-UBO Uniforms: explicit location until linking then reused to
|
||||
* store uniform slot number.
|
||||
* - Other: This field is not currently used.
|
||||
*
|
||||
* If the variable is a uniform, shader input, or shader output, and the
|
||||
* slot has not been assigned, the value will be -1.
|
||||
*/
|
||||
int location;
|
||||
|
||||
/**
|
||||
* Specifies the first component the variable is stored in as per
|
||||
* ARB_enhanced_layouts.
|
||||
*/
|
||||
unsigned component:2;
|
||||
|
||||
/**
|
||||
* Output index for dual source blending.
|
||||
*
|
||||
* \note
|
||||
* The GLSL spec only allows the values 0 or 1 for the index in \b dual
|
||||
* source blending.
|
||||
*/
|
||||
unsigned index:1;
|
||||
|
||||
/**
|
||||
* Specifies whether a shader input/output is per-patch in tessellation
|
||||
* shader stages.
|
||||
*/
|
||||
unsigned patch:1;
|
||||
|
||||
/**
|
||||
* Storage class of the variable.
|
||||
*
|
||||
* \sa (n)ir_variable_mode
|
||||
*/
|
||||
unsigned mode:4;
|
||||
|
||||
/**
|
||||
* Interpolation mode for shader inputs / outputs
|
||||
*
|
||||
* \sa glsl_interp_mode
|
||||
*/
|
||||
unsigned interpolation:2;
|
||||
|
||||
/**
|
||||
* Was the location explicitly set in the shader?
|
||||
*
|
||||
* If the location is explicitly set in the shader, it \b cannot be changed
|
||||
* by the linker or by the API (e.g., calls to \c glBindAttribLocation have
|
||||
* no effect).
|
||||
*/
|
||||
unsigned explicit_location:1;
|
||||
|
||||
/**
|
||||
* Precision qualifier.
|
||||
*/
|
||||
unsigned precision:2;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue