Commit graph

175523 commits

Author SHA1 Message Date
Faith Ekstrand
39b64aed3f nvk: Inline nouveau_copy_linear
It has exactly one caller so the helper's not really doing us much.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Karol Herbst
71c830278f nvk: clean up bo mappings
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Karol Herbst
05bc4500ad nouveau/ws: add a bo unmap helper function
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Karol Herbst
886db84e94 nouveau/ws: add API to query if the context was killed
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
e1af0f983f nvk: Fix dynamic buffer descriptor copies
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
c88cf7828d nvk: Set up clip and cull distances
Closes: https://gitlab.freedesktop.org/nouveau/mesa/-/issues/12
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
7696f8c8d2 nil: Fix nonnormalized coordinates
Also, replace our TODO with a real comment explaining how nonnormalized
coordinate select works between image and texture header.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
d407e2b130 nil: Fix max mip level
The MAX_MIP_LEVEL field needs the actual number from the image because
it's used to compute the stride between layers.  The restrictions on mip
level come entirely from the RES_VIEW fields.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
89591214a3 nil/format: Depth/stencil formats appear as red
Previously, it was treated as luminance and the depth or stencil
component was broadcast to all channels except alpha.  In Vulkan, depth
and stencil textures are treated as red.  If we want it treated
differntly by some other API, that driver can do that with a swizzle.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
fe84f07fce nvk: Fix border color alpha
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
d3f4a23f7b nvk: VkSamplerCreateInfo::mipLodBias is signed
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
b5cdb13b55 nvk: Assert on CmdExecuteCommands
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
bd4988b9c0 nvk: Fix max anisotropy
Now that we're using the bitpack helpers, we don't need the extra shift

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
2a2076b0d2 nvk: Don't advertise tiling on non-power-of-two formats
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
60f41aca47 nvk: Use a UINT format to clear non-renderable images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
177c968cd1 nvk: Implement vkCmdClear*Image directly
Instead of invoking the meta code, implement it ourselves so we get the
HW clear path.  We could probably put these implementations somewhere
common since they only set up a few things and invoke Begin/EndRendering
but there's not that much point for now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
f1aa12d596 nvk: Add image_view_init/finish functions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
7b7bfbcc61 nvk: Use hardware clears for attachment clears
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
10d16dce1c nouveau/parser: Add array and float tags for clear values
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Mauro Rossi
4d02d9d796 vulkan/meta: fix gnu-empty-initializer build error
Fixes the following building error:

../src/vulkan/runtime/vk_meta_clear.c:213:42: error: use of GNU empty initializer extension [-Werror,-Wgnu-empty-initializer]
   struct vk_meta_clear_push_data push = { };
                                         ^
1 error generated.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
b877922b07 nvk: Save/restore push constants around meta ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
a1652525e2 nvk: Wire up early z and post depth coverage
Was crawling through header bits and found that we weren't plumbing
these through.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Dave Airlie
b5beae5777 nvk: add basic primitive restart
fixes crucible
func.draw-index16-restart
func.draw-index32-restart

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Yusuf Khan
8e052c311f nvk: support GetImageSparseMemoryRequirements2
KHR_get_memory_requirements2 was enabled but GetImageMemoryRequirem
ents2 was not. This stubs out GetImageMemoryRequirements2 to fix it.

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>

v2: remove the v1 version of the command as its provided by the
common runtime

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Yusuf Khan
8271228289 nvk: implement GetDeviceMemoryCommitment
vulkan spec says:

If the memory object is allocated from a heap with the
VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT bit set, that object’s
backing memory may be provided by the implementation lazily. The
actual committed size of the memory may initially be as small as
zero (or as large as the requested size), and monotonically
increases as additional memory is needed.

As far as I can tell we ignore the bit meaning that we allocate the
requested size so return that as the size.

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
f3d43c2a86 nvk: Allocate descriptors for input attachments
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
d2b30362eb nvk: Assert samples == 1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
e3afa1e3c2 nvk: Re-flow a couple function prototypes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
0252b000de nvk: Align descriptor buffers to NVK_MIN_UBO_ALIGNMENT
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
8fff829b0b nvk: Add nvk_queue_init/finish() helpers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
1410100ebe nil: Add a PTE kind for Z32_FLOAT
This values was found by trial-and-error poking at the hardware until it
stopped complaining.  It's not clear if we need separate values for
compressed vs. not.  This appears to work on Turing regardless of what
we set for SET_Z_COMPRESSION.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
cbb14e5483 nvk: Return OUT_OF_DEVICE_MEMORY if bo_new fails
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
91c1be22ed nvk: Set GEOMETRY_SHADER_SELECTS_LAYER properly
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
2d108bb672 nvk: Call nir_lower_input_attachments
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
da0ad121bf nvk: Don't destroy NULL descriptor pool BOs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
226c152f55 nvk: Advertise depth/stencil support
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
5570e2c06b nvk: Flip the front-face setting
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
6ab9fe31fe nvk: Enable two-sided stencil
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
c6a50c2745 nvk: Fix viewport Z scale
Because Z needs to end up in [0, 1] and not [-1, 1], we don't want to
divide by 2.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
9deab8f139 nvk: Fix depth/stencil render pass clears
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
78009a1a9a nvk: Do internal dedicated allocations for ZS images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
ba70017f68 nvk: Add internal helpers for device memory allocation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
ac8bbb355a nouveau: Add a function to allocate a tiled buffer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
71420b4c7d nil: Compute PTE kinds and tile modes for images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
3ef84bc1e0 nvk: Disable sparse Z on Maxwell+
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
99248274b4 nvk: Depth buffers don't allow Z-tiling
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
90b94828dd vulkan/meta: Make stencil reference dynamic for clears
We call CmdSetStencilReference() but don't set it to dynamic in the
pipeline.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
6b7ee96391 nvk: Clear dynamic state dirty after flushing it all
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
6909155346 nvk: Advertise more format features
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
77db3e99dd nil: Add more format support helpers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00