summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2010-04-28ir_reader: Add support for reading (return ...)Kenneth Graunke
2010-04-28ir_reader: Add support for reading variable declarations.Kenneth Graunke
It also now reads a list of instructions, as it should, rather than a single rvalue.
2010-04-28Partial IR reader.Kenneth Graunke
Currently reads assignments, constants, expressions, and swizzles.
2010-04-28Set language_version to 130 (the max currently supported) when reading IR.Kenneth Graunke
This is necessary so _mesa_glsl_initialize_types can create appropriate glsl_types and add them to the symbol table. In the future, we'll want to set it to the max GLSL version supported by the current driver.
2010-04-28Add stub ir_reader and new 'i' mode for reading IR rather than GLSL.Kenneth Graunke
2010-04-28Add a simple S-Expression reader and printer.Kenneth Graunke
2010-04-28Use "neg" when printing/reading unary negation rather than "-".Kenneth Graunke
"-" is now only used for binary subtraction.
2010-04-28Move array of operator strings out of ir_print_visitor.cpp.Kenneth Graunke
Also implement a reverse-lookup function for use in the IR reader.
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-28ir_print_visitor: Re-parenthesize ir_call output.Kenneth Graunke
2010-04-28ir_print_visitor: Print return type of ir_function_signatures.Kenneth Graunke
2010-04-28ir_print_visitor: Print (constant bool (1)) instead of "true"Kenneth Graunke
It might be better to simply handle "true" in the reader, but since booleans normally aren't printed as "true" or "false", we may as well go for consistency.
2010-04-28ir_print_visitor: Remove unnecessary parens around expression operands.Kenneth Graunke
2010-04-28ir_print_visitor: Remove unnecessary parens around array size in types.Kenneth Graunke
2010-04-28ir_print_visitor: Fix unclosed parenthesis in (call...Kenneth Graunke
2010-04-28ir_print_visitor: Fix unclosed parenthesis in (assign ...Kenneth Graunke
Also remove useless parens around subexpressions.
2010-04-28Add parens around printed IR so it's an official list of instructions.Kenneth Graunke
2010-04-28ir_print_visitor: Remove unnecessary parenthesis around variable names.Kenneth Graunke
2010-04-28Refactor ir_expression::get_num_operands.Kenneth Graunke
A new static version takes an ir_expression_operation enum, and the original non-static version now uses it. This will make it easier to read operations (where the ir_expression doesn't yet exist).
2010-04-28ir_print_visitor: print the type of expressions.Kenneth Graunke
This can be useful for debugging - it allows us to see that the inferred type is what we think it should be. Furthermore, it will allow the IR reader to avoid complex, operator-specific type inference.
2010-04-28ir_print_visitor: Remove unnecessary parenthesis around type names.Kenneth Graunke
Parenthesis should only be present for compound types (i.e. arrays or structures). For atomic types, simply print the symbol.
2010-04-28Print full type for ir_constant instead of base and component count.Kenneth Graunke
vec4 and mat2x2 have the same base type and number of components; printing the full type allows us to distinguish the two.
2010-04-26Implement gl_TextureMatrix built-in uniformIan Romanick
2010-04-26Make private glsl_type singletons publicIan Romanick
2010-04-26Initial implementation of #lineIan Romanick
Does not handle comments in #line or line continuation characters, but it should be good enough for now.
2010-04-23builtin_functions: Clean up compiler warning about unused name, instructions.Eric Anholt
2010-04-23De-obfuscate some of builtin_types.h.Eric Anholt
2010-04-23ir_function_inlining: Implement inlining in many more cases.Eric Anholt
We still don't inline for control flow in the inlined function, and we don't have any limits on what we will inline.
2010-04-23Put static pointers to vec[234]_types along with the static float_type.Eric Anholt
Otherwise you have to type a lot of get_instance.
2010-04-23Replace builtin_types.h generation with the generated output.Eric Anholt
The script to generate it was longer and more obfuscated than the output.
2010-04-23Fix the swizzling of vector constructors from scalars.Eric Anholt
A refactor turned 'i' into '1', meaning everything writemasked into the y component.
2010-04-23ir_function_inlining: Avoid NULL dereference on assignment conditions.Eric Anholt
2010-04-23Zero-out the entire parser state structure at initializationIan Romanick
Among other things, this ensures that all of the extension flags are initially disabled. This causes the following tests to pass: glslparsertest/glsl2/draw_buffers-02.frag
2010-04-23Add missing 'else's to fix extension processingIan Romanick
The missing else-statements caused all of the extensions execpt GL_ARB_texture_rectangle to be unsupported. This causes the following tests to pass: glslparsertest/glsl2/draw_buffers-04.frag
2010-04-22Fix illegal (var_ref (array_ref ...)) in matrix constructors.Kenneth Graunke
2010-04-21Actually emit temp declaration in vector comparison builtins.Kenneth Graunke
2010-04-21Fix ir_dead_code for function refactoring.Kenneth Graunke
2010-04-21Emit body for constructors in the right place.Kenneth Graunke
Previously, the body of some vector constructors were added to the wrong function signature, and the body of matrix constructors were just being dumped in the main instruction stream.
2010-04-21Remove ir_label since it is no longer used.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-21Add missing break statementIan Romanick
2010-04-19Remove dead code assignments and variable declarations.Eric Anholt
This pass only works on assignments where the variable is never referenced. There is no code flow analysis, so it can't do a better job of avoiding redundant assignments. For now, the optimizer only does do_dead_code_unlinked(), so it won't trim the builtin variable list or initializers outside of the scope of functions. This is because we don't have the visibility into other functions that might get linked in in order to eliminate work on global variables.
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-16Add support for inlining calls done inside of expressions.Eric Anholt