summaryrefslogtreecommitdiffstats
path: root/src/glsl
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Regenerate parser files.Kenneth Graunke2010-10-182-249/+256
|
* glsl: Fix copy and paste error in ast_bit_and node creation.Kenneth Graunke2010-10-181-1/+1
| | | | All & operations were incorrectly being generated as ast_bit_or.
* glsl: Don't return NULL IR for erroneous bit-shift operators.Kenneth Graunke2010-10-181-5/+0
| | | | | | | | Existing code relies on IR being generated (possibly with error type) rather than returning NULL. So, don't break - go ahead and generate the operation. As long as an error is flagged, things will work out. Fixes fd.o bug #30914.
* glsl: add ir_unop_round_even case to silence unhandled enum warningBrian Paul2010-10-151-0/+1
|
* linker: Trivial indention fixIan Romanick2010-10-151-2/+2
|
* glsl: Fix ir validation for bit logic opsChad Versace2010-10-151-5/+9
| | | | | | | | | | | | In ir_validate::visit_leave(), the cases for - ir_binop_bit_and - ir_binop_bit_xor - ir_binop_bit_or were incorrect. It was incorrectly asserted that both operands must be the same type, when in fact one may be scalar and the other a vector. It was also incorrectly asserted that the resultant type was the type of the left operand, which in fact does not hold when the left operand is a scalar and the right operand is a vector.
* glsl: Implement constant expr evaluation for bitwise logic opsChad Versace2010-10-151-0/+54
| | | | | | | | Implement by adding the following cases to ir_exporession::constant_expression_value(): - ir_binop_bit_and - ir_binop_bit_or - ir_binop_bit_xor
* glsl: Implement constant expr evaluation for bit-shift opsChad Versace2010-10-151-0/+48
| | | | | | | Implement by adding the following cases to ir_expression::constant_expression_value(): - ir_binop_lshfit - ir_binop_rshfit
* glsl: Implement constant expr evaluation for bitwise-notChad Versace2010-10-151-0/+15
| | | | | Implement by adding a case to ir_expression::constant_expression_value() for ir_unop_bit_not.
* glsl: Implement ast-to-hir for binary shifts in GLSL 1.30Chad Versace2010-10-152-3/+71
| | | | | | | | | | Implement by adding the following cases to ast_expression::hir(): - ast_lshift - ast_rshift Also, implement ir validation for the new operators by adding the following cases to ir_validate::visit_leave(): - ir_binop_lshift - ir_binop_rshift
* glsl: Change generated file glsl_lexer.cppChad Versace2010-10-151-205/+215
|
* glsl: Add lexer rules for << and >> in GLSL 1.30Chad Versace2010-10-151-0/+2
| | | | Commit for generated file glsl_lexer.cpp follows this commit.
* glsl: Slightly change the semantic of _LinkedShadersIan Romanick2010-10-143-20/+84
| | | | | | | | | | | | | | | Previously _LinkedShaders was a compact array of the linked shaders for each shader stage. Now it is arranged such that each slot, indexed by the MESA_SHADER_* defines, refers to a specific shader stage. As a result, some slots will be NULL. This makes things a little more complex in the linker, but it simplifies things in other places. As a side effect _NumLinkedShaders is removed. NOTE: This may be a candidate for the 7.9 branch. If there are other patches that get backported to 7.9 that use _LinkedShader, this patch should be cherry picked also.
* glsl: Refresh autogenerated file builtin_function.cpp.Kenneth Graunke2010-10-141-0/+120
|
* glsl: Add support for the 1.30 round() built-in.Kenneth Graunke2010-10-143-0/+31
| | | | | | | This implements round() via the ir_unop_round_even opcode, rather than adding a new opcode. We may wish to add one in the future, since it might enable a small performance increase on some hardware, but for now, this should suffice.
* glsl: Add front-end support for GLSL 1.30's roundEven built-in.Kenneth Graunke2010-10-143-0/+31
| | | | Implemented using the op-code introduced in the previous commit.
* glsl: Add a new ir_unop_round_even opcode for GLSL 1.30's roundEven.Kenneth Graunke2010-10-142-0/+3
| | | | Also, update ir_to_mesa's "1.30 is unsupported" case to "handle" it.
* glsl: Refresh autogenerated file builtin_function.cpp.Kenneth Graunke2010-10-141-0/+60
|
* glsl: Add front-end support for the "trunc" built-in.Kenneth Graunke2010-10-143-0/+31
|
* linker: Reject shaders that have unresolved function callsIan Romanick2010-10-131-2/+6
| | | | | | | | | | 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.
* glsl: Initialize variable in ir_derefence_array::constant_expression_valueVinson Lee2010-10-131-1/+1
| | | | | | | Completely initialize data passed to ir_constant constructor. Fixes piglit glsl-mat-from-int-ctor-03 valgrind uninitialized value error on softpipe.
* Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg2010-10-137-17/+17
|
* glsl: add support for shader stencil exportDave Airlie2010-10-133-0/+28
| | | | | 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.
* glsl2: fix signed/unsigned comparison warningBrian Paul2010-10-121-1/+1
|
* glsl: Changes in generated file glsl_lexer.cppChad Versace2010-10-111-691/+716
| | | | Signed-off-by: Ian Romanick <[email protected]>
* glsl: Add lexer rules for uint and uvecN (N=2..4)Chad Versace2010-10-111-0/+4
| | | | | | Commit for generated file glsl_lexer.cpp follows this commit. Reviewed-by: Ian Romanick <[email protected]>
* glsl: Add glsl_type::uvecN_type for N=2,3Chad Versace2010-10-112-0/+4
| | | | Reviewed-by: Ian Romanick <[email protected]>
* glsl: Remove const decoration from inlined function parametersIan Romanick2010-10-081-0/+7
| | | | | | | | | | | 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.
* glsl: Add linker support for explicit attribute locationsIan Romanick2010-10-083-4/+48
|
* glsl: Track explicit location in AST to IR translationIan Romanick2010-10-084-0/+60
|
* glsl: Regenerate files changes by previous commitIan Romanick2010-10-082-902/+956
|
* glsl: Add parser support for GL_ARB_explicit_attrib_location layoutsIan Romanick2010-10-085-4/+75
| | | | | Only layout(location=#) is supported. Setting the index requires GLSL 1.30 and GL_ARB_blend_func_extended.
* glcpp: Regenerate files changes by previous commitIan Romanick2010-10-082-124/+120
|
* glcpp: Add the define for ARB_explicit_attrib_location when presentIan Romanick2010-10-081-0/+3
|
* glsl: Regenerate files modified by previous commitsIan Romanick2010-10-083-1412/+1431
|
* glsl: Wrap ast_type_qualifier contents in a struct in a unionIan Romanick2010-10-085-100/+109
| | | | This will ease adding non-bit fields in the near future.
* glsl: Clear type_qualifier using memsetIan Romanick2010-10-081-19/+86
|
* glsl: Slight refactor of error / warning checking for ARB_fcc layoutIan Romanick2010-10-081-9/+7
|
* glsl: Refactor 'layout' grammar to match GLSL 1.60 spec grammarIan Romanick2010-10-081-10/+21
|
* glsl: Fail linking if assign_attribute_locations failsIan Romanick2010-10-081-1/+3
|
* glsl: Remove unnecessary header.Vinson Lee2010-10-011-1/+0
|
* glsl: Add a lowering pass for texture projection.Eric Anholt2010-09-303-0/+102
|
* glsl: "Copyright", not "Constantright"Kenneth Graunke2010-09-281-1/+1
| | | | | Clearly this started out as ir_copy_propagation.cpp, but the search and replace was a bit overzealous.
* glsl: Also update implicit sizes of varyings at link time.Eric Anholt2010-09-281-4/+7
| | | | | | 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.
* glsl: Add validation that a swizzle only references valid channels.Eric Anholt2010-09-271-0/+18
| | | | Caught the bug in the previous commit.
* glsl: Fix broadcast_index of lower_variable_index_to_cond_assign.Eric Anholt2010-09-271-1/+1
| | | | | | | | | | 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
* glsl: Fix copy'n'wasted ir_noop_swizzle conditions.Eric Anholt2010-09-221-2/+2
| | | | It considered .xyyy a noop for vec4 instead of .xyzw, and similar for vec3.
* glsl: Rework assignments with write_masks to have LHS chan count match RHS.Eric Anholt2010-09-2210-111/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl2: fix typo in error msgBrian Paul2010-09-211-1/+1
|
* glsl: Add definition of gl_TextureMatrix inverse/transpose builtins.Eric Anholt2010-09-211-0/+3
| | | | | Fixes glsl2/builtin-texturematrix. Bug #30196.