summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader
Commit message (Collapse)AuthorAgeFilesLines
* glsl: fix bug in sampler array indexingBrian Paul2009-08-261-3/+7
| | | | | | | | | Need to add the 'offset' parameter when indexing the parameter array. Before, if we were setting arrays of samplers, we were actually only setting the 0th sampler's value. Because of how progs/glsl/samplers.c is constructed, this wasn't showing up as a failure in the samplers_array output.
* ARB prog: Set error instead of falling through with incorrect valueBrian Paul2009-08-241-0/+3
| | | | | | | | | | | | | | If a fragment program only parameter was queried of a vertex program (e.g., GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB) no error would be set and a random value would be returned. This caused 'glxinfo -l' to show the same values for GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB, GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB, GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB, GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB, GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB, GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB as for GL_MAX_PROGRAM_ENV_PARAMETERS_ARB. This is confusing and incorrect. (cherry picked from master, commit 4bccd693a72a0b42dffc849034263a68e779ca91)
* glsl: Silence gcc uninitialized variable warning.Vinson Lee2009-08-241-1/+1
|
* glsl: fix some uninitialized pointersBrian Paul2009-08-131-2/+2
|
* mesa: move misplaced return statementBrian Paul2009-07-301-1/+1
| | | | Fixes regression from commit 7d93f817c9c5222e2bdbaa9fa9f03fc502bfe878
* mesa: add missing return after catching program errorBrian Paul2009-07-301-0/+1
|
* glsl: do const parameter optimization for array element actual parametersBrian Paul2009-07-091-2/+3
| | | | | | | | | | 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.
* glsl: fix incorrect indexing for gl_TextureMatrix[i][j]Brian Paul2009-07-091-5/+6
| | | | | The two indexes were mixed up when accessing a row of a matrix in an array of matrices.
* mesa/shaders: fix gl_NormalMatrix state parametersKeith Whitwell2009-07-031-1/+1
| | | | | | gl_NormalMatrix is the inverse transpose of the modelview matrix, but as every matrix here needs to be transposed, we end up with {MODELVIEW_MATRIX, INVERSE}.
* mesa: s/TRUE/GL_TRUEKeith Whitwell2009-07-021-1/+1
| | | | Fix compile breakage on Linux.
* mesa: ensure UsesFogFragCoord value is set for non-glsl shadersKeith Whitwell2009-07-022-0/+8
| | | | | | With recent changes to support frontfacing in glsl, it is necessary to ensure that the UsesFogFragCoord value is accurate in all shaders. We were previously not setting it for fixed-function and ARB_fs shaders.
* glsl: check number of varying variables against the limitBrian Paul2009-06-261-4/+9
| | | | | | Link fails if too many varying vars. (cherry picked from master, commit cc58fbcf2c5c88f406818db60910f537e03610d6)
* glsl: move/simplify error checking for 'return' statementsBrian Paul2009-06-261-22/+14
|
* glsl: overhaul 'return' statement handlingBrian Paul2009-06-263-215/+212
| | | | | | | 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.
* glsl: predicate assignments according to __returnFlagBrian Paul2009-06-261-4/+29
| | | | Fixes glean "function with early return (3)" case (when EmitContReturn=FALSE).
* glsl: added slang_variable::is_global fieldBrian Paul2009-06-261-0/+1
|
* glsl: silence a problem warningBrian Paul2009-06-261-1/+2
|
* glsl: code refactoring for return statementsBrian Paul2009-06-261-70/+88
|
* glsl: fix assorted regressions related to early-return-removalBrian Paul2009-06-262-14/+35
|
* glsl: comments, field reorderingBrian Paul2009-06-261-1/+4
|
* glsl: rework loop nesting codeBrian Paul2009-06-262-41/+87
|
* glsl: remove test for loop unrolling when we hit conditional cont/breakBrian Paul2009-06-261-4/+0
| | | | | This is no longer needed since we added the new _slang_loop_contains_continue_or_break() function/test.
* glsl: checkpoint: predicate __retVal = expr with __returnFlagBrian Paul2009-06-261-26/+60
| | | | The glean "function with early return (1)" test passes now.
* glsl: use new helper functions in _slang_gen_logical_and/or()Brian Paul2009-06-261-15/+9
|
* glsl: add commentsBrian Paul2009-06-261-0/+3
|
* glsl: checkpoint: replace 'return' with __returnFlag=true;Brian Paul2009-06-261-7/+68
| | | | Needed for "remove early returns" transformation.
* glsl: fix up scoping for parent/children in slang_operation_copy()Brian Paul2009-06-261-0/+9
| | | | This will need more testing, but no regressions seen so far.
* glsl: fix uninitialized var in _slang_gen_for_without_continue()Brian Paul2009-06-261-1/+1
|
* glsl: added slang_operation_free_children()Brian Paul2009-06-262-0/+17
|
* glsl: added slang_oper_num_children() helperBrian Paul2009-06-261-0/+7
|
* glsl: check-point: declare _returnFlagBrian Paul2009-06-261-0/+33
|
* glsl: added slang_operation_insert_child()Brian Paul2009-06-262-0/+23
|
* glsl: use slang_generate_declaration() to consolidate some codeBrian Paul2009-06-261-31/+37
|
* glsl: remove obsolete commentBrian Paul2009-06-261-3/+0
|
* glsl: implement _slang_gen_while_without_continue()Brian Paul2009-06-261-82/+115
|
* glsl: fix a bug involving 'continue' in 'for' loopsBrian Paul2009-06-262-23/+44
| | | | | | | | 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.
* glsl: added slang_oper_child_const()Brian Paul2009-06-261-0/+8
|
* glsl: use _slang_loop_contains_continue_or_break() to check for unrollingBrian Paul2009-06-261-5/+36
| | | | The previous test failed for nested loops.
* glsl: use new _slang_loop_contains_continue() helper functionBrian Paul2009-06-261-5/+126
|
* glsl: implement continue->break translation for do-while loopsBrian Paul2009-06-261-15/+219
|
* glsl: added slang_operation_literal_int/bool() helper functionsBrian Paul2009-06-261-0/+26
|
* glsl: don't allocate 0-length children array in slang_operation_copy()Brian Paul2009-06-261-6/+7
|
* glsl: remove debug code, misc clean-upBrian Paul2009-06-261-5/+0
|
* glsl: implement continue->break transformation for for-loopsBrian Paul2009-06-261-3/+167
|
* glsl: added slang_operation_add_children() and slang_oper_child() helpersBrian Paul2009-06-262-0/+25
|
* glsl: added slang_assemble_ctx::EmitContReturn field, initBrian Paul2009-06-262-0/+4
|
* glsl: don't unroll loops containing continue/breakBrian Paul2009-06-261-0/+6
| | | | Just search the AST in _slang_can_unroll_for_loop().
* Revert "slang: if/else/break & if/else/continue work for unrolled loops"Brian Paul2009-06-262-38/+7
| | | | | | | | | | | 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
* glsl: Added gl_shader_state::EmitContReturn fieldBrian Paul2009-06-261-0/+1
| | | | | | | This is the start of a glsl-continue-return feature branch to support a GLSL code generator option for 'continue' and 'return' statements. Some targets don't support CONT or RET statements so we'll need to try to generate code that does not use them...
* mesa: rename MAX_VERTEX_ATTRIBS to MAX_VERTEX_GENERIC_ATTRIBSBrian Paul2009-06-221-4/+4
| | | | | | Be clearer that this is the number of generic vertex program/shader attributes, not counting the legacy attributes (pos, normal, color, etc). (cherry picked from commit 4a95185c9f30c2de7a03bb1a0653f51b53b1111d)