Commit Graph

148470 Commits

Author SHA1 Message Date
Samuel Pitoiset 2fd3b0bceb radv: do not free the GS copy shader binary if created from a library
Similar to other shader stages.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18672>
2022-09-26 07:25:50 +00:00
Dave Airlie 25ead8ec5c gallivm: fix buffer_type for LLVM 15
Fixes
deqp-vk: /home/airlied/devel/llvm-project/llvm/include/llvm/IR/Instructions.h:961: static llvm::GetElementPtrInst* llvm::GetElementPtrInst::Create(llvm::Type*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, const llvm::Twine&, llvm::Instruction*): Assertion `cast<PointerType>(Ptr->getType()->getScalarType()) ->isOpaqueOrPointeeTypeMatches(PointeeType)' failed.

Fixes: 1b8c4931df ("gallivm: fixes for LLVM-15 opaque pointers in lp_bld_jit_types.c")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18816>
2022-09-26 13:22:12 +10:00
Dave Airlie bcb136d548 gallivm: handle llvm coroutines for llvm > 15
LLVM 15 changed the coroutine presplit function attribute in

735e6c40b5e9 [Coroutines] Convert coroutine.presplit to enum attr

This needed to be updated in mesa.

Cc: mesa-stable
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18815>
2022-09-26 01:50:49 +00:00
Dave Airlie 16fd0c11c6 llvmpipe: bind sampler views/images properly.
There is some code that relies on TGSI here, and it has limits.
For now always just bind resources > 31.

Fixes
dEQP-VK.pipeline.pipeline_library.descriptor_limits*

Cc: mesa-stable
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18812>
2022-09-26 10:28:34 +10:00
Dave Airlie b144d3e6a7 llvmpipe: memset empty images in the key
This fixes a bunch of valgrind warnings in
dEQP-VK.pipeline.pipeline_library.descriptor_limits.fragment_shader.storage_images_63

Cc: mesa-stable
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18812>
2022-09-26 10:19:24 +10:00
Dave Airlie fe5636af6e lavapipe: handle view mask layer count properly for begin rendering.
If the view mask is set the layer count should be taken from it,
not from the layerCount.

Fixes: 8a6160a354 ("lavapipe: VK_KHR_dynamic_rendering")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18811>
2022-09-26 09:40:34 +10:00
Dave Airlie 21d39dd1de lavapipe: take layers into account around render surface creation.
This makes the code more consistent with handling layers, but also
makes sure a new surface is created when the w/h/layers changes.

Fixes: 8a6160a354 ("lavapipe: VK_KHR_dynamic_rendering")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18811>
2022-09-26 09:40:27 +10:00
Dave Airlie d724e95682 llvmpipe: handle different blocksizes for sampler/image views
In the cases where the sampler/image view format has a
different blocksize to the underlying resource, the width
/height need to be scaled.

Previous code to do this, did the rescaling before minification,
apparently scaling needs to happen after minification, this means
it has to happen in the llvm side.

This fixes a bunch of new VK CTS tests
dEQP-VK.image.texel_view_compatible.*

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18767>
2022-09-25 23:04:20 +00:00
Konstantin Seurer bf4a2b374f radv: Use scalar layout for BDA references
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18794>
2022-09-25 19:44:45 +00:00
Timur Kristóf 25e1c3d5b3 radv: Use a fallback for marketing name when libdrm doesn't know it.
Currently for GPUs which don't have a marketing name in libdrm,
RADV just prints "(null) (RADV ...)", which looks bad.

This commit replaces the "(null)" with "AMD Unknown".

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18775>
2022-09-25 16:32:58 +00:00
Yonggang Luo 26d1b0ca02 r600/sfn: Fixes 'numeric_limits' is not a member of 'std' error in sfn/sfn_instr.cpp
The error message is:
../src/gallium/drivers/r600/sfn/sfn_instr.cpp:46:20: error: 'numeric_limits' is not a member of 'std'
   46 |    m_block_id(std::numeric_limits<int>::max()),
      |                    ^~~~~~~~~~~~~~
../src/gallium/drivers/r600/sfn/sfn_instr.cpp:46:35: error: expected primary-expression before 'int'
   46 |    m_block_id(std::numeric_limits<int>::max()),

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

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18801>
2022-09-25 07:44:06 +00:00
Yiwei Zhang 37900ee2dd mesa/st: emit string marker based on PIPE_CAP_STRING_MARKER
Fixes: 10ac88b72f ("mesa/st: drop emit string marker device table entry.")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18803>
2022-09-25 04:21:06 +00:00
Thomas H.P. Andersen 48889fc68d vulkan: avoid warning about unused function
VK_DEFINE_NONDISP_HANDLE_CASTS defines two functions.
In some cases only one or the other is used. Marking
them both unused here to avoid warnings.

Fixes a clang warning about unused static inlined functions.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18800>
2022-09-25 03:53:15 +00:00
Thomas H.P. Andersen 0dd58bd115 panfrost: avoid warning about unused function
This function is only used if PAN_ARCH >= 5

Fixes a clang warning about unused static inlined functions.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18800>
2022-09-25 03:53:15 +00:00
Thomas H.P. Andersen 486381c489 llvmpipe: drop unused function
Fixes a clang warning about unused static inlined functions.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18800>
2022-09-25 03:53:15 +00:00
Thomas H.P. Andersen 1cbfc80f0f llvmpipe: mark function unused
build_masks is only used if neither PIPE_ARCH_SSE or
_ARCH_PWR8 && UTIL_ARCH_LITTLE_ENDIAN.
Adding a #if around build_masks feels a bit fragile so
I opted for just marking it unused.

Fixes a clang warning about unused static inlined functions.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18800>
2022-09-25 03:53:15 +00:00
Thomas H.P. Andersen ec5af409a5 spirv: mark function unused
It is unused, but seems relevant to keep around.

Fixes a clang warning about unused static inlined functions.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18800>
2022-09-25 03:53:15 +00:00
Chia-I Wu ee2e01c0ef venus: fix VkImageFormatListCreateInfo for AHB
In vn_physical_device_fix_image_format_info,
local_info->list.viewFormatCount is unintialized when has_format_list is
false.  We need to check has_format_list first.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18792>
2022-09-24 21:40:39 +00:00
Konstantin Seurer 0d66ed49b4 radv/rtpso: Use the common traversal helper
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18650>
2022-09-24 13:23:41 +00:00
Konstantin Seurer 3f72061be9 radv/rq: Use the common traversal helper
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18650>
2022-09-24 13:23:40 +00:00
Konstantin Seurer ac45935345 radv: Add a common traversal build helper
Adds a helper for building the ray traversal loop to radv_rt_common.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18650>
2022-09-24 13:23:40 +00:00
Vinson Lee e24a816818 radv: Fix file descriptor leak.
Fix defect reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable file going out of scope leaks the storage it points to.

Fixes: 5749806754 ("radv: Add Radeon Raytracing Analyzer trace dumping utilities")
Suggested-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18660>
2022-09-23 22:55:14 -07:00
Bas Nieuwenhuizen 5a3411567a radv: Properly initialize all memory in RRA dumps.
Helps debugging when making RADV BVH format changes.

changes:

1. Change bool to uint32_t because padding was uninitialized
2. Named bitfields, because unnamed bitfields were never initialized.
3. Use calloc where possible.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18734>
2022-09-24 02:01:35 +02:00
Bas Nieuwenhuizen 19aae06692 radv: Use deterministic order for dumping acceleration stuctures.
To provide deterministic RRA dumps.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18734>
2022-09-24 02:00:42 +02:00
Bas Nieuwenhuizen 50bb0d6427 radv: Use GLSL matrices for instance transforms in BVH.
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18692>
2022-09-23 22:52:23 +00:00
Bas Nieuwenhuizen 3c09681edd radv: Use proper matrices for instance nodes.
Converts both wto and otw matrices to be full row-major 4x3 matrices.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18692>
2022-09-23 22:52:23 +00:00
Bas Nieuwenhuizen 0f9fb8e15f radv: Remove aabb bounds from instance nodes.
I need space ...

Furthermore, this only gets used during the build, and we can eat
the cost of generating the AABB a second time there.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18692>
2022-09-23 22:52:23 +00:00
Bas Nieuwenhuizen b1ddb35040 radv: Translate the BVH copy shader to glsl from nir_builder.
Much easier to change.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18692>
2022-09-23 22:52:23 +00:00
Bas Nieuwenhuizen ffc5f52724 radv: Hardcode root node id.
Optimizes code a tiny bit, and avoid the hack of encoding the root
node id in the low bits of the BLAS address in an instance node.

This is needed to adjust serialization/deserialization as the
instance address there has to be the base address, so this avoids
some wrapping/unwrapping.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18692>
2022-09-23 22:52:23 +00:00
Georg Lehmann 513d074d39 radv: Fix GLSL BDA struct alignment and use pointer arithmetic SIZEOF.
Use pointer arithmetic from GL_EXT_buffer_reference2 to replace explicit
struct sizes. For that to work we also need to fix BDA alignment by setting
it to the smallest possible value (default is 16).

We could also replace the INDEX macro with a[b] operators, but that's actually
a change in behavior because a[b] always uses 64bit arithmetic.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18765>
2022-09-23 21:07:00 +00:00
Jordan Justen f446f7a769 intel/l3: Use L3 full-way allocation setting for gfx12.5 (DG2, MTL)
For now we use an empty set of L3 config settings on DG2 & MTL, which
will cause the L3 programming to set L3FullWayAllocationEnable.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18770>
2022-09-23 12:49:37 -07:00
Sil Vilerino 02d858ef0d d3d12: Fix usage of %ld with PRIu64 instead for cross-platform build
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18777>
2022-09-23 17:57:54 +00:00
Mike Blumenkrantz b3be2ace59 zink: PIPE_CAP_SHAREABLE_SHADERS
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18689>
2022-09-23 17:02:11 +00:00
Mike Blumenkrantz 10ed67867e zink: use screen param for zink_shader_free()
the context is no longer used

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18689>
2022-09-23 17:02:11 +00:00
Mike Blumenkrantz ac1b343477 zink: use program's context for cache deletion
this forces deletion of the program from its owner context under lock

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18689>
2022-09-23 17:02:11 +00:00
Mike Blumenkrantz 275e4a9c89 zink: add locking for program caches
these are context-based, so destroying them from another context needs locks

locks are not currently able to be contended

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18689>
2022-09-23 17:02:11 +00:00
Mike Blumenkrantz a10cad018b zink: don't try to delete programs from the cache if stages have been modified
this is guaranteed to fail anyway

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18689>
2022-09-23 17:02:11 +00:00
Mike Blumenkrantz eab18cb7a2 zink: use screen params for program reference functions
these never used the context anyway

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18689>
2022-09-23 17:02:11 +00:00
Mike Blumenkrantz 697eb99d69 zink: track the owner context for gfx programs
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18689>
2022-09-23 17:02:11 +00:00
Mike Blumenkrantz 2fa7091263 zink: track a mask of gfx stages remaining in gfx programs
this provides a hint to improve program deletion

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18689>
2022-09-23 17:02:11 +00:00
Joshua Ashton 0f770caa23 freedreno: Disable 8bpp_ubwc on a6xx gen2
Fixes text corruption in VSCode on a680.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18779>
2022-09-23 16:08:33 +00:00
Ruijing Dong 7bf8af2c8d radeon/vcn: process invalid frame rate in encoding
Just in case app sending zeros in frame rate,
which could cause zero division, it will be treated
as fixed value, 30fps.

Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18737>
2022-09-23 13:52:46 +00:00
Pierre-Eric Pelloux-Prayer 4fdf10fdaf radeonsi/gfx11: don't set VERTS_PER_SUBGRP to 0
It seems slower.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Fixes: 25a66477d0 ("radeonsi/gfx11: register changes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18758>
2022-09-23 13:29:18 +00:00
Pierre-Eric Pelloux-Prayer 7483e50404 winsys/amdgpu: init 'r' before using it
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Fixes: 471c82d21e ("winsys/amdgpu: flatten huge if and reorder code in amdgpu_cs_submit_ib")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18758>
2022-09-23 13:29:18 +00:00
Tapani Pälli 58829d9f11 iris: implement Wa_14016118574
After each 3DPRIMITIVE, we need to send a dummy post sync op if point or
line list was used or if had only 1 or 2 vertices per primitive.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18746>
2022-09-23 12:27:05 +00:00
Tapani Pälli f2645229c2 anv: implement Wa_14016118574
After each 3DPRIMITIVE, we need to send a dummy post sync op if point or
line list was used or if had only 1 or 2 vertices per primitive.

v2: add missing _3DPRIM_POINTLIST_BF (Lionel)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18746>
2022-09-23 12:27:05 +00:00
Erik Faye-Lund c7ff9876d6 zink: correct emulation of luminance-alpha formats
util_format_luminance_to_red returns a red-alpha format, not a red-green
format, which is what we need in Vulkan. So let's also call
emulate_red_alpha so we can finish up with a valid format.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18596>
2022-09-23 10:55:15 +00:00
Erik Faye-Lund e7f192030c zink: fix luminance/luminance-alpha emulation
We need to check the pipe_resource's format, not the texture-view
format. We're trying to overcome differences in the physical memory
layout, not the interpretation of the view.

But since we're now looking at the resource-format, we also need to take
the view-swizzle into account, because the state tracker likes to do
blits between LA and RA formats.

This had little effect in practice for luminance formats, but for
luminance-alpha formats things went kinda sideways. But luckily,
we don't actually use those formats yet, triggering state-tracker
emulation instead.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18596>
2022-09-23 10:55:15 +00:00
Erik Faye-Lund 09afab4c29 zink: refactor swizzle-clamping code
It's going to be a lot easier to work on this if we can use loops
instead of open-coding. So let's move the swizzles into arrays, process
them, and then stick it back into their place at the end.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18596>
2022-09-23 10:55:15 +00:00
Erik Faye-Lund 51c7691108 zink: fixup indent
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18596>
2022-09-23 10:55:15 +00:00