aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/hud/hud_context.c
Commit message (Collapse)AuthorAgeFilesLines
* gallium/hud: don't use user vertex buffersErik Faye-Lund2020-06-161-2/+5
| | | | | | | | This gains back some performance lost in the previous commit, by bypassing u_vbuf. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5417>
* Revert "gallium/hud: don't use user vertex buffers"Erik Faye-Lund2020-06-161-21/+7
| | | | | | | | | | | | | | | | | | The approach taken in this commit only works on drivers that expose the PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT capability. For drivers that don't, the buffer has been unmapped by the time we get to hud_draw_colored_prims, leading to crashes. It's not easy to fix the code, but drivers that do support coherent mapping will most likely do the right think themseleves, so let's just go back to using user-buffers here. This reverts commit 4fe1fd4df40ac91b2783e3604fd81e6a6faf0cd2. Fixes: 4fe1fd4df40 ("gallium/hud: don't use user vertex buffers") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3106 Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5417>
* gallium/hud: do not specify potentially invalid depth-rangeErik Faye-Lund2020-06-101-1/+1
| | | | | | | | | | | | Setting the depth-scale to 1 while leaving the depth-translation at 0 means our near-plane is at -1 in OpenGL semantics, which is out-of-range on some drivers. In particular, Zink has this limitation. But since we'll only pass a zero z in here anyway, we might as well multiply it by zero, and get the same result. This avoids the problem. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5408>
* util: Initialize pipe_shader_state for passthrough and transform shadersNeha Bhende2020-05-281-2/+2
| | | | | | | | | | | | | | | mesa/st is initializing pipe_shader_state for user define shaders. This patch intialized pipe_shader_state for all passthough and transform shaders. This fixes crashes for several opengl apps. Issue is found in vmware internal testing Fixes: f01c0565bb9 ("draw: free the NIR IR.") Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5240>
* gallium: change comments to remove 'state tracker'Marek Olšák2020-05-131-1/+1
| | | | | | | Acked-by: Eric Anholt <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]> Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4902>
* gallium: hud_context: Fix scalar initializer warning.John Stultz2020-03-111-1/+3
| | | | | | | | | | | | | | | | | When trying to build mesa/master under AOSP, I've run into the following error: external/mesa3d/src/gallium/auxiliary/hud/hud_context.c:1821:31: error: braces around scalar initializer [-Werror,-Wbraced-scalar-init] struct sigaction action = {{0}}; ^~~ 1 error generated. This patch addresses this by switching to using memset instead of using an initializer. Signed-off-by: John Stultz <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4141> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4141>
* gallium: pass cso_velems_state into cso_context instead of pipe_vertex_elementMarek Olšák2020-02-281-4/+5
| | | | | | | This removes one memcpy from the CSO hashing code. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3990>
* hud: add GALLIUM_HUD_SCALEJonathan Marek2020-02-241-8/+11
| | | | | | | | | Scale hud by an integer factor, for high DPI displays. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3931> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3931>
* gallium/auxiliary: Fix uses of gnu struct = {} extensionDylan Baker2019-11-261-1/+1
| | | | | | | | | | Most of these will never actually be compiled by windows, but in the interest of being able to make using struct foo = {}; an error and avoiding breaking windows removing a handful of safe uses seems like a good trade off. Reviewed-by: Kristian H. Kristensen <[email protected]> Acked-by: Eric Engestrom <[email protected]>
* util: Move gallium's PIPE_FORMAT utils to /util/format/Eric Anholt2019-11-141-1/+1
| | | | | | | | | | | | | | | To make PIPE_FORMATs usable from non-gallium parts of Mesa, I want to move their helpers out of gallium. Since u_format used util_copy_rect(), I moved that in there, too. I've put it in a separate directory in util/ because it's a big chunk of related code, and it's not clear to me whether we might want it as a separate library from libmesa_util at some point. Closes: #1905 Acked-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* util: remove LIST_IS_EMPTY macroTimothy Arceri2019-10-281-1/+1
| | | | | | | Just use the inlined function directly. The new function was introduced in addcf410. Reviewed-by: Eric Engestrom <[email protected]>
* util: remove LIST_DEL macroTimothy Arceri2019-10-281-3/+3
| | | | | | | Just use the inlined function directly. The macro was replaced with the function in ebe304fa540f. Reviewed-by: Eric Engestrom <[email protected]>
* util: remove LIST_ADD macroTimothy Arceri2019-10-281-1/+1
| | | | | | | Just use the inlined function directly. The macro was replaced with the function in ebe304fa540f. Reviewed-by: Eric Engestrom <[email protected]>
* util: remove LIST_ADDTAIL macroTimothy Arceri2019-10-281-4/+4
| | | | | | | Just use the inlined function directly. The macro was replaced with the function in ebe304fa540f. Reviewed-by: Eric Engestrom <[email protected]>
* util: remove LIST_INITHEAD macroTimothy Arceri2019-10-281-2/+2
| | | | | | | Just use the inlined function directly. The macro was replaced with the function in ebe304fa540f. Reviewed-by: Eric Engestrom <[email protected]>
* util: use standard name for vsnprintf()Eric Engestrom2019-07-191-1/+1
| | | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* util: use standard name for strncmp()Eric Engestrom2019-07-191-1/+1
| | | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* gallium: split depth_clip into depth_clip_near & depth_clip_farMarek Olšák2018-09-061-1/+2
| | | | for AMD_depth_clamp_separate.
* gallium: add storage_sample_count parameter into is_format_supportedMarek Olšák2018-07-311-1/+1
| | | | Tested-by: Dieter Nützel <[email protected]>
* gallium/hud: = should rename the last added data sourceMarek Olšák2018-06-181-1/+4
| | | | Tested-by: Dieter Nützel <[email protected]>
* gallium/hud: add frametime graph (v2)Matthias Groß2018-05-151-0/+4
| | | | | | | | | Thanks for your comment. This version has an additional boolean in the fps_info struct to distinguish between fps and frame time calculation. The struct is initialised in the respecting install functions for this purpose. Signed-off-by: Marek Olšák <[email protected]>
* gallium: remove aux_vertex_buffer_slot codeMarek Olšák2018-05-121-9/+5
| | | | | | The slot index is always 0, and is pretty unlikely to change in the future. Reviewed-by: Brian Paul <[email protected]>
* gallium/hud: add a simple HUD view that only draws textMarek Olšák2018-04-131-14/+58
| | | | | | | | | | | Add this prefix to the env var: "simple," For example: GALLIUM_HUD=simple,fps The X coordinates are the same, but the Y coordinates are different, because there is only text. '+' happens to behave the same as "\n". ',' happens to behave the same as "\n\n".
* gallium/hud: Fix support for PIPE_DRIVER_QUERY_TYPE_FLOATBrian Paul2018-01-171-0/+5
| | | | | | | | | | | | | | | Evidently, nobody has used PIPE_DRIVER_QUERY_TYPE_FLOAT up to this point. Adding a driver query of this type which returns the query value in pipe_query_result::f resulted in garbage output in the HUD. The problem is the pipe_query_result::f field was being accessed as through the u64 field and being added to the query_info::results_cumulative field. This patch checks for PIPE_DRIVER_QUERY_TYPE_FLOAT in a few places and scales the float by 1000 before converting to uint64_t. Also, add some comments to explain the query_info::result_index field. Reviewed-by: Marek Olšák <[email protected]>
* gallium/hud: use #ifdef to test for macro existenceEric Engestrom2017-12-011-5/+5
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/hud: add HUD sharing within a context share groupMarek Olšák2017-11-251-12/+91
| | | | | | | This is needed for profiling multi-context applications like Chrome. One context can record queries and another context can draw the HUD. Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/hud: update the HUD interface for multiple contextsMarek Olšák2017-11-251-3/+4
| | | | | | | This is the boring subset of the following commit. All new parameters are optional. Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/hud: prevent a crash if the recording context is inactiveMarek Olšák2017-11-251-1/+4
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/hud: separate code for record context init/releaseMarek Olšák2017-11-251-16/+33
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/hud: separate code for draw context init/releaseMarek Olšák2017-11-251-70/+111
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/hud: don't use hud->pipe in hud_parse_env_varMarek Olšák2017-11-251-6/+7
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/hud: use cso_get_pipe_contextMarek Olšák2017-11-251-2/+3
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/hud: pass pipe_context explicitly to most functionsMarek Olšák2017-11-251-19/+19
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/hud: split hud_draw into 3 separate functionsMarek Olšák2017-11-251-74/+94
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/hud: always use two-dimensional constant referencesNicolai Hähnle2017-09-041-4/+4
| | | | | | Acked-by: Roland Scheidegger <[email protected]> Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* gallium/hud: use double values for all graphsChristoph Haag2017-07-141-4/+10
| | | | | | | | | | | | | | | The fps graph for example calculates the fps as double with small variations based on when query_new_value() is called, which causes many values to be truncated on the cast to uint64_t. The HUD internally stores the values as double, so just use double everywhere instead of fixing this with rounding. Using doubles also allows the hud to show small variations instead of being clamped to discrete values. v2: Don't print decimals in the dump file when not necessary Signed-off-by: Christoph Haag <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* gallium/hud: add glthread countersMarek Olšák2017-06-261-0/+9
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* gallium/hud: add API-thread-busy for monitoring the thread loadMarek Olšák2017-06-261-1/+4
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* gallium/hud: add hud_pane::hud pointerMarek Olšák2017-06-261-3/+5
| | | | | | for later use Reviewed-by: Timothy Arceri <[email protected]>
* mesa/glthread: add glthread "perf" counters and pass them to gallium HUDMarek Olšák2017-06-261-0/+8
| | | | | | | | | | | for HUD integration in following commits. This valuable profiling data will allow us to see on the HUD how well glthread is able to utilize parallelism. This is better than benchmarking, because you can see exactly what's happening and you don't have to be CPU-bound. u_threaded_context has the same counters. Reviewed-by: Timothy Arceri <[email protected]>
* gallium/hud: move struct hud_context to hud_private.hMarek Olšák2017-06-261-46/+0
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* gallium/hud: rename API-thread-busy to main-thread-busyMarek Olšák2017-06-261-2/+2
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* gallium/hud: support GALLIUM_HUD_DUMP_DIR feature on WindowsBrian Paul2017-06-161-6/+30
| | | | | | | Use a dummy implementation of the access() function. Use \ path separator. Add a few comments. Reviewed-by: Neha Bhende <[email protected]>
* gallium: decrease the size of pipe_vertex_buffer - 24 -> 16 bytesMarek Olšák2017-05-101-7/+7
|
* gallium/hud: set the dump file streams to line bufferedEdmondo Tommasina2017-04-131-0/+2
| | | | | | | | Flush the HUD value streams to the dump files after every newline. v2: check that fopen succeeded (Julien) Reviewed-and-Tested-by: Julien Isorce <[email protected]>
* gallium/hud: check NULL return from u_upload_allocJulien Isorce2017-03-131-0/+5
| | | | | | | | | | | | | | | | | | | | Fixes the following segmentation fault: signal SIGSEGV: invalid address (fault address: 0x0) frame #0: 0x00007fffe718e117 radeonsi_dri.so hud_draw_background_quad hud_context.c:170 167 168 assert(hud->bg.num_vertices + 4 <= hud->bg.max_num_vertices); 169 -> 170 vertices[num++] = (float) x1; 171 vertices[num++] = (float) y1; 172 173 vertices[num++] = (float) x1; (lldb) bt * frame #0: 0x00007fffe718e117 radeonsi_dri.so`hud_draw_background_quad frame #1: 0x00007fffe718f458 radeonsi_dri.so`hud_draw frame #2: 0x00007fffe712967f radeonsi_dri.so`dri_flush Signed-off-by: Marek Olšák <[email protected]>
* gallium/hud: prevent an infinite loopMarek Olšák2017-02-221-2/+3
| | | | | | v2: use UINT64_MAX / 11 Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/hud: create files after graphs are created to get final namesMarek Olšák2017-02-181-2/+23
| | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Edmondo Tommasina <[email protected]>
* gallium/hud: add monitoring of API thread busy statusMarek Olšák2017-02-141-0/+3
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/hud: don't use user vertex buffersMarek Olšák2017-02-141-7/+19
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>