summaryrefslogtreecommitdiff
path: root/ast_to_hir.cpp
AgeCommit message (Collapse)Author
2010-06-23Add a virtual clone() method to ir_instruction.Eric Anholt
This will be used by function inlining, the linker, and avoiding double usage of the LHS deref chains in ++, *=, and similar operations.
2010-06-22Include stdio.h and stdlib.h everywhere, and don't cook our own #define NULL.Eric Anholt
2010-06-18Ensure that shader_in and shader_out are correctly set in declarationsIan Romanick
2010-06-17Allow initializers for uniformsIan Romanick
2010-06-11Use statically typed ir_constant constructors wherever possibleIan Romanick
2010-06-11Treat ?: with all constant subexpressions as a constant expressionIan Romanick
2010-06-11Rearrange code in HIR conversion of ?: operatorIan Romanick
There are no functional changes. Code is just moved arround. This prepares for the next set of changes that do change the functionality.
2010-06-01Allow arrays of floats as varyings.Eric Anholt
The comment just above the code said arrays were OK, then it didn't handle arrays. Whoops. Partially fixes CorrectUnsizedArray.frat.
2010-06-01Handle GLSL 1.20 implicit type conversions.Eric Anholt
We were nicely constructing a new expression for the implicit type conversion, but then checking that the previous types matched instead of the new expression's type. Fixes errors in Regnum Online shaders.
2010-05-26Fix setting the maximum accessed array elementIan Romanick
Array dereferences now point to variable dereferences instead of pointing directly to variables. This necessitated some changes to the way the variable is accessed when setting the maximum index array element.
2010-05-26Refactor ir_dereference data fields to subclassesIan Romanick
2010-05-26Begin refactoring ir_dereferenceIan Romanick
Create separate subclasses of ir_dereference for variable, array, and record dereferences. As a side effect, array and record dereferences no longer point to ir_variable objects directly. Instead they each point to an ir_dereference_variable object. This is the first of several steps in the refactoring process. The intention is that ir_dereference will eventually become an abstract base class.
2010-05-10Replace many uses of foreach_list with foreach_list_typedIan Romanick
2010-05-10Convert ast_node use of simple_node to exec_list and exec_nodeIan Romanick
2010-05-10Loop bodies, then-statements, and else-statements are not listsIan Romanick
The statement making up a loop body, a then-statement, or an else-statement are single nodes. If the statement is a block, the single node will be an ast_compound_statement. There is no need to loop at the top level when processing these statements.
2010-04-28Track and print user defined structure typesIan Romanick
2010-04-28Begin handling some varieties of invalid declarationsIan Romanick
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