aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/cso_cache
Commit message (Collapse)AuthorAgeFilesLines
* gallium: pass cso_velems_state into cso_context instead of pipe_vertex_elementMarek Olšák2020-02-282-23/+17
| | | | | | | 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>
* gallium/cso_hash: inline struct cso_hash_dataMarek Olšák2020-02-282-32/+28
| | | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3990>
* gallium/cso_hash: pack cso_node betterMarek Olšák2020-02-281-1/+1
| | | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3990>
* gallium/cso_hash: remove another layer of pointer indirectionMarek Olšák2020-02-142-45/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | Convert this: struct cso_hash { union { struct cso_hash_data *d; struct cso_node *e; } data; }; to this: struct cso_hash { struct cso_hash_data data; struct cso_node *end; }; 1) data is not a pointer anymore. 2) "end" points to "data" and acts as the end of the linked list. 3) This code is still crazy. Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3829> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3829>
* gallium/cso_hash: cosmetic changes, no behavior changesMarek Olšák2020-02-142-57/+43
| | | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3829>
* gallium/cso_hash: remove always constant variable nodeSizeMarek Olšák2020-02-142-3/+1
| | | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3829>
* gallium/cso_hash: make cso_hash declared within structures instead of alloc'dMarek Olšák2020-02-143-22/+13
| | | | | | | This removes one level of indirection. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3829>
* gallium/cso_hash: inline a bunch of functionsMarek Olšák2020-02-142-46/+46
| | | | | | | I'm probably not getting anything out of this, but it's harmless. Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3829>
* gallium: bypass u_vbuf if it's not needed (no fallbacks and no user VBOs)Marek Olšák2020-01-082-7/+83
| | | | | | | This decreases CPU overhead, because u_vbuf is completely bypassed in those cases. Acked-by: Alyssa Rosenzweig <[email protected]>
* gallium/cso_context: move non-vbuf vertex buffer and element code into helpersMarek Olšák2020-01-081-24/+43
| | | | | | These will be reused. Acked-by: Alyssa Rosenzweig <[email protected]>
* gallium: put u_vbuf_get_caps return values into u_vbuf_capsMarek Olšák2020-01-082-5/+12
| | | | Acked-by: Alyssa Rosenzweig <[email protected]>
* mesa/st: Expose compute shaders when NIR support is advertised.Eric Anholt2018-12-131-1/+2
| | | | | | | | We have a NIR path, and V3D doesn't have TGSI input for compute (only what TTN can handle for the various gallium-internal shaders). Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* gallium/aux/cso_cache: Fix various warningsGert Wollny2018-06-202-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cso_cache.c: In Function »delete_blend_state«: cso_cache/cso_cache.c:90:51: Warning: unused parameter »data« [-Wunused- parameter] static void delete_blend_state(void *state, void *data) ^~~~ cso_cache/cso_cache.c: In Funktion »delete_depth_stencil_state«: cso_cache/cso_cache.c:98:59: Warning: unused parameter »data« [-Wunused- parameter] static void delete_depth_stencil_state(void *state, void *data) ^~~~ cso_cache/cso_cache.c: In Funktion »delete_sampler_state«: cso_cache/cso_cache.c:106:53: Warning: unused parameter »data« [- Wunused-parameter] static void delete_sampler_state(void *state, void *data) ^~~~ cso_cache/cso_cache.c: In Funktion »delete_rasterizer_state«: cso_cache/cso_cache.c:114:56: Warning: unused parameter »data« [- Wunused-parameter] static void delete_rasterizer_state(void *state, void *data) ^~~~ cso_cache/cso_cache.c: In Funktion »delete_velements«: cso_cache/cso_cache.c:122:49: Warning: unused parameter »data« [- Wunused-parameter] static void delete_velements(void *state, void *data) ^~~~ cso_cache/cso_cache.c: In Funktion »sanitize_cb«: cso_cache/cso_cache.c:166:52: Warning: unused parameter »user_data« [- Wunused-parameter] int max_size, void *user_data) ^~~~~~~~~ gallium/aux/cso_context.c: a -Wunused-parameter warning cso_cache/cso_context.c: In Funktion »delete_sampler_state«: cso_cache/cso_context.c:163:57: Warning: unused parameter »ctx« [- Wunused-parameter] static boolean delete_sampler_state(struct cso_context *ctx, void *state) ^~~ Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* cso: check count == 0 in cso_set_vertex_buffersMarek Olšák2018-05-151-0/+3
| | | | | | | | The code didn't expect that, leading to crashes. Fixes: 86d63b53a20a747e "gallium: remove aux_vertex_buffer_slot code" Tested-by: Michel Dänzer <[email protected]>
* gallium: remove aux_vertex_buffer_slot codeMarek Olšák2018-05-122-38/+19
| | | | | | The slot index is always 0, and is pretty unlikely to change in the future. Reviewed-by: Brian Paul <[email protected]>
* gallium/pp: use user constant buffersMarek Olšák2018-04-042-0/+20
| | | | | | This fixes a radeonsi crash. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105026
* cso: don't cycle through PIPE_MAX_SHADER_SAMPLER_VIEWS on context destroyRoland Scheidegger2018-02-281-1/+3
| | | | | | | There's no point, we know the highest non-null one. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* cso: add a couple sanity check assertions in cso_draw_vbo()Brian Paul2018-02-081-0/+6
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* cso: add point rasterization sanity check assertionBrian Paul2017-12-121-0/+5
| | | | | Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* cso: add cso_get_pipe_contextMarek Olšák2017-11-252-0/+5
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* cso: inline a few frequently-used functionsMarek Olšák2017-06-222-31/+26
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* cso: don't return errors from sampler functionsMarek Olšák2017-06-222-18/+8
| | | | | | No code checks the errors. Reviewed-by: Nicolai Hähnle <[email protected]>
* cso: don't track the number of sampler states boundMarek Olšák2017-06-221-36/+23
| | | | | | | | | | | | This removes 2 loops from hot codepaths and adds 1 loop to a rare codepath (restore_sampler_states), and makes sanitize_hash() slightly worse. Sampler states, when bound, are not unbound for draw calls that don't need them. That's OK, because bound sampler states don't add any overhead. This results in lower CPU overhead in most cases. Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium: remove pipe_index_buffer and set_index_bufferMarek Olšák2017-05-102-20/+0
| | | | | | | | | | | | | | pipe_draw_info::indexed is replaced with index_size. index_size == 0 means non-indexed. Instead of pipe_index_buffer::offset, pipe_draw_info::start is used. For indexed indirect draws, pipe_draw_info::start is added to the indirect start. This is the only case when "start" affects indirect draws. pipe_draw_info::index is a union. Use either index::resource or index::user depending on the value of pipe_draw_info::has_user_indices. v2: fixes for nine, svga
* gallium: decrease the size of pipe_vertex_buffer - 24 -> 16 bytesMarek Olšák2017-05-101-16/+8
|
* gallium: s/uint/enum pipe_render_cond_flag/ for set_render_condition()Brian Paul2017-03-082-2/+4
| | | | Reviewed-by: Edward O'Callaghan <[email protected]>
* cso: s/unsigned/enum pipe_shader_type/Brian Paul2017-03-082-10/+12
| | | | Reviewed-by: Edward O'Callaghan <[email protected]>
* gallium: let state trackers tell u_vbuf whether user VBOs are possibleMarek Olšák2017-02-142-5/+7
| | | | | | This can affect whether u_vbuf will be enabled or not. Reviewed-by: Nicolai Hähnle <[email protected]>
* Revert "cso: don't release sampler states that are bound"Michel Dänzer2016-12-191-3/+1
| | | | | | | This reverts commit 6dc96de303290e8d1fc294da478c4f370be98dea. No longer necessary with the previous change. Reviewed-by: Nicolai Hähnle <[email protected]>
* cso: Make sanitize_hash safe for samplersMichel Dänzer2016-12-191-1/+43
| | | | | | | | Remove currently bound sampler states from the hash table before pruning entries from the hash table, so they cannot accidentally be deleted by the pruning. Reviewed-by: Nicolai Hähnle <[email protected]>
* cso: Store hash key in struct cso_samplerMichel Dänzer2016-12-192-0/+2
| | | | | | Preparation for following changes, no functional change intended. Reviewed-by: Nicolai Hähnle <[email protected]>
* cso: Optimize cso_save/restore_fragment_samplersMichel Dänzer2016-12-191-4/+17
| | | | | | | | | Only copy/memset the pointers that actually need to be. v2: * Cast info->nr_samplers to int for calculating delta (Nicolai) Reviewed-by: Nicolai Hähnle <[email protected]>
* cso: Store pointers to struct cso_sampler in struct sampler_infoMichel Dänzer2016-12-191-15/+18
| | | | | | Preparation for following changes, no functional change intended. Reviewed-by: Nicolai Hähnle <[email protected]>
* cso: Don't restore nr_samplers in cso_restore_fragment_samplersMichel Dänzer2016-12-191-1/+0
| | | | | | | | | | If info->nr_samplers > ctx->nr_fragment_samplers_saved, the assignment would prevent cso_single_sampler_done from unbinding the no longer used samplers from the driver, which could result in use-after-free. This is probably unlikely to happen in practice though. Cc: "12.0 13.0" <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* cso: don't release sampler states that are boundMarek Olšák2016-12-071-1/+3
| | | | | | | | | | | | | | This fixes random radeonsi GPU hangs in Batman Arkham: Origins (Wine) and probably many other games too. cso_cache deletes sampler states when the cache size is too big and doesn't check which sampler states are bound, causing use-after-free in drivers. Because of that, radeonsi uploaded garbage sampler states and the hardware went bananas. Other drivers may have experienced similar issues. Cc: 12.0 13.0 <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* gallium: Use enum pipe_shader_type in set_shader_images()Kai Wasserbäch2016-08-292-2/+4
| | | | | Signed-off-by: Kai Wasserbäch <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: Use enum pipe_shader_type in set_sampler_views()Kai Wasserbäch2016-08-292-2/+2
| | | | | Signed-off-by: Kai Wasserbäch <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: Use enum pipe_shader_type in bind_sampler_states() (v2)Kai Wasserbäch2016-08-292-5/+7
| | | | | | | | | | | v1 → v2: - Fixed indentation (noted by Brian Paul) - Removed second assert from nouveau's switch statements (suggested by Brian Paul) Signed-off-by: Kai Wasserbäch <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/cso: avoid unnecessary null dereferenceEric Engestrom2016-08-241-1/+1
| | | | | | | | | | | The label `out:` calls `destroy()` which dereferences `ctx`. This is unnecessary as there is nothing to destroy. Immediately return instead. CovID: 1258255 Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium/cso: allow saving the first fragment shader image slotNicolai Hähnle2016-06-012-0/+48
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* cso: remove / add some commentsBrian Paul2016-05-171-6/+4
| | | | Signed-off-by: Brian Paul <[email protected]>
* cso: null-out previously bound sampler statesBrian Paul2016-05-031-1/+3
| | | | | | | | | | | | | If, for example, we previously had 2 sampler states bound and now we are binding one, we'd leave the second sampler state unchanged. This change nulls-out the second sampler state in this situation. We're already doing the same thing for sampler views. This silences an occasional warning issued by the VMware driver when the number of sampler views and sampler states disagreed. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* gallium: pause queries for all meta opsMarek Olšák2016-04-122-0/+5
| | | | | Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/cso: fix indentationThomas Hindoe Paaboel Andersen2016-03-021-4/+4
| | | | | | | | Only one of these were recently introduced. However, since we keep copy/pasting the same wrong indentation we should probably just fix it. Reviewed-by: Brian Paul <[email protected]>
* gallium/cso: only enable compute shaders when TGSI is supportedSamuel Pitoiset2016-02-181-1/+6
| | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94186 Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* cso: add CSO_BITS_ALL_SHADERSBrian Paul2016-02-161-0/+6
| | | | | | For saving/restoring all shader stages. Reviewed-by: Marek Olšák <[email protected]>
* cso: make most of the cso_save/restore_x() functions staticBrian Paul2016-02-162-85/+70
| | | | | | | Users of the CSO save/restore facility all use the new cso_save/restore_state() functions instead. Reviewed-by: Jose Fonseca <[email protected]>
* cso: add new cso_save/restore_state() functionsBrian Paul2016-02-162-0/+133
| | | | | | | cso_save_state() takes a bitmask of state items to save. Calling cso_restore_state() restores those states. Reviewed-by: Jose Fonseca <[email protected]>
* cso: remove commentBrian Paul2016-02-161-1/+0
| | | | There's a similar comment just a few lines before.
* cso: add new cso_set_viewport_dims() helperBrian Paul2016-02-162-0/+20
| | | | | | To simplify some viewport setting code in the state tracker. Reviewed-by: Jose Fonseca <[email protected]>