platform/upstream/mesa.git
11 months agonvk: Break the guts of CmdDispatch into a helper
Faith Ekstrand [Tue, 31 Jan 2023 02:12:02 +0000 (20:12 -0600)]
nvk: Break the guts of CmdDispatch into a helper

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: advertize KHR_relaxed_block_layout
Thomas H.P. Andersen [Fri, 7 Oct 2022 15:09:19 +0000 (17:09 +0200)]
nvk: advertize KHR_relaxed_block_layout

Test run totals:
  Passed:        16/32 (50.0%)
  Failed:        0/32 (0.0%)
  Not supported: 16/32 (50.0%)
  Warnings:      0/32 (0.0%)

Not supported is: "Physical storage buffer pointers not supported", so
waiting for VK_KHR_buffer_device_address.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Implement VK_EXT/KHR_buffer_device_address
Faith Ekstrand [Tue, 31 Jan 2023 02:12:02 +0000 (20:12 -0600)]
nvk: Implement VK_EXT/KHR_buffer_device_address

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Use depth_clamp_enable to select PIXEL_*_Z_CLAMP.
Emma Anholt [Fri, 28 Oct 2022 22:43:40 +0000 (15:43 -0700)]
nvk: Use depth_clamp_enable to select PIXEL_*_Z_CLAMP.

Fixes most of "-t depth_clamp" (just point_list fails, but other
point_list stuff fails too)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Fix missing init of the stages to sync against.
Emma Anholt [Sat, 29 Oct 2022 15:48:19 +0000 (08:48 -0700)]
nvk: Fix missing init of the stages to sync against.

Fixes: d8a0dcb234cd ("nvk: Events")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Remove duplicate (disabled) point sprite setup.
Emma Anholt [Fri, 28 Oct 2022 23:19:30 +0000 (16:19 -0700)]
nvk: Remove duplicate (disabled) point sprite setup.

There's another copy of this above, with just slightly different unused
state.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: fix copy lower address extraction
Dave Airlie [Mon, 31 Oct 2022 03:48:43 +0000 (13:48 +1000)]
nvk: fix copy lower address extraction

this was missing an 0xf

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: sort extensions
Thomas H.P. Andersen [Mon, 24 Oct 2022 00:13:31 +0000 (02:13 +0200)]
nvk: sort extensions

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: fix initialization override
Thomas H.P. Andersen [Mon, 24 Oct 2022 00:13:08 +0000 (02:13 +0200)]
nvk: fix initialization override

this is already set a few lines up

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: drop dead assignment
Thomas H.P. Andersen [Mon, 24 Oct 2022 00:11:01 +0000 (02:11 +0200)]
nvk: drop dead assignment

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: drop dead assignment
Thomas H.P. Andersen [Mon, 24 Oct 2022 00:10:19 +0000 (02:10 +0200)]
nvk: drop dead assignment

p_format is not used again after this assignment

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonouveau/headers: Add generated headers to dependencies
Faith Ekstrand [Tue, 31 Jan 2023 02:12:02 +0000 (20:12 -0600)]
nouveau/headers: Add generated headers to dependencies

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: CmdPushDescriptorSetWithTemplateKHR
Thomas H.P. Andersen [Mon, 3 Oct 2022 21:54:21 +0000 (23:54 +0200)]
nvk: CmdPushDescriptorSetWithTemplateKHR

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Add a helper for pushing descriptors
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nvk: Add a helper for pushing descriptors

This reduces the boilerplate a bit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: KHR_descriptor_update_template
Thomas H.P. Andersen [Wed, 28 Sep 2022 16:15:35 +0000 (18:15 +0200)]
nvk: KHR_descriptor_update_template

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: advertise KHR_sampler_mirror_clamp_to_edge
Thomas H.P. Andersen [Fri, 14 Oct 2022 16:24:54 +0000 (18:24 +0200)]
nvk: advertise KHR_sampler_mirror_clamp_to_edge

Test run totals:
  Passed:        3162/13944 (22.7%)
  Failed:        0/13944 (0.0%)
  Not supported: 10782/13944 (77.3%)
  Warnings:      0/13944 (0.0%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: advertise EXT_private_data
Thomas H.P. Andersen [Sun, 9 Oct 2022 20:40:46 +0000 (22:40 +0200)]
nvk: advertise EXT_private_data

Test run totals:
  Passed:        69/112 (61.6%)
  Failed:        0/112 (0.0%)
  Not supported: 43/112 (38.4%)
  Warnings:      0/112 (0.0%)
  Waived:        0/112 (0.0%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: advertise KHR_image_format_list
Thomas H.P. Andersen [Sun, 9 Oct 2022 20:40:17 +0000 (22:40 +0200)]
nvk: advertise KHR_image_format_list

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: advertise KHR_shader_non_semantic_info
Thomas H.P. Andersen [Sun, 9 Oct 2022 20:39:01 +0000 (22:39 +0200)]
nvk: advertise KHR_shader_non_semantic_info

Test run totals:
  Passed:        8/8 (100.0%)
  Failed:        0/8 (0.0%)
  Not supported: 0/8 (0.0%)
  Warnings:      0/8 (0.0%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Advertise VK_KHR_storage_buffer_storage_class
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nvk: Advertise VK_KHR_storage_buffer_storage_class

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Move more states to dynamic
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nvk: Move more states to dynamic

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Advertise VK_EXT_extended_dynamic_state3
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nvk: Advertise VK_EXT_extended_dynamic_state3

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Implement VK_EXT_border_color_swizzle
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nvk: Implement VK_EXT_border_color_swizzle

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agovulkan: Add a helper for swizzling color values
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
vulkan: Add a helper for swizzling color values

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Advertise custom border color features
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nvk: Advertise custom border color features

We were advertising the extension string but not filling out the
features struct.  Now we should be properly advertising it "for real".

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonil: Fix include guards in nil_image.h
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nil: Fix include guards in nil_image.h

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Use 2D array views for 3D storage images
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nvk: Use 2D array views for 3D storage images

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Advertise VK_KHR_maintenance1
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nvk: Advertise VK_KHR_maintenance1

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Support 2D views of 3D images
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nvk: Support 2D views of 3D images

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonil: Add a helper for getting 2D views of 3D images
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nil: Add a helper for getting 2D views of 3D images

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Support copies between 3D and 2D images
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nvk: Support copies between 3D and 2D images

This requires that we unify and only have one layer count for the copy
region so we arbitrarily choose extent_el.depth.  We could choose layer
count but we already have a VkExtent3D so we may as well use it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Bind 3D images as 3D for clears
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nvk: Bind 3D images as 3D for clears

Normally, Vulkan doesn't support binding 3D image views for rendering
but we support it in NVK.  If we bind it as a 2D array, that requires
setting 2D_ARRAY_COMPATIBLE_BIT to get a 2D array layout.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Implement VK_EXT_pci_bus_info
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nvk: Implement VK_EXT_pci_bus_info

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonouveau: Add PCI information to nv_device_info
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nouveau: Add PCI information to nv_device_info

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Tell WSI we don't support legacy scanout
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nvk: Tell WSI we don't support legacy scanout

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Advertise VK_KHR_separate_depth_stencil_layout
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nvk: Advertise VK_KHR_separate_depth_stencil_layout

We entirely ignore image layouts on NVIDIA so this is trivial.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Flush the current pushbuf before allocating a new one
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nvk: Flush the current pushbuf before allocating a new one

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Advertise VK_KHR_imageless_framebuffer
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nvk: Advertise VK_KHR_imageless_framebuffer

Handled entirely in common code

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Enable VK_KHR_create_renderpass2
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nvk: Enable VK_KHR_create_renderpass2

Handled entirely in common code

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Stop leaking command pool BOs
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nvk: Stop leaking command pool BOs

There are a couple of bugs here.  First, vk_command_pool_finish() may
destroy command buffers which may end up returning BOs to the pool so we
need to wait to call nvk_cmd_pool_destroy_bos() until after that's
happened.  Second, we weren't actually adding allocated BOs to the BO
list in nvk_cmd_buffer so they weren't ever getting returned.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Don't crash if we fail to allocate a push BO
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nvk: Don't crash if we fail to allocate a push BO

Currently, we continue just fine until nvk_EndCommandBuffer calls
nvk_cmd_buffer_flush_push() and it crashes tring to look at
cmd->push_bo.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Events
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nvk: Events

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Use poll for BO waits
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nvk: Use poll for BO waits

The nouveau ioctl doesn't support timeouts but poll() does.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Use mme_load_addr64()
Faith Ekstrand [Tue, 31 Jan 2023 02:12:01 +0000 (20:12 -0600)]
nvk: Use mme_load_addr64()

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonouveau/parser: Handle 6F methods
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nouveau/parser: Handle 6F methods

These are the methods below 0x100 which exist on all subchannels.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Use a normal DMA for CmdUpdateBuffer
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Use a normal DMA for CmdUpdateBuffer

Sure, inline data is neat and all, but our upload buffers are better set
up for handling large quantities of data.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Handle large command buffer uploads better
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Handle large command buffer uploads better

Change our assertion from a < to a <=.  Also, if the size of the upload
is greater than the amount of space we have left in the old BO, don't
set cmd->upload_bo to point to the new thing.  Instead, let the next
upload carry on with the old buffer since it has more room.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Implement vkCmdCopyQueryPoolResults()
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Implement vkCmdCopyQueryPoolResults()

One day, we may want to make this a compute shader like RADV uses but
this gets us up-and-going without more infra and it's probably what we
want for small numbers of queries anyway.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Use mme_tu104_read_fifoed()
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Use mme_tu104_read_fifoed()

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonouveau/mme: Add a helper for MME_DMA_READ_FIFOED
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nouveau/mme: Add a helper for MME_DMA_READ_FIFOED

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonouveau/mme: Add a couple helpers for working 64-bit addresses
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nouveau/mme: Add a couple helpers for working 64-bit addresses

In the command stream, they always come high bits first which is
backwards from little endian. These helpers follow that same convention
so that MMEs use the same conventions as other registers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonouveau/mme: Add support for freeing registers
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nouveau/mme: Add support for freeing registers

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonouveau/mme: Assert on OOB registers
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nouveau/mme: Assert on OOB registers

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonouveau/mme: Allow ZERO as the destinatio nof mme_load_to
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nouveau/mme: Allow ZERO as the destinatio nof mme_load_to

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Implement pipeline statistics and occlusion queries
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Implement pipeline statistics and occlusion queries

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Implement timestamp queries
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Implement timestamp queries

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Add a query pool object
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Add a query pool object

Also, while we're here, add a skeliton for vkGetQueryPoolResult().  It
doesn't do anything yet because we haven't implemented any qeury types,
but all the helpers, etc. we need are there.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonouveau/parser: Parse all fields in each method
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nouveau/parser: Parse all fields in each method

When converting to mako, the break got moved to the wrong spot and we
were only parsing the first method.  Now we parse them all.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk/wsi: Use the common present implementation
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk/wsi: Use the common present implementation

This enables WSI for NVK.  Currently, it always gets the blit path and
renders correctly on X11 and corrupts on Wayland.  The problem is that
we don't yet support linear images so wayland gets tiled and is wrong.
The thing that saves us for X11 is the lack of VK_EXT_pci_bus_info.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk/wsi: Style fixes
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk/wsi: Style fixes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Reset semaphore syncs on wait
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Reset semaphore syncs on wait

Vulkan semaphores are spec'd to auto-reset on wait but we currently
assert on signal that the state is RESET. Without this, semaphores used
more than once assert which isn't what we want.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Style fixes in nvk_physical_device.c
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Style fixes in nvk_physical_device.c

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: support exporting buffers
Karol Herbst [Fri, 10 Jun 2022 17:37:17 +0000 (19:37 +0200)]
nvk: support exporting buffers

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Rework whitespace in nvk_device_memory.c
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Rework whitespace in nvk_device_memory.c

Trying to keep things consistent...

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Allocate shaders from a heap
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Allocate shaders from a heap

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Add a shader heap to nvk_device
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Add a shader heap to nvk_device

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Return a VkResult from nvk_shader_upload()
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Return a VkResult from nvk_shader_upload()

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Add a heap data structure
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Add a heap data structure

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Rework nvk_queue_submit_simple()
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: Rework nvk_queue_submit_simple()

This is a few changes rolled into one:

 1. Add a sync flag to force a stall before returning
 2. Re-order dw and push_dw_count to put the count first
 3. Take an array of extra BOs instead of just one

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agoutil/vma: Allow initializing zero-size heaps
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
util/vma: Allow initializing zero-size heaps

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: WFI in pipeline barriers
Faith Ekstrand [Tue, 31 Jan 2023 02:12:00 +0000 (20:12 -0600)]
nvk: WFI in pipeline barriers

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Use meta for doing blits with the 3D hardware
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Use meta for doing blits with the 3D hardware

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk/meta: Save/restore descriptor set 0
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk/meta: Save/restore descriptor set 0

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Support load_layer_id
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Support load_layer_id

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agovulkan/meta: Implement vkCmdBlitImage()
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
vulkan/meta: Implement vkCmdBlitImage()

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agovulkan/meta: Fixes for clear
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
vulkan/meta: Fixes for clear

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agovulkan/meta: Add a create_sampler helper
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
vulkan/meta: Add a create_sampler helper

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agovulkan/meta: Add a helper for image view types
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
vulkan/meta: Add a helper for image view types

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agovulkan/meta: Add key types
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
vulkan/meta: Add key types

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Properly implement robustBufferAccess
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Properly implement robustBufferAccess

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Add lowering for load_global_constant_bounded
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Add lowering for load_global_constant_bounded

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: drop nvk_nir.h
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: drop nvk_nir.h

Instead, move the definition of nvk_nir_lower_descriptors to
nvk_shader.h.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: use common pipeline layout code
Thomas H.P. Andersen [Sat, 17 Sep 2022 09:22:45 +0000 (11:22 +0200)]
nvk: use common pipeline layout code

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: use common descriptor set layout code
Thomas H.P. Andersen [Sat, 17 Sep 2022 09:21:20 +0000 (11:21 +0200)]
nvk: use common descriptor set layout code

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Bring back push sync and dumping
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Bring back push sync and dumping

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Also store the push BO map in nvk_queue_state
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Also store the push BO map in nvk_queue_state

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Add an nvk_queue_submit wrapper
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Add an nvk_queue_submit wrapper

Instead of having the common queue code call into drm_nouveau code
directly, add a wrapper layer.  This gives us a place to put things like
command buffer dumping.  Importantly, we move calling
`vk_queue_set_error()` to this layer because it may abort if the
`VK_ABORT_ON_DEVICE_LOST` is set and we may want to dump before that
happens.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Embed a nv_device_info in nvk_physical_device
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Embed a nv_device_info in nvk_physical_device

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Reference descriptor set layouts in the sets themselves
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Reference descriptor set layouts in the sets themselves

We need descriptor set layouts for vkUpdateDescriptorSets() but they
have different lifetimes.  This is the entire reason for doing reference
counting at all but we haven't actually set up the descriptor set code
to take references yet.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Implement VK_KHR_push_descriptor
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Implement VK_KHR_push_descriptor

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Fix up whitespace in nvk_descriptor_set.c
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Fix up whitespace in nvk_descriptor_set.c

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Use vk_object_zalloc/free for descriptor pools/sets
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Use vk_object_zalloc/free for descriptor pools/sets

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Re-indent vk_instance.c
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Re-indent vk_instance.c

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonouveau: Drop nouveau_ws_push
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nouveau: Drop nouveau_ws_push

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonouveau: Use DRM interfaces directly in MME tests
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nouveau: Use DRM interfaces directly in MME tests

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Remove remaining references to nouveau_push.h
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Remove remaining references to nouveau_push.h

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Implement vkCmdExecuteCommands()
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Implement vkCmdExecuteCommands()

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Use nvk_cmd_bo for push bufs
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Use nvk_cmd_bo for push bufs

This allows us to recycle them.  It also makes implementing secondary
command buffers tractable.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Allocate upload buffers from the command pool
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Allocate upload buffers from the command pool

Instead of the growing BO thing

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>

11 months agonvk: Add an nvk_cmd_buffer_ref_bo helper
Faith Ekstrand [Tue, 31 Jan 2023 02:11:59 +0000 (20:11 -0600)]
nvk: Add an nvk_cmd_buffer_ref_bo helper

We only need this for internal stuff that isn't tracked any other way.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>