aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/enable.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Remove flush_vertices argument from VAO methods.Mathias Fröhlich2018-05-171-2/+2
| | | | | | | The flush_vertices argument is now unused, remove it. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: add support for nvidia conservative rasterization extensionsRhys Perry2018-04-301-0/+14
| | | | | | | | Although the specs are written against compatibility GL 4.3 and allows core profile and GLES2+, it is exposed for GL 1.0+ and GLES1 and GLES2+. Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add flush_vertices to _mesa_{enable,disable}_vertex_array_attrib.Mathias Fröhlich2018-02-231-2/+2
| | | | | | | We will need the flush_vertices argument later in this series. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Provide an alternative to get_vp_mode()Mathias Fröhlich2018-02-231-0/+2
| | | | | | | | | | | | | | | | | To get equivalent information than get_vp_mode(), track the vertex processing mode in a per context variable at gl_vertex_program_state::_VPMode. This aims to replace get_vp_mode() as seen in the vbo module. But instead of the get_vp_mode() implementation which only gives correct answers past calling _mesa_update_state() this context variable is immediately tracked when the vertex processing state is modified. The correctness of this value is asserted on state validation. With this in place we should be able to untangle the dependency with varying_vp_inputs and state invalidation. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: decrease the array size of ctx->Texture.FixedFuncUnit to 8Marek Olšák2018-02-131-0/+5
| | | | | | | | | | GL allows doing glTexEnv on 192 texture units, while in reality, only MaxTextureCoordUnits units are used by fixed-func shaders. There is a piglit patch that adjusts piglits/texunits to check only MaxTextureCoordUnits units. Reviewed-by: Brian Paul <[email protected]>
* mesa: separate legacy stuff from gl_texture_unit into gl_fixedfunc_texture_unitMarek Olšák2018-02-131-9/+14
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Factor out _mesa_disable_vertex_array_attrib.Mathias Fröhlich2018-02-061-40/+24
| | | | | | | | And use it in the enable code path. Move _mesa_update_attribute_map_mode into its only remaining file. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: don't flag _NEW_COLOR for KHR adv.blend if prog constant doesn't changeMarek Olšák2018-02-021-4/+10
| | | | | | | | | | | This only affects drivers that set DriverFlags.NewBlend. v2: - fix typo advanded -> advanced - return "enum gl_advanced_blend_mode" from _mesa_get_advanced_blend_sh_constant - don't call FLUSH_VERTICES twice Reviewed-by: Ian Romanick <[email protected]>
* mesa: Track position/generic0 aliasing in the VAO.Mathias Fröhlich2018-02-011-0/+5
| | | | | | | | | | | | | | | | | | | | | | | Since the first material attribute no longer aliases with the generic0 attribute, only aliasing between generic0 and position is left and entirely dependent on the enabled state of the VAO. So introduce a gl_attribute_map_mode in the VAO that is used to track how the position and the generic 0 attribute alias. Provide a static const array that can be used to map from vertex program input indices to VERT_ATTRIB_* indices. The outer dimension of the array is meant to be indexed directly by the new VAO member variable. Also provide methods on the VAO to convert bitmasks of VERT_BIT's from the VAO numbering to the vertex processing inputs numbering. v2: s,unsigned char,GLubyte,g s,_ATTRIBUTE_MAP_MODE_MAX,ATTRIBUTE_MAP_MODE_MAX,g Change comment style, add comments. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: rename some vars in client_state()Brian Paul2018-01-301-25/+25
| | | | Reviewed-by: Gert Wollny <[email protected]>
* mesa: shrink VERT_ATTRIB bitfields to 32 bitsMarek Olšák2017-11-251-1/+1
| | | | | | There are only 32 vertex attribs now. Reviewed-by: Ian Romanick <[email protected]>
* mesa: Implement a new GL_MESA_tile_raster_order extension.Eric Anholt2017-10-101-0/+39
| | | | | | | | | | | | | | The intent is to use this extension on vc4 to allow X11 to do overlapping CopyArea() within a pixmap without first blitting the pixmap to a temporary. With associated glamor patches, improves x11perf -copywinwin100 performance on a Raspberry Pi 3 from ~4700/sec to ~5130/sec, and is an even larger boost to uncomposited window movement performance (most copywinwin100 copies don't overlap). v2: Fix glIsEnabled() on the new enums. v3: Drop the local spec since I'm upstreaming the spec. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: optimize GL_PRIMITIVE_RESTART_NV moreMarek Olšák2017-06-271-10/+9
| | | | | | | And other client state changes don't have to call update_derived_primitive_restart_state. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: fix clip plane enable breakageMarek Olšák2017-06-271-1/+6
| | | | | | | | | | | | | | | | | | | Broken by: commit 00173d91b70ae4dcea7c6324ee4858c498cae14b Author: Marek Olšák <[email protected]> Date: Sat Jun 10 12:09:43 2017 +0200 mesa: don't flag _NEW_TRANSFORM for st/mesa if possible It also optimizes the case slightly for GL core. It doesn't try to fix that glEnable might be a bad place to do the clip plane transformation. Reviewed-by: Nicolai Hähnle <[email protected]> Tested-by: Michel Dänzer <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: don't flag _NEW_ARRAY for GL_PRIMITIVE_RESTART_NVMarek Olšák2017-06-231-1/+3
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: don't call _mesa_update_clip_plane in the GL core profileMarek Olšák2017-06-221-1/+2
| | | | | | It uses the projection matrix to transform the clip plane. Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: don't flag _NEW_LINE for st/mesaMarek Olšák2017-06-221-2/+4
| | | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: don't flag _NEW_POLYGON for st/mesaMarek Olšák2017-06-221-6/+18
| | | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: don't flag _NEW_TRANSFORM for st/mesa if possibleMarek Olšák2017-06-221-2/+13
| | | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: don't flag _NEW_TRANSFORM for Transform.RasterPositionUnclippedMarek Olšák2017-06-221-1/+1
| | | | | | | | It's not a driver state, it's for glRasterPos. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: don't flag _NEW_TRANSFORM for primitive restartMarek Olšák2017-06-221-2/+2
| | | | | | | | It's a draw state. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: don't flag _NEW_MULTISAMPLE for st/mesaMarek Olšák2017-06-221-7/+30
| | | | | | | | There are several new driver flags here so that it maps nicely to gallium. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: don't flag _NEW_COLOR for st/mesa if possibleMarek Olšák2017-06-221-6/+11
| | | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: use DriverFlags.NewAlphaTest to communicate alphatest changes to st/mesaMarek Olšák2017-06-221-0/+2
| | | | | | | | | | | | Now AlphaFunc avoids the blend state update in st/mesa and avoids _mesa_update_state_locked. The GL_ALPHA_TEST enable won't trigger blend state updates in st/mesa after st/mesa stops relying on _NEW_COLOR. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: don't flag _NEW_DEPTH for st/mesaMarek Olšák2017-06-221-2/+4
| | | | | | | | skipping _mesa_update_state_locked Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: don't flag _NEW_SCISSOR for st/mesaMarek Olšák2017-06-221-2/+4
| | | | | | | | | Not needed and we get to bypass _mesa_update_state_locked that would be a no-op. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: stop using _NEW_STENCIL with st/mesa, use DriverFlags.NewStencil insteadMarek Olšák2017-06-221-2/+4
| | | | | | | | | | | | | | | | | | | This bypasses _mesa_update_state_locked. Before: DrawElements ( 1 VBOs, 4 UBOs, 8 Tex) w/ stencil enable change: 3.99 million DrawArrays ( 1 VBOs, 4 UBOs, 8 Tex) w/ stencil enable change: 4.56 million After: DrawElements ( 1 VBOs, 4 UBOs, 8 Tex) w/ stencil enable change: 4.93 million DrawArrays ( 1 VBOs, 4 UBOs, 8 Tex) w/ stencil enable change: 5.84 million It's quite a difference in the draw call rate when ctx->NewState stays equal to 0 the whole time. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: whitespace fixes in enable.cBrian Paul2017-06-161-68/+68
| | | | Remove trailing whitespace, replace tabs w/ spaces, etc. Trivial.
* mesa: make use of NewScissorTest driver flagsSamuel Pitoiset2017-06-091-0/+2
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: remove redundant _ae_invalidate_state() callTimothy Arceri2017-06-091-3/+0
| | | | | | | | | The FLUSH_VERTICES(ctx, _NEW_ARRAY) above this will already cause this to be called. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: add gl_driver_flags::NewFramebufferSRGBMarek Olšák2017-06-071-1/+4
| | | | | | | _NEW_BUFFERS updates too much stuff. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/main: Maintain compressed fog mode.Gustaw Smolarczyk2017-04-081-0/+1
| | | | | Signed-off-by: Gustaw Smolarczyk <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: split _NEW_TEXTURE into _NEW_TEXTURE_OBJECT & _NEW_TEXTURE_STATEMarek Olšák2017-03-291-4/+4
| | | | | | | | | | | | No performance testing has been done, because it makes sense to make this change regardless of that. Also, _NEW_TEXTURE is still used in many places, but the obvious occurences are replaced here. It's now possible to split _NEW_TEXTURE_OBJECT further. Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* main: don't error when enabling conservative rasterization on glesLionel Landwerlin2016-12-131-1/+1
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* main: use new driver flag for conservative rasterization stateLionel Landwerlin2016-12-131-1/+3
| | | | | | | | | | | Suggested by Marek. v2: Use new driver flag (Marek) v3: Fix i965 comments (Lionel) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: add support for GL_INTEL_conservative_rasterizationLionel Landwerlin2016-12-071-0/+12
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
* mesa: Implement GL_KHR_blend_equation_advanced_coherent.Kenneth Graunke2016-08-251-0/+12
| | | | | | | | | This adds the extension enable (so drivers can advertise it) and the extra boolean state flag, GL_BLEND_ADVANCED_COHERENT_KHR, which can be set to request coherent blending. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* mesa: Remove the linked list of enabled lightsMathias Fröhlich2016-06-161-4/+0
| | | | | | | Clean up after conversion to bitmasks. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Track enabled lights in a bitmaskMathias Fröhlich2016-06-161-0/+2
| | | | | | | This enables some optimizations afterwards. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: raise error for glEnable(GL_VERTEX_ARRAY), etc. in core profileBrian Paul2016-05-241-1/+11
| | | | | | | | | | | | | | | Otherwise, if the call executes normally we'll hit an assertion later in the VBO code when we draw something. Note that these cases were already handled correctly for the glIsEnabled() function (and the API checks were copied from there). Tested with new piglit gl-3.1-enable-vertex-array test. v2: fix compat/es mix-up, per Ilia. Cc: <[email protected]> Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: add GL_OES_sample_shading supportIlia Mirkin2016-03-301-2/+2
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Ignore glPointSize when GL_POINT_SIZE_ARRAY_OES is enabledPlamena Manolova2016-03-151-0/+2
| | | | | | | | | | When a user defines a point size array and enables it, the point size value set via glPointSize should be ignored. To achieve this, we can simply toggle ctx->VertexProgram.PointSizeEnabled. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42187 Signed-off-by: Plamena Manolova <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: remove _ARB suffix from cube map enumsBrian Paul2016-02-121-2/+2
| | | | | | | Just minor clean-up so we're consistent everywhere. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: move GL_ARB_debug_output code into new debug_output.c fileBrian Paul2016-02-081-0/+1
| | | | | | | | The errors.c file had grown quite large so split off this extension code into its own file. This involved making a handful of functions non-static. Acked-by: Timothy Arceri <[email protected]>
* mesa: Don't include meta.hIan Romanick2016-01-251-1/+0
| | | | | | | | Commit 055093e removed the call to _mesa_meta_in_progress, and meta.h has not been necessary in src/mesa/main/enable.c since. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* main: Don't restrict several KHR_debug enum to desktop GLBoyan Ding2015-11-201-8/+2
| | | | | | | | | In preparation for supporting GL_KHR_debug in OpenGL ES v2: add a missing hunk in _mesa_IsEnabled (Emil) Signed-off-by: Boyan Ding <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa/es3.1: Allow enable of GL_SAMPLE_MASKMarta Lofstedt2015-08-031-1/+1
| | | | | | | GLES 3.1 must be able to enable GL_SAMPLE_MASK. Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/es3.1: Allow GL_SAMPLE_MASKMarta Lofstedt2015-08-031-1/+1
| | | | | | | GLES 3.1 should be allowed to enable GL_SAMPLE_MASK. Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: Rename _mesa_lookup_enum_by_nr() to _mesa_enum_to_string().Kenneth Graunke2015-07-201-6/+6
| | | | | | | Generated by sed; no manual changes. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Use assert() instead of ASSERT wrapper.Matt Turner2015-02-231-1/+1
| | | | Acked-by: Eric Anholt <[email protected]>