Commit graph

205225 commits

Author SHA1 Message Date
Samuel Pitoiset
4b76d04f7f radv: ignore conditional rendering with vkCmdTraceRays*
CmdTraceRays is neither a dispatch or a draw command which means it
shouldn't be affected by conditional rendering.

Fixes recent VKCTS coverage.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34868>
2025-05-08 19:08:10 +00:00
Robert Mader
7b68e1da91 llvmpipe: Enable support for multiplanar formats
Stop supporting formats that would cause us to use
lp_build_fetch_subsampled_rgba_aos() for YCbCr->RGB conversion
and always go through the slower emulated paths using
mulitple sampler views.

This not only allows dmabuf imports with EXT_image_dma_buf_import
to succeed for common YCbCr formats, but also ensures hints like
EGL_YUV_COLOR_SPACE_HINT_EXT and EGL_SAMPLE_RANGE_HINT_EXT are
honored.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34775>
2025-05-08 18:47:17 +00:00
Robert Mader
bf126d08ae llvmpipe: Preparations for multiplanar formats
Use the appropriate util functions like many other drivers.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34775>
2025-05-08 18:47:17 +00:00
Robert Mader
4051d4ef59 llvmpipe: Fix dmabuf import paths for DRM_FORMAT_YUYV variants
Right now llvmpipe only successfully supports single-plane formats,
limiting the number of supported YCbCr formats to a relatively small
number.

The implicit support for R8G8_R8B8 style subsampled RGB formats
causes the most common ones, YUYV and its variants, to chain up
to to lp_build_fetch_subsampled_rgba_aos() when importing (u)dmabufs
with EXT_image_dma_buf_import.
This code path currently has at least the following issues:
1. It doesn't support the YVYU/PIPE_FORMAT_R8B8_R8G8_UNORM and
    VYUY/PIPE_FORMAT_B8R8_G8R8_UNORM, resulting in asserts/crashes.
2. The supported cases, YUYV and UYVY, end up with sub-optimal results
    as they always return BT.601/narrow results, ignoring
    EGL_YUV_COLOR_SPACE_HINT_EXT and EGL_SAMPLE_RANGE_HINT_EXT.

Stopping advertising support for those formats, as well as native support
for PIPE_FORMAT_YUYV and PIPE_FORMAT_UYVY, results in all four variants
taking fallback paths which happen to be much better supported.

An additional effect is that YUYV and UYVY are correctly advertised as
external only.

Cc: mesa-stable
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34775>
2025-05-08 18:47:17 +00:00
Gurchetan Singh
03a35024a6 gfxstream: make sure by default descriptor is negative
Otherwise, another valid fd may be closed.

Cc: mesa-stable
Reviewed-by: Aaron Ruby <aruby@qnx.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34885>
2025-05-08 18:29:03 +00:00
Samuel Pitoiset
b7d2cdd2b4 radv: ignore radv_disable_dcc_stores on GFX12
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
It's not necessary because DCC is completely transparent to the
userspace driver. Also it's causing issues with scanout.

This fixes rendering issues with scanout in Indiana Jones.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12924
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34859>
2025-05-08 17:17:28 +02:00
Sil Vilerino
154c3934d6 d3d12: Add missing offset to encode slice metadata in the get_feedback function
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 10:42:17 -04:00
Sil Vilerino
245be20fa1 d3d12: Add fallback to ID3D12VideoEncodeCommandList2 if ID3D12VideoEncodeCommandList4 not available in underlying OS
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
e30a534f29 d3d12: Add missing D3D12_VIDEO_USE_NEW_ENCODECMDLIST4_INTERFACE guards
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
be33edbdf1 d3d12: Set HEVC slice mode state before calling d3d12_video_encoder_negotiate_requested_features_and_d3d12_driver_caps
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Pohsiang (John) Hsu
2939604248 d3d12: fix configuration flag for D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_DISABLE_LOOP_FILTER_ACROSS_SLICES
Signed-off-by: Pohsiang Hsu <pohhsu@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
2ff18b2757 d3d12: Remove more nir dependencies when with_gallium_d3d12_graphics disabled
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
27829d7ffe d3d12: Do not build microsoft/compiler when graphics, gl or vk disabled
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
5051140c32 d3d12: Report pipe_enc_cap_dirty_info.supports_require_sao/loop_filter_disabled
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
64f1a365e5 pipe: Add pipe_enc_cap_dirty_info.supports_require_sao/loop_filter_disabled
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
922f8a7d07 d3d12: Implement H264/HEVC PIPE_VIDEO_SLICE_MODE_AUTO for gallium driver auto-partition
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
0ee4b77ec9 pipe: Add PIPE_VIDEO_SLICE_MODE_AUTO for gallium driver auto-partition
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
7dfc7e1b1d d3d12: Reports pipe_enc_cap_dirty_info.supports_require_auto_slice_mode
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
ffe9cec740 pipe: Add pipe_enc_cap_dirty_info.supports_require_auto_slice_mode
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
1c31fc3091 d3d12: Implement GPU Input Motion vectors
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
143087dadd d3d12: Make d3d12_video_encode_support_caps in/out param capEncoderSupportData1 pointer members an external allocation to outlive the stack of the method call
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
7312db4827 pipe: Add support for (GPU Input) motion maps
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
2c193547ca d3d12: Implement PIPE_VIDEO_CAP_ENC_QP_MAPS and CPU/GPU input QPMaps
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
5810c39978 pipe: Add (GPU input) PIPE_VIDEO_CAP_ENC_QP_MAPS and input_gpu_qpmap GPU input support
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
5cb4979875 d3d12: Add GPU input dirty rect support
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
86d521db4f pipe: Add (GPU input) PIPE_VIDEO_CAP_ENC_DIRTY_MAPS and pipe_enc_move_rects GPU input support
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
064e07b26a d3d12: deduplicate code with helpers: get_dirty_rects_support, get_move_rects_support, get_gpu_output_stats_support, get_sliced_encode_support
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
19cbb13255 d3d12: Support slice NAL prefixes on slice notifications mode
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
df995c9631 d3d12: Implement multi-slice notifications
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
bedd423893 d3d12: Prepare d3d12_video_encoder_encode_bitstream for sliced encoding. Checked working with single slice buffer at this point
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
555a13661a pipe: Add sliced encoding API and caps
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
c5f5ee41c8 d3d12: Add support for QP, SATD and RC bits output stats
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
25726509ff pipe: Add PIPE_VIDEO_CAP_ENC_GPU_STATS_* and pipe_resource textures in H264/H265 encode pic params
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
56bbfb9598 d3d12: Add support for pipe_enc_move_rects for H264/H265 encode
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
7c490bb860 pipe: Add PIPE_VIDEO_CAP_ENC_MOVE_RECTS and pipe_enc_move_rects for H264/H265 encode
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
6d81bc0cdd d3d12: Add support for pipe_enc_dirty_rects for H264/H265 encode
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
700c6fff58 pipe: Add PIPE_VIDEO_CAP_ENC_DIRTY_RECTS and pipe_enc_dirty_rects for H264/H265 encode
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
4e632ed891 d3d12: Use D3D12_FEATURE_VIDEO_ENCODER_SUPPORT2 when D3D12_VIDEO_USE_NEW_ENCODECMDLIST4_INTERFACE is set
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
731bc92e87 d3d12: Add #if guards for using new ID3D12VideoEncodeCommandList4
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
2465dcf4cc d3d12: Fix reporting for PIPE_VIDEO_CAP_ENC_MAX_DPB_CAPACITY
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
0577c77a4c d3d12: Report pipe_enc_cap_roi.log2_roi_min_block_pixel_size
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Sil Vilerino
17cdbc5729 pipe: Add pipe_enc_cap_roi.log2_roi_min_block_pixel_size
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Pohsiang (John) Hsu
295ecc8d96 d3d12: enable D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_ENABLE_LONG_TERM_REFERENCES when max_num_ltr_frames > 0
Signed-off-by: Pohsiang Hsu <pohhsu@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Pohsiang (John) Hsu
ebd82f39f8 d3d12: Add support for retreiving PIPE_VIDEO_CAP_ENC_MAX_DPB_CAPACITY for H264/H265 encode
Signed-off-by: Pohsiang Hsu <pohhsu@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:22 +00:00
Pohsiang (John) Hsu
7557ce41be pipe: add PIPE_VIDEO_CAP_ENC_MAX_DPB_CAPACITY for H264/H265 encode
Signed-off-by: Pohsiang Hsu <pohhsu@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:21 +00:00
Pohsiang (John) Hsu
ea7ef6d575 d3d12: Add support for retrieving PIPE_VIDEO_CAP_ENC_MAX_LONG_TERM_REFERENCES_PER_FRAME for H264/H265 encode
Signed-off-by: Pohsiang Hsu <pohhsu@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:21 +00:00
Pohsiang (John) Hsu
743f0a8df1 pipe: add PIPE_VIDEO_CAP_ENC_MAX_LONG_TERM_REFERENCES_PER_FRAME for H264/H265 encode
Signed-off-by: Pohsiang Hsu <pohhsu@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
2025-05-08 14:17:21 +00:00
Rhys Perry
2704a30df0 radv: perform nir_opt_access before the first radv_optimize_nir
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Two lowered loads might not be CSE'd after nir_lower_explicit_io if one of
them is shrinked. This doesn't happen for deref loads, but it needs the
CAN_REORDER flag first.

fossil-db (gfx1201):
Totals from 556 (0.70% of 79377) affected shaders:
MaxWaves: 14936 -> 14940 (+0.03%); split: +0.05%, -0.03%
Instrs: 2140334 -> 2140942 (+0.03%); split: -0.07%, +0.10%
CodeSize: 11137948 -> 11145416 (+0.07%); split: -0.07%, +0.13%
SpillSGPRs: 2385 -> 2527 (+5.95%); split: -0.34%, +6.29%
Latency: 12310570 -> 12305011 (-0.05%); split: -0.08%, +0.04%
InvThroughput: 2136142 -> 2135516 (-0.03%); split: -0.06%, +0.03%
VClause: 47419 -> 47420 (+0.00%); split: -0.01%, +0.01%
SClause: 58423 -> 58290 (-0.23%); split: -0.36%, +0.14%
Copies: 160626 -> 161321 (+0.43%); split: -0.25%, +0.68%
Branches: 69693 -> 69710 (+0.02%); split: -0.04%, +0.06%
PreSGPRs: 34824 -> 34945 (+0.35%); split: -0.24%, +0.58%
PreVGPRs: 28682 -> 28649 (-0.12%); split: -0.36%, +0.24%
VALU: 1080800 -> 1081171 (+0.03%); split: -0.04%, +0.08%
SALU: 353112 -> 353770 (+0.19%); split: -0.15%, +0.34%
SMEM: 81587 -> 81364 (-0.27%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34162>
2025-05-08 13:30:50 +00:00
Rhys Perry
18a53230eb aco: don't check dst_bitsize in apply_load_extract
I don't think this is necessary.

fossil-db (gfx1201):
Totals from 12 (0.02% of 79377) affected shaders:
Instrs: 73041 -> 72669 (-0.51%); split: -0.51%, +0.00%
CodeSize: 417376 -> 413852 (-0.84%); split: -0.85%, +0.00%
Latency: 1301862 -> 1301533 (-0.03%); split: -0.03%, +0.00%
InvThroughput: 599874 -> 599723 (-0.03%)
VClause: 1344 -> 1346 (+0.15%)
Copies: 15855 -> 15832 (-0.15%); split: -0.37%, +0.23%
VALU: 42138 -> 41883 (-0.61%); split: -0.61%, +0.00%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34162>
2025-05-08 13:30:50 +00:00
Rhys Perry
eb95f7cc0e aco: support sign extension in apply_load_extract
fossil-db (gfx1201):
Totals from 10 (0.01% of 79377) affected shaders:
Instrs: 28954 -> 28938 (-0.06%)
CodeSize: 164552 -> 164472 (-0.05%)
Latency: 1249341 -> 1247037 (-0.18%)
InvThroughput: 297077 -> 296618 (-0.15%)
VALU: 15951 -> 15941 (-0.06%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34162>
2025-05-08 13:30:50 +00:00