summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang
AgeCommit message (Collapse)Author
2009-05-22mesa: rename MAX_VERTEX_ATTRIBS to MAX_VERTEX_GENERIC_ATTRIBSBrian Paul
Be clearer that this is the number of generic vertex program/shader attributes, not counting the legacy attributes (pos, normal, color, etc).
2009-05-08glsl: check number of varying variables against the limitBrian Paul
Link fails if too many varying vars.
2009-05-08glsl: set vertex/fragment program Ids to aid with debuggingBrian Paul
2009-04-27Avoid a segfault in shader compilationRobert Ellison
If a shader reaches an out-of-memory condition while adding a new function (reallocating the function list), a segfault will occur during cleanup (because the num_functions field is non-zero, but the functions pointer is NULL). This fixes that segfault by zeroing out the num_functions field if reallocation fails.
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-07glsl: don't optimize program if MESA_GLSL=noptBrian Paul
2009-04-02glsl: fix segfault in linker when vertex or fragment shader was missingBrian Paul
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-04-01glsl: fix texgen state variable tokens in emit_statevars()Brian Paul
This fixes broken variable indexing into the gl_Eye/ObjectPlaneS/T/R/Q arrays. See bug 20986.
2009-03-25slang: ensure structure elements have their array length setAlan Hourihane
2009-03-20slang: Use _mesa_snprintf() wrapper.Michal Krol
2009-03-19slang: initialize the contextAlan Hourihane
2009-03-19slang: support uniform arraysAlan Hourihane
2009-03-19glsl: change GLSL #pragma initializationBrian Paul
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.
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-10glsl: fix typo: s/vec4_tex1d_proj/vec4_tex_1d_proj/Brian Paul
This regression came from commit c0b59420eec5ffdf22a5919d38851c3620b97c09.
2009-03-07mesa: gl_register_file enum typedefBrian Paul
2009-03-06glsl: call the program optimizerBrian Paul
This still needs more testing bug glean and Mesa GLSL tests seem OK.
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-24glsl: silence warningBrian 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-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-18glsl: fix link failure for variable-indexed varying output arraysBrian Paul
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.
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-16glsl: silence some uninit var warningsBrian Paul
2009-02-09mesa: merge gallium-0.2 into gallium-master-mergeBrian Paul
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
2009-02-06glsl: new MESA_GLSL env var for GLSL debugging featuresBrian Paul
Replaces the VERBOSE_GLSL, VERBOSE_GLSL_DUMP flags which only worked in debug builds. MESA_GLSL will work both in debug and non-debug builds. Also add facility to dump glUniform() calls to stdout.
2009-02-06Revert "mesa: meaningless whitespace change to see if git's working (ignore)"Brian Paul
This reverts commit b2e779988eeb595187933fe2122d86f8ccfe059c. I didn't mean to push this stuff yet. I'm having a bad git day...
2009-02-06mesa: meaningless whitespace change to see if git's working (ignore)Brian Paul
2009-02-04glsl: use _slang_var_swizzle() in a few places to simplify the code.Brian Paul
2009-02-04glsl: remove unused prototypeBrian Paul
2009-02-04glsl: replace assertion with conditional in _slang_pop_var_table()Brian Paul
We were hitting the assertion when we ran out of registers, which can happen. Also, add some additional assertions and freshen up some comments.
2009-02-02mesa: fix GLSL issue preventing use of all 16 generic vertex attributesBrian Paul
Only 15 actually worked before since we always reserved generic[0] as an alias for vertex position. The case of vertex attribute 0 is tricky. The spec says that there is no aliasing between generic vertex attributes 0..MAX_VERTEX_ATTRIBS-1 and the conventional attributes. But it also says that calls to glVertexAttrib(0, v) are equivalent to glVertex(v). The distinction seems to be in glVertex-mode versus vertex array mode. So update the VBO code so that if the shader uses generic[0] but not gl_Vertex, route the attribute data set with glVertex() to go to shader input generic[0]. No change needed for the glDrawArrays/Elements() path. This is a potentially risky change so regressions are possible. All the usual tests seem OK though.
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-28Make GL_ARB_draw_buffers mandatoryIan Romanick
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2009-01-22glsl: call _mesa_write_shader_to_file(). Debug-only, disabledBrian Paul
2009-01-22glsl: set shader->CompileStatus in _slang_compile()Brian Paul
2009-01-22Merge commit 'origin/master' into gallium-0.2Alan Hourihane
Conflicts: windows/VC8/mesa/osmesa/osmesa.vcproj windows/VC8/progs/demos/gears.vcproj windows/VC8/progs/progs.sln