Commit Graph

9362 Commits

Author SHA1 Message Date
Brian aa7ddbd0ff clean-up, move IR_ELEMENT code 2007-02-20 17:00:16 -07:00
Brian 760c114b24 alloc IR_FIELD's Storage in codegen, like IR_ELEMENT 2007-02-20 16:56:49 -07:00
Brian 10f42ddb9e work on struct/array handling 2007-02-20 15:22:38 -07:00
Brian 361b60678e forgot to return length in parse_array_len() 2007-02-20 15:20:46 -07:00
Brian 243c2dd746 implement support for pre-defined uniform structs (state vars) 2007-02-20 14:03:43 -07:00
Brian 48d65aabbc added slang_builtin.c 2007-02-20 14:03:10 -07:00
Brian bd894c4705 added SWIZZLE_XXXX, SWIZZLE_YYYY, etc 2007-02-20 10:40:08 -07:00
Brian 174c555414 remove accidental check-in 2007-02-20 08:05:29 -07:00
Brian 3d001b81c2 Merge branch 'glsl-compiler-1' of git+ssh://brianp@git.freedesktop.org/git/mesa/mesa into glsl-compiler-1 2007-02-20 08:04:40 -07:00
Brian 9449a4d894 s/PROG_PRINT_ARB/PROG_PRINT_DEBUG/ 2007-02-17 09:41:59 -07:00
Brian 61d31ae10d info about stand-alone compiler 2007-02-17 09:41:19 -07:00
Brian cc153541a2 stand-alone GLSL compiler 2007-02-17 09:15:39 -07:00
Brian 501ee87180 Lots of changes to prog_print.c code.
Mainly, allow printing programs in either ARB, NV or "debug" formats.
2007-02-17 09:15:00 -07:00
Brian 00647c39de remove dead code 2007-02-16 09:59:27 -07:00
Brian c177191804 s/_slang_link2/_slang_link/ 2007-02-16 09:56:19 -07:00
Brian 1c1a0a23d3 change all enum tokens to uppercase 2007-02-16 09:31:35 -07:00
Brian d15059b128 abort upon errors (temporary) 2007-02-16 09:06:09 -07:00
Brian d30806b0c5 added a comment 2007-02-16 09:05:11 -07:00
Brian 9ea2315d2d Allow int->float argument conversion in _slang_locate_function(). 2007-02-16 09:04:53 -07:00
Brian d003877c66 implement IR_I_TO_F 2007-02-16 08:58:42 -07:00
Brian ed490e4643 remove dead code 2007-02-13 09:23:00 -07:00
Brian 5620392d67 add prog_debug.c 2007-02-09 15:40:15 -07:00
Brian 942ee02590 move GL_MESA_program_debug funcs to prog_debug.c 2007-02-09 15:40:00 -07:00
Brian 383ecc0374 Move experimental GL_MESA_program_debug functions into new file. 2007-02-09 15:39:32 -07:00
Brian b3893baf80 comments, etc 2007-02-09 14:19:12 -07:00
Brian 3d479b9638 re-enable free'ing of IR trees 2007-02-09 14:18:41 -07:00
Brian cf490a7f81 always init param vars to silence valgrind warnings 2007-02-09 12:04:52 -07:00
Brian 5e6908944b do full swizzled matching in _mesa_lookup_parameter_constant() 2007-02-08 20:39:42 -07:00
Brian bd9615bbc5 Check for constant-valued while/do loop conditions.
Allows us to:
1. avoid generating constant-valued BRK test for while(1)..
2. discard entire loop for while(0).
3. detection infinite loops at compile-time.
2007-02-08 17:40:29 -07:00
Brian c0a9f554be optimize conditional breaks/continues 2007-02-08 17:11:18 -07:00
Brian 6230ae7faf cont at top of loop, little clean-ups 2007-02-08 15:09:47 -07:00
Brian a1c2e87c4b remove some cruft 2007-02-08 15:08:16 -07:00
Brian fbf0f400b7 fix broken BRA for return stmts 2007-02-08 14:10:54 -07:00
Brian 34af2b7194 consolidate BRA with BRK, CONT 2007-02-08 14:10:19 -07:00
Brian c81aedeaec change BranchTarget to GLint 2007-02-08 14:09:34 -07:00
Brian b768c48547 Use conditional break in for/do/while loops. 2007-02-08 13:23:17 -07:00
Brian 97125fb370 Simplify code with eval_condition(). Implement conditional BRK. 2007-02-08 13:22:31 -07:00
Brian 2c75ef62ea remove old loop break/cont stuff 2007-02-07 16:19:19 -07:00
Brian b35b4566c2 high vs. low level if/then/else code emit 2007-02-07 16:11:00 -07:00
Brian c5e6bf63e6 s/%f/%g/ 2007-02-07 16:09:13 -07:00
Brian a7c2c7d6b2 Remove old functions for generating BRA-based looping. 2007-02-07 15:14:20 -07:00
Brian 4aa487e796 Use IR_LOOP to represent do-while and for-loops.
Also, start moving high vs. low-level instruction selection into slang_emit.c
2007-02-07 15:12:13 -07:00
Brian 1f99a7514e BRK and CONT work the same 2007-02-06 22:34:09 -07:00
Brian f22ed0986a Implement CONT, improve BRK.
IR_LOOP's BranchNode ptr is the head of a linked list of CONT and BRK nodes.
After emitting loop, walk over the linked list, filling in the CONT/BRK
instruction's BranchTarget field (location of the ENDLOOP instruction, or
one past).
2007-02-06 22:31:19 -07:00
Brian 5f7d4668c4 replace IR_BEGIN_LOOP/IR_END_LOOP with IR_LOOP 2007-02-06 21:33:29 -07:00
Brian 7e73bc32f5 new_node[0123]() functions 2007-02-06 20:53:09 -07:00
Brian 2043364516 redo IR_IF node, removing IR_ELSE, IR_ENDIF 2007-02-06 20:45:43 -07:00
Brian d434019633 additional comments for BranchTarget 2007-02-05 18:04:35 -07:00
Brian 2755c798f3 BRK instruction's BranchTarget field now used for efficiently breaking out of loops.
BRK's BranchTarget field actually points to the top of the loop, not the
bottom, since we don't know the later's location yet.  In the interpreter,
basically do an indirect jump to update the PC.
2007-02-05 18:01:02 -07:00
Brian 8608079647 Use IR node's BranchNode field for IF/ELSE/ENDIF instructions.
This allows us to back-patch the IF/ELSE instruction's BranchTarget field
to point to the location of the ELSE/ENDIF instructions.  No longer have to
search for ELSE/ENDIF in the interpreter.  Also makes it trivial to translate
IF/ELSE instructions into conditional/unconditional BRA instructions.
2007-02-05 17:18:10 -07:00