platform/upstream/mesa.git
18 months agodzn: Ignore unnormalized sampling flag if driver doesn't support it
Jesse Natalie [Fri, 7 Apr 2023 23:50:12 +0000 (16:50 -0700)]
dzn: Ignore unnormalized sampling flag if driver doesn't support it

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

18 months agodzn: Use a linear allocator for upload data on command buffers
Jesse Natalie [Fri, 7 Apr 2023 23:48:48 +0000 (16:48 -0700)]
dzn: Use a linear allocator for upload data on command buffers

Significantly improves performance for apps that heavily use
dynamic descriptors.

Still needs caching so they can be re-used after command buffer reset.

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

18 months agodzn: Changes to descriptor set dirty flag handling
Jesse Natalie [Fri, 7 Apr 2023 23:44:53 +0000 (16:44 -0700)]
dzn: Changes to descriptor set dirty flag handling

The scenario of:
* App binds multiple descriptor sets
* App binds a pipeline that uses a subset of them
* App binds a pipeline that uses more of them

was broken. We were only copying the descriptors for the accessible
subset before, but then clearing all dirty bits, so simply changing
the pipeline wouldn't result in more descriptors being copied.

When running not-bindless, the right thing to do is to copy *all*
descriptors if we're copying any. When running bindless, each parameter
is set separately, and more importantly, *can't* be set on the command
list if the root signature can't access them.

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

18 months agomicrosoft/compiler: Don't split loads/stores that will be split by lower_explicit_io
Jesse Natalie [Fri, 7 Apr 2023 23:39:23 +0000 (16:39 -0700)]
microsoft/compiler: Don't split loads/stores that will be split by lower_explicit_io

Otherwise we can end up splitting push constant loads, which currently require
an unbroken (no-cast) deref chain up to the variable.

Fixes: 4c527f4f ("spirv2dxil: Lower unaligned loads and stores")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22371>

18 months agodocs: add more release notes for RADV
Samuel Pitoiset [Mon, 10 Apr 2023 09:19:22 +0000 (11:19 +0200)]
docs: add more release notes for RADV

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22390>

18 months agonir: make nir_fisnan helper exact
Rhys Perry [Thu, 30 Mar 2023 12:38:06 +0000 (13:38 +0100)]
nir: make nir_fisnan helper exact

Floating point ALU assume no NaNs unless
FLOAT_CONTROLS_SIGNED_ZERO_INF_NAN_PRESERVE_FPn or (for some opcodes)
exact=true.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: bf9c1699cd7 ("nir: add nir_fisnan helper function")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22206>

18 months agoradv: Set DB_Z_INFO.NUM_SAMPLES to MSAA_EXPOSED_SAMPLES without Z/S
Vitaliy Triang3l Kuzmin [Sun, 2 Apr 2023 18:05:53 +0000 (21:05 +0300)]
radv: Set DB_Z_INFO.NUM_SAMPLES to MSAA_EXPOSED_SAMPLES without Z/S

This case is a new addition in GFX11, and according to PAL, when no
depth/stencil attachment is bound, it must be set to the number of coverage
samples (the number of SampleMask bits - which is MSAA_EXPOSED_SAMPLES):

https://github.com/GPUOpen-Drivers/pal/blob/4640888b579bc9b0951c586b08a4552f71780d0d/src/core/hw/gfxip/gfx9/gfx9UniversalCmdBuffer.cpp#L6978

Without this change, the maximum of depth/stencil and color sample counts
is used, and if there are no depth/stencil or color attachments (target-
independent rasterization), the Depth Block assumes 1 coverage sample, and
thus Primitive Ordered Pixel Shading doesn't work correctly (and fails 4xAA
fragment shader interlock CTS tests), and occlusion queries don't count the
correct number of samples (according to the "Sample Counting" section of
the Vulkan specification, "the occlusion query sample counter increments by
one for each sample with a coverage value of 1...")

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22375>

18 months agozink: try to prune resources from barrier jit on fb unbind
Mike Blumenkrantz [Fri, 7 Apr 2023 21:06:45 +0000 (17:06 -0400)]
zink: try to prune resources from barrier jit on fb unbind

if a resource has no binds remaining then it should not remain in
the queue for barrier updates on the next draw

cc: mesa-stable

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

18 months agowinsys/amdgpu: Fix amdgpu_cs_query_reset_state2 error log
André Almeida [Wed, 5 Apr 2023 02:45:23 +0000 (23:45 -0300)]
winsys/amdgpu: Fix amdgpu_cs_query_reset_state2 error log

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: André Almeida <andrealmeid@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22253>

18 months agoradv: Implement vk.check_status
André Almeida [Sat, 1 Apr 2023 22:57:52 +0000 (19:57 -0300)]
radv: Implement vk.check_status

Implement check_status function so the driver can check if the GPU has
been reset by the application, and thus if it's still available.

AMDGPU_CTX_QUERY ioctls work by asking amdgpu if this context was the
cause of a previous GPU reset.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: André Almeida <andrealmeid@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22253>

18 months agoradv/ci: update expected failures with BONAIRE
Samuel Pitoiset [Mon, 10 Apr 2023 09:37:21 +0000 (11:37 +0200)]
radv/ci: update expected failures with BONAIRE

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22391>

18 months agoradv/ci: remove no longer existing tests for PITCAIRN
Samuel Pitoiset [Fri, 7 Apr 2023 16:14:02 +0000 (18:14 +0200)]
radv/ci: remove no longer existing tests for PITCAIRN

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22366>

18 months agoradv/ci: update expected failures for PITCAIRN
Samuel Pitoiset [Fri, 7 Apr 2023 16:12:30 +0000 (18:12 +0200)]
radv/ci: update expected failures for PITCAIRN

These have been recently fixed.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22366>

18 months agoradv: enable VK_EXT_graphics_pipeline_library by default
Samuel Pitoiset [Fri, 31 Mar 2023 15:48:04 +0000 (17:48 +0200)]
radv: enable VK_EXT_graphics_pipeline_library by default

You won't get your money back!

It's been a very long time but everything should be working great now.

This replaces RADV_PERFTEST=gpl by RADV_DEBUG=nogpl to disable the
extension for debugging purposes.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22362>

18 months agovulkan/pipeline_cache: move vk_log on failed deserialization to vk_pipeline_cache_load()
Daniel Schürmann [Fri, 31 Mar 2023 14:35:59 +0000 (16:35 +0200)]
vulkan/pipeline_cache: move vk_log on failed deserialization to vk_pipeline_cache_load()

Partially evicted or corrupted disk cache entries should not create
application cache log entries.

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

18 months agovulkan/pipeline_cache: add cache parameter to deserialize() function
Daniel Schürmann [Sun, 19 Mar 2023 22:56:07 +0000 (23:56 +0100)]
vulkan/pipeline_cache: add cache parameter to deserialize() function

This allows for secondary cache lookups during deserialization.

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

18 months agovulkan/pipeline_cache: use vk_pipeline_cache_create_and_insert_object() during vk_pip...
Daniel Schürmann [Thu, 16 Mar 2023 19:24:31 +0000 (20:24 +0100)]
vulkan/pipeline_cache: use vk_pipeline_cache_create_and_insert_object() during vk_pipeline_cache_load()

This avoids an extra serialize() step for disk-cache insertion.

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

18 months agovulkan/pipeline_cache: implement vk_pipeline_cache_create_and_insert_object()
Daniel Schürmann [Thu, 16 Mar 2023 19:05:36 +0000 (20:05 +0100)]
vulkan/pipeline_cache: implement vk_pipeline_cache_create_and_insert_object()

This function directly inserts the serialized data into the disk cache
before calling deserialize() and inserting into the pipeline cache.

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

18 months agovulkan/pipeline_cache: Don't re-insert disk-cache hits into disk-cache
Daniel Schürmann [Thu, 16 Mar 2023 18:27:11 +0000 (19:27 +0100)]
vulkan/pipeline_cache: Don't re-insert disk-cache hits into disk-cache

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

18 months agovulkan/pipeline_cache: remove vk_device from vk_pipeline_cache_object
Daniel Schürmann [Thu, 16 Mar 2023 14:35:48 +0000 (15:35 +0100)]
vulkan/pipeline_cache: remove vk_device from vk_pipeline_cache_object

It is not necessary to store the extra pointer.

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

18 months agoci/v3d: add flaking spec@ext_framebuffer_blit@fbo-sys-blit
David Heidelberg [Sat, 8 Apr 2023 20:24:47 +0000 (22:24 +0200)]
ci/v3d: add flaking spec@ext_framebuffer_blit@fbo-sys-blit

Flakes on both RPI 3 and RPI 4.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22377>

18 months agoac/llvm: Cover runtime 0 in GFX10 gs_alloc_req workaround.
Timur Kristóf [Fri, 7 Apr 2023 22:22:18 +0000 (00:22 +0200)]
ac/llvm: Cover runtime 0 in GFX10 gs_alloc_req workaround.

Previously, the workaround only covered compile-time zero, but
this is insufficient and can cause GPU hangs in RadeonSI when
NGG culling is enabled.

Fix this by handling runtime zero in the workaround.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22370>

18 months agomesa: Enable NV_texture_barrier in GLES2+
Adam Jackson [Mon, 17 Oct 2022 21:35:25 +0000 (17:35 -0400)]
mesa: Enable NV_texture_barrier in GLES2+

The spec text is written against 3.2 but only requires framebuffer
objects and ES2.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19234>

19 months agointel/compiler: Use nir_dest_bit_size() for ballot bit size check
Kenneth Graunke [Sat, 8 Apr 2023 02:19:31 +0000 (19:19 -0700)]
intel/compiler: Use nir_dest_bit_size() for ballot bit size check

There's no guarantee that this is a SSA value.  Use the helper to handle
both SSA values and register correctly.  Otherwise we read trash when we
encounter a register and make bad decisions on types, possibly leading
to our destination being UQ typed when the VGRF is only 32-bit.

Fixes compilation with -Dintel-clc=enabled since 7f6491b76d51f35e7671
(nir: Combine if_uses with instruction uses) but the bug is much older
than that, circa 2017.  We were just getting lucky before.

Fixes: 069bf7c9078a ("i965/fs: Match destination type to size for ballot")
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22374>

19 months agonir/validate: Only walk uses once
Alyssa Rosenzweig [Fri, 7 Apr 2023 21:50:09 +0000 (17:50 -0400)]
nir/validate: Only walk uses once

Ostensibly faster.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>

19 months agonir/repair_ssa: Refactor some use handling
Alyssa Rosenzweig [Fri, 7 Apr 2023 21:44:17 +0000 (17:44 -0400)]
nir/repair_ssa: Refactor some use handling

We can mostly unify the instr-use and if-use handling, which is a lot more
concise.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>

19 months agonir: Remove nir_if_rewrite_condition_ssa
Alyssa Rosenzweig [Thu, 6 Apr 2023 21:16:36 +0000 (17:16 -0400)]
nir: Remove nir_if_rewrite_condition_ssa

Now unused.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>

19 months agodxil: Use nir_src_rewrite_ssa
Alyssa Rosenzweig [Thu, 6 Apr 2023 21:13:57 +0000 (17:13 -0400)]
dxil: Use nir_src_rewrite_ssa

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>

19 months agonir: Use nir_src_rewrite_ssa
Alyssa Rosenzweig [Thu, 6 Apr 2023 21:13:45 +0000 (17:13 -0400)]
nir: Use nir_src_rewrite_ssa

Where sensible.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>

19 months agonir: Factor out nir_src_rewrite_ssa helper
Alyssa Rosenzweig [Thu, 6 Apr 2023 19:54:18 +0000 (15:54 -0400)]
nir: Factor out nir_src_rewrite_ssa helper

Like nir_instr_rewrite_ssa but without the asserted extra argument. Works on ifs
too, now that we have a unified use list.

We do need to assert that the source has actually been inserted and has valid
use/def chains. Previously, asserting on the parent instruction accomplished
that indirectly. For the more general helper, we instead directly assert that
there exists a non-null parent, whatever it is.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>

19 months agonir: Reduce indirection
Alyssa Rosenzweig [Thu, 6 Apr 2023 21:14:44 +0000 (17:14 -0400)]
nir: Reduce indirection

A source used by an if is necessarily the condition of that if.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>

19 months agodxil: Avoid list_length
Alyssa Rosenzweig [Thu, 6 Apr 2023 19:50:29 +0000 (15:50 -0400)]
dxil: Avoid list_length

Do O(1) check instead.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>

19 months agonir/validate: Don't treat if-uses specially
Alyssa Rosenzweig [Thu, 6 Apr 2023 19:37:54 +0000 (15:37 -0400)]
nir/validate: Don't treat if-uses specially

We don't use the tag anywhere, so don't bother with it.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-by: Faith Ekstrand <faith@gfxstrand.net>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>

19 months agonir: Remove 2nd argument from nir_before_src
Alyssa Rosenzweig [Thu, 6 Apr 2023 19:35:15 +0000 (15:35 -0400)]
nir: Remove 2nd argument from nir_before_src

We can now determine whether a nir_src is for an if without a sideband, so
simplify the function signature.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-by: Faith Ekstrand <faith@gfxstrand.net>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>

19 months agonir/opt_loop_unroll: Avoid list_length
Alyssa Rosenzweig [Thu, 6 Apr 2023 19:31:59 +0000 (15:31 -0400)]
nir/opt_loop_unroll: Avoid list_length

It is O(N) but can often be replaced with something O(1).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>

19 months agonir/opt_ray_queries: Don't use list_length
Alyssa Rosenzweig [Thu, 6 Apr 2023 19:31:43 +0000 (15:31 -0400)]
nir/opt_ray_queries: Don't use list_length

Expensive.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>

19 months agonir: Combine if_uses with instruction uses
Alyssa Rosenzweig [Thu, 6 Apr 2023 17:19:31 +0000 (13:19 -0400)]
nir: Combine if_uses with instruction uses

Every nir_ssa_def is part of a chain of uses, implemented with doubly linked
lists.  That means each requires 2 * 64-bit = 16 bytes per def, which is
memory intensive. Together they require 32 bytes per def. Not cool.

To cut that memory use in half, we can combine the two linked lists into a
single use list that contains both regular instruction uses and if-uses. To do
this, we augment the nir_src with a boolean "is_if", and reimplement the
abstract if-uses operations on top of that list. That boolean should fit into
the padding already in nir_src so should not actually affect memory use, and in
the future we sneak it into the bottom bit of a pointer.

However, this creates a new inefficiency: now iterating over regular uses
separate from if-uses is (nominally) more expensive. It turns out virtually
every caller of nir_foreach_if_use(_safe) also calls nir_foreach_use(_safe)
immediately before, so we rewrite most of the callers to instead call a new
single `nir_foreach_use_including_if(_safe)` which predicates the logic based on
`src->is_if`. This should mitigate the performance difference.

There's a bit of churn, but this is largely a mechanical set of changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>

19 months agotu: Use vk_features2_to_features
Alyssa Rosenzweig [Thu, 30 Mar 2023 15:56:57 +0000 (11:56 -0400)]
tu: Use vk_features2_to_features

Sanitizes properties returned through GetPhysicalDeviceFormatProperties2.

Bit-31 is not valid to return in the original
vkGetPhysicalDeviceFormatProperties{2,}. Sanitize the bit returned from the
internal to ensure invalid bits aren't return to the application.

Falls in line with the other vulkan drivers.

Based on original commit by Ryan Houdek.

Closes: #8733
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>

19 months agoanv,hasvk: Use vk_features2_to_features
Alyssa Rosenzweig [Thu, 30 Mar 2023 15:55:31 +0000 (11:55 -0400)]
anv,hasvk: Use vk_features2_to_features

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>

19 months agopvr: Use vk_features2_to_features
Alyssa Rosenzweig [Thu, 30 Mar 2023 15:55:18 +0000 (11:55 -0400)]
pvr: Use vk_features2_to_features

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>

19 months agolavapipe: Use vk_features2_to_features
Alyssa Rosenzweig [Thu, 30 Mar 2023 15:55:10 +0000 (11:55 -0400)]
lavapipe: Use vk_features2_to_features

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>

19 months agov3dv: Use vk_features2_to_features
Alyssa Rosenzweig [Thu, 30 Mar 2023 15:55:02 +0000 (11:55 -0400)]
v3dv: Use vk_features2_to_features

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>

19 months agoradv: Use vk_features2_to_features
Alyssa Rosenzweig [Thu, 30 Mar 2023 15:54:48 +0000 (11:54 -0400)]
radv: Use vk_features2_to_features

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>

19 months agovulkan: Add common features2_to_features
Alyssa Rosenzweig [Thu, 30 Mar 2023 15:48:56 +0000 (11:48 -0400)]
vulkan: Add common features2_to_features

Needed to correctly implement GetPhysicalDeviceFormatProperties2.

Cc stable so the turnip patch can get backported cleanly.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>

19 months agoRevert "zink: don't trigger shader variants on pcp change if driver supports dynamic...
Mike Blumenkrantz [Fri, 7 Apr 2023 19:46:57 +0000 (15:46 -0400)]
Revert "zink: don't trigger shader variants on pcp change if driver supports dynamic pcp"

This reverts commit 472fcf74e250a72053d837f7730fb991c1c3cb7e.

this is sort of right but then also sort of broken, going to rework a little

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

19 months agoradv: copy stages instead of serializing NIR for GPL with the RETAIN flag
Samuel Pitoiset [Fri, 7 Apr 2023 12:20:15 +0000 (14:20 +0200)]
radv: copy stages instead of serializing NIR for GPL with the RETAIN flag

When the driver gets a cache hit for the binary, we still have to
retain shaders because we can't know if the LTO pipeline will be a
cache hit as well.

Though, serializing the NIR is too costly and most of the libraries
took more than 10ms to be created, which isn't acceptable. To fix this,
keep track of the shaders stage info for libs with the RETAIN flag.

This might be replaced by NIR caching later if it's worth a try.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22327>

19 months agoradv: create a helper for copying VkPipelineShaderStageCreateInfo
Samuel Pitoiset [Fri, 7 Apr 2023 12:20:06 +0000 (14:20 +0200)]
radv: create a helper for copying VkPipelineShaderStageCreateInfo

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22327>

19 months agoradv/rt: stop storing unused hashes/identifiers
Samuel Pitoiset [Thu, 6 Apr 2023 14:52:25 +0000 (16:52 +0200)]
radv/rt: stop storing unused hashes/identifiers

This is never used.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22327>

19 months agozink: fix sampler array collision in `nir_to_spirv`
antonino [Fri, 7 Apr 2023 12:41:27 +0000 (14:41 +0200)]
zink: fix sampler array collision in `nir_to_spirv`

`nir_to_spirv` has flat arrays to map driver_location to sampler
variables.

Now when bindless textures are used together with non binless textures
the sampler vars are in different descriptor sets and the binding can be
the same between different descriptor sets, this causes a collision in
arrays.

This patches chamges `nir_to_spirv` to also index the array by whether
the texture is bindless.

Fixes: bc202553e9b ("zink: implement bindless textures")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22358>

19 months agozink: add `descriptor_bindless_id` to `zink_shader_info`
antonino [Fri, 7 Apr 2023 15:57:15 +0000 (17:57 +0200)]
zink: add `descriptor_bindless_id` to `zink_shader_info`

This field stores the id of the descriptor set used for bindless
textures.

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

19 months agodzn: Remove xfail for test that passes (if run)
Jesse Natalie [Thu, 6 Apr 2023 20:50:38 +0000 (13:50 -0700)]
dzn: Remove xfail for test that passes (if run)

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

19 months agodzn: Support >2K samplers with bindless
Jesse Natalie [Thu, 6 Apr 2023 20:45:08 +0000 (13:45 -0700)]
dzn: Support >2K samplers with bindless

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

19 months agodzn: Remove skips now that WARP is faster
Jesse Natalie [Thu, 6 Apr 2023 20:15:21 +0000 (13:15 -0700)]
dzn: Remove skips now that WARP is faster

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

19 months agodzn: Don't leave deleted physical devices in the instance pdev list
Jesse Natalie [Fri, 7 Apr 2023 15:55:13 +0000 (08:55 -0700)]
dzn: Don't leave deleted physical devices in the instance pdev list

Fixes: cfa260cd ("dzn: Use common physical device list/enumeration helpers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22346>

19 months agodzn: Use GetResourceAllocationInfo3 for castable formats
Jesse Natalie [Thu, 6 Apr 2023 19:57:53 +0000 (12:57 -0700)]
dzn: Use GetResourceAllocationInfo3 for castable formats

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

19 months agodzn: Clean up ABI helpers now that we require DirectX-Headers 606
Jesse Natalie [Thu, 6 Apr 2023 19:57:15 +0000 (12:57 -0700)]
dzn: Clean up ABI helpers now that we require DirectX-Headers 606

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

19 months agodzn: Early-out on no-op barriers
Jesse Natalie [Thu, 6 Apr 2023 19:39:08 +0000 (12:39 -0700)]
dzn: Early-out on no-op barriers

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

19 months agozink: don't trigger shader variants on pcp change if driver supports dynamic pcp
Mike Blumenkrantz [Fri, 7 Apr 2023 16:01:09 +0000 (12:01 -0400)]
zink: don't trigger shader variants on pcp change if driver supports dynamic pcp

this otherwise pointlessly creates and binds shader variants that do nothing

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

19 months agozink: reuse copy_vars for generated tcs
Mike Blumenkrantz [Fri, 7 Apr 2023 14:17:45 +0000 (10:17 -0400)]
zink: reuse copy_vars for generated tcs

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

19 months agozink: reuse d3d12 variable copying to make passthrough gs more robust
Mike Blumenkrantz [Fri, 7 Apr 2023 14:14:09 +0000 (10:14 -0400)]
zink: reuse d3d12 variable copying to make passthrough gs more robust

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

19 months agoanv: reset query pools using blorp
Felix DeGrood [Wed, 22 Mar 2023 22:08:09 +0000 (22:08 +0000)]
anv: reset query pools using blorp

Previously we used PC to set query data to 0 during
CmdResetQueryPool. This was slow when clearing large query pools.
Switching to blorp to clear pools is faster for large query pools.

Red Dead Redemption 2: +1.5% speedup

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>

19 months agoanv: replace query flush before gpu copy by semaphore wait
Lionel Landwerlin [Fri, 31 Mar 2023 08:32:18 +0000 (11:32 +0300)]
anv: replace query flush before gpu copy by semaphore wait

All the flushes should already have happened, we just need CS to wait
for the operations to complete. Just use a MI_SEMAPHORE_WAIT to check
the availability bit is set.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>

19 months agoanv: pass steam output as argument for anv_dump_pipe_bits
Lionel Landwerlin [Thu, 30 Mar 2023 16:10:19 +0000 (19:10 +0300)]
anv: pass steam output as argument for anv_dump_pipe_bits

Just if you need to change it at some point ;)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>

19 months agoanv/blorp: add flush reasons to RT flushes
Felix DeGrood [Tue, 28 Mar 2023 23:44:19 +0000 (23:44 +0000)]
anv/blorp: add flush reasons to RT flushes

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>

19 months agoanv/blorp: implement anv_cmd_buffer_fill_area
Felix DeGrood [Wed, 22 Mar 2023 22:04:22 +0000 (22:04 +0000)]
anv/blorp: implement anv_cmd_buffer_fill_area

Implemented function to fill an area at an address.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>

19 months agoanv/blorp: support surf generation for addresses
Felix DeGrood [Wed, 22 Mar 2023 18:04:42 +0000 (18:04 +0000)]
anv/blorp: support surf generation for addresses

Already have support for anv_buff. Extended to support addresses.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>

19 months agodzn: Enable VK_KHR_get_memory_requirements2
Raun [Thu, 6 Apr 2023 19:31:43 +0000 (14:31 -0500)]
dzn: Enable VK_KHR_get_memory_requirements2

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

19 months agodzn: Enable VK_KHR_bind_memory2
Raun [Thu, 6 Apr 2023 19:23:42 +0000 (14:23 -0500)]
dzn: Enable VK_KHR_bind_memory2

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

19 months agoradv: import retained NIR shaders later in the compilation process
Samuel Pitoiset [Fri, 7 Apr 2023 09:36:08 +0000 (11:36 +0200)]
radv: import retained NIR shaders later in the compilation process

This allows us to remove the intermediate NIR shader pointer.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22356>

19 months agoradv: do not retain noop FS for libs when a cache hit happened
Samuel Pitoiset [Fri, 7 Apr 2023 09:05:57 +0000 (11:05 +0200)]
radv: do not retain noop FS for libs when a cache hit happened

Determine if the graphics pipeline needs a noop FS later instead of
retaining it. This was also suboptimal.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22356>

19 months agoradv: simplify a check when retaining NIR shaders
Samuel Pitoiset [Fri, 7 Apr 2023 08:55:24 +0000 (10:55 +0200)]
radv: simplify a check when retaining NIR shaders

The RETAIN flag is only allowed with graphics libs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22356>

19 months agoradv: move the serialized NIR to radv_graphics_lib_pipeline
Samuel Pitoiset [Fri, 7 Apr 2023 08:53:38 +0000 (10:53 +0200)]
radv: move the serialized NIR to radv_graphics_lib_pipeline

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22356>

19 months agoradv: add a helper for retaining NIR shaders
Samuel Pitoiset [Fri, 7 Apr 2023 08:44:55 +0000 (10:44 +0200)]
radv: add a helper for retaining NIR shaders

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22356>

19 months agozink: don't access non_fs part of zink_shader from fs
Mike Blumenkrantz [Thu, 6 Apr 2023 18:49:31 +0000 (14:49 -0400)]
zink: don't access non_fs part of zink_shader from fs

Fixes: a6de15eff56 ("zink: add flags to `zink_gfx_program` and `zink_context`")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22347>

19 months agozink: more explicitly track/check rp optimizing per-context
Mike Blumenkrantz [Wed, 5 Apr 2023 15:35:53 +0000 (11:35 -0400)]
zink: more explicitly track/check rp optimizing per-context

if tc creation fails for whatever reason, rp optimizing must be
marked as disabled for that context to avoid erroneous assumptions
about rp operation

fixes #8787

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

19 months agoac/llvm: remove some unused code replaced by nir
Qiang Yu [Wed, 5 Apr 2023 02:09:28 +0000 (10:09 +0800)]
ac/llvm: remove some unused code replaced by nir

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22304>

19 months agoac/nir/ngg: fix store shared alignment
Qiang Yu [Wed, 5 Apr 2023 01:52:01 +0000 (09:52 +0800)]
ac/nir/ngg: fix store shared alignment

For stream!=0, this align_mul=4 is not true. Not observe any
problem yet, just for correctness.

Fixes: 60ac5dda82e ("ac: Add NIR lowering for NGG GS.")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22304>

19 months agoac/nir/ngg: fix gs culling vertex liveness check for odd vertices
Qiang Yu [Wed, 5 Apr 2023 01:27:50 +0000 (09:27 +0800)]
ac/nir/ngg: fix gs culling vertex liveness check for odd vertices

If vertex does not complete a primitive, it should not set the odd
flag which miss lead liveness check when culling is enabled.

For example, if odd flag is set regardless of complete flag, when
culling is enabled, 3 vertices of a triangle's init prim flag:
  [0x00 0x04 0x01]

then after culling, this triangle has been culled, their prim flag:
  [0x00 0x04 0x00]

the second vertex is miss treat as live because its odd flag (code
check prim_flag!=0 for liveness).

Fixes: 1bdeb961bd8 ("ac/nir/ngg: add gs culling")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8725
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22304>

19 months agoradeonsi: fix max scrach lds size calculation when ngg
Qiang Yu [Tue, 4 Apr 2023 01:42:24 +0000 (09:42 +0800)]
radeonsi: fix max scrach lds size calculation when ngg

Fixes: 028d0590f85 ("radeonsi: replace llvm ngg vs/tes with nir lowering")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22304>

19 months agoasahi: Allow explicit non-LINEAR modifiers for scanout
Asahi Lina [Wed, 5 Apr 2023 12:42:14 +0000 (21:42 +0900)]
asahi: Allow explicit non-LINEAR modifiers for scanout

The compositor is responsible for picking the right supported modifiers
for scanout. If we get no modifiers, we have to assume linear, but if we
do, just roll with it and don't attempt to force things.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>

19 months agoasahi: Flip kmsro around to allocate on the GPU
Asahi Lina [Wed, 5 Apr 2023 12:41:27 +0000 (21:41 +0900)]
asahi: Flip kmsro around to allocate on the GPU

Our display controller can handle arbitrary GPU imports, so there is no
reason to use dumb KMS buffers. Allocate everything on the GPU instead.

This also allows us to be lazy about mapping things to the KMS side, so
only clients that really want a KMS handle actually do that, which stops
us from ending up with a bunch of junk mapped to DCP (e.g. X11 clients
always request SCANOUT even under XWayland).

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>

19 months agoasahi: Fix compressed ZS support
Asahi Lina [Wed, 5 Apr 2023 16:42:51 +0000 (01:42 +0900)]
asahi: Fix compressed ZS support

Depth/stencil formats are "not renderable" but do support compression.

I swear I already fixed this at some point and the commit must've fallen
through the cracks...

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>

19 months agoasahi: Print reasons why compression is disabled
Asahi Lina [Wed, 5 Apr 2023 07:17:50 +0000 (16:17 +0900)]
asahi: Print reasons why compression is disabled

For resource debug. Found a regression in compressed depth this way.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>

19 months agoasahi: Add resource debugging
Asahi Lina [Wed, 5 Apr 2023 06:54:04 +0000 (15:54 +0900)]
asahi: Add resource debugging

I keep re-implementing this every time I look at resource-related
issues. Let's just make it official so we can turn it on with a flag
instead of having to add printfs every time ^^

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>

19 months agoasahi: Add a helper macro for debug/error messages
Asahi Lina [Wed, 5 Apr 2023 06:39:46 +0000 (15:39 +0900)]
asahi: Add a helper macro for debug/error messages

This includes the program short name in the message, which is useful
when running entire desktop sessions with a single log to figure out who
is doing what.

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

19 months agoasahi: Make BO import path failures more robust
Asahi Lina [Wed, 29 Mar 2023 09:48:53 +0000 (18:48 +0900)]
asahi: Make BO import path failures more robust

These operations can fail for complex reasons through no fault of mesa,
so we should have proper runtime checks for them even in release builds.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>

19 months agoasahi: Implement valid buffer range tracking
Asahi Lina [Wed, 29 Mar 2023 10:20:12 +0000 (19:20 +0900)]
asahi: Implement valid buffer range tracking

A common pattern is to allocate a vertex/etc buffer and write to it in
subsets. Some games interleave this with draw calls using the buffer.
This causes very expensive flushing for every draw call.

Fix this by tracking which range of a buffer has been written to, and
elide syncs when the range was previously uninitialized.

Fixes Source engine game performance and probably helps a bunch of
others.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>

19 months agoasahi: Fix style nits
Asahi Lina [Wed, 5 Apr 2023 10:48:12 +0000 (19:48 +0900)]
asahi: Fix style nits

Found with a grep abomination which is probably too broken/silly to
actually implement in CI... but hey, at least it found some.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>

19 months agoasahi: Locate low VA BOs correctly
Asahi Lina [Wed, 5 Apr 2023 14:48:42 +0000 (23:48 +0900)]
asahi: Locate low VA BOs correctly

These need the shader_base added to them.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>

19 months agoasahi: Enable glthread
Asahi Lina [Wed, 29 Mar 2023 09:45:45 +0000 (18:45 +0900)]
asahi: Enable glthread

This helps a lot with FEX, since the GPU driver runs emulated (and only
64bit supports thunking).

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>

19 months agoasahi: Make agx_alloc_staging() take a screen instead of a context
Asahi Lina [Wed, 5 Apr 2023 11:17:51 +0000 (20:17 +0900)]
asahi: Make agx_alloc_staging() take a screen instead of a context

This makes it clear that it is thread-safe.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>

19 months agoRevert "asahi: Advertise dual-source blending"
Asahi Lina [Wed, 5 Apr 2023 11:59:50 +0000 (20:59 +0900)]
Revert "asahi: Advertise dual-source blending"

This reverts commit f4e2b2264663482f76681dbc0a8e9fc1574a3ce7.

This is broken until GL3 is enabled, possibly due to a core Mesa bug,
but it's a corner case not worth fixing.

Fixes Chromium.

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

19 months agoagx: Make signal_pix instructions explicit
Alyssa Rosenzweig [Thu, 30 Mar 2023 02:17:18 +0000 (22:17 -0400)]
agx: Make signal_pix instructions explicit

Rather than implicitly packing them with the sample_mask. Again, this is just
changing where they're emitted, no functional changes yet. Bug for bug
compatibility with the old behaviour.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>

19 months agoagx: Rename writeout to wait_pix
Alyssa Rosenzweig [Thu, 30 Mar 2023 02:08:47 +0000 (22:08 -0400)]
agx: Rename writeout to wait_pix

This is the name applegpu is currently using, to capture the semantics of a
pixel fence. I'm not sure what Apple calls this but wait_pix is closer than
writeout for sure.

This commit just does the rename. It doesn't fix the broken semantics we've had,
this is to ease review and bisection.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>

19 months agoagx: Tease apart some sample_mask packing magic
Alyssa Rosenzweig [Thu, 30 Mar 2023 01:58:59 +0000 (21:58 -0400)]
agx: Tease apart some sample_mask packing magic

There's a second instruction here, and a second source in the first instruction.
applegpu has known about the encodings for a while but I never updated the
packing code. We will need to stop hardcoding this for multisampling support, as
preparation tease apart the magic pieces.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>

19 months agoasahi: Clamp texture buffer sizes
Alyssa Rosenzweig [Sat, 18 Mar 2023 21:34:17 +0000 (17:34 -0400)]
asahi: Clamp texture buffer sizes

Per the spec / freedreno. Fixes
arb_texture_buffer_object-texture-buffer-size-clamp

Fixes: 6b22a02f908 ("asahi,agx: Implement buffer textures with gnarly NIR")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>

19 months agoasahi: Dirty track depth bias uploads
Alyssa Rosenzweig [Sun, 26 Mar 2023 21:12:21 +0000 (17:12 -0400)]
asahi: Dirty track depth bias uploads

Reduces how much we upload in SuperTuxKart.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>

19 months agoasahi: Lower 1D to 2D
Alyssa Rosenzweig [Sat, 18 Mar 2023 20:42:35 +0000 (16:42 -0400)]
asahi: Lower 1D to 2D

Khronos APIs require that we support mipmapping even for 1D textures. However,
it isn't clear if this is supported in the hardware, and how it would work even
if it is. But 1D textures are pretty useless, so we just lower 1D textures to 2D
textures instead of worrying about that.

Fixes piles of Piglits relating to 1D textures.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>

19 months agoasahi: Implement null textures
Alyssa Rosenzweig [Sat, 18 Mar 2023 20:58:22 +0000 (16:58 -0400)]
asahi: Implement null textures

Use the same silly workaround that Metal does, to fill in texture descriptors
when there's nothing bound in the interest of robust behaviour.

Fixes null pointer dereference in
arb_shading_language_420pack-active-sampler-conflict.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>

19 months agoasahi: Honour sampler count
Alyssa Rosenzweig [Tue, 28 Mar 2023 04:05:07 +0000 (00:05 -0400)]
asahi: Honour sampler count

It may not be equal to the texture count. Prevents a regression from the next
commit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>