summaryrefslogtreecommitdiff
path: root/src/glsl/hir_field_selection.cpp
AgeCommit message (Collapse)AuthorFilesLines
2014-06-10glsl: Remove unused include from hir_field_selection.cppThomas Helland1-1/+0
Found with IWYU. Compile-tested on my Ivy-bridge system Reviewed-by: Tom Stellard <thomas.stellard@amd.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Thomas Helland <thomashelland90@gmail.com>
2013-10-28glsl: Add check for unsized arrays to glsl typesTimothy Arceri1-1/+1
The main purpose of this patch is to increase readability of the array code by introducing is_unsized_array() to glsl_types. Some redundent is_array() checks are also removed, and small number of other related clean ups. The introduction of is_unsized_array() should also make the ARB_arrays_of_arrays code simpler and more readable when it arrives. V2: Also replace code that checks for unsized arrays directly with the length variable Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au> v3 (Paul Berry <stereotype441@gmail.com>): clean up formatting. Separate whitespace cleanups to their own patch. Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-07-27glsl: Be consistent about '\n', '.', and capitalization in errors/warnings.Paul Berry1-10/+10
The majority of calls to _mesa_glsl_error(), _mesa_glsl_warning(), and _mesa_glsl_parse_state::check_version() use a message that begins with a lower case letter and ends without a period. This patch makes all messages follow that convention. Also, error/warning messages shouldn't end in '\n', since _mesa_glsl_msg() automatically adds '\n' at the end of the message. Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-06-14glsl: Allow swizzles on scalars.Matt Turner1-1/+3
Required by ARB_shading_language_420pack. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-06-14glsl: Allow .length() method on vectors and matrices.Matt Turner1-20/+38
Required by ARB_shading_language_420pack. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25glsl: Allow dereferencing fields of an interface instanceIan Romanick1-1/+2
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-12-06glsl: Enable GLSL ES 3.00 features inherited from desktop GLSL.Paul Berry1-1/+1
This patch turns on the following features for GLSL ES 3.00: - Array constructors, whole array assignment, and array comparisons. - Second and third operands of ?: may be arrays. - Use of "in" and "out" qualifiers on globals. - Bitwise and modulus operators. - Integral vertex shader inputs. - Range-checking of literal integers. - array.length method. - Function calls may be constant expressions. - Integral varyings must be qualified with "flat". - Interpolation and centroid qualifiers may not be applied to vertex shader inputs. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06glsl: Make use of new _mesa_glsl_parse_state::check_version() function.Paul Berry1-2/+1
Previous to this patch, we were not very consistent about the errors we generate when a shader tried to use a feature that is prohibited in the current GLSL version. Some error messages failed to mention the GLSL version currently in use (or did so inaccurately), and some error messages failed to mention the first GLSL version in which the given feature is allowed. This patch reworks all of the error checks to use the check_version() function, which produces error messages in a standard form (approximately "$FEATURE forbidden in $CURRENT_GLSL_VERSION ($REQUIRED_GLSL_VERSION required)."). Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Acked-by: Carl Worth <cworth@cworth.org>
2012-04-02glsl: Use ir_rvalue to represent generic error_type values.Kenneth Graunke1-1/+1
Currently, ir_call can be used as either a statement (for void functions) or a value (for non-void functions). This is rather awkward, as it's the only class that can be used in both forms. A number of places use ir_call::get_error_instruction() to construct a generic value of error_type. If ir_call is to become a statement, it can no longer serve this purpose. Unfortunately, none of our classes are particularly well suited for this, and creating a new one would be rather aggrandizing. So, this patch introduces ir_rvalue::error_value(), a static method that creates an instance of the base class, ir_rvalue. This has the nice property that you can't accidentally try and access uninitialized fields (as it doesn't have any). The downside is that the base class is no longer abstract. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-02-21Use C-style system headers in C++ code to avoid issues with std:: namespaceIan Romanick1-2/+0
2011-02-03glsl: Add using statements for standard library functions.Vinson Lee1-0/+2
Standard library functions in C++ are in the std namespace. When using C++-style header files for the standard library, some compilers, such as Sun Studio, provide symbols only for the std namespace and not for the global namespace. This patch adds using statements for standard library functions. Another option could have been to prepend standard library function calls with 'std::'. This patch fixes several compilation errors with Sun Studio.
2010-08-24glsl: Include main/core.h.Chia-I Wu1-1/+0
Make glsl include only main/core.h from core mesa.
2010-08-13glsl2: Remove unnecessary use of 'struct' before type namesIan Romanick1-1/+1
In C++ you don't have to say 'struct' or 'class' if the declaration of the type has been seen. Some compilers will complain if you use 'struct' when 'class' should have been used and vice versa. Fixes bugzilla #29539.
2010-08-02glsl2: Give the path within src/mesa/ for headers instead of relying on -I.Aras Pranckevicius1-1/+1
2010-07-20glsl2: Add support for the .length() method on arrays.Kenneth Graunke1-0/+22
Fixes piglit test glsl-array-length, and provides proper error messages for negative piglit tests array-length-110.frag, array-length-unsized.frag, and array-length-args.frag.
2010-06-30glsl2: Use _mesa_glsl_parse_state as the talloc parent, not glsl_shader.Kenneth Graunke1-1/+1
_mesa_glsl_parse_state should be the parent for all temporary allocation done while compiling a shader. glsl_shader should only be used as the parent for the shader's final IR---the _result_ of compilation. Since many IR instructions may be added or discarded during optimization passes, IR should not ever be allocated to glsl_shader directly. Done via sed -i s/talloc_parent(state)/state/g and s/talloc_parent(st)/st/g. This also removes a ton of talloc_parent calls, which may help performance.
2010-06-24glsl2: Move the compiler to the subdirectory it will live in in Mesa.Eric Anholt1-0/+81