summaryrefslogtreecommitdiff
path: root/ast_to_hir.cpp
AgeCommit message (Collapse)Author
2010-04-28Reject conflicting struct declarations, generate struct constructorIan Romanick
2010-04-28Always return a value from ast_type_specifier::hirIan Romanick
2010-04-28Ensure that structure fields have non-NULL typesIan Romanick
2010-04-28Ensure that anonymous structures have non-NULL namesIan Romanick
2010-04-28Begin converting structure definitions to IRIan Romanick
2010-04-28Factor out parameter list replacement for later reuse.Kenneth Graunke
2010-04-28Factor out parameter list matching from ast_function::hir for later reuse.Kenneth Graunke
Unfortunately, we still have two kinds of matching - one, with implicit conversions (for use in calls) and another without them (for finding a prototype to overwrite when processing a function body). This commit does not attempt to coalesce the two.
2010-04-28Factor out qualifier checking code for later reuse.Kenneth Graunke
2010-04-21Refactor IR function representation.Kenneth Graunke
Now, ir_function is emitted as part of the IR instructions, rather than simply existing in the symbol table. Individual ir_function_signatures are not emitted themselves, but only as part of ir_function.
2010-04-21Use ir_function_signature::function_name() rather than direct access.Kenneth Graunke
2010-04-21Ensure that both parameter lists are the same length in function overloading.Kenneth Graunke
Fixes new test function-05.glsl, where the second function has matching parameter types, but less of them.
2010-04-19Mark some variables as having usage beyond the shader's scope.Eric Anholt
This will be important to optimization passes. We don't want to dead-code eliminate writes to out varyings, or propagate uninitialized values of uniforms.
2010-04-16While-loops also start a new scope.Ian Romanick
2010-04-16Avoid generating ir_if for &&, || short-circuiting with constant LHS.Eric Anholt
It was breaking constant expression detection for constant initializers, i.e. CorrectParse2.frag, CorrectParse2.vert.
2010-04-16Make && and || only evaluate the RHS when the LHS requires it.Eric Anholt
2010-04-14Check that the return type of function definition matches its prototype.Eric Anholt
Doesn't fix any testcases, but fixes a FINISHME.
2010-04-14Check that function definition parameter qualifiers match proto qualifiers.Eric Anholt
Fixes function9.frag.
2010-04-14Return the rvalue of a variable decl to fix while (bool b = condition) {}Eric Anholt
2010-04-07Make function bodies rely on the parameter variable declarations.Eric Anholt
Previously, generating inlined function bodies was going to be difficult, as there was no mapping between the body's declaration of variables where parameter values were supposed to live and the parameter variables that a caller would use in paramater setup. Presumably this also have been a problem for actual codegen.
2010-04-07Put function bodies under function signatures, instead of flat in the parent.Eric Anholt
This will let us know the length of function bodies for the purpose of inlining (among other uses).
2010-04-07Use _mesa_glsl_shader_target_nameIan Romanick
2010-04-07Generate correct IR for do-while loopsIan Romanick
Previously the same code was generated for a while loop and a do-while loop. This pulls the code that generates the conditional break into a separate method. This method is called either at the beginning or the end depending on the loop type. Reported-by: Kenneth Graunke <kenneth@whitecape.org>
2010-04-07Process ast_jump_statement into ir_loop_jumpIan Romanick
Specifically, handle 'break' and 'continue' inside loops. This causes the following tests to pass: glslparsertest/shaders/break.frag glslparsertest/shaders/continue.frag
2010-04-07Begin tracking the nesting of loops and switch-statementsIan Romanick
2010-04-07Use switch based on mode in ast_jump_statement::hirIan Romanick
2010-04-07Process ast_iteration_statement into ir_loopIan Romanick
This causes the following tests to pass: glslparsertest/shaders/dowhile.frag glslparsertest/shaders/while.frag glslparsertest/shaders/while1.frag glslparsertest/shaders/while2.frag
2010-04-06Handle constant expressions using derefs of const values.Eric Anholt
Fixes CorrectParse1.frag and makes for a ton of folding in CorrectParse2.frag.
2010-04-05Set lower bound on size implied by whole-array assignmentIan Romanick
When an unsized array is accessed with a constant extension index this sets a lower bound on the allowable sizes. When the unsized array gets a size set due to a whole-array assignment, this size must be at least as large as the implied lower bound. This causes the following tests to pass: glslparsertest/glsl2/array-16.vert
2010-04-05Allow dereference of vectors and matrices with []Ian Romanick
This causes the following tests to pass: glslparsertest/glsl2/matrix-11.vert glslparsertest/glsl2/matrix-12.vert glslparsertest/shaders/CorrectParse2.vert glslparsertest/shaders/CorrectSwizzle2.frag
2010-04-02Propagate sizes when assigning a whole array to an unsized arrayIan Romanick
2010-04-02Track whether whole-arrays are assignableIan Romanick
In GLSL 1.10 this was not allowed, but in GLSL 1.20 and later it is. This causes the following tests to pass: glslparsertest/glsl2/array-09.vert glslparsertest/glsl2/array-13.vert
2010-04-02Additional void parameter checksIan Romanick
If there is a void parameter it must not have a name, and it must be the only parameter.
2010-04-02Require that function formal parameters have namesIan Romanick
2010-04-02Add conversion of bool to float as an IR operation to match int to float.Eric Anholt
2010-04-02Test that invalid quailfiers aren't used on variables in GLSL 1.10.Eric Anholt
2010-04-02Test for the type being different in parameter_lists_match.Eric Anholt
Fixes CorrectFuncOverload.frag.
2010-04-02Reject non-float varyings.Eric Anholt
Fixes varying2.frag.
2010-04-02Fix error handling of logic operators.Eric Anholt
They were always throwing a type error because type wasn't being set.
2010-04-02Emit errors for unfinished ast_to_hir expression operations.Eric Anholt
2010-04-02Fix ast_logic_not handling to be unary, not binary.Eric Anholt
2010-04-02Add errors for type results of other expressions.Eric Anholt
2010-04-02Emit errors from failure in arithmetic_result_type.Eric Anholt
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-04-02Compute the constant value of a constant initializer.Eric Anholt
Fixes constFunc.frag.
2010-04-02Allow initializers of constant values to succeed.Eric Anholt
This regresses constFunc.frag, but that's just unexpectedly passing because of the FINISHME just above.
2010-04-02Don't create a parameter declaration for a (void) parameter.Eric Anholt
Fixes segfaults in a shader consisting of just: void main(void) { } Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-04-01Track max accessed array element, reject additional out-of-bounds accessesIan Romanick
For unsized arrays, we can't flag out-of-bounds accesses until the array is redeclared with a size. Track the maximum accessed element and generate an error if the declaration specifies a size that would cause that access to be out-of-bounds. This causes the following tests to pass: glslparsertest/shaders/array10.frag
2010-04-01Begin processing ast_array_index nodesIan Romanick
This causes the following tests to pass: glslparsertest/shaders/parser3.frag glslparsertest/shaders/varying3.frag (also generates spurious error)
2010-04-01Allow unsized arrays to be redeclared with a sizeIan Romanick
Test glslparsertest/shaders/array11.frag now passes for the right reason.
2010-03-31Add ast_function::hirIan Romanick
ast_function::hir consists of bits pulled out of ast_function_definition::hir. In fact, the later uses the former to do a lot of its processing. Several class private data fields were added to ast_function to facilitate communicate between the two. This causes the following tests to pass: glslparsertest/shaders/CorrectModule.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/function9.frag glslparsertest/shaders/function10.frag
2010-03-31Use ir_variable::clone to copy parameters to the function bodyIan Romanick
Several other code movements were also done. This partitions this function into two halves. The first half processes the prototype part, and the second have processes the actual function definition. The coming patch series will parition ast_function_definition::hir into (at least) two separate functions.