Dave Airlie
040dc89b95
radv/trace: don't attempt to emit trace on non-graphics/compute queues
...
This will just break on video queues
Fixes: 9477f117f4 ("radv/video: add initial frameworking.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21671 >
2023-03-15 05:08:49 +00:00
Dave Airlie
17d19a3c07
radv/video: fix h265 decoding sizes.
...
Fixes the misrendering/hangs on hevc content.
Fixes: 6c3c242361 ("radv/video: add h265 decode UVD support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21671 >
2023-03-15 05:08:49 +00:00
Dave Airlie
67a606c611
radv/video: fix used for reference flags.
...
These weren't getting programmed properly for interlaced videos
Fixes: 3e2c768aa8 ("radv/vcn: enable dynamic dpb tier 2 for h264/h265 on navi21+")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21671 >
2023-03-15 05:08:49 +00:00
Dave Airlie
30ccf31aae
radv/video: fix h264 frame heights when field images are in use
...
This was breaking MBAFF decoding.
Fixes: 8a29291dbe ("radv/video: add h264 support for uvd")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21671 >
2023-03-15 05:08:49 +00:00
Daniel Schürmann
f6a36190a1
radv/rt: Fix any_hit scratch variables.
...
We have to make sure not to change call_data locations as well.
Fixes: 481f78ab93 ('radv/rt: place any-hit scratch vars after intersection scratch vars')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21876 >
2023-03-14 11:57:02 +00:00
Konstantin Seurer
ecf29228d0
radv/sqtt: Skip dumping pipeline libraries
...
They don't have any shaders which can lead to crashes when dumping
them.
Fixes: 2e04aeb ("radv: capture RT pipelines from the SQTT layer")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21852 >
2023-03-13 20:05:49 +00:00
Samuel Pitoiset
4d03bf0f9d
radv: allow to cache optimized (LTO) pipelines with GPL
...
This should be working now, except PS epilogs that are still not
added to the cache.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21834 >
2023-03-13 13:35:24 +00:00
Samuel Pitoiset
532d63993f
radv: keep track of the retained NIR shaders sha1 for LTO pipelines
...
Otherwise the per pipeline cache key doesn't consider shaders at all
when they are imported from libs.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21834 >
2023-03-13 13:35:24 +00:00
Samuel Pitoiset
fbc7e8f3df
radv: determine if a graphics pipeline needs a noop FS earlier
...
Also introduce a helper.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21834 >
2023-03-13 13:35:24 +00:00
Samuel Pitoiset
86ab8c33ed
radv: fix the error code when the driver fails to create a PS epilog
...
It would have been returned VK_SUCCESS.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21834 >
2023-03-13 13:35:24 +00:00
Daniel Schürmann
481f78ab93
radv/rt: place any-hit scratch vars after intersection scratch vars
...
If both, any-hit and intersection shader, use scratch vars,
it could happen that they end up in the same location and
overwrite each other.
Found by inspection.
Fixes: c3d82a9622 ('radv: Add pass to lower anyhit shader into an intersection shader.')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21863 >
2023-03-13 11:45:26 +00:00
Mike Blumenkrantz
e28b982db8
radv: avoid a huge memset in radv_graphics_pipeline_compile()
...
this has a noticeable impact on pipeline creation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20947 >
2023-03-13 08:11:10 +01:00
Samuel Pitoiset
1c286db14e
radv: zero-initialize radv_shader_info earlier for graphics pipeline
...
This should allow us to remove a big memset when compiling a
graphics pipeline. This is mostly for imported NIR stages which
don't go through radv_pipeline_stage_init().
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20947 >
2023-03-13 08:11:10 +01:00
Samuel Pitoiset
67635bb3e3
radv: zero-initialize radv_shader_args right before declaring them
...
This should allow us to remove a big memset when compiling a
graphics pipeline. This is mostly for imported NIR stages which
don't go through radv_pipeline_stage_init().
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20947 >
2023-03-13 08:11:10 +01:00
Mike Blumenkrantz
c505f892d4
radv: delete radv_graphics_pipeline_compile() asserts
...
validation should catch these by now
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20947 >
2023-03-13 08:11:10 +01:00
Konstantin Seurer
e3aa058317
radv/rt: Properly handle pNext of pipeline library stages
...
Fixes
dEQP-VK.pipeline.pipeline_library.graphics_library.misc.non_graphics.shader_module_info_rt_lib.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21707 >
2023-03-12 13:18:15 +00:00
Konstantin Seurer
0fc8335ccb
radv/rt: Use vk_pipeline_hash_shader_stage for RT stages
...
Fixes
dEQP-VK.pipeline.pipeline_library.graphics_library.misc.non_graphics.shader_module_info_rt.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21707 >
2023-03-12 13:18:15 +00:00
Chia-I Wu
5691b10b0f
radv: set RADEON_FLAG_GTT_WC for external mem on vram
...
We used to set RADEON_FLAG_GTT_WC when wsi_info is set. This changes it
to set the flag for any external mem on vram, extending the logic for
apps using external memory directly.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21803 >
2023-03-09 22:21:09 +00:00
Lionel Landwerlin
9a058f6b4c
radv: use 1ull for alignment computations
...
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21757 >
2023-03-08 23:32:37 +00:00
Konstantin Seurer
d17bf881ea
radv/rt: Fix updating stack_size if the shader uses scratch
...
src_vars contains the stack_size of the shader that is about to get inlined.
Fixes: 7fadee9b70 ('radv/rt: only reserve stack_sizes after rt_case insertion')
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21768 >
2023-03-08 22:17:00 +00:00
Daniel Schürmann
41ae2d0725
radv/rt: use terminate() when returning from raygen shaders
...
Q2RTX stats:
Totals from 7 (0.01% of 134913) affected shaders:
CodeSize: 204712 -> 204744 (+0.02%); split: -0.06%, +0.07%
Instrs: 37526 -> 37522 (-0.01%); split: -0.07%, +0.06%
Latency: 950563 -> 956024 (+0.57%)
InvThroughput: 187915 -> 188977 (+0.57%)
Copies: 4829 -> 4763 (-1.37%)
Branches: 1570 -> 1583 (+0.83%)
PreSGPRs: 407 -> 400 (-1.72%)
PreVGPRs: 614 -> 617 (+0.49%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21736 >
2023-03-08 16:59:41 +00:00
Samuel Pitoiset
842b8f14f4
radv: move device memory related code to radv_device_memory.c
...
radv_device.c is getting too big.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21767 >
2023-03-08 16:21:10 +00:00
Samuel Pitoiset
4316a64e27
radv: move buffer related code to radv_buffer.c
...
radv_device.c is getting too big and this follows the Vulkan common
runtime infrastructure.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21767 >
2023-03-08 16:21:10 +00:00
Samuel Pitoiset
17c5a91028
radv: move event related code to radv_event.c
...
radv_device.c is getting too big.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21767 >
2023-03-08 16:21:10 +00:00
Samuel Pitoiset
4de305cb8a
radv: move sampler related code to radv_sampler.c
...
radv_device.c is getting too big and this follows the Vulkan common
runtime infrastructure.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21767 >
2023-03-08 16:21:10 +00:00
Samuel Pitoiset
7a157b3a4c
radv: move queue related code to radv_queue.c
...
radv_device.c is getting too big and this follows the Vulkan common
runtime infrastructure.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21767 >
2023-03-08 16:21:10 +00:00
Samuel Pitoiset
4e5db63482
radv: move physical device related code to radv_physical_device.c
...
radv_device.c is getting too big and this follows the Vulkan common
runtime infrastructure.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21767 >
2023-03-08 16:21:10 +00:00
Samuel Pitoiset
06fa90e14e
radv: move instance related code to radv_instance.c
...
radv_device.c is getting too big and this follows the Vulkan common
runtime infrastructure.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21767 >
2023-03-08 16:21:10 +00:00
Samuel Pitoiset
e6735409ee
radv: disable DCC with signedness reinterpretation on GFX11
...
All formats should be compatible on GFX11 but for some weird reasons
DCC with signedness reinterpretation doesn't work as expected, like
R8_UINT<->R8_SINT. Note that RadeonSI also has issues with this.
This might be a hardware bug on RDNA3.
This fixes DCC issues with Cyberpunk and A Plague Tale: Requiem.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8020
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8371
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21755 >
2023-03-08 11:53:25 +00:00
Samuel Pitoiset
f88dbb27d4
radv: enable VK_KHR_fragment_shading_rate on GFX11
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20333 >
2023-03-08 10:30:48 +00:00
Samuel Pitoiset
1fb8e0eff2
radv: advertise attachmentFragmentShadingRate on GFX11
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20333 >
2023-03-08 10:30:48 +00:00
Samuel Pitoiset
d1e724b952
radv: do not emit PA_SC_VRS_OVERRIDE_CNTL from the pipeline on GFX11
...
PA_SC_VRS_OVERRIDE_CNTL is emitted when a framebuffer is bound because
it controls the VRS surface enable bit. Though, if a pipeline is bound
after the framebuffer is emitted, it can override the state. Remove it
completely since VRS for flat shading and RADV_FORCE_VRS are disabled.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20333 >
2023-03-08 10:30:48 +00:00
Samuel Pitoiset
c186420b26
radv: add support for VRS attachment on GFX11
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20333 >
2023-03-08 10:30:48 +00:00
Samuel Pitoiset
ce4a1b1c3c
radv: move disabling DCC for VRS rate images in radv_get_surface_flags()
...
On GFX11, the VRS rate image needs a specific swizzle mode and a new
flag will be added here.
gned-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20333 >
2023-03-08 10:30:48 +00:00
Timur Kristóf
a0141c6308
aco, radv: Don't use radv_shader_args in aco.
...
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/21696 >
2023-03-08 04:39:18 +00:00
Timur Kristóf
e9793331db
aco, radv: Move PS epilog and VS prolog args to their info structs.
...
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/21696 >
2023-03-08 04:39:18 +00:00
Timur Kristóf
84a2cea596
aco, radv: Rename aco_*_key to aco_*_info.
...
The naming of aco_*_key didn't make sense because they
were never actually used as cache keys, only radv_*_key
are used as cache keys.
Rename the aco structs to aco_*_info instead.
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/21696 >
2023-03-08 04:39:18 +00:00
Qiang Yu
91e68db0e1
aco, radv: Move is_trap_handler_shader to aco info.
...
v2 by Timur Kristóf:
- Rebase this patch on latest main.
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Reviewed-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/21696 >
2023-03-08 04:39:18 +00:00
Qiang Yu
978220c99a
aco, radv: Add load_grid_size_from_user_sgpr to aco options.
...
v2 by Timur Kristóf:
- Rebase this patch.
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Reviewed-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/21696 >
2023-03-08 04:39:18 +00:00
Timur Kristóf
1583bea9da
radv: Set pending_vmem on dynamic VS input args.
...
These are loaded from VMEM and need a waitcnt before use.
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/21696 >
2023-03-08 04:39:18 +00:00
Daniel Schürmann
26f430d6ce
radv/rt: move radv_pipeline_key from rt_variables to traversal_data
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21764 >
2023-03-07 17:00:50 +00:00
Daniel Schürmann
d87bbee0be
radv: remove unused parameters from radv_compute_pipeline_compile()
...
Also make this function static.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21764 >
2023-03-07 17:00:50 +00:00
Daniel Schürmann
d06aa7b71d
radv/rt: introduce and use radv_rt_pipeline_compile()
...
This is essentially a code-duplication of radv_compute_pipeline_compile()
but will later be more specialized for the needs of RT pipelines.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21764 >
2023-03-07 17:00:50 +00:00
Daniel Schürmann
f1565de4cc
radv: expose radv_pipeline_capture_shaders()
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21764 >
2023-03-07 17:00:50 +00:00
Daniel Schürmann
2fbd495ce7
radv: expose radv_postprocess_nir()
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21764 >
2023-03-07 17:00:50 +00:00
Samuel Pitoiset
c87c34bbba
radv: fix defining RADV_USE_WSI_PLATFORM
...
RADV_USE_WSI_PLATFORM was unused in radv_CreateImage().
Fixes: 2a5d7f4926 ("radv: fix missing implementation of creating images from swapchains")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21763 >
2023-03-07 16:37:17 +00:00
Samuel Pitoiset
7b2086d741
radv: fix border color swizzle for stencil-only format on GFX9+
...
Swizzle of 8-bit stencil format is defined as _x__ but the hw expects
BC_SWIZZLE_XYZW.
Fixes dEQP-VK.pipeline.monolithic.sampler.border_swizzle.*s8_uint*.
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21482 >
2023-03-07 15:10:33 +00:00
Samuel Pitoiset
c119b19f98
radv: fix incorrect stride for primitives generated query with GDS
...
When the query pool uses GDS (for NGG), the stride is 40.
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8412
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21650 >
2023-03-07 10:15:35 +01:00
Samuel Pitoiset
5ec80ab37c
radv: do not add descriptor BOs on update when the global BO list is used
...
It's unnecessary and already checked elsewhere like in
vkCmdBindDescriptorSets(). This improves performance of vkoverhead
test #76 (descriptor_1image) by +18%. It's the same performance as
PRO on my Threadripper 1950X now. This should also slightly improve
texel and buffer descriptors.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20699 >
2023-03-07 07:30:29 +00:00
Daniel Schürmann
7fadee9b70
radv/rt: only reserve stack_sizes after rt_case insertion
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21667 >
2023-03-06 13:58:54 +00:00