Commit graph

185347 commits

Author SHA1 Message Date
Ian Romanick
c42830c64a intel/fs: Use constant of same type to write flag
Otherwise the compiler generates an extra MOV to load the constant into
a register first because reasons. 🤷 vote_any, vote_all, vote_ieq,
and vote_feq handling already do this.

No shader-db changes on any Intel plaform.

Fossil-db results:

All Intel platforms had similar results. (Ice Lake shown)
Totals:
Instrs: 165592451 -> 165557937 (-0.02%)
Cycles: 15133282615 -> 15133059360 (-0.00%); split: -0.00%, +0.00%

Totals from 33779 (5.15% of 656115) affected shaders:
Instrs: 4396576 -> 4362062 (-0.79%)
Cycles: 86867412 -> 86644157 (-0.26%); split: -0.37%, +0.11%

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27044>
2024-02-27 08:37:15 -08:00
Ian Romanick
b22fff90d5 intel/fs: Enable nir_opt_uniform_atomics in all shader stages
The problem seems to have been related to
nir_intrinsic_load_global_block_intel being marked as non-divergent.

No shader-db or fossil-db changes on any Intel platform.

v2: Rebase on splitting ELK from BRW. Remove devinfo->ver >= 8 check.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27044>
2024-02-27 08:37:05 -08:00
Ian Romanick
75de4458a1 nir: Mark nir_intrinsic_load_global_block_intel as divergent
This is divergent because it specifically loads sequential values into
successive SIMD lanes.

No shader-db or fossil-db changes on any Intel platform.

Fixes: 9f44a26462 ("nir/divergence: handle load_global_block_intel")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27044>
2024-02-27 08:36:42 -08:00
Ian Romanick
56a3f031f4 intel/fs: Delete stale comment in nir_intrinsic_ballot implementation
Discard actually uses f1.x, so this implementation of ballot is fine.

Trivial.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27044>
2024-02-27 08:36:34 -08:00
Ian Romanick
5da5106727 nir: Add documentation for subgroup_.._mask
v2: Fix reference to GL_ARB_shader_ballot. Noticed by Lionel.

Suggested-by: Lionel
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27044>
2024-02-27 08:36:09 -08:00
Samuel Pitoiset
727170fee0 radv/ci: enable RADV_PERFTEST=shader_object for vkcts-tahiti-valve
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27812>
2024-02-27 14:28:54 +00:00
Martin Roukala (né Peres)
83efcd6a72 radv/ci: add a vkcts-tahiti job
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27812>
2024-02-27 14:28:54 +00:00
Sebastian Wick
0fe7e06f5f vulkan/wsi/wayland: Use dispatch_queue_timeout in acquire_next_image
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27511>
2024-02-27 13:10:13 +00:00
Sebastian Wick
a00f9c401b loader/wayland: Add fallback wl_display_dispatch_queue_timeout
This is almost a 1:1 copy of the same function in libwayland. If the version
with the symbol propagates far enough the fallback can be removed again.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27511>
2024-02-27 13:10:13 +00:00
Sebastian Wick
df801bec1e util: Add timespec_sub_saturate to avoid negative time for deadlines
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27511>
2024-02-27 13:10:13 +00:00
Connor Abbott
a80a23dc49 tu: Enable UBWC for storage images on a7xx
I'm not sure exactly when this was introduced. It doesn't work on a650,
but does work on a7xx, I'm not sure whether it works on the a660
generation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27506>
2024-02-27 07:34:15 -05:00
Connor Abbott
b9e04f8293 tu: Enable UBWC for SNORM formats on a740+
The fast-clear value is now the same for SNORM and UNORM, so our trick
of reinterpreting SNORM as UNORM when copying now works with UBWC. We
can also freely reinterpret UNORM, SNORM, and UINT formats, as tested by
dEQP-VK.image.mutable.*.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27506>
2024-02-27 07:33:59 -05:00
Connor Abbott
4529b2ea54 tu: Reenable MSAA UBWC on a6xx gen1
This passes a full CTS run now, probably due to other fixes in the
meantime.

Closes: #7438
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27506>
2024-02-27 07:17:29 -05:00
Daniel Stone
dcbf61f5df egl/dri: Use pipe_format instead of DRI_IMAGE_FORMAT
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
68eaf820e1 st/dri: Use pipe_format from config directly
The driver already stores the pipe_format within the mode, so we can
just reuse that rather than trying to re-derive it back from a hardcoded
set of masks.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
832d814852 egl: Remove shifts/sizes from dri2_add_config argument
All the callers now do their own filtering on driver configs to decide
whether or not to add them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
e66305d681 egl/x11: Compare config shifts/sizes locally
Rather than getting the egl_dri2 core to compare our shift/size arrays,
do it in the caller, as X11 is the only caller that constructs configs
like this.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
273e54391a egl/android: Remove hard-coded color-channel data
We don't need to write out tables of the shift/size of every colour
channel, because we already have that as part of the format description
if we use pipe_format.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
d8d153d4c2 gbm: Remove hardcoded color-channel data
We don't need to write out the shifts and sizes everywhere; we already
have them as part of the format description.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
a10f10c4ce gbm/dri: Query DRIImage for FourCC directly
No need to go through the DRIImage format query when we can just get the
FourCC directly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
6b04b64a21 egl: Use pipe_format for pbuffer configs
There's no need to pass shifts and masks now; we can just take a list of
pbuffer configs to add.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
630fda2492 egl: Automatically set EGLConfig ID
There's no reason to make the users go through and count all their
configs; just set it ourselves in the core.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
487016796b egl/{surfaceless,device}: Remove check for EGLConfig presence
We now check in the EGL core that we actually have some configs for the
display, so no need to do it in the platform.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
e12a55c979 egl/android: Remove check for EGLConfig presence
We now check in the EGL core that we actually have some configs for the
display, so no need to do it in the platform.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
ac304d0393 egl/x11: Remove check for EGLConfig presence
We now check in the EGL core that we actually have some configs for the
display, so no need to do it in the platform.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
6770921918 egl/gbm: Remove check for EGLConfig presence
We now check in the EGL core that we actually have some configs for the
display, so no need to do it in the platform.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
bf7ebe6ff8 egl/wayland: Remove check for EGLConfig presence
We now check in the EGL core that we actually have some configs for the
display, so no need to do it in the platform.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
cbb6f62135 egl: Fail display creation if no EGLConfigs created
If we failed to create any EGLConfigs, throw an error and refuse to
create the display. This lets us eliminate a bunch of copy-and-wasted
code throughout the drivers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
97c435c926 egl/wayland: Remove shift/size masks
We don't need these anymore.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
7889c9dc92 egl/wayland: Use pipe_format for format names
We don't need to carry our own strings.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
84bb6d0e0a egl/wayland: Remove WL_SHM_* format listings
We don't need to type all of these out, because they're exactly the same
as the DRM ones, with the exception of ARGB8888 and XRGB8888 which carry
their own format codes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
5ac70182e8 egl/wayland: Simplify alternate-format fallback for configs
Rather than doing everything to add the config twice, we can simply
reuse the helpers to check if the different formats are supported, then
add the config only once.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
ee04cc5d2b egl/wayland: Eliminate double loop for configs
We used to loop like this:

foreach (config_supported_by_driver) {
   foreach (config_wl_knows_about) {
      dri2_add_config(wl_config.rgba_masks, wl_config.rgba_shifts)) {
         if (wl_config.rgba_masks != driver_config.rgba_masks ||
	     wl_config.rgba_shifts != driver_config.rgba_shifts) {
            return NULL; /* driver config != wl config */
         }
      }
   }
}

This is a pretty painful way to discover the relationship between the
different sets of configs, especially as we can just look up our Wayland
visual entry directly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
f63e676370 egl/wayland: Use helper to look up visual
No functional change.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
ebdf9ad85c egl/wayland: Add helper to check server format support
Often when we look up a dri2_wl_visual, the only thing we want to do
with it is check whether or not the server supports it. Add a helper for
this common pattern.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
a34d3c290e egl/wayland: Use FourCC to look up wl_buffer support
No point in using a DRI_IMAGE_FORMAT, since we'll need to get a FourCC
for dmabuf/wl_drm support anyway.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
6a084e2b08 egl/wayland: Use pipe_format to look up configs
Instead of using the sizes and shifts to look up a dri2_wl_visual from a
config, just use the pipe_format we stash in the config.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
9ea9a963aa egl/wayland: Fix EGL_EXT_present_opaque
This extension has been broken ever since the initial commit. It created
an XRGB DRIImage for the driver to render to, so whilst the presentation
was opaque, the buffer also completely lacked an alpha channel.

Fix it by making sure we only modify the FourCC we send to the Wayland
server when creating a buffer.

Closes: mesa/mesa#5886
Fixes: 9aee7855d2 ("egl: implement EGL_EXT_present_opaque on wayland")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
c74f480391 egl/wayland: Add opaque-equivalent FourCCs
Add a mapping for the opaque version of an alphaful format (e.g.
ARGB8888 -> XRGB8888) to better support EGL_EXT_present_opaque.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
084fea1e7d egl/wayland: s/DRI_IMAGE_FORMAT/pipe_format/g
All the DRI_IMAGE_FORMATs we use are now pipe_formats, so eliminate the
old type names.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
ba3b867552 egl/wayland: Query image FourCC for linear copies
This entire pattern really wants to be a shared helper, to allocate a
shadow linear image from another device and then import it across into
the rendering GPU. Querying the FourCC from the DRIImage makes it easier
to pull out into shared code.

This temporarily makes the implementation more ugly, however it's
already pretty hard on the eyes, so probably no great loss.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
57c3343c2d dri/kopper: Flatten pipe_format/DRIImage/FourCC conversion
No need to go through DRI_IMAGE_FORMAT_* tokens; we can just directly
convert from pipe_format to FourCC.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
3c46252570 dri/kopper: Reorder format tables
Just make it more obvious that they're identical.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
d60415bad5 dri/kopper: Add translations for sRGB formats
There was DRI_IMAGE_FORMAT -> FourCC format translation, but this was
unreachable as we only ever called image_format_to_fourcc() on the
result of get_dri_format().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
ca0f94c805 dri/kopper: Move format -> FourCC translation up a level
There's no reason to use DRIImage formats here, given that it's only
ever used to immediately convert to a FourCC.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
a8cb490193 st/dri: Reuse stored texture format
When we create a texture, we allocate a pipe_resource for it with a
given format. When we export the texture to an EGLImage, we go look
up what the GL format was and try to re-derive the pipe_format back
again.

Instead of doing that, just immediately reuse the pipe_format for the
image's format.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
858ad38f8b st/dri: Reuse stored renderbuffer format
When we create a renderbuffer, we allocate a pipe_resource for it with a
given format. When we export the renderbuffer to an EGLImage, we go look
up what the GL format was and try to re-derive the pipe_format back
again.

Instead of doing that, just immediately reuse the pipe_format for the
image's format.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
303b935dbd egl/wayland: Remove format-query fallback
The DRI2 frontend should always be responsible for answering a FourCC
query, so just remove one use of DRI formats here.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
216d4613c3 st/dri: Store pipe_format in gl_config
When the DRI frontend generates configs to pass to the APIs, store the
pipe_format in the internal gl_config structure. Doing this allows us to
nuke a few places where we try to retcon our way back from the config to
a pipe_format.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00
Daniel Stone
ad0edea53a st/dri: Check format properties from format helpers
When populating DRI configs, driconf allows us to exclude
10bpc/RGBA/float configs. Rather than having a hardcoded set of formats
which satisfy those properties, just check the actual format
definitions.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27709>
2024-02-27 10:51:03 +00:00