Commit Graph

9418 Commits

Author SHA1 Message Date
Georg Lehmann 55735ed728 radv: Lower 8bit isub_sat/usub_sat.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13895>
2022-06-01 17:09:25 +00:00
Georg Lehmann 4e6667ea87 radv: Lower hadd/hradd.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13895>
2022-06-01 17:09:25 +00:00
Georg Lehmann cc3f03b757 radv: Lower mul_32x16.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13895>
2022-06-01 17:09:25 +00:00
Georg Lehmann 83f51212c1 ac/llvm: Implement uclz.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13895>
2022-06-01 17:09:25 +00:00
Georg Lehmann 8671b866bf ac/llvm: Implement usub_sat and isub_sat.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13895>
2022-06-01 17:09:25 +00:00
Georg Lehmann d404f1964c aco: Implement isub_sat.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13895>
2022-06-01 17:09:25 +00:00
Georg Lehmann faa2a89487 aco: Implement usub_sat.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13895>
2022-06-01 17:09:25 +00:00
Georg Lehmann 529ec3d7dc aco: Implement uclz.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13895>
2022-06-01 17:09:25 +00:00
Martin Roukala (né Peres) 60c82453a1 radv/ci: allow polaris10 to retry more times
The Polaris10 in CI has been getting insta-hangs when starting dEQP.
Let's give it 5 attempts to get its act together, as it won't affect
the run time dramatically (max 5 minutes), but will provide more
reliable results for developers.

Tracking of hangs (and many other issues) is done through scrapping the
execution logs, processing them to find these issues, then pushing the
data to influxdb. This allows us to plot the failure rate over time,
and see if the situation is getting better or worse.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16793>
2022-06-01 13:03:02 +00:00
Daniel Schürmann bd151a256e nir/opt_vectorize: add callback for max vectorization width
The callback allows to request different vectorization factors
per instruction depending on e.g. bitsize or opcode.

This patch also removes using the vectorize_vec2_16bit option
from nir_opt_vectorize().

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13080>
2022-06-01 11:41:44 +00:00
Daniel Schürmann 8e41c66639 aco: fix spilling of phis without temp operands
These were spilled unconditionally.

Cc: mesa-stable
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16708>
2022-06-01 09:11:03 +00:00
Samuel Pitoiset b968b99c45 radv: reduce radv_discard_rectangle_info::count to 8-bit
DiscardRectangleCount must be less than or equal to
maxDiscardRectangles which is limited to 4.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16778>
2022-06-01 07:59:27 +00:00
Samuel Pitoiset b62f1cdee8 radv: reduce radv_rasterization_info::polygon_mode to 8-bit
It's large enough.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16778>
2022-06-01 07:59:27 +00:00
Samuel Pitoiset 38b6f2e0ce radv: reduce radv_input_assembly_info::primitive_topology to 8-bit
It's large enough.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16778>
2022-06-01 07:59:27 +00:00
Samuel Pitoiset 2f176f86c2 radv: reduce radv_tessellation_info::patch_control_points to 8-bit
The value must be less than or equal to maxTessellationPatchSize which
is limited to 32 with RADV.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16778>
2022-06-01 07:59:27 +00:00
Samuel Pitoiset c869a5d550 radv: ignore DYNAMIC_STENCIL_OP if stencil test isn't enabled
Like compare/write masks and reference.

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/16783>
2022-06-01 07:34:28 +00:00
Martin Roukala (né Peres) 2f7f4060ee radv/ci: update the list of flakes
This commit has been created by aggregating all the flakes found in the
last 2 weeks, excluding the ones seen once.

v2 (Martin Roukala):
 - stop trying to hardcode all the flakes, use a wildcard

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16777>
2022-06-01 05:26:12 +00:00
Jason Ekstrand 7003ff2e3a radv: Use nir_gather_xfb_info
Instead of gathering XFB info over and over again every time we even
want to know if the shader uses XFB, gather it once when we compile the
shader and refer to the copy in the NIR.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16750>
2022-05-31 23:09:30 +00:00
Jason Ekstrand 3e04432b3a nir: Rename nir_gather_xfb_info to nir_shader_get_xfb_info
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16750>
2022-05-31 23:09:30 +00:00
Rhys Perry 982cc9bcf5 aco/tests: update for GFX11's removal of SDWA
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16595>
2022-05-31 18:07:34 +00:00
Rhys Perry e68e6c75ca aco: use v_perm_b32 to copy 0xff00/0x00ff/0xff/0x00
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16595>
2022-05-31 18:07:34 +00:00
Rhys Perry dae1629778 aco: disable sdwa on gfx11
Instead of SDWA v_mov_b32/v_xor_b32, we can use a combination of
v_add_u16/v_sub_u16 (add/sub swap, similar to xor swap) and v_perm_b32
with a literal.

I don't know yet if GFX11 adds any new instructions which makes this
easier, but this approach should have full functionality.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16595>
2022-05-31 18:07:34 +00:00
Rhys Perry d51dd7527b aco/tests: fix gfx11 variants printed as gfx12
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16595>
2022-05-31 18:07:34 +00:00
Rhys Perry c8bde76a42 aco/tests: disable regalloc.subdword_alloc.reuse_16bit_operands on GFX11
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16595>
2022-05-31 18:07:34 +00:00
Rhys Perry 9b60a67841 aco: clarify a portion of do_pack_2x16
This confused me a bit when I first saw it.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16595>
2022-05-31 18:07:34 +00:00
Rhys Perry 8384189b6c aco: use p_parallelcopy for uniform reduction with zero source
I think v_mov_b32 was only used because a sub-dword p_parallelcopy
couldn't take constants on some gfx levels. That shouldn't be the case
anymore.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16595>
2022-05-31 18:07:34 +00:00
Juan A. Suarez Romero 836ce97f5e ci: bump VK-GL-CTS to 1.3.2.0
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Alejandro Piñeiro <apinheiro@igalia.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16689>
2022-05-31 15:02:08 +00:00
Pierre-Eric Pelloux-Prayer 9776c1cff2 ac/llvm: add use_waterfall_for_divergent_tex_samplers option
GLSL says that indexing in a samplers array should be done with
a dynamically uniform value.

If the app doesn't obey this constraint, it'll get incorrect
results.

But there's one case where the app might be correct and yet
get incorrect result: if 2 consecutive draws are used, with no
state changes in between, the hardware might run them in the
same wave and the app will get incorrect result as-if it was
using non-dynamically uniform index.

To prevent this, this commit takes advantage of the divergence
analysis pass - if the index is marked as divergent, then it will
have the same effect as using ACCESS_NON_UNIFORM in SPIR-V.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16709>
2022-05-31 13:08:07 +00:00
Timur Kristóf 2027f28b30 ac/nir/taskmesh: Use 3 dimensional workgroup ID.
For the sake of consistency, do not rely on a 1-dimensional
workgroup ID anymore.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16721>
2022-05-31 08:24:48 +00:00
Timur Kristóf c6d12a510c ac/nir/taskmesh: Use task shader lowering from common NIR code.
This also implements task_payload atomics for RADV.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16721>
2022-05-31 08:24:48 +00:00
Timur Kristóf c69b771e35 radv, ac/nir: Fix multiview layer export for mesh shaders.
Unfortunately, radv_lower_multiview is not suitable for mesh shaders
because it can't know the mapping between API mesh shader
invocations and output primitives.

Additionally, when lowering view id to layer, it must be created
as a per-primitive PS input.

Fixes: d32656bc65
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16504>
2022-05-31 07:58:29 +00:00
Marek Olšák 05eb9530ca ac/gpu_info: always retile DCC on gfx10 and newer chips
Unaligned DCC doesn't work there.

Fixes: f8cf5ea982 - amd: add support for gfx1036 and gfx1037 chips

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16726>
2022-05-31 05:34:25 +00:00
Vinson Lee b35991dbcb amd: Initialize Gfx11Lib members in constructor.
Fix defects reported by Coverity Scan.

Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member m_numPkrLog2 is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member m_numSaLog2 is not initialized in this constructor nor in any functions that it calls.

Fixes: 4fdf42b3c2 ("amd: import gfx11 addrlib")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16679>
2022-05-31 03:36:53 +00:00
Konstantin Seurer 1727310ea1 radv: Use vk_buffer
Use vk_buffer as a base for radv_buffer and
replace manual handling of VK_WHOLE_SIZE with
vk_buffer_range.

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16764>
2022-05-30 17:43:58 +00:00
Rhys Perry cd2b4c319a aco/ra: fix usage of invalidated iterator
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 58bd9a379e ("aco/ra: fix live-range splits of phi definitions")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16454>
2022-05-30 16:41:32 +00:00
Samuel Pitoiset 2981ee5c7b radv: init states from VkPipelineFragmentShadingRateState at only one place
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16672>
2022-05-30 12:21:14 +00:00
Samuel Pitoiset 8fdc4bf3ba radv: init states from VkPipelineDiscardRectangleState at only one place
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16672>
2022-05-30 12:21:14 +00:00
Samuel Pitoiset b36bee672f radv: init states from VkAttachmentSampleCountInfo at only one place
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16672>
2022-05-30 12:21:14 +00:00
Samuel Pitoiset 23ba9a6249 radv: init states from pColorBlendState at only one place
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16672>
2022-05-30 12:21:14 +00:00
Samuel Pitoiset 1dff2a9204 radv: use AMD values for computing blend related state
This will allow to translate the function and factors earlier.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16672>
2022-05-30 12:21:14 +00:00
Samuel Pitoiset d423d1c683 radv: init states from VkPipelineRenderingCreateInfo at only one place
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16672>
2022-05-30 12:21:14 +00:00
Samuel Pitoiset 6e8e926e1b radv: init states from pDepthStencilState at only one place
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16672>
2022-05-30 12:21:14 +00:00
Samuel Pitoiset 8e9b3fabc5 radv: init states from pMultisampleState at only one place
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16672>
2022-05-30 12:21:14 +00:00
Samuel Pitoiset 1f8db57023 radv: copy viewport/scissor when initializing radv_viewport_info
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16672>
2022-05-30 12:21:14 +00:00
Tatsuyuki Ishi 250b6eb908 radv/ci: skip image.sample_texture.*_compressed_format*
These tests are flaky due to missing barriers, exposed by 211db6d333
("radv: Fix redundant subpass barriers due to erroneous comparison").

Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16762>
2022-05-30 09:18:38 +00:00
Tatsuyuki Ishi 6eb5a110dd radv/ci: Move transient_attachment_bit from fail to skip list
These tests are flaky and should not be treated as expected-fail.

This also removes the duplicates from the fail list which was breaking CTS
runner.

Fixes: cd14431b8c ("radv/ci: skip dEQP-VK.fragment_operations.transient_attachment_bit")
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16762>
2022-05-30 09:18:38 +00:00
Konstantin Seurer 8aecb3ed58 radv: Ignore transformOffset if transformData is 0
There is also a hypothetical scenario where
transformData is 0 and transformOffset is not 0
and we end up reading from transformOffset because
transform_addr is not 0.
VkAccelerationStructureBuildRangeInfoKHR spec:

If VkAccelerationStructureGeometryTrianglesDataKHR::transformData is not NULL, a single VkTransformMatrixKHR structure is consumed from VkAccelerationStructureGeometryTrianglesDataKHR::transformData, at an offset of transformOffset. This matrix describes a transformation from the space in which the vertices for all triangles in this geometry are described to the space in which the acceleration structure is defined.

Which I think means, that we should ignore
transformOffset if transformData is NULL.

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16719>
2022-05-30 00:00:53 +00:00
Konstantin Seurer 9be00573c4 radv: Fix handling of primitiveOffset
VkAccelerationStructureBuildRangeInfoKHR spec:
If the geometry uses indices, primitiveCount × 3 indices are consumed from VkAccelerationStructureGeometryTrianglesDataKHR::indexData, starting at an offset of primitiveOffset. The value of firstVertex is added to the index values before fetching vertices.

If the geometry does not use indices, primitiveCount × 3 vertices are consumed from VkAccelerationStructureGeometryTrianglesDataKHR::vertexData, starting at an offset of primitiveOffset + VkAccelerationStructureGeometryTrianglesDataKHR::vertexStride × firstVertex.

Meaning: We always add firstVertex * vertexStride
to the vertex address and add primitiveOffset
either to the vertex address or the index address,
depending on wether indices are used.

Also add missing handling with instances.

Fixes: 0dad88b ("radv: Implement device-side BVH building.")
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16719>
2022-05-30 00:00:53 +00:00
Tatsuyuki Ishi cd14431b8c radv/ci: skip dEQP-VK.fragment_operations.transient_attachment_bit
Until the CTS bug is fixed.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16663>
2022-05-27 09:43:04 +00:00
Tatsuyuki Ishi 211db6d333 radv: Fix redundant subpass barriers due to erroneous comparison
We accidentally compared the stencil layout to the color/depth layout.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16663>
2022-05-27 09:43:04 +00:00
Timur Kristóf 77a67f1115 radv: Add mesh and task stage names to pipeline executable properties.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16712>
2022-05-27 08:46:29 +00:00
Samuel Pitoiset 1046c2a1c0 radv: fix writing buffer markers with non-zero memory offset
Found by insepction.

Cc: mesa-stable
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/16698>
2022-05-26 08:23:52 +00:00
Samuel Pitoiset 6f854ac2f2 radv: use pipeline->slab_bo in more places
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16687>
2022-05-26 08:03:33 +00:00
Samuel Pitoiset 0393cba27b radv: disable attachementFragmentShadingRate on GFX11
The VRS image no longer uses HTILE like on GFX10.3 and I don't know
yet how to program it.

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/16557>
2022-05-26 07:43:38 +00:00
Samuel Pitoiset 4ffc7a50cb radv: disable VK_AMD_shader_fragment_mask on GFX11
No FMASK on GFX11 which means I don't think we can expose this ext.

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/16557>
2022-05-26 07:43:38 +00:00
Samuel Pitoiset 779e09639b radv: configure DB_Z_INFO.NUM_SAMPLES correctly on GFX11
It affects VRS and occlusion queries.

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/16557>
2022-05-26 07:43:38 +00:00
Samuel Pitoiset 00c649339b radv: fix VK_BLEND_FACTOR_CONSTANT_COLOR translation on GFX11
This one was missing.

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/16557>
2022-05-26 07:43:38 +00:00
Samuel Pitoiset 97dc28b177 radv: fix configuring COLOR_INVALID on GFX11
It's a different bitfield but this one was missing.

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/16557>
2022-05-26 07:43:38 +00:00
Samuel Pitoiset aa439d7f46 radv: report adjusted LDS size for fragment shaders on GFX11
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/16557>
2022-05-26 07:43:38 +00:00
Samuel Pitoiset 2fd5aa79b2 radv: use the fragment resolve path by default on GFX11
GFX11 doesn't support CB_RESOLVE which means it doesn't support the
hardware resolve path. If necessary (for arrays or integer formats)
the driver will select the compute path.

No CTS regressions by forcing the fragment resolve path on GFX10.3

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/16557>
2022-05-26 07:43:38 +00:00
Samuel Pitoiset f7b1ad7c06 radv: update VRS rates on GFX11
GFX11 uses enum instead of 2-bit integer numbers.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
iReviewed-by: Timur Kristóf <timur.kristof@gmail.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16557>
2022-05-26 07:43:38 +00:00
Samuel Pitoiset e210ffb4d0 radv: update framebuffer registers on GFX11
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/16557>
2022-05-26 07:43:38 +00:00
Samuel Pitoiset d88c859b4e radv: do not emit more non-existent registers on GFX11
Found these by diffing the list of registers between GFX10_3 and GFX11.

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/16557>
2022-05-26 07:43:38 +00:00
Samuel Pitoiset c5d8ef97fa radv: rename VERT_GRP_SIZE to VERTS_PER_SUBGRP on GFX11
Same bitfield but it has been renamed.

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/16557>
2022-05-26 07:43:38 +00:00
Timur Kristóf 55466ca506 radv: Disable predication for supass clear and image clears.
According to the Vulkan spec 21.4 "Conditional Rendering",
only clearing attachments with vkCmdClearAttachments is subject to
conditional rendering.

Subpass clear and vkCmdClearColorImage / vkCmdClearDepthStencilImage
should always be executed even if it happens in a
conditional rendering block.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16654>
2022-05-25 12:59:37 +00:00
Timur Kristóf 10459522eb radv: Remove trailing whitespace.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16702>
2022-05-25 12:29:30 +00:00
Timur Kristóf abcd0aa9e5 aco: Remove trailing whitespace.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16702>
2022-05-25 12:29:30 +00:00
Timur Kristóf 5e0615c512 ac: Remove trailing white space.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16702>
2022-05-25 12:29:30 +00:00
Pierre-Eric Pelloux-Prayer 7e2874dc93 ac: reset LLVM command line parser
In some scenario ac_init_llvm_target may be called twice,
but the LLVM library won't have been unloaded between
the 2 calls, leading to a LLVM warning being printed.

Example pseudo-code to trigger this for radeonsi:
   gbm_create_device();
   eglInitialize();
   eglTerminate();
   gbm_device_destroy();
   gbm_create_device();
   eglInitialize();
   eglTerminate();
   gbm_device_destroy();

To avoid the warning message from LLVM, clear the command line
parser state before calling LLVMParseCommandLineOptions.

This might fix https://gitlab.freedesktop.org/mesa/mesa/-/issues/5960

This is done only on LLVM 12+ because it seems to break some apps
on LLVM 11 (there has been some work post LLVM 11 release to refactor
CommandLine.cpp, see 42f588f39c5c and the following commits).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16587>
2022-05-25 12:03:34 +00:00
Pierre-Eric Pelloux-Prayer 2172ddf2bf ac: export LLVM c++ ResetCommandLineParser method
This method isn't part of the C API but we can still use it and
avoid getting error messages from the command line parser:

   mesa: for the [...]: may only occur zero or one times

We could call it at the beginning of ac_init_llvm_target but
this may hide some real bugs so let drivers call it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16587>
2022-05-25 12:03:34 +00:00
Samuel Pitoiset 4642e268e2 radv: move active_stages to radv_graphics_pipeline
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/16688>
2022-05-25 11:39:20 +00:00
Samuel Pitoiset 2e53c69d88 radv: move streamout_shader to radv_graphics_pipeline
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/16688>
2022-05-25 11:39:20 +00:00
Samuel Pitoiset 98f3727d56 radv: unify radv_pipeline_has_XXX() helpers
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/16688>
2022-05-25 11:39:20 +00:00
Samuel Pitoiset 6fe6570e76 radv: rename radv_cmd_state::pipeline to graphics_pipeline
To be consistent with compute pipelines.

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/16688>
2022-05-25 11:39:20 +00:00
Samuel Pitoiset 35af86af8c radv: move HS info and task_num_entries to the physical device
They are not logical device properties.

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/16688>
2022-05-25 11:39:20 +00:00
Timur Kristóf 85a4c5b351 radv: Implement conditional rendering for async compute queue.
MEC (the compute queue firmware) does not support real
predication, so we have to emulate that using COND_EXEC
packets before each dispatch.

Additionally, COND_EXEC doesn't have an inverted mode, so
in order to support inverted mode conditional rendering, we
allocate a new piece of memory in which we invert the condition.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6533
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16653>
2022-05-25 11:18:51 +00:00
Yiwei Zhang 229538d6da radv: remove VkPhysicalDeviceMemoryProperties2 workaround
This reverts 03888bf09c

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16694>
2022-05-24 23:35:28 +00:00
Timur Kristóf 743f4b995d radv: Clarify emitting graphics shader pointers.
Rename radv_emit_global_shader_pointers to radv_emit_graphics_shader_pointers
and don't call it on compute queues. Note that the registers
that this function sets, are not available on the async compute
queue anyway.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16395>
2022-05-24 15:47:13 +00:00
Timur Kristóf 84089d8c8d radv: Refactor queue state to separate structure.
In the future we'll need a 1:N mapping between radv_queue objects and
HW queues, meaning that 1 radv_queue object will need to be able to
submit to multiple queues. To do that, we'll must also maintain a different
state for each HW queue.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16395>
2022-05-24 15:47:13 +00:00
Timur Kristóf 5d3c1f4b41 radv: Pass radv_device pointer to some functions.
This will be needed for a future refactor of these functions
where we won't pass radv_queue to them anymore.
Also remove the radv_queue pointer from functions which
don't actually need it.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16395>
2022-05-24 15:47:13 +00:00
Timur Kristóf 1f2bbfdfca radv: Use a ws variable during preamble creation.
This is to prevent excessive code repetition, and hopefully make the
code a bit easier to read.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16395>
2022-05-24 15:47:13 +00:00
Timur Kristóf 37abbaee36 radv: Introduce ring info structure for queues, refactor preamble generation.
Put the shader ring information into a separate structure.
Also clean up how this information is used when generating the preambles
and add a few comments that explain how it works.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16395>
2022-05-24 15:47:13 +00:00
Timur Kristóf 7761b4d89e aco: Fix scratch with task shaders.
Task shaders work like compute shaders, their scratch pointer
is currently located at the first two user SGPRs.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16692>
2022-05-24 12:33:49 +00:00
Samuel Pitoiset 59d246e1c5 radv/ci: fix fails list for NAVI21
Probably a wrong rebase. Also add Vangogh.

Fixes: 72910242a6 ("radv/ci: Skip slow/crashing ray tracing tests")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16690>
2022-05-24 13:14:57 +02:00
Konstantin Seurer b2e9e0f2f7 radv: Add fail/flake lists for navi22
This is a copy of the sienna_cichlid ones and
only useful for running vk-cts-image on navi22
cards.

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16007>
2022-05-24 08:32:43 +00:00
Konstantin Seurer 5f5882ef08 radv: Enable ray queries by default
Ray queries and acceleration structure builds
are quite stable now and so we can enable those
features for CI and more feedback and bug reports.

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16007>
2022-05-24 08:32:43 +00:00
Konstantin Seurer 72910242a6 radv/ci: Skip slow/crashing ray tracing tests
In preparation to enable ray queries by default.
This is also useful for testing ray tracing
pipeline changes with vk-cts-image.

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16007>
2022-05-24 08:32:43 +00:00
Konstantin Seurer d5023027a4 radv: Replace nir_vector_extract with nir_channel
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16650>
2022-05-24 06:44:27 +00:00
Konstantin Seurer 182f1d44a0 radv: Add and use radv_bvh_node_type
We use magic numbers for node types in many
places of the RADV code. This commit adds an enum
for the node types and uses it to replace magic
numbers in the acceleration structure build code.

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16650>
2022-05-24 06:44:27 +00:00
Rhys Perry 4513cb8d41 aco: only add/subtract low bits of program addresses
fossil-db (Sienna Cichlid):
Totals from 4007 (2.47% of 162293) affected shaders:
Instrs: 3733239 -> 3728018 (-0.14%)
CodeSize: 20770340 -> 20749456 (-0.10%)
Latency: 46883958 -> 46872764 (-0.02%); split: -0.02%, +0.00%
InvThroughput: 10550392 -> 10548698 (-0.02%); split: -0.02%, +0.00%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16460>
2022-05-23 11:52:54 +00:00
Rhys Perry 69d1f4186a aco/tests: add test for p_constaddr with a non-zero offset
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16460>
2022-05-23 11:52:54 +00:00
Rhys Perry bd8f8dda8c aco: fix p_constaddr with a non-zero offset
Seems this broke a while ago and we never noticed.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 0af7ff49fd ("aco: lower p_constaddr into separate instructions earlier")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16460>
2022-05-23 11:52:54 +00:00
Samuel Pitoiset da49fee80f radv: introduce radv_graphics_pipeline_info and split existing info structs
I should have introduced radv_graphics_pipeline_info earlier. More
states will be added later.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16643>
2022-05-23 10:33:08 +00:00
Samuel Pitoiset 23be0aad9c radv: split radv_pipeline into radv_{graphics,compute,library}pipeline
Instead of using a union in radv_pipeline, this introduces new
structures for graphics, compute and library pipelines which inherit
from radv_pipeline. This will ease graphics pipeline libary implem.

There is still no radv_raytracing_pipeline because RADV actually
uses a compute pipeline for everything but it could be introduced
later when necessary.

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/16603>
2022-05-23 07:32:56 +00:00
Samuel Pitoiset fc3717df0c radv: cleanup using device/physical_device during pipeline creation
This removes a TON of pipeline->device occurences which were a mess.

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/16603>
2022-05-23 07:32:56 +00:00
Samuel Pitoiset 7fb4849314 radv: move gs_table_depth to the physical_device
This is not a logical device property.

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/16603>
2022-05-23 07:32:56 +00:00
Samuel Pitoiset 6c44e25078 radv: remove unused radv_get_conservative_raster_mode() helper
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/16603>
2022-05-23 07:32:56 +00:00
Samuel Pitoiset a1d3b80c5d radv: remove couple of useless pCreateInfo pointers in the emit path
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/16603>
2022-05-23 07:32:56 +00:00
Samuel Pitoiset f75b80fd80 radv: rename radv_pipeline_generate_XXX() to radv_pipeline_emit_XXX()
Shorter and clearer.

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/16603>
2022-05-23 07:32:56 +00:00
Samuel Pitoiset 3825c7202b radv: constify radv_pipeline in more radv_pipeline_generate_XXX() helpers
These functions should only emit registers and not change the pipeline.

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/16603>
2022-05-23 07:32:56 +00:00
Samuel Pitoiset 95d4e5435b radv: export implicit primitive ID in NIR for legacy VS or TES
It's implicit for VS or TES, while it's required for GS or MS.

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/16404>
2022-05-20 14:55:05 +00:00
Samuel Pitoiset d711e9813c radv: determine if shaders use NGG before linking
This would be needed by some NIR pass during linking. Given that NGG
settings are currently dispatched in many places, I don't think this
should hurt but it should be refactored at some point.

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/16404>
2022-05-20 14:55:05 +00:00
Hyunjun Ko 5b2756ec2c radv: fix assertion for the count of xfb output
It's an counter, not an index.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16623>
2022-05-20 06:43:11 +00:00
Hans-Kristian Arntzen 04459c8287 radv: Fix RTPSO hashing of pGroups.
There are padding bytes here. Only hash relevant members.

Fixes: ca2d96db51 ("radv: Add caching for RT pipelines.")
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16582>
2022-05-20 07:43:58 +02:00
Jason Ekstrand a299e5efbb radv: Use the common CmdBindVertexBuffers wrapper
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16611>
2022-05-20 02:12:37 +00:00
Jason Ekstrand 50a00f889c radv: Add a sqtt entrypoint for CmdBindVertexBuffers2
Fixes: b262284300 ("radv: add support for dynamic vertex input binding stride")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16611>
2022-05-20 02:12:37 +00:00
Rhys Perry 1e710f7a2c radv: validate shaders after linking passes
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5244
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12448>
2022-05-19 13:37:20 +00:00
Rhys Perry 75c80be484 radv: add missing NIR_PASS() and switch from NIR_PASS_V()
Unlike NIR_PASS_V(), NIR_PASS() can skip printing the shader when
NIR_DEBUG=print.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5244
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12448>
2022-05-19 13:37:20 +00:00
Rhys Perry d98b7817fc radv: call nir_metadata_preserve in various lowering passes
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12448>
2022-05-19 13:37:20 +00:00
Marek Olšák 2443054932 amd: rename fishes to Navi21, Navi22, Navi23, Navi24, and Rembrandt
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16604>
2022-05-19 11:55:50 +00:00
Samuel Pitoiset 0c8a07f25d aco: remove unnecessary intrinsics that are lowered at the ABI level
Fixes: f553076eaf ("aco: Remove now-superfluous intrinsics.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16577>
2022-05-19 06:49:07 +00:00
Samuel Pitoiset 8396df5ad9 radv: init states from pRasterizationState at only one place
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16552>
2022-05-18 13:53:35 +00:00
Samuel Pitoiset 7f08fe0b9f radv: init states from pViewportState at only one place
Except the viewport/scissor arrays to avoid useless array copies.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16552>
2022-05-18 13:53:35 +00:00
Samuel Pitoiset f13b30fe62 radv: init states from pTessellationState at only one place
It's part of the pre-rasterization state of graphics pipeline libs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16552>
2022-05-18 13:53:35 +00:00
Samuel Pitoiset b014d983bb radv: add new pipeline helpers for NIR->ASM compilation
It walks backwards to compile, looks cleaner to me.

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/16553>
2022-05-18 07:19:20 +00:00
Samuel Pitoiset 8e1085c19a radv: do not try to dump the NIR of the trap handler shader
There is no NIR at all.

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/16553>
2022-05-18 07:19:20 +00:00
Samuel Pitoiset 9207d791af radv: rename shader compile functions to spirv_to_nir/nir_to_asm
For better clarity.

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/16553>
2022-05-18 07:19:20 +00:00
Martin Roukala (né Peres) 5fc99a1536 radv/ci: enable the experimental support for mesh shaders
The experimental support has been merged for months already, but has
been left unexercised in CI even though dEQP has a mesh_shader.nv
category.

This commit enables the experimental support, which should bring
additional testing \o/.

Suggested-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16550>
2022-05-18 06:48:05 +00:00
Jason Ekstrand d9048e31a0 radv: Use vk_image_view as the base for radv_image_view
I've left the extent field because, even though it looks like it should
be roughly equivalent, it's weirdly different on different hardware and
I didn't want to mess with it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16376>
2022-05-17 18:14:55 +00:00
Jason Ekstrand c56f3dcbaa radv: Use vk_image as the base for radv_image
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16376>
2022-05-17 18:14:55 +00:00
Jason Ekstrand 992690e483 radv: Only use PLANE_0 in meta when actually needed
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16376>
2022-05-17 18:14:55 +00:00
Samuel Pitoiset 8510d5daa3 aco: use ac_is_llvm_processor_supported() for checking LLVM asm support
It seems more universal but it's needed to create a temporary TM.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16494>
2022-05-17 17:14:21 +00:00
Samuel Pitoiset 07eba9a15a radv: do not lower loading TESS/ESGS rings using the ABI for LLVM
LLVM uses an implicit argument for the ring offsets and this lowering
was just broken.

This fixes tessellation and geometry on all generations with LLVM.

Fixes: 896a55f47d ("radv: Lower ABI in NIR for tess/ESGS/NGG shader arguments.")
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/16530>
2022-05-17 16:45:02 +00:00
Konstantin Seurer b9f43059fc Revert "radv: Make fill_buffer_shader non-static"
We do not need this any longer since
radv_acceleration_structure.c uses
radv_fill_buffer now instead.

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16517>
2022-05-17 13:10:07 +00:00
Konstantin Seurer 405b2bb79c radv: Use radv_fill_buffer for accel struct builds
It turns out, that the fuchsia sort may actually
perform clears with size < 16 which hits an assert
in radv_fill_buffer_shader. This fixes random
crashes in Control.

Fixes: be57b08 ("radv: Build accaleration structures using LBVH")
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16517>
2022-05-17 13:10:07 +00:00
Konstantin Seurer 183c15dbb2 radv: Allow radv_fill_buffer to work with VAs only
Makes the bo parameter optional which is useful
for the clears performed by acceleration structure
build commands.

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16517>
2022-05-17 13:10:07 +00:00
Marek Olšák fcaa9f5096 radeonsi/gfx11: fix alpha-to-coverage with stencil or samplemask export
We can't use UINT16_ABGR for the alpha channel. Always use 32_ABGR.

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16509>
2022-05-17 10:27:04 +00:00
Marek Olšák ba02ed91a6 ac/gfx11: fix the scratch buffer
We didn't use the value that we computed.

Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16509>
2022-05-17 10:27:04 +00:00
Marek Olšák 0eb48fa4e9 ac/gpu_info: silence a valgrind warning due to amdgpu_query_hw_ip_info
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16509>
2022-05-17 10:27:04 +00:00
Samuel Pitoiset 9b4c346029 radv: more register changes on GFX11
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/16419>
2022-05-17 10:08:17 +00:00
Samuel Pitoiset 7f31917119 radv: limit CP DMA to max 32KB sizes on GFX11
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/16419>
2022-05-17 10:08:17 +00:00
Samuel Pitoiset 533df65e85 radv: apply a workaround for CB perf counters on GFX11
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/16419>
2022-05-17 10:08:17 +00:00
Bas Nieuwenhuizen 0ce2401144 radv: update the initialization of SGPR0/1 registers for HS and GS on GFX11
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/16419>
2022-05-17 10:08:17 +00:00
Samuel Pitoiset 31ec1ecc12 radv: update VRS registers on GFX11
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/16419>
2022-05-17 10:08:17 +00:00
Samuel Pitoiset ab21ce46a6 radv: update TF_RING_size to a per-SE size on GFX11
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/16419>
2022-05-17 10:08:17 +00:00
Samuel Pitoiset 995ab9a505 radv: do not emit FLUSH_AND_INV_DB_META on GFX11
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/16419>
2022-05-17 10:08:17 +00:00
Samuel Pitoiset 2e3aec1633 radv: do not emit non-existent CP_COHER_START_DELAY on GFX11
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/16419>
2022-05-17 10:08:17 +00:00
Samuel Pitoiset dcb324eb53 radv: configure DB_RENDER_CONTROL on GFX11
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/16419>
2022-05-17 10:08:17 +00:00
Samuel Pitoiset 66882363b3 radv: use PIXEL_PIPE_STATE_DUMP event instead of ZPASS_DONE on GFX11
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/16419>
2022-05-17 10:08:17 +00:00
Samuel Pitoiset 6026cf43b3 radv: update image descriptor registers on GFX11
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/16419>
2022-05-17 10:08:17 +00:00
Samuel Pitoiset ef59e5b193 radv: update buffer descriptor registers on GFX11
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/16419>
2022-05-17 10:08:17 +00:00
Samuel Pitoiset ebca4f2b3d radv: update sampler registers on GFX11
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/16419>
2022-05-17 10:08:17 +00:00
Bas Nieuwenhuizen 670ee6023d radv: Disable transform feedback for gfx11.
Until we implement it.

Reviewed-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/16419>
2022-05-17 10:08:17 +00:00
Bas Nieuwenhuizen c7f5da6829 radv: Add gfx11 DCC fast clear support.
Reviewed-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/16419>
2022-05-17 10:08:17 +00:00
Bas Nieuwenhuizen cc2b3f3924 radv: Adjust for new SWIZZLE_ENABLE.
Reviewed-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/16419>
2022-05-17 10:08:17 +00:00
Bas Nieuwenhuizen e96a35e6db radv: gfx11 register changes.
Reviewed-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/16419>
2022-05-17 10:08:17 +00:00
Bas Nieuwenhuizen 9c391fe47e radv: Mark all formats as DCC compatible with each other on gfx11.
Reviewed-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/16419>
2022-05-17 10:08:17 +00:00
Bas Nieuwenhuizen eb117a4711 radv: always enable NGG on GFX11
The legacy path is removed.

Reviewed-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/16419>
2022-05-17 10:08:17 +00:00
Samuel Pitoiset 278e533ec9 radv: update scratch buffer registers on GFX11
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/16419>
2022-05-17 10:08:17 +00:00
Samuel Pitoiset 6e4d9729cc radv: use the new format table on GFX11
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/16419>
2022-05-17 10:08:17 +00:00