summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/ffvertex_prog.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Fix fixed function spot lighting on newer hardware (again)Daniel Scharrer2016-08-191-14/+3
| | | | | | | | | | | | This was first fixed in commit b3f9c5c and then broken again in commit fe2d2c7, which removed the abs modifier from input registers. v2: Don't change the size of struct ureg. Cc: "12.0" <mesa-stable@lists.freedesktop.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91342 Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Daniel Scharrer <daniel@constexpr.org>
* mesa: Use bitmask/ffs to build ff vertex shader keys.Mathias Fröhlich2016-06-161-2/+4
| | | | | | | | | | | | | Replaces an iterate and test bit in a bitmask loop by a loop only iterating over the bits set in the bitmask. The bitmask used here for iteration is a combination of different enabled masks present for texture units. v2: Use _mesa_bit_scan{,64} instead of open coding. v3: Use u_bit_scan{,64} instead of _mesa_bit_scan{,64}. Reviewed-by: Brian Paul <brianp@vmware.com> Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
* mesa: Use bitmask/ffs to iterate enabled lights for ff shader keys.Mathias Fröhlich2016-06-161-13/+15
| | | | | | | | | | | | Replaces a loop that iterates all lights and test which of them is enabled by a loop only iterating over the bits set in the enabled bitmask. v2: Use _mesa_bit_scan{,64} instead of open coding. v3: Use u_bit_scan{,64} instead of _mesa_bit_scan{,64}. Reviewed-by: Brian Paul <brianp@vmware.com> Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
* mesa: Rename CoordReplaceBits back to CoordReplace.Mathias Fröhlich2016-06-161-1/+1
| | | | | | | | It used to be called like that and fits better with 80 columns. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
* mesa: Add gl_point_attrib::CoordReplaceBits bitfield.Mathias Fröhlich2016-06-161-1/+1
| | | | | | | | | | | | | The aim is to replace the CoordReplace array by a bitfield. Until all drivers are converted, establish the bitfield in parallel to the CoordReplace array. v2: Fix bitmask logic. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
* program: Remove NV_fragment_program Abs support.Matt Turner2016-03-011-1/+0
| | | | | | Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Acked-by: Brian Paul <brianp@vmware.com>
* program: Remove condition-code and precision support.Matt Turner2016-03-011-2/+0
| | | | | | Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Acked-by: Brian Paul <brianp@vmware.com>
* mesa: call ProgramStringNotify for fixed-function vertex programsMarek Olšák2015-10-091-2/+1
| | | | | | | | | Drivers weren't notified about this at all. This allows disabling on-demand compilation in drivers. Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Brian Paul <brianp@vmware.com> Tested-by: Brian Paul <brianp@vmware.com>
* mesa: Add abs input modifier to base for POW in ffvertex_progDaniel Scharrer2015-10-011-3/+14
| | | | | | | | | | | The result of POW for a negative base is undefined. Even when the result is multiplied by zero (which is the case here whenever the base is negative), the Inf and NaNs can propagate past that. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91342 Signed-off-by: Daniel Scharrer <daniel@constexpr.org> Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
* mesa: Avoid double promotion.Matt Turner2015-07-291-5/+5
| | | | Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
* mesa: fix shininess check for ffvertex_prog v2Tim Rowley2015-05-051-1/+1
| | | | | | | | Switch to using VERT_BIT_GENERIC macro, as varying_vp_inputs is a bitmask. Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: mesa-stable@lists.freedesktop.org
* Fix a few typosZoë Blade2015-04-271-1/+1
| | | | Reviewed-by: Francisco Jerez <currojerez@riseup.net>
* main: replace __FUNCTION__ with __func__Marius Predut2015-04-141-3/+3
| | | | | | | | | | | Consistently just use C99's __func__ everywhere. The patch was verified with Microsoft Visual studio 2013 redistributable package(RTM version number: 18.0.21005.1) Next MSVC versions intends to support __func__. No functional changes. Acked-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Marius Predut <marius.predut@intel.com>
* mesa: Use assert() instead of ASSERT wrapper.Matt Turner2015-02-231-3/+3
| | | | Acked-by: Eric Anholt <eric@anholt.net>
* mesa: Fix some signed-unsigned comparison warningsJan Vesely2015-01-211-2/+2
| | | | | | | | v2: s/unsigned int/unsigned/ in prog_optimize.c Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: David Heidelberg <david@ixit.cz> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
* mesa: move ShaderCompilerOptions into gl_constantsMarek Olšák2014-08-111-1/+1
| | | | | Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
* mesa: Replace use of _ReallyEnabled as a boolean with use of _Current.Eric Anholt2014-04-301-1/+1
| | | | | | | | | | | | | I'm probably not the only person that has tried to kill _ReallyEnabled. This does the mechanical part of the work, and cleans _ReallyEnabled from i965. I think that using _Current makes texture management clearer: You can't have multiple targets in use in the same texture image unit at the same time, because there's just that one pointer. Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: Drop _EnabledUnits.Eric Anholt2014-04-301-1/+1
| | | | | | | | | | | The field wasn't really valid, since we've got more than 32 units now. It turns out it was mostly just used for checking != 0, or checking for fixed function coordinates, though. v2: Fix mis-conversion in xm_line.c (caught by Ken). Reviewed-by: Matt Turner <mattst88@gmail.com> (v1) Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: Rename ArrayObj to VAO and DefaultArrayObj to DefaultVAO.Kenneth Graunke2014-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When reading through the Mesa drawing code, it's not immediately obvious to me that "ArrayObj" (gl_array_object) is the Vertex Array Object (VAO) state. The comment above the structure explains this, but readers still have to remember this and translate accordingly. Out of context, "array object" is a fairly vague. Even in context, "array" has a lot of meanings: glDrawArrays, vertex data stored in user arrays, gl_client_arrays, gl_vertex_attrib_arrays, and so on. Using the term "VAO" immediately associates these fields with the OpenGL concept, clarifying the situation and aiding programmer sanity. Completely generated by: $ find . -type f -print0 | xargs -0 sed -i \ -e 's/ArrayObj;/VAO;/g' \ -e 's/->ArrayObj/->VAO/g' \ -e 's/Array\.ArrayObj/Array.VAO/g' \ -e 's/Array\.DefaultArrayObj/Array.DefaultVAO/g' v2: Rerun command to resolve conflicts with Ian's meta patches. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: rename PreferDP4 to OptimizeForAOS.Matt Turner2014-01-211-1/+1
| | | | | | | | | This flag was really just a proxy for determining whether the backend was vector (AOS) or scalar (SOA). It will be used to apply a future optimization only for vector backends. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* s/Tungsten Graphics/VMware/José Fonseca2014-01-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tungsten Graphics Inc. was acquired by VMware Inc. in 2008. Leaving the old copyright name is creating unnecessary confusion, hence this change. This was the sed script I used: $ cat tg2vmw.sed # Run as: # # git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed # # Rename copyrights s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g /Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./ s/TUNGSTEN GRAPHICS/VMWARE/g # Rename emails s/alanh@tungstengraphics.com/alanh@vmware.com/ s/jens@tungstengraphics.com/jowen@vmware.com/g s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/ s/jrfonseca\?@tungstengraphics.com/jfonseca@vmware.com/g s/keithw\?@tungstengraphics.com/keithw@vmware.com/g s/michel@tungstengraphics.com/daenzer@vmware.com/g s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/ s/zack@tungstengraphics.com/zackr@vmware.com/ # Remove dead links s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g # C string src/gallium/state_trackers/vega/api_misc.c s/"Tungsten Graphics, Inc"/"VMware, Inc"/ Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: replace ctx->Const.{Vertex,Fragment,Geomtery}Program with an array.Paul Berry2014-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | These are replaced with ctx->Const.Program[MESA_SHADER_{VERTEX,FRAGMENT,GEOMETRY}]. In patches to follow, this will allow us to replace a lot of ad-hoc logic with a variable index into the array. With the exception of the changes to mtypes.h, this patch was generated entirely by the command: find src -type f '(' -iname '*.c' -o -iname '*.cpp' -o -iname '*.py' \ -o -iname '*.y' ')' -print0 | xargs -0 sed -i \ -e 's/Const\.VertexProgram/Const.Program[MESA_SHADER_VERTEX]/g' \ -e 's/Const\.GeometryProgram/Const.Program[MESA_SHADER_GEOMETRY]/g' \ -e 's/Const\.FragmentProgram/Const.Program[MESA_SHADER_FRAGMENT]/g' Suggested-by: Brian Paul <brianp@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: fix indentation in ffvertex_prog.cBrian Paul2013-11-221-12/+14
| | | | Reviewed-by: Roland Scheidegger <sroland@vmware.com>
* mesa: Add ARB_vertex_attrib_bindingFredrik Höglund2013-11-071-1/+1
| | | | | | | update_array() and update_array_format() are changed to update the new attrib and binding states, and the client arrays become derived state. Reviewed-by: Eric Anholt <eric@anholt.net>
* mesa: Rename gl_array_object::VertexAttrib to _VertexAttribFredrik Höglund2013-11-071-1/+1
| | | | | | | | This will become derived state as part of the ARB_vertex_attrib_binding support. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* mesa: Move the mvp_with_dp4 flag to ShaderCompilerOptions.Kenneth Graunke2013-05-121-1/+1
| | | | | | | | | | | | | | | This flag essentially tells the compiler whether it prefers dot products or multiply/adds for matrix operations. As such, ShaderCompilerOptions seems like the right place for it. This also lets us specify it on a per-stage basis. This patch makes all existing users set the flag for the Vertex Shader stage only, as it's currently only used for fixed-function vertex programs. That will change soon, and I wanted to preserve the existing behavior. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* mesa: remove unused opcodes AND, DP2A, NOT, NRM3, NRM4, OR, PRINT, XORMarek Olšák2013-04-241-6/+0
| | | | | Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* mesa: remove #include "mfeatures.h" from numerous source filesBrian Paul2013-04-171-1/+0
| | | | | | None of the remaining FEATURE_x symbols in mfeatures.h are used anymore. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* Replace gl_frag_attrib enum with gl_varying_slot.Paul Berry2013-03-151-7/+7
| | | | | | | | | | | | This patch makes the following search-and-replace changes: gl_frag_attrib -> gl_varying_slot FRAG_ATTRIB_* -> VARYING_SLOT_* FRAG_BIT_* -> VARYING_BIT_* Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Tested-by: Brian Paul <brianp@vmware.com>
* Replace gl_vert_result enum with gl_varying_slot.Paul Berry2013-03-151-19/+19
| | | | | | | | | | | This patch makes the following search-and-replace changes: gl_vert_result -> gl_varying_slot VERT_RESULT_* -> VARYING_SLOT_* Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Tested-by: Brian Paul <brianp@vmware.com>
* Revert "mesa: assert that key->fragprog_inputs_read value isn't too large"Brian Paul2012-11-091-2/+0
| | | | | | | | This reverts commit 0d61f879a1f2e6bb37368731a29d5267e1c25195. Assigning the FS inputs to the 12 bit field is fine since we don't care about the higher FS inputs. Maybe I'll revisit silencing the compiler warning another day.
* mesa: assert that key->fragprog_inputs_read value isn't too largeBrian Paul2012-11-061-0/+2
| | | | | | | fragprog_inputs_read is a 12-bit bitfield so check the assigned value. MSVC warns on the assignment. Not easy to fix but let's do a sanity check. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
* mesa: Remove prog_instruction.h field for never-supported NV_vertex_program3.Eric Anholt2012-10-151-1/+0
| | | | Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: remove FEATURE_point_size_array define.Oliver McFadden2012-09-151-2/+0
| | | | | Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: improve comment in build_tnl_program()Brian Paul2012-07-241-1/+1
|
* mesa: remove stale commentBrian Paul2012-07-181-1/+0
|
* mesa: use gl_program cast wrappersBrian Paul2012-07-181-4/+3
| | | | | | | In a few cases, remove unneeded casts. And fix a few other const-correctness issues. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: rename ColorMaterialBitmask to _ColorMaterialBitmaskBrian Paul2012-06-271-1/+1
| | | | Since it's a derived field.
* mesa: remove _mesa_ffs(), implement ffs() for non-GNU platformsBrian Paul2012-01-121-1/+1
| | | | | | | | | | | Call ffs() and ffsll() everywhere. Define our own ffs(), ffsll() functions when the platform doesn't have them. v2: remove #ifdef _WIN32, __IBMC__, __IBMCPP_ tests inside ffs() implementation. The #else clause was recursive. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Tested-by: Alexander von Gluck <kallisti5@unixzen.com>
* mesa: distinct gl_client_array arrays are goneChia-I Wu2011-11-291-1/+1
| | | | | | Fix build errors since 762c9766c93697af8d7fbaa729aed118789dbe8e. Acked-by: Jose Fonseca <jfonseca@vmware.com>
* mesa: Make gl_program::InputsRead 64 bits.Mathias Fröhlich2011-11-291-9/+9
| | | | | | | | | Make gl_program::InputsRead a 64 bits bitfield. Adapt the intel and radeon driver to handle a 64 bits InputsRead value. Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de> Reviewed-by: Eric Anholt <eric@anholt.net>
* mesa: do not skip att and spot calculation for infinite lightYuanhan Liu2011-11-161-63/+50
| | | | | | | | | | | | | | | | | | glspec doesn't say that we should skip the attenuation and spot calculation for infinite light(Ppli.w == 0). Instead, it gives a same formula to do the light calculation for both finite light and infinite light(see page 62 of glspec 2.1.pdf) Also from the formula (2.4) at page 62 of glspec 2.1.pdf, we can skip attenuation calculation if Ppli.w == 0. This would fix all the intel oglc l_sed fail subcases and introduces no intel oglc regressions. v2: fix an wrong intendation(comments from Brian). Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Acked-by: Brian Paul <brianp@vmware.com>
* mesa: Add NV_fog_distance to the fixed-function vertex program generatorNicholas Miell2011-11-011-4/+39
| | | | | This is all that is needed to implement NV_fog_distance on programmable hardware.
* mesa: support boolean and integer-based parameters in prog_parameterBryan Cain2011-08-011-5/+5
| | | | | | The functionality is not used by anything yet, and the glUniform functions will need to be reworked before this can reach its full usefulness. It is nonetheless a step towards integer support in the state tracker and classic drivers.
* mesa: Directly include mfeatures.h in files that perform feature tests.Vinson Lee2011-01-071-0/+1
|
* Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg2010-10-131-3/+3
|
* mesa: rename src/mesa/shader/ to src/mesa/program/Brian Paul2010-06-101-6/+6
|
* ffvertex: don't touch tex coords if coord replace is enabled.Dave Airlie2010-04-131-0/+8
| | | | | | | | | | | | | | The fixed function vertex program shouldn't need to deal or touch tex coords if stuffing is enabled. Though I'm not 100% this won't break assumption made elsewhere it seems like the correct thing to do, and makes r300g point sprites a lot easier to implement. draw: fix point-sprite when vertex program is used. This commit regressed draw, so fix it as well to help bisection. Signed-off-by: Dave Airlie <airlied@redhat.com>
* Replace the _mesa_*printf() wrappers with the plain libc versionsKristian Høgsberg2010-02-191-4/+4
|
* Remove _mesa_memset in favor of plain memset.Kenneth Graunke2010-02-191-1/+1
| | | | This may break the SUNOS4 build, but it's no longer relevant.