glsl/linker: Use canonical format for ARB_program_interface_query spec quotes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
@@ -3414,12 +3414,12 @@ should_add_buffer_variable(struct gl_shader_program *shProg,
|
|||||||
if (found_interface)
|
if (found_interface)
|
||||||
name = name + block_name_len + 1;
|
name = name + block_name_len + 1;
|
||||||
|
|
||||||
/* From: ARB_program_interface_query extension:
|
/* The ARB_program_interface_query spec says:
|
||||||
*
|
*
|
||||||
* "For an active shader storage block member declared as an array, an
|
* "For an active shader storage block member declared as an array, an
|
||||||
* entry will be generated only for the first array element, regardless
|
* entry will be generated only for the first array element, regardless
|
||||||
* of its type. For arrays of aggregate types, the enumeration rules are
|
* of its type. For arrays of aggregate types, the enumeration rules
|
||||||
* applied recursively for the single enumerated array element.
|
* are applied recursively for the single enumerated array element."
|
||||||
*/
|
*/
|
||||||
const char *struct_first_dot = strchr(name, '.');
|
const char *struct_first_dot = strchr(name, '.');
|
||||||
const char *first_square_bracket = strchr(name, '[');
|
const char *first_square_bracket = strchr(name, '[');
|
||||||
@@ -3585,19 +3585,20 @@ create_shader_variable(struct gl_shader_program *shProg,
|
|||||||
if (!out->name)
|
if (!out->name)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* From the ARB_program_interface_query specification:
|
/* The ARB_program_interface_query spec says:
|
||||||
*
|
*
|
||||||
* "Not all active variables are assigned valid locations; the
|
* "Not all active variables are assigned valid locations; the
|
||||||
* following variables will have an effective location of -1:
|
* following variables will have an effective location of -1:
|
||||||
*
|
*
|
||||||
* * uniforms declared as atomic counters;
|
* * uniforms declared as atomic counters;
|
||||||
*
|
*
|
||||||
* * members of a uniform block;
|
* * members of a uniform block;
|
||||||
*
|
*
|
||||||
* * built-in inputs, outputs, and uniforms (starting with "gl_"); and
|
* * built-in inputs, outputs, and uniforms (starting with "gl_"); and
|
||||||
*
|
*
|
||||||
* * inputs or outputs not declared with a "location" layout qualifier,
|
* * inputs or outputs not declared with a "location" layout
|
||||||
* except for vertex shader inputs and fragment shader outputs."
|
* qualifier, except for vertex shader inputs and fragment shader
|
||||||
|
* outputs."
|
||||||
*/
|
*/
|
||||||
if (in->type->base_type == GLSL_TYPE_ATOMIC_UINT ||
|
if (in->type->base_type == GLSL_TYPE_ATOMIC_UINT ||
|
||||||
is_gl_identifier(in->name) ||
|
is_gl_identifier(in->name) ||
|
||||||
@@ -3628,14 +3629,14 @@ add_shader_variable(struct gl_shader_program *shProg, unsigned stage_mask,
|
|||||||
|
|
||||||
switch (type->base_type) {
|
switch (type->base_type) {
|
||||||
case GLSL_TYPE_STRUCT: {
|
case GLSL_TYPE_STRUCT: {
|
||||||
/* From the ARB_program_interface_query specification:
|
/* The ARB_program_interface_query spec says:
|
||||||
*
|
*
|
||||||
* "For an active variable declared as a structure, a separate entry
|
* "For an active variable declared as a structure, a separate entry
|
||||||
* will be generated for each active structure member. The name of
|
* will be generated for each active structure member. The name of
|
||||||
* each entry is formed by concatenating the name of the structure,
|
* each entry is formed by concatenating the name of the structure,
|
||||||
* the "." character, and the name of the structure member. If a
|
* the "." character, and the name of the structure member. If a
|
||||||
* structure member to enumerate is itself a structure or array, these
|
* structure member to enumerate is itself a structure or array,
|
||||||
* enumeration rules are applied recursively."
|
* these enumeration rules are applied recursively."
|
||||||
*/
|
*/
|
||||||
unsigned field_location = location;
|
unsigned field_location = location;
|
||||||
for (unsigned i = 0; i < type->length; i++) {
|
for (unsigned i = 0; i < type->length; i++) {
|
||||||
@@ -3653,11 +3654,11 @@ add_shader_variable(struct gl_shader_program *shProg, unsigned stage_mask,
|
|||||||
}
|
}
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
/* From the ARB_program_interface_query specification:
|
/* The ARB_program_interface_query spec says:
|
||||||
*
|
*
|
||||||
* "For an active variable declared as a single instance of a basic
|
* "For an active variable declared as a single instance of a basic
|
||||||
* type, a single entry will be generated, using the variable name
|
* type, a single entry will be generated, using the variable name
|
||||||
* from the shader source."
|
* from the shader source."
|
||||||
*/
|
*/
|
||||||
gl_shader_variable *sha_v =
|
gl_shader_variable *sha_v =
|
||||||
create_shader_variable(shProg, var, name, type,
|
create_shader_variable(shProg, var, name, type,
|
||||||
@@ -3791,14 +3792,16 @@ get_top_level_name(const char *name)
|
|||||||
const char *first_dot = strchr(name, '.');
|
const char *first_dot = strchr(name, '.');
|
||||||
const char *first_square_bracket = strchr(name, '[');
|
const char *first_square_bracket = strchr(name, '[');
|
||||||
int name_size = 0;
|
int name_size = 0;
|
||||||
/* From ARB_program_interface_query spec:
|
|
||||||
|
/* The ARB_program_interface_query spec says:
|
||||||
*
|
*
|
||||||
* "For the property TOP_LEVEL_ARRAY_SIZE, a single integer identifying the
|
* "For the property TOP_LEVEL_ARRAY_SIZE, a single integer identifying
|
||||||
* number of active array elements of the top-level shader storage block
|
* the number of active array elements of the top-level shader storage
|
||||||
* member containing to the active variable is written to <params>. If the
|
* block member containing to the active variable is written to
|
||||||
* top-level block member is not declared as an array, the value one is
|
* <params>. If the top-level block member is not declared as an
|
||||||
* written to <params>. If the top-level block member is an array with no
|
* array, the value one is written to <params>. If the top-level block
|
||||||
* declared size, the value zero is written to <params>.
|
* member is an array with no declared size, the value zero is written
|
||||||
|
* to <params>."
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* The buffer variable is on top level.*/
|
/* The buffer variable is on top level.*/
|
||||||
@@ -3868,15 +3871,15 @@ static int
|
|||||||
get_array_size(struct gl_uniform_storage *uni, const glsl_struct_field *field,
|
get_array_size(struct gl_uniform_storage *uni, const glsl_struct_field *field,
|
||||||
char *interface_name, char *var_name)
|
char *interface_name, char *var_name)
|
||||||
{
|
{
|
||||||
/* From GL_ARB_program_interface_query spec:
|
/* The ARB_program_interface_query spec says:
|
||||||
*
|
*
|
||||||
* "For the property TOP_LEVEL_ARRAY_SIZE, a single integer
|
* "For the property TOP_LEVEL_ARRAY_SIZE, a single integer identifying
|
||||||
* identifying the number of active array elements of the top-level
|
* the number of active array elements of the top-level shader storage
|
||||||
* shader storage block member containing to the active variable is
|
* block member containing to the active variable is written to
|
||||||
* written to <params>. If the top-level block member is not
|
* <params>. If the top-level block member is not declared as an
|
||||||
* declared as an array, the value one is written to <params>. If
|
* array, the value one is written to <params>. If the top-level block
|
||||||
* the top-level block member is an array with no declared size,
|
* member is an array with no declared size, the value zero is written
|
||||||
* the value zero is written to <params>.
|
* to <params>."
|
||||||
*/
|
*/
|
||||||
if (is_top_level_shader_storage_block_member(uni->name,
|
if (is_top_level_shader_storage_block_member(uni->name,
|
||||||
interface_name,
|
interface_name,
|
||||||
@@ -3895,17 +3898,16 @@ get_array_stride(struct gl_uniform_storage *uni, const glsl_type *interface,
|
|||||||
const glsl_struct_field *field, char *interface_name,
|
const glsl_struct_field *field, char *interface_name,
|
||||||
char *var_name)
|
char *var_name)
|
||||||
{
|
{
|
||||||
/* From GL_ARB_program_interface_query:
|
/* The ARB_program_interface_query spec says:
|
||||||
*
|
*
|
||||||
* "For the property TOP_LEVEL_ARRAY_STRIDE, a single integer
|
* "For the property TOP_LEVEL_ARRAY_STRIDE, a single integer
|
||||||
* identifying the stride between array elements of the top-level
|
* identifying the stride between array elements of the top-level
|
||||||
* shader storage block member containing the active variable is
|
* shader storage block member containing the active variable is
|
||||||
* written to <params>. For top-level block members declared as
|
* written to <params>. For top-level block members declared as
|
||||||
* arrays, the value written is the difference, in basic machine
|
* arrays, the value written is the difference, in basic machine units,
|
||||||
* units, between the offsets of the active variable for
|
* between the offsets of the active variable for consecutive elements
|
||||||
* consecutive elements in the top-level array. For top-level
|
* in the top-level array. For top-level block members not declared as
|
||||||
* block members not declared as an array, zero is written to
|
* an array, zero is written to <params>."
|
||||||
* <params>."
|
|
||||||
*/
|
*/
|
||||||
if (field->type->is_array()) {
|
if (field->type->is_array()) {
|
||||||
const enum glsl_matrix_layout matrix_layout =
|
const enum glsl_matrix_layout matrix_layout =
|
||||||
|
Reference in New Issue
Block a user