Commit graph

175395 commits

Author SHA1 Message Date
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
Faith Ekstrand
fff59a5f4f nvk: Fix descriptor offset alignment
This fixes two bugs.  First, we were aligning when setting the bindign
offset but not actually applying that alignment to buffer_size so when
we incremented by stride * descriptorCount, it incremented starting with
the unaligned value.  Second, in some cases we return stride = align = 0
and the ALIGN_POT macro will return 0 when something's aligned to 0.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
443717a17e nvk: Properly indent a comment
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
98a573eb15 nvk: Implement push constants
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
717ed1c48f nvk: Load the requested descriptor size
We were hard-coding to vec4s for some reason.  This results in vec4
texture handles which, while properly ignroed by codegen, are just
weird and not what we want.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
b6483f5126 nvk: Handle cube storage images properly
TIC entries for cubes divide the array size by 6 so we don't want that
when using it as a storage image.  This means nvk_image_view needs
separate TIC entries for storage vs. sampled now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
8b08bbe2cf nvk: Use a descriptor type instead of a hand-rolled thing
This was an attempt to prematurely optimize some things.  Sure, it's a
hot-path, but there's other control-flow in there and we can optimize it
later if needed.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
0648f0fa03 nvk: Advertise non-zero descriptor set limits
Right now, everything's pretty much unlimited.  We may want to limit
UBOs in the future to just what we can bind but everything else will
probably remain pretty high.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
aa78f098f2 nvk: Advertise descriptor array indexing
This isn't as dynamic as it looks.  It still requires the index to be
uniform, it just lets it be not a constant.  Given how our descriptor
sets work, this is all handled trivially already.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
dda149c053 nvk: Better advertise image format features
We now advertise the top-level features and we don't falsely claim
write-without-format support per-format.  In theory, NV hardware should
be able to do shaderStorageImageReadWithoutFormat but codegen doesn't
know how yet.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
db81c26525 nvk: Add support for dynamic buffers
These are recorded in the CPU portion of the descriptor set and combined
with the dynamic offset at vkCmdBindDescriptorSets time and placed into
the root descriptor table.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
1f7476a03d nvk: Use the correct root descriptor table size for CmdDispatch
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
fae4f1884c nvk: Advertise KHR_dedicated_allocation
We're not requiring or even requesting anything to be dedicated yet but
we may as well put in the plumbing.  This gets more tests running.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
fedff04fbd nvk: Implement buffer views
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
1f72430bd6 nvk: Move is_storage_image_format to nvk_format.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
788e94294f nil: Add a helper for filling out buffer TIC entries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
834f01f1b1 nvk: Implement samplers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
100c7060d8 nvk: Re-format nvk_sampler.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
cb4eff26e7 nvk: Teture pool sizes are maximums not sizes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
e13a64d286 nil: Fix image array layer alignments
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
f3ef6f2ee1 nil: Refactor TIC image extent setup
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
6a6cf64a78 nil: Don't minify image dimensions when setting up TIC
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Faith Ekstrand
a67cfe2590 nil: Drop miptail support for now
We don't have any idea how they work or even which TIC bits have to do
with them.  Better off just leave them alone for now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Dave Airlie
974212a581 nouveau/classes: add 906f header support.
This needed some tweaks to the generator script

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00