Commit graph

175335 commits

Author SHA1 Message Date
Faith Ekstrand
eefb60b832 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>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
d673111bc8 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>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
3e706a974e 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>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
3beb4daa2b nvk: Align arguments consistently in copy/blit code
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
b647527476 nvk: Use helpers for push_ref
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
3516136d7a 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>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
ec6d56d4ce nil: Add a nil_view and code to fill out TIC entries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
c12c94cde3 nil: Add the TIC format table from nouveau
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
69967e3f0d nil: Create images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
13abd1dbf2 nouveau: Add stubs for an image layout library called NIL
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Karol Herbst
5623de7345 nouveau/ws: initial debugging options for command submissions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Karol Herbst
95843dd754 nouveau/headers: Generate parser functions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Karol Herbst
43444e1a72 nvk/blit: assert that formats are supported
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Karol Herbst
1de656bce3 nouveau/ws: assert on broken channel
no point in continuing

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Karol Herbst
008e9768ad nouveau/ws: make sure we don't submit nonsense
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
ee50fe7d85 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>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
7d6ea3fcf5 nvk: Reserve a null image descriptor
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
86d367e75b nvk: GART os host-cache-coherent
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
8213eaa99f 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>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
c9bf974472 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>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
8d3f185a4d nvk: Re-format nvk_buffer.c a bit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
da3e5c13c3 nvk: Re-format nvk_image_view.h a bit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
9cd1753a29 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>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
035a63d8bf nvk: Set b->cursor when lowering image intrinsics
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
e120a789d3 nvk: Fill out TIC table entries for image views
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
ff84f8aa48 nvk: Add an image descriptor table to the device
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
e0d445c28d nvk/image_view: Reformat and fix Create/DestroyImageView
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
52565b1e62 nvk: Copy in the nouveau TIC format table
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
108c9dc655 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>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
2ec2ce44f3 nvk: Mark nvk_push_descriptor_set_ref() inline
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
460a026d72 nvk: Allow R32_UINT
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
ecbc820898 nvk: Stop returning VK_ERROR_FORMAT_NOT_SUPPORTED for non-blitable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
6a481d8170 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>
2023-08-04 21:31:54 +00:00
Dave Airlie
a0d64f2770 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>
2023-08-04 21:31:54 +00:00
Dave Airlie
f845c72283 nvk: add some compute limits
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Dave Airlie
a2d9f95961 nvk: add some basic format wrapping framework
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Dave Airlie
25dc939252 nouveau/winsys: Add m2mf/compute objects
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Dave Airlie
0870cd8719 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>
2023-08-04 21:31:54 +00:00
Dave Airlie
c8805f4544 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>
2023-08-04 21:31:54 +00:00
Dave Airlie
fa32ee409a 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>
2023-08-04 21:31:54 +00:00
Dave Airlie
a3e5eb1134 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>
2023-08-04 21:31:54 +00:00
Dave Airlie
bd8077bef5 nouveau/vk: add support for compute classes to generator.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Karol Herbst
d440084d96 nvk: tiling prep work for VK_EXT_image_2d_view_of_3d
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Karol Herbst
b73b91016a nvk: support array blits over multiple layers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Karol Herbst
e49a66c40c nvk: support multiple miplevels
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
d8a9d662e4 nvk: Lower load_global_constant_offset
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
1b7ff4b62c nvk: Re-arrange nir_lower_explicit_io a bit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
0c775223da nvk: Fetch descriptor set addresses from the root table
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Faith Ekstrand
5017a3b092 nvk: Add a root descriptor table
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Dave Airlie
935f316eb0 nvk: Basic descriptor binding
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00