This helper unlike alloc, tries to use the same value as the register
had before. This is intended for manual spill/unspill code which wants
to keep register numbers the same while carefully spilling around high-
pressure regions.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Introduce helpers to make it easier to work with the nvk mme shadow
scratch. Store begin in the shadow scratch in vkCmdDraw* related code to
save registers, which is necessary for Fermi.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
Pre-Turing, we don't have a full condition built into the loop so, for
mme_while(b, ine, x, y) we have to generate the following:
[top] BR -> [cond]
/* loop body */
[cond] XOR tmp, x, y
BRZ !tmp -> [top]
However, due to an accounting error, we were generating
[top] BR -> [cond]
/* loop body */
XOR tmp, x, y
[cond] BRZ !tmp -> [top]
which meant that the XOR (or ADD if one is an immediate) was getting
skipped, leading to the loop either never terminating or always
terminating. The way to fix this accounting error is to close the while
first, then compute the condition value, then do the jump.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
We need to lock the memory objects list around the entire push builder
process. Otherwise, a memory object could get destroyed between adding
it to the BO list and doing the submit, leading to the kernel rejecting
our pushbuf.
When the time comes that we switch to the new uAPI both uses of
nvk_device::mutex will go away. We'll no longer be passing lists of BOs
to the kernel and we'll move to syncobj and be able to drop all the
nvk_bo_sync nonsense.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
We need 2 reports for these. One for successfully written primitives
and one for needed primitives. Also we need to use report semaphore's
sub_report member to specify the query's corresponding vertex stream.
Finally availability index is 2 in the query results, as we have 2
results for succeeded and needed primitives.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This draw needs to read the byte count indirectly so it is implemented
as an mme function. Some refactoring was done in the draw functions, so
that nvk_mme_build_draw could be used for this case.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
For starters, we support only vertex shader output transform feedback.
Optional support for queries, streams and indirect draw are left out for
now.
Pipeline and shader state is based on nvc0 code. Most of the shader
state is going to change with the new compiler.
Required support for pause/resume is implemented with an mme function
that loads the offset indirectly from the counter buffer on resume.
For pause, we store the offset indirectly with a SET_REPORT_SEMAPHORE.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
nvk_get_device_extensions uses device->info to enable extensions
only for supported device architectures.
Only info is needed, but it seemed cleaner to keep all the three
changed lines together.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
We need to supply the base vertex, the base instance and draw index to
the shader for this extension. Similar to the base instance we supported
before, we load base vertex and draw index as root constants at draw time.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
We do not need the full nvk_device struct for the mme builder functions,
just the nv_device_info is enough. We keep a pointer in the
mme_builder so we can use this instead. Also, when we run mme builder
tests we do not need to initialize a device struct.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>