There are a couple of bugs here. First, vk_command_pool_finish() may
destroy command buffers which may end up returning BOs to the pool so we
need to wait to call nvk_cmd_pool_destroy_bos() until after that's
happened. Second, we weren't actually adding allocated BOs to the BO
list in nvk_cmd_buffer so they weren't ever getting returned.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Change our assertion from a < to a <=. Also, if the size of the upload
is greater than the amount of space we have left in the old BO, don't
set cmd->upload_bo to point to the new thing. Instead, let the next
upload carry on with the old buffer since it has more room.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
One day, we may want to make this a compute shader like RADV uses but
this gets us up-and-going without more infra and it's probably what we
want for small numbers of queries anyway.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
In the command stream, they always come high bits first which is
backwards from little endian. These helpers follow that same convention
so that MMEs use the same conventions as other registers.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Also, while we're here, add a skeliton for vkGetQueryPoolResult(). It
doesn't do anything yet because we haven't implemented any qeury types,
but all the helpers, etc. we need are there.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This enables WSI for NVK. Currently, it always gets the blit path and
renders correctly on X11 and corrupts on Wayland. The problem is that
we don't yet support linear images so wayland gets tiled and is wrong.
The thing that saves us for X11 is the lack of VK_EXT_pci_bus_info.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Vulkan semaphores are spec'd to auto-reset on wait but we currently
assert on signal that the state is RESET. Without this, semaphores used
more than once assert which isn't what we want.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This is a few changes rolled into one:
1. Add a sync flag to force a stall before returning
2. Re-order dw and push_dw_count to put the count first
3. Take an array of extra BOs instead of just one
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Instead of having the common queue code call into drm_nouveau code
directly, add a wrapper layer. This gives us a place to put things like
command buffer dumping. Importantly, we move calling
`vk_queue_set_error()` to this layer because it may abort if the
`VK_ABORT_ON_DEVICE_LOST` is set and we may want to dump before that
happens.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
We need descriptor set layouts for vkUpdateDescriptorSets() but they
have different lifetimes. This is the entire reason for doing reference
counting at all but we haven't actually set up the descriptor set code
to take references yet.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>