summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2010-08-04glsl2: Remove a dead cut and paste member from ir_variable_refcount_visitor.Eric Anholt
2010-08-04i965: Settle on printing our program debug to stdout.Eric Anholt
Mixing stderr (_mesa_print_program, _mesa_print_instruction, _mesa_print_alu) with stdout means that when writing both to a file, there isn't a consistent ordering between the two.
2010-08-04ir_to_mesa: Print shader source and compiled IR under MESA_GLSL=dump.Eric Anholt
While the Mesa IR dumping includes some corresponding GLSL IR for correlating Mesa IR to GLSL IR, it doesn't completely express it. This printing includes things like variable declarations and control flow structure that is hard to read otherwise.
2010-08-04glsl2: Use linked ir_constant_variable after linking, instead of unlinked.Eric Anholt
2010-08-04glsl2: Return progress from ir_vec_index_to_swizzle.Eric Anholt
2010-08-04glsl2: Generate masked assignments in some expanded matrix operationsIan Romanick
2010-08-04glsl2: Generate masked assignments in vector and matrix constructorsIan Romanick
Previously the in-line matrix and vector constructors would generate swizzles in the LHS. The code is actually more clear if it just generates the masked assignments instead of relying on the ir_assignment constructor to convert the swizzles to write masks.
2010-08-04glsl2: Additional validation of write masksIan Romanick
2010-08-04glsl2: Add ir_assignment::write_mask and associated methodsIan Romanick
Replace swizzles on the LHS with additional swizzles on the RHS and a write mask in the assignment instruction. As part of this add ir_assignment::set_lhs. Ideally we'd make ir_assignment::lhs private to prevent erroneous writes, but that would require a lot of code butchery at this point. Add ir_assignment constructor that takes an explicit write mask. This is required for ir_assignment::clone, but it can also be used in other places. Without this, ir_assignment clones lose their write masks, and incorrect IR is generated in optimization passes. Add ir_assignment::whole_variable_written method. This method gets the variable on the LHS if the whole variable is written or NULL otherwise. This is different from ir->lhs->whole_variable_referenced() because the latter has no knowledge of the write mask stored in the ir_assignment. Gut all code from ir_to_mesa that handled swizzles on the LHS of assignments. There is probably some other refactoring that could be done here, but that can be left for another day.
2010-08-04glsl2: Don't try to construct an ir_assignment with an invalid LHSIan Romanick
2010-08-04glsl2: Constant fold the children of many more ir_instruction types.Eric Anholt
2010-08-04glsl2: Return a real progress value from constant folding.Eric Anholt
2010-08-04glsl2: Refactor constant folding of rvalues to a function.Eric Anholt
2010-08-04glcpp: Refresh autogenerated lexer and parser.Kenneth Graunke
2010-08-04glcpp: Remove xtalloc wrappers in favor of plain talloc.Kenneth Graunke
Calling exit() on a memory failure probably made sense for the standalone preprocessor, but doesn't seem too appealing as part of the GL library. Also, we don't use it in the main compiler.
2010-08-04glsl2: Remove uses of deprecated TALLOC_CTX type.Kenneth Graunke
2010-08-04glsl2: add gl_LightModel built-in uniform.Aras Pranckevicius
2010-08-04glsl2: Don't try to assign locations for samplers during linking.Eric Anholt
Mesa will do the mapping at _mesa_add_sampler() time. Fixes assertion failures in debug builds, which might have caught real problems with multiple samplers linked in a row.
2010-08-04ir_to_mesa: Clean up the mapping of samplers to Mesa's sampler uniforms.Eric Anholt
Instead of using a linker-assigned location (since samplers don't actually take up uniform space, being a link-time choice), use the sampler's varaible pointer as a hash key.
2010-08-04mesa: Don't null deref looking for Mesa IR code at compile time.Eric Anholt
The new compiler doesn't generate Mesa IR at compile time, and that compile time code previously wouldn't have reflected the link time code that actually got used. But do dump the info log of the compile regardless.
2010-08-04glsl2: Skip talloc_parent in constant_expression of non-constant arrays.Eric Anholt
2010-08-04glsl2: Make the clone() method take a talloc context.Eric Anholt
In most cases, we needed to be reparenting the cloned IR to a different context (for example, to the linked shader instead of the unlinked shader), or optimization before the reparent would cause memory usage of the original object to grow and grow.
2010-08-04glsl2: Set ir_discard::ir_type when cloning itAras Pranckevicius
Fixes unset ir_type after inlining.
2010-08-03glsl2: Fix ir_validate validating null variable names.Eric Anholt
An unnamed variable in a prototype will have a NULL ->name, so don't worry about storage then. Fixes: CorrectFunction1.vert CorrectParse1.frag
2010-08-03glsl2: No need to strdup the name passed in to ir_variable constructor.Eric Anholt
ir_variable always strdups the incoming name so that it matches the lifetime of the ir_variable.
2010-08-02glsl2: Fix typo in clamp() constant builtin using uint instead of int.Eric Anholt
I take back the bad things I've said about the signed/unsigned comparison warning now.
2010-08-02ir_to_mesa: Add support for 1.20 uniform initializers.Eric Anholt
Fixes: glsl-uniform-initializer-1 glsl-uniform-initializer-2 glsl-uniform-initializer-3 glsl-uniform-initializer-4 glsl1-GLSL 1.20 uniform array constructor
2010-08-02glsl2: Don't consider uniform initializers as constant expressions.Eric Anholt
We were happily optimizing away the body of glsl-uniform-initializer-* to never use the uniforms.
2010-08-02Initialize a couple of HasIndex2 fields on Mesa IR src regs.Eric Anholt
2010-08-02ir_to_mesa: Support for struct uniforms.Eric Anholt
Fixes glsl-uniform-struct.
2010-08-02ir_to_mesa: Add a constructor for ir_to_mesa_src_reg.Eric Anholt
This helps makes sure we don't miss any new fields, and makes totally uninitialized src_regs be PROGRAM_UNDEFINED.
2010-08-02glsl2: Use talloc_zero_size instead of talloc_size to allocate ast_node objects.Carl Worth
This is a zero-ing function, (like calloc), to avoid bugs due to accessing uninitialized values. Thanks to valgrind for noticing the use of uninitialized values.
2010-08-02glsl_type: Use string key for array type hashIan Romanick
2010-08-02Keep a local copy of the symbol name in the symbol tableIan Romanick
The symbol_header structure that tracks symbols with a particular name may have a different (longer) life time than the symbols it tracks. Not keeping a local copy of the name can lead to use-after-free errors. For example, the following sequence would trigger such an error: char *copy = strdup(name); _mesa_symbol_table_push_scope(st); _mesa_symbol_table_add_symbol(st, 0, name, NULL); _mesa_symbol_table_pop_scope(st); free(name); _mesa_symbol_table_find_symbol(st, 0, copy); With this change, the symbol table keeps a local copy of the name that has the same life time as the symbol_header for that name. This resolves some use-after-free errors with built-in functions in the GLSL compiler.
2010-08-02glsl2: Clean-up two 'unused variable' warningsIan Romanick
2010-08-02glsl2: Make glsl_types::ctx private againIan Romanick
2010-08-02glsl2: Fix expression type in builtin tan().Eric Anholt
Fixes glsl-fs-tan-1.
2010-08-02glsl2: Add validation that talloc ownership of ir_* names is right.Eric Anholt
2010-08-02glsl2: Fix validation for ir_unop_not.Eric Anholt
We use vector ir_unop_not to implement builtin not(), and that seems fine.
2010-08-02glsl2: Add support for floating constants like "1f".Eric Anholt
Fixes glsl-floating-constant-120.
2010-08-02glsl2: Initialize the ARB_fcc fields of ir_variable.Eric Anholt
Fixes intermittent failure in glsl-arb-fragment-coord-conventions.
2010-08-02glsl2: Also initialize the identifier field of parameter_declarator.Eric Anholt
The non-named parameter grammar understandably doesn't set the identifier field. Fixes intermittent failures about void main(void) {} having a named void parameter.
2010-08-02glsl2: Fix spelling of "precision" in error output.Eric Anholt
2010-08-02glsl2: Don't add mesa/program/ as an include dir. Let includes say program/.Eric Anholt
2010-08-02glsl2: Give the path within src/mesa/ for headers instead of relying on -I.Aras Pranckevicius
2010-08-02glsl2: initialize is_array and array_size of ast_parameter_declaratorAras Pranckevicius
The non-array path of glsl_parser.ypp wasn't setting is_array to false.
2010-08-01glsl2: Make non-square matrix keywords not keywords pre-120.Eric Anholt
Fixes glsl-mat-110.
2010-08-01ir_to_mesa: Add support for MESA_GLSL=log.Eric Anholt
This is the option that dumps shader source to files in the current directory.
2010-08-01glcpp: Add a testcase for the failure in compiling xonotic's shader.Eric Anholt
gcc and mesa master agree that this is OK.
2010-07-31glsl2: Do algebraic optimizations after linking as well.Eric Anholt
Linking brings in inlining of builtins, so we weren't catching the (rcp(/sqrt(x)) -> rsq(x)) without it.