summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang/slang_codegen.c
AgeCommit message (Collapse)Author
2010-02-13mesa: Fix compiler warningsKarl Schultz
Add explicit casts, fix constant types, fix variable types. Fixes about 340 warnings in MSFT Visual Studio.
2010-01-27mesa: fix double->float assignment warnings, int/uint comparison warningsBrian Paul
Reported by Karl Schultz.
2010-01-04glsl: use varName variable in _slang_gen_assignment()Brian Paul
2009-12-29glsl: added uniform initializer checkBrian Paul
GLSL 1.10 disallows initializers for uniforms but GLSL 1.20 and later allows them. This patch uses the #version directive to allow/disallow uniform initializers. This addresses bug 25807, but piglit also needs to be fixed to specify the GLSL version in the shader.
2009-11-17mesa: fix assorted compiler warningsBrian Paul
2009-09-29glsl: add support for CMP instructionBrian Paul
2009-09-24glsl: init var to silence warningBrian Paul
2009-08-12glsl: move predefined shader input/output info/code to slang_builtin.cBrian Paul
This is a more logical place for this code. Also add some functions for querying vertex shader input names, types, etc.
2009-07-09glsl: do const parameter optimization for array element actual parametersBrian Paul
When a function parameter is const-qualified we can avoid making a copy of the actual parameter (we basically do a search/replace when inlining). This is now done for array element params too, resulting in better code (fewer MOV instructions). We should allow some other types of function arguments here but let's be conservative for the moment.
2009-06-26glsl: move/simplify error checking for 'return' statementsBrian Paul
2009-06-26glsl: overhaul 'return' statement handlingBrian Paul
A new node type (SLANG_OPER_RETURN_INLINED) is used to denote 'return' statements inside inlined functions which need special handling. All glean glsl1 tests pass for EmitContReturn=FALSE and TRUE.
2009-06-26glsl: predicate assignments according to __returnFlagBrian Paul
Fixes glean "function with early return (3)" case (when EmitContReturn=FALSE).
2009-06-26glsl: silence a problem warningBrian Paul
2009-06-26glsl: code refactoring for return statementsBrian Paul
2009-06-26glsl: fix assorted regressions related to early-return-removalBrian Paul
2009-06-26glsl: rework loop nesting codeBrian Paul
2009-06-26glsl: remove test for loop unrolling when we hit conditional cont/breakBrian Paul
This is no longer needed since we added the new _slang_loop_contains_continue_or_break() function/test.
2009-06-26glsl: checkpoint: predicate __retVal = expr with __returnFlagBrian Paul
The glean "function with early return (1)" test passes now.
2009-06-26glsl: use new helper functions in _slang_gen_logical_and/or()Brian Paul
2009-06-26glsl: checkpoint: replace 'return' with __returnFlag=true;Brian Paul
Needed for "remove early returns" transformation.
2009-06-26glsl: fix uninitialized var in _slang_gen_for_without_continue()Brian Paul
2009-06-26glsl: check-point: declare _returnFlagBrian Paul
2009-06-26glsl: use slang_generate_declaration() to consolidate some codeBrian Paul
2009-06-26glsl: remove obsolete commentBrian Paul
2009-06-26glsl: implement _slang_gen_while_without_continue()Brian Paul
2009-06-26glsl: fix a bug involving 'continue' in 'for' loopsBrian Paul
Need to execute the for loop's increment code before we continue. Add a slang_assemble_ctx::CurLoopOper field to keep track of the containing loop and avoid the "cont if true" path in this situation. Plus, assorted clean-ups.
2009-06-26glsl: use _slang_loop_contains_continue_or_break() to check for unrollingBrian Paul
The previous test failed for nested loops.
2009-06-26glsl: use new _slang_loop_contains_continue() helper functionBrian Paul
2009-06-26glsl: implement continue->break translation for do-while loopsBrian Paul
2009-06-26glsl: remove debug code, misc clean-upBrian Paul
2009-06-26glsl: implement continue->break transformation for for-loopsBrian Paul
2009-06-26glsl: don't unroll loops containing continue/breakBrian Paul
Just search the AST in _slang_can_unroll_for_loop().
2009-06-26Revert "slang: if/else/break & if/else/continue work for unrolled loops"Brian Paul
We should just check if the loop contains a continue/break in the _slang_can_unroll_for_loop() test function... This reverts commit 989856bde47d699d7e18798df4013fbf962e1d4b. Conflicts: src/mesa/shader/slang/slang_codegen.h
2009-04-01glsl: implement compiling/linking of separate compilation unitsBrian Paul
A shader program may consist of multiple shaders (source code units). If we find there are unresolved functions after compiling the unit that defines main(), we'll concatenate all the respective vertex or fragment shaders then recompile. This isn't foolproof but should work in most cases.
2009-03-20slang: Use _mesa_snprintf() wrapper.Michal Krol
2009-03-19slang: support uniform arraysAlan Hourihane
2009-03-19glsl: when debug pragma is on, emit comments about function calls/inlinesBrian Paul
BTW, the debug pragma syntax is "#pragma debug(on)"
2009-03-19slang: if/else/break & if/else/continue work for unrolled loopsAlan Hourihane
2009-03-18slang: redo the last commit for if/break & if/continue tests as itAlan Hourihane
wasn't good enough for deeply nested if's.
2009-03-18Revert "slang: if we detect an if/break or if/continue within a loop and we're"Alan Hourihane
This reverts commit 752296b8f311c5e3844f3ce89d17ba57224ce5ba.
2009-03-18slang: if we detect an if/break or if/continue within a loop and we'reAlan Hourihane
trying to unroll, bail, and fallback to doing the real loop.
2009-03-10glsl: remove _slang_attach_storage() functionBrian Paul
This was used to handle both variable declarations and references to variables. Instead, just do storage allocation and assignment for declarations and references, respectively. This is a step toward better var/uniform allocation (only allocate storage for vars/uniforms that are actually referenced by the code).
2009-03-10glsl: some clean-ups, remove old assertions, add new assertionsBrian Paul
2009-03-10glsl: remove stray/unneeded totalSize assignmentBrian Paul
2009-03-07mesa: gl_register_file enum typedefBrian Paul
2009-02-28mesa: rename, reorder FRAG_RESULT_x tokensBrian Paul
s/FRAG_RESULT_DEPR/FRAG_RESULT_DEPTH/ s/FRAG_RESULT_COLR/FRAG_RESULT/COLOR/ Remove FRAG_RESULT_COLH (NV half-precision) output since we never used it. Next, we might merge the COLOR and DATA outputs (COLOR0, COLOR1, etc).
2009-02-20glsl: use new IR opcodes for TEX instructions with shadow comparisonBrian Paul
Such TEX instructions will have the TexShadow flag set. The gl_program::ShadowSamplers field is now set in the linker. We missed that before.
2009-02-20glsl: rename GLSL texture assembly instructions to be more legibleBrian Paul
2009-02-20glsl: fix vec4_texp_rect IR code (need projective version)Brian Paul
2009-02-16glsl: silence some uninit var warningsBrian Paul