summaryrefslogtreecommitdiff
path: root/src/glsl
AgeCommit message (Collapse)Author
2010-10-14glsl: Refresh autogenerated file builtin_function.cpp.Kenneth Graunke
2010-10-14glsl: Add front-end support for the "trunc" built-in.Kenneth Graunke
2010-10-13linker: Reject shaders that have unresolved function callsIan Romanick
This really amounts to just using the return value from link_function_calls. All the work was being done, but the result was being ignored. Fixes piglit test link-unresolved-funciton. NOTE: this is a candidate for the 7.9 branch.
2010-10-13glsl: Initialize variable in ir_derefence_array::constant_expression_valueVinson Lee
Completely initialize data passed to ir_constant constructor. Fixes piglit glsl-mat-from-int-ctor-03 valgrind uninitialized value error on softpipe.
2010-10-13Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg
2010-10-13glsl: add support for shader stencil exportDave Airlie
This adds proper support for the GL_ARB_shader_stencil_export extension to the GLSL compiler. Thanks to Ian for pointing out where I need to add things.
2010-10-12glsl2: fix signed/unsigned comparison warningBrian Paul
2010-10-11glsl: Changes in generated file glsl_lexer.cppChad Versace
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-10-11glsl: Add lexer rules for uint and uvecN (N=2..4)Chad Versace
Commit for generated file glsl_lexer.cpp follows this commit. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2010-10-11glsl: Add glsl_type::uvecN_type for N=2,3Chad Versace
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2010-10-08glsl: Remove const decoration from inlined function parametersIan Romanick
The constness of the function parameter gets inlined with the rest of the function. However, there is also an assignment to the parameter. If this occurs inside a loop the loop analysis code will get confused by the assignment to a read-only variable. Fixes bugzilla #30552. NOTE: this is a candidate for the 7.9 branch.
2010-10-08glsl: Add linker support for explicit attribute locationsIan Romanick
2010-10-08glsl: Track explicit location in AST to IR translationIan Romanick
2010-10-08glsl: Regenerate files changes by previous commitIan Romanick
2010-10-08glsl: Add parser support for GL_ARB_explicit_attrib_location layoutsIan Romanick
Only layout(location=#) is supported. Setting the index requires GLSL 1.30 and GL_ARB_blend_func_extended.
2010-10-08glcpp: Regenerate files changes by previous commitIan Romanick
2010-10-08glcpp: Add the define for ARB_explicit_attrib_location when presentIan Romanick
2010-10-08glsl: Regenerate files modified by previous commitsIan Romanick
2010-10-08glsl: Wrap ast_type_qualifier contents in a struct in a unionIan Romanick
This will ease adding non-bit fields in the near future.
2010-10-08glsl: Clear type_qualifier using memsetIan Romanick
2010-10-08glsl: Slight refactor of error / warning checking for ARB_fcc layoutIan Romanick
2010-10-08glsl: Refactor 'layout' grammar to match GLSL 1.60 spec grammarIan Romanick
2010-10-08glsl: Fail linking if assign_attribute_locations failsIan Romanick
2010-10-01glsl: Remove unnecessary header.Vinson Lee
2010-09-30glsl: Add a lowering pass for texture projection.Eric Anholt
2010-09-28glsl: "Copyright", not "Constantright"Kenneth Graunke
Clearly this started out as ir_copy_propagation.cpp, but the search and replace was a bit overzealous.
2010-09-28glsl: Also update implicit sizes of varyings at link time.Eric Anholt
Otherwise, we'll often end up with gl_TexCoord being 0 length, for example. With ir_to_mesa, things ended up working out anyway, as long as multiple implicitly-sized arrays weren't involved.
2010-09-27glsl: Add validation that a swizzle only references valid channels.Eric Anholt
Caught the bug in the previous commit.
2010-09-27glsl: Fix broadcast_index of lower_variable_index_to_cond_assign.Eric Anholt
It's trying to get an int smeared across all channels, not trying to get a 1:1 mapping of a subset of a vector's channels. This usually ended up not mattering with ir_to_mesa, since it just smears floats into every chan of a vec4. Fixes: glsl1-temp array with swizzled variable indexing
2010-09-22glsl: Fix copy'n'wasted ir_noop_swizzle conditions.Eric Anholt
It considered .xyyy a noop for vec4 instead of .xyzw, and similar for vec3.
2010-09-22glsl: Rework assignments with write_masks to have LHS chan count match RHS.Eric Anholt
It turns out that most people new to this IR are surprised when an assignment to (say) 3 components on the LHS takes 4 components on the RHS. It also makes for quite strange IR output: (assign (constant bool (1)) (x) (var_ref color) (swiz x (var_ref v) )) (assign (constant bool (1)) (y) (var_ref color) (swiz yy (var_ref v) )) (assign (constant bool (1)) (z) (var_ref color) (swiz zzz (var_ref v) )) But even worse, even we get it wrong, as shown by this line of our current step(float, vec4): (assign (constant bool (1)) (w) (var_ref t) (expression float b2f (expression bool >= (swiz w (var_ref x))(var_ref edge)))) where we try to assign a float to the writemasked-out x channel and don't supply anything for the actual w channel we're writing. Drivers right now just get lucky since ir_to_mesa spams the float value across all the source channels of a vec4. Instead, the RHS will now have a number of components equal to the number of components actually being written. Hopefully this confuses everyone less, and it also makes codegen for a scalar target simpler. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2010-09-21glsl2: fix typo in error msgBrian Paul
2010-09-21glsl: Add definition of gl_TextureMatrix inverse/transpose builtins.Eric Anholt
Fixes glsl2/builtin-texturematrix. Bug #30196.
2010-09-20glsl: Fix broken handling of ir_binop_equal and ir_binop_nequal.Kenneth Graunke
When ir_binop_all_equal and ir_binop_any_nequal were introduced, the meaning of these two opcodes changed to return vectors rather than a single scalar, but the constant expression handling code was incorrectly written and only worked for scalars. As a result, only the first component of the returned vector would be properly initialized.
2010-09-20glsl: Add comments to clarify the types of comparison binops.Kenneth Graunke
2010-09-20glsl2: silence compiler warnings in printf() callsBrian Paul
Such as: "ir_validate.cpp:143: warning: format ‘%p’ expects type ‘void*’, but argument 2 has type ‘ir_variable*’"
2010-09-20glsl: Add doxygen commentsIan Romanick
2010-09-18glsl/builtins: Switch comparison functions to just return an expression.Kenneth Graunke
2010-09-18glsl/builtins: Fix equal and notEqual builtins.Kenneth Graunke
Commit 309cd4115b7cba669a0bf858e7809cb6dae90ddf incorrectly converted these to all_equal and any_nequal, which is the wrong operation.
2010-09-18glsl: Properly handle nested structure types.Kenneth Graunke
Fixes piglit test CorrectFull.frag.
2010-09-18glsl2: Fixed cloning of ir_call error instructions.Tilman Sauerbeck
Those have the callee field set to the null pointer, so calling the public constructor will segfault. Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
2010-09-18glsl: Fix 'control reaches end of non-void function' warning.Vinson Lee
Fixes this GCC warning. lower_variable_index_to_cond_assign.cpp: In member function 'bool variable_index_to_cond_assign_visitor::needs_lowering(ir_dereference_array*) const': lower_variable_index_to_cond_assign.cpp:261: warning: control reaches end of non-void function
2010-09-18glsl2: Empty functions can be inlined.Tilman Sauerbeck
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de> Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2010-09-17glsl2: Add flags to enable variable index loweringIan Romanick
2010-09-17glsl2: Refactor testing for whether a deref is of a matrix or arrayIan Romanick
2010-09-17glsl: add pass to lower variable array indexing to conditional assignmentsLuca Barbieri
Currenly GLSL happily generates indirect addressing of any kind of arrays. Unfortunately DirectX 9 GPUs are not guaranteed to support any of them in general. This pass fixes that by lowering such constructs to a binary search on the values, followed at the end by vectorized generation of equality masks, and 4 conditional assignments for each mask generation. Note that this requires the ir_binop_equal change so that we can emit SEQ to generate the boolean masks. Unfortunately, ir_structure_splitting is too dumb to turn the resulting constant array references to individual variables, so this will need to be added too before this pass can actually be effective for temps. Several patches in the glsl2-lower-variable-indexing were squashed into this commit. These patches fix bugs in Luca's original implementation, and the individual patches can be seen in that branch. This was done to aid bisecting in the future. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-09-16glsl: Don't print blank (function ...) headers for built-ins.Kenneth Graunke
Fixes a regression caused when I added my GLSL ES support.
2010-09-16glsl: Change from has_builtin_signature to has_user_signature.Kenneth Graunke
The print visitor needs this, and the only existing user can work with has_user_signature just as well.
2010-09-15glsl: Fix 'format not a string literal and no format arguments' warning.Vinson Lee
Fix the following GCC warning. loop_controls.cpp: In function 'int calculate_iterations(ir_rvalue*, ir_rvalue*, ir_rvalue*, ir_expression_operation)': loop_controls.cpp:88: warning: format not a string literal and no format arguments
2010-09-14glsl2: add case for ir_unop_noiseBrian Paul
Silences a compiler warning. Still need to add some assertions for this case.