aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_cb_queryobj.c
Commit message (Collapse)AuthorAgeFilesLines
* st/mesa: move utility functions, macros into new st_util.h fileBrian Paul2019-03-111-0/+1
| | | | | | | | | | | | | | To de-clutter st_context.h. Clean up remaining function prototypes in st_context.h. The st_vp_uses_current_values() helper is only used in st_context.c so move it there. The st_get_active_states() function is only used in st_context.c so remove its prototype in st_context.h Reviewed-by: Neha Bhende <[email protected]>
* st/mesa: fix PRIMITIVES_GENERATED query after the "pipeline stat single" changesMarek Olšák2019-01-231-1/+2
| | | | | | | | | | | | When this functionality was added, the PRIMITIVES_GENERATED query was accidentally omitted. This causes issues for drivers that support transform feedback." Fixes: d644698b443 ("gallium: Add the ability to query a single pipeline statistics counter") Reviewed-by: Erik Faye-Lund <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* gallium: Add the ability to query a single pipeline statistics counterKenneth Graunke2019-01-151-2/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Gallium historically has treated pipeline statistics queries as a single query, PIPE_QUERY_PIPELINE_STATISTICS, which returns a block of 11 values. This was originally patterned after the D3D1x API. Much later, Brian introduced an OpenGL extension that exposed these counters - but it exposes 11 separate queries, each of which returns a single value. Today, st/mesa simply queries all 11 values, and returns a single value. While pipeline statistics counters aren't typically performance critical, this is still not a great fit. A D3D1x->GL translator might request all 11 counters by creating 11 separate GL queries...which Gallium would map to reads of all 11 values each time, resulting in a total 121 counter reads. That's not ideal. This patch adds a new cap, PIPE_CAP_QUERY_PIPELINE_STATISTICS_SINGLE, and corresponding query type PIPE_QUERY_PIPELINE_STATISTICS_SINGLE. When calling create_query(), q->index should be set to one of the PIPE_STAT_QUERY_* enums to select a counter. Unlike the block query, this returns the value in pipe_query_result::u64 (as it's a single value) instead of the pipe_query_data_pipeline_statistics group. We update st/mesa to expose ARB_pipeline_statistics_query if either capability is set, preferring the new SINGLE variant when available. Thanks to Roland, Ilia, and Marek for helping me sort this out. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* st/mesa: Rearrange PIPE_QUERY_PIPELINE_STATISTICS result fetching.Kenneth Graunke2019-01-151-43/+45
| | | | | | | | | | | This just changes the order of the switch statements, so we only look at target if the query type is PIPE_QUERY_PIPELINE_STATISTICS. The next commit will introduce a new SINGLE query type which can be used for the same GL query types, and it won't want this processing. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* st/mesa: Make an enum for pipeline statistics query result indices.Kenneth Graunke2019-01-151-11/+11
| | | | | | | | | | | | Gallium handles pipeline statistics queries as a single query (PIPE_QUERY_PIPELINE_STATISTICS) which returns a struct with 11 values. Sometimes it's useful to refer to each of those values individually, rather than as a group. To avoid hardcoding numbers, we define a new enum for each value. Here, the name and enum value correspond to the index in the struct pipe_query_data_pipeline_statistics result. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* st/mesa: include main/compiler.h in st_cb_queryobj.cBrian Paul2018-01-171-0/+1
| | | | | | To get CPU_TO_LE32() macro. Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium: add PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVENicolai Hähnle2017-09-181-1/+4
| | | | | | | | | | | | | | | | | To be able to properly distinguish between GL_ANY_SAMPLES_PASSED and GL_ANY_SAMPLES_PASSED_CONSERVATIVE. This patch goes through all drivers, having them treat the two query types identically, except: 1. radeon incorrectly enabled conservative mode on PIPE_QUERY_OCCLUSION_PREDICATE. We now do it correctly, only on PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE. 2. st/mesa uses the new query type. Fixes dEQP-GLES31.functional.fbo.no_attachments.* Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: implement ARB_transform_feedback_overflow_queryNicolai Hähnle2017-08-021-1/+3
| | | | | | v2: update for new cap name Reviewed-by: Marek Olšák <[email protected]>
* mesa: Track transform feedback overflow query objects.Rafael Antognolli2017-02-211-0/+6
| | | | | | | Also update checks on conditional rendering. Signed-off-by: Rafael Antognolli <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: check return value of begin/end_queryNicolai Hähnle2016-04-211-22/+33
| | | | | | | | | They can only indicate out of memory conditions, since the other error conditions are caught earlier. v2: fix error message in EndQuery Reviewed-by: Samuel Pitoiset <[email protected]>
* st/mesa: make use of the occlusion predicate queryIlia Mirkin2016-02-091-2/+10
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: add query buffer supportIlia Mirkin2016-02-041-1/+96
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium/st: add pipe_context::get_timestamp()Brian Paul2015-09-021-2/+11
| | | | | | | | | The VMware svga driver doesn't directly support pipe_screen::get_timestamp() but we can do a work-around. However, we need a gallium context to do so. This patch adds a new pipe_context::get_timestamp() function that will only be called if the pipe_screen::get_timestamp() function is NULL. Signed-off-by: Brian Paul <[email protected]>
* st/mesa: add ARB_pipeline_statistics_query supportIlia Mirkin2015-02-181-4/+54
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: add vertex stream supportIlia Mirkin2014-07-011-1/+1
| | | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium: add an index argument to create_queryIlia Mirkin2014-07-011-3/+3
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* st/mesa: add null pointer checking in query object functionsBrian Paul2014-03-261-2/+16
| | | | | | | | | Don't pass null query object pointers into gallium functions. This avoids segfaulting in the VMware driver (and others?) if the pipe_context::create_query() call fails and returns NULL. Cc: "10.0" "10.1" <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* s/Tungsten Graphics/VMware/José Fonseca2014-01-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tungsten Graphics Inc. was acquired by VMware Inc. in 2008. Leaving the old copyright name is creating unnecessary confusion, hence this change. This was the sed script I used: $ cat tg2vmw.sed # Run as: # # git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed # # Rename copyrights s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g /Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./ s/TUNGSTEN GRAPHICS/VMWARE/g # Rename emails s/[email protected]/[email protected]/ s/[email protected]/[email protected]/g s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/ s/jrfonseca\[email protected]/[email protected]/g s/keithw\[email protected]/[email protected]/g s/[email protected]/[email protected]/g s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/ s/[email protected]/[email protected]/ # Remove dead links s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g # C string src/gallium/state_trackers/vega/api_misc.c s/"Tungsten Graphics, Inc"/"VMware, Inc"/ Reviewed-by: Brian Paul <[email protected]>
* st/mesa: remove #include mfeatures.hBrian Paul2013-04-091-1/+0
| | | | | | None of these were needed. Reviewed-by: Jordan Justen <[email protected]>
* mesa/es3: Add support for GL_ANY_SAMPLES_PASSED_CONSERVATIVE query targetIan Romanick2013-01-111-0/+1
| | | | Signed-off-by: Ian Romanick <[email protected]>
* mesa/st: Implement GL_TIME_ELAPSED w/ PIPE_QUERY_TIMESTAMP.José Fonseca2012-12-201-18/+67
| | | | | | | | | | | | | | | | | | ARB/EXT_timer_query's definition of GL_TIME_ELAPSED match precisely the subtraction of two GL_TIMESTAMP queries. And for a lot of drivers, that's precisely how they have to implement internally -- by emitting two hardware timestamp queries. So, to simplify driver implementation, simply allow doing so in the state tracker. Eventually if no driver implements PIPE_QUERY_TIME_ELAPSED then we could retire it. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: remove FEATURE_queryobj define.Oliver McFadden2012-09-151-4/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: implement ARB_timer_queryMarek Olšák2012-07-101-0/+14
|
* gallium: adapt to get_query_result interface changeMarek Olšák2012-03-301-2/+2
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: flush bitmap cache on query and conditional render boundariesVadim Girlin2011-07-131-0/+5
| | | | | | | | | | Bitmap caching shouldn't affect the results of the queries and conditional render. NOTE: This is a candidate for the 7.11 branch. Signed-off-by: Vadim Girlin <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* st/mesa: add st_BeginQuery() case for GL_ANY_SAMPLES_PASSEDBrian Paul2011-01-121-0/+2
| | | | Fixes piglit occlusion_query2 failure.
* st/mesa: Include mfeatures.h in files that perform feature tests.Vinson Lee2011-01-091-0/+1
|
* st/mesa: Remove unnecessary header.Vinson Lee2010-10-271-1/+0
|
* Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg2010-10-131-6/+6
|
* gallium: EXT_timer_query support.Mathias Fröhlich2010-05-171-0/+3
| | | | Signed-off-by: Corbin Simpson <[email protected]>
* st/mesa: Make st_cb_queryobj.h FEATURE_queryobj aware.Chia-I Wu2010-05-121-0/+4
| | | | | This change allows st_cb_queryobj.h to be used without knowing if FEATURE_queryobj is enabled.
* st/mesa: update query code for transform feedbackBrian Paul2010-05-111-3/+25
|
* st/mesa: clean-up: use st_context() everywhereBrian Paul2010-04-231-5/+5
|
* Replace _mesa_malloc, _mesa_calloc and _mesa_free with plain libc versionsKristian Høgsberg2010-02-191-1/+1
|
* st/mesa: replace conditional with assertionBrian Paul2010-02-171-7/+2
| | | | | Core Mesa will not call ctx->Driver.CheckQuery() if the Ready flag is already set.
* Merge branch 'mesa_7_7_branch'Brian Paul2010-01-221-1/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gallium/auxiliary/draw/draw_context.c src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c src/gallium/auxiliary/pipebuffer/Makefile src/gallium/auxiliary/pipebuffer/SConscript src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c src/gallium/auxiliary/tgsi/tgsi_scan.c src/gallium/drivers/i915/i915_surface.c src/gallium/drivers/i915/i915_texture.c src/gallium/drivers/llvmpipe/lp_setup.c src/gallium/drivers/llvmpipe/lp_tex_sample_c.c src/gallium/drivers/llvmpipe/lp_texture.c src/gallium/drivers/softpipe/sp_prim_vbuf.c src/gallium/state_trackers/xorg/xorg_dri2.c src/gallium/winsys/drm/intel/gem/intel_drm_api.c src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c src/gallium/winsys/drm/radeon/core/radeon_drm.c src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c src/mesa/state_tracker/st_cb_clear.c
| * st/mesa: Remove unnecessary header from st_cb_queryobj.c.Vinson Lee2010-01-151-1/+0
| |
* | st/mesa: move st_query_object type to header to make it publicBrian Paul2009-12-311-17/+0
|/
* mesa: use new ST_CALLOC_STRUCT() macro in gallium state trackerBrian Paul2009-02-121-1/+1
|
* mesa: consistantly use mesa memory-functions in gallium state trackerBrian Paul2009-02-121-1/+1
| | | | | Use _mesa_malloc(), _mesa_free(), etc everywhere, not malloc(), free(), etc. Still using CALLOC_STRUCT() at this point.
* gallium: remove stray commentBrian Paul2008-04-071-5/+1
|
* Rework gallium and mesa queries a little.Keith Whitwell2007-12-111-19/+49
| | | | | | Add a 'CheckQuery()' driver callback to mesa to check query completion. Make pipe_query an opaque type. Rework softpipe queries, support overlapping occlusion queries.
* Implement query object interface.Brian2007-09-111-7/+76
| | | | | | This replaces the temporary occlusion counter functions we had before. Added new ctx->Driver.WaitQuery() function which should block until the result is ready. Sketch out some code for vertex transformation feedback counters.
* Begin/EndQuery functionsBrian2007-08-111-0/+76