Age | Commit message (Collapse) | Author |
|
Fixes the following Piglit tests:
glslparsertest/shaders/array2.frag
glslparsertest/shaders/dataType6.frag
NOTE: This is a candidate for the 7.9 and 7.10 branches.
|
|
The check for
Precision qualifiers only apply to floating point and integer types.
was incomplete. It rejected only type 'bool' and structures.
|
|
* Add new field ast_type_specifier::is_precision_statement.
* Add semantic checks in ast_type_specifier::hir().
* Alter parser rules accordingly.
|
|
* Check that precision qualifiers only appear in language versions 1.00,
1.30, and later.
* Check that precision qualifiers do not apply to bools and structs.
Fixes the following Piglit tests:
* spec/glsl-1.30/precision-qualifiers/precision-bool-01.frag
* spec/glsl-1.30/precision-qualifiers/precision-struct-01.frag
* spec/glsl-1.30/precision-qualifiers/precision-struct-02.frag
|
|
The check is performed only in GLSL versions >= 1.30.
From section 4.3.4 of the GLSL 1.30 spec:
"It is an error to use centroid in in a vertex shader."
Fixes Piglit test
spec/glsl-1.30/compiler/storage-qualifiers/vs-centroid-in-01.vert
|
|
The check is performed only in GLSL versions >= 1.30.
Fixes the following Piglit tests:
* spec/glsl-1.30/compiler/interpolation-qualifiers/fs-smooth-02.frag
* spec/glsl-1.30/compiler/interpolation-qualifiers/vs-smooth-01.vert
|
|
... and 'centroid varying'. The check is performed only in GLSL
versions >= 1.30.
From page 29 (page 35 of the PDF) of the GLSL 1.30 spec:
"interpolation qualifiers may only precede the qualifiers in, centroid
in, out, or centroid out in a declaration. They do not apply to the
deprecated storage qualifiers varying or centroid varying."
Fixes Piglit test
spec/glsl-1.30/compiler/interpolation-qualifiers/smooth-varying-01.frag.
|
|
'varying'
The specs that add 'layout' require the use of 'in' or 'out'.
However, a number of implementations, including Mesa, shipped several
of these extensions allowing the use of 'varying' and 'attribute'.
For these extensions only a warning is emitted.
This differs from the behavior of Mesa 7.10. Mesa 7.10 would only
accept 'attribute' with 'layout(location)'. This behavior was clearly
wrong. Rather than carrying the broken behavior forward, we're just
doing the correct thing.
This is related to (piglit) bugzilla #31804.
NOTE: This is a candidate for the 7.9 and 7.10 branches.
|
|
All of the extensions that add the 'layout' keyword also enable (and
required) the use of 'in' and 'out' with shader globals.
This is related to (piglit) bugzilla #31804.
NOTE: This is a candidate for the 7.9 and 7.10 branches.
|
|
In particular, variables cannot be redeclared invariant after being
used.
Fixes piglit test invariant-05.vert and bugzilla #29164.
NOTE: This is a candidate for the 7.9 and 7.10 branches.
|
|
Fixes piglit tests glsl-1.20/compiler/qualifiers/in-01.vert and
glsl-1.20/compiler/qualifiers/out-01.vert and bugzilla #32910.
NOTE: This is a candidate for the 7.9 and 7.10 branches. This patch
also depends on the previous two commits.
|
|
Previously the 'STDGL invariant(all)' pragma added in GLSL 1.20 was
simply ignored by the compiler. This adds support for setting all
variable invariant.
In GLSL 1.10 and GLSL ES 1.00 the pragma is ignored, per the specs,
but a warning is generated.
Fixes piglit test glsl-invariant-pragma and bugzilla #31925.
NOTE: This is a candidate for the 7.9 and 7.10 branches.
|
|
GLSL 1.10 and 1.20 allow any sort of sampler array indexing.
Restrictions were added in GLSL 1.30. Commit f0f2ec4d added support
for the 1.30 restrictions, but it broke some valid 1.10/1.20 shaders.
This changes the error to a warning in GLSL 1.10, GLSL 1.20, and GLSL
ES 1.00.
There are some spurious whitespace changes in this commit. I changed
the layout (and wording) of the error message so that all three cases
would be similar. The 1.10/1.20 and 1.30 text is the same. The only
difference is that one is an error, and the other is a warning. The
GLSL ES 1.00 wording is similar but not quite the same.
Fixes piglit test
spec/glsl-1.10/compiler/constant-expressions/sampler-array-index-02.frag
and bugzilla #32374.
|
|
Perform this check in ast_declarator_list::hir().
From section 4.3.6 of the GLSL 1.30 spec:
"If a vertex output is a signed or unsigned integer or integer
vector, then it must be qualified with the interpolation
qualifier
flat."
|
|
Allow redeclaration of the following built-in variables with an
interpolation qualifier in language versions >= 1.30:
* gl_FrontColor
* gl_BackColor
* gl_FrontSecondaryColor
* gl_BackSecondaryColor
* gl_Color
* gl_SecondaryColor
See section 4.3.7 of the GLSL 1.30 spec.
|
|
I think was used long ago, when we actually read the builtins into the
shader's instruction stream directly, rather than creating a separate
shader and linking the two. It doesn't seem to serve any purpose now.
|
|
assignment
do_assignment may apply implicit conversions to coerce the base type
of initializer to the base type of the variable being declared. Fixes
piglit test glsl-implicit-conversion-02 (bugzilla #32287). This
probably also fixes bugzilla #32273.
NOTE: This is a candidate for the 7.9 branch and the 7.10 branch.
|
|
This code has been changed around a lot, and there were some temporary
variables left around from previous versions.
|
|
Raise error if a sampler array is indexed with a non-constant expression.
From section 4.1.7 of the GLSL 1.30 spec:
"Samplers aggregated into arrays within a shader (using square
brackets [ ]) can only be indexed with integral constant
expressions [...]."
|
|
Types of declared variables and their initializer must match excatly
except for unsized arrays. Previously the type inherritance for
unsized arrays happened implicitly in the emitted assignment.
However, this assignment is never emitted for uniforms. Now that type
is explicitly copied unconditionally.
Fixes piglit test array-compare-04.vert (bugzilla #32035) and
glsl-array-uniform-length (bugzilla #31985).
NOTE: This is a candidate for the 7.9 branch.
|
|
This fixes bugzilla #32035 and piglit test case array-compare-01 and
array-compare-02.
NOTE: This is a candidate for the 7.9 branch.
|
|
A future commit will use the newly created function in a second place.
|
|
By not doing so, the uniform contents of
glsl-uniform-non-uniform-array-compare.shader_test was getting thrown
out since nobody was recorded as dereferencing the array.
|
|
|
|
We were trying to emit a single ir_expression to compare the whole
thing. The backends (ir_to_mesa.cpp and brw_fs.cpp so far) expected
ir_binop_any_nequal or ir_binop_all_equal to apply to at most a vector
(with matrices broken down by the lowering pass). Break them down to
a bunch of ORed or ANDed any_nequals/all_equals.
Fixes:
glsl-array-compare
glsl-array-compare-02
glsl-fs-struct-equal
glsl-fs-struct-notequal
Bug #31909
|
|
|
|
|
|
Return values were erroneously cast from (ir_rvalue*) to (ir_expression*).
NOTE: This is a candidate for the 7.9 branch.
|
|
Function ast_declarator_list::hir(), when processing keywords added by
extension ARB_fragment_coord_conventions, made the mistake of checking only if
the extension was __supported by the driver__. The correct behavior is to check
if the extensi0n is __enabled in the parse state__.
NOTE: this is a candidate for the 7.9 branch.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
|
|
|
|
Silences this GCC warning.
ast_to_hir.cpp: In function 'void apply_type_qualifier_to_variable(const
ast_type_qualifier*, ir_variable*, _mesa_glsl_parse_state*, YYLTYPE*)'
ast_to_hir.cpp:1768: warning: enumeration value 'ir_shader' not handled
in switch
|
|
Implement by adding to ast_expression::hir() the following cases:
- ast_and_assign
- ast_or_assign
- ast_xor_assign
|
|
This function type checks the operands of and returns the result type of
bit-logic operations. It replaces the type checking performed in the
following cases of ast_expression::hir() :
- ast_bit_and
- ast_bit_or
- ast_bit_xor
|
|
Implement by adding to ast_expression::hir() these cases:
- ast_ls_assign
- ast_rs_assign
|
|
This function type checks the operands of and returns the result type of
bit-shift operations. It replaces the type checking performed in the following
cases of ast_expression::hir() :
- ast_lshift
- ast_rshift
|
|
Existing code relies on IR being generated (possibly with error type)
rather than returning NULL. So, don't break - go ahead and generate the
operation. As long as an error is flagged, things will work out.
Fixes fd.o bug #30914.
|
|
Implement by adding the following cases to ast_expression::hir():
- ast_lshift
- ast_rshift
Also, implement ir validation for the new operators by adding the following
cases to ir_validate::visit_leave():
- ir_binop_lshift
- ir_binop_rshift
|
|
|
|
|
|
This will ease adding non-bit fields in the near future.
|
|
Fixes piglit test CorrectFull.frag.
|
|
The print visitor needs this, and the only existing user can work with
has_user_signature just as well.
|
|
Currently GLSL IR forbids any vector comparisons, and defines "ir_binop_equal"
and "ir_binop_nequal" to compare all elements and give a single bool.
This is highly unintuitive and prevents generation of optimal Mesa IR.
Hence, first rename "ir_binop_equal" to "ir_binop_all_equal" and
"ir_binop_nequal" to "ir_binop_any_nequal".
Second, readd "ir_binop_equal" and "ir_binop_nequal" with the same semantics
as less, lequal, etc.
Third, allow all comparisons to acts on vectors.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
|
|
This allows them to be passed as out/inout parameters, but still
prevents them from being used as the target of an assignment. This is
per section 5.8 of the GLSL ES 1.00 specification.
|
|
The rules are explicitly different from desktop GLSL.
|
|
This effectively reverts b6f15869b324ae64a00d0fe46fa3c8c62c1edb6c.
In desktop GLSL, defining a function with the same name as a built-in
hides that built-in function completely, so there would never be
built-in and user function signatures in the same ir_function.
However, in GLSL ES, overloading built-ins is allowed, and does not
hide the built-in signatures - so we're back to needing this.
|
|
|
|
|
|
This should make it easier to change the default version based on the
API (say, version 1.00 for OpenGL ES).
Also, synchronize the symbol table's version with the parse state's
version just before doing AST-to-HIR. This way, it will be set when
it matters, but the main initialization code doesn't have to care about
the symbol table.
|
|
Fixes bugzilla #30039.
|