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>
By applying the same coding style of the other case statements,
this patch fixes the following building errors:
../src/nouveau/mme/mme_fermi.c:209:10: error: expected expression
uint32_t src_bit = inst->bitfield.src_bit;
^
../src/nouveau/mme/mme_fermi.c:216:39: error: use of undeclared identifier 'src_bit'; did you mean 'dst_bit'?
fprintf(fp, " (%u, %u, %u)", src_bit, size, dst_bit);
^~~~~~~
dst_bit
../src/nouveau/mme/mme_fermi.c:211:19: note: 'dst_bit' declared here
uint32_t dst_bit = inst->bitfield.dst_bit;
^
2 errors generated.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This simple test compiles all the MMEs for Turing and Volta to ensure
that they build and don't run out of registers. We could, in theory, do
actual unit testing here with gtest but just building is enough to
ensure that no one breaks driver start-up on hardware they don't own.
They can still break the driver functionally, of course, but at least
it'll initialize.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>