Re: [Mesa-dev] abundance of branches in mesa.git
Ilia Mirkin imir...@alum.mit.edu writes: Hello, There are a *ton* of branches in the upstream mesa git. Here is a full list: [...] is there any reason to keep these around with the exception of: master $version (i.e. 9.0, 10.0, mesa_7_7_branch, etc) Instead of outright deleting old branches, it would be possible to set up an archive repository which mirrors all branches of the main repository. And then delete obsolete branches only from the main repository. Ideally, you would want a git hook to refuse to create a new branch (in the main repository) if a branch by that name already exists in the archive repository. Possibly with the exception that creating a same-named branch on the same commit would be allowed. (And the same for tags, of course) eirik ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 09/19] glsl: add helper for calculating size of AoA
--- src/glsl/glsl_types.h | 19 +++ 1 file changed, 19 insertions(+) diff --git a/src/glsl/glsl_types.h b/src/glsl/glsl_types.h index f54a939..c48977c 100644 --- a/src/glsl/glsl_types.h +++ b/src/glsl/glsl_types.h @@ -537,6 +537,25 @@ struct glsl_type { } /** +* Return the total number of elements in an array including the elements +* in arrays of arrays. +*/ + unsigned arrays_of_arrays_size() const + { + if (!is_array()) + return -1; + + unsigned size = length; + const glsl_type *base_type = fields.array; + + while (base_type-is_array()) { + size = size * base_type-length; + base_type = base_type-fields.array; + } + return size; + } + + /** * Return the amount of atomic counter storage required for a type. */ unsigned atomic_size() const -- 2.1.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 14/19] glsl: add support for sampler AoA with const index
--- src/mesa/program/sampler.cpp | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/mesa/program/sampler.cpp b/src/mesa/program/sampler.cpp index 34eee6d..0017328 100644 --- a/src/mesa/program/sampler.cpp +++ b/src/mesa/program/sampler.cpp @@ -87,7 +87,17 @@ public: if (ir-type-without_array()-is_record()) { this-name = ralloc_asprintf(mem_ctx, %s[%d], name, i); } else { -offset = i; + if (ir-type-is_array()) { +unsigned current_dim = 1; +const glsl_type *type = ir-type; +while (type-fields.array-is_array()) { + current_dim++; + type = type-fields.array; +} +offset += pow(ir-type-length, current_dim) * i; + } else { +offset += i; + } } return visit_continue; } -- 2.1.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 08/19] glsl: fix binding validation for interface blocks
V2: fix minor formating issue --- src/glsl/ast_to_hir.cpp | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 0d3cbac..f5e3570 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -2041,10 +2041,10 @@ validate_matrix_layout_for_type(struct _mesa_glsl_parse_state *state, static bool validate_binding_qualifier(struct _mesa_glsl_parse_state *state, YYLTYPE *loc, - ir_variable *var, + const glsl_type *type, const ast_type_qualifier *qual) { - if (var-data.mode != ir_var_uniform) { + if (!qual-flags.q.uniform) { _mesa_glsl_error(loc, state, the \binding\ qualifier only applies to uniforms); return false; @@ -2056,10 +2056,11 @@ validate_binding_qualifier(struct _mesa_glsl_parse_state *state, } const struct gl_context *const ctx = state-ctx; - unsigned elements = var-type-is_array() ? var-type-length : 1; + unsigned elements = type-is_array() ? type-length : 1; unsigned max_index = qual-binding + elements - 1; + const glsl_type *base_type = type-without_array(); - if (var-type-is_interface()) { + if (base_type-is_interface()) { /* UBOs. From page 60 of the GLSL 4.20 specification: * If the binding point for any uniform block instance is less than zero, * or greater than or equal to the implementation-dependent maximum @@ -2077,8 +2078,7 @@ validate_binding_qualifier(struct _mesa_glsl_parse_state *state, ctx-Const.MaxUniformBufferBindings); return false; } - } else if (var-type-is_sampler() || - (var-type-is_array() var-type-fields.array-is_sampler())) { + } else if (base_type-is_sampler()) { /* Samplers. From page 63 of the GLSL 4.20 specification: * If the binding is less than zero, or greater than or equal to the * implementation-dependent maximum supported number of units, a @@ -2095,7 +2095,7 @@ validate_binding_qualifier(struct _mesa_glsl_parse_state *state, return false; } - } else if (var-type-contains_atomic()) { + } else if (base_type-contains_atomic()) { assert(ctx-Const.MaxAtomicBufferBindings = MAX_COMBINED_ATOMIC_BUFFERS); if (unsigned(qual-binding) = ctx-Const.MaxAtomicBufferBindings) { _mesa_glsl_error(loc, state, layout(binding = %d) exceeds the @@ -2651,7 +2651,7 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, } if (qual-flags.q.explicit_binding - validate_binding_qualifier(state, loc, var, qual)) { + validate_binding_qualifier(state, loc, var-type, qual)) { var-data.explicit_binding = true; var-data.binding = qual-binding; } @@ -5752,6 +5752,8 @@ ast_interface_block::hir(exec_list *instructions, num_variables, packing, this-block_name); + if (this-layout.flags.q.explicit_binding) + validate_binding_qualifier(state, loc, block_type, this-layout); if (!state-symbols-add_interface(block_type-name, block_type, var_mode)) { YYLTYPE loc = this-get_location(); @@ -5849,6 +5851,10 @@ ast_interface_block::hir(exec_list *instructions, not allowed); } + if (this-layout.flags.q.explicit_binding) +validate_binding_qualifier(state, loc, block_array_type, + this-layout); + var = new(state) ir_variable(block_array_type, this-instance_name, var_mode); -- 2.1.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 05/19] glsl: update assert to support arrays of arrays
Reviewed-by: Ilia Mirkin imir...@alum.mit.edu --- src/glsl/glsl_types.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp index f675e90..3547561 100644 --- a/src/glsl/glsl_types.cpp +++ b/src/glsl/glsl_types.cpp @@ -1086,7 +1086,8 @@ glsl_type::std140_base_alignment(bool row_major) const this-fields.array-is_matrix()) { return MAX2(this-fields.array-std140_base_alignment(row_major), 16); } else { -assert(this-fields.array-is_record()); +assert(this-fields.array-is_record() || +this-fields.array-is_array()); return this-fields.array-std140_base_alignment(row_major); } } -- 2.1.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 12/19] nir: add support for sampler AoA with const index
--- src/glsl/nir/nir_lower_samplers.cpp | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/glsl/nir/nir_lower_samplers.cpp b/src/glsl/nir/nir_lower_samplers.cpp index c450198..a79b093 100644 --- a/src/glsl/nir/nir_lower_samplers.cpp +++ b/src/glsl/nir/nir_lower_samplers.cpp @@ -60,9 +60,23 @@ lower_sampler(nir_tex_instr *instr, const struct gl_shader_program *shader_progr if (instr-sampler == NULL) return; + /* Get number of array dimensions */ + unsigned num_dimensions = 1; + for (nir_deref *deref = instr-sampler-deref; +deref-child; deref = deref-child) { + if (deref-child-deref_type == nir_deref_type_array) { + nir_deref_array *deref_array = nir_deref_as_array(deref-child); + if (deref_array-deref.child +!deref-child-type-without_array()-is_record()) { +num_dimensions++; + } + } + } + /* Get the name and the offset */ instr-sampler_index = 0; char *name = ralloc_strdup(mem_ctx, instr-sampler-var-name); + unsigned curr_dim = num_dimensions; for (nir_deref *deref = instr-sampler-deref; deref-child; deref = deref-child) { @@ -78,8 +92,10 @@ lower_sampler(nir_tex_instr *instr, const struct gl_shader_program *shader_progr deref_array-deref_array_type == nir_deref_array_type_direct ? deref_array-base_offset : 0); } else { -assert(deref-child-type-base_type == GLSL_TYPE_SAMPLER); -instr-sampler_index = deref_array-base_offset; +/* calculate offset allowing for for arrays of arrays */ +instr-sampler_index += + pow(glsl_get_length(deref-type), --curr_dim) * + deref_array-base_offset; } /* XXX: We're assuming here that the indirect is the last array -- 2.1.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 15/19] mesa: store full array type in gl_uniform_storage
Previously only the type of a single array element was stored. _mesa_sampler_uniforms_pipeline_are_valid() was expecting to get the array type so this fixes a bug there. However the main reason for doing this is to use the array type for implementing arrays of arrays in glGetUniformLocation() --- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 5 +- src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 5 +- src/mesa/main/shader_query.cpp | 2 +- src/mesa/main/uniform_query.cpp| 64 ++ src/mesa/program/ir_to_mesa.cpp| 7 +-- 5 files changed, 45 insertions(+), 38 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index 59081ea..c67e56b 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp @@ -222,6 +222,7 @@ fs_visitor::nir_setup_uniform(nir_variable *var) unsigned index = var-data.driver_location; for (unsigned u = 0; u shader_prog-NumUniformStorage; u++) { struct gl_uniform_storage *storage = shader_prog-UniformStorage[u]; + const glsl_type *type = storage-type-without_array(); if (storage-builtin) continue; @@ -233,7 +234,7 @@ fs_visitor::nir_setup_uniform(nir_variable *var) continue; } - unsigned slots = storage-type-component_slots(); + unsigned slots = type-component_slots(); if (storage-array_elements) slots *= storage-array_elements; @@ -243,7 +244,7 @@ fs_visitor::nir_setup_uniform(nir_variable *var) } /* Make sure we actually initialized the right amount of stuff here. */ - assert(var-data.driver_location + var-type-component_slots() == index); + assert(var-data.driver_location + type-component_slots() == index); } void diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp index 0a76bde..92b6044 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp @@ -685,6 +685,7 @@ vec4_visitor::setup_uniform_values(ir_variable *ir) */ for (unsigned u = 0; u shader_prog-NumUniformStorage; u++) { struct gl_uniform_storage *storage = shader_prog-UniformStorage[u]; + const glsl_type *type = storage-type-without_array(); if (storage-builtin) continue; @@ -698,11 +699,11 @@ vec4_visitor::setup_uniform_values(ir_variable *ir) gl_constant_value *components = storage-storage; unsigned vector_count = (MAX2(storage-array_elements, 1) * - storage-type-matrix_columns); + type-matrix_columns); for (unsigned s = 0; s vector_count; s++) { assert(uniforms uniform_array_size); - uniform_vector_size[uniforms] = storage-type-vector_elements; + uniform_vector_size[uniforms] = type-vector_elements; int i; for (i = 0; i uniform_vector_size[uniforms]; i++) { diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp index a6246a3..807a95c 100644 --- a/src/mesa/main/shader_query.cpp +++ b/src/mesa/main/shader_query.cpp @@ -953,7 +953,7 @@ _mesa_program_resource_prop(struct gl_shader_program *shProg, case GL_TYPE: switch (res-Type) { case GL_UNIFORM: - *val = RESOURCE_UNI(res)-type-gl_type; + *val = RESOURCE_UNI(res)-type-without_array()-gl_type; return 1; case GL_PROGRAM_INPUT: case GL_PROGRAM_OUTPUT: diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp index cab5083..c8b0b58 100644 --- a/src/mesa/main/uniform_query.cpp +++ b/src/mesa/main/uniform_query.cpp @@ -320,9 +320,10 @@ _mesa_get_uniform(struct gl_context *ctx, GLuint program, GLint location, return; } + const glsl_type *uni_type = uni-type-without_array(); { - unsigned elements = (uni-type-is_sampler()) -? 1 : uni-type-components(); + unsigned elements = (uni_type-is_sampler()) +? 1 : uni_type-components(); /* Calculate the source base address *BEFORE* modifying elements to * account for the size of the user's buffer. @@ -348,14 +349,14 @@ _mesa_get_uniform(struct gl_context *ctx, GLuint program, GLint location, * just memcpy the data. If the types are not compatible, perform a * slower convert-and-copy process. */ - if (returnType == uni-type-base_type + if (returnType == uni_type-base_type || ((returnType == GLSL_TYPE_INT || returnType == GLSL_TYPE_UINT) - (uni-type-base_type == GLSL_TYPE_INT - || uni-type-base_type == GLSL_TYPE_UINT - || uni-type-base_type == GLSL_TYPE_SAMPLER - || uni-type-base_type == GLSL_TYPE_IMAGE))) { + (uni_type-base_type == GLSL_TYPE_INT + ||
[Mesa-dev] [PATCH 19/19] glsl: Allow arrays of arrays in GLSL ES 3.10 and GLSL 4.30
--- src/glsl/ast_to_hir.cpp | 13 - src/glsl/glsl_parser.yy | 22 ++ src/glsl/glsl_parser_extras.h | 5 + 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 6d2dc2e..81b2765 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -1939,12 +1939,15 @@ process_array_type(YYLTYPE *loc, const glsl_type *base, * * Only one-dimensional arrays may be declared. */ - if (!state-ARB_arrays_of_arrays_enable) { + if (!state-has_arrays_of_arrays()) { +const char *const requirement = state-es_shader + ? GLSL ES 310 + : GL_ARB_arrays_of_array or GLSL 430; _mesa_glsl_error(loc, state, - invalid array of `%s' - GL_ARB_arrays_of_arrays - required for defining arrays of arrays, - base-name); + invalid array of `%s' + %s required for defining arrays of arrays, + base-name, requirement); + return glsl_type::error_type; } } diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy index 1f08893..49c01f8 100644 --- a/src/glsl/glsl_parser.yy +++ b/src/glsl/glsl_parser.yy @@ -1856,10 +1856,13 @@ array_specifier: void *ctx = state; $$ = $1; - if (!state-ARB_arrays_of_arrays_enable) { - _mesa_glsl_error( @1, state, - GL_ARB_arrays_of_arrays - required for defining arrays of arrays); + if (!state-has_arrays_of_arrays()) { + const char *const requirement = state-es_shader +? GLSL ES 310 +: GL_ARB_arrays_of_array or GLSL 430; + _mesa_glsl_error( @1, state, + %s required for defining arrays of arrays., + requirement); } $$-add_dimension(new(ctx) ast_expression(ast_unsized_array_dim, NULL, NULL, NULL)); @@ -1868,10 +1871,13 @@ array_specifier: { $$ = $1; - if (!state-ARB_arrays_of_arrays_enable) { - _mesa_glsl_error( @1, state, - GL_ARB_arrays_of_arrays - required for defining arrays of arrays); + if (!state-has_arrays_of_arrays()) { + const char *const requirement = state-es_shader +? GLSL ES 310 +: GL_ARB_arrays_of_array or GLSL 430; + _mesa_glsl_error( @1, state, + %s required for defining arrays of arrays., + requirement); } $$-add_dimension($3); diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h index 9a0c24e..21182e4 100644 --- a/src/glsl/glsl_parser_extras.h +++ b/src/glsl/glsl_parser_extras.h @@ -190,6 +190,11 @@ struct _mesa_glsl_parse_state { return true; } + bool has_arrays_of_arrays() const + { + return ARB_arrays_of_arrays_enable || is_version(430, 310); + } + bool has_atomic_counters() const { return ARB_shader_atomic_counters_enable || is_version(420, 310); -- 2.1.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 16/19] glsl: add AoA support to resource name parsing
Updated to parse arrays of arrays and return the correct offset. We are now also validating the array subscript rather than potentially returning an offset that will be out of bounds. --- src/glsl/link_uniforms.cpp | 2 +- src/glsl/link_varyings.cpp | 7 +-- src/glsl/link_varyings.h| 3 +- src/glsl/linker.cpp | 108 src/glsl/program.h | 3 +- src/mesa/main/uniform_query.cpp | 2 +- 6 files changed, 97 insertions(+), 28 deletions(-) diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp index 6b6b197..38400d9 100644 --- a/src/glsl/link_uniforms.cpp +++ b/src/glsl/link_uniforms.cpp @@ -621,7 +621,7 @@ private: } this-uniforms[id].name = ralloc_strdup(this-uniforms, name); - this-uniforms[id].type = base_type; + this-uniforms[id].type = type; this-uniforms[id].initialized = 0; this-uniforms[id].num_driver_storage = 0; this-uniforms[id].driver_storage = NULL; diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp index 6cb55b3..d97af8f 100644 --- a/src/glsl/link_varyings.cpp +++ b/src/glsl/link_varyings.cpp @@ -292,7 +292,7 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog, */ void tfeedback_decl::init(struct gl_context *ctx, const void *mem_ctx, - const char *input) + const char *input, struct gl_shader_program *shProg) { /* We don't have to be pedantic about what is a valid GLSL variable name, * because any variable with an invalid name can't exist in the IR anyway. @@ -329,7 +329,8 @@ tfeedback_decl::init(struct gl_context *ctx, const void *mem_ctx, /* Parse a declaration. */ const char *base_name_end; - long subscript = parse_program_resource_name(input, base_name_end); + long subscript = parse_program_resource_name(input, base_name_end, +shProg); this-var_name = ralloc_strndup(mem_ctx, input, base_name_end - input); if (this-var_name == NULL) { _mesa_error_no_memory(__func__); @@ -574,7 +575,7 @@ parse_tfeedback_decls(struct gl_context *ctx, struct gl_shader_program *prog, char **varying_names, tfeedback_decl *decls) { for (unsigned i = 0; i num_names; ++i) { - decls[i].init(ctx, mem_ctx, varying_names[i]); + decls[i].init(ctx, mem_ctx, varying_names[i], prog); if (!decls[i].is_varying()) continue; diff --git a/src/glsl/link_varyings.h b/src/glsl/link_varyings.h index afc16a8..443d1ca 100644 --- a/src/glsl/link_varyings.h +++ b/src/glsl/link_varyings.h @@ -91,7 +91,8 @@ struct tfeedback_candidate class tfeedback_decl { public: - void init(struct gl_context *ctx, const void *mem_ctx, const char *input); + void init(struct gl_context *ctx, const void *mem_ctx, + const char *input, struct gl_shader_program *shProg); static bool is_same(const tfeedback_decl x, const tfeedback_decl y); bool assign_location(struct gl_context *ctx, struct gl_shader_program *prog); diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index 3494464..66d5706 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -377,18 +377,18 @@ linker_warning(gl_shader_program *prog, const char *fmt, ...) /** * Given a string identifying a program resource, break it into a base name - * and an optional array index in square brackets. + * and optional array indices in square brackets. * - * If an array index is present, \c out_base_name_end is set to point to the - * [ that precedes the array index, and the array index itself is returned - * as a long. + * If array indices are present, \c out_base_name_end is set to point to the + * [ that precedes the first array index, and the an array offset is + * returned as a long. * * If no array index is present (or if the array index is negative or * mal-formed), \c out_base_name_end, is set to point to the null terminator * at the end of the input string, and -1 is returned. * - * Only the final array index is parsed; if the string contains other array - * indices (or structure field accesses), they are left in the base name. + * Only the final array indices are parsed; if the string contains other array + * indices such as structure field accesses, they are left in the base name. * * No attempt is made to check that the base name is properly formed; * typically the caller will look up the base name in a hash table, so @@ -396,7 +396,8 @@ linker_warning(gl_shader_program *prog, const char *fmt, ...) */ long parse_program_resource_name(const GLchar *name, -const GLchar **out_base_name_end) +const GLchar **out_base_name_end, +struct gl_shader_program *shProg) { /* Section 7.3.1 (Program Interfaces) of the OpenGL 4.3 spec says: * @@ -406,31 +407,96 @@
[Mesa-dev] [PATCH 18/19] glsl: allow AoA to be sized by initializer or constructor
From Section 4.1.9 of the GLSL ES 3.10 spec: Arrays are sized either at compile-time or at run-time. To size an array at compile-time, either the size must be specified within the brackets as above or must be inferred from the type of the initializer. --- src/glsl/ast.h | 21 +++- src/glsl/ast_array_index.cpp | 7 ++-- src/glsl/ast_function.cpp| 33 +- src/glsl/ast_to_hir.cpp | 80 ++-- src/glsl/glsl_parser.yy | 11 +++--- 5 files changed, 107 insertions(+), 45 deletions(-) diff --git a/src/glsl/ast.h b/src/glsl/ast.h index 3f67907..0f9dbf9 100644 --- a/src/glsl/ast.h +++ b/src/glsl/ast.h @@ -181,6 +181,7 @@ enum ast_operators { ast_post_dec, ast_field_selection, ast_array_index, + ast_unsized_array_dim, ast_function_call, @@ -308,16 +309,7 @@ private: class ast_array_specifier : public ast_node { public: - /** Unsized array specifier ([]) */ - explicit ast_array_specifier(const struct YYLTYPE locp) - : is_unsized_array(true) - { - set_location(locp); - } - - /** Sized array specifier ([dim]) */ ast_array_specifier(const struct YYLTYPE locp, ast_expression *dim) - : is_unsized_array(false) { set_location(locp); array_dimensions.push_tail(dim-link); @@ -330,19 +322,14 @@ public: bool is_single_dimension() { - return (this-is_unsized_array this-array_dimensions.is_empty()) || - (!this-is_unsized_array - this-array_dimensions.tail_pred-prev != NULL - this-array_dimensions.tail_pred-prev-is_head_sentinel()); + return this-array_dimensions.tail_pred-prev != NULL + this-array_dimensions.tail_pred-prev-is_head_sentinel(); } virtual void print(void) const; - /* If true, this means that the array has an unsized outermost dimension. */ - bool is_unsized_array; - /* This list contains objects of type ast_node containing the -* sized dimensions only, in outermost-to-innermost order. +* array dimensions in outermost-to-innermost order. */ exec_list array_dimensions; }; diff --git a/src/glsl/ast_array_index.cpp b/src/glsl/ast_array_index.cpp index 752d86f..89c08d8 100644 --- a/src/glsl/ast_array_index.cpp +++ b/src/glsl/ast_array_index.cpp @@ -28,13 +28,10 @@ void ast_array_specifier::print(void) const { - if (this-is_unsized_array) { - printf([ ] ); - } - foreach_list_typed (ast_node, array_dimension, link, this-array_dimensions) { printf([ ); - array_dimension-print(); + if (((ast_expression*)array_dimension)-oper != ast_unsized_array_dim) + array_dimension-print(); printf(] ); } } diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp index 92e26bf..0906040 100644 --- a/src/glsl/ast_function.cpp +++ b/src/glsl/ast_function.cpp @@ -870,6 +870,7 @@ process_array_constructor(exec_list *instructions, } bool all_parameters_are_constant = true; + const glsl_type *element_type = constructor_type-fields.array; /* Type cast each parameter and, if possible, fold constants. */ foreach_in_list_safe(ir_rvalue, ir, actual_parameters) { @@ -896,12 +897,34 @@ process_array_constructor(exec_list *instructions, } } - if (result-type != constructor_type-fields.array) { + if (constructor_type-fields.array-is_unsized_array()) { + /* As the inner parameters of the constructor are created without + * knowledge of each other we need to check to make sure unsized + * parameters of unsized constructors all end up with the same size. + * + * e.g we make sure to fail for a constructor like this: + * vec4[][] a = vec4[][](vec4[](vec4(0.0), vec4(1.0)), + * vec4[](vec4(0.0), vec4(1.0), vec4(1.0)), + * vec4[](vec4(0.0), vec4(1.0))); + */ + if (element_type-is_unsized_array()) { + /* This is the first parameter so just get the type */ +element_type = result-type; + } else if (element_type != result-type) { +_mesa_glsl_error(loc, state, type error in array constructor: + expected: %s, found %s, + element_type-name, + result-type-name); +return ir_rvalue::error_value(ctx); + } + } else if (result-type != constructor_type-fields.array) { _mesa_glsl_error(loc, state, type error in array constructor: expected: %s, found %s, constructor_type-fields.array-name, result-type-name); return ir_rvalue::error_value(ctx); + } else { + element_type = result-type; } /* Attempt to convert the parameter to a constant valued expression. @@ -918,6 +941,14 @@
[Mesa-dev] [PATCH 17/19] mesa: add AoA support to active sampler conflict validation
--- src/mesa/main/uniform_query.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp index f7a5c87..3faf770 100644 --- a/src/mesa/main/uniform_query.cpp +++ b/src/mesa/main/uniform_query.cpp @@ -1113,7 +1113,7 @@ _mesa_sampler_uniforms_pipeline_are_valid(struct gl_pipeline_object *pipeline) active_samplers++; - const unsigned count = MAX2(1, storage-type-array_size()); + const unsigned count = MAX2(1, storage-array_elements); for (unsigned j = 0; j count; j++) { const unsigned unit = storage-storage[j].i; -- 2.1.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 11/19] nir: support uniform sampler AoA lookup
To do this we make sure to only append the array subscript to structs. --- src/glsl/nir/nir_lower_samplers.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/glsl/nir/nir_lower_samplers.cpp b/src/glsl/nir/nir_lower_samplers.cpp index 7a0b0a0..c450198 100644 --- a/src/glsl/nir/nir_lower_samplers.cpp +++ b/src/glsl/nir/nir_lower_samplers.cpp @@ -72,7 +72,8 @@ lower_sampler(nir_tex_instr *instr, const struct gl_shader_program *shader_progr assert(deref_array-deref_array_type != nir_deref_array_type_wildcard); - if (deref_array-deref.child) { + if (deref_array-deref.child +deref-child-type-without_array()-is_record()) { ralloc_asprintf_append(name, [%u], deref_array-deref_array_type == nir_deref_array_type_direct ? deref_array-base_offset : 0); -- 2.1.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 10/19] glsl: validate binding qualifier for AoA
--- src/glsl/ast_to_hir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index f5e3570..de13060 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -2056,7 +2056,7 @@ validate_binding_qualifier(struct _mesa_glsl_parse_state *state, } const struct gl_context *const ctx = state-ctx; - unsigned elements = type-is_array() ? type-length : 1; + unsigned elements = type-is_array() ? type-arrays_of_arrays_size() : 1; unsigned max_index = qual-binding + elements - 1; const glsl_type *base_type = type-without_array(); -- 2.1.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 13/19] glsl: support uniform sampler AoA lookup
To do this we make sure to only append the array subscript to structs. --- src/mesa/program/sampler.cpp | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/mesa/program/sampler.cpp b/src/mesa/program/sampler.cpp index ea3024d..34eee6d 100644 --- a/src/mesa/program/sampler.cpp +++ b/src/mesa/program/sampler.cpp @@ -38,14 +38,12 @@ class get_sampler_name : public ir_hierarchical_visitor { public: - get_sampler_name(ir_dereference *last, - struct gl_shader_program *shader_program) + get_sampler_name(struct gl_shader_program *shader_program) { this-mem_ctx = ralloc_context(NULL); this-shader_program = shader_program; this-name = NULL; this-offset = 0; - this-last = last; } ~get_sampler_name() @@ -86,7 +84,7 @@ public: and is unlikely to be supported for 1.10 in Mesa.\n); i = 0; } - if (ir != last) { + if (ir-type-without_array()-is_record()) { this-name = ralloc_asprintf(mem_ctx, %s[%d], name, i); } else { offset = i; @@ -98,7 +96,6 @@ public: const char *name; void *mem_ctx; int offset; - ir_dereference *last; }; @@ -107,7 +104,7 @@ _mesa_get_sampler_uniform_value(class ir_dereference *sampler, struct gl_shader_program *shader_program, const struct gl_program *prog) { - get_sampler_name getname(sampler, shader_program); + get_sampler_name getname(shader_program); GLuint shader = _mesa_program_enum_to_shader_stage(prog-Target); -- 2.1.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] ARB_arrays_of_arrays GLSL ES
Hi all, The restrictions in ES make the extension easier to implement so I thought I'd try get this stuff reviewed an committed before finishing up the full extension. The bits that I'm still working on for the desktop version are AoA inputs outputs, and interface blocks. The only thing I know is definatly missing in this series for ES is support for indirect indexing of samplers, but that didn't seem like something that should hold up the series. Once the SSBO series lands (with a patch that restricts unsized arrays) then all the AoA ES conformance tests will pass. There are already a bunch of piglit tests in git but I've just sent a series with all the patches still waiting review here: http://lists.freedesktop.org/archives/piglit/2015-June/016312.html I haven't made a patch marking this as done yet because currently the i965 backend takes a very long time trying to optimise some of the conformance tests. They still pass but they are taking 15-minutes+ just to compile so this really needs to be sorted out first. If someone with more knowledge in this area than me wants to take a look at this I would be greatful for being pointed in the right direction. If useful the series is in the 'gles4' branch of the repo here: https://github.com/tarceri/Mesa_arrays_of_arrays.git Thanks, Tim ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 07/19] glsl: allow precision qualifiers for AoA
--- src/glsl/ast_to_hir.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index f1c3e4a..0d3cbac 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -3881,9 +3881,7 @@ ast_declarator_list::hir(exec_list *instructions, * an array of that type. */ if (!(this-type-qualifier.precision == ast_precision_none - || precision_qualifier_allowed(var-type) - || (var-type-is_array() - precision_qualifier_allowed(var-type-fields.array { + || precision_qualifier_allowed(var-type-without_array( { _mesa_glsl_error(loc, state, precision qualifiers apply only to floating point -- 2.1.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [Nouveau] [PATCH v3 0/2] nouveau: support for custom VRAM domains
On 19/06/2015 19:27, Alexandre Courbot wrote: On Fri, Jun 19, 2015 at 9:38 PM, Ben Skeggs skeg...@gmail.com wrote: On 19 June 2015 at 21:51, Martin Peres martin.pe...@free.fr wrote: On 19/06/2015 13:02, Alexandre Courbot wrote: New revision of this patchset that prevents VRAM objects from being allocated on VRAM-less systems like Tegra. This is required for Mesa to work on such systems. Changes since v2: - Use vram_size to detect systems without VRAM and set the correct domain instead of expecting each chip to set its domain explicitly. This question may have been asked a ton of times, but what is the difference with the nvac (Ion)? Would the nvac have some reserved memory for its usage by the bios which would then be used as VRAM? PFB on the dGPU IGPs has facilities to fake VRAM from an area of stolen system memory reserved by the SBIOS. GK20A/GM20B do not do this, and require direct (or, via a mmu, whatever) access to system memory. Exactly. While dGPU do actually carve out a range of system memory to be exclusively used as fake VRAM, Tegra GPUs have access to the whole system memory which is shared with the other IPs of the SoC, which requires a different management strategy. Hence the choice to simply wipe out the concept of VRAM and use everything as system memory. Very well, thanks Ben and Alexandre! The series is: Reviewed-by: Martin Peres martin.pe...@free.fr ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 02/19] glsl: avoid hitting assert for arrays of arrays
Also add TODO comment about adding proper support Signed-off-by: Timothy Arceri t_arc...@yahoo.com.au --- src/glsl/ir_set_program_inouts.cpp | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/glsl/ir_set_program_inouts.cpp b/src/glsl/ir_set_program_inouts.cpp index b968a1e..01d84fe 100644 --- a/src/glsl/ir_set_program_inouts.cpp +++ b/src/glsl/ir_set_program_inouts.cpp @@ -184,6 +184,12 @@ ir_set_program_inouts_visitor::try_mark_partial_variable(ir_variable *var, type = type-fields.array; } + /* TODO: implement proper arrays of arrays support +* for now let the caller mark whole variable as used. +*/ + if (type-is_array() type-fields.array-is_array()) + return false; + /* The code below only handles: * * - Indexing into matrices -- 2.1.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 06/19] glsl: update types for unsized array members
Assigns a new array type based on the max access of unsized array members. Reviewed-by: Ilia Mirkin imir...@alum.mit.edu --- src/glsl/linker.cpp | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index 9978380..3494464 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -1217,8 +1217,7 @@ public: resize_interface_members(var-type-fields.array, var-get_max_ifc_array_access()); var-change_interface_type(new_type); -var-type = - glsl_type::get_array_instance(new_type, var-type-length); +var-type = update_interface_members_array(var-type, new_type); } } else if (const glsl_type *ifc_type = var-get_interface_type()) { /* Store a pointer to the variable in the unnamed_interfaces @@ -1266,6 +1265,21 @@ private: } } + static const glsl_type * + update_interface_members_array(const glsl_type *type, + const glsl_type *new_interface_type) + { + const glsl_type *element_type = type-fields.array; + if (element_type-is_array()) { + const glsl_type *new_array_type = +update_interface_members_array(element_type, new_interface_type); + return glsl_type::get_array_instance(new_array_type, type-length); + } else { + return glsl_type::get_array_instance(new_interface_type, + type-length); + } + } + /** * Determine whether the given interface type contains unsized arrays (if * it doesn't, array_sizing_visitor doesn't need to process it). -- 2.1.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 04/19] glsl: Add support for linking uniform arrays of arrays
--- src/glsl/link_uniform_initializers.cpp | 51 -- src/glsl/link_uniforms.cpp | 28 +++ 2 files changed, 52 insertions(+), 27 deletions(-) diff --git a/src/glsl/link_uniform_initializers.cpp b/src/glsl/link_uniform_initializers.cpp index 204acfa..6164bdd 100644 --- a/src/glsl/link_uniform_initializers.cpp +++ b/src/glsl/link_uniform_initializers.cpp @@ -100,6 +100,38 @@ copy_constant_to_storage(union gl_constant_value *storage, } void +copy_constant_array_to_storage(struct gl_uniform_storage *const storage, + const ir_constant *val, + unsigned int *idx, + unsigned int *array_elements, + unsigned int boolean_true) +{ + if (val-type-fields.array-is_array()) { + for (unsigned int i = 0; i val-type-length; i++) { + copy_constant_array_to_storage(storage, val-array_elements[i], +idx, array_elements, boolean_true); + } + } else { + const enum glsl_base_type base_type = +val-array_elements[0]-type-base_type; + const unsigned int elements = val-array_elements[0]-type-components(); + unsigned dmul = (base_type == GLSL_TYPE_DOUBLE) ? 2 : 1; + unsigned int length = MIN2(val-type-length, + (storage-array_elements - *array_elements)); + + for (unsigned int i = 0; i length; i++) { + copy_constant_to_storage( storage-storage[*idx], + val-array_elements[i], + base_type, + elements, + boolean_true); + *idx += elements * dmul; + *array_elements = *array_elements + 1; + } + } +} + +void set_sampler_binding(gl_shader_program *prog, const char *name, int binding) { struct gl_uniform_storage *const storage = @@ -178,7 +210,7 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog, field_constant = (ir_constant *)field_constant-next; } return; - } else if (type-is_array() type-fields.array-is_record()) { + } else if (type-without_array()-is_record()) { const glsl_type *const element_type = type-fields.array; for (unsigned int i = 0; i type-length; i++) { @@ -201,22 +233,11 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog, } if (val-type-is_array()) { - const enum glsl_base_type base_type = -val-array_elements[0]-type-base_type; - const unsigned int elements = val-array_elements[0]-type-components(); unsigned int idx = 0; - unsigned dmul = (base_type == GLSL_TYPE_DOUBLE) ? 2 : 1; + unsigned int array_elements = 0; - assert(val-type-length = storage-array_elements); - for (unsigned int i = 0; i storage-array_elements; i++) { -copy_constant_to_storage( storage-storage[idx], - val-array_elements[i], - base_type, - elements, - boolean_true); - -idx += elements * dmul; - } + copy_constant_array_to_storage(storage, val, idx, + array_elements, boolean_true); } else { copy_constant_to_storage(storage-storage, val, diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp index 11ae06f..6b6b197 100644 --- a/src/glsl/link_uniforms.cpp +++ b/src/glsl/link_uniforms.cpp @@ -49,8 +49,8 @@ values_for_type(const glsl_type *type) { if (type-is_sampler()) { return 1; - } else if (type-is_array() type-fields.array-is_sampler()) { - return type-array_size(); + } else if (type-is_array()) { + return type-array_size() * values_for_type(type-fields.array); } else { return type-component_slots(); } @@ -71,6 +71,7 @@ void program_resource_visitor::process(ir_variable *var) { const glsl_type *t = var-type; + const glsl_type *t_without_array = var-type-without_array(); const bool row_major = var-data.matrix_layout == GLSL_MATRIX_LAYOUT_ROW_MAJOR; @@ -136,7 +137,7 @@ program_resource_visitor::process(ir_variable *var) */ recursion(var-type, name, strlen(name), row_major, NULL, false); ralloc_free(name); - } else if (t-without_array()-is_record()) { + } else if (t_without_array-is_record()) { char *name = ralloc_strdup(NULL, var-name); recursion(var-type, name, strlen(name), row_major, NULL, false); ralloc_free(name); @@ -144,8 +145,8 @@ program_resource_visitor::process(ir_variable *var) char *name = ralloc_strdup(NULL, var-type-name); recursion(var-type, name, strlen(name), row_major, NULL, false); ralloc_free(name); - } else if (t-is_array() t-fields.array-is_interface()) { -
[Mesa-dev] [PATCH 01/19] glsl: calculate component size for arrays of arrays when varying packing disabled
Signed-off-by: Timothy Arceri t_arc...@yahoo.com.au Reviewed-by: Ilia Mirkin imir...@alum.mit.edu --- src/glsl/link_varyings.cpp | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp index 7b2d4bd..6cb55b3 100644 --- a/src/glsl/link_varyings.cpp +++ b/src/glsl/link_varyings.cpp @@ -876,9 +876,18 @@ varying_matches::record(ir_variable *producer_var, ir_variable *consumer_var) this-matches[this-num_matches].packing_order = this-compute_packing_order(var); if (this-disable_varying_packing) { - unsigned slots = var-type-is_array() - ? (var-type-length * var-type-fields.array-matrix_columns) - : var-type-matrix_columns; + unsigned slots; + if (var-type-is_array()) { + const glsl_type *type = var-type; + slots = 1; + while (type-is_array()) { +slots *= type-length; +type = type-fields.array; + } + slots *= type-matrix_columns; + } else { + slots = var-type-matrix_columns; + } this-matches[this-num_matches].num_components = 4 * slots; } else { this-matches[this-num_matches].num_components -- 2.1.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 03/19] glsl: dont allow gl_PerVertex to be redeclared as an array of arrays
V2: move single dimensionial array detection into a helper Signed-off-by: Timothy Arceri t_arc...@yahoo.com.au --- src/glsl/ast.h | 8 src/glsl/ast_to_hir.cpp | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/glsl/ast.h b/src/glsl/ast.h index ef74e51..3f67907 100644 --- a/src/glsl/ast.h +++ b/src/glsl/ast.h @@ -328,6 +328,14 @@ public: array_dimensions.push_tail(dim-link); } + bool is_single_dimension() + { + return (this-is_unsized_array this-array_dimensions.is_empty()) || + (!this-is_unsized_array + this-array_dimensions.tail_pred-prev != NULL + this-array_dimensions.tail_pred-prev-is_head_sentinel()); + } + virtual void print(void) const; /* If true, this means that the array has an unsized outermost dimension. */ diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 259e01e..f1c3e4a 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -5672,7 +5672,8 @@ ast_interface_block::hir(exec_list *instructions, _mesa_shader_stage_to_string(state-stage)); } if (this-instance_name == NULL || - strcmp(this-instance_name, gl_in) != 0 || this-array_specifier == NULL) { + strcmp(this-instance_name, gl_in) != 0 || this-array_specifier == NULL || + !this-array_specifier-is_single_dimension()) { _mesa_glsl_error(loc, state, gl_PerVertex input must be redeclared as gl_in[]); -- 2.1.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] Mesa 10.5.8
Mesa 10.5.8 is now available. This release contains nouveau and i965 driver fixes, along with a couple of patches for the libEGL library and a build fix for toolchains that don't support -Wl,--allow-multiple-definition. Ben Widawsky (1): i965: Disable compaction for EOT send messages Boyan Ding (1): egl/x11: Set version of swrastLoader to 2 Emil Velikov (3): docs: Add sha256sums for the 10.5.7 release Update version to 10.5.8 Add release notes for the 10.5.8 release Erik Faye-Lund (1): mesa: build xmlconfig to a separate static library Francisco Jerez (1): i965: Don't compact instructions with unmapped bits. Ilia Mirkin (3): nvc0/ir: fix collection of first uses for texture barrier insertion nv50,nvc0: clamp uniform size to 64k nvc0/ir: can't have a join on a load with an indirect source Jason Ekstrand (1): i965/fs: Don't let the EOT send message interfere with the MRF hack Marek Olšák (1): egl: fix setting context flags Roland Scheidegger (1): draw: (trivial) fix NULL pointer dereference git tag: mesa-10.5.8 ftp://ftp.freedesktop.org/pub/mesa/10.5.8/mesa-10.5.8.tar.gz MD5: bd8ecb8f2432a768cca116d072cbec10 mesa-10.5.8.tar.gz SHA1: 864cc4ed60e776bd545eb4638f667dcd7097bb46 mesa-10.5.8.tar.gz SHA256: 611ddcfa3c1bf13f7e6ccac785c8749c3b74c9a78452bac70f8372cf6b209aa0 mesa-10.5.8.tar.gz PGP: ftp://ftp.freedesktop.org/pub/mesa/10.5.8/mesa-10.5.8.tar.gz.sig ftp://ftp.freedesktop.org/pub/mesa/10.5.8/mesa-10.5.8.tar.xz MD5: 5332a3576c5e3a0c3947ee6668dd4157 mesa-10.5.8.tar.xz SHA1: f1b72b0ce0221429249485fd97f39775bc1148bf mesa-10.5.8.tar.xz SHA256: 2866b855c5299a4aed066338c77ff6467c389b2c30ada7647be8758663da2b54 mesa-10.5.8.tar.xz PGP: ftp://ftp.freedesktop.org/pub/mesa/10.5.8/mesa-10.5.8.tar.xz.sig -- -Emil signature.asc Description: OpenPGP digital signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] abundance of branches in mesa.git
Hi Ilia, oh, yes please. Especially since some people tend to completely mirror the mesa master repository including all those old branches. This sometimes creates quite a mess. Regards, Christian. On 20.06.2015 02:10, Ilia Mirkin wrote: Hello, There are a *ton* of branches in the upstream mesa git. Here is a full list: origin/10.0 origin/10.1 origin/10.2 origin/10.3 origin/10.4 origin/10.5 origin/10.6 origin/7.10 origin/7.11 origin/7.8 origin/7.8-gles origin/7.9 origin/8.0 origin/9.0 origin/9.1 origin/9.2 origin/965-glsl origin/965-ttm origin/HEAD - origin/master origin/R300_DRIVER origin/amdgpu origin/arb_copy_buffer origin/arb_fbo origin/arb_fbo_cleanup origin/arb_fbo_indirect origin/arb_geometry_shader4 origin/arb_half_float_vertex origin/arb_map_buffer_range origin/arb_robustness origin/arb_sampler_objects origin/arb_sync origin/arb_vertex_array_object origin/asm-shader-rework-1 origin/asm-shader-rework-2 origin/asm-shader-rework-3 origin/auto-cherry-for-8.0 origin/autoconf origin/broadwell origin/cxx-1-branch origin/d3d1x-addons origin/direct_state_access origin/draw-instanced origin/draw-ply origin/dri2-swapbuffers origin/drm-gem origin/egl-drm origin/embedded-1-branch origin/embedded-2-branch origin/experimental-1 origin/ext-provoking-vertex origin/flex-and-bison-required origin/floating origin/fp64_floor origin/frontbuffer-removal origin/gallium-0.1 origin/gallium-0.1-dri origin/gallium-0.1-dri2 origin/gallium-0.2 origin/gallium-array-textures origin/gallium-buffer-usage-cleanup origin/gallium-clip-state origin/gallium-compute origin/gallium-context-transfers-2 origin/gallium-cylindrical-wrap origin/gallium-double-opcodes origin/gallium-drm-driver-descriptor origin/gallium-dynamicstencilref origin/gallium-fb-dimensions origin/gallium-float--format origin/gallium-format-cleanup origin/gallium-front-ccw origin/gallium-gpu4-texture-opcodes origin/gallium-integer-opcodes origin/gallium-llvmpipe origin/gallium-mesa-7.4 origin/gallium-msaa origin/gallium-new-formats origin/gallium-newclear origin/gallium-no-nvidia-opcodes origin/gallium-no-rhw-position origin/gallium-no-texture-blanket origin/gallium-nopointsizeminmax origin/gallium-render-condition-predicate origin/gallium-resource-sampling origin/gallium-resources origin/gallium-sampler-view origin/gallium-softpipe-winsys origin/gallium-st-api origin/gallium-st-api-dri origin/gallium-stream-out origin/gallium-sw-api origin/gallium-tgsi-semantic-cleanup origin/gallium-userbuf origin/gallium-util-format-is-supported origin/gallium-vertexelementcso origin/gallium_draw_llvm origin/gallivm-call origin/glapi-reorg origin/gles3 origin/glsl-compiler-1 origin/glsl-continue-return origin/glsl-continue-return-7-5 origin/glsl-pp-rework-1 origin/glsl-pp-rework-2 origin/glsl-to-tgsi origin/glsl2 origin/glsl2-llvm origin/glsl2-lower-variable-indexing origin/graw-tests origin/hw_gl_select origin/i915tex-pageflip origin/i915tex-zone-rendering origin/i915tex_branch origin/i915tex_privbuffers origin/index-swtnl-0.1 origin/indirect-vbo origin/intel-2008-q3 origin/intel-2008-q4 origin/kasanen-post-process origin/kasanen-post-process-v2 origin/llvm-cliptest-viewport origin/llvm-context origin/llvmpipe-duma origin/llvmpipe-rast-64 origin/llvmpipe-wider-regs origin/loader-v4 origin/lp-line-rast origin/lp-offset-twoside origin/lp-setup-llvm origin/lp-surface-tiling origin/map-tex-branch origin/map-texture-image-v4 origin/map-texture-image-v5 origin/master origin/mesa origin/mesa_20040127_branch origin/mesa_20040309_branch origin/mesa_20050114_branch origin/mesa_3_2_dev origin/mesa_3_3_texture_env_combine2 origin/mesa_3_4_branch origin/mesa_4_0_branch origin/mesa_5_0_branch origin/mesa_6_0_branch origin/mesa_6_2_branch origin/mesa_6_4_branch origin/mesa_7_0_branch origin/mesa_7_2_branch origin/mesa_7_4_branch origin/mesa_7_4_idr_staging origin/mesa_7_5_branch origin/mesa_7_6_branch origin/mesa_7_7_branch origin/nv50-compiler origin/nvc0 origin/openchrome-branch origin/opengl-es origin/opengl-es-v2 origin/openvg-1.0 origin/outputswritten64 origin/pipe-video origin/primitive-restart origin/r300-bufmgr origin/r500-support origin/r6xx-r7xx-support origin/r6xx-rewrite origin/radeon-rewrite origin/remove-copyteximage-hook origin/remove-driver-date origin/remove-max-width origin/remove-max-width-2 origin/remove-redundant-helpers origin/renderbuffer-cleanups-v2 origin/shader-file-reorg origin/shader-work origin/softpipe_0_1_branch
Re: [Mesa-dev] [PATCH 16/19] glsl: add AoA support to resource name parsing
Grrr. Not sure how I missed it but this patch breaks transform feedback. It doesn't seem like a good idea to share this code between the two codepaths any more, seems like Paul had plains to use it in more places when it was added but it never happened. I'll send a version 2 of this patch tomorrow. On Sat, 2015-06-20 at 22:33 +1000, Timothy Arceri wrote: Updated to parse arrays of arrays and return the correct offset. We are now also validating the array subscript rather than potentially returning an offset that will be out of bounds. --- src/glsl/link_uniforms.cpp | 2 +- src/glsl/link_varyings.cpp | 7 +-- src/glsl/link_varyings.h| 3 +- src/glsl/linker.cpp | 108 src/glsl/program.h | 3 +- src/mesa/main/uniform_query.cpp | 2 +- 6 files changed, 97 insertions(+), 28 deletions(-) diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp index 6b6b197..38400d9 100644 --- a/src/glsl/link_uniforms.cpp +++ b/src/glsl/link_uniforms.cpp @@ -621,7 +621,7 @@ private: } this-uniforms[id].name = ralloc_strdup(this-uniforms, name); - this-uniforms[id].type = base_type; + this-uniforms[id].type = type; this-uniforms[id].initialized = 0; this-uniforms[id].num_driver_storage = 0; this-uniforms[id].driver_storage = NULL; diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp index 6cb55b3..d97af8f 100644 --- a/src/glsl/link_varyings.cpp +++ b/src/glsl/link_varyings.cpp @@ -292,7 +292,7 @@ cross_validate_outputs_to_inputs(struct gl_shader_program *prog, */ void tfeedback_decl::init(struct gl_context *ctx, const void *mem_ctx, - const char *input) + const char *input, struct gl_shader_program *shProg) { /* We don't have to be pedantic about what is a valid GLSL variable name, * because any variable with an invalid name can't exist in the IR anyway. @@ -329,7 +329,8 @@ tfeedback_decl::init(struct gl_context *ctx, const void *mem_ctx, /* Parse a declaration. */ const char *base_name_end; - long subscript = parse_program_resource_name(input, base_name_end); + long subscript = parse_program_resource_name(input, base_name_end, +shProg); this-var_name = ralloc_strndup(mem_ctx, input, base_name_end - input); if (this-var_name == NULL) { _mesa_error_no_memory(__func__); @@ -574,7 +575,7 @@ parse_tfeedback_decls(struct gl_context *ctx, struct gl_shader_program *prog, char **varying_names, tfeedback_decl *decls) { for (unsigned i = 0; i num_names; ++i) { - decls[i].init(ctx, mem_ctx, varying_names[i]); + decls[i].init(ctx, mem_ctx, varying_names[i], prog); if (!decls[i].is_varying()) continue; diff --git a/src/glsl/link_varyings.h b/src/glsl/link_varyings.h index afc16a8..443d1ca 100644 --- a/src/glsl/link_varyings.h +++ b/src/glsl/link_varyings.h @@ -91,7 +91,8 @@ struct tfeedback_candidate class tfeedback_decl { public: - void init(struct gl_context *ctx, const void *mem_ctx, const char *input); + void init(struct gl_context *ctx, const void *mem_ctx, + const char *input, struct gl_shader_program *shProg); static bool is_same(const tfeedback_decl x, const tfeedback_decl y); bool assign_location(struct gl_context *ctx, struct gl_shader_program *prog); diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index 3494464..66d5706 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -377,18 +377,18 @@ linker_warning(gl_shader_program *prog, const char *fmt, ...) /** * Given a string identifying a program resource, break it into a base name - * and an optional array index in square brackets. + * and optional array indices in square brackets. * - * If an array index is present, \c out_base_name_end is set to point to the - * [ that precedes the array index, and the array index itself is returned - * as a long. + * If array indices are present, \c out_base_name_end is set to point to the + * [ that precedes the first array index, and the an array offset is + * returned as a long. * * If no array index is present (or if the array index is negative or * mal-formed), \c out_base_name_end, is set to point to the null terminator * at the end of the input string, and -1 is returned. * - * Only the final array index is parsed; if the string contains other array - * indices (or structure field accesses), they are left in the base name. + * Only the final array indices are parsed; if the string contains other array + * indices such as structure field accesses, they are left in the base name. * * No attempt is made to check that the base name is properly formed; * typically the caller will look up
Re: [Mesa-dev] [PATCH 18/19] glsl: allow AoA to be sized by initializer or constructor
On Sat, 2015-06-20 at 22:33 +1000, Timothy Arceri wrote: From Section 4.1.9 of the GLSL ES 3.10 spec: Arrays are sized either at compile-time or at run-time. To size an array at compile-time, either the size must be specified within the brackets as above or must be inferred from the type of the initializer. --- src/glsl/ast.h | 21 +++- src/glsl/ast_array_index.cpp | 7 ++-- src/glsl/ast_function.cpp| 33 +- src/glsl/ast_to_hir.cpp | 80 ++-- src/glsl/glsl_parser.yy | 11 +++--- 5 files changed, 107 insertions(+), 45 deletions(-) diff --git a/src/glsl/ast.h b/src/glsl/ast.h index 3f67907..0f9dbf9 100644 --- a/src/glsl/ast.h +++ b/src/glsl/ast.h @@ -181,6 +181,7 @@ enum ast_operators { ast_post_dec, ast_field_selection, ast_array_index, + ast_unsized_array_dim, ast_function_call, @@ -308,16 +309,7 @@ private: class ast_array_specifier : public ast_node { public: - /** Unsized array specifier ([]) */ - explicit ast_array_specifier(const struct YYLTYPE locp) - : is_unsized_array(true) - { - set_location(locp); - } - - /** Sized array specifier ([dim]) */ ast_array_specifier(const struct YYLTYPE locp, ast_expression *dim) - : is_unsized_array(false) { set_location(locp); array_dimensions.push_tail(dim-link); @@ -330,19 +322,14 @@ public: bool is_single_dimension() { - return (this-is_unsized_array this-array_dimensions.is_empty()) || - (!this-is_unsized_array - this-array_dimensions.tail_pred-prev != NULL - this-array_dimensions.tail_pred-prev-is_head_sentinel()); + return this-array_dimensions.tail_pred-prev != NULL + this-array_dimensions.tail_pred-prev-is_head_sentinel(); } virtual void print(void) const; - /* If true, this means that the array has an unsized outermost dimension. */ - bool is_unsized_array; - /* This list contains objects of type ast_node containing the -* sized dimensions only, in outermost-to-innermost order. +* array dimensions in outermost-to-innermost order. */ exec_list array_dimensions; }; diff --git a/src/glsl/ast_array_index.cpp b/src/glsl/ast_array_index.cpp index 752d86f..89c08d8 100644 --- a/src/glsl/ast_array_index.cpp +++ b/src/glsl/ast_array_index.cpp @@ -28,13 +28,10 @@ void ast_array_specifier::print(void) const { - if (this-is_unsized_array) { - printf([ ] ); - } - foreach_list_typed (ast_node, array_dimension, link, this-array_dimensions) { printf([ ); - array_dimension-print(); + if (((ast_expression*)array_dimension)-oper != ast_unsized_array_dim) + array_dimension-print(); printf(] ); } } diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp index 92e26bf..0906040 100644 --- a/src/glsl/ast_function.cpp +++ b/src/glsl/ast_function.cpp @@ -870,6 +870,7 @@ process_array_constructor(exec_list *instructions, } bool all_parameters_are_constant = true; + const glsl_type *element_type = constructor_type-fields.array; /* Type cast each parameter and, if possible, fold constants. */ foreach_in_list_safe(ir_rvalue, ir, actual_parameters) { @@ -896,12 +897,34 @@ process_array_constructor(exec_list *instructions, } } - if (result-type != constructor_type-fields.array) { + if (constructor_type-fields.array-is_unsized_array()) { + /* As the inner parameters of the constructor are created without + * knowledge of each other we need to check to make sure unsized + * parameters of unsized constructors all end up with the same size. + * + * e.g we make sure to fail for a constructor like this: + * vec4[][] a = vec4[][](vec4[](vec4(0.0), vec4(1.0)), + * vec4[](vec4(0.0), vec4(1.0), vec4(1.0)), + * vec4[](vec4(0.0), vec4(1.0))); + */ + if (element_type-is_unsized_array()) { + /* This is the first parameter so just get the type */ +element_type = result-type; + } else if (element_type != result-type) { +_mesa_glsl_error(loc, state, type error in array constructor: + expected: %s, found %s, + element_type-name, + result-type-name); +return ir_rvalue::error_value(ctx); + } + } else if (result-type != constructor_type-fields.array) { _mesa_glsl_error(loc, state, type error in array constructor: expected: %s, found %s, constructor_type-fields.array-name, result-type-name); return ir_rvalue::error_value(ctx); + }
[Mesa-dev] [Bug 91038] X segfault when watching youtube
https://bugs.freedesktop.org/show_bug.cgi?id=91038 Chris Wilson ch...@chris-wilson.co.uk changed: What|Removed |Added Component|Other |Driver/intel Assignee|mesa-dev@lists.freedesktop. |ch...@chris-wilson.co.uk |org | Product|Mesa|xorg QA Contact|mesa-dev@lists.freedesktop. |intel-gfx-bugs@lists.freede |org |sktop.org -- You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 91039] [d3d9] D3D9 state tracker crashes due to stack misalignment if Mesa is compiled with -mfpmath=sse
https://bugs.freedesktop.org/show_bug.cgi?id=91039 Bug ID: 91039 Summary: [d3d9] D3D9 state tracker crashes due to stack misalignment if Mesa is compiled with -mfpmath=sse Product: Mesa Version: 10.6 Hardware: x86-64 (AMD64) OS: Linux (All) Status: NEW Severity: normal Priority: medium Component: Mesa core Assignee: mesa-dev@lists.freedesktop.org Reporter: xamaniqi...@gmail.com QA Contact: mesa-dev@lists.freedesktop.org Description: The Nine D3D9 state tracker crashes when Wine loads any D3D program if Mesa is compiled with -mfpmath=sse. This is because the Linux ABI assumes a stack alignment to 16 bytes, whereas the Win32 ABI assumes a stack alignment to 4 bytes. This causes a stack misalignment and thus a general protection fault. Additional information: Also see the following external bug reports: https://bugs.winehq.org/show_bug.cgi?id=22475 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40838 Specifications: OS: Gentoo GNU/Linux x86_64 Kernel version: Linux 4.0.4-hardened-r3 Mesa version: 10.6.0 Solution: The crashes no longer occur when Mesa's stack is realigned to 4 bytes. Therefore, always pass -mstackrealign to CFLAGS if -mfpmath=sse is enabled; this should probably be handled in the configure script. -- You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 91039] [d3d9] D3D9 state tracker crashes due to stack misalignment if Mesa is compiled with -mfpmath=sse
https://bugs.freedesktop.org/show_bug.cgi?id=91039 Itzamna xamaniqi...@gmail.com changed: What|Removed |Added CC||xamaniqi...@gmail.com -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 91038] X segfault when watching youtube
https://bugs.freedesktop.org/show_bug.cgi?id=91038 Bug ID: 91038 Summary: X segfault when watching youtube Product: Mesa Version: git Hardware: x86-64 (AMD64) OS: Linux (All) Status: NEW Severity: normal Priority: medium Component: Other Assignee: mesa-dev@lists.freedesktop.org Reporter: 19.jaime...@gmail.com QA Contact: mesa-dev@lists.freedesktop.org Created attachment 116620 -- https://bugs.freedesktop.org/attachment.cgi?id=116620action=edit AIGLX segfault I was watching youtube on fullscreen and X restarted. I got a segfault. -- You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 91039] [d3d9] D3D9 state tracker crashes due to stack misalignment if Mesa is compiled with -mfpmath=sse
https://bugs.freedesktop.org/show_bug.cgi?id=91039 --- Comment #1 from Itzamna xamaniqi...@gmail.com --- (In reply to Itzamna from comment #0) Solution: The crashes no longer occur when Mesa's stack is realigned to 4 bytes. Therefore, always pass -mstackrealign to CFLAGS if -mfpmath=sse is enabled; this should probably be handled in the configure script. Erratum: -mstackrealign realigns the incoming (4 byte-aligned) stack to 16 bytes, see https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html . -- You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 19/19] glsl: Allow arrays of arrays in GLSL ES 3.10 and GLSL 4.30
On Sat, 2015-06-20 at 19:35 -0400, Ilia Mirkin wrote: On Sat, Jun 20, 2015 at 8:33 AM, Timothy Arceri t_arc...@yahoo.com.au wrote: --- src/glsl/ast_to_hir.cpp | 13 - src/glsl/glsl_parser.yy | 22 ++ src/glsl/glsl_parser_extras.h | 5 + 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 6d2dc2e..81b2765 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -1939,12 +1939,15 @@ process_array_type(YYLTYPE *loc, const glsl_type *base, * * Only one-dimensional arrays may be declared. */ - if (!state-ARB_arrays_of_arrays_enable) { + if (!state-has_arrays_of_arrays()) { +const char *const requirement = state-es_shader + ? GLSL ES 310 + : GL_ARB_arrays_of_array or GLSL 430; I think everywhere I've seen it's GLSL ES 3.10 and GLSL 4.30. Also, it should be arrays_of_array*s* Thanks for pointing out the missing 's' I'll fix that, however it seems more common to use GLSL ES 310 and GLSL 430 see glsl_parser_extras.h. I could only find one instance of GLSL 4.30 in glsl_parser.yy I searched from 3.30-4.50 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 19/19] glsl: Allow arrays of arrays in GLSL ES 3.10 and GLSL 4.30
On Sat, Jun 20, 2015 at 11:38 PM, Timothy Arceri t_arc...@yahoo.com.au wrote: On Sat, 2015-06-20 at 19:35 -0400, Ilia Mirkin wrote: On Sat, Jun 20, 2015 at 8:33 AM, Timothy Arceri t_arc...@yahoo.com.au wrote: --- src/glsl/ast_to_hir.cpp | 13 - src/glsl/glsl_parser.yy | 22 ++ src/glsl/glsl_parser_extras.h | 5 + 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 6d2dc2e..81b2765 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -1939,12 +1939,15 @@ process_array_type(YYLTYPE *loc, const glsl_type *base, * * Only one-dimensional arrays may be declared. */ - if (!state-ARB_arrays_of_arrays_enable) { + if (!state-has_arrays_of_arrays()) { +const char *const requirement = state-es_shader + ? GLSL ES 310 + : GL_ARB_arrays_of_array or GLSL 430; I think everywhere I've seen it's GLSL ES 3.10 and GLSL 4.30. Also, it should be arrays_of_array*s* Thanks for pointing out the missing 's' I'll fix that, however it seems more common to use GLSL ES 310 and GLSL 430 see glsl_parser_extras.h. I could only find one instance of GLSL 4.30 in glsl_parser.yy I searched from 3.30-4.50 $ git grep -P 'GLSL (ES )?\d{3}' reveals just a handful of instances: src/gallium/drivers/freedreno/freedreno_screen.c: {glsl120, FD_DBG_GLSL120,Temporary flag to force GLSL 120 (rather than 130) on a3xx+}, src/glsl/glsl_parser_extras.h: const char *const requirement = GL_ARB_gpu_shader5 extension or GLSL 400; src/glsl/glsl_parser_extras.h:? GLSL ES 300 src/glsl/glsl_parser_extras.h:: GL_ARB_explicit_attrib_location extension or GLSL 330; src/glsl/glsl_parser_extras.h:? GL_EXT_separate_shader_objects extension or GLSL ES 310 src/glsl/glsl_parser_extras.h:: GL_ARB_separate_shader_objects extension or GLSL 420; src/glsl/glsl_parser_extras.h:? GLSL ES 310 src/glsl/glsl_parser_extras.h: GL_ARB_explicit_attrib_location or GLSL 330.; Which IMHO should be fixed. Compare that to $ git grep -P 'GLSL (ES )?\d{1}\.\d{2}' src | wc -l 286 Most of which come from comments... I guess there are just a few that end up in user strings: src/glsl/ast_array_index.cpp: expressions will be forbidden in GLSL 1.30 src/glsl/ast_array_index.cpp:expressions is forbidden in GLSL 1.30 and src/glsl/ast_to_hir.cpp: function `%s' in GLSL ES 3.00, name); src/glsl/ast_to_hir.cpp: not allowed in GLSL ES 1.00); src/glsl/glsl_parser.yy:(GLSL ES 1.00 or GLSL 1.20 required), src/glsl/glsl_parser.yy:%s qualifier requires GLSL 4.30 or src/glsl/glsl_parser_extras.cpp: GLSL 1.00 ES should be selected using The version strings reported also have the . in them: const char * glsl_compute_version_string(void *mem_ctx, bool is_es, unsigned version) { return ralloc_asprintf(mem_ctx, GLSL%s %d.%02d, is_es ? ES : , version / 100, version % 100); } IMHO it'd be better to standardize on one thing. -ilia ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 19/19] glsl: Allow arrays of arrays in GLSL ES 3.10 and GLSL 4.30
On Sat, Jun 20, 2015 at 8:33 AM, Timothy Arceri t_arc...@yahoo.com.au wrote: --- src/glsl/ast_to_hir.cpp | 13 - src/glsl/glsl_parser.yy | 22 ++ src/glsl/glsl_parser_extras.h | 5 + 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 6d2dc2e..81b2765 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -1939,12 +1939,15 @@ process_array_type(YYLTYPE *loc, const glsl_type *base, * * Only one-dimensional arrays may be declared. */ - if (!state-ARB_arrays_of_arrays_enable) { + if (!state-has_arrays_of_arrays()) { +const char *const requirement = state-es_shader + ? GLSL ES 310 + : GL_ARB_arrays_of_array or GLSL 430; I think everywhere I've seen it's GLSL ES 3.10 and GLSL 4.30. Also, it should be arrays_of_array*s* _mesa_glsl_error(loc, state, - invalid array of `%s' - GL_ARB_arrays_of_arrays - required for defining arrays of arrays, - base-name); + invalid array of `%s' + %s required for defining arrays of arrays, + base-name, requirement); + return glsl_type::error_type; } } diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy index 1f08893..49c01f8 100644 --- a/src/glsl/glsl_parser.yy +++ b/src/glsl/glsl_parser.yy @@ -1856,10 +1856,13 @@ array_specifier: void *ctx = state; $$ = $1; - if (!state-ARB_arrays_of_arrays_enable) { - _mesa_glsl_error( @1, state, - GL_ARB_arrays_of_arrays - required for defining arrays of arrays); + if (!state-has_arrays_of_arrays()) { + const char *const requirement = state-es_shader +? GLSL ES 310 +: GL_ARB_arrays_of_array or GLSL 430; Same as above. + _mesa_glsl_error( @1, state, + %s required for defining arrays of arrays., + requirement); } $$-add_dimension(new(ctx) ast_expression(ast_unsized_array_dim, NULL, NULL, NULL)); @@ -1868,10 +1871,13 @@ array_specifier: { $$ = $1; - if (!state-ARB_arrays_of_arrays_enable) { - _mesa_glsl_error( @1, state, - GL_ARB_arrays_of_arrays - required for defining arrays of arrays); + if (!state-has_arrays_of_arrays()) { + const char *const requirement = state-es_shader +? GLSL ES 310 +: GL_ARB_arrays_of_array or GLSL 430; and again. + _mesa_glsl_error( @1, state, + %s required for defining arrays of arrays., + requirement); } $$-add_dimension($3); diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h index 9a0c24e..21182e4 100644 --- a/src/glsl/glsl_parser_extras.h +++ b/src/glsl/glsl_parser_extras.h @@ -190,6 +190,11 @@ struct _mesa_glsl_parse_state { return true; } + bool has_arrays_of_arrays() const + { + return ARB_arrays_of_arrays_enable || is_version(430, 310); + } + bool has_atomic_counters() const { return ARB_shader_atomic_counters_enable || is_version(420, 310); -- 2.1.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 78318] [swrast] piglit glsl-kwin-blur-1 regression
https://bugs.freedesktop.org/show_bug.cgi?id=78318 Vinson Lee v...@freedesktop.org changed: What|Removed |Added Version|git |10.2 --- Comment #5 from Vinson Lee v...@freedesktop.org --- mesa: 717376155d2082d7bf94122a1e1d383b39e0b070 (master 10.7.0-devel) piglit glsl-kwin-blur-1 regression is still present. -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 86980] [swrast] piglit fp-rfl regression
https://bugs.freedesktop.org/show_bug.cgi?id=86980 Vinson Lee v...@freedesktop.org changed: What|Removed |Added Status|NEW |RESOLVED Version|git |10.5 Resolution|--- |FIXED --- Comment #8 from Vinson Lee v...@freedesktop.org --- commit 88305dfd0b79ad5980d293e86712496f134347b4 Author: Roland Scheidegger srol...@vmware.com Date: Sat Feb 14 16:34:04 2015 +0100 mesa: don't enable NV_fragment_program_option with swrast Since dropping some NV_fragment_program opcodes (commits 868f95f1da74cf6dd7468cba1b56664aad585ccb, a3688d686f147f4252d19b298ae26d4ac72c2e08) we can no longer parse all opcodes necessary for this extension, leading to bugs (https://bugs.freedesktop.org/show_bug.cgi?id=86980). Hence don't announce support for it in swrast (no other driver enabled it). (Note that remnants of some NV_fp/vp extensions remain, they could be dropped but are required as hacks for getting viewperf11 catia to run.) -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 79706] [TRACKER] Mesa regression tracker
https://bugs.freedesktop.org/show_bug.cgi?id=79706 Bug 79706 depends on bug 86980, which changed state. Bug 86980 Summary: [swrast] piglit fp-rfl regression https://bugs.freedesktop.org/show_bug.cgi?id=86980 What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2 1/3] nv50/ir: support different unordered_set implementations
2015-06-20 9:04 GMT+08:00 Chih-Wei Huang cwhu...@android-x86.org: 2015-06-20 3:12 GMT+08:00 Emil Velikov emil.l.veli...@gmail.com: Hi Chih-Wei, On 19 June 2015 at 19:00, Chih-Wei Huang cwhu...@android-x86.org wrote: diff --git a/Android.common.mk b/Android.common.mk index d662d60..35dcda2 100644 --- a/Android.common.mk +++ b/Android.common.mk @@ -77,7 +77,7 @@ LOCAL_CFLAGS += \ endif LOCAL_CPPFLAGS += \ - $(if $(filter true,$(MESA_LOLLIPOP_BUILD)),-D_USING_LIBCXX) \ + $(if $(filter true,$(MESA_LOLLIPOP_BUILD)),-std=c++11) \ Please expand like elsewhere in the build. Additionally this is a C++ only flag, so LOCAL_CPPFLAGS does not sound like the right place. Shame that the Android folk did not like (f'd up) the standard CXXFLAGS. Seems you misread it. LOCAL_CPPFLAGS is the C++ only flag. ifeq MESA_LOLLIPOP_BUILD... LOCAL_C??FLAGS += \ -std=c++11 endif Personally I like the compact format. But if you prefer the style, I can update it. After re-thinking the style, I hope to keep as it is. Actually the style is already accepted in my last patch. This patch only changed the unused -D_USING_LIBCXX to more appropriate -std=c++11. I consider the $(if ) operator of makefile to be analogous to ? : operator of C/C++. I know some people dislike ? : operator, but most programmers won't reject it since it make the code more elegant. I also see the ? : operator is used in Mesa's code extensively. In short, I think the patch is good and no plan to update it. Could you merge it? -- Chih-Wei Android-x86 project http://www.android-x86.org ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 77288] [swrast] piglit glean glsl1 regression
https://bugs.freedesktop.org/show_bug.cgi?id=77288 Vinson Lee v...@freedesktop.org changed: What|Removed |Added Version|git |10.2 --- Comment #6 from Vinson Lee v...@freedesktop.org --- mesa: 717376155d2082d7bf94122a1e1d383b39e0b070 (master 10.7.0-devel) piglit glean glsl1 regression on swrast is still present. -- You are receiving this mail because: You are the assignee for the bug. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev