aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/program/prog_statevars.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Convert gl_context::Viewport to gl_context::ViewportArrayCourtney Goeltzenleuchter2014-01-201-3/+3
| | | | | | | | | | | Only element 0 of the array is used anywhere at this time, so there should be no changes. v4: Split out from a single megapatch. Suggested by Ken. Signed-off-by: Courtney Goeltzenleuchter <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Fix setup of LocalParams array.Eric Anholt2013-11-201-0/+14
| | | | | | | | | | | | | | | | | | | i965 passed piglit, but swrast and gallium both segfaulted without this. i965 happened to work because it never ran _mesa_load_state_parameters() on the new program before the test called glProgramLocalParameter(), which was allocating a LocalParams array for the fallback path. v2: Since v1 threw away old localparams data, leaked old LocalParams memory, only fixed fragment programs, and I was dubious of my previous invariants already (nothing but program_parse.y will generate LocalParams, and only that one path of program_parse.y will), just late-allocate localparams at the other point of dereferencing them. This adds overhead to _mesa_load_state_parameter, which is uncomfortable, but I'm pretty sure that giant switch statement is super slow already. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71734 Tested-by: Michel Dänzer <[email protected]>
* mesa: Pass number of samples as a program state variableAnuj Phogat2013-11-011-0/+11
| | | | | | | | | | | | | Number of samples will be required in fragment shader program by new GLSL builtin uniform "gl_NumSamples". V2: Use "state.numsamples" in place of "state.num.samples" Use _NEW_BUFFERS flag in place of _NEW_MULTISAMPLE Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Ken Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* mesa: Properly set the fog scale (gl_Fog.scale) to +INF when fog start and ↵Henri Verbeet2013-09-101-2/+1
| | | | | | | | | | | | | | | | | | | | | | | end are equal. This was originally introduced by commit ba47aabc9868b410cdfe3bc8b6d25a44a598cba2, but unfortunately the commit message doesn't go into much detail about why +INF would be a problem here. A similar issue exists for STATE_FOG_PARAMS_OPTIMIZED, but allowing infinity there would potentially introduce NaNs where they shouldn't exist, depending on the values of fog end and the fog coord. Since STATE_FOG_PARAMS_OPTIMIZED is only used for fixed function (including ARB_fragment_program with fog option), and the calculation there probably isn't very stable to begin with when fog start and end are close together, it seems best to just leave it alone. This fixes piglit glsl-fs-fogscale, and a couple of Wine D3D tests. No piglit regressions on Cayman. Signed-off-by: Henri Verbeet <[email protected]> Tested-by: Brian Paul <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove outdated version lines in commentsRico Schüller2013-06-051-1/+0
| | | | Signed-off-by: Brian Paul <[email protected]>
* mesa: Restore 78-column wrapping of license text in C-style comments.Kenneth Graunke2013-04-231-3/+4
| | | | | | | | | | | | | | The previous commit introduced extra words, breaking the formatting. This text transformation was done automatically via the following shell command: $ git grep 'THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY' | sed 's/:.*$//' | xargs -I {} sh -c 'vim -e -s {} < vimscript where 'vimscript' is a file containing: /THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY/;/\*\// !fmt -w 78 -p ' * ' :wq Reviewed-by: Brian Paul <[email protected]>
* mesa: Add "OR COPYRIGHT HOLDERS" to license text disclaiming liability.Kenneth Graunke2013-04-231-1/+1
| | | | | | | | | | | | | | | This brings the license text in line with the MIT License as published on the Open Source Initiative website: http://opensource.org/licenses/mit-license.php Generated automatically be the following shell command: $ git grep 'THE AUTHORS BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \ sed -i 's/THE AUTHORS/THE AUTHORS OR COPYRIGHT HOLDERS/' {} This introduces some wrapping issues, to be fixed in the next commit. Reviewed-by: Brian Paul <[email protected]>
* mesa: Change "BRIAN PAUL" to "THE AUTHORS" in license text.Kenneth Graunke2013-04-231-1/+1
| | | | | | | | | | | | | | | | Generated automatically be the following shell command: $ git grep 'BRIAN PAUL BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \ sed -i 's/BRIAN PAUL/THE AUTHORS/' {} The intention here is to protect all authors, not just Brian Paul. I believe that was already the sensible interpretation, but spelling it out is probably better. More practically, it also prevents people from accidentally copy & pasting the license into a new file which says Brian is not liable when he isn't even one of the authors. Reviewed-by: Brian Paul <[email protected]>
* mesa: don't set _ClampFragmentColor to TRUE if it has no effectMarek Olšák2013-04-061-2/+3
| | | | | | | | This should reduce shader recompilations with drivers that emulate fragment color clamping, because we want the clamping to be enabled only if there is a signed normalized or floating-point colorbuffer. Reviewed-by: Brian Paul <[email protected]>
* mesa: handle STATE_CURRENT_ATTRIB_MAYBE_VP_CLAMPED for parameter printingMarek Olšák2013-03-281-0/+3
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Remove support for NV_vertex_program's tracked matrices.Eric Anholt2012-10-151-91/+0
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Kill GL_ARB_shadow_ambient with fireIan Romanick2012-08-141-20/+0
| | | | | | | | | | No driver supports this extension, and it seems unlikely than any driver ever will. I think r300c may have supported it at one time, but that driver has already been removed. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/program: Use sampler object state if presentPauli Nieminen2012-08-011-1/+4
| | | | | | | | | CompareFailValue is part of Sampler state that needs to be read from bound sampler object if present. Signed-off-by: Pauli Nieminen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove _math_matrix_alloc_inv()Brian Paul2012-07-261-1/+0
| | | | | | | Always allocate space for the inverse matrix in _math_matrix_ctr() since we were always calling _math_matrix_alloc_inv() anyway. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Make more consistent use of _mesa_is_{user,winsys}_fbo()Paul Berry2012-07-261-1/+2
| | | | | | | | | | A lot of code was still differentiating between between winsys and user fbos by testing the fbo's name against zero. This converts everything in core mesa, the state tracker, and src/mesa/program over to use _mesa_is_user_fbo() and _mesa_is_winsys_fbo(). Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: kill off point size clamping in vertex shadersMarek Olšák2012-01-311-27/+0
| | | | | | | | This fixes the gl_PointSize transform feedback test. Point size clamping should happen at the rasterizer stage, i.e. after the vertex and geometry shaders and transform feedback. Drivers are expected to do this by themselves.
* mesa: add _NEW_CURRENT_ATTRIB in _mesa_program_state_flags()Brian Paul2011-09-301-2/+5
| | | | | | | | | | | | If color material mode is enabled, constant buffer entries related to the material coefficients will depend on glColor. So add _NEW_CURRENT_ATTRIB to the bitset returned for material-related constants in _mesa_program_state_flags(). This fixes a bug exercised by the new piglit draw-arrays-colormaterial test. Note: This is a candidate for the 7.11 branch.
* mesa: pass correct constant type to _mesa_fetch_state()Brian Paul2011-08-041-1/+1
| | | | Fixes assorted warnings about float vs. gl_constant_value pointers.
* mesa: replace ONE_DIV_LN2 constant with M_LOG2EMatt Turner2011-05-061-1/+1
| | | | | | | | | | | | | 1/ln(2) is equivalent to log2(e), so define it as such. log2(e) = ln(e)/ln(2) = 1/ln(2) Worst of all, the definitions for M_LOG2E and ONE_DIV_LN2 (right beside each other!) weren't the same. Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Matt Turner <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* mesa,st/mesa: fix WPOS adjustmentChristoph Bumiller2011-05-031-2/+2
| | | | Tested-by: Marek Olšák <[email protected]>
* mesa: move sampler state into new gl_sampler_object typeBrian Paul2011-04-101-1/+1
| | | | | | gl_texture_object contains an instance of this type for the regular texture object sampling state. glGenSamplers() generates new instances of gl_sampler_object which can override that state with glBindSampler().
* mesa: implement clamping controls (ARB_color_buffer_float)Marek Olšák2011-03-291-3/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: Author: Marek Olšák <[email protected]> mesa: fix getteximage so that it doesn't clamp values mesa: update the compute_version function mesa: add display list support for ARB_color_buffer_float mesa: fix glGet query with GL_ALPHA_TEST_REF and ARB_color_buffer_float commit b2f6ddf907935b2594d2831ddab38cf57a1729ce Author: Luca Barbieri <[email protected]> Date: Tue Aug 31 16:50:57 2010 +0200 mesa: document known possible deviations from ARB_color_buffer_float commit 5458935be800c1b19d1c9d1569dc4fa30a97e8b8 Author: Luca Barbieri <[email protected]> Date: Tue Aug 24 21:54:56 2010 +0200 mesa: expose GL_ARB_color_buffer_float commit aef5c3c6be6edd076e955e37c80905bc447f8a82 Author: Luca Barbieri <[email protected]> Date: Thu Aug 26 18:12:34 2010 +0200 mesa, mesa/st: handle read color clamping properly (I'll squash the st/mesa part to a separate commit. -Marek) We set IMAGE_CLAMP_BIT in the caller based on _ClampReadColor, where the operation mandates it. TODO: did I get the set of operations mandating it right? commit 3a9cb5e59b676b6148c50907ce6eef5441677e36 Author: Luca Barbieri <[email protected]> Date: Thu Aug 26 18:09:41 2010 +0200 mesa: respect color clamping in texenv programs (v2) Changes in v2: - Fix attributes other than vertex color sometimes getting clamped commit de26f9e47e886e176aab6e5a2c3d4481efb64362 Author: Luca Barbieri <[email protected]> Date: Thu Aug 26 18:05:53 2010 +0200 mesa: restore color clamps on glPopAttrib commit a55ac3c300c189616627c05d924c40a8b55bfafa Author: Luca Barbieri <[email protected]> Date: Thu Aug 26 18:04:26 2010 +0200 mesa: clamp color queries if and only if fragment clamping is enabled commit 9940a3e31c2fb76cc3d28b15ea78dde369825107 Author: Luca Barbieri <[email protected]> Date: Wed Aug 25 00:00:16 2010 +0200 mesa: introduce derived _ClampXxxColor state resolving FIXED_ONLY To do this, we make ClampColor call FLUSH_VERTICES with the appropriate _NEW flag. We introduce _NEW_FRAG_CLAMP since fragment clamping has wide-ranging effects, despite being in the Color attrib group. This may be easily changed by s/_NEW_FRAG_CLAMP/_NEW_COLOR/g commit 6244c446e3beed5473b4e811d10787e4019f59d6 Author: Luca Barbieri <[email protected]> Date: Thu Aug 26 17:58:24 2010 +0200 mesa: add unclamped color parameters
* mesa: update comments, remove dead codeBrian Paul2010-12-031-3/+3
|
* mesa: remove unneeded castBrian Paul2010-12-031-1/+1
|
* mesa, st/mesa: fix gl_FragCoord with FBOs in GalliumMarek Olšák2010-12-031-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | gl_FragCoord.y needs to be flipped upside down if a FBO is bound. This fixes: - piglit/fbo-fragcoord - https://bugs.freedesktop.org/show_bug.cgi?id=29420 Here I add a new program state STATE_FB_WPOS_Y_TRANSFORM, which is set based on whether a FBO is bound. The state contains a pair of transformations. It can be either (XY=identity, ZW=transformY) if a FBO is bound, or (XY=transformY, ZW=identity) otherwise, where identity = (1, 0), transformY = (-1, height-1). A classic driver (or st/mesa) may, based on some other state, choose whether to use XY or ZW, thus negate the conditional "if (is a FBO bound) ...". The reason for this is that a Gallium driver is allowed to only support WPOS relative to either the lower left or the upper left corner, so we must flip the Y axis accordingly again. (the "invert" parameter in emit_wpos_inversion) NOTE: This is a candidate for the 7.9 branch. Signed-off-by: Marek Olšák <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg2010-10-131-3/+3
|
* mesa: Remove SGI_color_matrix.Eric Anholt2010-09-231-29/+0
| | | | Another optional ARB_imaging subset extension.
* ir_to_mesa: Add support for gl_NormalScale.Eric Anholt2010-09-071-0/+2
| | | | Bug #30040.
* mesa: rename src/mesa/shader/ to src/mesa/program/Brian Paul2010-06-101-0/+1187