diff options
author | Marek Olšák <marek.olsak@amd.com> | 2021-01-02 16:32:42 -0500 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-01-27 23:53:35 +0000 |
commit | a4a21b6104e7692de070a6f48a768d1894b732ac (patch) | |
tree | f20493e2629c9bff359be9cb039d6793d10db10c /src/gallium/auxiliary/cso_cache | |
parent | 27dcb466293f2ab3f80a141fd0b8c14617a8e37f (diff) |
cso_context,u_vbuf: add take_ownership param into set_vertex_buffers
st/mesa will use this to skip atomic ops for reference counting.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8298>
Diffstat (limited to 'src/gallium/auxiliary/cso_cache')
-rw-r--r-- | src/gallium/auxiliary/cso_cache/cso_context.c | 10 | ||||
-rw-r--r-- | src/gallium/auxiliary/cso_cache/cso_context.h | 1 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c index e48f12993ea..fc54dfc7be7 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.c +++ b/src/gallium/auxiliary/cso_cache/cso_context.c @@ -1027,7 +1027,7 @@ void cso_set_vertex_buffers(struct cso_context *ctx, return; if (vbuf) { - u_vbuf_set_vertex_buffers(vbuf, start_slot, count, 0, buffers); + u_vbuf_set_vertex_buffers(vbuf, start_slot, count, 0, false, buffers); return; } @@ -1052,6 +1052,7 @@ cso_set_vertex_buffers_and_elements(struct cso_context *ctx, const struct cso_velems_state *velems, unsigned vb_count, unsigned unbind_trailing_vb_count, + bool take_ownership, bool uses_user_vertex_buffers, const struct pipe_vertex_buffer *vbuffers) { @@ -1073,7 +1074,8 @@ cso_set_vertex_buffers_and_elements(struct cso_context *ctx, if (vb_count || unbind_trailing_vb_count) { u_vbuf_set_vertex_buffers(vbuf, 0, vb_count, - unbind_trailing_vb_count, vbuffers); + unbind_trailing_vb_count, + take_ownership, vbuffers); } u_vbuf_set_vertex_elements(vbuf, velems); return; @@ -1083,7 +1085,7 @@ cso_set_vertex_buffers_and_elements(struct cso_context *ctx, /* Unbind all buffers in u_vbuf, because we'll use cso_context. */ unsigned unbind_vb_count = vb_count + unbind_trailing_vb_count; if (unbind_vb_count) - u_vbuf_set_vertex_buffers(vbuf, 0, 0, unbind_vb_count, NULL); + u_vbuf_set_vertex_buffers(vbuf, 0, 0, unbind_vb_count, false, NULL); /* Unset this to make sure the CSO is re-bound on the next use. */ u_vbuf_unset_vertex_elements(vbuf); @@ -1093,7 +1095,7 @@ cso_set_vertex_buffers_and_elements(struct cso_context *ctx, if (vb_count || unbind_trailing_vb_count) { pipe->set_vertex_buffers(pipe, 0, vb_count, unbind_trailing_vb_count, - false, vbuffers); + take_ownership, vbuffers); } cso_set_vertex_elements_direct(ctx, velems); } diff --git a/src/gallium/auxiliary/cso_cache/cso_context.h b/src/gallium/auxiliary/cso_cache/cso_context.h index cd0fc0f616e..826e153ab7a 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.h +++ b/src/gallium/auxiliary/cso_cache/cso_context.h @@ -169,6 +169,7 @@ cso_set_vertex_buffers_and_elements(struct cso_context *ctx, const struct cso_velems_state *velems, unsigned vb_count, unsigned unbind_trailing_vb_count, + bool take_ownership, bool uses_user_vertex_buffers, const struct pipe_vertex_buffer *vbuffers); |