summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang/slang_emit.c
AgeCommit message (Collapse)Author
2009-11-10slang: Fix return value check.Michal Krol
2009-11-10slang: Check OOM conditions for alloc_node_storage().Michal Krol
2009-11-10slang: Check return value from new_instruction().Michal Krol
2009-11-10slang: Handle OOM condition in new_instruction().Michal Krol
2009-09-29glsl: add support for CMP instructionBrian Paul
2009-04-14mesa: merge the prog_src_register::NegateBase and NegateAbs fieldsBrian Paul
There's really no need for two negation fields. This came from the GL_NV_fragment_program extension. The new, unified Negate bitfield applies after the absolute value step.
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-19glsl: when debug pragma is on, emit comments about function calls/inlinesBrian Paul
BTW, the debug pragma syntax is "#pragma debug(on)"
2009-03-07mesa: gl_register_file enum typedefBrian Paul
2009-02-23glsl: yet another swizzled expression fixBrian Paul
This fixes swizzled conditional expressions such "(b ? p : q).x"
2009-02-23glsl: fix another swizzle-related bugBrian Paul
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.
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-18glsl: fix a swizzle-related regressionBrian Paul
This new issue was exposed by commit 6eabfc27f19a10dfc2663e99f9560966ba1ff697
2009-02-17glsl: fix mistake in a commentBrian Paul
2009-02-17glsl: fix an array indexing bugBrian Paul
This fixes a bug found with swizzled array indexes such as in "array[index.z]" where "index" is an ivec4.
2009-02-02glsl: update program->InputsRead when referencing input attributesBrian Paul
This info will be used in the linker for allocating generic vertex attribs.
2009-01-16glsl: fix broken sampler assignmentsBrian Paul
2009-01-14glsl: propagate pragma info down into compiler from preprocessorBrian Paul
2009-01-14glsl: simplify IR storage for samplersBrian Paul
Don't overload the Size field with the texture target, to avoid confusion.
2009-01-14glsl: support sampler arrays.Alan Hourihane
2009-01-07mesa: Add _mesa_snprintf.José Fonseca
On Windows snprintf is renamed as _snprintf. (cherry picked from commit f8f9a1b620d31d1a59855fd502caed325d4a324f)
2009-01-02mesa: fix warning about possibly undefined var in GLSL compilerBrian Paul
2009-01-02mesa: fix another "out of samplers" problemBrian Paul
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.
2008-12-30mesa: fix bug in evaluation of structure fieldsBrian Paul
Fixes incorrect size information. See bug 19273.
2008-12-30mesa: allow variable indexing into the predefined uniform variable arraysBrian Paul
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.
2008-12-16mesa: fix some GLSL array regressionsBrian Paul
array.length() wasn't working. Swizzle mask for accessing elements of float arrays was incorrect.
2008-11-26mesa: add missing size check for assignment optimizationBrian Paul
2008-11-21mesa: better variable name: s/aux/store/Brian Paul
2008-11-19mesa: rework GLSL array code generationBrian Paul
We now express arrays in terms of indirect addressing. For example: dst = a[i]; becomes: MOV dst, TEMP[1 + TEMP[2].y]; At instruction-emit time indirect addressing is converted into ARL/ ADDR-relative form: ARL ADDR.x, TEMP[2].y; MOV dst, TEMP[1 + ADDR.x]; This fixes a number of array-related issues. Arrays of arrays and complex array/struct nesting works now. There may be some regressions, but more work is coming.
2008-11-19mesa: don't realloc instruction buffer so oftenBrian Paul
2008-11-13mesa: no longer need Writemask field in GLSL IR nodesBrian Paul
The Swizzle and Size fields carry all the info we need now.
2008-11-13mesa: revamp GLSL instruction emit codeBrian Paul
This is a step toward better array handling code. In particular, when more than one operand of an instruction uses indirect addressing, we'll need some temporary instructions and registers. By converting IR storage to instruction operands all in one place (emit_instruction()) we can be smarter about this. Also, somewhat better handling of dst register swizzle/writemask handling. This results in tighter writemasks on some instructions which is good for SOA execution. And, cleaner instruction commenting with inst_comment(). Next: remove some more dead code and additional clean-ups...
2008-11-07mesa: add GLSL support for DP2, NRM3, NRM4 instructions (not actually ↵Brian Paul
emitted yet though)
2008-11-05mesa: fix a GLSL array indexing codegen bugBrian Paul
Expressions like array[i] + array[j] didn't work properly before.
2008-11-01mesa: fix assignment / parameter passing of sampler typesBrian Paul
2008-08-25mesa: glsl: grab latest fixes from gallium-0.1 branchBrian Paul
Includes: 1. Fixes failed asserting about bad swizzles in src reg emit. 2. Tracks uniform var usage. 3. Emit exp() in terms of EXP2 instruction.
2008-08-16mesa: import latest GLSL code from gallium-0.1 branchBrian Paul
2008-07-29mesa: glsl: remove old assertion (fixes glsl/bitmap.c)Brian Paul
2008-07-29mesa: glsl: assorted fixes for resolving polymorphic functionsBrian Paul
Plus, - fix some issues in casting function arguments to format param types. - fix some vec/mat constructor bugs - find/report more syntax/semantic errors
2008-07-29mesa: glsl: additional error detectionBrian Paul
Plus begin some fixes for vec/matrix constructors.
2008-07-29mesa: gls: fix broken else clause of conditional break/continueBrian Paul
In the following case: for () { if (cond) break; // or continue; else something; } The "something" block didn't get emitted.
2008-07-29mesa: glsl: fix/simplify array element handlingBrian Paul
Also fix bug in comparing large structs/arrays.
2008-07-29mesa: glsl: rework swizzle storage handlingBrian Paul
Build on the heirarchal approach implemented for arrays/structs.
2008-07-29mesa: initial support for GLSL struct/array comparisonsBrian Paul
2008-07-29mesa: added null ptr check (error handling case)Brian Paul
2008-07-29mesa: glsl: various writemask/swizzle improvements and clean-upsBrian Paul
2008-07-29mesa: rework array/struct addressing code.Brian Paul
The slang_ir_storage type now has a pointer to parent storage to represent storage of an array element within an array, or a field within a struct. This fixes some problems related to addressing of fields/elements in non- trivial cases. More work to follow.
2008-07-16mesa: fix temp re-use bug in emit_arith()Brian Paul
2008-07-15mesa: add missing IR_LOG2 caseBrian Paul
2008-07-15mesa: fix storage size computation in emit_arith()Brian Paul