aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/queryobj.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa/main: fixup requirements for GL_PRIMITIVES_GENERATEDErik Faye-Lund2018-11-261-0/+1
| | | | | | | | | | | | This enum is also allowed by EXT_tessellation_shader, which is supported on older i965 HW (as opposed to OES_geometry_shader). This was missed when narrowing this code-path, leading to dEQP regressions. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108868 Fixes: f09d94fbd11 "mesa/main: fix validation of transform-feedback queries" Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Tested-by: Mark Janes <[email protected]>
* mesa/main: remove overly strict query-validationErik Faye-Lund2018-11-231-14/+0
| | | | | | | | | The rules encoded in this code also applies to OpenGL ES 3.0 and up, but the per-enum validation has already been taught about these rules. So let's get rid of this duplicate, narrow version of the validation. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/main: fix validation of GL_TIMESTAMPErik Faye-Lund2018-11-231-1/+2
| | | | | | | | | | | | | | | | ctx->Extensions.ARB_timer_query is set based on the driver- capabilities, not based on the context type. We need to check against _mesa_has_ARB_timer_query(ctx) instead to figure out if the extension is really supported. We also need to check for EXT_disjoint_timer_query for GLES-support. This shouln't have any functional effect, as this entry-point is only valid on desktop GL, or on GLES with EXT_disjoint_timer_query in the first place. But if this gets added to the core of a future version of ES, this should be a step in the right direction. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/main: fix validation of ARB_query_buffer_objectErik Faye-Lund2018-11-231-2/+2
| | | | | | | | | | | | | ctx->Extensions.ARB_query_buffer_object is set based on the driver- capabilities, not based on the context type. We need to check against _mesa_has_ARB_query_buffer_object(ctx) instead to figure out if the extension is really supported. This turns attempts to read queries into buffer objects on ES 3 into errors, as required by the spec. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/main: fix validation of transform-feedback overflow queriesErik Faye-Lund2018-11-231-2/+2
| | | | | | | | | | | | | | ctx->Extensions.ARB_transform_feedback_overflow_query is set based on the driver-capabilities, not based on the context type. We need to check against _mesa_has_RB_transform_feedback_overflow_query(ctx) instead to figure out if the extension is really supported. This turns usage of GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW and GL_TRANSFORM_FEEDBACK_OVERFLOW into errors on ES 3, as required by the spec. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/main: fix validation of transform-feedback queriesErik Faye-Lund2018-11-231-2/+3
| | | | | | | | | | | | | | | ctx->Extensions.EXT_transform_feedback is set based on the driver- capabilities, not based on the context type. We need to check against _mesa_has_EXT_transform_feedback(ctx) instead to figure out if the extension is really supported. We also need to check for OES_geometry_shader. This turns usage of GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN into an error on ES 2, as well as usage of GL_PRIMITIVES_GENERATED on ES 3, both as required by the spec. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/main: fix validation of GL_TIME_ELAPSEDErik Faye-Lund2018-11-231-1/+2
| | | | | | | | | | | | | | ctx->Extensions.EXT_timer_query is set based on the driver- capabilities, not based on the context type. We need to check against _mesa_has_EXT_timer_query(ctx) instead to figure out if the extension is really supported. We also need to check for EXT_disjoint_timer_query, which enables the same functionality for ES. This turns usage of GL_TIME_ELAPSED into an error on ES 3, as is required by the spec. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/main: fix validation of GL_ANY_SAMPLES_PASSED_CONSERVATIVEErik Faye-Lund2018-11-231-2/+2
| | | | | | | | | | | | | | | | | ctx->Extensions.ARB_ES3_compatibility is set based on the driver- capabilities, not based on the context type. We need to check against _mesa_has_ARB_ES3_compatibility(ctx) instead to figure out if the extension is really supported. In addition, EXT_occlusion_query_boolean should also allow this behavior. This shouldn't cause any functional change, as all drivers that support ES3_compatibility should in practice enable either ES3_compatibility or EXT_occlusion_query_boolean under all APIs that export this symbol. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/main: fix validation of GL_ANY_SAMPLES_PASSEDErik Faye-Lund2018-11-231-1/+2
| | | | | | | | | | | | | | | | | | ctx->Extensions.ARB_occlusion_query2 is set based on the driver- capabilities, not based on the context type. We need to check against _mesa_has_ARB_occlusion_query2(ctx) instead to figure out if the extension is really supported. In addition, EXT_occlusion_query_boolean should also allow this behavior. This shouldn't cause any functional change, as all drivers that support ARB_occlusion_query2 should in practice enable either ARB_occlusion_query2 or EXT_occlusion_query_boolean under all APIs that export this symbol. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/main: fix validation of GL_SAMPLES_PASSEDErik Faye-Lund2018-11-231-1/+2
| | | | | | | | | | | | | | | ctx->Extensions.ARB_occlusion_query is set based on the driver- capabilities, not based on the context type. We need to check against _mesa_has_ARB_occlusion_query(ctx) instead to figure out if the extension is really supported. We also need to check for ARB_occlusion_query2, as ARB_occlusion_query isn't available in core contexts. This turns usage of GL_SAMPLES_PASSED into an error on ES 3, as is required by the spec. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/main: simplify pipeline-statistics query validationErik Faye-Lund2018-11-231-2/+1
| | | | | | | | | | | | The _mesa_has_ARB_pipeline_statistics_query(ctx)-helper will already check the GLES-version according to the extension-table, so if this extension would ever be back-ported to ES, we only need to update the table to support this. This shouln't have any functional effect. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/main: use non-prefixed enums for consistencyErik Faye-Lund2018-11-231-33/+33
| | | | | | | | | These enums all have the same values as their non-prefixed versions, and there's several aliases for some of them. So let's switch to the non-prefixed versions for simplicity. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: remove incorrect change for EXT_disjoint_timer_queryMarek Olšák2018-08-231-2/+1
| | | | | Reviewed-by: Tapani Pälli <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: Return number of result bits for GL_ANY_SAMPLES_PASSED_CONSERVATIVEDanylo Piliaiev2018-06-271-0/+1
| | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106986 Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: include dispatch.h lessMarek Olšák2018-04-121-1/+0
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: GL_EXT_disjoint_timer_query extension API bitsTapani Pälli2017-12-151-1/+2
| | | | | | | | | | | Patch adds GL_GPU_DISJOINT_EXT and enables to use timer queries when EXT_disjoint_timer_query is enabled. v2: enable extension only when EXT_disjoint_timer_query set Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> (v1) Reviewed-by: Ian Romanick <[email protected]>
* mesa: enum checks for GL_EXT_occlusion_query_booleanTapani Pälli2017-10-251-0/+44
| | | | | | | Some of the checks are valid for generic ES 3.2 as well. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: don't lock hashtables that are not shared across contextsTimothy Arceri2017-04-221-4/+4
| | | | | | | | | | | | | | | | | | | From Chapter 5 'Shared Objects and Multiple Contexts' of the OpenGL 4.5 spec: "Objects which contain references to other objects include framebuffer, program pipeline, query, transform feedback, and vertex array objects. Such objects are called container objects and are not shared" For we leave locking in place for framebuffer objects because the EXT fbo extension allowed sharing. We could maybe just replace the hash with an ordinary hash table but for now this should remove most of the unnecessary locking. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: Track transform feedback overflow query objects.Rafael Antognolli2017-02-211-0/+21
| | | | | | | Also update checks on conditional rendering. Signed-off-by: Rafael Antognolli <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/queryobject: return INVALID_VALUE if offset < 0 (v2)Dave Airlie2016-05-231-0/+5
| | | | | | | | | | | | This fixes: GL45-CTS.direct_state_access.queries_errors The ARB_direct_state_access spec agrees. v2: move check down further (Ilia) Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: remove hack to fix up GL_ANY_SAMPLES_PASSED resultsIlia Mirkin2016-02-091-5/+0
| | | | | | | | | | Both st/mesa and i965 should return a true/false result now, and the only other driver implementing queries (radeon) doesn't support ARB_occlusion_query2 which added that pname. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add core implementation of ARB_query_buffer_objectIlia Mirkin2016-02-041-147/+138
| | | | | | | Forwards query result writes to drivers. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: add _mesa_has_tessellationMarek Olšák2015-07-231-1/+1
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Rename _mesa_lookup_enum_by_nr() to _mesa_enum_to_string().Kenneth Graunke2015-07-201-14/+14
| | | | | | | 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 query object functions"Ian Romanick2015-05-281-7/+0
| | | | | | | This reverts commit d3368e0c9e27ced6059eb2ecdf2aa999a00e90b0. Acked-by: Fredrik Höglund <[email protected]> Cc: "10.6" <[email protected]>
* mesa: Add ARB_direct_state_access checks in query object functionsFredrik Höglund2015-05-141-0/+7
| | | | | Signed-off-by: Fredrik Höglund <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
* main/queryobj: add GL_QUERY_TARGET support to GetQueryObjectiv()Martin Peres2015-05-061-0/+12
| | | | | | | | This was missing from my patchset to support the query-related entry points of Direct State Access. Reported-by: Ilia Mirkin <[email protected]> Signed-off-by: Martin Peres <[email protected]>
* main: Added entry points for glGetQueryBufferObject*Martin Peres2015-03-251-0/+39
| | | | | | | | | These entry points will be fleshed out when the GL_ARB_query_buffer_object extension gets implemented. In the meantime, return GL_INVALID_OPERATION as suggested by Ian. Reviewed-by: Laura Ekstrand <[email protected]> Signed-off-by: Martin Peres <[email protected]>
* main: Added entry point for glCreateQueriesMartin Peres2015-03-251-7/+69
| | | | | | | | v2: - display the name of the target instead of its id (Laura) Reviewed-by: Laura Ekstrand <[email protected]> Signed-off-by: Martin Peres <[email protected]>
* main: replace tabs by 8 spaces in bufferobj.cMartin Peres2015-03-251-8/+8
| | | | | Reviewed-by: Laura Ekstrand <[email protected]> Signed-off-by: Martin Peres <[email protected]>
* mesa: move declaration before codeBrian Paul2015-02-271-2/+3
| | | | | | To fix MinGW warning. Reviewed-by: Anuj Phogat <[email protected]>
* mesa: Return error if BeginQuery is called with an existing object of ↵Eduardo Lima Mitev2015-02-241-0/+16
| | | | | | | | | | | | | | | | | | | different type Section 2.14 Asynchronous Queries, page 84 of the OpenGL ES 3.0.4 spec states: "BeginQuery generates an INVALID_OPERATION error if any of the following conditions hold: [...] id is the name of an existing query object whose type does not match target; [...] Similar wording exists in the OpenGL 4.5 spec, section 4.2. QUERY OBJECTS AND ASYNCHRONOUS QUERIES, page 43. Fixes 1 dEQP test: * dEQP-GLES3.functional.negative_api.fragment.begin_query Reviewed-by: Ian Romanick <[email protected]>
* mesa: Return INVALID_OPERATION when querying a never bound Query objEduardo Lima Mitev2015-02-241-4/+4
| | | | | | | | | | | | | | | | | Section 2.14 Asynchronous Queries, page 84 of the OpenGL ES 3.0.4 states: "The command void GenQueries( sizei n, uint *ids ); returns n previously unused query object names in ids. These names are marked as used, for the purposes of GenQueries only, but no object is associated with them until the first time they are used by BeginQuery." This means that any attempt to use or query a Query object id before it has ever been bound by calling glBeginQuery, should be assume to be an invalid object. Fixes 1 dEQP test: * dEQP-GLES3.functional.negative_api.state.get_query_objectuiv Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add support for the ARB_pipeline_statistics_query extensionBen Widawsky2015-02-171-0/+89
| | | | | | | | | | | | | | | | | | | | | | | | | This was originally part of a single patch which added the extension, and implemented it for i965 classic. For information about the evolution of the patch, please see the subsequent commit. One difference here as compared to the original mega patch is this does build support for the compute shader query. Since it cannot be tested on any platform, it will always return NULL for now. Jordan has already written a patch to address this, and when that patch lands, this logic can be modified. v2: Fix typo in subject (Brian Paul) Add checks for desktop gl (Ilia) Fail for any callers for now (Ilia) Update QueryCounterBits for new tokens (Ilia) Jordan: Use _mesa_has_compute_shaders Signed-off-by: Ben Widawsky <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> v3: Rebased on patch which adds the proper information to unstub tessellation shaders. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Enable simultaneous queries on different streams.Iago Toral Quiroga2014-06-301-8/+9
| | | | | | | | It should be possible to query the number of primitives written to each individual stream by a geometry shader in a single draw call. For that we need to have up to MAX_VERTEX_STREAM separate query objects. Reviewed-by: Ian Romanick <[email protected]>
* mesa: Include stream information in indexed queries.Iago Toral Quiroga2014-06-301-0/+1
| | | | Reviewed-by: Ian Romanick <[email protected]>
* Remove error when calling glGenQueries/glDeleteQueries while a query is activeCarl Worth2013-10-281-15/+10
| | | | | | | | | | | | | | | | There is nothing in the OpenGL specification which prevents the user from calling glGenQueries to generate a new query object while another object is active. Neither is there anything in the Mesa implementation which prevents this. So remove the INVALID_OPERATION errors in this case. Similarly, it is explicitly allowed by the OpenGL specification to delete an active query, so remove the assertion for that case, replacing it with the necesssary state updates to end the query, (clear the bindpt pointer and call into the driver's EndQuery hook). CC: <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* mesa: Ensure gl_query_object is fully initialized.Vinson Lee2013-09-061-1/+1
| | | | | | | | | | | | 278372b47e4db8a022d57f60302eec74819e9341 added the uninitialized pointer field gl_query_object:Label. A free of this pointer resulted in a crash. This patch fixes piglit regressions with swrast introduced by 6d8dd59cf53d2f47b817d79204a52bb3a46e8c77. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69047 Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: free object labels when deletingTimothy Arceri2013-09-041-0/+1
| | | | | | Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Set query->EverBound in glQueryCounter().Kenneth Graunke2013-08-251-0/+1
| | | | | | | | | | | | | | | | | | | | | glIsQuery is supposed to return false for names returned by glGenQueries until their first use. BeginQuery is a use, but QueryCounter is also a use. From the ARB_timer_query spec: "A timer query object is created with the command void QueryCounter(uint id, enum target); [...] If <id> is an unused query object name, the name is marked as used [...]" Fixes Piglit's spec/ARB_timer_query/query-lifetime. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]> Cc: [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 flag _NEW_DEPTH in Begin/EndQuery if driver implements the functionsMarek Olšák2013-04-241-3/+4
| | | | | | | | | | | We don't want to set the flag for Gallium. I think only swrast needs the flag to be set for occlusion queries. v2: fix stats_wm updates in i965 Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove #include "mfeatures.h" from numerous source filesBrian Paul2013-04-171-1/+0
| | | | | | None of the remaining FEATURE_x symbols in mfeatures.h are used anymore. Reviewed-by: Jordan Justen <[email protected]>
* mesa: Add a new QueryCounter() hook for TIMESTAMP queries.Kenneth Graunke2013-03-011-3/+8
| | | | | | | | | | | | | | | | | | | | In OpenGL, most queries record statistics about operations performed between a defined beginning and ending point. However, TIMESTAMP queries are different: they immediately return a single value, and there is no start/stop mechanism. Previously, Mesa implemented TIMESTAMP queries by calling EndQuery without first calling BeginQuery. Apparently this is DirectX convention, and Gallium followed suit. I personally find the asymmetry jarring, however---having BeginQuery and EndQuery handle a different set of enum values looks like a bug. It's also a bit confusing to mix the one-shot query with the start/stop model. So, add a new QueryCounter driver hook for implementing TIMESTAMP. For now, fall back to EndQuery to support drivers that don't do the new mechanism. Signed-off-by: Kenneth Graunke <[email protected]>
* mesa: Initially populate the display list with the exec list.Eric Anholt2013-01-211-27/+0
| | | | | | | | This cuts out a ton of code to make functions not set to a save_ variant match. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Drop manual checks for outside begin/end.Eric Anholt2013-01-211-10/+0
| | | | | | | | | | | 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]>
* queryobj: Add EverBound flag, making ISQuery() return false before BeginQuery()Carl Worth2013-01-151-3/+18
| | | | | | | | | | | | | | | | | | | | | This flag allows for the specified behavior that GenQueries reserves a name, but does not associate an object with it until BeginQuery. We allocate the object immediately with the new EverBound flag set to false, and then set the flag to true at the time of BeginQuery. This allows us to implement a conformant IsQuery function by checking the state of the new EverBound flag. This fixes the following es3conform tests: occlusion_query_genqueries occlusion_query_is_query_nonzero and the following piglit test: occlusion_query_lifetime Reviewed-by: Ian Romanick <[email protected]>