Ian Romanick
00aa173c9c
Generate array constructor calls
15 jaren geleden
Ian Romanick
0f0ea58264
Add ir_function_signature::function_name
15 jaren geleden
Ian Romanick
a4775823b0
Make ir_function::signatures private
15 jaren geleden
Ian Romanick
95cd6cc195
Add ir_function::iterator to iterate over function signatures
15 jaren geleden
Ian Romanick
6a15d5b514
Use ir_function::add_signature to create link between function and signature
ir_function_signature now has a pointer back to the ir_function that owns it.
15 jaren geleden
Ian Romanick
4ef183e51d
Add glsl_type::generate_constructor_prototype
Generates a symbol table entry and the IR approximation of a prototype for a
type's constructor. Currently only arrays are supported.
15 jaren geleden
Ian Romanick
68515ee6c2
Refactor parts of match_function_by_name into process_parameters and process_call
These will be used in the functions that implement calls to array constructors.
15 jaren geleden
Ian Romanick
b6326abb85
Reject array constructor calls in GLSL 1.10
15 jaren geleden
Ian Romanick
3e0ef5f81b
Use ast_type_specifier::glsl_type to get the type of a constructor
This is the first baby step towards getting array constructors working.
15 jaren geleden
Ian Romanick
d612a127cc
Move type_specifier_to_glsl_type to ast_type_specifier::glsl_type
This make is easily accessible from other modules.
15 jaren geleden
Ian Romanick
615adcda8a
More array declaration tests
15 jaren geleden
Ian Romanick
299ed08a68
Fix big dumbness in glsl_type::get_array_instance
hash_table_insert needs to keep the key so that it compare keys on a
following hash_table_find call. Since key was allocated on the stack,
it disappeared out from under the hash table.
15 jaren geleden
Ian Romanick
0bf3810165
glsl_type array constructor generate a real name for the type
15 jaren geleden
Eric Anholt
0ed6125725
Test that const declarations include initializers.
Fixes dataType6.frag, and also array2.frag for an unexpected but valid
reason.
15 jaren geleden
Ian Romanick
e0800062da
Reject declarations with 'in' or 'out' qualifiers
'in' and 'out' can only be used in function parameter lists or at
global scope (1.30 and later). This change enforces this.
15 jaren geleden
Ian Romanick
a705d65ccd
Add 'in' to some parameters of the function
This goes along with the qualifier-?? tests.
15 jaren geleden
Ian Romanick
d8a2133887
Add some variable declaration qualifier tests
15 jaren geleden
Ian Romanick
d8065d86e8
Fix comment bug and printf bug in previous commit
15 jaren geleden
Ian Romanick
b168e53452
Require that 'uniform' and 'varying' variables be declared at global scope
This causes the following tests to pass:
glslparsertest/shaders/uniform.frag
glslparsertest/shaders/varying.frag
15 jaren geleden
Ian Romanick
e1c1a3f3bd
Slightly refector checks for declarations that must be at global scope
15 jaren geleden
Eric Anholt
b82c0c31ae
Implement logical operators.
Fixes parser9.frag.
15 jaren geleden
Eric Anholt
b97ee2e260
Test that variable names don't use the reserved gl_ prefix.
Fixes identifier2.frag.
15 jaren geleden
Eric Anholt
b980207707
Test that discard only appears in the fragment shader.
Fixes fragmentOnly4.vert.
15 jaren geleden
Eric Anholt
174cc03edc
Test that main doesn't take any parameters.
Fixes main2.vert.
15 jaren geleden
Eric Anholt
aad7c77937
Test that a non-void function returns a value.
15 jaren geleden
Eric Anholt
ab79d4ec6e
Test that a void function doesn't return a value.
Fixes function1.frag.
15 jaren geleden
Eric Anholt
794ea61006
Fix unused variable warning.
15 jaren geleden
Ian Romanick
a80cbd6d82
Forbid array comparisons in GLSL 1.10
This causes the following tests to pass:
glslparsertest/shaders/array3.frag
15 jaren geleden
Ian Romanick
28009cd75c
Begin handling array declarations
This causes the following tests to pass:
glslparsertest/shaders/array4.frag
glslparsertest/shaders/array5.frag
This causes the following tests to fail. These shaders were
previously failing to compile, but they were all failing for the wrong
reasons.
glslparsertest/shaders/array3.frag
15 jaren geleden
Ian Romanick
548a1b5ab7
Implement array type handling
Since all glsl_type objects are flyweights, support is added to track all
known array types. This accounts for most of the changes.
15 jaren geleden
Ian Romanick
066304679c
Add proper wrappers so that C++ code can use hash_table type
15 jaren geleden
Ian Romanick
1cf43a4331
Initial bits of constant expression evaluator
Currently only works for constants. The rest will be added later.
15 jaren geleden
Ian Romanick
84960f01cb
Add some array declaration tests
15 jaren geleden
Ian Romanick
2d816204c8
Arrays are not allowed as vertex shader inputs in GLSL 1.30 either
15 jaren geleden
Ian Romanick
8901eeefc9
Add several tests for vertex shader attributes
15 jaren geleden
Ian Romanick
fb9f5b0675
Add some checking for vertex shader inputs / attributes
This causes the following tests to pass:
glslparsertest/shaders/attribute.vert
glslparsertest/shaders/attribute1.vert
glslparsertest/shaders/attribute2.vert
15 jaren geleden
Ian Romanick
06e5308e29
Add parser support for texture rectangle types
15 jaren geleden
Ian Romanick
bfb09c2a94
Use call-by-reference for apply_implicit_conversion
I'm not sure if this is a win or not. It makes the code in
apply_implicit_conversion more clear, but it obscures the fact that it
may change the pointers.
15 jaren geleden
Ian Romanick
db9be2e7aa
Apply implicit conversions to ?: operator
15 jaren geleden
Ian Romanick
212b0327b4
Apply implicit conversions to equality operators
15 jaren geleden
Ian Romanick
0150f5f20e
Apply implicit conversions to relational operators
15 jaren geleden
Ian Romanick
0104536568
Apply implicit conversions to arithmetic operators
15 jaren geleden
Ian Romanick
70348543ac
Add glsl_type::is_array and glsl_type::is_float queries
15 jaren geleden
Ian Romanick
8a24cd5cea
Allow single-component constructors
This causes the following tests to pass:
glslparsertest/shaders/CorrectVersion.V110.frag
shaders/glsl-vs-sqrt-zero.frag
shaders/glsl-vs-sqrt-zero.vert
This causes the following tests to fail. These shaders were
previously failing to compile, but they were all failing for the wrong
reasons.
glslparsertest/shaders/attribute1.vert
glslparsertest/shaders/attribute2.vert
glslparsertest/shaders/main2.vert
15 jaren geleden
Ian Romanick
32a494586f
Add tests for :? operator
15 jaren geleden
Ian Romanick
96f9cea116
Implement HIR conversion for ?: operator
15 jaren geleden
Ian Romanick
5185a5f7d5
Add generate_temporary to generate an anonymous temporary
15 jaren geleden
Ian Romanick
6e659caaa9
Implement HIR conversion for ast_nequal and ast_equal
The following tests now pass:
shaders/glsl-unused-varying.frag
shaders/glsl-fs-sqrt-branch.frag
15 jaren geleden
Ian Romanick
251eb75318
Add missing break-statements in ast_expression::hir
The ast_conditional case was flowing right into ast_pre_inc.
15 jaren geleden
Ian Romanick
3c6fea3048
Implement ir_if (for if-statments) and conversion from AST
The following tests now pass:
glslparsertest/shaders/if1.frag
glslparsertest/shaders/if2.frag
The following tests that used to pass now fail. It appears that most
of these fail because ast_nequal and ast_equal are not converted to HIR.
shaders/glsl-unused-varying.frag
shaders/glsl-fs-sqrt-branch.frag
15 jaren geleden