summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/slang
Commit message (Collapse)AuthorAgeFilesLines
* glsl: don't optimize program if MESA_GLSL=noptBrian Paul2009-04-071-1/+2
|
* glsl: fix segfault in linker when vertex or fragment shader was missingBrian Paul2009-04-021-9/+14
|
* glsl: implement compiling/linking of separate compilation unitsBrian Paul2009-04-015-23/+138
| | | | | | | | | 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.
* glsl: fix texgen state variable tokens in emit_statevars()Brian Paul2009-04-011-8/+16
| | | | | This fixes broken variable indexing into the gl_Eye/ObjectPlaneS/T/R/Q arrays. See bug 20986.
* slang: ensure structure elements have their array length setAlan Hourihane2009-03-251-0/+1
|
* slang: Use _mesa_snprintf() wrapper.Michal Krol2009-03-201-1/+1
|
* slang: initialize the contextAlan Hourihane2009-03-191-2/+3
|
* slang: support uniform arraysAlan Hourihane2009-03-191-1/+13
|
* glsl: change GLSL #pragma initializationBrian Paul2009-03-192-14/+13
| | | | | | Initialize the shader's pragma settings before calling the compiler. Added pragma "Ignore" fields to allow overriding the #pragma directives found in shader source code.
* glsl: when debug pragma is on, emit comments about function calls/inlinesBrian Paul2009-03-193-0/+13
| | | | BTW, the debug pragma syntax is "#pragma debug(on)"
* slang: if/else/break & if/else/continue work for unrolled loopsAlan Hourihane2009-03-192-7/+38
|
* slang: redo the last commit for if/break & if/continue tests as itAlan Hourihane2009-03-181-1/+8
| | | | wasn't good enough for deeply nested if's.
* Revert "slang: if we detect an if/break or if/continue within a loop and we're"Alan Hourihane2009-03-181-28/+17
| | | | This reverts commit 752296b8f311c5e3844f3ce89d17ba57224ce5ba.
* slang: if we detect an if/break or if/continue within a loop and we'reAlan Hourihane2009-03-181-17/+28
| | | | trying to unroll, bail, and fallback to doing the real loop.
* glsl: remove _slang_attach_storage() functionBrian Paul2009-03-101-52/+21
| | | | | | | | | 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).
* glsl: some clean-ups, remove old assertions, add new assertionsBrian Paul2009-03-101-7/+6
|
* glsl: remove stray/unneeded totalSize assignmentBrian Paul2009-03-101-1/+1
|
* glsl: fix typo: s/vec4_tex1d_proj/vec4_tex_1d_proj/Brian Paul2009-03-102-24/+24
| | | | This regression came from commit c0b59420eec5ffdf22a5919d38851c3620b97c09.
* mesa: gl_register_file enum typedefBrian Paul2009-03-074-14/+14
|
* glsl: call the program optimizerBrian Paul2009-03-061-0/+5
| | | | This still needs more testing bug glean and Mesa GLSL tests seem OK.
* mesa: rename, reorder FRAG_RESULT_x tokensBrian Paul2009-02-282-3/+3
| | | | | | | 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).
* glsl: silence warningBrian Paul2009-02-241-1/+1
|
* glsl: yet another swizzled expression fixBrian Paul2009-02-231-2/+5
| | | | This fixes swizzled conditional expressions such "(b ? p : q).x"
* glsl: fix another swizzle-related bugBrian Paul2009-02-231-13/+8
| | | | | | | This fixes the case of "infinitely" nested swizzles such as EXPR.wzyx.yxwz.xxyz This doesn't appear in typical shaders but with function inlining and the compiler's internal use of swizzles it can happen. New glean glsl1 test case added for this.
* glsl: use new IR opcodes for TEX instructions with shadow comparisonBrian Paul2009-02-2011-171/+213
| | | | | | Such TEX instructions will have the TexShadow flag set. The gl_program::ShadowSamplers field is now set in the linker. We missed that before.
* glsl: rename GLSL texture assembly instructions to be more legibleBrian Paul2009-02-207-321/+327
|
* glsl: fix vec4_texp_rect IR code (need projective version)Brian Paul2009-02-201-1/+1
|
* glsl: fix link failure for variable-indexed varying output arraysBrian Paul2009-02-181-0/+25
| | | | | | | | | | | | | | | If the vertex shader writes to a varying array with a variable index, mark all the elements of that array as being written. For example, if the vertex shader does: for (i = 0; i < 4; i++) gl_TexCoord[i] = expr; Mark all texcoord outputs as being written, not just the first. Linking will fail if a fragment shader tries to read an input that's not written by the vertex shader. Before this fix, this linker test could fail.
* glsl: fix a swizzle-related regressionBrian Paul2009-02-181-1/+1
| | | | This new issue was exposed by commit 6eabfc27f19a10dfc2663e99f9560966ba1ff697
* glsl: fix mistake in a commentBrian Paul2009-02-171-1/+1
|
* glsl: fix an array indexing bugBrian Paul2009-02-171-10/+43
| | | | | This fixes a bug found with swizzled array indexes such as in "array[index.z]" where "index" is an ivec4.
* glsl: silence some uninit var warningsBrian Paul2009-02-162-2/+2
|
* mesa: merge gallium-0.2 into gallium-master-mergeBrian Paul2009-02-092-65/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge commit 'origin/gallium-0.2' into gallium-master-merge Conflicts: Makefile docs/relnotes-7.4.html docs/relnotes.html src/mesa/drivers/dri/i965/brw_wm.h src/mesa/main/imports.c src/mesa/main/mtypes.h src/mesa/main/texcompress.c src/mesa/main/texenvprogram.c src/mesa/main/version.h src/mesa/vbo/vbo_exec_api.c src/mesa/vbo/vbo_save_draw.c
| * Merge commit 'origin/master' into gallium-0.2Alan Hourihane2009-01-221-0/+2
| |\ | | | | | | | | | | | | | | | | | | Conflicts: windows/VC8/mesa/osmesa/osmesa.vcproj windows/VC8/progs/demos/gears.vcproj windows/VC8/progs/progs.sln
| * \ Merge commit 'origin/master' into gallium-0.2Alan Hourihane2009-01-165-10/+24
| |\ \ | | | | | | | | | | | | | | | | Conflicts: src/mesa/shader/slang/slang_compile.c
| * | | mesa: Fix merge conflictsJakob Bornecrantz2009-01-151-15/+0
| | | |
| * | | Merge commit 'origin/master' into gallium-0.2Alan Hourihane2009-01-1413-60/+226
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: docs/install.html docs/relnotes-7.3.html src/mesa/shader/slang/slang_codegen.c src/mesa/shader/slang/slang_compile.c src/mesa/shader/slang/slang_emit.c src/mesa/shader/slang/slang_preprocess.c src/mesa/shader/slang/slang_preprocess.h
| * | | | glsl: fix regression from sampler arrays commitAlan Hourihane2009-01-141-3/+1
| | | | |
| * | | | glsl: fix a comment typoAlan Hourihane2009-01-131-1/+1
| | | | |
| * | | | glsl: support sampler arrays.Alan Hourihane2009-01-133-11/+49
| | | | |
| * | | | glsl: fix typo in the vec2 += operator functionBrian Paul2009-01-092-2/+2
| | | | |
| * | | | glsl: fix broken +=, -=, *=, /= operatorsBrian Paul2009-01-092-737/+786
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These functions need to return the final computed value. Now expressions such as a = (b += c) work properly. Also, no need to use __asm intrinsics in these functions. The resulting code is the same when using ordinary arithmetic operators and is more legible.
| * | | | glsl: pass GLcontext::Extension info down into GLSL preprocessorBrian Paul2009-01-093-35/+65
| | | | | | | | | | | | | | | | | | | | Now the #extension directives can be handled properly.
| * | | | glsl: bump up MAX_FOR_LOOP_UNROLL_COMPLEXITYBrian Paul2009-01-091-1/+1
| | | | |
| * | | | glsl: check that the fragment shader does not write both gl_FragColor and ↵Brian Paul2009-01-091-0/+11
| | | | | | | | | | | | | | | | | | | | gl_FragData[]
| * | | | glsl: disable some unused functions (but don't remove just yet)Brian Paul2009-01-091-1/+8
| | | | |
| * | | | glsl: also unroll loops with variable declarations such as "for (int i = 0; ..."Brian Paul2009-01-091-24/+58
| | | | |
| * | | | glsl: remove dead codeBrian Paul2009-01-091-13/+2
| | | | |
| * | | | glsl: loop unroll adjustmentsBrian Paul2009-01-091-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-091-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).