platform/upstream/mesa.git
14 months agov3d: apply proper clamping when setting up RT
Juan A. Suarez Romero [Thu, 27 Apr 2023 12:15:18 +0000 (14:15 +0200)]
v3d: apply proper clamping when setting up RT

Ensure the render target values are in the proper range.

This fixes `spec@!opengl 3.0@render-integer`.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22733>

14 months agov3d: upgrade V3D 4.1 to 4.2 version
Juan A. Suarez Romero [Thu, 27 Apr 2023 12:13:14 +0000 (14:13 +0200)]
v3d: upgrade V3D 4.1 to 4.2 version

Some of the new features require at least V3D 4.2. And actually, 4.2 is
the version used by the Raspberry Pi 4 hardware.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22733>

14 months agov3d: add per hw-version caller macro
Juan A. Suarez Romero [Thu, 27 Apr 2023 12:11:23 +0000 (14:11 +0200)]
v3d: add per hw-version caller macro

Instead of hardcoding conditionals to know which hardwared-based version
of a function to call, just wrap them in a macro to use

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22733>

14 months agoradv/rt: store stack_sizes per stage instead of per group
Daniel Schürmann [Tue, 25 Apr 2023 17:44:17 +0000 (19:44 +0200)]
radv/rt: store stack_sizes per stage instead of per group

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

14 months agoradv/rt: use vk_multialloc for radv_ray_tracing_pipeline
Daniel Schürmann [Wed, 26 Apr 2023 10:26:27 +0000 (12:26 +0200)]
radv/rt: use vk_multialloc for radv_ray_tracing_pipeline

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

14 months agoradv/rt: refactor radv_rt_pipeline_compile()
Daniel Schürmann [Fri, 14 Apr 2023 14:34:27 +0000 (16:34 +0200)]
radv/rt: refactor radv_rt_pipeline_compile()

This patch moves the NIR shader creation into radv_rt_pipeline_compile()
and simplifies radv_rt_pipeline_create().

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

14 months agoradv/rt: unify radv_rt_pipeline_create() and radv_rt_pipeline_library_create()
Daniel Schürmann [Fri, 14 Apr 2023 13:50:13 +0000 (15:50 +0200)]
radv/rt: unify radv_rt_pipeline_create() and radv_rt_pipeline_library_create()

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

14 months agoradv/rt: unify radv_ray_tracing_lib_pipeline and radv_ray_tracing_pipeline
Daniel Schürmann [Fri, 14 Apr 2023 12:53:02 +0000 (14:53 +0200)]
radv/rt: unify radv_ray_tracing_lib_pipeline and radv_ray_tracing_pipeline

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

14 months agoradv/rt: change base of radv_ray_tracing_lib_pipeline to radv_compute_pipeline
Daniel Schürmann [Fri, 14 Apr 2023 12:09:01 +0000 (14:09 +0200)]
radv/rt: change base of radv_ray_tracing_lib_pipeline to radv_compute_pipeline

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

14 months agoanv: enable graphics pipeline libraries by default
Iván Briano [Tue, 9 May 2023 18:53:37 +0000 (11:53 -0700)]
anv: enable graphics pipeline libraries by default

Since we are disabling mesh, which has issues with gpl, enable gpl by
default now, leaving the renamed environment variable as a way to
disable it for debug purposes.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22910>

14 months agoanv: put EXT_mesh_shader behind an environment variable
Iván Briano [Mon, 8 May 2023 21:22:15 +0000 (14:22 -0700)]
anv: put EXT_mesh_shader behind an environment variable

We are seeing frequent hangs in other workloads when something using
mesh shaders runs at the same time, so gate the feature behind an
environment variable until we figure out what's going on.

v2: (Sagar)
 - Give the mesh enabled variable a more descriptive name

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22910>

14 months agozink: also cache swapchain semaphores
Mike Blumenkrantz [Tue, 9 May 2023 14:14:20 +0000 (10:14 -0400)]
zink: also cache swapchain semaphores

a semaphore is a semaphore, as they say

Fixes: 7399b2241f8 ("zink: move semaphore caching to zink_reset_batch_state()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22935>

14 months agozink: block more flushes during unordered blits
Mike Blumenkrantz [Wed, 3 May 2023 17:16:25 +0000 (13:16 -0400)]
zink: block more flushes during unordered blits

Fixes: 89aa3635932 ("zink: block oom flushes during unordered blits")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22931>

14 months agozink: adjust bindless texel buffer handle before indexing
Mike Blumenkrantz [Tue, 9 May 2023 23:28:18 +0000 (19:28 -0400)]
zink: adjust bindless texel buffer handle before indexing

buffer handle ids are offset by ZINK_MAX_BINDLESS_HANDLES, but the actual
index is zero-based

Fixes: 99ba529feed ("zink: implement descriptor buffer handling of bindless texture")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22931>

14 months agozink: compare desc set to detect bindless vars in separate shaders
Mike Blumenkrantz [Tue, 9 May 2023 23:17:39 +0000 (19:17 -0400)]
zink: compare desc set to detect bindless vars in separate shaders

the bindless flag here isn't set, so this check did nothing

Fixes: e3b746e3a31 ("zink: use GPL to handle (simple) separate shader objects")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22931>

14 months agozink: bind bindless db set when updating separate shader db sets
Mike Blumenkrantz [Tue, 9 May 2023 22:19:19 +0000 (18:19 -0400)]
zink: bind bindless db set when updating separate shader db sets

this otherwise doesn't bind a bindless set and hangs

Fixes: e3b746e3a31 ("zink: use GPL to handle (simple) separate shader objects")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22931>

14 months agozink: set debug callback on context
Mike Blumenkrantz [Tue, 9 May 2023 20:32:08 +0000 (16:32 -0400)]
zink: set debug callback on context

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

14 months agozink: add perf_debug for "interesting" shader compiles
Mike Blumenkrantz [Tue, 9 May 2023 18:50:36 +0000 (14:50 -0400)]
zink: add perf_debug for "interesting" shader compiles

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

14 months agozink: make mesa_logw separate from perf_debug
Mike Blumenkrantz [Tue, 9 May 2023 18:45:09 +0000 (14:45 -0400)]
zink: make mesa_logw separate from perf_debug

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

14 months agozink: add ZINK_DEBUG=nobgc
Mike Blumenkrantz [Mon, 8 May 2023 12:54:01 +0000 (08:54 -0400)]
zink: add ZINK_DEBUG=nobgc

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

14 months agozink: add ZINK_DEBUG=noopt
Mike Blumenkrantz [Fri, 5 May 2023 16:58:03 +0000 (12:58 -0400)]
zink: add ZINK_DEBUG=noopt

it's often useful to disable optimized pipeline compiles for debugging

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

14 months agovc4/ci: disable VC4 jobs
Juan A. Suarez Romero [Tue, 9 May 2023 18:19:16 +0000 (20:19 +0200)]
vc4/ci: disable VC4 jobs

Some test is causing a GPU reset, which blocks merge requests.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22927>

14 months agodzn/ci: Remove 'exclude' for graphicsfuzz cases
Jesse Natalie [Tue, 9 May 2023 15:35:08 +0000 (08:35 -0700)]
dzn/ci: Remove 'exclude' for graphicsfuzz cases

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

14 months agodzn: Run nir_opt_remove_phis before nir_lower_returns
Jesse Natalie [Tue, 9 May 2023 15:31:56 +0000 (08:31 -0700)]
dzn: Run nir_opt_remove_phis before nir_lower_returns

Otherwise nir_lower_returns can produce invalid NIR by not updating
a phi in a non-trivial if.

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

14 months agofrontends/va/config: check for QVBR support when creating
Thong Thai [Mon, 8 May 2023 17:26:10 +0000 (13:26 -0400)]
frontends/va/config: check for QVBR support when creating

Fixes: 30a6363c8f6 ("frontend/va: Support QVBR rate control mode")
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22905>

14 months agofrontends/va/context: check min supported resolution when creating
Thong Thai [Mon, 8 May 2023 16:20:23 +0000 (12:20 -0400)]
frontends/va/context: check min supported resolution when creating

Fixes: c987eed9cd7 ("frontends/va: report min width and min height values if available")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8981
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22905>

14 months agofrontends/va/config: add disable packed headers as valid config
Thong Thai [Mon, 8 May 2023 15:43:43 +0000 (11:43 -0400)]
frontends/va/config: add disable packed headers as valid config

Fixes: 306c6e12a59 ("frontends/va: define va av1 encoding caps")
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22905>

14 months agoradeonsi: set proper drm_amdgpu_cs_chunk_fence alignment
Patrick Lerda [Tue, 25 Apr 2023 14:47:23 +0000 (16:47 +0200)]
radeonsi: set proper drm_amdgpu_cs_chunk_fence alignment

The 'struct drm_amdgpu_cs_chunk_fence' is processed as
'struct drm_amdgpu_cs_chunk_data' which is a union.
This change ensures the proper alignment for this structure
to be processed as 'struct drm_amdgpu_cs_chunk_data'.

The presence of __u64 as one member of
'struct drm_amdgpu_cs_chunk_data' makes the
whole structure expected to be 64-bit aligned.

This is a minor issue detected by the gcc sanitizer (ubsan), for instance at the libdrm library:
../amdgpu/amdgpu_cs.c:937:26: runtime error: member access within misaligned address 0x63100001484c for type 'struct drm_amdgpu_cs_chunk_data', which requires 8 byte alignment
0x63100001484c: note: pointer points here
  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
                ^

Fixes: ae7e4d7619e0 ("amd: rename ring_type --> amd_ip_type and match the kernel enum values")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22920>

14 months agoiris: Add function to return mmap mode for aux map
José Roberto de Souza [Mon, 17 Apr 2023 15:32:08 +0000 (08:32 -0700)]
iris: Add function to return mmap mode for aux map

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22240>

14 months agoiris: Add function to return mmap mode for userptr bos
José Roberto de Souza [Mon, 27 Mar 2023 20:20:45 +0000 (13:20 -0700)]
iris: Add function to return mmap mode for userptr bos

Similar to what was done to alloc buffer but now for userptr bos.
There is no changes in i915 modes but Xe may different values in
future.

While at it, also setting bo->real.heap to IRIS_HEAP_SYSTEM_MEMORY
as it was already implicit set as IRIS_HEAP_SYSTEM_MEMORY is the
value 0 of the enum.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22240>

14 months agoiris: Add a function to return allocated bo mmap mode
José Roberto de Souza [Thu, 13 Apr 2023 14:36:53 +0000 (07:36 -0700)]
iris: Add a function to return allocated bo mmap mode

i915 and Xe kmd can have different mmaps modes, so here extracting
the code to handle it to function.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22240>

14 months agolavapipe: honor dst base array layer when resolving color attachments
Matthieu Bouron [Tue, 9 May 2023 10:29:33 +0000 (12:29 +0200)]
lavapipe: honor dst base array layer when resolving color attachments

CC: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22924>

14 months agozink/ci: document new flakes on RADV
Martin Roukala (né Peres) [Tue, 9 May 2023 12:07:11 +0000 (15:07 +0300)]
zink/ci: document new flakes on RADV

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22923>

14 months agozink/ci: document recent fixes on RADV
Martin Roukala (né Peres) [Tue, 9 May 2023 11:47:41 +0000 (14:47 +0300)]
zink/ci: document recent fixes on RADV

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22923>

14 months agoradv: advertise VK_EXT_attachment_feedback_loop_dynamic_state
Samuel Pitoiset [Tue, 2 May 2023 12:46:57 +0000 (14:46 +0200)]
radv: advertise VK_EXT_attachment_feedback_loop_dynamic_state

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

14 months agoradv: implement VK_EXT_attachment_feedback_loop_dynamic_state
Samuel Pitoiset [Tue, 2 May 2023 13:15:51 +0000 (15:15 +0200)]
radv: implement VK_EXT_attachment_feedback_loop_dynamic_state

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

14 months agovulkan/runtime: add VK_DYNAMIC_STATE_ATTACHMENT_FEEDBACK_LOOP_ENABLE_EXT
Mike Blumenkrantz [Wed, 3 May 2023 13:24:26 +0000 (09:24 -0400)]
vulkan/runtime: add VK_DYNAMIC_STATE_ATTACHMENT_FEEDBACK_LOOP_ENABLE_EXT

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22849>

14 months agovulkan: Update XML and headers to 1.3.250
Samuel Pitoiset [Thu, 4 May 2023 12:20:12 +0000 (14:20 +0200)]
vulkan: Update XML and headers to 1.3.250

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22849>

14 months agoglsl/lower_samplers_as_deref: apply bindings for unused samplers
Mike Blumenkrantz [Mon, 8 May 2023 13:15:08 +0000 (09:15 -0400)]
glsl/lower_samplers_as_deref: apply bindings for unused samplers

if a sampler is never used (no derefs) then its binding will never be
applied here, leaving it with binding=0. this will clobber the real binding=0
sampler in driver backends, leading to errors, so try to iterate using
the same criteria as above and apply bindings in the same way

fixes #8974

cc: mesa-stable

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22902>

14 months agovc4/ci: skip unsupported test versions
Juan A. Suarez Romero [Tue, 9 May 2023 10:51:26 +0000 (12:51 +0200)]
vc4/ci: skip unsupported test versions

Skip all OpenGL[ES] and GLSL tests that are not supported.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22919>

14 months agoac/spm: switch to SPM version 2.0
Samuel Pitoiset [Wed, 3 May 2023 08:05:14 +0000 (10:05 +0200)]
ac/spm: switch to SPM version 2.0

Found this while glancing in PAL.

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

14 months agov3d/ci: update neverball-v2 trace reference
Juan A. Suarez Romero [Tue, 9 May 2023 08:17:45 +0000 (10:17 +0200)]
v3d/ci: update neverball-v2 trace reference

Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22915>

14 months agoiris: use the workaround framework for WA 14013111325
Rohan Garg [Fri, 5 May 2023 10:18:59 +0000 (12:18 +0200)]
iris: use the workaround framework for WA 14013111325

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22830>

14 months agohasvk: drop dead code
Rohan Garg [Wed, 3 May 2023 14:22:20 +0000 (16:22 +0200)]
hasvk: drop dead code

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22830>

14 months agoanv: use the workaround framework for WA 14013111325
Rohan Garg [Wed, 3 May 2023 14:21:04 +0000 (16:21 +0200)]
anv: use the workaround framework for WA 14013111325

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22830>

14 months agointel/compiler: Fold constants after distributing source modifiers
Kenneth Graunke [Thu, 4 May 2023 07:55:42 +0000 (00:55 -0700)]
intel/compiler: Fold constants after distributing source modifiers

This can generate things like fneg! of load_const, which is silly.
Fold those away into an actual constant.  Only do so on the scalar
backend because there's a comment above that the vec4 backend doesn't
want any new constants this late, and I'm inclined to believe it.

fossil-db stats show a very minor improvement:

   Totals:
   Instrs: 203091223 -> 203091099 (-0.00%); split: -0.00%, +0.00%
   Cycles: 14410638075 -> 14410577067 (-0.00%); split: -0.00%, +0.00%

   Totals from 20 (0.00% of 665070) affected shaders:
   Instrs: 27067 -> 26943 (-0.46%); split: -0.47%, +0.01%
   Cycles: 2687958 -> 2626950 (-2.27%); split: -2.27%, +0.00%

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

14 months agovenus: enable sparse binding properties
Juston Li [Thu, 27 Apr 2023 21:04:25 +0000 (14:04 -0700)]
venus: enable sparse binding properties

signed-off-by: Juston Li <justonli@google.com>

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

14 months agovenus: enable sparse binding features
Juston Li [Thu, 20 Apr 2023 19:48:10 +0000 (12:48 -0700)]
venus: enable sparse binding features

Enable sparse binding now that vkQueueBindSparse works with feedback.

If a device only has queue families with exclusive sparse binding
support then disable sparse binding.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22616>

14 months agovenus: add back sparse binding support
Juston Li [Thu, 20 Apr 2023 18:42:35 +0000 (11:42 -0700)]
venus: add back sparse binding support

Add back support for vkQueueBindSparse that works with fence and timeline
semaphore feedback.

For each vkQueueBindSparse batch, if it contains feedback then move the
signal operations to a subsequent vkQueueSubmit with feedback cmds.

This requires queue families that support vkQueueSubmit alongside sparse
binding support so any queue familes that exclusively support sparse
binding will be filtered out.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22616>

14 months agovenus: add helper function support for VkBindSparseInfo
Juston Li [Wed, 19 Apr 2023 19:03:26 +0000 (12:03 -0700)]
venus: add helper function support for VkBindSparseInfo

add getter/setters for VkBindSparseInfo so we can at least share
vn_queue_submission_prepare() to handle external semaphores and
check for fence/semaphore feedback

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22616>

14 months agovenus: filter out queue familes with exclusive sparse binding support
Juston Li [Thu, 20 Apr 2023 21:36:53 +0000 (14:36 -0700)]
venus: filter out queue familes with exclusive sparse binding support

We require the queue to have additional support to be able to send
feedback commands.

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

14 months agoac/nir/cull: fix line position w culling
Qiang Yu [Fri, 5 May 2023 03:04:35 +0000 (11:04 +0800)]
ac/nir/cull: fix line position w culling

Fixes: db0e9d3caba ("ac/nir/ngg: support line culling")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8950
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/22867>

14 months agozink: fix uncached memory readback
Mike Blumenkrantz [Mon, 8 May 2023 19:06:55 +0000 (15:06 -0400)]
zink: fix uncached memory readback

the inner conditional here didn't include uncached readback, meaning
that many (most?) buffers allocated with uncached memory (i.e., BAR) were
being read back directly instead of using staging resources to be faster

at some point this inner conditional should be reevaluated to determine
whether it still does anything, but this is not that time

fixes, among other things, loading in DOOM2016 on some GPUs

Fixes: 52f27cda05b ("zink: allow direct memory mapping for any COHERENT+CACHED buffer")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22907>

14 months agozink: block batching of unordered barriers if previous usage was write
Mike Blumenkrantz [Mon, 8 May 2023 23:19:04 +0000 (19:19 -0400)]
zink: block batching of unordered barriers if previous usage was write

in the case where a cmdbuf was submitted with write access and the subsequent
batch promotes an op to unordered, it's important for associated barriers
to happen-before those ops to guarantee synchronization

the fixes tag is wrong on this, but it's all in the same release

Fixes: bf0af0f8ede ("zink: move all barrier-related functions to c++")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22907>

14 months agozink: disable batched unordered barries with ZINK_DEBUG=noreorder
Mike Blumenkrantz [Mon, 8 May 2023 23:19:04 +0000 (19:19 -0400)]
zink: disable batched unordered barries with ZINK_DEBUG=noreorder

another improvement for debugging

Fixes: bf0af0f8ede ("zink: move all barrier-related functions to c++")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22907>

14 months agozink: flush INDIRECT_BUFFER mem barrier for compute
Mike Blumenkrantz [Mon, 8 May 2023 21:25:17 +0000 (17:25 -0400)]
zink: flush INDIRECT_BUFFER mem barrier for compute

this is usable in gfx and compute, so don't desync

Fixes: 3674839d110 ("zink: batch mem barrier hooks")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22907>

14 months agozink: unbind the ssbo slot being iterated, not the index of the buffer
Mike Blumenkrantz [Mon, 8 May 2023 20:31:58 +0000 (16:31 -0400)]
zink: unbind the ssbo slot being iterated, not the index of the buffer

this otherwise breaks ssbo binding

cc: mesa-stable

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

14 months agozink: use an intermediate variable for binding ssbo slots
Mike Blumenkrantz [Mon, 8 May 2023 20:31:18 +0000 (16:31 -0400)]
zink: use an intermediate variable for binding ssbo slots

this makes the bug more obvious

cc: mesa-stable

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

14 months agozink: delete unnecessary pipeline stage flags from inference
Mike Blumenkrantz [Mon, 8 May 2023 20:15:15 +0000 (16:15 -0400)]
zink: delete unnecessary pipeline stage flags from inference

I added these for completeness, but zink will never use them

cc: mesa-stable

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

14 months agozink: add PERSISTENT for db buffer maps
Mike Blumenkrantz [Mon, 8 May 2023 19:14:14 +0000 (15:14 -0400)]
zink: add PERSISTENT for db buffer maps

Fixes: 13c6ad0038a ("zink: use a single descriptor buffer for all non-bindless types")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22907>

14 months agozink: delete persistent map tracking
Mike Blumenkrantz [Mon, 8 May 2023 19:23:10 +0000 (15:23 -0400)]
zink: delete persistent map tracking

this was never needed and never did anything: zink only uses COHERENT
memory, which is always available on queue submission, so it was all
just pointless code

cc: mesa-stable

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

14 months agomicrosoft/compiler: Avoid integer divides by 0
Jesse Natalie [Mon, 1 May 2023 23:43:05 +0000 (16:43 -0700)]
microsoft/compiler: Avoid integer divides by 0

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

14 months agospirv2dxil: Lower large temps to scratch
Jesse Natalie [Mon, 1 May 2023 23:18:22 +0000 (16:18 -0700)]
spirv2dxil: Lower large temps to scratch

WARP has a temp register limit, and the control flow needed to convert
indirect to direct accesses on large temps ends up bloating shaders massively.
We can just go ahead and spill these large temps to scratch, which maps
to an alloca in DXIL.

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

14 months agodzn: Use A4B4G4R4 instead of B4G4R4A4 when available
Jesse Natalie [Thu, 20 Apr 2023 16:27:09 +0000 (09:27 -0700)]
dzn: Use A4B4G4R4 instead of B4G4R4A4 when available

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

14 months agozink: stringify unsupported prim restart log error
Mike Blumenkrantz [Fri, 28 Apr 2023 13:55:13 +0000 (09:55 -0400)]
zink: stringify unsupported prim restart log error

cc: mesa-stable

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

14 months agozink: allow vk 1.2 timelineSemaphore feature if extension isn't supported
Mike Blumenkrantz [Fri, 28 Apr 2023 13:50:28 +0000 (09:50 -0400)]
zink: allow vk 1.2 timelineSemaphore feature if extension isn't supported

this is a weird case but whatever

cc: mesa-stable

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

14 months agoci/windows: Pick up WARP 1.0.6 NuGet with lots of dzn fixes
Jesse Natalie [Mon, 8 May 2023 21:50:06 +0000 (14:50 -0700)]
ci/windows: Pick up WARP 1.0.6 NuGet with lots of dzn fixes

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

14 months agofrontend/nine: Add debug driconf var force_features_emulation
Axel Davy [Sat, 22 Apr 2023 13:09:46 +0000 (15:09 +0200)]
frontend/nine: Add debug driconf var force_features_emulation

This is useful to debug drivers to be able to
disable all specific d3d9 features and always trigger
the emulated path.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>

14 months agofrontend/nine: Fix shader cap test for POSITIONT
Axel Davy [Sat, 22 Apr 2023 13:08:19 +0000 (15:08 +0200)]
frontend/nine: Fix shader cap test for POSITIONT

This feature is almost never used in programmable
shaders so no issue was ever reported.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>

14 months agofrontend/nine: Implement backup support for clip planes
Axel Davy [Thu, 21 Jul 2022 20:50:10 +0000 (22:50 +0200)]
frontend/nine: Implement backup support for clip planes

Implement backup support for clip planes.
Driver support is still preferred, as the driver
can reuse the compilation of the core of the shader
to generate variants.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>

14 months agotgsi_to_nir: handle PIPE_CAP_NIR_COMPACT_ARRAYS for clipdistance
Mike Blumenkrantz [Wed, 27 Jul 2022 16:29:15 +0000 (12:29 -0400)]
tgsi_to_nir: handle PIPE_CAP_NIR_COMPACT_ARRAYS for clipdistance

drivers that set this cap require clipdistance to be passed as an
array of floats, so convert the existing stores during finalize

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

14 months agodocs/gallium: Clarify PIPE_CAP_CLIP_PLANES
Axel Davy [Thu, 21 Jul 2022 20:01:47 +0000 (22:01 +0200)]
docs/gallium: Clarify PIPE_CAP_CLIP_PLANES

Drivers with PIPE_CAP_CLIP_PLANES set to 0,
such as zink, ignore clip_plane_enable.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>

14 months agofrontend/nine: initialize force_color_in_centroid
Axel Davy [Sun, 23 Apr 2023 11:25:43 +0000 (13:25 +0200)]
frontend/nine: initialize force_color_in_centroid

The first version of the shader didn't have proper
force_color_in_centroid field set.

That won't make much a difference (centroid is very
similar to no centroid) but it is still better.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>

14 months agofrontend/nine: Get rid of INTERPOLATE_COLOR
Axel Davy [Fri, 29 Jul 2022 16:02:26 +0000 (18:02 +0200)]
frontend/nine: Get rid of INTERPOLATE_COLOR

Some drivers don't handle it, and those who do replace it anyway
depending on the rasterizer setting. Keep the rasterizer setting
but replace the interpolation flag accordingly.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>

14 months agofrontend/nine: Enforce legacy pow behaviour
Axel Davy [Thu, 28 Jul 2022 21:35:07 +0000 (23:35 +0200)]
frontend/nine: Enforce legacy pow behaviour

Gallium drivers used to implement the legacy behaviour.
It's not the case of all recent drivers, so implement
the legacy behaviour in nine.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>

14 months agofrontend/nine: Print warning incomplete position_t support
Axel Davy [Thu, 28 Jul 2022 19:59:06 +0000 (21:59 +0200)]
frontend/nine: Print warning incomplete position_t support

What would be missing for position_t to work in
vs programmable shaders when VS_WINDOW_SPACE_POSITION
is unavailable is to apply the inverse viewport transformation
similarly to what is done for ff vs.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>

14 months agofrontend/nine: Improve VS_WINDOW_SPACE_POSITION fallback
Axel Davy [Thu, 28 Jul 2022 19:31:25 +0000 (21:31 +0200)]
frontend/nine: Improve VS_WINDOW_SPACE_POSITION fallback

Previously we would implement position_t by
applying the inverse of the viewport, and
advertising clipping was going to occur with
the cap CLIPTLVERTS.

However when the cap is advertised, clipping
is supposed to be disabled via sw emulation
when D3DRS_CLIPPING is set to FALSE.

Since we don't support that either, instead take the
approach of disabling at least depth clipping, and
not advertising the cap.

Ideally, clipping should be totally disabled.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>

14 months agofrontend/nine: Implement backup support for pointsize
Axel Davy [Thu, 21 Jul 2022 16:45:25 +0000 (18:45 +0200)]
frontend/nine: Implement backup support for pointsize

Improve support for drivers that don't support the
pointsize states.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>

14 months agofrontend/nine: Implement alpha test backup support
Axel Davy [Thu, 21 Jul 2022 15:14:45 +0000 (17:14 +0200)]
frontend/nine: Implement alpha test backup support

Implement alpha test emulation for drivers without support.

Driver support is still a preferred option, as driver
can reuse the compilation of the main core of the shader
to generate shader variants.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8315

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>

14 months agofrontend/nine: Drop max_ps_const_f
Axel Davy [Wed, 20 Jul 2022 21:56:14 +0000 (23:56 +0200)]
frontend/nine: Drop max_ps_const_f

Replace max_ps_const_f with a constant.
In practice it already was always the
same value no matter the hw.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22644>

14 months agozink: don't init mutable for swapchain src during blit
Mike Blumenkrantz [Mon, 8 May 2023 17:55:45 +0000 (13:55 -0400)]
zink: don't init mutable for swapchain src during blit

fixes #8993

cc: 23.1 <mesa-stable>

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

14 months agozink: don't init mutable resource bit for swapchain images
Mike Blumenkrantz [Fri, 5 May 2023 16:06:05 +0000 (12:06 -0400)]
zink: don't init mutable resource bit for swapchain images

these are either already mutable (for srgb) or invalid usage

fixes #8970

cc: mesa-stable

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

14 months agointel: enable protected context creation along with engines
Lionel Landwerlin [Mon, 8 May 2023 06:15:02 +0000 (09:15 +0300)]
intel: enable protected context creation along with engines

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22898>

14 months agotu: Expose VK_EXT_fragment_density_map
Connor Abbott [Fri, 25 Nov 2022 13:12:58 +0000 (14:12 +0100)]
tu: Expose VK_EXT_fragment_density_map

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

14 months agotu: Don't allow importing/exporting subsampled images with modifiers
Connor Abbott [Tue, 13 Dec 2022 18:28:17 +0000 (19:28 +0100)]
tu: Don't allow importing/exporting subsampled images with modifiers

Right now subsampled images are the same as non-subsampled images, this
will change when we actually implement them which will be an ABI break.
Disallow importing/exporting them with modifiers until that's stabilized
to force users to match the driver UUID.

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

14 months agotu/autotune: Always prefer GMEM with fragment density maps
Connor Abbott [Fri, 25 Nov 2022 15:48:17 +0000 (16:48 +0100)]
tu/autotune: Always prefer GMEM with fragment density maps

If we encounter an app doing bad things where we want sysmem, we can fix
that later, but this seems like the right thing to do initially.

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

14 months agotu, ir3: Handle FDM shader builtins
Connor Abbott [Fri, 25 Nov 2022 13:11:12 +0000 (14:11 +0100)]
tu, ir3: Handle FDM shader builtins

Also, add the necessary transform to fixup gl_FragCoord.xy.

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

14 months agonir, ir3: Add option to use unscaled FragCoord for input attachments
Connor Abbott [Tue, 13 Dec 2022 17:09:28 +0000 (18:09 +0100)]
nir, ir3: Add option to use unscaled FragCoord for input attachments

When rendering a scaled tile, we need to use the original, hardware
FragCoord when accessing input attachments that are on-tile (i.e. were
rendered to in a previous subpass) because they are also scaled in the
same way that FragCoord is scaled. For input attachments that aren't
already on-tile, however, we need to use the fixed gl_FragCoord. Add a
new intrinsic and a bitfield of input attachments which should use it.

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

14 months agotu: Implement FDM scaled loads/stores
Connor Abbott [Mon, 21 Nov 2022 13:54:36 +0000 (14:54 +0100)]
tu: Implement FDM scaled loads/stores

In addition to scaling the rendering itself, we need to scale
loads/stores except when using subsampling, but subsampling isn't
implemented yet.

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

14 months agotu: Implement FDM viewport patching
Connor Abbott [Mon, 21 Nov 2022 13:52:44 +0000 (14:52 +0100)]
tu: Implement FDM viewport patching

We scale the actual rendering by patching the viewport state. This is
helped by a HW bit to make the viewport index equal to the view index,
so that we can have a different scaling per-view.

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

14 months agoir3: Record whether a shader writes gl_ViewportIndex
Connor Abbott [Mon, 21 Nov 2022 13:05:43 +0000 (14:05 +0100)]
ir3: Record whether a shader writes gl_ViewportIndex

This will be needed by turnip.

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

14 months agotu: Add core FDM patchpoint infrastructure
Connor Abbott [Mon, 21 Nov 2022 13:37:15 +0000 (14:37 +0100)]
tu: Add core FDM patchpoint infrastructure

FDM is implemented pretty much entirely inside the driver, by patching
various structures for each bin. This adds the core infrastructure to
sample the density map, compute the scaled bin sizes we will use, create
patchpoints, and apply them at the start of each bin before executing
the IB2.

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

14 months agotu/cs: Add support for CS patching
Connor Abbott [Fri, 25 Nov 2022 13:53:05 +0000 (14:53 +0100)]
tu/cs: Add support for CS patching

In order to patch the command stream on the gpu, we need two features:

1. The ability to use a read-write BO instead of a read-only one, when
   patching might be performed.
2. The ability to get the iova of the current position after reserving
   some number of dwords, even with externally-allocated command
   streams.

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

14 months agotu: Implement sampling the fragment density map
Connor Abbott [Mon, 21 Nov 2022 13:34:31 +0000 (14:34 +0100)]
tu: Implement sampling the fragment density map

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

14 months agotu: Parse fragment density map attachment info
Connor Abbott [Mon, 21 Nov 2022 13:09:17 +0000 (14:09 +0100)]
tu: Parse fragment density map attachment info

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

14 months agofreedreno/a6xx: Document per-view viewport in GRAS_SU_CNTL
Connor Abbott [Mon, 21 Nov 2022 11:21:10 +0000 (12:21 +0100)]
freedreno/a6xx: Document per-view viewport in GRAS_SU_CNTL

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

14 months agotu: Make dynamic viewport and scissor count more accurate
Connor Abbott [Fri, 18 Nov 2022 20:28:08 +0000 (21:28 +0100)]
tu: Make dynamic viewport and scissor count more accurate

Because we delay emitting them until we know the pipeline, we can track
the actual count instead of taking the max.

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

14 months agotu: Merge RB_DEPTH_CNTL and RB_STENCIL_CONTROL drawstates
Connor Abbott [Mon, 21 Nov 2022 17:36:19 +0000 (18:36 +0100)]
tu: Merge RB_DEPTH_CNTL and RB_STENCIL_CONTROL drawstates

We're again running out of draw states, and this matches what gallium
does.

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

14 months agotu: Precompute maximum views across all subpasses
Connor Abbott [Thu, 17 Nov 2022 12:24:30 +0000 (13:24 +0100)]
tu: Precompute maximum views across all subpasses

We'll need this to know how many viewports to create.

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

14 months agotu: Use dirty bit for scissor state
Connor Abbott [Thu, 17 Nov 2022 11:08:37 +0000 (12:08 +0100)]
tu: Use dirty bit for scissor state

This will make patching it on-demand easier.

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