Commit graph

175418 commits

Author SHA1 Message Date
Faith Ekstrand
c9e28274cc nouveau: Add CPU push buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
8530c3c882 nvk: Implement push constants and descriptors for graphics
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
1e3e85056b nvk: Emit dynamic graphics state
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
d98a7d0de5 nvk: Misc. additional state setup
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
ff3e099a73 nvk: Add boilerplate for Begin/EndRendering
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
5ee481bf26 nil/format: Add helpers for render formats
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
617532b24e nvk: Import 3D context init code from nouveau
We really should organize this better but at least we have it now.
This should pretty much be equivalent to what nouveau is doing on
screen/context create.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
7315650739 nvk: Add a nvk_cmd_buffer_device() helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
abb7f69520 nvk/shader: Populate headers for vertex and fragment shaders
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
8df9d16fb4 nvk/shader: Assign I/O locations and gather info
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
0b179da344 nvk: Make shader_upload take an nvk_device
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
61a91914df nvk: Expose pipeline alloc/free functions
This will provide some commonality between graphics and compute.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
ae0d8edc1d nvk: Free pipeline shader BOs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
c2f636861a nvk: Add an nvk_shader_address helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
782d376363 nvk: Don't free the NIR in nvk_compile_nir
It's a layering violation and the NIR is currently leaked if we the
compile fails.  It's better to make the caller clean up.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
ffc6c3afaf nvk: Switch to vk_pipeline_shader_stage_to_nir
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
65b1cc3adf nvk: Split pipeline binding into helpers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
db2cf498ce nvk: Add graphics state to command buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
0f203b2b44 nouveau: Generate 3D headers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
b3531276c6 nouveau: Null terminate the debug flag list
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
4a22e24e98 nouveau/push: Make P_IMMD more versatile
It's now able to use either the immediate form or method form depending
on whether or not the value fits into 13 bits.  We wrap the check with
__builtin_constant_p() so that this choice is compile-time determined
instead of runtime.  I've verified with SET_CT_SELECT() that GCC is able
to determine which bits are used even if not all of them are constants.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
ec0b9109b8 nouveau/parser: Handle arrays properly in P_IMMD()
We make a new macro VA_NVCLS_FOO which is either an array macro or a
regular macro and, either way, redirects to V_NVCLS_FOO.  This lets us
unconditionally use VA_NVCLS_FOO in P_IMMD() and, if the caller hands in
a FOO(i), it will get unwrapped and mangled to produce to V_NVCLS_FOO.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
68403e5742 nouveau/parser: Better dump float data
For now, we only do something with floats when we dump.  You still need
to use fui() when setting them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
bbdd35f155 nouveau/parser: Properly dump most arrays used by 3D
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
76e30e64da nouveau/parser: Fix an integer overflow and a typo
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
a4b29aaa72 nvk: Init WSI after setting up supported_sync_types
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Karol Herbst
edfc84b4eb nouveau/ws: allocate copy subchan as well
Starting with Ampere we have to do this. It is a safe thing for previous
gens to do.
Very old kernels might reject this, but too lazy to check.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Karol Herbst
25a91f9093 nouveau/ws: allocate 3D subchan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Karol Herbst
3f07cd31e3 nouveau/headers: initial 3D headers import
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Karol Herbst
e6b2c84d0f nouveau/headers: add path for 3D headers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Karol Herbst
84830a1725 nvk: set deviceName
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
dc1f87864d nouveau/push: Add a P_INLINE_FLOAT helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
5e3f6f326f nvk: Make image/buffer address helpers const
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
7ebc94a17a nvk: Include nvk_private.h in everything
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Yusuf Khan
d76175955f nouveau/ws: remove the drm.h header
It can cause compilation issues on Arch, there is a workaround by
including it as <drm.h> but this solution is simpler.

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Mauro Rossi
403ac39bbc nouveau/ws: fix building error in nouveau_ws_push_dump()
PRIxPTR macro solves the problem

Fixes the following build error:

../src/nouveau/winsys/nouveau_push.c:119:43: error: format specifies type 'unsigned long' but the argument has type 'int' [-Werror,-Wformat]
      printf("[0x%08lx] HDR %x subch %i", cur - push->orig_map, hdr, subchan);
                 ~~~~~                    ^~~~~~~~~~~~~~~~~~~~
                 %08x
1 error generated.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Karol Herbst
002516aeb8 nouveau/ws: use new NVIF interface to query oclasses
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Karol Herbst
daa91dfedf nouveau/ws: get rid of libdrm
and just completely rework device and context creation

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Karol Herbst
cafccc2305 nouveau/ws: depend on generated class header files
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
a8d545602a nvk: Padd shader BOs by 4K to avoid I-cache overflow
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
06cf8244f1 nvk: Bind immutable samplers on descriptor set creation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
61e910bde0 nvk: Rework OOM handling for descriptor pools
We now properly return VK_ERROR_OUT_OF_POOL_MEMORY if we run out instead
of silently assigning a NULL bo and map.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
933d487313 nvk: Advertise minUniformBufferOffsetAlignment
Fixes a bunch of dEQP-VK.image.store.with_format.*_constant tests

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
152ded2b97 nvk: No-op sparse image format properties
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
0e284f71e1 nvk: Unconditionally zero image format properties
It seems like this shouldn't be neded but some of the tests complain if
we don't because they call vkGetPhysicalDeviceImageFormatProperties()
and vkGetPhysicalDeviceImageFormatProperties2() and compare if they
return identical results even if they return error.  Zero is the
reasonable thing to do if you don't support a format anyway because then
it's a maximum extent, sample count, etc. of zero.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
cf76c3d17c nvk: Initial vkCmdClearImage support
Doing something for some formats is better than silently doing nothing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
f8b48ccf0b nvk: Assert that we don't double-free descriptors
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
a68b0fcd05 nvk: Delete the storage TIC in nvk_image_view_destroy
Also, assert that descriptors are non-zero.  Zero is reserved for the
null image descriptor.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
e1c93352d7 nvk: Support inline uniform blocks
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
a45f789083 nvk: Use a switch for descriptor types in load_descriptor
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00