summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_validate.cpp
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Add validation that a swizzle only references valid channels.Eric Anholt2010-09-271-0/+18
| | | | Caught the bug in the previous commit.
* glsl: Rework assignments with write_masks to have LHS chan count match RHS.Eric Anholt2010-09-221-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: silence compiler warnings in printf() callsBrian Paul2010-09-201-2/+4
| | | | | Such as: "ir_validate.cpp:143: warning: format ‘%p’ expects type ‘void*’, but argument 2 has type ‘ir_variable*’"
* glsl2: add case for ir_unop_noiseBrian Paul2010-09-141-0/+4
| | | | | Silences a compiler warning. Still need to add some assertions for this case.
* glsl: introduce ir_binop_all_equal and ir_binop_any_equal, allow vector cmpsLuca Barbieri2010-09-131-10/+16
| | | | | | | | | | | | | | | | | Currently GLSL IR forbids any vector comparisons, and defines "ir_binop_equal" and "ir_binop_nequal" to compare all elements and give a single bool. This is highly unintuitive and prevents generation of optimal Mesa IR. Hence, first rename "ir_binop_equal" to "ir_binop_all_equal" and "ir_binop_nequal" to "ir_binop_any_nequal". Second, readd "ir_binop_equal" and "ir_binop_nequal" with the same semantics as less, lequal, etc. Third, allow all comparisons to acts on vectors. Signed-off-by: Ian Romanick <[email protected]>
* ir_validate: Ensure ir_binop_dot is only used on vector types.Kenneth Graunke2010-09-081-0/+1
|
* ir_validate: Validate loop control fields in ir_loopIan Romanick2010-09-031-0/+35
|
* mesa: Add new ir_unop_any() expression operation.Eric Anholt2010-08-231-0/+5
| | | | | | | The previous any() implementation would generate arg0.x || arg0.y || arg0.z. Having an expression operation for this makes it easy for the backend to generate something easier (DPn + SNE for 915 FS, .any predication on 965 VS)
* Revert "glsl2: Use stdint.h instead of inttypes.h"José Fonseca2010-08-141-1/+1
| | | | This reverts commit a77a6bc008b3146c56431fa520a00e1f8dfa3938.
* glsl2: Use stdint.h instead of inttypes.hIan Romanick2010-08-131-1/+1
|
* glsl2: added casts to silence warningsBrian Paul2010-08-111-7/+7
|
* glsl2: Add a pass to convert exp and log to exp2 and log2.Eric Anholt2010-08-051-0/+4
| | | | | | | | | Fixes ir_to_mesa handling of unop_log, which used the weird ARB_vp LOG opcode that doesn't do what we want. This also lets the multiplication coefficients in there get constant-folded, possibly. Fixes: glsl-fs-log
* glsl2: Additional validation of write masksIan Romanick2010-08-041-0/+32
|
* glsl2: Fix ir_validate validating null variable names.Eric Anholt2010-08-031-1/+2
| | | | | | | | | An unnamed variable in a prototype will have a NULL ->name, so don't worry about storage then. Fixes: CorrectFunction1.vert CorrectParse1.frag
* glsl2: Clean-up two 'unused variable' warningsIan Romanick2010-08-021-0/+2
|
* glsl2: Add validation that talloc ownership of ir_* names is right.Eric Anholt2010-08-021-1/+3
|
* glsl2: Fix validation for ir_unop_not.Eric Anholt2010-08-021-2/+2
| | | | We use vector ir_unop_not to implement builtin not(), and that seems fine.
* glsl2: Give the path within src/mesa/ for headers instead of relying on -I.Aras Pranckevicius2010-08-021-1/+1
|
* 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: Validate that ir_if conditions are actually bool.Eric Anholt2010-07-221-0/+13
|
* glsl2: Check that nodes in a valid tree aren't error-type.Eric Anholt2010-07-201-1/+2
| | | | | We're good at propagating error types around, but finding when the first one was triggered can be painful if we aren't paying attention.
* glsl2: Give IR nodes a type field.Eric Anholt2010-07-191-0/+15
| | | | | | | This is a big deal for debugging if nothing else ("what class is this ir_instruction, really?"), but is also nice for avoiding building a whole visitor or an if (node->as_whatever() || node->as_other_thing()) chain.
* ir_validate: Also perform usual checks on ir_dereference_variable nodesIan Romanick2010-07-121-0/+2
|
* ir_validate: Validate that varibles are declared before used in IRIan Romanick2010-07-121-2/+26
|
* ir_validate: Additional function related invariant checksIan Romanick2010-07-121-0/+60
| | | | | | | | | Add two invariant checks related to functions and function signatures: 1. Ensure that function definitions (ir_function) are not nested. 2. Ensure that the ir_function pointed to by an ir_function_signature is the one that contains it in its signatures list.
* Add hash table helper functions for using pointers as hash keysIan Romanick2010-07-061-13/+2
|
* glsl2: Wrap includes of C interfaces with extern "C".Eric Anholt2010-06-241-0/+2
|
* glsl2: Move the compiler to the subdirectory it will live in in Mesa.Eric Anholt2010-06-241-0/+104