Faith Ekstrand
8e85ea6f7a
nvk: Set deviceType based on nv_device_info::type
...
The is_integrated bool is based on VRAM size which is a bit clunky and
not really what the Vulkan query means.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Faith Ekstrand
56ccada087
nouveau: Stop using hex for SM numbers
...
There's no indication that NVIDIA considers this to be anything other
than a decimal number. Much to the contrary, the number of 5s and 9s in
the SM number table implies they very much are base 10. Given that
Lovelace is SM90, we'll likely be hitting 100 fairly soon at which point
this will stop fitting in a uint8_t. Switch to decimal to compress it
down a bit.
Also, rename the field to SM which beter matches the NVIDIA docs and
ensures that there are no users of this which are likely to be confused.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Faith Ekstrand
9846c4e13e
nouveau: Put PCI info in a pci substruct in nv_device_info
...
We separate out device_id because even non-PCI devices have one.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Faith Ekstrand
b232e42532
nvk: Only advertise EXT_pci_bus_info on discrete GPUs
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Faith Ekstrand
e722d0ff0b
nvk: Drop nvk_physical_device::instance
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Faith Ekstrand
221e024386
nvk: Use canonical variable names in nvk_sampler.c
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Faith Ekstrand
75fc6260e8
nvk: Use canonical variable names in nvk_bo_sync.c
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Faith Ekstrand
2be4acce25
nvk: Use canonical variable names in nvk_shader.c
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Faith Ekstrand
6170e1c8d9
nvk: Use canonical variable names in nvk_physical_device.c
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Dave Airlie
0d9155c9f8
nvk: handle alignments in device memory
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Faith Ekstrand
f0a165799c
nvk: Add an addr field to nvk_image_plane
...
Nothing actually needs the pointer to the memory object so it's better
to not even include it.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Dave Airlie
ad37394dfe
nvk: init image fields for requirements
...
Fixes a crash in dEQP-VK.memory.requirements.create_info.*
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Faith Ekstrand
0498eeba32
nvk: Add a buffer alignment helper
...
This consolodates buffer alignment calculations into one place,
including physical device queries, buffer creation, and buffer memory
requirements queries.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Faith Ekstrand
6a0cc93bd4
nvk: Reformat nvk_buffer.c
...
Mostly, using dev instead of device and re-flow the arguments to
nvk_GetDeviceBufferMemoryRequirements().
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Karol Herbst
5fb3298a95
nouveau/winsys: fix SM value for Ada
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Emma Anholt
9ffbd53bb7
nvk: Add support for probing as a platform device.
...
The driver now comes up on gk20a (Jetson TK1).
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Emma Anholt
880663c25d
nvk: Clean up redundant vendor checking for physical device creation.
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Emma Anholt
826486339b
nvk: Quiet a compiler warning.
...
Looks like it's always set to me, but 🤷
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Emma Anholt
0410054459
nouveau/winsys: Fix an undefined use in the error path.
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Dave Airlie
820c03ebee
nvk/query: fix push buffer size for copy pool results.
...
the immediate takes two slots, so bump this by one,
fixes a crash in zink KHR-GL45.transform_feedback.query_vertex_interleaved_test
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Faith Ekstrand
4fe57b2d7a
nvk: Enable external memory extensions
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Faith Ekstrand
113b9b00e7
nvk: Support dma-buf export
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Faith Ekstrand
0399999dec
nvk: Support dma-buf import
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Faith Ekstrand
c370260a8f
nouveau/winsys: Add dma-buf import support
...
This requires a lock and a buffer cache on the nouveau_ws_device.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Faith Ekstrand
10ffe8e709
nvk: Require dedicated allocations for external images
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Faith Ekstrand
7f0c06e130
nvk: Dedicated allocations override internal
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Faith Ekstrand
702326d013
nvk: Add external memory queries
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Faith Ekstrand
3d247f447e
nvk: Add device and driver UUIDs
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Faith Ekstrand
cccc044f51
nvk: Use abbreviated names in nvk_device_memory.c
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
Faith Ekstrand
14d35c7048
nvk: Use NVIDIA_VENDOR_ID in pdev try_create()
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
George Ouzounoudis
ccfbd94891
nvk: Enable descriptor indexing
...
These values follow the already existing per-stage and descriptor set
limits. If we change these to be similar to the reported values of the
proprietary driver, care must be taken as Turing has bigger limits for
uniform buffers than older generations.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
George Ouzounoudis
edb58c6660
nvk: Add nir non-uniform optimization pass
...
The hardware supports non-uniform access natively so we do not need to
lower most non-uniform access in the shader. Just lower the ubo access
as it should probably be faster when we uniformly load from real hw
ubos in the future.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:06 +00:00
George Ouzounoudis
0dd15199a1
nvk: Handle cases of descriptor bindings with variable counts
...
We need to compute the allocated descriptor buffer size at descriptor allocation
time. So we need to split to a pre-computed size for all the other bindings
except the one with the variable count.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:05 +00:00
George Ouzounoudis
6a74b3e311
nvk: Support VkDescriptorSetVariableDescriptorCountLayoutSupport
...
On cases with variable descriptor counts we need to calculate the
maximum supported variable count while taking into account the other existing
descriptors and their alignments in the set.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:05 +00:00
Faith Ekstrand
81bec8b63b
nvk: Use the max descriptor alignemtn in GetDescriptorSetLayoutSupport
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:05 +00:00
Benjamin Lee
354fe8fda0
nvk: Fix segfault when opening DRI device file returns error
...
Previously, ver was unitialized on this path, causing UB on the
`if (ver)` branch after the out_err label.
Signed-off-by: Benjamin Lee <benjamin@computer.surgery>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:05 +00:00
Dave Airlie
3572f5cd7e
nvk: add support for D32_SFLOAT_S8_UINT
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:05 +00:00
Faith Ekstrand
62fa4ff5e0
nvk: Take an nvk_image_plane in nouveau_copy_rect_image
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:05 +00:00
Faith Ekstrand
8d712c2e06
nvk: Add helpers for binding image planes
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:05 +00:00
Faith Ekstrand
fe022d4e87
nvk: s/device/dev in nvk_image.c
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:05 +00:00
Dave Airlie
ebcac6b81c
nvk: introduce an optimisation loop.
...
This brings in pretty much the radv opt loop.
So for tess ctrl where this a loop we can unroll, this fixes
some dynamic array access later to be non-dynamic.
Fixes:
dEQP-VK.clipping.user_defined.clip_distance_dynamic_index.vert_tess.1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:05 +00:00
Dave Airlie
0b6b59e654
nvk: merge tess info between tcs/tes.
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:05 +00:00
Dave Airlie
136d49054b
nvk: fix transform feedback crash when optimiser removes things.
...
This optimise loop can remove stuff, which causes this to crash,
just exit early.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:05 +00:00
George Ouzounoudis
7715aea5aa
nvk: Lower io to temporaries for tessellation evaluation nir
...
This is consistent to what radv does.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:05 +00:00
George Ouzounoudis
f561406d38
nvk: Respect tessellation domain origin state
...
When switching to lower left tessellation domain origin we need to
switch the orientation for triangles/quads. The changes are based on
what anv and radv do.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:05 +00:00
George Ouzounoudis
93369f1f96
nvk: Fix cases where execution mode is specified in the tesc shader.
...
We need to keep some context for the compilation of the tessellation shaders.
This is required in the case where the domain is specified in the
tessellation control shader instead of the tessellation evaluation
shader, as codegen needs the domain information when compiling the
tessellation evaluation shader.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:05 +00:00
George Ouzounoudis
544aadc56b
nvk: Enable multiview with tessellation shader
...
This works by default, we just switch it on.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:05 +00:00
George Ouzounoudis
76e02c7f77
nvk: Assign locations correctly for arrayed IO
...
Arrayed IO, encountered in tessellation shaders, should not take up
multiple driver locations.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:05 +00:00
George Ouzounoudis
304636297f
nvk: Basic tessellation shader support
...
Based on nvc0 implementation but with added nvidia-headers usage.
Device limits taken from http://www.vulkan.gpuinfo.org/ and minimum
required values.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:05 +00:00
Thomas H.P. Andersen
ecbcc26a6e
nvk: remove duplicated device features
...
These are already set in the Vulkan 1.2 section
Add status for bufferDeviceAddressCaptureReplayEXT
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326 >
2023-08-04 21:32:05 +00:00