platform/upstream/mesa.git
12 months agonouveau/ws: fix building error in nouveau_ws_push_dump()
Mauro Rossi [Fri, 15 Jul 2022 16:04:27 +0000 (18:04 +0200)]
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>

12 months agonouveau/ws: use new NVIF interface to query oclasses
Karol Herbst [Thu, 7 Jul 2022 16:36:52 +0000 (18:36 +0200)]
nouveau/ws: use new NVIF interface to query oclasses

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

12 months agonouveau/ws: get rid of libdrm
Karol Herbst [Sun, 3 Jul 2022 17:05:44 +0000 (19:05 +0200)]
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>

12 months agonouveau/ws: depend on generated class header files
Karol Herbst [Thu, 23 Jun 2022 23:34:15 +0000 (01:34 +0200)]
nouveau/ws: depend on generated class header files

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

12 months agonvk: Padd shader BOs by 4K to avoid I-cache overflow
Faith Ekstrand [Tue, 31 Jan 2023 02:11:51 +0000 (20:11 -0600)]
nvk: Padd shader BOs by 4K to avoid I-cache overflow

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

12 months agonvk: Bind immutable samplers on descriptor set creation
Faith Ekstrand [Tue, 31 Jan 2023 02:11:51 +0000 (20:11 -0600)]
nvk: Bind immutable samplers on descriptor set creation

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

12 months agonvk: Rework OOM handling for descriptor pools
Faith Ekstrand [Tue, 31 Jan 2023 02:11:51 +0000 (20:11 -0600)]
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>

12 months agonvk: Advertise minUniformBufferOffsetAlignment
Faith Ekstrand [Tue, 31 Jan 2023 02:11:51 +0000 (20:11 -0600)]
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>

12 months agonvk: No-op sparse image format properties
Faith Ekstrand [Tue, 31 Jan 2023 02:11:51 +0000 (20:11 -0600)]
nvk: No-op sparse image format properties

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

12 months agonvk: Unconditionally zero image format properties
Faith Ekstrand [Tue, 31 Jan 2023 02:11:51 +0000 (20:11 -0600)]
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>

12 months agonvk: Initial vkCmdClearImage support
Faith Ekstrand [Tue, 31 Jan 2023 02:11:51 +0000 (20:11 -0600)]
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>

12 months agonvk: Assert that we don't double-free descriptors
Faith Ekstrand [Tue, 31 Jan 2023 02:11:51 +0000 (20:11 -0600)]
nvk: Assert that we don't double-free descriptors

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

12 months agonvk: Delete the storage TIC in nvk_image_view_destroy
Faith Ekstrand [Tue, 31 Jan 2023 02:11:51 +0000 (20:11 -0600)]
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>

12 months agonvk: Support inline uniform blocks
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
nvk: Support inline uniform blocks

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

12 months agonvk: Use a switch for descriptor types in load_descriptor
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
nvk: Use a switch for descriptor types in load_descriptor

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

12 months agonvk: Fix descriptor offset alignment
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
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>

12 months agonvk: Properly indent a comment
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
nvk: Properly indent a comment

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

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

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

12 months agonvk: Load the requested descriptor size
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
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>

12 months agonvk: Handle cube storage images properly
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
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>

12 months agonvk: Use a descriptor type instead of a hand-rolled thing
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
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>

12 months agonvk: Advertise non-zero descriptor set limits
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
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>

12 months agonvk: Advertise descriptor array indexing
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
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>

12 months agonvk: Better advertise image format features
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
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>

12 months agonvk: Add support for dynamic buffers
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
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>

12 months agonvk: Use the correct root descriptor table size for CmdDispatch
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
nvk: Use the correct root descriptor table size for CmdDispatch

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

12 months agonvk: Advertise KHR_dedicated_allocation
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
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>

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

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

12 months agonvk: Move is_storage_image_format to nvk_format.c
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
nvk: Move is_storage_image_format to nvk_format.c

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

12 months agonil: Add a helper for filling out buffer TIC entries
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
nil: Add a helper for filling out buffer TIC entries

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

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

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

12 months agonvk: Re-format nvk_sampler.c
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
nvk: Re-format nvk_sampler.c

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

12 months agonvk: Teture pool sizes are maximums not sizes
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
nvk: Teture pool sizes are maximums not sizes

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

12 months agonil: Fix image array layer alignments
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
nil: Fix image array layer alignments

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

12 months agonil: Refactor TIC image extent setup
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
nil: Refactor TIC image extent setup

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

12 months agonil: Don't minify image dimensions when setting up TIC
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
nil: Don't minify image dimensions when setting up TIC

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

12 months agonil: Drop miptail support for now
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
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>

12 months agonouveau/classes: add 906f header support.
Dave Airlie [Mon, 20 Jun 2022 06:56:43 +0000 (16:56 +1000)]
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>

12 months agonvk: Drop vk_sync BO refs after push_submit
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
nvk: Drop vk_sync BO refs after push_submit

Otherwise, all syncs are cumulative and, if the same command buffer is
submitted multiple times, it will sync on the union of all syncs it's
ever seen.

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

12 months agonouveau/ws: add a push reset just for references.
Dave Airlie [Fri, 17 Jun 2022 04:02:14 +0000 (14:02 +1000)]
nouveau/ws: add a push reset just for references.

This is to be used with the empty submission pushbuf.

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

12 months agonvk: fix empty cmd submission.
Dave Airlie [Fri, 17 Jun 2022 04:02:51 +0000 (14:02 +1000)]
nvk: fix empty cmd submission.

The sync obj stuff does a second queue submit with just signals
and no command buffers. Make sure things get sent to the kernel
so sync works.

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

12 months agonvk: Support compressed images in copy commands
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
nvk: Support compressed images in copy commands

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

12 months agonvk: Add a more competent GetPhysicalDeviceImageFormatProperties
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
nvk: Add a more competent GetPhysicalDeviceImageFormatProperties

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

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

Split the buffer and image portions into vk_buffer_view.c and vk_image.c
respectively.  This way they're a lot closer to each other.  Put the
main combined helper in nvk_format.c since it's a format thing.  Also,
restructure things a bit based on ANV to make the code look nicer.
Also, implement VK_KHR_format_feature_flags2 while we're here.

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

12 months agonvk: Reset and properly clean up command buffer upload areas
Faith Ekstrand [Tue, 31 Jan 2023 02:11:50 +0000 (20:11 -0600)]
nvk: Reset and properly clean up command buffer upload areas

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

12 months agonvk: Implement VkGetImageSubresourceLyout
Faith Ekstrand [Thu, 3 Aug 2023 21:10:59 +0000 (16:10 -0500)]
nvk: Implement VkGetImageSubresourceLyout

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

12 months agonvk: Re-indent image entrypoints
Faith Ekstrand [Tue, 31 Jan 2023 02:11:49 +0000 (20:11 -0600)]
nvk: Re-indent image entrypoints

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

12 months agonvk: Convert to using NIL for image layout
Faith Ekstrand [Tue, 31 Jan 2023 02:11:49 +0000 (20:11 -0600)]
nvk: Convert to using NIL for image layout

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

12 months agonvk: Manually offset for array layers in copy/blit
Faith Ekstrand [Tue, 31 Jan 2023 02:11:49 +0000 (20:11 -0600)]
nvk: Manually offset for array layers in copy/blit

The more I start at the hardware the more convinced I become that arrays
and 3D are not the same thing.  I'm sure they're similar enough in
certain circumstances but they don't appear to be in the way they're
treated in the 2D hardware, especially when miplevels are involved.
Instead of trying to use the 2D engine's depth/slice logic, offset
manually.  We have to emit a copy command for each slice anyway so
making the GPU do those calculations doesn't really gain us anything.

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

12 months agoRevert "nvk: Stop returning VK_ERROR_FORMAT_NOT_SUPPORTED for non-blitable"
Faith Ekstrand [Tue, 31 Jan 2023 02:11:49 +0000 (20:11 -0600)]
Revert "nvk: Stop returning VK_ERROR_FORMAT_NOT_SUPPORTED for non-blitable"

This reverts commit 74ad75f2624c50f732db35946a127eb11edee3e5.

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

12 months agonvk: Move Fill/UpdateBuffer to nvk_cmd_copy
Faith Ekstrand [Tue, 31 Jan 2023 02:11:49 +0000 (20:11 -0600)]
nvk: Move Fill/UpdateBuffer to nvk_cmd_copy

Even if they technically use blit-like HW commands, they're much more a
copy operation than a blit since there's no scaling going on.

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

12 months agonvk: Align arguments consistently in copy/blit code
Faith Ekstrand [Tue, 31 Jan 2023 02:11:49 +0000 (20:11 -0600)]
nvk: Align arguments consistently in copy/blit code

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

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

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

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

This makes the array size internal to nvk_format.c so we don't have to
keep it in sync when we add extra elements.  Also, there's no reason why
we need to be hand-rolling that loop all the time.

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

12 months agonil: Add a nil_view and code to fill out TIC entries
Faith Ekstrand [Thu, 3 Aug 2023 20:47:20 +0000 (15:47 -0500)]
nil: Add a nil_view and code to fill out TIC entries

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

12 months agonil: Add the TIC format table from nouveau
Faith Ekstrand [Tue, 31 Jan 2023 02:11:49 +0000 (20:11 -0600)]
nil: Add the TIC format table from nouveau

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

12 months agonil: Create images
Faith Ekstrand [Tue, 31 Jan 2023 02:11:49 +0000 (20:11 -0600)]
nil: Create images

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

12 months agonouveau: Add stubs for an image layout library called NIL
Faith Ekstrand [Tue, 31 Jan 2023 02:11:49 +0000 (20:11 -0600)]
nouveau: Add stubs for an image layout library called NIL

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

12 months agonouveau/ws: initial debugging options for command submissions
Karol Herbst [Wed, 15 Jun 2022 21:37:36 +0000 (23:37 +0200)]
nouveau/ws: initial debugging options for command submissions

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

12 months agonouveau/headers: Generate parser functions
Karol Herbst [Thu, 16 Jun 2022 15:24:31 +0000 (17:24 +0200)]
nouveau/headers: Generate parser functions

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

12 months agonvk/blit: assert that formats are supported
Karol Herbst [Wed, 15 Jun 2022 11:22:08 +0000 (13:22 +0200)]
nvk/blit: assert that formats are supported

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

12 months agonouveau/ws: assert on broken channel
Karol Herbst [Tue, 14 Jun 2022 23:44:42 +0000 (01:44 +0200)]
nouveau/ws: assert on broken channel

no point in continuing

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

12 months agonouveau/ws: make sure we don't submit nonsense
Karol Herbst [Tue, 14 Jun 2022 23:23:17 +0000 (01:23 +0200)]
nouveau/ws: make sure we don't submit nonsense

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

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

In particular, this makes us only touch the descriptor UBO memory as a
memcpy destination unless we're doing a descriptor copy.  This should be
much better for mapped GPU memory than the read-modify-write required by
our previous implementation of image descriptor writes with their 12:20
configuration.

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

12 months agonvk: Reserve a null image descriptor
Faith Ekstrand [Tue, 31 Jan 2023 02:11:49 +0000 (20:11 -0600)]
nvk: Reserve a null image descriptor

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

12 months agonvk: GART os host-cache-coherent
Faith Ekstrand [Tue, 31 Jan 2023 02:11:49 +0000 (20:11 -0600)]
nvk: GART os host-cache-coherent

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

12 months agonvk: Make texture descriptors a bit more acceptable to codegen
Faith Ekstrand [Tue, 31 Jan 2023 02:11:49 +0000 (20:11 -0600)]
nvk: Make texture descriptors a bit more acceptable to codegen

Codegen assumes that it gets a combined descriptor on both the texture
and sampler handle sources and that it's 64-bit.  It's not too hard to
just give it that in NIR.  We may make codegen a bit more flexible in
future but, for now, this gets things working.  While we're here, do a
quick optimization for combined texture+sampler descriptors because it's
easy.

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

12 months agonvk: Add a stub implementation of buffer views
Faith Ekstrand [Tue, 31 Jan 2023 02:11:49 +0000 (20:11 -0600)]
nvk: Add a stub implementation of buffer views

We don't actually populate the TIC entries yet but we can at least
pretend and stick them in descriptor sets.

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

12 months agonvk: Re-format nvk_buffer.c a bit
Faith Ekstrand [Tue, 31 Jan 2023 02:11:49 +0000 (20:11 -0600)]
nvk: Re-format nvk_buffer.c a bit

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

12 months agonvk: Re-format nvk_image_view.h a bit
Faith Ekstrand [Tue, 31 Jan 2023 02:11:49 +0000 (20:11 -0600)]
nvk: Re-format nvk_image_view.h a bit

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

12 months agonvk: Unify descriptor loading in lower_descriptors
Faith Ekstrand [Tue, 31 Jan 2023 02:11:49 +0000 (20:11 -0600)]
nvk: Unify descriptor loading in lower_descriptors

The code we were using for images/textures was broken since it didn't
track with the change to always use root descriptors.

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

12 months agonvk: Set b->cursor when lowering image intrinsics
Faith Ekstrand [Tue, 31 Jan 2023 02:11:49 +0000 (20:11 -0600)]
nvk: Set b->cursor when lowering image intrinsics

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

12 months agonvk: Fill out TIC table entries for image views
Faith Ekstrand [Tue, 31 Jan 2023 02:11:49 +0000 (20:11 -0600)]
nvk: Fill out TIC table entries for image views

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

12 months agonvk: Add an image descriptor table to the device
Faith Ekstrand [Tue, 31 Jan 2023 02:11:49 +0000 (20:11 -0600)]
nvk: Add an image descriptor table to the device

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

12 months agonvk/image_view: Reformat and fix Create/DestroyImageView
Faith Ekstrand [Tue, 31 Jan 2023 02:11:49 +0000 (20:11 -0600)]
nvk/image_view: Reformat and fix Create/DestroyImageView

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

12 months agonvk: Copy in the nouveau TIC format table
Faith Ekstrand [Tue, 31 Jan 2023 02:11:49 +0000 (20:11 -0600)]
nvk: Copy in the nouveau TIC format table

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

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

This will be used for image and sampler descriptors

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

12 months agonvk: Mark nvk_push_descriptor_set_ref() inline
Faith Ekstrand [Tue, 31 Jan 2023 02:11:48 +0000 (20:11 -0600)]
nvk: Mark nvk_push_descriptor_set_ref() inline

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

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

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

12 months agonvk: Stop returning VK_ERROR_FORMAT_NOT_SUPPORTED for non-blitable
Faith Ekstrand [Tue, 31 Jan 2023 02:11:48 +0000 (20:11 -0600)]
nvk: Stop returning VK_ERROR_FORMAT_NOT_SUPPORTED for non-blitable

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

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

It's unused.  Drop for now.  If we want it for meta later, we can add it
then.

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

12 months agonvk: add basic nve4+ compute support.
Dave Airlie [Tue, 14 Jun 2022 00:27:57 +0000 (10:27 +1000)]
nvk: add basic nve4+ compute support.

This can do most basic compute execution, except indirect

computeheadless demo runs, and some CTS tests pass.

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

12 months agonvk: add some compute limits
Dave Airlie [Fri, 10 Jun 2022 04:29:59 +0000 (14:29 +1000)]
nvk: add some compute limits

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

12 months agonvk: add some basic format wrapping framework
Dave Airlie [Fri, 10 Jun 2022 04:29:43 +0000 (14:29 +1000)]
nvk: add some basic format wrapping framework

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

12 months agonouveau/winsys: Add m2mf/compute objects
Dave Airlie [Thu, 2 Jun 2022 04:46:40 +0000 (14:46 +1000)]
nouveau/winsys: Add m2mf/compute objects

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

12 months agonvk: add command stream upload buffer.
Dave Airlie [Mon, 6 Jun 2022 03:53:17 +0000 (13:53 +1000)]
nvk: add command stream upload buffer.

This is an upload buffer that is kept beside the command buffer.

It can be used to allocate any per command buffer gpu state that
doesn't fit in the cmd stream.

compute dispatches will go in here for now.

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

12 months agonvk: add record result to cmd_buffer.
Dave Airlie [Mon, 6 Jun 2022 03:57:59 +0000 (13:57 +1000)]
nvk: add record result to cmd_buffer.

This keeps track of recording errors so end command buffer
 can report them

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

12 months agonvk: add support for preamble and tls allocation.
Dave Airlie [Mon, 13 Jun 2022 23:14:05 +0000 (09:14 +1000)]
nvk: add support for preamble and tls allocation.

This adds support for per-queue allocations that are reallocated
upwards if the submitted cmd needs more space.

This is used to implement the tls allocations for compute.

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

12 months agonvk: retrieve gpc/mp counts from kernel.
Dave Airlie [Mon, 6 Jun 2022 03:39:05 +0000 (13:39 +1000)]
nvk: retrieve gpc/mp counts from kernel.

These are needed to size the tls area.

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

12 months agonouveau/vk: add support for compute classes to generator.
Dave Airlie [Fri, 10 Jun 2022 21:07:32 +0000 (07:07 +1000)]
nouveau/vk: add support for compute classes to generator.

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

12 months agonvk: tiling prep work for VK_EXT_image_2d_view_of_3d
Karol Herbst [Mon, 13 Jun 2022 15:25:18 +0000 (17:25 +0200)]
nvk: tiling prep work for VK_EXT_image_2d_view_of_3d

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

12 months agonvk: support array blits over multiple layers
Karol Herbst [Fri, 10 Jun 2022 23:59:29 +0000 (01:59 +0200)]
nvk: support array blits over multiple layers

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

12 months agonvk: support multiple miplevels
Karol Herbst [Fri, 10 Jun 2022 20:48:45 +0000 (22:48 +0200)]
nvk: support multiple miplevels

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

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

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

12 months agonvk: Re-arrange nir_lower_explicit_io a bit
Faith Ekstrand [Tue, 31 Jan 2023 02:11:48 +0000 (20:11 -0600)]
nvk: Re-arrange nir_lower_explicit_io a bit

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

12 months agonvk: Fetch descriptor set addresses from the root table
Faith Ekstrand [Tue, 31 Jan 2023 02:11:48 +0000 (20:11 -0600)]
nvk: Fetch descriptor set addresses from the root table

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

12 months agonvk: Add a root descriptor table
Faith Ekstrand [Tue, 31 Jan 2023 02:11:48 +0000 (20:11 -0600)]
nvk: Add a root descriptor table

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

12 months agonvk: Basic descriptor binding
Dave Airlie [Fri, 10 Jun 2022 21:13:36 +0000 (16:13 -0500)]
nvk: Basic descriptor binding

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

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

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

12 months agonvk: Move nvk_cmd_pool cast definitions
Faith Ekstrand [Tue, 31 Jan 2023 02:11:48 +0000 (20:11 -0600)]
nvk: Move nvk_cmd_pool cast definitions

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