Commit Graph

148486 Commits

Author SHA1 Message Date
Marcin Ślusarz cb201e92ac glsl: use nir_shader_instructions_pass in gl_nir_lower_samplers_as_deref
No functional changes.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>
2022-09-26 11:13:03 +00:00
Marcin Ślusarz d3708d6cf5 glsl: use nir_shader_instructions_pass in gl_nir_lower_images
No functional changes.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>
2022-09-26 11:13:03 +00:00
Marcin Ślusarz 1829fde212 glsl: use nir_shader_instructions_pass in gl_nir_lower_atomics
Changes:
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
  make progress

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>
2022-09-26 11:13:03 +00:00
Marcin Ślusarz e9dc98ed87 crocus: remove invalid nir_metadata_preserve from crocus_fix_edge_flags
nir_metadata_preserve(NULL, ...) doesn't make any sense.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>
2022-09-26 11:13:03 +00:00
Marcin Ślusarz a1c042fb5a iris: remove invalid nir_metadata_preserve from iris_fix_edge_flags
nir_metadata_preserve(NULL, ...) doesn't make any sense.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>
2022-09-26 11:13:03 +00:00
Marcin Ślusarz 0337f449a6 radv: use nir_shader_instructions_pass in radv_nir_lower_ycbcr_textures
Changes:
- nir_metadata_preserve(..., nir_metadata_all) is called when pass doesn't
  make progress

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12282>
2022-09-26 11:13:03 +00:00
Mike Blumenkrantz a54d996463 radv: ALWAYS_INLINE radv_is_streamout_enabled()
v2 by Timur Kristóf:
- Use ALWAYS_INLINE instead of just inline.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18807>
2022-09-26 10:51:25 +00:00
Mike Blumenkrantz 051594fb7f radv: ALWAYS_INLINE radv_flush_descriptors
B I G  P E R F

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18807>
2022-09-26 10:51:25 +00:00
Mike Blumenkrantz 876f7f60ac radv: ALWAYS_INLINE radv_after_draw
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18807>
2022-09-26 10:51:25 +00:00
Samuel Pitoiset 7985a9df9a radv: enable NGG culling unconditionally for GPL but disable it dynamically
When compiling the pre-rasterization stages we don't know the primitive
topology, but we still want to enable NGG culling for performance. To
achieve that, NGG culling is enabled unconditionally when the topology
is unknown and disabled dynamically for points or lines.

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/18776>
2022-09-26 09:28:14 +02:00
Samuel Pitoiset e7f6786d59 radv: use the maximum number of vertices per primitives for NGG with GPL
The hw will ignore the extra bits when points/lines are drawn, so this
just works as-is.

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/18776>
2022-09-26 09:28:14 +02:00
Samuel Pitoiset e364670e83 radv: determine the last VGT api stage also for GPL
When compiling the pre-rasterization stages, we need to know this.

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/18776>
2022-09-26 09:28:14 +02:00
Samuel Pitoiset e053f6feb3 radv: remove useless gfx10_ngg_info::enable_vertex_grouping
It's always TRUE and this will simplify future changes.

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/18776>
2022-09-26 09:28:14 +02:00
Samuel Pitoiset efd83e9627 radv: allow to build the pre-rasterization stages in a library
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
Samuel Pitoiset 456543e6d8 radv: determine the last VGT api stage from the active_stages bitfield
With GPL, we can get binaries from libs directly, so this would fail.

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
Samuel Pitoiset c08ba6a76c radv: import the GS copy shader from a library if present
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
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