summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/state.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: use gl_program cast wrappersBrian Paul2012-07-181-10/+5
| | | | | | | In a few cases, remove unneeded casts. And fix a few other const-correctness issues. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: move gl_array_attrib::NewState to gl_array_object::NewArraysBrian Paul2012-04-201-1/+1
| | | | | | | | The field wasn't actually used before and it's not used now either. But this is a more logical place for it and will hopefully allow doing smarter draw/array validation (per array object) in the future. Reviewed-by: Mathias Fröhlich <[email protected]>
* Revert "mesa: only update _MaxElement when we actually need it"Marek Olšák2012-04-191-3/+1
| | | | | | | This reverts commit 0de5a21470b3bff9b7c8714e5d960d5ed9d01b9c. I was wrong, we use it in the vbo module too. This fixes a performance regression in Nexuiz.
* mesa: set _NEW_VARYING_VP_INPUTS flag only if fixed-func VP is enabled & validMarek Olšák2012-04-191-1/+10
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: add _NEW_VARYING_VP_INPUTS for gl_context::varying_vp_inputsMarek Olšák2012-04-191-5/+6
| | | | | | | | | This is a frequently-updated state and _NEW_ARRAY already causes revalidation of the vbo module. It's kinda counter-productive to recompute arrays in the vbo module if _NEW_ARRAY is set and then set _NEW_ARRAY again. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa,vbo: properly detect when vertex arrays need to be recalculatedMarek Olšák2012-04-191-2/+0
| | | | | | | | | | | | | | | | | | | This moves the RebindArrays flag into the vbo module, consolidates the code, and adds missing vbo_draw_method calls. Also with this change, the vertex arrays are not needlessly recalculated twice. The issue with the old code was: - If recalculate_input_bindings updates vp_varying_inputs, _NEW_ARRAY is set. - _mesa_update_state is called and the vp_varying_inputs change causes regeneration of the fixed-function shaders, which also sets _NEW_PROGRAM. - The occurence of either _NEW_ARRAY or _NEW_PROGRAM sets the recalculate_inputs flag to TRUE again. - The new code sets the flag to FALSE after the second _mesa_update_state, because there can't possibly be any change which would require recalculating the arrays. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: only update _MaxElement when we actually need itMarek Olšák2012-04-191-1/+3
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: remove unused DD_TRI_CULL_FRONT_BACKBrian Paul2012-03-121-8/+2
| | | | | Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove unused DD_FLATSHADEBrian Paul2012-03-121-2/+0
| | | | | Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove unused DD_TRI_TWOSTENCILBrian Paul2012-03-121-6/+0
| | | | | Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: define _MESA_NEW_SEPARATE_SPECULARBrian Paul2012-03-121-2/+2
| | | | | | | | This will replace the soon-to-be-removed _DD_NEW_SEPARATE_SPECULAR flag. Note: there's a similar composite _MESA_NEW_NEED_EYE_COORDS flag set already. Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Make sure _TexEnvProgram points at the current ff fragment programIan Romanick2012-01-241-0/+9
| | | | | | | | | | | | | At least one place, the _mesa_need_secondary_color function in state.h, uses this to make decisions. The next patch in this series will add another dependency. Ideally, this field would go away and be replace by a flag or something. NOTE: This is a candidate for the 8.0 branch. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: include arrayobj.h to silence implicit function declaration warningBrian Paul2012-01-201-0/+1
| | | | Caused by commit 7a1e941ebee43cb97a2c77fd2269999b202308a2.
* mesa: Fix and speedup gl_array_object::_MaxElement computation.Mathias Fröhlich2012-01-201-125/+1
| | | | | | | | | | Use a bitmask approach to compute gl_array_object::_MaxElement. To make this work correctly depending on the shader type actually used, make use of the newly introduced typed bitmask getters. With this change I gain about 5% draw time on some osgviewer examples. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove const qualifier from fProg to silence warningBrian Paul2012-01-111-1/+1
| | | | The args to _mesa_reference_shader_program() can't be const.
* mesa: Track fixed-function fragment shader as a shaderIan Romanick2012-01-111-0/+10
| | | | | | | | | | | | Previously the fixed-function fragment shader was tracked as a gl_program. This means that it shows up in the driver as a Mesa IR program instead of as a GLSL IR program. If a driver doesn't generate Mesa IR from the GLSL IR, that program is empty. If the program is empty there is either no rendering or a GPU hang. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Kenneth Graunke <[email protected]>
* mesa: Use VERT_ATTRIB_* indexed array in gl_array_object.Mathias Fröhlich2011-11-291-40/+43
| | | | | | | | | | | | Replace the distinct struct gl_client_array members in gl_array_object by an array of gl_client_arrays indexed by VERT_ATTRIB_*. Renumber the vertex attributes slightly to keep the old semantics of the distinct array members. Make use of the upper 32 bits in VERT_BIT_*. Update all occurances of the distinct struct members with the array equivalents. Signed-off-by: Mathias Froehlich <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Make gl_program::InputsRead 64 bits.Mathias Fröhlich2011-11-291-1/+1
| | | | | | | | | 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 <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: fix frag shader generation for alpha test with no color buffersBrian Paul2011-11-281-1/+1
| | | | | | | | | | | | If alpha test is enabled and there's no color buffers we still need the fragment shader to emit a color. v2: add _NEW_COLOR flag in _mesa_update_state_locked() Fixes piglit fbo-alphatest-nocolor-ff failures with Gallium drivers. Reviewed-by: Eric Anholt <[email protected]> Tested-by: Eric Anholt <[email protected]> (i965)
* mesa: Fix detection of whether an ARB_vp is enabled for two sided lighting.Eric Anholt2011-10-201-1/+1
| | | | | | | | | | When there is no ARB_vertex_program program enabled, the Current pointer points at a default program, so we were always using VERTEX_PROGRAM_TWO_SIDE, even for fixed function lighting. Fixes piglit two-sided-lighting* Reviewed-by: Brian Paul <[email protected]>
* mesa: Convert fixed function fragment program generator to GLSL IR.Eric Anholt2011-10-181-3/+4
| | | | | | | | This is a step towards providing a direct route for drivers accepting GLSL IR for codegen. Perhaps more importantly, it runs the fixed function fragment program through the GLSL IR optimization. Having seen how easy it is to make ugly fixed function texenv code that can do unnecessary work, this may improve real applicatinos.
* mesa: Use gl_shader_program::_LinkedShaders instead of FragmentProgramIan Romanick2011-10-071-2/+4
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Use gl_shader_program::_LinkedShaders instead of GeometryProgramIan Romanick2011-10-071-2/+4
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Use gl_shader_program::_LinkedShaders instead of VertexProgramIan Romanick2011-10-071-2/+4
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add a context flag indicating whether two-sided lighting should happen.Eric Anholt2011-09-211-1/+17
| | | | | The 965 driver was ignoring the VERTEX_PROGRAM_TWO_SIDE flag and only looking at fixed-function state.
* mesa: Use ColorLogicOpEnabled instead of _LogicOpEnabledIan Romanick2011-09-191-16/+0
| | | | | | | | | | Since GL_EXT_blend_logic_op is removed, _LogicOpEnabled and ColorLogicOpEnabled always have the same value. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: update multisample state on _NEW_BUFFERSChristoph Bumiller2011-08-301-1/+1
| | | | A change in sampleBuffers affects the final enable value.
* mesa: comments and 80-column wrappingBrian Paul2011-06-221-6/+21
|
* mesa: update comments in update_program_enables()Brian Paul2011-06-221-1/+4
|
* mesa: update/fix comments in update_program()Brian Paul2011-06-221-17/+16
|
* mesa: consolidate code in _mesa_update_array_max_element()Brian Paul2011-04-061-31/+2
|
* mesa: implement clamping controls (ARB_color_buffer_float)Marek Olšák2011-03-291-1/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: remove _MESA_NEW_TRANSFER_STATEBrian Paul2011-03-231-1/+1
|
* Revert "mesa: Convert fixed function fragment program generator to GLSL IR."Eric Anholt2011-03-121-8/+4
| | | | | This reverts commit 7cb87dffce2c7a37f960f3a865cf92fd193dd8c5. There were regressions (Bug #35244) and more review has been requested.
* Revert "mesa: Track a computed _CurrentFragmentProgram for current ↵Eric Anholt2011-03-121-9/+4
| | | | | | gl_shader_program" This reverts commit b4452c3baad6e0379eeb7f22f2e51d13999e1323.
* mesa: Track a computed _CurrentFragmentProgram for current gl_shader_programEric Anholt2011-03-111-4/+9
| | | | | | | This is like how we track FragmentProgram._Current for the computed ARB fragment program for fixed function texenv, but this gives direct access to the gl_shader_program for drivers to codegen from, skipping ARB_fp.
* mesa: Convert fixed function fragment program generator to GLSL IR.Eric Anholt2011-03-111-4/+8
| | | | | | | | This is a step towards providing a direct route for drivers accepting GLSL IR for codegen. Perhaps more importantly, it runs the fixed function fragment program through the GLSL IR optimization. Having seen how easy it is to make ugly fixed function texenv code that can do unnecessary work, this may improve real applicatinos.
* mesa: replace NEED_SECONDARY_COLOR(), RGBA_LOGICOP_ENABLED() with inlinesBrian Paul2011-03-111-3/+3
| | | | and rename them.
* vbo: bind arrays only when necessaryMarek Olšák2011-02-141-0/+2
| | | | | We don't need to call bind_arrays in the vbo module if the states which the function depends on are not dirty.
* mesa: remove unneeded DD_POINT_SIZE and DD_LINE_WIDTH tricapsRoland Scheidegger2010-11-101-4/+0
| | | | | | | | DD_POINT_SIZE was broken for quite some time, and the only driver (r200) relying on this no longer needs it. Both DD_POINT_SIZE and DD_LINE_WIDTH have no users left outside of debugging output, hence instead of fixing DD_POINT_SIZE setting just drop both of them - there was a plan to remove tricaps flags entirely at some point.
* Track separate programs for each stageIan Romanick2010-10-271-7/+9
| | | | | The assumption is that all stages are the same program or that varyings are passed between stages using built-in varyings.
* Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg2010-10-131-16/+16
|
* mesa: make the number of draw buffers part of the texenv program key stateBrian Paul2010-07-021-1/+1
| | | | | | | | All the state that effects the program should be in the key. This didn't help with bug 28169 but is a good fix anyway. NOTE: this is a low-priority candidate for the 7.8 branch. In practice, this issue might never be hit.
* mesa: initial support for ARB_geometry_shader4Zack Rusin2010-06-281-1/+29
| | | | | | laying down the foundation for everything and implementing most of the stuff. linking, gl_VerticesIn and multidimensional inputs are left.
* mesa: rename src/mesa/shader/ to src/mesa/program/Brian Paul2010-06-101-2/+2
|
* mesa: update_arrays() depends on program state.Henri Verbeet2010-04-051-3/+2
| | | | | | It uses ctx->VertexProgram._Current. Signed-off-by: Brian Paul <[email protected]>
* Replace the _mesa_*printf() wrappers with the plain libc versionsKristian Høgsberg2010-02-191-1/+1
|
* mesa: remove redundant _MaxElement computationBrian Paul2010-01-261-6/+0
| | | | | | | | Eric added some new code to check if offset < obj_size before computing _MaxElement but my original code was still present afterward and it clobbered the _MaxElement value. Not sure if this came from a bad merge or what.
* mesa: Remove unnecessary header from state.c.Vinson Lee2010-01-181-1/+0
|
* mesa/main: Make FEATURE_pixel_transfer follow feature conventions.Chia-I Wu2009-09-241-4/+0
| | | | | As shown in mfeatures.h, this allows users of pixel.h to work without knowing if the feature is available.