summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader
Commit message (Collapse)AuthorAgeFilesLines
* glsl: loop unroll adjustmentsBrian Paul2009-01-061-1/+20
| | | | | | | Add a "max complexity" heuristic to allow unrolling long loops with small bodies and short loops with large bodies. The loop unroll limits may need further tweaking...
* glsl: implement loop unrolling for simple 'for' loopsBrian Paul2009-01-061-24/+205
| | | | | | | | | | | | | | | | | Loops such as this will be unrolled: for (i = 0; i < 4; ++i) { body; } where 'body' isn't too large. This also helps to fix the issue reported in bug #19190. The problem there is indexing vector types with a variable index. For example: vec4 v; v[2] = 1.0; // equivalent to v.z = 1.0 v[i] = 2.0; // variable index into vector!! Since the for-i loop can be unrolled, we can avoid the problems associated with variable indexing into a vector (at least in this case).
* mesa: Move var declaration to top of scope.Brian Paul2009-01-061-0/+8
| | | | (cherry picked from commit 3740a06e28f4cd09e2a3dce2da60320aa9304df1)
* mesa: fix a GLSL swizzled writemask bugBrian Paul2009-01-051-2/+18
| | | | | | | | | This fixes cases such as: vec4 v4; vec2 v2; v4.xz.yx = v2; The last line now correctly compiles into MOV TEMP[1].xz, TEMP[0].yyxw; Helps to fix the Humus Domino demo. See bug 19189.
* mesa: fix warning about possibly undefined var in GLSL compilerBrian Paul2009-01-021-6/+4
|
* mesa: fix another "out of samplers" problemBrian Paul2009-01-023-18/+50
| | | | | | Now only the samplers that are actually used by texture() functions are saved in the uniform variable list. Before, we could run out of samplers if too many were declared while only some of them were actually used.
* mesa: updated comments about GLSL constantsBrian Paul2009-01-011-2/+3
|
* mesa: increase max texture image units and GLSL samplers to 16Brian Paul2008-12-312-6/+7
| | | | | | | | | | | | | | | | The max texture coord units is still 8. All the fixed-function paths are still limited to 8 too. But GLSL shaders can use more samplers now. Note that some texcoord-related data structures are declared to be 16 elements in size rather than 8. This just simplifies the code in a few places; the extra elements aren't accessible to the user. These changes haven't been extensively tested yet, but sanity checking has been done. It should be possible to increase the max image units/samplers to 32 without doing anything special. Beyond that we'll need longer bitfields in a few places.
* mesa: fix bug in evaluation of structure fieldsBrian Paul2008-12-301-3/+1
| | | | Fixes incorrect size information. See bug 19273.
* mesa: allow variable indexing into the predefined uniform variable arraysBrian Paul2008-12-305-91/+376
| | | | | | | | | | | | | | | | | | | This allows code such as "vec4 a = gl_LightSource[i].ambient;" to work. When a built-in uniform array is indexed with a variable index we need to "unroll" the whole array into the parameter list (aka constant buffer) because we don't know which elements may be accessed at compile-time. In the case of the gl_LightSource array of size [8], we emit 64 state references into the parameter array (8 elements times 8 vec4s per gl_LightSourceParameters struct). Previously, we only allowed constant-indexed references to uniform arrays (such as gl_LightSource[2].position) which resulted in a single state reference being added to the parameter array, not 64. We still optimize this case. Users should be aware that using "gl_LightSource[i].ambient" in their shaders is a bit expensive since state validation will involve updating all 64 light source entries in the parameter list.
* mesa: better error message when running out of GLSL samplersBrian Paul2008-12-301-1/+4
|
* mesa: comments for some state varsBrian Paul2008-12-301-4/+4
|
* GLSL: The LOG2 macro doesn't have enough precisionIan Romanick2008-12-191-2/+9
| | | | | It looks like the LOG2 macro only has 8 or 9 bits of precission, but the ARB_vertex_program spec says "accurate to at least 10 bits".
* glsl: Fix handling of nested parens in macro actual arguments.Michal Krol2008-12-181-2/+15
|
* mesa: disable debug outputBrian Paul2008-12-161-2/+2
|
* mesa: fix some GLSL array regressionsBrian Paul2008-12-164-66/+85
| | | | | array.length() wasn't working. Swizzle mask for accessing elements of float arrays was incorrect.
* mesa: rename slang_library_noise.[ch] to prog_noise.[ch] and rename functionsBrian Paul2008-12-154-520/+650
| | | | | The noise functions were not glsl-specific. Also, ran indent on the code to clean it up.
* mesa: bump glsl grammar revisionBrian Paul2008-12-1511-13/+13
| | | | And update some copyrights.
* mesa: more re-org of variable declarations in glsl compilerBrian Paul2008-12-151-52/+56
|
* mesa: more comments, clean upBrian Paul2008-12-151-10/+12
|
* mesa: added comments, remove unused codeBrian Paul2008-12-151-32/+9
|
* mesa: checkpoint: handle uniform vars in _slang_gen_var_decl()Brian Paul2008-12-151-18/+59
| | | | | This allows uniform declarations with scalar/array initializers. The code is rough though, and will be cleaned up.
* mesa: use IFLOOR(x) instead of (int) FLOORF(x)Brian Paul2008-12-121-1/+1
|
* mesa: place glsl constant arrays in constant memoryBrian Paul2008-12-121-7/+93
| | | | | | | | For example, a declaration like const float[3] xxx = float[3](1.1, 2.2, 3.3); will place the array in the constant buffer whereas a regular, non-const array would be placed in the temporary register file. Next up: do the same thing for uniform arrays.
* mesa: remove old size=4 limitBrian Paul2008-12-121-1/+0
|
* mesa: code clean-up in glsl compilerBrian Paul2008-12-121-7/+8
|
* mesa: remove unneeded swizzle init code in glsl compilerBrian Paul2008-12-121-18/+0
|
* mesa: disable glsl debug outputBrian Paul2008-12-121-2/+2
|
* mesa: remove unused varpool code in glsl compilerBrian Paul2008-12-124-26/+0
|
* mesa: basic array constructors work nowBrian Paul2008-12-121-13/+144
| | | | | | For example: float[3] xxx = float[3](1.1, 2.2, 3.3); Optimizations for const-qualified arrays next.
* mesa: copy array_len in slang_fully_specified_type_copy()Brian Paul2008-12-121-0/+1
|
* mesa: remove incorrect array_len assignmentBrian Paul2008-12-121-1/+0
|
* mesa: array size fix in _slang_typeof_operation()Brian Paul2008-12-121-1/+9
|
* mesa: fix some more GLSL 1.20 array things.Brian Paul2008-12-122-12/+33
| | | | Function that return arrays should work now.
* mesa: more glsl function renamingBrian Paul2008-12-125-28/+28
|
* mesa: use _slang_alloc()Brian Paul2008-12-122-2/+2
|
* mesa: glsl compiler function renamingBrian Paul2008-12-1210-32/+32
|
* mesa: more glsl type/function movementBrian Paul2008-12-125-30/+14
|
* mesa: move some glsl compiler functions to different files to be more consistantBrian Paul2008-12-126-196/+197
|
* mesa: move _slang_locate_function() to different fileBrian Paul2008-12-124-83/+86
|
* mesa: remove unused fixup table code in glsl compilerBrian Paul2008-12-123-61/+1
|
* mesa: checkpoint: GLSL 1.20 array constructorsBrian Paul2008-12-127-24/+92
|
* mesa: consolidate variable declaration initializer code for globals tooBrian Paul2008-12-111-19/+3
|
* mesa: move variable initializer IR generation into _slang_gen_var_decl()Brian Paul2008-12-111-79/+93
| | | | More code consolidation coming...
* mesa: simplify some glsl variable declaration codeBrian Paul2008-12-111-23/+21
|
* mesa: glsl clean-upsBrian Paul2008-12-114-47/+56
|
* mesa: checkpoint commit of GLSL 1.20 array syntax.Brian Paul2008-12-1111-2836/+2974
| | | | | | This allows things like float[3] x = float[3](1., 2., 3.); Parsing and AST construction now. Codegen not working yet.
* mesa: in slang linker, replace assertion with link error when max samplers ↵Brian Paul2008-12-091-6/+18
| | | | exceeded
* mesa: fix default switch case in append_token(), see bug 18734Brian Paul2008-11-281-2/+3
|
* mesa: remove an assertion (see bug 18734)Brian Paul2008-11-271-1/+0
|