nv50,nvc0: clear internal vbo masks based on the trailing slots

Fixes: 0278d1fa32 (gallium: add unbind_num_trailing_slots to set_vertex_buffers)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8882>
This commit is contained in:
Ilia Mirkin 2021-02-05 11:08:40 -05:00 committed by Marge Bot
parent eff837c7c2
commit 021bc4f868
2 changed files with 18 additions and 6 deletions

View File

@ -1091,10 +1091,16 @@ nv50_set_vertex_buffers(struct pipe_context *pipe,
unbind_num_trailing_slots,
take_ownership);
unsigned clear_mask = ~u_bit_consecutive(start_slot + count, unbind_num_trailing_slots);
nv50->vbo_user &= clear_mask;
nv50->vbo_constant &= clear_mask;
nv50->vtxbufs_coherent &= clear_mask;
if (!vb) {
nv50->vbo_user &= ~(((1ull << count) - 1) << start_slot);
nv50->vbo_constant &= ~(((1ull << count) - 1) << start_slot);
nv50->vtxbufs_coherent &= ~(((1ull << count) - 1) << start_slot);
clear_mask = ~u_bit_consecutive(start_slot, count);
nv50->vbo_user &= clear_mask;
nv50->vbo_constant &= clear_mask;
nv50->vtxbufs_coherent &= clear_mask;
return;
}

View File

@ -1012,10 +1012,16 @@ nvc0_set_vertex_buffers(struct pipe_context *pipe,
unbind_num_trailing_slots,
take_ownership);
unsigned clear_mask = ~u_bit_consecutive(start_slot + count, unbind_num_trailing_slots);
nvc0->vbo_user &= clear_mask;
nvc0->constant_vbos &= clear_mask;
nvc0->vtxbufs_coherent &= clear_mask;
if (!vb) {
nvc0->vbo_user &= ~(((1ull << count) - 1) << start_slot);
nvc0->constant_vbos &= ~(((1ull << count) - 1) << start_slot);
nvc0->vtxbufs_coherent &= ~(((1ull << count) - 1) << start_slot);
clear_mask = ~u_bit_consecutive(start_slot, count);
nvc0->vbo_user &= clear_mask;
nvc0->constant_vbos &= clear_mask;
nvc0->vtxbufs_coherent &= clear_mask;
return;
}