summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/blend.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: change ctx->Color.ColorMask into a 32-bit bitmaskMarek Olšák2018-02-041-33/+20
| | | | | | | | 4 bits per draw buffer, 8 draw buffers in total --> 32 bits. This is easier to work with. Reviewed-by: Eric Anholt <[email protected]>
* mesa: don't flag _NEW_COLOR for KHR adv.blend if prog constant doesn't changeMarek Olšák2018-02-021-2/+4
| | | | | | | | | | | 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: Pass the translated color logic op dd_function_table::LogicOpcodeIan Romanick2018-01-261-1/+1
| | | | | | | | | | | And delete the resulting dead code. This has only been compile-tested. v2: sed --in-place -e 's/color_logic_ops/gl_logicop_mode/g' $(grep -lr color_logic_ops src/) suggested by Brian. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: Also track a remapped version of the color logic opIan Romanick2018-01-261-0/+20
| | | | | | | | | | | | | | | | | With the exception of NVIDIA hardware, these are is the values that all hardware and Gallium want. The remapping is currently implemented in at least 6 places. This starts the process of consolidating to a single place. v2: sed --in-place -e 's/color_logic_ops/gl_logicop_mode/g' $(grep -lr color_logic_ops src/) suggested by Brian. Added some comments about the selection of bit patterns for gl_logicop_mode and the GLenums. Suggested by Nicolai. Folded the GLenum_to_color_logicop macro into its only users. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> [v1] Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: fix debug/error messages in glColorMaski()Samuel Pitoiset2017-08-241-4/+4
| | | | | | | Trivial. While we are at it, adjust indentation. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: only check errors when the state change in glLogicOp()Samuel Pitoiset2017-08-031-27/+29
| | | | | | | When this GL call is a no-op, it should be a little faster. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: only check errors when the state change in glBlendEquationSeparateiARB()Samuel Pitoiset2017-08-031-20/+22
| | | | | | | When this GL call is a no-op, it should be a little faster. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glBlendEquationSeparate()Samuel Pitoiset2017-07-311-0/+8
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add blend_equation_separate() helperSamuel Pitoiset2017-07-311-28/+39
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glBlendEquationiARB()Samuel Pitoiset2017-07-311-0/+11
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add blend_equationi() helperSamuel Pitoiset2017-07-311-11/+18
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glBlendFunc*()Timothy Arceri2017-06-291-0/+25
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: create some glBlendFunc*() helper functionsTimothy Arceri2017-06-291-50/+81
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: add KHR_no_error support for glLogicOp()Timothy Arceri2017-06-291-0/+8
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: add logic_op() helperTimothy Arceri2017-06-291-9/+16
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: don't flag _NEW_COLOR for st/mesa if possibleMarek Olšák2017-06-221-11/+18
| | | | | | 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-1/+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: add KHR_no_error support for glBlendEquationSeparateiARB()Timothy Arceri2017-05-171-0/+9
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add blend_equation_separatei() helperTimothy Arceri2017-05-171-9/+17
| | | | | | Will be used to add KHR_no_error support. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support for glBlendFunc*iARB()Timothy Arceri2017-05-171-0/+18
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add blend_func_separatei() helperTimothy Arceri2017-05-171-17/+28
| | | | | | This will be used to add KHR_no_error support. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/main: fix version/extension checks in _mesa_ClampColorNicolai Hähnle2017-01-131-6/+10
| | | | | | | | | | | | | Add a proper check for feature support, and raise an invalid enum for GL_CLAMP_VERTEX/FRAGMENT_COLOR unconditionally in core profiles, since those enums were explicitly removed after the extension was promoted to core functionality (not in the profile sense) with OpenGL 3.0. This matches the behavior of the AMD closed source driver and fixes GL45-CTS.gtf30.GL3Tests.half_float.half_float_textures. Cc: "12.0 13.0" <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: replace gl_framebuffer::_IntegerColor wih _IntegerBuffersBrian Paul2016-10-131-1/+1
| | | | | | | | | | | Use a bitmask to indicate which color buffers are integer-valued, rather than a bool. Also, the old field was mis-computed. If an integer buffer was followed by a non-integer buffer, the _IntegerColor field was wrongly set to false. This fixes the new piglit gl-3.1-mixed-int-float-fbo test. Reviewed-by: Marek Olšák <[email protected]>
* mesa: Implement GL_KHR_blend_equation_advanced_coherent.Kenneth Graunke2016-08-251-0/+2
| | | | | | | | | 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: Track the current advanced blending mode.Kenneth Graunke2016-08-251-13/+41
| | | | | | | | | | | This will be useful for a number of things: - Checking the current advanced blending mode against the shader's blend_support_* qualifiers. - Disabling hardware blending when emulating advanced blending. - Uploading the current advanced blending mode as a state var. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* mesa: Allow advanced blending enums in glBlendEquation[i].Kenneth Graunke2016-08-251-10/+54
| | | | | | | | Don't allow them in glBlendEquationSeparate[i], though, as required by the spec. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* mesa: update some old-style (K&R?) function pointer callsBrian Paul2015-11-201-2/+2
| | | | Reviewed-by: Emil Velikov <[email protected]>
* mesa: enable usage of blend_func_extended blend factors in GLES2Ryan Houdek2015-11-191-3/+3
| | | | Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: minor comment fix in blend.cBrian Paul2015-11-131-1/+1
|
* mesa: add num_buffers() helper in blend.cBrian Paul2015-10-151-15/+22
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: optimize _UsesDualSrc blend flag settingBrian Paul2015-10-151-1/+6
| | | | | | | For glBlendFunc and glBlendFuncSeparate(), the _UsesDualSrc flag will be the same for all buffers, so no need to compute it N times. Reviewed-by: Eric Anholt <[email protected]>
* mesa: fix incorrect error string in _mesa_BlendEquationiARB()Brian Paul2015-10-151-1/+1
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: move validate_blend_factors() call after no-change checkBrian Paul2015-10-151-6/+6
| | | | | | | A redundant call to glBlendFuncSeparateiARB() is more likely than getting invalid values, so do the no-op check first. Reviewed-by: Eric Anholt <[email protected]>
* mesa: optimize no-change check in _mesa_BlendEquationSeparate()Brian Paul2015-10-151-15/+26
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: optimize no-change check in _mesa_BlendEquation()Brian Paul2015-10-151-12/+23
| | | | | | Same story as preceeding change to _mesa_BlendFuncSeparate(). Reviewed-by: Eric Anholt <[email protected]>
* mesa: optimize no-change check in _mesa_BlendFuncSeparate()Brian Paul2015-10-151-15/+28
| | | | | | | | | | | | Streamline the checking for no state change in _mesa_BlendFuncSeparate() (and _mesa_BlendFunc()). If _BlendFuncPerBuffer is false, we only need to check the 0th buffer state. Move argument validation after the no-op check. I'm looking at an app that issues about 1000 redundant glBlendFunc() calls per frame! Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove Driver.ColorMaskIndexedMarek Olšák2015-10-031-3/+0
| | | | | | | Nothing sets it. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove some Driver.Blend* hooksMarek Olšák2015-10-031-11/+0
| | | | | | | Nothing sets them. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: move check for no-op glAlphaFunc call earlierBrian Paul2015-07-211-3/+3
| | | | | Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Rename _mesa_lookup_enum_by_nr() to _mesa_enum_to_string().Kenneth Graunke2015-07-201-17/+17
| | | | | | | Generated by sed; no manual changes. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: fix sRGB rendering for GLES1Marek Olšák2015-07-031-6/+4
|
* main: Refactor _mesa_get_clamp_read_color.Laura Ekstrand2015-05-141-2/+3
| | | | | | | | This wasn't neccessary for ARB_direct_state_access, but felt like a good idea for the sake of completeness. Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* main: Refactor _mesa_[update|get]_clamp_fragment_color.Laura Ekstrand2015-05-141-9/+10
| | | | | Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* main: Refactor _mesa_[update|get]_clamp_vertex_color.Laura Ekstrand2015-05-141-5/+8
| | | | | Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* mesa/main: replace Elements() with ARRAY_SIZE()Brian Paul2015-03-021-1/+1
| | | | | | | | We've been using a mix of these two macros for a while now. Let's just use the later everywhere. It seems to be the convention used by other open-source projects. Acked-by: Ilia Mirkin <[email protected]>
* mesa: Use assert() instead of ASSERT wrapper.Matt Turner2015-02-231-1/+1
| | | | Acked-by: Eric Anholt <[email protected]>
* Fix the initial value of glDrawBuffers for GLESNeil Roberts2014-03-121-1/+3
| | | | | | | | | | | | | | | | | | Under GLES 3 it is not valid to pass GL_FRONT to glDrawBuffers. Instead, GL_BACK has a magic interpretation which means it will render to the front buffer on single-buffered contexts and the back buffer on double-buffered. We were incorrectly setting the initial value to GL_FRONT for single-buffered contexts. This probably doesn't really matter at the moment except that presumably it would be exposed in the API via glGetIntegerv. When we switch to configless contexts this is more important because in that case we always want to rely on the magic interpretation of GL_BACK in order to automatically switch between the front and back buffer when a new surface with a different number of buffers is bound. We also do this for GLES 1 and 2 because the internal value doesn't matter in that case and it is convenient to use the same code to have the magic interpretation of GL_BACK. Reviewed-by: Kristian Høgsberg <[email protected]>
* mesa: change gl_format to mesa_formatMark Mueller2014-01-271-3/+3
| | | | s/\bgl_format\b/mesa_format/g. Use better name for Mesa Formats enum
* mesa: GL_NV_blend_square is not optionalIan Romanick2013-06-281-2/+0
| | | | | | | | | Every driver left in Mesa enables this extension all the time. There's no reason to let it be optional. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[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]>