Commit graph

170109 commits

Author SHA1 Message Date
Samuel Pitoiset
c1d32880f7 radv: track DB_COUNT_CONTROL changes to avoid context rolls
This can be really noticeable for the BeginQuery/Draw/EndQuery pattern.
It seems to improve a depth-only pass by +35% in one upcoming game
because this removes a bunch of context rolls.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22556>
2023-04-20 16:25:09 +00:00
Samuel Pitoiset
02443d752e radv: delay enabling/disabling occlusion queries at draw time
Most applications have a sequence like BeginQuery/Draw/EndQuery which
can be optimized by delaying DB_COUNT_CONTROL at draw time instead of
enabling/disabling for every draw.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22556>
2023-04-20 16:25:09 +00:00
Mike Blumenkrantz
3017d01c9d zink: check for extendedDynamicState3DepthClipNegativeOneToOne for ds3 support
somehow this was forgotten

Fixes: c7f46d2ad6 ("zink: use dynamic state3 rasterization states when available")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22603>
2023-04-20 15:19:04 +00:00
Leo Liu
e6701f7231 radeonsi/vcn: AV1 skip the redundant bs resize
For AV1, the begin bitstream buffer have included all the tile data,
and extra bitstream buffer is useless and causing the bad performance
by bs buffer resize/map/copy.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Veerabadhran Gopalakrishnan <veerabadhran.gopalakrishnan@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22557>
2023-04-20 14:43:55 +00:00
Samuel Pitoiset
d44651bfc3 radv: wait for occlusion queries in the resolve query shader
This is really noticeable for games that resolve a bunch of occlusion
queries (in this case 4096) because it seems that emitting 4096
WAIT_REG_MEM packets can stall more than expected. Fixes this by
waiting for queries in the resolve query shader.

This improves performance of an unreleased game by +~10% (71->78 FPS).
RADV should now be really close to Windows performance for that title.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22579>
2023-04-20 14:11:26 +00:00
Mike Blumenkrantz
1e6e3427f0 drisw: don't leak the winsys
if a winsys is allocated by the frontend, it should be freed by the frontend
rather than the driver to ensure it doesn't leak if it doesn't reach
the driver

cc: mesa-stable

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22396>
2023-04-20 13:34:15 +00:00
Frank Binns
2d6527c9f1 pvr: fix typo in pvr_rt_get_region_headers_stride_size()
This function was returning the size of a single region header as the stride
when it was supposed to be returning the total size of the region headers for a
single render target. This went unnoticed due to the fact this function had two
variables with basically identical names. To avoid any future confusion, rename
rgn_header_size to single_rgn_header_size throughout the code.

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22574>
2023-04-20 13:17:01 +00:00
Mike Blumenkrantz
83a1b74240 zink: don't create separate shader dsls if there are no bindings
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22577>
2023-04-20 12:58:12 +00:00
Mike Blumenkrantz
329473c242 zink: add a util function for printing shaders
now that these are serialized, nir_print_shader is slightly less convenient

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22577>
2023-04-20 12:58:12 +00:00
Mike Blumenkrantz
f2f6012f4a zink: call zink_shader_free for compute shaders
ensure everything is deallocated consistently

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22577>
2023-04-20 12:58:12 +00:00
Mike Blumenkrantz
ee8c1a44c1 zink: always wait on precompile fence at start of zink_gfx_shader_free()
this shouldn't affect anything at present, but that will change in the future

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22577>
2023-04-20 12:58:12 +00:00
Mike Blumenkrantz
b2ecafd1ac zink: split out generic shader destruction for reuse
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22577>
2023-04-20 12:58:12 +00:00
Mike Blumenkrantz
9f6eec03e0 zink: zink_shader_free -> zink_gfx_shader_free
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22577>
2023-04-20 12:58:12 +00:00
Mike Blumenkrantz
9bf4db8ebb zink: don't bitcast bool deref loads/stores
a bool can only be a bool, and OpBitCast requires the src type to be
different than the dst type, so this is illegal

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22577>
2023-04-20 12:58:12 +00:00
Mike Blumenkrantz
82add9f2e9 zink: avoid recursion during msrtss blits from flushing clears
if an attachment other than the msrtss blit attachment has clears pending,
unbinding the other attachment will trigger a clear flush, which will then
recurse into the msrtss blit that's being triggered

instead, save/restore these clears around the msrtss blit since they
can be executed during the normal renderpass

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22577>
2023-04-20 12:58:12 +00:00
Mike Blumenkrantz
8ea506e94b zink: skip msrtss replicate if the attachment will be full-cleared
this should be unnecessary and avoids a perf hit

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22577>
2023-04-20 12:58:12 +00:00
Mike Blumenkrantz
1e7cb4642e zink: handle 'blitting' flag better in msrtss replication
barriers are illegal while 'blitting' is set, so unset it temporarily
for the replication barriers and then also re-set the layouts after

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22577>
2023-04-20 12:58:12 +00:00
Mike Blumenkrantz
ec0860b401 zink: manually re-set framebuffer after msrtss replicate blit
with the new zsbuf elimination handling, the fb state calculated in
u_blitter's fb restore may be incorrect if the zsbuf has indeed been
eliminated, so ensure the right fb is stored to be reapplied so that
misrenders will be avoided

fixes some crashes/misrenders in webgl

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22577>
2023-04-20 12:58:12 +00:00
Samuel Pitoiset
72a522fb36 radv: fix usage flag for 3D compressed 128 bpp images on GFX9
VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT is equal to
VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT but we want COLOR_ATTACHMENT_BIT.

Found by inspection.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22540>
2023-04-20 08:20:50 +00:00
Samuel Pitoiset
8a2fab66de radv: do not allow 1D block-compressed images with (extended) storage on GFX6
For some reasons this seems broken only on GFX6. Note that PAL doesn't
allowed block-compressed with 1D on all GPUs.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22540>
2023-04-20 08:20:50 +00:00
Caio Oliveira
aeec9071b5 spirv: Rework structured control flow handling
The new code splits the work into a few passes instead of trying to do
everything with a single pass.  This helps to apply the new clarified
rules for structured control flow in the SPIR-V specification, in
particular the "exit construct" rules.

First find an appropriate ordering for the blocks, based on the
approach taken by Tint (WebGPU compiler).  Then, with those blocks
in order, identify the SPIR-V constructs start and end positions.

Finally, walk the blocks again to emit NIR for each of them, "opening"
and "closing" the necessary NIR constructs as we reach the start and
end positions of the SPIR-V constructs.

There are a couple of interesting choices when mapping the constructs
to NIR:

- NIR doesn't have something like a switch, so like the previous code,
  we lower the switch construct to a series of conditionals for each
  case.

- And, unlike the previous code, when there's a need to perform a
  break from a construct that NIR doesn't directly support (e.g. inside
  a case construct, conditionally breaking early from the switch), we
  now use a combination of a NIR loop and an NIR if.  Extra code is
  added to ensure that loop_break and loop_continues are propagated
  to the right loop.

This should fix various issues with valid SPIR-V that previously
resulted in "Invalid back or cross-edge in the CFG" errors.

Thanks to Alan Baker and David Neto for their explanations of
ordering the blocks, in the Tint code and in presentations to
the SPIR-V WG.

Thanks to Jack Clark for providing a lot of valuable tests used to
validate this MR.

Closes: #5973, #6369
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17922>
2023-04-20 07:02:42 +00:00
Qiang Yu
6a39d35df0 aco: fix nir_f2u64 translation
mantissa needs to be at the lower part for shift left.
This fixes large integer value conversion.

Cc: mesa-stable
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22570>
2023-04-20 06:32:15 +00:00
Dmitry Baryshkov
22b07b10c4 freedreno/registers: updte HDMI registers to include CEC details
Based on patchset by Arnaud Vrac update the hdmi.xml register
decscription.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22588>
2023-04-20 06:03:53 +00:00
Michel Zou
d5871d21a5 vulkan/wsi: fix -Wnarrowing warning
else I get this output:

[11/600] Compiling C++ object src/vulkan/wsi/libvulkan_wsi.a.p/wsi_common_win32.cpp.obj
../src/vulkan/wsi/wsi_common_win32.cpp: In function 'VkResult wsi_win32_surface_create_swapchain_dxgi(wsi_win32_surface*, VkDevice, wsi_win32*, const VkSwapchainCreateInfoKHR*, wsi_win32_swapchain*)':
../src/vulkan/wsi/wsi_common_win32.cpp:757:65: warning: narrowing conversion of '((((int)chain->wsi_win32_swapchain::base.wsi_swapchain::present_mode) == ((int)VK_PRESENT_MODE_IMMEDIATE_KHR)) ? ((int)DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING) : 0)' from 'int' to 'UINT' {aka 'unsigned int'} [-Wnarrowing]
  757 |       chain->base.present_mode == VK_PRESENT_MODE_IMMEDIATE_KHR ?
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
  758 |          DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING : 0
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

fixes: d7730fcf22

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22475>
2023-04-20 03:33:51 +00:00
Mike Blumenkrantz
a6c8d74cd7 util/debug: move null checks out of debug message macro
this otherwise causes tons of compiler warnings

cc: mesa-stable

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22196>
2023-04-20 02:52:16 +00:00
Mike Blumenkrantz
3909471288 zink: use a perf_debug() macro for debug message logging of copy box warning
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22196>
2023-04-20 02:52:16 +00:00
Mike Blumenkrantz
3d467c466a zink: hook up debug callback
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22196>
2023-04-20 02:52:16 +00:00
Mike Blumenkrantz
366b79fa10 zink: only print copy box warning once per resource
this otherwise gets spammy

cc: mesa-stable

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22196>
2023-04-20 02:52:16 +00:00
Emma Anholt
f7758bd379 ci/freedreno: Demote a530 to manual again.
6 job-level flakes detected yesterday across a530_gl {2,3,5}/6.  It's
still not ready to gate MRs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22562>
2023-04-20 02:22:41 +00:00
Emma Anholt
7d17713723 ci: Crank up the yamllint line length limit.
I hated that CI errors out because I pasted useful information in the
yaml.  You shouldn't have to manually line-wrap pastes from dmesg.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22562>
2023-04-20 02:22:41 +00:00
Emma Anholt
392266ad6a ci/radv: Add known flakes for #8817
Should greatly increase Marge reliability.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22562>
2023-04-20 02:22:41 +00:00
Emma Anholt
bcf38ff950 ci/freedreno: Drop portal-2-v2 trace.
It's intermittently segfaulting.  CI daily says 4 flakes this month.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22562>
2023-04-20 02:22:41 +00:00
Emma Anholt
a75371b68a ci/zink+tu: Drop some intermittently failing a630 traces.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22562>
2023-04-20 02:22:40 +00:00
Emma Anholt
2a9b990fa3 ci/radv: Demote navi21 to manual until recent flakiness resolves.
22 detected job flakes yesterday.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22562>
2023-04-20 02:22:40 +00:00
Emma Anholt
53cbe352ad ci/lvp: Update sanctuary trace hash.
Changed a few days ago, still looks good.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22562>
2023-04-20 02:22:40 +00:00
Timur Kristóf
b32556b058 radv: Fix dword alignment in SDMA buffer copy.
Also add a comment that explains the dword aligned mode.

Note that the SDMA shader uploads are always dword aligned
so this commit doesn't fix any issues but just prepares this
function for more general use.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22551>
2023-04-20 00:46:01 +00:00
Caio Oliveira
cf181fef68 spirv: Add --optimize flag to spirv2nir tool
Apply some basic NIR optimizations to clean up the result.  Useful in some
situations when comparing the parsing code from different mesa branches.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22180>
2023-04-20 00:15:23 +00:00
Caio Oliveira
6e3207a191 spirv: Output spirv2nir tool result to stdout
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22180>
2023-04-20 00:15:23 +00:00
Sil Vilerino
a71f79fb45 d3d12: Clean unused code for parsing slices
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22541>
2023-04-19 23:38:18 +00:00
Sil Vilerino
244af0523c d3d12: Use frontend H264 decode slice offsets and sizes instead of parsing buffer
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22541>
2023-04-19 23:38:18 +00:00
Sil Vilerino
114c35cb0c frontend/va: Add H264 decode slice data
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22541>
2023-04-19 23:38:18 +00:00
Mike Blumenkrantz
6ddfc5087c zink: emit demote cap when using demote
VUID-VkShaderModuleCreateInfo-pCode-01377(ERROR / SPEC): msgNum: 1478567243 - Validation Error: [ VUID-VkShaderModuleCreateInfo-pCode-01377 ] Object 0: handle = 0x55f304e851c0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x5821254b | SPIR-V module not valid: Opcode DemoteToHelperInvocation requires one of these capabilities: DemoteToHelperInvocation

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22582>
2023-04-19 23:08:56 +00:00
Filip Gawin
421d3e3c8e nine: add fallback for D3DFMT_D16 in d3d9_to_pipe_format_checked
Helps with avoing crash in winetests on crocus.

Cc: mesa-stable

Reviewed-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20121>
2023-04-19 22:54:26 +00:00
Mike Blumenkrantz
8f3c3d2fc0 glthread: add newline to env override
Fixes: 8c42c353b6 ("driconf: rework glthread enablement")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22581>
2023-04-19 22:21:46 +00:00
Mike Blumenkrantz
972082d051 util/blitter: fix line wrapping on error to avoid giving wrong line number
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22581>
2023-04-19 22:21:46 +00:00
Marek Olšák
4681fd3882 nir: set uses_wide_subgroup_intrinsics for all shader stages
nir_opt_varyings will use it in VS, TES, GS.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21861>
2023-04-19 21:42:11 +00:00
Marek Olšák
e6e406b483 nir: add next_stage parameter to nir_remove_varying
so that e.g. the POS output is removed if the next stage is not FS.

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21861>
2023-04-19 21:42:11 +00:00
Marek Olšák
42822413cf nir: add next_stage parameter to nir_slot_is_sysval_output to return better info
If we know the next stage, we can tell whether an output is a sysval,
such as POS.

For example, POS is not a sysval output if the next stage is not FS.

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21861>
2023-04-19 21:42:11 +00:00
Marek Olšák
c60002ea27 nir: remove an obsolete comment from nir_gather_xfb_info_from_intrinsics
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21861>
2023-04-19 21:42:11 +00:00
Marek Olšák
ea9156edc3 nir: return a status from nir_remove_varying whether it removed the instruction
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21861>
2023-04-19 21:42:11 +00:00