summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang/slang_codegen.c
AgeCommit message (Collapse)Author
2007-03-12Implement GL_ARB_texture_rectangle supportBrian
This includes the sampler2DRect and sampler2DRectShadow types and the texture2DRect(), texture2DRectProj(), etc. built-in functions.
2007-03-12Add array bounds checking, fix memleaks, add null ptr checks.Brian
2007-03-11add NULL ptr checkBrian
2007-03-11Implement support for GL_ARB_draw_buffers with GL_MAX_DRAW_BUFFERS > 1.Brian
GL_MAX_DRAW_BUFFERS is currently 4. Added gl_FragData[] output for fragment programs. In _swrast_write_rgba_span() loop over the color outputs/renderbuffers.
2007-03-10Implement gl_FrontFacing for fragment shaders.Brian
For the time being, we put the gl_FrontFacing value in the FOGC.Y input register. Combining FOGC and FrontFacing in one register is a bit of a hack and may need to be changed someday.
2007-03-09add NULL ptr checkBrian
2007-03-08fix broken vec4_seq, vec4_sne instructionsBrian
2007-03-08Added IR_SLE and IR_SLT for <= and < operations.Brian
Using IR_SGE and IR_SGT with transposed args doesn't work since the __asm calls don't do argument matching by name, but by position. This fixes the broken lessThan() and lessThanEqual() functions.
2007-03-08; and {} statements were brokenBrian
2007-03-08remove unused new_cjump()Brian
2007-03-08rewrite _slang_gen_select() to use IF nodeBrian
2007-03-08s/_slang_gen_hl_if/_slang_gen_if/Brian
2007-03-08s/_slang_gen_hl_if/_slang_gen_if/Brian
2007-03-08check for attempted writes to read-only varsBrian
2007-03-08Rework matrix-related code.Brian
GLSL matrices are stored in column-major order while GL_ARB_vertex/fragment_program use row-major. So, need to use STATE_MATRIX_TRANSPOSE for built-in matrices. Unfortunately, this means that the expression M * V isn't very efficient since we need to extract the rows out of M. And that's the typical expression for vertex transformation: gl_ModelViewProjectionMatrix * gl_Position. Solve this inefficiency by looking for M*V expressions and replacing them with V*Transpose(M). Also, add support for GLSL 1.20's MatrixTranspose, Inverse and InverseTranspose matrices.
2007-03-07Fix problem with nested function calls such as y = f(f(x))Brian
Replace CurFunction with curFuncEndLabel.
2007-03-07s/equal/EQUAL/, fix bugs in logical or/and code.Brian
2007-03-07fix swizzled writemask bugBrian
2007-03-07additional error detectionBrian
2007-02-26Fix a few bugs in slang_operation variable scoping. Seems to fix a double-free.Brian
2007-02-26Overhaul of error handling.Brian
2007-02-23comments, clean-upBrian
2007-02-23Replace slang_ir_node::Target w/ Field. Remove Comment field. Clean-up.Brian
2007-02-23remove old _slang_gen_if()Brian
2007-02-23Re-implement branching with slang_labels.Brian
This eliminates the NOP instructions that had been used as placeholders for branch targets. Also, fix "return" statement bug.
2007-02-22emit high-level IF/ELSE/ENDIF for vertex progs nowBrian
2007-02-22remove unneeded #includes, misc clean-upBrian
2007-02-22get rid of some unused slang_variable fieldsBrian
2007-02-22Replace slang_allocate_storage() with simpler _slang_attach_storage()Brian
2007-02-21disable debugBrian
2007-02-21checkpoint overhaul of pre-defined uniform codeBrian
2007-02-20alloc IR_FIELD's Storage in codegen, like IR_ELEMENTBrian
2007-02-20work on struct/array handlingBrian
2007-02-20implement support for pre-defined uniform structs (state vars)Brian
2007-02-16change all enum tokens to uppercaseBrian
2007-02-16added a commentBrian
2007-02-09re-enable free'ing of IR treesBrian
2007-02-08Check for constant-valued while/do loop conditions.Brian
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-08optimize conditional breaks/continuesBrian
2007-02-08remove some cruftBrian
2007-02-08fix broken BRA for return stmtsBrian
2007-02-08Use conditional break in for/do/while loops.Brian
2007-02-07remove old loop break/cont stuffBrian
2007-02-07Remove old functions for generating BRA-based looping.Brian
2007-02-07Use IR_LOOP to represent do-while and for-loops.Brian
Also, start moving high vs. low-level instruction selection into slang_emit.c
2007-02-06Implement CONT, improve BRK.Brian
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-06replace IR_BEGIN_LOOP/IR_END_LOOP with IR_LOOPBrian
2007-02-06new_node[0123]() functionsBrian
2007-02-06redo IR_IF node, removing IR_ELSE, IR_ENDIFBrian
2007-02-05BRK instruction's BranchTarget field now used for efficiently breaking out ↵Brian
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.