summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/programopt.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: rename src/mesa/shader/ to src/mesa/program/Brian Paul2010-06-101-669/+0
|
* mesa: change _mesa_find_free_register() to find multiple free regsBrian Paul2010-02-011-2/+9
| | | | | | | | | | | | | | | | | Before, _mesa_find_free_register() would scan the given shader to find a free/unused register of the given type. But subsequent calls would return the same register again. This caused a failure in the _mesa_remove_output_reads() function which sometimes needs several free temps. Now use a new function which build a vector of 'used' flags and another function which searches that vector for an unused register starting at a position that's incremented for each call. Fixes fd.o bug 26317. Note that a regression test for this has been added to the glean/glsl1 test. (cherry picked from commit e0d01c9d7f46ccd531f8dd1a04c5ac067200ef1e)
* Merge branch 'mesa_7_6_branch' into mesa_7_7_branchBrian Paul2009-12-111-9/+5
|\
| * mesa: remove unnecessary loop in _mesa_remove_output_reads()Brian Paul2009-12-111-9/+5
| |
* | Merge branch 'outputswritten64'Ian Romanick2009-11-171-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a GLbitfield64 type and several macros to operate on 64-bit fields. The OutputsWritten field of gl_program is changed to use that type. This results in a fair amount of fallout in drivers that use programs. No changes are strictly necessary at this point as all bits used are below the 32-bit boundary. Fairly soon several bits will be added for clip distances written by a vertex shader. This will cause several bits used for varyings to be pushed above the 32-bit boundary. This will affect any drivers that support GLSL. At this point, only the i965 driver has been modified to support this eventuality. I did this as a "squash" merge. There were several places through the outputswritten64 branch where things were broken. I foresee this causing difficulties later for bisecting. The history is still available in the branch. Conflicts: src/mesa/drivers/dri/i965/brw_wm.h
* | mesa: added _mesa_nop_vertex/fragment_program()Brian Paul2009-09-291-0/+91
|/ | | | For debug/test purposes.
* mesa: add new FRAG_ATTRIB_FACE and FRAG_ATTRIB_PNTC fragment program inputsBrian Paul2009-07-291-1/+0
| | | | | | | | | | Previously, the FOGC attribute contained the fragment fog coord, front/back- face flag and the gl_PointCoord.xy values. Now each of those things are separate fragment program attributes. This simplifies quite a few things in Mesa and gallium. Need to test i965 driver and fix up point coord handling in the gallium/draw module...
* mesa: ensure UsesFogFragCoord value is set for non-glsl shadersKeith Whitwell2009-07-021-0/+1
| | | | | | 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.
* mesa: more complete fix for transform_invarient glitchesKeith Whitwell2009-05-081-2/+117
| | | | | | Add a new flag mvp_with_dp4 in the context, and use that to switch both ffvertex.c and programopt.c vertex transformation code to either DP4 or MUL/MAD implementations.
* mesa: merge the prog_src_register::NegateBase and NegateAbs fieldsBrian Paul2009-04-141-1/+1
| | | | | | 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.
* mesa: gl_register_file enum typedefBrian Paul2009-03-071-1/+1
|
* mesa: rename, reorder FRAG_RESULT_x tokensBrian Paul2009-02-281-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).
* mesa: import latest GLSL code from gallium-0.1 branchBrian Paul2008-08-161-6/+6
|
* silly bug: it's PROGRAM_VARYINGZack Rusin2008-06-121-1/+1
|
* glsl: make sure we replace all output reads with temporariesZack Rusin2008-06-121-5/+7
| | | | test in if.glsl
* clean-up swizzle fields in fog code, fix NegateBaseBrian Paul2008-05-141-11/+10
| | | | cherry-picked from gallium-0.1
* added _mesa_combine_parameter_lists()Brian Paul2008-05-141-2/+94
| | | | cherry-picked from gallium-0.1
* need to clamp MAD for linear fogBrian2007-04-161-0/+1
|
* use _mesa_copy_instructions()Brian2007-03-221-2/+1
|
* merge from masterBrian2007-03-211-2/+1
|\
| * Use _mesa_copy_instructions rather than memcpy in _mesa_insert_mvp_code.Oliver McFadden2007-03-181-2/+1
| |
* | replace GLint with gl_state_indexBrian2007-02-231-3/+3
| |
* | Undo some STATE_POINT/FOG changes. Max length of state token array is now 5.Brian2007-02-221-4/+5
| |
* | Merge branch 'origin' into glsl-compiler-1Brian2007-02-221-55/+31
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/mesa/main/state.c src/mesa/shader/program.c src/mesa/shader/program.h src/mesa/shader/programopt.c src/mesa/shader/slang/slang_execute.c src/mesa/sources src/mesa/swrast/s_arbshader.c src/mesa/swrast/s_context.c src/mesa/swrast/s_span.c src/mesa/swrast/s_zoom.c src/mesa/tnl/t_context.c src/mesa/tnl/t_save_api.c src/mesa/tnl/t_vb_arbprogram.c src/mesa/tnl/t_vp_build.c src/mesa/tnl/t_vtx_eval.c
| * optimize per-pixel fog programRoland Scheidegger2007-02-091-49/+30
| | | | | | | | | | | | | | use the same internal state as for vertex fog. From the old implemenentation, this changes a SUB+MUL into a MAD for linear fog, and saves a MUL for EXP/EXP2, plus saves a (constant) parameter. While here, fix the broken (forgotten) swizzling. (untested)
* | adjustments to STATE_ token layout/format so token[1] is always the array indexBrian2007-02-211-6/+8
| |
* | added _mesa_count_texture_indirections(), _mesa_count_texture_instructions()Brian2007-01-091-2/+84
| |
* | remove some unneeded includesBrian2006-12-141-3/+0
| |
* | Updated includes.Brian2006-12-141-1/+3
| |
* | Checkpoint of work for new GLSL compiler back-end. Lots of assorted changes.Brian2006-12-131-1/+4
|/
* Add a size parameter to _mesa_add_unnamed_constant() andBrian Paul2006-11-151-1/+1
| | | | | _mesa_add_named_constant() to indicate vector size (1, 2, 3 or 4). Always 4 for now...
* fix wrong inequalityBrian Paul2006-10-291-1/+1
|
* Change _mesa_init_instruction() to initialize an array of instructions.Brian Paul2006-10-291-3/+2
|
* Implement _mesa_append_fog_code() for fragment program fog options.Brian Paul2006-10-281-18/+177
|
* Rename _mesa_append_modelview_code() to _mesa_insert_mvp_code().Brian Paul2006-08-251-22/+23
| | | | | The four DP4 instructions are now inserted at the top of the program instead of appended to tail.
* Functions for vertex/fragment program transformations, optimizations, etc.Brian Paul2006-08-241-0/+146