Commit graph

171160 commits

Author SHA1 Message Date
Samuel Pitoiset
6894692d27 radv: enable GS_FAST_LAUNCH=2 by default for RDNA3 APUs (Phoenix)
GS_FAST_LAUNCH=1 shouldn't be used on GFX11 but it's still needed for
dGPUs (eg. NAVI31) because it destroys performance for unknown reasons.

On RDNA3 APUs, GS_FAST_LAUNCH=2 seems to be required for working
mesh shaders and performance is fine. There is possibly a firmware bug
on APUs that would explain why GS_FAST_LAUNCH=1 doesn't work on Phoenix.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10583
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10397
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27618>
2024-02-16 07:32:18 +00:00
Samuel Pitoiset
0c2213cbbd radv: fix setting the rasterized primitive for ESO
This was missing.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27479>
2024-02-16 07:08:36 +00:00
Samuel Pitoiset
b199aa1bda radv: fix selecting shader variants with ESO
The shader BO for variants (like as LS) wasn't added to the BO list.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27479>
2024-02-16 07:08:36 +00:00
Samuel Pitoiset
a47de04ff3 radv: make sure to reset the GS copy shader with ESO
It should be NULL when not used. This is also slightly more optimal
than doing it in the loop.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27479>
2024-02-16 07:08:36 +00:00
Samuel Pitoiset
b1d4a7a95e radv: fix re-emitting DB_RENDER_CONTROL when resetting gfx pipeline state
This is only used by internal operations but the state wasn't
re-emitted.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27479>
2024-02-16 07:08:36 +00:00
Samuel Pitoiset
64e18b04d9 radv: clear the custom blend mode when resetting gfx pipeline state
This custom blend mode is only used by internal operations and they
don't use shader objects.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27479>
2024-02-16 07:08:35 +00:00
Samuel Pitoiset
b0a31a62e4 radv: clear RADV_CMD_DIRTY_SHADERS when resetting the shader object state
Binding a pipeline resets the shader object state and it's more optimal
to clear this flag here.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27479>
2024-02-16 07:08:35 +00:00
Mike Blumenkrantz
5e813a15f8 zink: update vvl expectations
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27358>
2024-02-15 22:35:01 -05:00
Mike Blumenkrantz
c163a38a8e ci: bump VVL to snapshot-2024wk06
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27358>
2024-02-15 22:35:01 -05:00
Mike Blumenkrantz
7c1916b98f zink: add a ci skip
avoids having to add vvl exceptions for the rest of the run

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27358>
2024-02-15 22:35:01 -05:00
Mike Blumenkrantz
4c08db5501 zink: don't add VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT for sparse textures
according to VUID-VkImageCreateInfo-flags-09403, this is illegal

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27358>
2024-02-15 22:35:01 -05:00
Mike Blumenkrantz
e8ce53a33d zink: promote gpl libs freeing during shader destroy out of prog loop
now that zink_gfx_lib_cache::stages_present exists (and is correct),
this value can be used directly to effect cache eviction instead of depending
on the prog->stages_present value, which may not even be the same prog that
owns a given zink_gfx_lib_cache instance

this fixes the case where a shader used in multiple progs with differing shader
masks would never have all its gpl pipelines freed

fixes leaks with caselist:
KHR-Single-GL46.arrays_of_arrays_gl.InteractionUniformBuffers1
KHR-Single-GL46.subgroups.quad.framebuffer.subgroupquadbroadcast_3_float_vertex

Fixes: d786f52f1f ("zink: prevent crash when freeing")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27358>
2024-02-15 22:35:01 -05:00
Mike Blumenkrantz
36e7350e0b zink: clamp zink_gfx_lib_cache::stages_present for generated tcs
this otherwise does not reflect reality

Fixes: d786f52f1f ("zink: prevent crash when freeing")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27358>
2024-02-15 22:35:01 -05:00
Mike Blumenkrantz
d2dafa3289 zink: promote a conditional on gfx shader destroy
it only makes sense to run these loops in the cases where they might
be true

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27358>
2024-02-15 22:35:01 -05:00
Mark Janes
08176d9d16 intel/tools: add shader compiler hash key to json devinfo format
Offline shader compilation will use json as the source configuration
to accurately instantiate mesa for target hardware.  Similar platforms
generate identical shader binaries even though intel_device_info
differs inconsequenially.

Include the shader compilation hash key to device info json files, so
these platforms can be deduplicated.

Closes: #6746

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26844>
2024-02-15 16:59:25 -08:00
Mark Janes
aa649dfa5f intel/tools: move intel_dev_info to intel/tools
This is a more sensible home for intel_dev_info.

Offline shader compilation will take intel_dev_info json files as
input.  For that use case, the shader compiler hash value is needed in
the json file.

intel_dev_info will depend on intel/compiler, and must be located in
intel/tools to break a circular meson dependency.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26844>
2024-02-15 16:59:15 -08:00
Mark Janes
9b1ae760a8 anv: use intel_device_info to set device UUID
For anv, use the intel device info hash function instead of
device PCI ID when generating a UUID for the pipeline cache.

PCI ID can vary between on devices which are comparable from the
perspective of the shader compiler.  A more precise key eliminates
redundant entries in a multiplatform shader cache.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26844>
2024-02-15 16:58:20 -08:00
Mark Janes
48bf7ad3b8 iris: use device info sha in device renderer string
For iris, use the intel device info hash function instead of PCI ID in
the renderer name.  The renderer is incorporated into the gallium disk
cache for programs, as part of the key for looking up cache entries.

PCI ID can vary between on devices which are comparable from the
perspective of the shader compiler.  A more precise key eliminates
redundant entries in a multiplatform shader cache.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26844>
2024-02-15 16:58:18 -08:00
Mark Janes
c4ce1ca847 intel/compiler: generate a hash function to use with the shader cache
Currently, Intel's shader cache incorporates PCI ID into shader cache
keys.

Many devices with different PCI IDs have identical shader compilation
functionality.  Using PCI ID as a component of the shader cache hash
means that a multi-platform shader cache will have redundant,
identical entries for similar platforms.

All Intel compiler functionality is selected based on device
configuration in `struct intel_device_info`.  intel_device_info.py
flags all fields accessed by intel/compiler.

This commit generates a hash function incorporating intel/compiler
device info fields.  Using this hash function in place of PCI ID will
produce a multiplatform cache with no duplicated content.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26844>
2024-02-15 16:58:15 -08:00
Caio Oliveira
5a88267366 intel: Add missing dependencies on blorp
Various components implicitly depend on blorp, make this explicit.

Checked by setting a 'compiler_args' on idep_intel_blorp and verifying
it on blorp_priv.h header.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27643>
2024-02-16 00:08:42 +00:00
Caio Oliveira
3b48b7df1f intel/blorp: Use a Meson dependency for blorp
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27643>
2024-02-16 00:08:42 +00:00
Sagar Ghuge
f55f9272e4 intel/compiler: Fix disassembly of URB message descriptor on Xe2+
URB messages follow the LSC message descriptor so we are already
disassembling the descriptor/extended descriptor, we don't have to
duplicate it.

Without this change:
   urb MsgDesc: ( store, a32, d32, V4, L1UC_L3WB dst_len = 0, src0_len = 2, src1_len = 8 flat )  mlen 2 ex_mlen 8 rlen 0 { align1 1H $1 };

with this change:
   urb MsgDesc: ( store, a32, d32, V4, L1UC_L3WB dst_len = 0, src0_len = 2, src1_len = 8 flat )  base_offset 0  { align1 1H $1 };

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27498>
2024-02-15 19:46:55 +00:00
Jesse Natalie
5c85cdd378 d3d12: Support R16G16B16A16_FLOAT display targets
Since GDI doesn't support this format, we need a fallback path to
get contents on-screen if we're not using DXGI. For that scenario,
we allocate a proxy display target and blit during frontbuffer flush.

Once we have that fallback in place, we can override the sw winsys
format support check for that format.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27512>
2024-02-15 17:56:45 +00:00
Jesse Natalie
6a60270336 winsys/d3d12: Support single-buffered mode
When the frontend asks for the front buffer, we return an offscreen
surface, when the frontend asks us to flush that surface, we copy it
to the swapchain, and then present remains unchanged.

This means the only reason we need to avoid using a swapchain is if
the app asks for GDI compatibility.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27512>
2024-02-15 17:56:45 +00:00
Jesse Natalie
5879684a46 wgl: Add HDR pixel formats
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Jose Fonseca <jose.fonseca@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27512>
2024-02-15 17:56:44 +00:00
Jesse Natalie
f97060bc14 wgl: Enable WGL_ARB_pixel_format_float
We already implement all of the relevant bits of this extension, which
is just handling WGL_TYPE_RGBA_FLOAT_ARB for WGL_PIXEL_TYPE_ARB in
wglGetPixelFormatAttrib[i/f]vARB and wglChoosePixelFormatARB. We just
didn't have any float formats enumerated so it was never seen in
practice.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Jose Fonseca <jose.fonseca@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27512>
2024-02-15 17:56:44 +00:00
Jesse Natalie
c432fbe534 wgl: Add no-gdi-single-buffered and gdi-double-buffered PFDs
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Jose Fonseca <jose.fonseca@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27512>
2024-02-15 17:56:44 +00:00
Jesse Natalie
610dcc178a wgl: Flush frontbuffer when calling swapbuffers on single-buffered fb
Some apps don't look at what kind of PFDthey get, and if they
get a single-buffered one, they only ever call swap and never flush,
so nothing shows up on-screen.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Jose Fonseca <jose.fonseca@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27512>
2024-02-15 17:56:44 +00:00
Jesse Natalie
b6a2972455 wgl: Support a single-buffered winsys framebuffer
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Jose Fonseca <jose.fonseca@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27512>
2024-02-15 17:56:44 +00:00
Lionel Landwerlin
f733215c12 anv: enable query clear/copy using shaders on MTL/ARL
It seems like an L3 setting is different between DG2 & MTL, breaking
the L3 coherency with CS.

We can apply the same tile cache flush as we do on TGL for now until
we figure out how to configure L3 properly to avoid this.

Tested with :

 $ query_clear_with_blorp_threshold=0 query_copy_with_shader_threshold=0 ./deqp-vk -n dEQP-VK.query_pool.*

to force the shader optimizations.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27597>
2024-02-15 17:25:37 +00:00
Karol Herbst
53df391d27 rusticl/kernel: recalculate scratch and shared memory after opts
Turns out we have to do it regardless as opts after explicit_types could
get rid of even more scratch and shared memory.

Fixes: ea023ff5cd ("rusticl/kernel: no need to reset the scratch size anymore")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27634>
2024-02-15 15:09:23 +00:00
Georg Lehmann
ad5fbc4407 aco: use fmamk/ak instead of fma with inline constant for more VOPD
Foz-DB navi31, forced wave32:
Totals from 24438 (31.29% of 78112) affected shaders:
Instrs: 21632788 -> 21551766 (-0.37%); split: -0.38%, +0.01%
CodeSize: 126181860 -> 126083848 (-0.08%); split: -0.10%, +0.02%
Latency: 162491062 -> 162516234 (+0.02%); split: -0.05%, +0.07%
InvThroughput: 31121194 -> 31002125 (-0.38%); split: -0.40%, +0.02%
VClause: 420176 -> 420169 (-0.00%); split: -0.00%, +0.00%
SClause: 791844 -> 791762 (-0.01%); split: -0.01%, +0.00%

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27523>
2024-02-15 12:38:55 +01:00
Caio Oliveira
62a8de99ac intel/blorp: Move brw_compiler.h include to where is needed
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27581>
2024-02-15 10:29:19 +00:00
Caio Oliveira
f4df4be7e7 intel/blorp: Avoid brw types in blorp_priv.h
Abuse void* here so there's one less file dependent on specific brw
types.  We can revisit if there's a need later, if we ever end up with
a common type for prog_data.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27581>
2024-02-15 10:29:19 +00:00
Caio Oliveira
b28cf9123b intel/blorp: Move brw_blorp_get_urb_length helper
Moving to blorp_genX_exec.h to help make blorp_priv.h independent of brw
types.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27581>
2024-02-15 10:29:19 +00:00
Caio Oliveira
b34df9f801 intel/blorp: Remove outdated reference in comment
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27581>
2024-02-15 10:29:19 +00:00
Caio Oliveira
9377dc417d intel/blorp: Use a struct to return blorp_compile_*() results
Allocate the prog_data instead of expecting one from the user, also
explicitly return both kernel and prog_data size, so that the
plumbing code isn't required to use the exact prog_data type.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27581>
2024-02-15 10:29:19 +00:00
Caio Oliveira
82ecc219e0 intel/blorp: Simplify blorp_compile_cs() interface
No need to take brw_prog_cs_key.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27581>
2024-02-15 10:29:19 +00:00
Caio Oliveira
cfad85eed0 intel/blorp: Simplify blorp_compile_fs() interface
Take multisample_fbo parameter instead of a brw_wm_key.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27581>
2024-02-15 10:29:18 +00:00
Caio Oliveira
16ba2478fa intel/blorp: Remove brw_ prefix when not applicable
Remove the brw_ prefix from some blorp functions and structs to avoid
confusion with what's related to brw and what's not.  Some of those will
become independent of brw in upcoming patches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27581>
2024-02-15 10:29:18 +00:00
Caio Oliveira
c8fda63378 intel/blorp: Don't require specific prog_data type in callback
Make interface less dependent on brw types.  If we care, later
might make sense to add a tagged union for the possible types here.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27581>
2024-02-15 10:29:18 +00:00
Pavel Ondračka
d78a913bda r300: add explicit flrp lowering
Even though we set .lower_flrp32 = true there is no actuall flrp
lowering in nir_opt_algebraic. Mesa does not produce any but nine does,
so lower it explicitly to fix nine.

Fixes: f8a5cba3b4
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27467>
2024-02-15 10:11:51 +00:00
Caio Oliveira
0b751a2134 intel: Rename i965_{asm,disasm} tools to brw_{asm,disasm}
And move them inside the compiler since they (especially asm) rely on
a bunch of internal types.

Acked-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27579>
2024-02-15 09:26:46 +00:00
Caio Oliveira
5992185c8d intel/compiler: Merge intel_disasm.[ch] into corresponding brw files
Rename the functions to match the existing ones.

Acked-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27579>
2024-02-15 09:26:46 +00:00
Caio Oliveira
468a0ffe9c intel/compiler: Include brw_disasm_info.h where its used
Acked-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27579>
2024-02-15 09:26:46 +00:00
Caio Oliveira
ff95f00883 intel/compiler: Move disassemble functions to own header file
Acked-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27579>
2024-02-15 09:26:46 +00:00
Hans-Kristian Arntzen
786c1b8322 radv: export multiview in VS/TES/GS for depth-only rendering
For depth-only rendering, a VS would not export layer properly.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10606
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27615>
2024-02-15 09:07:42 +00:00
Caio Oliveira
5732c9d269 intel/compiler: Rename brw_cs_dispatch_info to intel_cs_dispatch_info
And move to the intel_shader_enums.h file.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27475>
2024-02-14 22:31:23 -08:00
Caio Oliveira
c5b80de583 intel/compiler: Rename brw_vue_map to intel_vue_map
And move to the intel_shader_enums.h file.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27475>
2024-02-14 22:31:23 -08:00
Caio Oliveira
7d85d2c7fd intel/compiler: Rename DISPATCH_MODE_* enums to INTEL_DISPATCH_MODE_*
And move to the intel_shader_enums.h file.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27475>
2024-02-14 22:31:23 -08:00