summaryrefslogtreecommitdiffstats
path: root/src/glsl
Commit message (Collapse)AuthorAgeFilesLines
* glsl2: Parser support for GL_ARB_fragment_coord_conventionsIan Romanick2010-07-288-1801/+2009
|
* glsl2: Fail linking where the FS reads a varying that the VS doesn't write.Eric Anholt2010-07-281-7/+30
| | | | | | Fixes: glsl1-varying read but not written glsl1-varying var mismatch
* glsl2: Unmark unwritten varyings as varying.Eric Anholt2010-07-281-0/+1
| | | | | This fixes an assertion failure in ir_to_mesa, and the varying won't take up varying space.
* glcpp: Add generated source files.Carl Worth2010-07-284-3/+6693
| | | | | | | This is now consistent with other usage of flex/bison througout mesa, (which is that these generated files are added to source control so that the build system does not require external tools like flex/bison for non-developers).
* glsl: Ignore glsl_compiler and glsl_parser.output files.Carl Worth2010-07-281-0/+2
| | | | | These are generated files where we can do the sane thing, and keep them out of version control.
* glsl: Add generated files from flex/bison.Carl Worth2010-07-283-0/+8490
| | | | | | | The mesa build environment does not (currently) accept external dependencies such as flex and bison. The compromise is to commit the generated output files, (in spite of the pain that comes from having generated files under version control).
* glcpp: Add expected output for a recently-added test.Carl Worth2010-07-281-0/+3
| | | | I simply forgot to add this file when adding the test case originally.
* glsl2: Add the remaining builtin uniforms.Eric Anholt2010-07-281-15/+53
|
* glsl2: Size builtin arrays according to the context constants.Eric Anholt2010-07-281-13/+5
| | | | Cleans up some of the FINISHMEs in this file.
* glcpp: Explicitly expect 0 shift/reduce conflicts.Carl Worth2010-07-281-0/+1
| | | | | | The "%expect 0" construct will make bison emit an error if any future changes to the grammar introduce shift/reduce conflicts, (without also increasing the number after "%expect").
* glcpp: Remove 2 shift/reduce conflicts from the grammar.Carl Worth2010-07-281-1/+0
| | | | | | | Since we have productions to turn "defined FOO" and "defined ( FOO )" into a conditional_token we don't need to list DEFINED as an operator as well. Doing so just introduces the shift/reduce ambiguity with no benefit.
* glsl2: When stealing var->constant_value, steal its children as well.Eric Anholt2010-07-271-1/+1
| | | | | Fixes: glsl1-GLSL 1.20 uniform array constructor
* glsl2: Actually use the linked dead code eliminator.Eric Anholt2010-07-271-1/+1
| | | | | | I managed to revert the change from unlinked at some point while cleaning up the changes. glsl-fs-raytrace-bug27060 drops from 389 instructions to 370.
* glsl2: Don't dereference a NULL var in CE handling during a compile error.Eric Anholt2010-07-271-0/+4
| | | | | | | | | If an undeclared variable was dereferenced in an expression that needed constant expression handling, we would walk off a null ir->var pointer. Fixes: glsl1-TIntermediate::addUnaryMath
* glsl2: Use ir_dead_code's linked version after linking.Eric Anholt2010-07-271-3/+1
| | | | | glsl-fs-raytrace-bug27060 goes from 485 Mesa IR instructions to 389 before Mesa IR optimization.
* glsl2: Fix the linked version of ir_dead_code.Eric Anholt2010-07-271-3/+6
| | | | | If we don't walk into functions, we won't see any usage of variables in the functions.
* glsl2: Make the dead code handler make its own talloc context.Eric Anholt2010-07-273-11/+9
| | | | | This way, we don't need to pass in a parse state, and the context doesn't grow with the number of passes through optimization.
* glsl2: Talloc type names.Eric Anholt2010-07-272-10/+17
| | | | | Otherwise, we end up losing structure names after compile time, and dumping IR often ends up reporting some other mysterious string.
* glsl2: Add optimization pass for algebraic simplifications.Eric Anholt2010-07-275-1/+378
| | | | | | This cleans up the assembly output of almost all the non-logic tests glsl-algebraic-*. glsl-algebraic-pow-two needs love (basically, flattening to a temporary and squaring it).
* ir_validate: Check the types of expression operations.Eric Anholt2010-07-271-0/+144
|
* glsl2: Fix missing visit_continue return in ir_validate.Eric Anholt2010-07-271-0/+2
|
* glsl2: Also steal the constant components of aggregate-typed ir_constants.Eric Anholt2010-07-261-0/+18
|
* glsl2: Steal ir_variable's constant_value field.Kenneth Graunke2010-07-261-0/+3
| | | | Fixes a link-time crash in glsl-vs-cross-3.
* glsl2: Remove old .gitignore file from when we were out of tree.Eric Anholt2010-07-261-1/+0
|
* Merge remote branch 'origin/master' into glsl2Eric Anholt2010-07-2610-30/+45
|\ | | | | | | | | | | | | | | | | | | | | This pulls in multiple i965 driver fixes which will help ensure better testing coverage during development, and also gets past the conflicts of the src/mesa/shader -> src/mesa/program move. Conflicts: src/mesa/Makefile src/mesa/main/shaderapi.c src/mesa/main/shaderobj.h
| * glsl/apps: Handle ftell errors in non-debug builds.Vinson Lee2010-07-155-0/+15
| |
| * mesa: make the arguments in the asm statemants optionalZack Rusin2010-06-291-3/+2
| | | | | | | | geometry shaders emit/end functions don't take any arguments
| * mesa: initial support for ARB_geometry_shader4Zack Rusin2010-06-282-19/+20
| | | | | | | | | | | | laying down the foundation for everything and implementing most of the stuff. linking, gl_VerticesIn and multidimensional inputs are left.
* | ir_constant_expression: Fix broken code for floating point modulus.Kenneth Graunke2010-07-221-1/+1
| | | | | | | | It's supposed to be x - y * floor(x/y), not (x - y) * floor(x/y).
* | glsl2: Refresh autogenerated file builtin_function.cpp.Kenneth Graunke2010-07-221-25/+47
| |
* | glsl2/builtins: Add 1.30 bvec variant of the "mix" builtin.Kenneth Graunke2010-07-221-0/+39
| |
* | glsl2/builtins: Fix 1.30 sign implementation for ints.Kenneth Graunke2010-07-221-1/+1
| |
* | glsl2/builtins: Fix "mod" builtin to use scalar/vector operations.Kenneth Graunke2010-07-221-24/+3
| |
* | glsl2: Initialize ir_instruction::type and ir_rvalue::type.Kenneth Graunke2010-07-222-4/+7
| | | | | | | | | | | | | | | | | | | | | | Top-level instructions now get NULL as their default type (since type is irrelevant for things like ir_function), while ir_rvalues get error_type by default. This should make it easier to tell if we've forgotten to set a type. It also fixes some "Conditional jump or move depends on uninitialized value" errors in valgrind caused by ir_validate examining the type of top level ir_instructions, which weren't set.
* | glsl2: Make ir_assignment derive from ir_instruction, not ir_rvalue.Kenneth Graunke2010-07-222-3/+3
| | | | | | | | | | | | Assignments can only exist at the top level instruction stream; the residual value is handled by assigning the value to a temporary and returning an ir_dereference_variable of that temporary.
* | glsl2: Fix standalone compiler to not crash horribly.Kenneth Graunke2010-07-222-41/+27
| | | | | | | | | | ir_to_mesa was updated for the _mesa_glsl_parse_state constructor changes, but main.cpp was not.
* | ir_print_visitor: Add "temporary" to mode string printing.Kenneth Graunke2010-07-221-1/+2
| | | | | | | | | | | | Variables with mode ir_var_temporary were causing an out of bounds array access and filling my screen with rubbish. I'm not sure if "temporary" is the right thing to print.
* | glcpp: Fix function-like macros with an argument used multiple times.Carl Worth2010-07-222-3/+9
| | | | | | | | | | | | | | | | | | | | | | It's really hard to believe that this case has been broken, but apparently no test previously exercised it. So this commit adds such a test and fixes it by making a copy of the argument token-list before expanding it. This fix causes the following glean tests to now pass: glsl1-Preprocessor test 6 (#if 0, #define macro) glsl1-Preprocessor test 7 (multi-line #define)
* | glsl2: Put side effects of the RHS of logic_or in the right branch.Eric Anholt2010-07-221-1/+1
| | | | | | | | | | | | | | | | Kind of missing the point to only do the side effects if the LHS evaluates as true. Fixes: glsl1-|| operator, short-circuit
* | glsl2: Validate that ir_if conditions are actually bool.Eric Anholt2010-07-221-0/+13
| |
* | glsl2: When setting the size of an unsized array, set its deref's size too.Eric Anholt2010-07-221-0/+1
| |
* | glsl2: Set the type on cloned tex instructions.Eric Anholt2010-07-221-0/+1
| |
* | glsl2: Add the API defines to the glsl2 build so we get the right GLcontextEric Anholt2010-07-221-2/+6
| | | | | | | | | | | | | | Fixes: draw_buffers-08.frag draw_buffers-09.frag glsl-vs-texturematrix-2
* | glsl2: Fix builtin prototypes defined in multiple glsl/builtins/* filesEric Anholt2010-07-221-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | If we put the protos in separate ir_functions, they wouldn't be found at lookup time for linking. Fixes: glsl-fs-texture2d-bias glsl-fs-texture2dproj-bias glsl-fs-texture2dproj-bias-2 glsl-lod-bias glsl1-texture2D(), computed coordinate
* | glsl2: Fix expected type for multiplying vector with non-square matrix.Carl Worth2010-07-221-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the compiler expected the result of the multiplication to be of the same type as the vector. This is correct for square matrices, but wrong for all others. We fix this by instead expecting a vector with the same number of rows as the matrix (for the case of M*v with a column vector) or the same number of columns as the matrix (for v*M with a row vector). This fix causes the following four glean tests to now pass: glsl1-mat4x2 * vec4 glsl1-vec2 * mat4x2 multiply glsl1-vec3 * mat4x3 multiply glsl1-vec4 * mat3x4 multiply
* | glsl2: Fix the type of (1.0 - arg2) for mix(gen, gen, float).Eric Anholt2010-07-222-6/+6
| | | | | | | | | | | | | | Previously, we'd constant-fold up a value of vec4(1.0 - arg2, 0, 0, 0). Fixes: glsl1-mix(vec4) function
* | glsl2: When inlining, don't clone and assign sampler arguments.Eric Anholt2010-07-221-8/+18
| | | | | | | | | | Instead, just use the incoming sampler param. Fixes many texture-using piglit tests since the linker rework.
* | glsl2: When a "continue" happens in a "for" loop, run the loop expression.Eric Anholt2010-07-222-0/+15
| | | | | | | | | | | | | | Fixes: glsl1-for-loop with continue Bug #29097
* | glsl2: Update TODO.Kenneth Graunke2010-07-211-23/+0
| |
* | ir_constant_expression: Add support for array == and !=.Kenneth Graunke2010-07-212-4/+24
| | | | | | | | | | Piglit parser tests const-array-03.frag and const-array-04.frag now generate the correct code.