summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/clear.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: s/GLint/gl_buffer_index/ for _ColorDrawBufferIndexesBrian Paul2017-11-091-4/+5
| | | | | | | Also fix local variable declarations and replace -1 with BUFFER_NONE. No Piglit changes. Reviewed-by: Charmaine Lee <[email protected]>
* mesa: add KHR_no_error support to glClearBufferiv()Samuel Pitoiset2017-08-021-0/+8
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add clear_bufferiv() helperSamuel Pitoiset2017-08-021-14/+23
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glClearBufferuiv()Samuel Pitoiset2017-08-021-0/+9
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add clear_bufferuiv() helperSamuel Pitoiset2017-08-021-13/+22
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glClearBufferfi()Samuel Pitoiset2017-08-021-0/+9
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add clear_bufferi() helperSamuel Pitoiset2017-08-021-20/+30
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glClearBufferfv()Samuel Pitoiset2017-08-021-0/+9
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add clear_bufferfv() helperSamuel Pitoiset2017-08-021-14/+23
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glClear()Samuel Pitoiset2017-06-281-0/+8
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add clear() helperSamuel Pitoiset2017-06-281-23/+31
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: optimize color_buffer_writes_enabled()Brian Paul2017-04-281-4/+5
| | | | | | | | | | Return as soon as we find an existing color channel that's enabled for writing. Typically, this allows us to return true on the first loop iteration intead of doing four iterations. No piglit regressions. Reviewed-by: Marek Olšák <[email protected]>
* mesa: Make single-buffered GLES representation internally consistentGurchetan Singh2016-07-071-0/+8
| | | | | | | | | | | | | There are a few places in the code where clearing and reading are done on incorrect buffers for GLES contexts. See comments for details. This fixes 75 GLES3 dEQP tests on the surfaceless platform with no regressions. v2: Corrected unclear comment v3: Make the change in context.c instead of get.c v4: Removed whitespace Reviewed-by: Stéphane Marchesin <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa: add drawbuffer argument to ClearNamedFramebufferfiIlia Mirkin2016-06-101-2/+2
| | | | | | | | | | | This was fixed in revision 47 of the ARB_dsa spec in Oct 22, 2015. Since it's horrible to have differing APIs across library versions, we should attempt to minimize the impact by backporting it as far as possible and hope no one notices. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Cc: "11.2 12.0" <[email protected]>
* mesa/clear: update ClearBufferfv error handling for GL 4.5 specIlia Mirkin2016-02-121-18/+5
| | | | | | | | | | | This fixes dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.clear_bufferfv and brings the logic up to spec with GL 4.5 Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/clear: update ClearBufferuiv error handling for GL 4.5 specIlia Mirkin2016-02-121-24/+5
| | | | | | | | | | | This fixes dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.clear_bufferuiv and brings the logic up to spec with GL 4.5 Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/clear: simplify ClearBufferiv error handlingIlia Mirkin2016-02-121-12/+6
| | | | | | | Might as well handle everything in the same error call. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa/clear: remove dead code handling ClearBufferiv(GL_DEPTH)Ilia Mirkin2016-02-121-19/+0
| | | | | | | | There's a hunk above which sets INVALID_ENUM for GL_DEPTH unconditionally. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Return INVALID_ENUM in glClearBufferiv() when buffer is not color or ↵Eduardo Lima Mitev2015-07-291-0/+12
| | | | | | | | | | | | | | | stencil Page 497 of the PDF, section '17.4.3.1 Clearing Individual Buffers' of the OpenGL 4.5 spec states: "An INVALID_ENUM error is generated by ClearBufferiv and ClearNamedFramebufferiv if buffer is not COLOR or STENCIL." Fixes 1 dEQP test: * dEQP-GLES3.functional.negative_api.buffer.clear_bufferiv Reviewed-by: Ian Romanick <[email protected]>
* mesa: Rename _mesa_lookup_enum_by_nr() to _mesa_enum_to_string().Kenneth Graunke2015-07-201-4/+4
| | | | | | | Generated by sed; no manual changes. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* Revert "mesa: Add ARB_direct_state_access checks in FBO functions"Ian Romanick2015-05-281-32/+0
| | | | | | | This reverts commit 6ad0b7e07a0445e9e0f368e079c4f7b8a6757bb3. Acked-by: Fredrik Höglund <[email protected]> Cc: "10.6" <[email protected]>
* mesa: Add ARB_direct_state_access checks in FBO functionsFredrik Höglund2015-05-141-0/+32
| | | | | Signed-off-by: Fredrik Höglund <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
* main: Fake entry point for glClearNamedFramebufferfi.Laura Ekstrand2015-05-141-0/+18
| | | | | | | | | | Mesa's ClearBuffer framework is very complicated and thoroughly married to the object binding model. Moreover, the OpenGL spec for ClearBuffer is also very complicated. At some point, we should implement buffer clearing for arbitrary framebuffer objects, but for now, we will just wrap ClearBuffer. Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* main: Fake entry point for glClearNamedFramebufferfv.Laura Ekstrand2015-05-141-0/+18
| | | | | | | | | | Mesa's ClearBuffer framework is very complicated and thoroughly married to the object binding model. Moreover, the OpenGL spec for ClearBuffer is also very complicated. At some point, we should implement buffer clearing for arbitrary framebuffer objects, but for now, we will just wrap ClearBuffer. Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* main: Fake entry point for glClearNamedFramebufferuiv.Laura Ekstrand2015-05-141-0/+18
| | | | | | | | | | Mesa's ClearBuffer framework is very complicated and thoroughly married to the object binding model. Moreover, the OpenGL spec for ClearBuffer is also very complicated. At some point, we should implement buffer clearing for arbitrary framebuffer objects, but for now, we will just wrap ClearBuffer. Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* main: Fake entry point for glClearNamedFramebufferiv.Laura Ekstrand2015-05-141-0/+20
| | | | | | | | | | Mesa's ClearBuffer framework is very complicated and thoroughly married to the object binding model. Moreover, the OpenGL spec for ClearBuffer is also very complicated. At some point, we should implement buffer clearing for arbitrary framebuffer objects, but for now, we will just wrap ClearBuffer. Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* mesa: Use assert() instead of ASSERT wrapper.Matt Turner2015-02-231-1/+1
| | | | Acked-by: Eric Anholt <[email protected]>
* mesa: Fix some signed-unsigned comparison warningsJan Vesely2015-01-211-1/+1
| | | | | | | | v2: s/unsigned int/unsigned/ in prog_optimize.c Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: David Heidelberg <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* mesa: remove obsolete comment on _mesa_ClearColor()Brian Paul2014-12-121-4/+0
|
* mesa: whitespace, line wrap fixes in clear.cBrian Paul2014-12-121-8/+11
|
* mesa: trim down some #includesBrian Paul2014-09-101-1/+0
|
* mesa: Remove glClear optimization based on drawable sizeKristian Høgsberg2014-06-181-5/+0
| | | | | | | | | | | | | | | A drawable size of 0x0 means that we don't have buffers for a drawable yet, not that we have a zero-sized buffer. Core mesa shouldn't be optimizing out drawing based on buffer size, since the draw call could be what triggers the driver to go and get buffers. As discussed in the referenced bug report, the optimization was added as part of a scatter-shot attempt to fix a different problem. There's no other example in mesa core of using the buffer size in this way. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74005 Cc: "10.1 10.2" <[email protected]> Signed-off-by: Kristian Høgsberg <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Skip clearing color buffers when color writes are disabled.Kenneth Graunke2014-03-241-1/+26
| | | | | | | | | | | | | | | | | | WebGL Aquarium in Chrome 24 actually hits this. v2: Move to core Mesa (wisely suggested by Ian); only consider components which actually exist. v3: Use _mesa_format_has_color_component to determine whether components actually exist, fixing alpha format handling. v4: Add a comment, as requested by Brian. No actual code changes. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Tested-by: Dylan Baker <[email protected]>
* mesa: use signed temporary variable to store _ColorDrawBufferIndexesEmil Velikov2014-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | _ColorDrawBufferIndexes is defined as GLint* and using a GLuint* will result in the first part of the conditional to be evaluated to true always. Unintentionally introduced by the following commit, this will result in a driver segfault if one is using an old version of the piglit test bin/clearbuffer-mixed-format -auto -fbo commit 03d848ea1003abefd8fe51a5b4a780527cd852af Author: Marek Olšák <[email protected]> Date: Wed Dec 4 00:27:20 2013 +0100 mesa: fix interpretation of glClearBuffer(drawbuffer) This corresponding piglit tests supported this incorrect behavior instead of pointing at it. Cc: Marek Olšák <[email protected]> Cc: 10.0 9.2 9.1 <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* mesa: handle GL_NONE draw buffers correctly in glClearMarek Olšák2014-01-131-1/+5
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: fix interpretation of glClearBuffer(drawbuffer)Marek Olšák2013-12-121-6/+25
| | | | | | | | This corresponding piglit tests supported this incorrect behavior instead of pointing at it. Reviewed-by: Ian Romanick <[email protected]> Cc: 10.0 9.2 9.1 <[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 flush vertices and don't flag _NEW_COLOR in ClearColor, ClearIndexMarek Olšák2013-04-241-37/+12
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Drop manual checks for outside begin/end.Eric Anholt2013-01-211-10/+5
| | | | | | | | | | | We now have a separate dispatch table for begin/end that prevent these functions from being entered during that time. The ASSERT_OUTSIDE_BEGIN_END_WITH_RETVALs are left because I don't want to change any return values or introduce new error-only stubs at this point. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove #if _HAVE_FULL_GL checksBrian Paul2012-10-161-2/+0
| | | | | | This is basically more of the "remove FEATURE_x" clean-up. Reviewed-by: Ian Romanick <[email protected]>
* mesa/es: Validate glClear mask in Mesa code rather than the ES wrapperIan Romanick2012-08-291-0/+9
|
* mesa: remove COPY_4V_CAST() macroBrian Paul2012-08-291-1/+1
| | | | Only used in one place, and not really needed.
* mesa: remove ctx->Driver.ClearColor() hookBrian Paul2012-03-121-30/+0
| | | | | | | The driver Clear() function should just grab the clear color out of the context. Reviewed-by: Dave Airlie <[email protected]>
* mesa: remove ctx->Driver.ClearDepth(), ClearStencil() driver hooksBrian Paul2012-03-121-16/+0
| | | | | | | Not used by any drivers. Drivers can easily access the values from the Mesa context at glClear() time. Reviewed-by: Dave Airlie <[email protected]>
* mesa/clear: fix crashes with illegal clear tests.Dave Airlie2012-01-111-4/+11
| | | | | | | | | Mesa shouldn't call into the drivers if there are no renderbuffers bound to the attachments for the buffers to be cleared. Fixes a number of the clearbuffer-* tests on softpipe. Signed-off-by: Dave Airlie <[email protected]>
* mesa: Move RasterDiscard to toplevel of gl_context.Paul Berry2011-12-211-7/+7
| | | | | | | | | | | | | | | | | | | | Previously we were storing the RasterDiscard flag (for GL_RASTERIZER_DISCARD) in gl_context::TransformFeedback. This was confusing, because we use the _NEW_TRANSFORM flag (not _NEW_TRANSFORM_FEEDBACK) to track state updates to it, and because rasterizer discard has effects even when transform feedback is not in use. This patch makes RasterDiscard a toplevel element in gl_context rather than a subfield of gl_context::TransformFeedback. Note: We can't put RasterDiscard inside gl_context::Transform, since all items inside gl_context::Transform need to be pieces of state that are saved and restored using PushAttrib and PopAttrib. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Fix error generation for glClearBuffer{i ui}v with GL_DEPTH or GL_STENCILIan Romanick2011-11-071-0/+84
| | | | | | | | | | | | | | | | | | | | The spec says "Only ClearBufferiv should be used to clear stencil buffers." and "Only ClearBufferfv should be used to clear depth buffers." However, on the following page it also says: "The result of ClearBuffer is undefined if no conversion between the type of the specified value and the type of the buffer being cleared is defined (for example, if ClearBufferiv is called for a fixed- or floating-point buffer, or if ClearBufferfv is called for a signed or unsigned integer buffer). *This is not an error.*" Emphasis mine. Fixes problems with piglit's clearbuffer-invalid-drawbuffer test. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>