Compare commits

...

4583 Commits

Author SHA1 Message Date
Qiang Yu
45826e42c5 ac,aco: move gfx10 ngg prim count zero workaround to nir
To simplify both llvm and aco backend and remove unnecessary
workaround code where prim count is known to be not zero.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22381>
2023-04-13 08:12:03 +00:00
Tapani Pälli
b967cbba57 intel/compiler: use intel_needs_workaround for Wa_14012437816
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22437>
2023-04-13 07:33:50 +00:00
Tapani Pälli
ccf16693e1 intel/fs: use intel_needs_workaround for Wa_22013689345
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22437>
2023-04-13 07:33:50 +00:00
Eric Engestrom
1a9727a81e ci/rustfmt: make sure to only check each file once
rustfmt has some magic that follows files (I'm guessing), making files get
checked multiple times with `*.rs`, so let's limit ourselves to `lib.rs`.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22321>
2023-04-13 05:56:53 +00:00
Tatsuyuki Ishi
36fd2bbd98 ci/android: Make armv8's arch aarch64 instead of arm.
Per [1], arm is for 32-bit.

For an upcoming change, we need to detect AArch64 specifically.
Specifying arm in the cross file will result in the wrong build script
behavior.

[1]: https://mesonbuild.com/Reference-tables.html#cpu-families

Reviewed-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22418>
2023-04-13 04:28:29 +00:00
Mike Blumenkrantz
1a63ccc9aa zink: remove a fixed validation error for ci
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22453>
2023-04-13 04:10:32 +00:00
Karol Herbst
55c9356d29 rusticl/program: rework source code tracking
For the CL spec it really matters how a program object was created. We
never really cared all that much, but it didn't support the corner case of
having an empty string as the OpenCL C source code.

Enums feel like the more Rust way to do this kind of stuff anyway.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22280>
2023-04-13 02:54:21 +00:00
Karol Herbst
6d7b705125 rusticl/program: extract common code of compile and build
The code wasn't all the same, but the build version was wrong, e.g. the
compile flags specified need to be stored even on error.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22280>
2023-04-13 02:54:21 +00:00
Karol Herbst
d7e9b4ef5b rusticl/program: validate the SPIR-V when created from IL
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8771
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22280>
2023-04-13 02:54:21 +00:00
Karol Herbst
8fcfc51dad clc: add clc_validate_spirv
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22280>
2023-04-13 02:54:21 +00:00
Karol Herbst
ab032f4bfd rusticl/program: make IL programs look closer to CLC ones
We want to validate the actual passed in SPIR-V, but we can only report
errors back on build/compile time. So instead of storing the initial IL
in the devices `ProgramBuild` objects, just store it on the Program
instead. This also simplifies setting spec constants as this is only valid
on program directly created from IL and not e.g. linked ones.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22280>
2023-04-13 02:54:21 +00:00
Karol Herbst
ca1e9917a9 rusticl/program: allow dumping compilation logs through RUSTICL_DEBUG
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22280>
2023-04-13 02:54:21 +00:00
Karol Herbst
22808d542b rusticl/platform: move device initialization to the platform
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22280>
2023-04-13 02:54:21 +00:00
Karol Herbst
53025688bb rusticl/platform: move getter into the type
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22280>
2023-04-13 02:54:21 +00:00
Karol Herbst
3e59a2860e rusticl/platform: rename _cl_platform_id to Platform
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22280>
2023-04-13 02:54:21 +00:00
Karol Herbst
11250d7a9e rusticl: split platform into core and api parts
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22280>
2023-04-13 02:54:20 +00:00
Samuel Pitoiset
3320eee877 radv: cleanup after splitting radv_pipeline.c
I moved to many things to radv_pipeline_graphics.c without checking.

Fixes: 7783b7f697 ("radv: split radv_pipeline.c into radv_pipeline_{compute,graphics}.c")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22441>
2023-04-13 02:21:44 +00:00
Vitaliy Triang3l Kuzmin
30d141ba63 r600: Alpha to coverage dithering on Evergreen+
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22384>
2023-04-13 02:07:52 +00:00
Alyssa Rosenzweig
7a7d374ac3 pan/decode: Print compute job payloads
Noticed while debugging OpenCL. I think this was fallout from the CSF decode
rework?

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22228>
2023-04-13 01:49:33 +00:00
Alyssa Rosenzweig
de01ae120d panfrost: Allocate shared memory in OpenCL
In OpenCL, we can have no shader-defined shared memory but some dispatch-time
variable memory. This is not reflected in ss->info.wls_size, so check the right
variable instead so we allocate the appropriate memory.

Fixes page faults accessing shared memory with Rusticl, e.g. in the vstore_local
test.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22228>
2023-04-13 01:49:33 +00:00
Alyssa Rosenzweig
2f2738dc90 pan/bi: Use nir_lower_mem_access_bit_sizes
OpenCL can generate large loads and stores that we can't support, so we need to
lower. We can load/store up to 128-bits in a single go. We currently only handle
up to 32-bit components in the load and no more than vec4, so we split up
accordingly.

It's not clear to me what the requirements are for alignment on Valhall, so we
conservatively generate aligned access, at worst there's a performance penalty
in those cases. I think unaligned access is suppoerted, but likely with a
performance penalty of its own? So in the absence of hard data otherwise, let's
just use natural alignment.

Oddly, this shaves off a tiny bit of ALU in a few compute shaders on Valhall,
all in gfxbench. Seems to just be noise from the RA lottery.

total instructions in shared programs: 2686768 -> 2686756 (<.01%)
instructions in affected programs: 584 -> 572 (-2.05%)
helped: 6
HURT: 0
Instructions are helped.

total cvt in shared programs: 14644.33 -> 14644.14 (<.01%)
cvt in affected programs: 5.77 -> 5.58 (-3.25%)
helped: 6
HURT: 0

total quadwords in shared programs: 1455320 -> 1455312 (<.01%)
quadwords in affected programs: 56 -> 48 (-14.29%)
helped: 1
HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22228>
2023-04-13 01:49:33 +00:00
Alyssa Rosenzweig
934b0f1add pan/bi: Respect swizzles for more vector ops
We need to respect the ALU swizzle, this takes a vector. Fixes incorrect
pack_64_2x32 translation hit when wiring up lower_mem_access_bit_sizes for
OpenCL.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22228>
2023-04-13 01:49:33 +00:00
Alyssa Rosenzweig
d00d2ae701 pan/bi: Lower swizzles for 8-bit CSEL
With OpenCL we can generate stuff like CSEL.u32.eq r0.b0000, we need to handle
it when lowering swizzles.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22228>
2023-04-13 01:49:33 +00:00
Lionel Landwerlin
66edd030ab anv: add utrace tracking of frame boundaries
Based on vkQueuePresentKHR calls. It just helps spotting the beginning
end of a frame in perfetto when apps are using 3/4 command buffers per
frame.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22276>
2023-04-13 01:14:38 +00:00
Lionel Landwerlin
da6842007f intel/ds: add a new timeline row for frames
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22276>
2023-04-13 01:14:38 +00:00
Lionel Landwerlin
68bba1539f anv: exclude performance queries from blorp clears
The query buffer contains a batch to implement the multi pass
replay/accumulation of results. So we can't clear it with a memset.

An optimization for later would be to move the batches to the very end
of the query buffer so we can clear the query data without touching
the batches.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4dc7256bf9 ("anv: reset query pools using blorp")
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22421>
2023-04-13 00:44:29 +00:00
Timur Kristóf
7036d1a155 ac/nir/ngg: Don't store primitive IDs from culled primitives.
Primitive export used the gs_accepted variable after culling,
so we overwrote this variable after vertex compaction to make
sure not to hang the GPU.

This had an unintended side effect when storing the primitive ID
to LDS on GS threads: the LDS store was done even on threads whose
triangle was culled; potentially causing issues.

As a fix, create a separate boolean variable that remembers
which invocations need to export a primitive; and don't store
the primitive ID to LDS when gs_accepted is false.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8805
Signed-off-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/22424>
2023-04-12 23:55:37 +00:00
Ruijing Dong
31c4087cb3 frontends/va: disable skip_frame_enable in vaapi interface.
skip_frame_enable is for preventing overshooting in some cases,
however the tests in FW were broken, and the output result shows
the functionality has not completed yet, which is the reason
this should be disabled at the moment until it has been fully
verified.

Cc: mesa-stable
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8178

Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22428>
2023-04-12 23:40:23 +00:00
Oleksii Bozhenko
8976d8280f wsi: remove get_sorted_vk_formats duplication
Fixes: 37a8b2d12e
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8727

Signed-off-by: Oleksii Bozhenko oleksii.bozhenko@globallogic.com

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22337>
2023-04-12 22:07:32 +00:00
Oleksii Bozhenko
53106c3a4f wsi: add rgb_component_bits_are_equal
Signed-off-by: Oleksii Bozhenko oleksii.bozhenko@globallogic.com

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22337>
2023-04-12 22:07:32 +00:00
Mike Blumenkrantz
7704773619 zink: handle swapchain handoffs around makecurrent
when a new resource is created for an extant swapchain, the existing
acquire (if any) should be transferred to the resource to ensure
expected behavior

this should be enough to fix piglit's glx-make-current

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22431>
2023-04-12 21:43:35 +00:00
Mike Blumenkrantz
5db5218044 zink: track per-image swapchain layouts
this is important for handing off the swapchain between resources
on makecurrent since a context that is made not-current will have its
swapchain resources destroyed while the swapchain persists

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22431>
2023-04-12 21:43:35 +00:00
Bas Nieuwenhuizen
ba73a41a2b radv: Reserve space for fast clear related writes.
Fixes: 9ee67467c9 ("radv: predicate cmask eliminate when using DCC.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22392>
2023-04-12 20:31:47 +00:00
Bas Nieuwenhuizen
1b5bd0f1c0 radv: Reserve space for updating DCC metadata.
Fixes: 9ee67467c9 ("radv: predicate cmask eliminate when using DCC.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22392>
2023-04-12 20:31:47 +00:00
Bas Nieuwenhuizen
771c0f0e65 radv: Reserve space in si_cs_emit_cache_flush.
Fixes: 4c6f83006d ("radv: Synchronization for task shaders.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22392>
2023-04-12 20:31:47 +00:00
Bas Nieuwenhuizen
1de978b873 radv: Reserve space in conditional rendering functions.
Fixes: e45ba51ea4 ("radv: add support for VK_EXT_conditional_rendering")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22392>
2023-04-12 20:31:47 +00:00
Bas Nieuwenhuizen
7f47d764e1 radv: Reserve space in various streamout functions.
Fixes: b4eb029062 ("radv: implement VK_EXT_transform_feedback")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22392>
2023-04-12 20:31:47 +00:00
Bas Nieuwenhuizen
4879f309a6 radv: Reserve space in framebuffer emission.
In the execute secondary scenario nothing else does it for us.

Fixes: 203f60ebf2 ("radv: emit framebuffer state from primary if secondary doesn't inherit it")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22392>
2023-04-12 20:31:47 +00:00
Georg Lehmann
0c8394908c aco/tests: add missing dependency on generated header
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8820
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22442>
2023-04-12 20:00:09 +00:00
Emma Anholt
f8a8b7708e etnaviv: Fix regression from if_uses change.
Flipped the condition in the conversion.

Fixes: 7f6491b76d ("nir: Combine if_uses with instruction uses")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22430>
2023-04-12 18:21:40 +00:00
Timur Kristóf
bd3191dbfe aco, radv: Remove redundant enable_mrt_output_nan_fixup from PS epilog info.
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/21935>
2023-04-12 17:30:02 +00:00
Timur Kristóf
af768afcbf aco, radv: Remove "key" from aco_compiler_options.
aco_compiler_options::key is a leftover from when aco used
the radv_pipeline_key struct, but aco_compiler_options::key was
never actually used as a cache key.

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/21935>
2023-04-12 17:30:02 +00:00
Timur Kristóf
80d8e8d828 aco: Remove setup_*_variables and add setup_lds_size 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/21935>
2023-04-12 17:30:02 +00:00
Timur Kristóf
facecd87e1 radv: Don't hardcode LDS granularity in gfx9_get_gs_info.
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/21935>
2023-04-12 17:30:02 +00:00
Timur Kristóf
4ae46840cd ac, aco, radv: Clarify LDS size on GFX6, and NGG shaders.
This information was wrong in some places, let's fix it now.

GFX6:
The GPU has 64KB LDS, but only 32KB is usable by a workgroup.

NGG:
There was some misinformation about NGG only being able to
address 32 KB LDS, it turns out this is actually not true
and it can address the full 64K.

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/21935>
2023-04-12 17:30:02 +00:00
Mike Blumenkrantz
edf30b1c6d zink: eliminate implicit feedback loops on rp begin
in a scenario like:
* bind fb
* clear
* bind fb attachment as sampler
* begin rp
* draw
* end rp
* flush
* bind new fs
* begin rp
* draw

the first draw will have an implicit feedback loop, but the second one will not
need a feedback loop. since no samplers or attachments are changed between
draws, however, the feedback loop will remain active for successive renderpasses,
which is problematic since the shader part of the driver (zink_update_barriers)
attempts to eliminate these same feedback loops, leading to layout desync

instead, add handling to attachment prep here to eliminate feedback loops
in the event that an attachment can be switched from a write layout to a read layout

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22423>
2023-04-12 15:43:01 +00:00
Mike Blumenkrantz
60d045e0b2 zink: pre-convert attachment id to attachment idx
this is a little simpler and allows reuse

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22423>
2023-04-12 15:43:01 +00:00
Mike Blumenkrantz
d649368009 zink: break out feedback loop pipeline state flagging for reuse
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22423>
2023-04-12 15:43:01 +00:00
Mike Blumenkrantz
aec938b1f8 zink: remove redundant 'blitting' check in zink_prep_fb_attachment()
this is a return conditional 2 lines above

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22423>
2023-04-12 15:43:01 +00:00
Samuel Pitoiset
4f3ddf31e0 radv: fix pipeline creation feedback with imported graphics libs
Stages imported from graphics pipeline libraries are defined as
additional entries in the order they were imported. This is similar
to raytracing libraries.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22288>
2023-04-12 15:03:42 +00:00
Erik Faye-Lund
d689a72bc5 zink: do not use sampled-image for buffers
In SPIR-V 1.6, sampled images with buffer dimensionality was disallowed.

The sampler that GLSL provides for buffer-textures is useless, and can
simply be ignored. So let's not treat them as samplers any more.

Fixes: bd816084c6 ("zink: enable spir-v 1.6 for vulkan 1.3")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8808
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22407>
2023-04-12 12:47:13 +00:00
Samuel Pitoiset
7783b7f697 radv: split radv_pipeline.c into radv_pipeline_{compute,graphics}.c
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21811>
2023-04-12 11:18:45 +00:00
José Roberto de Souza
02de31f6bb loader: Add Xe KMD support
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22425>
2023-04-12 10:41:21 +00:00
José Roberto de Souza
156464b67e iris: Handle Xe syncronization with syncobjs
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22425>
2023-04-12 10:41:21 +00:00
José Roberto de Souza
910e659e31 iris: Add function to close gem bos
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22425>
2023-04-12 10:41:21 +00:00
José Roberto de Souza
b1299f42ff anv: Fix vm bind of imported buffers
Imported buffers may be created in a device with different
memory alignment and this can cause vm bind to fail because bo
size can be smaller than the calculated vm bind range using the
importer device memory alignment.

So here adding actual_size to anv_bo, this will be set with the actual
size of the bo allocated by kmd for bos allocate in the current device.
For other bo the lseek or the Vulkan API size will be used.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22219>
2023-04-12 10:05:32 +00:00
Rob Clark
87978c3933 freedreno/a6xx: Allow z24s8 format casts
Allow UBWC format casts between z24s8/x24s8/z24x8.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8816
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22427>
2023-04-12 09:26:22 +00:00
Dmitry Baryshkov
fc5dd4035a freedreno/a5xx: add SP clock control register
Add GPMU_GPMU_SP_CLOCK_CONTROL register. Duplicated GPGMU is not a typo,
vendor kernel names it A5XX_GPMU_GPMU_SP_CLOCK_CONTROL.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22429>
2023-04-12 08:48:27 +00:00
Dmitry Baryshkov
05c22bdea1 freedreno/a5xx: reorder GPMU registers
Severeal GPMU registers were places out of the order. Move them to be
ordered proprely.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22429>
2023-04-12 08:48:27 +00:00
Collabora's Gfx CI Team
be5db62f88 Uprev Piglit to 355ad6bcb2cb3d9e030b7c6eef2b076b0dfb4d63
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22325>
2023-04-12 08:04:55 +00:00
Samuel Pitoiset
8f76a6a26e radv/ci: remove one RT test from the expected failures on RDNA3
It does pass.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22413>
2023-04-12 07:33:31 +00:00
Jesse Natalie
117ace3b14 dzn: Handle mismatches in bound descriptor set vs pipeline layout
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22420>
2023-04-12 04:14:46 +00:00
Kenneth Graunke
a4e13063ed iris: Hack around gbm_gralloc stride restrictions
gbm_bo_map returns a stride for the mapping, which may differ from the
stride of the underlying BO.  Drivers may implement mappings via staging
blits, returning a map of a temporary resource instead.  That temporary
may have fewer stride restrictions (i.e. it isn't used for display), and
thus be more tightly packed, saving memory.

However, gbm_gralloc has a design flaw where after calling gbm_bo_map,
it asserts that the stride exactly matches the original BO's stride:

   assert(stride == gbm_bo_get_stride(bo));

This is a bad assumption, as the GBM API returns a stride explicitly
precisely because it -can- differ.  But, this would require significant
changes to gbm_gralloc to fix.  So, to work around it, we add a driver
hack for Android-only that forces staging maps of any external BO to use
the original resource's stride.

This should fix issues with mapping cursor planes and SW media codec
uploads on Android-x86.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7974
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22156>
2023-04-11 23:45:04 +00:00
Kenneth Graunke
1452b60f35 iris: Extend resource creation helpers to allow for explicit strides
We'll want to create temporary staging images with explicit strides
in the next commit.  This extends iris_resource_create_with_modifiers
to have an explicit row_pitch_B parameter (0 continues to mean "let
ISL pick one").

Because resource_create_with_modifiers() is a driver hook, we can't
just add a parameter, so unfortunately we gain another wrapper layer.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22156>
2023-04-11 23:45:04 +00:00
Mike Blumenkrantz
59bb2f1aac zink: fix GPL lib leaking
this was improperly added into the conditional for removing a prog from the
ctx hash when it had no relation to that code, leading to refcount
leaks that ended up leaking the whole thing

Fixes: 487ac6dbd6 ("zink: implement cross-program pipeline library sharing")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22397>
2023-04-11 22:22:12 +00:00
Mike Blumenkrantz
a81a101159 zink: free GPL input/output libs on context destroy to avoid leaking
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22397>
2023-04-11 22:22:11 +00:00
Jesse Natalie
187efd4e97 d3d12: Fix buffer reference leak for SO count staging buffer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22417>
2023-04-11 22:08:11 +00:00
Karol Herbst
3b958f65ca rusticl: enable radeonsi
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19232>
2023-04-11 20:44:36 +00:00
Karol Herbst
c9ab7d7525 radeonsi: use default float mode for CL
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19232>
2023-04-11 20:44:36 +00:00
Karol Herbst
e5ef95e31f radeonsi: implement get_compute_state_info
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19232>
2023-04-11 20:44:36 +00:00
Mike Blumenkrantz
0c730f98c5 zink: unroll array loop when copying vars for passthrough shaders
wildcard derefs aren't supported in ntv

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22376>
2023-04-11 20:26:22 +00:00
Sil Vilerino
26f767d524 d3d12: Video processor to only promote resources to permanent residency when there is work to be flushed
This fixes some cases where flush is called from the app without work being scheduled before, causing d3d12_promote_to_permanent_residency
to be called with garbage pointers/arguments.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22415>
2023-04-11 20:09:19 +00:00
Danylo Piliaiev
17df75d47d vulkan: Sanitize pSampleMask in CmdSetSampleMaskEXT
ms.sample_mask is only 16b, while VkSampleMask is 32b and it is allowed
to have all of them set even if maximum 16 samples are supported.

E.g. happens with Zink running supertuxkart:
 supertuxkart: ../../../source/mesa/src/vulkan/runtime/vk_graphics_state.c:2346: vk_common_CmdSetSampleMaskEXT: Assertion `(dyn)->ms.sample_mask == (*pSampleMask)' failed.

  vk_common_CmdSetSampleMaskEXT (commandBuffer=0x5556e903f0, samples=VK_SAMPLE_COUNT_1_BIT, pSampleMask=0x5556819ccc) at vk_graphics_state.c:2346
  zink_draw<(zink_multidraw)1, (zink_dynamic_state)5, true, false> (...) at zink_draw.cpp:639
  zink_draw_vbo<(zink_multidraw)1, (zink_dynamic_state)5, true> (...) at zink_draw.cpp:922

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22360>
2023-04-11 19:20:50 +00:00
Mike Blumenkrantz
89aa363593 zink: block oom flushes during unordered blits
this is broken beyond space and time

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22412>
2023-04-11 18:59:13 +00:00
Timur Kristóf
b51e858d68 radv/amdgpu: Place secondary CS without IB2 in non-WC GTT.
When using a secondary CS without IB2, we have to memcpy the
contents into the primary CS. Use these flags to improve perf
by preventing memcpy from VRAM.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22354>
2023-04-11 17:05:03 +00:00
Timur Kristóf
7c5bf91350 radv/amdgpu: Extract radv_amdgpu_cs_bo_create function.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22354>
2023-04-11 17:05:03 +00:00
Timur Kristóf
0c1d4130ca radv/amdgpu: Add bool is_secondary argument to cs_create function.
Also save is_secondary to the CS object.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22354>
2023-04-11 17:05:03 +00:00
Timur Kristóf
c0fe6bbef1 radv: Allow task/mesh shaders with RADV_DEBUG=noibs.
The new submit code path should now be able to handle gang submit
even when chaining is not enabled.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22354>
2023-04-11 17:05:03 +00:00
Timur Kristóf
dc59a6b2ee radv/amdgpu: Respect maximum number of submitted IBs per IP type.
In a gang submit, the maximum number of IBs is per IP type,
and is different for each queue. Let's respect that.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22354>
2023-04-11 17:05:03 +00:00
Timur Kristóf
e4a37547a5 radv/amdgpu: Clean up submission functions.
Remove a useless extra function call, and rename fallback to
internal because it is the only code path left.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22354>
2023-04-11 17:05:03 +00:00
Timur Kristóf
50e6b16855 radv/amdgpu: Use fallback submit for queues that can't use IBs.
This commit consolidates the queue submit code paths into one.

Now we always allocate BOs for every CS, but when IBs aren't
allowed, we simply submit every BO to the kernel.

A microbenchmark done by Bas indicated that submitting more IBs to
the kernel only adds a negligible overhead. Additionally, this
allows us to stop copying the command buffer contents in system
memory and get rid of a lot of legacy code.

In order to be able to submit every BO, we make sure to add the
last BO to the old_ib_buffers array on cs_finalize. This also
necessitates some changes in cs_execute_secondary and other
functions.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22354>
2023-04-11 17:05:03 +00:00
Timur Kristóf
958ea2ec2a radv: Split submission in winsys instead of radv_queue.
This will still make it so that RADV_DEBUG=hang will only submit
one command buffer at a time, but otherwise let's pass all CS
objects into one submission and let the winsys split them if
necessary.

The winsys can do a better job at splitting them because
radv_queue has no knowledge of IBs and ignores chaining in the
splitting logic.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22354>
2023-04-11 17:05:03 +00:00
Timur Kristóf
41a9bced31 radv: Fill continue preambles and postambles properly.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22354>
2023-04-11 17:05:03 +00:00
Timur Kristóf
1bdc1bd36c radv/amdgpu: Split gang submissions correctly when not chained.
In a gang submit, the follower (typically ACE) and leader
(typically GFX) can have synchronization between each other.
We must ensure that these end up in the same submission,
otherwise we can deadlock the GPU.

We rely on radv_queue here to order follower before the leader
in the submitted CS array.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22354>
2023-04-11 17:05:03 +00:00
Timur Kristóf
813885f682 radv/amdgpu: Add ability to submit non-chained CS to fallback.
When submitting a CS whose IP type doesn't support chaining,
let's submit all the IBs that this CS allocated.

This is going to be better than the sysmem code path because it
doesn't require the winsys to memcpy the contents of the command
buffers.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22354>
2023-04-11 17:05:03 +00:00
Timur Kristóf
e4dd6a8eb3 radv/amdgpu: Add postambles to fallback submit.
Some new features, such as perf counters and gang submit use
postambles. Implement these properly.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22354>
2023-04-11 17:05:02 +00:00
Timur Kristóf
103ebe96c0 radv/amdgpu: Add continue preambles to fallback submit.
When splitting a larger submission into several smaller ones,
the flushing at the beginning of the initial preambles is not
really necessary, so it'll be better to use the continue
preambles for this purpose.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22354>
2023-04-11 17:05:02 +00:00
Timur Kristóf
6844506c3d radv/amdgpu: Allow multiple continue preambles.
For feature parity with initial preambles.
Previously, continue preambles were for GFX6 only, but this is
about to change in the next commits.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22354>
2023-04-11 17:05:02 +00:00
Timur Kristóf
8cea452bda radv/amdgpu: Rewrite fallback code path so it can split submissions.
Currently, radv_queue already splits submissions but we want to
change this and be able to split them in the winsys code as well.
Necessary because we want to split based on number of actual
IBs not number of command buffers, but radv_queue is not
aware of IBs.

Note that this commit does not actually take this new split into
use yet, that will be done in a following commit when it is ready,
this is why we set the max IB count higher than radv_queue here.

This commit is the first step in making "fallback" the default and
only submission code path.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22354>
2023-04-11 17:05:02 +00:00
Timur Kristóf
df90102a15 radv/amdgpu: Remove hw_can_chain in favour of use_ib.
They have the same meaning, but use_ib makes more sense because it
also takes the gfx_level into account.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22354>
2023-04-11 17:05:02 +00:00
Timur Kristóf
ccb4b78840 radv/amdgpu: Add a few assertions during submit.
These are useful when debugging the submission code.

- Ensure correct IB alignment
- Ensure we don't submit empty IBs

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22354>
2023-04-11 17:05:02 +00:00
Timur Kristóf
e5201987b1 radv/amdgpu: Extract radv_amdgpu_cs_add_old_ib_buffer.
This function will be used elsewhere in a following commit.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22354>
2023-04-11 17:05:02 +00:00
Timur Kristóf
44de40fb5f radv/amdgpu: Use correct alignment when creating CS BOs.
Shouldn't matter in practice because the kernel will likely
give us a page-aligned BO, but better to specify it just
in case.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22354>
2023-04-11 17:05:02 +00:00
Timur Kristóf
e214059120 radv/amdgpu: Only allow IB BOs on graphics and compute queues.
This disallows IB BOs on eg. SDMA queues which was previously
mistakenly left out.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22354>
2023-04-11 17:05:02 +00:00
Timur Kristóf
a7080fe4ef radv/amdgpu: Fix mismatching return type of radv_amdgpu_cs_submit.
Fixes a warning that is reported by GCC 13.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22354>
2023-04-11 17:05:02 +00:00
Timur Kristóf
daeb409559 ac: Add maximum number of submitted IBs.
The number of IBs per submit isn't infinite, it depends on the IP type
(ie. some initial setup needed for a submit) and the packet size.
It can be calculated according to the kernel source code as:
(ring->max_dw - emit_frame_size) / emit_ib_size

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22354>
2023-04-11 17:05:02 +00:00
Timur Kristóf
87d22933ae radv: Create continue preamble on GFX6 even when no shader rings are used.
Skipping the continue preamble can allow other processes to mess
up some	registers set by the current process.

Originally, we could omit generating the continue preamble when
no shader rings were used, because the register initialization
happened at the beginning of every main cmdbuf. However, this
isn't the case anymore.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22354>
2023-04-11 17:05:02 +00:00
xurui
0bba139767 zink: bs->dd.push_pool[1].pool should be freed
cc: mesa-stable

Signed-off-by: xurui <xurui@kylinos.cn>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22389>
2023-04-11 16:16:05 +00:00
Patrick Lerda
f9401a515a egl: fix memory leak related to _eglRefreshDeviceList()
Indeed, the unnecessary drmDevice objects were not freed.

For instance, this issue could be triggered with: "piglit/bin/egl_ext_platform_device -auto -fbo":
SUMMARY: AddressSanitizer: 2796 byte(s) leaked in 12 allocation(s).

Fixes: e39d72aec2 ("egl: only take render nodes into account when listing DRM devices")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22408>
2023-04-11 15:48:26 +00:00
David Heidelberg
1fa1c285fc ci/amd: add draw.dynamic_rendering flake
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22411>
2023-04-11 15:10:37 +00:00
Eric Engestrom
4b182dbcf2 v3dv/ci: mark known dEQP-VK.wsi.xlib.surface.query_formats failure
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22410>
2023-04-11 13:39:31 +00:00
Bas Nieuwenhuizen
a8cb837703 radv: Align atomic values.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22121>
2023-04-11 12:57:15 +00:00
Bas Nieuwenhuizen
02c46fa1e8 util/disk_cache: Align atomic size.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22121>
2023-04-11 12:57:15 +00:00
Bas Nieuwenhuizen
1c2d90f17a util: Add aligned int64_t types for x86(non 64).
To avoid split locks.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22121>
2023-04-11 12:57:15 +00:00
Samuel Pitoiset
9ccaf5583f radv: fix re-emitting vertex user SGPRs when binding a graphics pipeline
The base SGPR and the number of SGPRs can be equal but it was incorrect
because one VS can have draw_id and one can have base_instance. Fix
this by invalidating the vertex user SGPRs unconditionally.

Though they should also be invalidated after executing secondaries,
otherwise nothing is invalidated if the same pipeline is bind to the
primary again.

This fixes dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed*.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21652>
2023-04-11 12:12:05 +00:00
Daniel Schürmann
35805d172a radv/ci: add 2 more Flakes for Navi21
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22030>
2023-04-11 11:38:15 +00:00
Daniel Schürmann
dcfca69e67 radv: clean up pipeline-cache interface
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22030>
2023-04-11 11:38:15 +00:00
Daniel Schürmann
c2b9279227 radv: use vk_pipeline_cache
Replaces the RADV pipeline cache with an implementation
based on the common vk_pipeline_cache.

We use a dual-layer approach with two types of cache entries.

  1. radv_shader:
    - serialized as radv_shader_binary
    - uses SHA1 of the binary as key
  2. radv_pipeline_cache_object:
    - contains pointers to associated radv_shaders
    - serialized as list of SHA1
    - uses the pipeline hash as key

In combination with single-file disk-cache, this reduces the cache size by ~60%.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22030>
2023-04-11 11:38:15 +00:00
Daniel Schürmann
9b3679aff2 radv: implement radv_shader_create_cached()
This function takes a radv_shader_binary and writes it to the
disk cache before creating and returning a radv_shader cache entry.
The key of the cache entry is the full SHA1 hash of the binary.
This way, we will be able to deduplicate identical shaders.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22030>
2023-04-11 11:38:15 +00:00
Daniel Schürmann
55cc2fb088 radv: add struct radv_pipeline_cache_object
This patch implements a per pipeline cache-entry which contains
pointers to the associated shaders.
The serialized format contains the binary hashes of the shaders.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22030>
2023-04-11 11:38:15 +00:00
Daniel Schürmann
577d76f60f radv: add radv_shader_serialize() and radv_shader_deserialize() functions
These functions convert between radv_shader and radv_shader_binary.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22030>
2023-04-11 11:38:15 +00:00
Daniel Schürmann
efbf0e70eb radv: unconditionally store the binary code in radv_shader
We will (temporarily) use it to serialize shader binaries
with the common vk_pipeline_cache.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22030>
2023-04-11 11:38:15 +00:00
Daniel Schürmann
5303a57964 radv: derive struct radv_shader from vk_pipeline_cache_object
We will use radv_shader directly as cache entries.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22030>
2023-04-11 11:38:15 +00:00
Lionel Landwerlin
daa8003e45 intel/fs: use nomask for setting cr0 for float controls
The instructions manipulation cr0 use the default mask on lane0. So if
for some reason that lane is disabled in some of the dispatchs, we can
end up not executing the instructions.

Fixes flakyness in dEQP-VK.spirv_assembly.instruction.graphics.16bit_storage.uniform_float_32_to_16.uniform_matrix_float_rtz_frag

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22314>
2023-04-11 11:01:31 +00:00
Corentin Noël
45a682650c mesa: Add EXT_instanced_arrays support
The support for ARB_instanced_arrays already exists for big GL, reuse the same
PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR for this extension.

The OES_draw_elements_base_vertex and EXT_draw_elements_base_vertex both define
the DrawElementsInstancedBaseVertex method when EXT_instanced_arrays is defined.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22167>
2023-04-11 10:22:35 +00:00
Corentin Noël
8aa4d37b83 glapi: Make EXT_draw_instanced functions available for GLES 2.0
The EXT suffixed functions should be available in the GLES 2.0 context.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22167>
2023-04-11 10:22:35 +00:00
Corentin Noël
b3793dc442 mesa: OpenGL ES 3.0 requires EXT_instanced_arrays
Add it to the list of the required extensions.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22167>
2023-04-11 10:22:35 +00:00
Lionel Landwerlin
cff71ae8ff anv: fixup streamout write barriers
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8796
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22336>
2023-04-11 09:53:10 +00:00
Konstantin Seurer
2bf9ae78c5 radv: Remove radv_bvh_aabb_node::aabb
It was only read by RRA which can infer it from the parenbt internal
node.

Change in average build time (Control):
84.69471 ms -> 84.25319 ms

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22400>
2023-04-11 07:57:34 +00:00
Konstantin Seurer
1ce50f0774 radv/bvh: Remove calculate_node_bounds
It is unused and will prevent removing the aabb field from
radv_bvh_aabb_node.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22400>
2023-04-11 07:57:34 +00:00
Konstantin Seurer
f791cd9e43 radv: Pack and encode geometry id and flags on the CPU
There is no need to do it on the GPU.

Change in average build time (Control):
84.80691 ms -> 84.69471 ms

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22400>
2023-04-11 07:57:34 +00:00
Konstantin Seurer
8391639b5f radv: Remove has_previous_stage
MESA_SHADER_NONE implies that has_previous_stage is false.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22382>
2023-04-11 06:24:17 +00:00
Konstantin Seurer
b4bae8a2c0 aco: Remove is_gs_copy_shader
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22382>
2023-04-11 06:24:17 +00:00
Konstantin Seurer
58ab783153 radv: Remove some dead radv_shader_args setup
radv_declare_shader_args already sets them up.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22382>
2023-04-11 06:24:17 +00:00
Konstantin Seurer
6f9bb453ef radv: Add radv_shader_type to fix gs_copy and trap handler handling
is_gs_copy_shader and is_trap_handler_shader were cleared in
radv_init_shader_args. This restores the original behaviour.

Fixes: 67635bb ("radv: zero-initialize radv_shader_args right before declaring them")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22382>
2023-04-11 06:24:17 +00:00
Alyssa Rosenzweig
c66be7521f nir/lower_blend: Enable per-sample shading
Loading output require per-sample blending, so enable per-sample execution of
the shader as a whole so the right sample values are blended. Affects:

dEQP-GLES31.functional.multisample.default_framebuffer.sample_mask_sum_of_inverses

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22385>
2023-04-11 04:16:32 +00:00
Alyssa Rosenzweig
a74c2ac403 nir/lower_blend: Set uses_fbfetch_output conservatively
Only insert a load_output if we're going to use it, don't rely on it getting
DCE'd since that will mess up the shader info. This does require a bit of logic
to figure out whether we do need it.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22385>
2023-04-11 04:16:32 +00:00
Alyssa Rosenzweig
d998217e17 mesa/st: Set uses_sample_shading when forcing per-sample
In addition to requiring per-sample interpolation, sample shading
changes the behaviour of gl_SampleMaskIn, so we need per-sample shading
even if there are no shader-in variables at all. In that case,
uses_sample_shading won't be set by glsl_to_nir. We need to do so here.

Affected dEQP test on asahi:

   dEQP-GLES31.functional.shaders.sample_variables.sample_mask_in.bits_unique_per_two_samples.multisample_texture_4

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22402>
2023-04-11 03:32:41 +00:00
Jesse Natalie
52ba7e967b d3d12: Support creating PSOs with no attachments with MSAA without TIR
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22402>
2023-04-11 03:32:41 +00:00
Yiwei Zhang
1fda55ba09 venus: forward ARM driverVersion for ANGLE workarounds
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22242>
2023-04-11 03:17:56 +00:00
David Heidelberg
590959057c ci/amd: raven is currently downgraded to 2 machines only, adapt
Revert when all 5 machines are back online.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22403>
2023-04-11 02:33:52 +00:00
David Heidelberg
d9ba47e8d4 ci/amd: update device status
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22403>
2023-04-11 02:33:52 +00:00
David Heidelberg
fe96bb8dcc Revert "mesa: Enable NV_texture_barrier in GLES2+"
Fixes failing skqp GLES test:
 - gles_lcdblendmodes

This reverts commit c7da969f8f.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22403>
2023-04-11 02:33:52 +00:00
Friedrich Vock
900d622d8e radv: Add RT stages to radv_mesa_to_rgp_shader_stages
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22367>
2023-04-11 02:00:15 +00:00
Mike Blumenkrantz
de70c0cf88 lavapipe: implement inline variant caching
inlining is great, but it's less great if a new variant must be created
for every draw

to avoid this, cache inlined variants for reuse

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22363>
2023-04-11 01:37:05 +00:00
Mike Blumenkrantz
9f5bb8992f lavapipe: don't double-inline ubo0
this was already handled above and causes negative indexing

cc: mesa-stable

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22363>
2023-04-11 01:37:05 +00:00
Alyssa Rosenzweig
7582752233 ci: Run clang-format on panfrost
So we don't regress formatting in the future. This should never really trigger
if people configure their editors correctly, but it can help avoid regressing
the formatting from drive-by patches.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22372>
2023-04-10 21:56:04 +00:00
Alyssa Rosenzweig
c7bf3b69eb panvk: Clang-format
We're going to enforce clang-format in CI, so get with the program! This doesn't
change a *ton* all considered, because panvk was already aiming for the style we
have in the panfrost clang-format file.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22372>
2023-04-10 21:56:04 +00:00
Alyssa Rosenzweig
4ccf174009 panfrost: Re-run clang-format
We've regressed the clang-formatting in a few places, since we're not enforcing
formatting in CI yet and I think at one point my editor wasn't quite right.
Reapply so we can get to clang-format-clean.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22372>
2023-04-10 21:56:04 +00:00
Alyssa Rosenzweig
0a67386b40 pan/decode: Move comment out of designated initializer
clang-format chokes on this.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22372>
2023-04-10 21:56:04 +00:00
Alyssa Rosenzweig
c90f036516 panfrost/winsys: Clang-format
This was missed in the original clang-format commit because I touch this code so
infrequently, lol.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22372>
2023-04-10 21:56:04 +00:00
Alyssa Rosenzweig
edb5b03cde panfrost/winsys: Add .clang-format for winsys folder
Last place where Panfrost code hides.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22372>
2023-04-10 21:56:04 +00:00
Alyssa Rosenzweig
74a31491ed panfrost: Symlink gallium .clang-format to common
So we only have one .clang-format file to worry about.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22372>
2023-04-10 21:56:04 +00:00
Alyssa Rosenzweig
e3105f93bd mailmap: Update my e-mail
https://rosenzweig.io/blog/passing-reins-panfrost.html

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22399>
2023-04-10 21:54:05 +00:00
Mike Blumenkrantz
d87756923d lavapipe: refactor/consolidate GPL shader copying
this is easier to read/modify

also add asserts for members that should be null

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22352>
2023-04-10 21:35:57 +00:00
Mike Blumenkrantz
e33fda3732 lavapipe: copy fragment shader when merging GPL pipelines
this otherwise loses access data and causes flakiness with atomic ops

Fixes: 6e5fe71599 ("lavapipe: split out shader struct members into their own struct")

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22352>
2023-04-10 21:35:57 +00:00
Timur Kristóf
14be6b084e radv: Don't include nir.h in radv_shader.h
Avoid recompiling some RADV files when something changes in NIR.
Also clean up a few other includes.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22241>
2023-04-10 20:01:28 +00:00
Timur Kristóf
2ff1267959 aco: Only include nir.h in instruction selection.
Don't recompile entire ACO when something changes in NIR.
Instead, only use some headers which are actually needed,
include these in ACO files instead of relying on nir.h to
include them.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22241>
2023-04-10 20:01:28 +00:00
Timur Kristóf
8e9d269da6 aco: Don't use nir_selection_control in aco_ir.
We don't want to rely on any NIR structures in ACO, because
we would like to avoid the need to include nir.h in aco_ir.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22241>
2023-04-10 20:01:28 +00:00
Timur Kristóf
cff02468c6 aco: Fix optimization of v_cmp with subgroup invocation.
There was a typo in this optimization which went unnoticed.

Fixes: 2c40215ab9
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22393>
2023-04-10 19:15:27 +00:00
Yiwei Zhang
57afa79933 venus: move exp feature init back to ring and remove unused function
This mostly undos 476c771e34 and removes
the unused vn_renderer_submit_simple_sync.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22323>
2023-04-10 18:59:40 +00:00
Yiwei Zhang
b285083cad venus: requires ringMonitoring
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22323>
2023-04-10 18:59:40 +00:00
Yiwei Zhang
5fcb2830e6 venus: requires asyncRoundtrip
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22323>
2023-04-10 18:59:40 +00:00
Jesse Natalie
3cbd4fb61b dzn: Don't enable bindless by default
There's bad interactions with dynamic buffers at this point:
* Perf issues due to allocating and freeing the buffer to store indices/offsets
* Large dynamic uniform buffer offsets (above 65K) cause out-of-bounds reads

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22371>
2023-04-10 18:43:12 +00:00
Jesse Natalie
4d142ec594 dzn: Never set STATE_RENDER_TARGET on a compute command list
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22371>
2023-04-10 18:43:12 +00:00
Jesse Natalie
5aca593262 dzn: Ignore unnormalized sampling flag if driver doesn't support it
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22371>
2023-04-10 18:43:12 +00:00
Jesse Natalie
51c96cb745 dzn: Use a linear allocator for upload data on command buffers
Significantly improves performance for apps that heavily use
dynamic descriptors.

Still needs caching so they can be re-used after command buffer reset.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22371>
2023-04-10 18:43:12 +00:00
Jesse Natalie
0c2848f44a dzn: Changes to descriptor set dirty flag handling
The scenario of:
* App binds multiple descriptor sets
* App binds a pipeline that uses a subset of them
* App binds a pipeline that uses more of them

was broken. We were only copying the descriptors for the accessible
subset before, but then clearing all dirty bits, so simply changing
the pipeline wouldn't result in more descriptors being copied.

When running not-bindless, the right thing to do is to copy *all*
descriptors if we're copying any. When running bindless, each parameter
is set separately, and more importantly, *can't* be set on the command
list if the root signature can't access them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22371>
2023-04-10 18:43:12 +00:00
Jesse Natalie
01ccba0d8e microsoft/compiler: Don't split loads/stores that will be split by lower_explicit_io
Otherwise we can end up splitting push constant loads, which currently require
an unbroken (no-cast) deref chain up to the variable.

Fixes: 4c527f4f ("spirv2dxil: Lower unaligned loads and stores")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22371>
2023-04-10 18:43:12 +00:00
Samuel Pitoiset
642a88df3d docs: add more release notes for RADV
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22390>
2023-04-10 18:37:26 +00:00
Rhys Perry
bb653b0acb nir: make nir_fisnan helper exact
Floating point ALU assume no NaNs unless
FLOAT_CONTROLS_SIGNED_ZERO_INF_NAN_PRESERVE_FPn or (for some opcodes)
exact=true.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: bf9c1699cd ("nir: add nir_fisnan helper function")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22206>
2023-04-10 17:42:24 +00:00
Vitaliy Triang3l Kuzmin
a6ab0cff08 radv: Set DB_Z_INFO.NUM_SAMPLES to MSAA_EXPOSED_SAMPLES without Z/S
This case is a new addition in GFX11, and according to PAL, when no
depth/stencil attachment is bound, it must be set to the number of coverage
samples (the number of SampleMask bits - which is MSAA_EXPOSED_SAMPLES):

4640888b57/src/core/hw/gfxip/gfx9/gfx9UniversalCmdBuffer.cpp (L6978)

Without this change, the maximum of depth/stencil and color sample counts
is used, and if there are no depth/stencil or color attachments (target-
independent rasterization), the Depth Block assumes 1 coverage sample, and
thus Primitive Ordered Pixel Shading doesn't work correctly (and fails 4xAA
fragment shader interlock CTS tests), and occlusion queries don't count the
correct number of samples (according to the "Sample Counting" section of
the Vulkan specification, "the occlusion query sample counter increments by
one for each sample with a coverage value of 1...")

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22375>
2023-04-10 15:07:30 +00:00
Mike Blumenkrantz
75a7dcf35f zink: try to prune resources from barrier jit on fb unbind
if a resource has no binds remaining then it should not remain in
the queue for barrier updates on the next draw

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22398>
2023-04-10 14:44:13 +00:00
André Almeida
871aa64e53 winsys/amdgpu: Fix amdgpu_cs_query_reset_state2 error log
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: André Almeida <andrealmeid@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22253>
2023-04-10 13:50:36 +00:00
André Almeida
ad4a72c11e radv: Implement vk.check_status
Implement check_status function so the driver can check if the GPU has
been reset by the application, and thus if it's still available.

AMDGPU_CTX_QUERY ioctls work by asking amdgpu if this context was the
cause of a previous GPU reset.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: André Almeida <andrealmeid@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22253>
2023-04-10 13:50:36 +00:00
Samuel Pitoiset
c8949db0cc radv/ci: update expected failures with BONAIRE
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22391>
2023-04-10 11:47:15 +00:00
Samuel Pitoiset
18ea108038 radv/ci: remove no longer existing tests for PITCAIRN
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22366>
2023-04-10 10:53:47 +00:00
Samuel Pitoiset
d3e5a1f638 radv/ci: update expected failures for PITCAIRN
These have been recently fixed.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22366>
2023-04-10 10:53:47 +00:00
Samuel Pitoiset
6476abd821 radv: enable VK_EXT_graphics_pipeline_library by default
You won't get your money back!

It's been a very long time but everything should be working great now.

This replaces RADV_PERFTEST=gpl by RADV_DEBUG=nogpl to disable the
extension for debugging purposes.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22362>
2023-04-10 10:02:32 +00:00
Daniel Schürmann
719a0e269e vulkan/pipeline_cache: move vk_log on failed deserialization to vk_pipeline_cache_load()
Partially evicted or corrupted disk cache entries should not create
application cache log entries.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21967>
2023-04-10 09:14:30 +00:00
Daniel Schürmann
53eb3ad375 vulkan/pipeline_cache: add cache parameter to deserialize() function
This allows for secondary cache lookups during deserialization.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21967>
2023-04-10 09:14:30 +00:00
Daniel Schürmann
a6360a3203 vulkan/pipeline_cache: use vk_pipeline_cache_create_and_insert_object() during vk_pipeline_cache_load()
This avoids an extra serialize() step for disk-cache insertion.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21967>
2023-04-10 09:14:30 +00:00
Daniel Schürmann
f524f91d6f vulkan/pipeline_cache: implement vk_pipeline_cache_create_and_insert_object()
This function directly inserts the serialized data into the disk cache
before calling deserialize() and inserting into the pipeline cache.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21967>
2023-04-10 09:14:30 +00:00
Daniel Schürmann
84fa7b1745 vulkan/pipeline_cache: Don't re-insert disk-cache hits into disk-cache
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21967>
2023-04-10 09:14:30 +00:00
Daniel Schürmann
5daff41e27 vulkan/pipeline_cache: remove vk_device from vk_pipeline_cache_object
It is not necessary to store the extra pointer.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21967>
2023-04-10 09:14:30 +00:00
David Heidelberg
4ac56e3e5a ci/v3d: add flaking spec@ext_framebuffer_blit@fbo-sys-blit
Flakes on both RPI 3 and RPI 4.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22377>
2023-04-08 22:24:47 +02:00
Timur Kristóf
ba537ac25a ac/llvm: Cover runtime 0 in GFX10 gs_alloc_req workaround.
Previously, the workaround only covered compile-time zero, but
this is insufficient and can cause GPU hangs in RadeonSI when
NGG culling is enabled.

Fix this by handling runtime zero in the workaround.

Cc: mesa-stable
Signed-off-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/22370>
2023-04-08 13:54:06 +00:00
Adam Jackson
c7da969f8f mesa: Enable NV_texture_barrier in GLES2+
The spec text is written against 3.2 but only requires framebuffer
objects and ES2.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19234>
2023-04-08 06:10:44 +00:00
Kenneth Graunke
98bcf650f1 intel/compiler: Use nir_dest_bit_size() for ballot bit size check
There's no guarantee that this is a SSA value.  Use the helper to handle
both SSA values and register correctly.  Otherwise we read trash when we
encounter a register and make bad decisions on types, possibly leading
to our destination being UQ typed when the VGRF is only 32-bit.

Fixes compilation with -Dintel-clc=enabled since 7f6491b76d
(nir: Combine if_uses with instruction uses) but the bug is much older
than that, circa 2017.  We were just getting lucky before.

Fixes: 069bf7c907 ("i965/fs: Match destination type to size for ballot")
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22374>
2023-04-07 19:28:56 -07:00
Alyssa Rosenzweig
f5471ca965 nir/validate: Only walk uses once
Ostensibly faster.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
9a35079074 nir/repair_ssa: Refactor some use handling
We can mostly unify the instr-use and if-use handling, which is a lot more
concise.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
dcb59a7672 nir: Remove nir_if_rewrite_condition_ssa
Now unused.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
ed85a49727 dxil: Use nir_src_rewrite_ssa
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
e25c182993 nir: Use nir_src_rewrite_ssa
Where sensible.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
e9e0956d62 nir: Factor out nir_src_rewrite_ssa helper
Like nir_instr_rewrite_ssa but without the asserted extra argument. Works on ifs
too, now that we have a unified use list.

We do need to assert that the source has actually been inserted and has valid
use/def chains. Previously, asserting on the parent instruction accomplished
that indirectly. For the more general helper, we instead directly assert that
there exists a non-null parent, whatever it is.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
2285b5daae nir: Reduce indirection
A source used by an if is necessarily the condition of that if.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
373bd37b85 dxil: Avoid list_length
Do O(1) check instead.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
c4a91c12dc nir/validate: Don't treat if-uses specially
We don't use the tag anywhere, so don't bother with it.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-by: Faith Ekstrand <faith@gfxstrand.net>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
f3b420692b nir: Remove 2nd argument from nir_before_src
We can now determine whether a nir_src is for an if without a sideband, so
simplify the function signature.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-by: Faith Ekstrand <faith@gfxstrand.net>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
8505f0bd84 nir/opt_loop_unroll: Avoid list_length
It is O(N) but can often be replaced with something O(1).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
7356f3eee7 nir/opt_ray_queries: Don't use list_length
Expensive.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
7f6491b76d nir: Combine if_uses with instruction uses
Every nir_ssa_def is part of a chain of uses, implemented with doubly linked
lists.  That means each requires 2 * 64-bit = 16 bytes per def, which is
memory intensive. Together they require 32 bytes per def. Not cool.

To cut that memory use in half, we can combine the two linked lists into a
single use list that contains both regular instruction uses and if-uses. To do
this, we augment the nir_src with a boolean "is_if", and reimplement the
abstract if-uses operations on top of that list. That boolean should fit into
the padding already in nir_src so should not actually affect memory use, and in
the future we sneak it into the bottom bit of a pointer.

However, this creates a new inefficiency: now iterating over regular uses
separate from if-uses is (nominally) more expensive. It turns out virtually
every caller of nir_foreach_if_use(_safe) also calls nir_foreach_use(_safe)
immediately before, so we rewrite most of the callers to instead call a new
single `nir_foreach_use_including_if(_safe)` which predicates the logic based on
`src->is_if`. This should mitigate the performance difference.

There's a bit of churn, but this is largely a mechanical set of changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
Alyssa Rosenzweig
fd9c69218a tu: Use vk_features2_to_features
Sanitizes properties returned through GetPhysicalDeviceFormatProperties2.

Bit-31 is not valid to return in the original
vkGetPhysicalDeviceFormatProperties{2,}. Sanitize the bit returned from the
internal to ensure invalid bits aren't return to the application.

Falls in line with the other vulkan drivers.

Based on original commit by Ryan Houdek.

Closes: #8733
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>
2023-04-07 18:16:43 -04:00
Alyssa Rosenzweig
4fa2924610 anv,hasvk: Use vk_features2_to_features
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>
2023-04-07 18:16:40 -04:00
Alyssa Rosenzweig
672a06a1b6 pvr: Use vk_features2_to_features
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>
2023-04-07 18:16:40 -04:00
Alyssa Rosenzweig
c517d45341 lavapipe: Use vk_features2_to_features
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>
2023-04-07 18:16:40 -04:00
Alyssa Rosenzweig
b222b02d3d v3dv: Use vk_features2_to_features
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>
2023-04-07 18:16:40 -04:00
Alyssa Rosenzweig
a7389f6894 radv: Use vk_features2_to_features
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>
2023-04-07 18:16:40 -04:00
Alyssa Rosenzweig
657e82a72f vulkan: Add common features2_to_features
Needed to correctly implement GetPhysicalDeviceFormatProperties2.

Cc stable so the turnip patch can get backported cleanly.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22217>
2023-04-07 18:16:27 -04:00
Mike Blumenkrantz
6894548d6c Revert "zink: don't trigger shader variants on pcp change if driver supports dynamic pcp"
This reverts commit 472fcf74e2.

this is sort of right but then also sort of broken, going to rework a little

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22368>
2023-04-07 20:22:11 +00:00
Samuel Pitoiset
79655e2ea8 radv: copy stages instead of serializing NIR for GPL with the RETAIN flag
When the driver gets a cache hit for the binary, we still have to
retain shaders because we can't know if the LTO pipeline will be a
cache hit as well.

Though, serializing the NIR is too costly and most of the libraries
took more than 10ms to be created, which isn't acceptable. To fix this,
keep track of the shaders stage info for libs with the RETAIN flag.

This might be replaced by NIR caching later if it's worth a try.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22327>
2023-04-07 19:43:05 +00:00
Samuel Pitoiset
edb198e0b1 radv: create a helper for copying VkPipelineShaderStageCreateInfo
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22327>
2023-04-07 19:43:05 +00:00
Samuel Pitoiset
6181ba11d5 radv/rt: stop storing unused hashes/identifiers
This is never used.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22327>
2023-04-07 19:43:05 +00:00
antonino
a782393b1a zink: fix sampler array collision in nir_to_spirv
`nir_to_spirv` has flat arrays to map driver_location to sampler
variables.

Now when bindless textures are used together with non binless textures
the sampler vars are in different descriptor sets and the binding can be
the same between different descriptor sets, this causes a collision in
arrays.

This patches chamges `nir_to_spirv` to also index the array by whether
the texture is bindless.

Fixes: bc202553e9 ("zink: implement bindless textures")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22358>
2023-04-07 19:25:08 +00:00
antonino
4579fe5fad zink: add descriptor_bindless_id to zink_shader_info
This field stores the id of the descriptor set used for bindless
textures.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22358>
2023-04-07 19:25:08 +00:00
Jesse Natalie
c0c16d1ae2 dzn: Remove xfail for test that passes (if run)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22346>
2023-04-07 19:11:11 +00:00
Jesse Natalie
e4da9c2dfc dzn: Support >2K samplers with bindless
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22346>
2023-04-07 19:11:11 +00:00
Jesse Natalie
b269c206c1 dzn: Remove skips now that WARP is faster
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22346>
2023-04-07 19:11:11 +00:00
Jesse Natalie
16e70708ba dzn: Don't leave deleted physical devices in the instance pdev list
Fixes: cfa260cd ("dzn: Use common physical device list/enumeration helpers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22346>
2023-04-07 19:11:11 +00:00
Jesse Natalie
71dbb3120a dzn: Use GetResourceAllocationInfo3 for castable formats
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22346>
2023-04-07 19:11:11 +00:00
Jesse Natalie
4fad8931f5 dzn: Clean up ABI helpers now that we require DirectX-Headers 606
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22346>
2023-04-07 19:11:11 +00:00
Jesse Natalie
33051f1eb4 dzn: Early-out on no-op barriers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22346>
2023-04-07 19:11:11 +00:00
Mike Blumenkrantz
472fcf74e2 zink: don't trigger shader variants on pcp change if driver supports dynamic pcp
this otherwise pointlessly creates and binds shader variants that do nothing

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22365>
2023-04-07 18:32:34 +00:00
Mike Blumenkrantz
172054e305 zink: reuse copy_vars for generated tcs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22364>
2023-04-07 17:44:29 +00:00
Mike Blumenkrantz
762a29279b zink: reuse d3d12 variable copying to make passthrough gs more robust
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22364>
2023-04-07 17:44:29 +00:00
Felix DeGrood
4dc7256bf9 anv: reset query pools using blorp
Previously we used PC to set query data to 0 during
CmdResetQueryPool. This was slow when clearing large query pools.
Switching to blorp to clear pools is faster for large query pools.

Red Dead Redemption 2: +1.5% speedup

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>
2023-04-07 15:51:20 +00:00
Lionel Landwerlin
bb49610973 anv: replace query flush before gpu copy by semaphore wait
All the flushes should already have happened, we just need CS to wait
for the operations to complete. Just use a MI_SEMAPHORE_WAIT to check
the availability bit is set.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>
2023-04-07 15:51:20 +00:00
Lionel Landwerlin
abc4111d19 anv: pass steam output as argument for anv_dump_pipe_bits
Just if you need to change it at some point ;)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>
2023-04-07 15:51:20 +00:00
Felix DeGrood
2415d57a99 anv/blorp: add flush reasons to RT flushes
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>
2023-04-07 15:51:20 +00:00
Felix DeGrood
43f93f5043 anv/blorp: implement anv_cmd_buffer_fill_area
Implemented function to fill an area at an address.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>
2023-04-07 15:51:20 +00:00
Felix DeGrood
0130a4f667 anv/blorp: support surf generation for addresses
Already have support for anv_buff. Extended to support addresses.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22178>
2023-04-07 15:51:20 +00:00
Raun
9d38c9ca2f dzn: Enable VK_KHR_get_memory_requirements2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22349>
2023-04-07 15:35:10 +00:00
Raun
a9a0dc3cca dzn: Enable VK_KHR_bind_memory2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22349>
2023-04-07 15:35:10 +00:00
Samuel Pitoiset
bcd33d2937 radv: import retained NIR shaders later in the compilation process
This allows us to remove the intermediate NIR shader pointer.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22356>
2023-04-07 14:38:46 +00:00
Samuel Pitoiset
e909764930 radv: do not retain noop FS for libs when a cache hit happened
Determine if the graphics pipeline needs a noop FS later instead of
retaining it. This was also suboptimal.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22356>
2023-04-07 14:38:46 +00:00
Samuel Pitoiset
34fa60e138 radv: simplify a check when retaining NIR shaders
The RETAIN flag is only allowed with graphics libs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22356>
2023-04-07 14:38:46 +00:00
Samuel Pitoiset
3b5ea90f1d radv: move the serialized NIR to radv_graphics_lib_pipeline
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22356>
2023-04-07 14:38:46 +00:00
Samuel Pitoiset
4672c6c43b radv: add a helper for retaining NIR shaders
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22356>
2023-04-07 14:38:46 +00:00
Mike Blumenkrantz
dc18570c0a zink: don't access non_fs part of zink_shader from fs
Fixes: a6de15eff5 ("zink: add flags to `zink_gfx_program` and `zink_context`")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22347>
2023-04-07 13:10:03 +00:00
Mike Blumenkrantz
215beee16d zink: more explicitly track/check rp optimizing per-context
if tc creation fails for whatever reason, rp optimizing must be
marked as disabled for that context to avoid erroneous assumptions
about rp operation

fixes #8787

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22319>
2023-04-07 12:29:56 +00:00
Qiang Yu
2c78cbbfe1 ac/llvm: remove some unused code replaced by nir
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22304>
2023-04-07 03:42:25 +00:00
Qiang Yu
a2cecbbc44 ac/nir/ngg: fix store shared alignment
For stream!=0, this align_mul=4 is not true. Not observe any
problem yet, just for correctness.

Fixes: 60ac5dda82 ("ac: Add NIR lowering for NGG GS.")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22304>
2023-04-07 03:42:25 +00:00
Qiang Yu
c082cdacae ac/nir/ngg: fix gs culling vertex liveness check for odd vertices
If vertex does not complete a primitive, it should not set the odd
flag which miss lead liveness check when culling is enabled.

For example, if odd flag is set regardless of complete flag, when
culling is enabled, 3 vertices of a triangle's init prim flag:
  [0x00 0x04 0x01]

then after culling, this triangle has been culled, their prim flag:
  [0x00 0x04 0x00]

the second vertex is miss treat as live because its odd flag (code
check prim_flag!=0 for liveness).

Fixes: 1bdeb961bd ("ac/nir/ngg: add gs culling")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8725
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22304>
2023-04-07 03:42:25 +00:00
Qiang Yu
fc3d8e1125 radeonsi: fix max scrach lds size calculation when ngg
Fixes: 028d0590f8 ("radeonsi: replace llvm ngg vs/tes with nir lowering")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22304>
2023-04-07 03:42:25 +00:00
Asahi Lina
9fcadd0c8d asahi: Allow explicit non-LINEAR modifiers for scanout
The compositor is responsible for picking the right supported modifiers
for scanout. If we get no modifiers, we have to assume linear, but if we
do, just roll with it and don't attempt to force things.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
534a04d557 asahi: Flip kmsro around to allocate on the GPU
Our display controller can handle arbitrary GPU imports, so there is no
reason to use dumb KMS buffers. Allocate everything on the GPU instead.

This also allows us to be lazy about mapping things to the KMS side, so
only clients that really want a KMS handle actually do that, which stops
us from ending up with a bunch of junk mapped to DCP (e.g. X11 clients
always request SCANOUT even under XWayland).

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
9db36376a6 asahi: Fix compressed ZS support
Depth/stencil formats are "not renderable" but do support compression.

I swear I already fixed this at some point and the commit must've fallen
through the cracks...

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
2296f69629 asahi: Print reasons why compression is disabled
For resource debug. Found a regression in compressed depth this way.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
888d443f29 asahi: Add resource debugging
I keep re-implementing this every time I look at resource-related
issues. Let's just make it official so we can turn it on with a flag
instead of having to add printfs every time ^^

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
0a132b0640 asahi: Add a helper macro for debug/error messages
This includes the program short name in the message, which is useful
when running entire desktop sessions with a single log to figure out who
is doing what.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
883ba4b161 asahi: Make BO import path failures more robust
These operations can fail for complex reasons through no fault of mesa,
so we should have proper runtime checks for them even in release builds.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
fcf594d00b asahi: Implement valid buffer range tracking
A common pattern is to allocate a vertex/etc buffer and write to it in
subsets. Some games interleave this with draw calls using the buffer.
This causes very expensive flushing for every draw call.

Fix this by tracking which range of a buffer has been written to, and
elide syncs when the range was previously uninitialized.

Fixes Source engine game performance and probably helps a bunch of
others.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
00064ba4e3 asahi: Fix style nits
Found with a grep abomination which is probably too broken/silly to
actually implement in CI... but hey, at least it found some.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
a88b9c5540 asahi: Locate low VA BOs correctly
These need the shader_base added to them.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
030b2306a4 asahi: Enable glthread
This helps a lot with FEX, since the GPU driver runs emulated (and only
64bit supports thunking).

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
4a5115c47b asahi: Make agx_alloc_staging() take a screen instead of a context
This makes it clear that it is thread-safe.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Asahi Lina
75e3212809 Revert "asahi: Advertise dual-source blending"
This reverts commit f4e2b22646.

This is broken until GL3 is enabled, possibly due to a core Mesa bug,
but it's a corner case not worth fixing.

Fixes Chromium.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Alyssa Rosenzweig
8a6d74d15b agx: Make signal_pix instructions explicit
Rather than implicitly packing them with the sample_mask. Again, this is just
changing where they're emitted, no functional changes yet. Bug for bug
compatibility with the old behaviour.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Alyssa Rosenzweig
bb530760a2 agx: Rename writeout to wait_pix
This is the name applegpu is currently using, to capture the semantics of a
pixel fence. I'm not sure what Apple calls this but wait_pix is closer than
writeout for sure.

This commit just does the rename. It doesn't fix the broken semantics we've had,
this is to ease review and bisection.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Alyssa Rosenzweig
2028e7b88b agx: Tease apart some sample_mask packing magic
There's a second instruction here, and a second source in the first instruction.
applegpu has known about the encodings for a while but I never updated the
packing code. We will need to stop hardcoding this for multisampling support, as
preparation tease apart the magic pieces.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Alyssa Rosenzweig
13b3da822b asahi: Clamp texture buffer sizes
Per the spec / freedreno. Fixes
arb_texture_buffer_object-texture-buffer-size-clamp

Fixes: 6b22a02f90 ("asahi,agx: Implement buffer textures with gnarly NIR")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Alyssa Rosenzweig
c4175c5fc8 asahi: Dirty track depth bias uploads
Reduces how much we upload in SuperTuxKart.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:04 +00:00
Alyssa Rosenzweig
23880daa8d asahi: Lower 1D to 2D
Khronos APIs require that we support mipmapping even for 1D textures. However,
it isn't clear if this is supported in the hardware, and how it would work even
if it is. But 1D textures are pretty useless, so we just lower 1D textures to 2D
textures instead of worrying about that.

Fixes piles of Piglits relating to 1D textures.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
098295f1a0 asahi: Implement null textures
Use the same silly workaround that Metal does, to fill in texture descriptors
when there's nothing bound in the interest of robust behaviour.

Fixes null pointer dereference in
arb_shading_language_420pack-active-sampler-conflict.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
1fb4e34020 asahi: Honour sampler count
It may not be equal to the texture count. Prevents a regression from the next
commit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
203c9c12e2 agx: Don't overallocate registers
We need to account for the full vector lengths. Especially important once we
start restricting the reg file.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
42c5d6140b agx: Coalesce more collects
Try harder to coalesce collects, by trying to allocate collects only to regions
of the register file where we actually have a full vector worth of registers
free. If we already know that the vector will be blocked later, it's not a good
base register to pick since we'd be force to shuffle later. So, this tweak to
the collect coalescing heuristic lets us eliminate a pile of pointless copying.

shader-db results are excellent. Note that, although we use more registers,
none of the shaders tested had their thread count affected, likely because the
max HURT isn't too high and most of the scary % here is from using a few more
registers when the register pressure is already low. In the near future, that
property will become guaranteed thanks to live range splitting, too.

total instructions in shared programs: 1507337 -> 1500562 (-0.45%)
instructions in affected programs: 428137 -> 421362 (-1.58%)
helped: 2658
HURT: 167
helped stats (abs) min: 1.0 max: 34.0 x̄: 2.63 x̃: 2
helped stats (rel) min: 0.10% max: 25.00% x̄: 3.04% x̃: 2.14%
HURT stats (abs)   min: 1.0 max: 10.0 x̄: 1.24 x̃: 1
HURT stats (rel)   min: 0.20% max: 23.81% x̄: 3.90% x̃: 3.57%
95% mean confidence interval for instructions value: -2.49 -2.31
95% mean confidence interval for instructions %-change: -2.76% -2.51%
Instructions are helped.

total bytes in shared programs: 10333670 -> 10293172 (-0.39%)
bytes in affected programs: 2996682 -> 2956184 (-1.35%)
helped: 2660
HURT: 175
helped stats (abs) min: 2.0 max: 204.0 x̄: 15.70 x̃: 12
helped stats (rel) min: 0.08% max: 23.08% x̄: 2.64% x̃: 1.83%
HURT stats (abs)   min: 2.0 max: 60.0 x̄: 7.26 x̃: 6
HURT stats (rel)   min: 0.12% max: 22.39% x̄: 3.19% x̃: 2.78%
95% mean confidence interval for bytes value: -14.81 -13.76
95% mean confidence interval for bytes %-change: -2.39% -2.18%
Bytes are helped.

total halfregs in shared programs: 417284 -> 427363 (2.42%)
halfregs in affected programs: 49814 -> 59893 (20.23%)
helped: 95
HURT: 3018
helped stats (abs) min: 1.0 max: 8.0 x̄: 2.29 x̃: 2
helped stats (rel) min: 2.44% max: 28.57% x̄: 9.20% x̃: 6.06%
HURT stats (abs)   min: 1.0 max: 14.0 x̄: 3.41 x̃: 4
HURT stats (rel)   min: 2.08% max: 150.00% x̄: 36.54% x̃: 27.27%
95% mean confidence interval for halfregs value: 3.17 3.31
95% mean confidence interval for halfregs %-change: 34.05% 36.23%
Halfregs are HURT.

total threads in shared programs: 16465280 -> 16465280 (0.00%)
threads in affected programs: 0 -> 0
helped: 0
HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
43b221cd59 asahi: Set PIPE_CAP_LOAD_CONSTBUF
The CAP is a bit of a misnomer, what it really does is relax the alignment
requirements for UBO packing. It should work fine and save us some memory.
Noticed while debugging piglit fails.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
8e501b758a asahi/decode: Print VDM barriers
Instead of just decoding silently.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
0bbd8b502a asahi/decode: Remove agxdecode_dump_bo
Now that we have proper parsing this is more of a nuissance than not.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
e713983875 agx: Add helper for calculating occupancy
Add information about the relationship between program register usage and
program occupancy (the maximum number of threads that may execute concurrently
on a single shader core). This table is derived from studying the
maxTotalThreadsPerThreadgroup property in Metal while varying the register
usage, something I blogged about a few years back. It's probably not 100%
accurate and it hasn't been tested against hardware, but it matters "only" for
performance (not correctness) so I'm not super stressed about the details.

In the (near) future, RA will be able to make use of this information to know
exactly when it can use more registers without hurting performance. In the
present, it's just used for better shader-db statistics.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
05e614cc31 agx: Set loads_varying accurately
Instead of just always mashing to true. Should be better for depth-only passes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
80adaa47e5 asahi: Add perf debug for shader variants
Compiling this can cause jank. This is still an issue in Quake3. There is a way
to solve it but it's rather involved and certainly not this weekend's project.
Better perf debugging on the other hand apparently is ^_^

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
3a4920e928 asahi: Add perf debug for generate_mipmap
The current implementation leaves a lot of perf on the table, so call it out on
ASAHI_MESA_DEBUG=perf to help debugging perf problems, especially if this
ever happens in a real application (i.e. not a benchmark).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
3a87d2cfbd agx: Don't destroy usub_sat with constant
Fixes KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-cs-std430-vec-pad

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
8ec91ee16f agx: Don't allow uniform source to local_atomic
Fixes KHR-GLES31.core.compute_shader.atomic-case3

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
c643f42dc6 agx: Constify agx_{read,write}_registers
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
da9c8a4627 agx: Assert that we don't overflow registers
This will become particularly important when we bound to smaller register files.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
7c7b95ba2a agx: DCE even with noopt
To simplify live range splitting, RA will soon assume that DCE has run (removing
extraneous vectors). So run DCE even when otherwise disabling backend
optimizations. AGX_MESA_DEBUG=noopt is still useful for disabling instruction
combining, which is the more-likely-to-be-buggy pass anyway.

This also fixes IR not being printed with noopt.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Alyssa Rosenzweig
75b858e904 asahi: Support more renderable formats
Fixes KHR-GLES3.copy_tex_image_conversions.forbidden.*

Arguably working around a mesa/st issue but more format support is good for
compatibility and performance anyway.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Janne Grunau <j@jannau.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22353>
2023-04-07 03:23:03 +00:00
Yiwei Zhang
fc22380c32 venus/docs: sync to latest venus supported extensions
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22243>
2023-04-07 03:05:02 +00:00
Yiwei Zhang
bb7424b4b4 venus: add VK_EXT_rasterization_order_attachment_access support
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22243>
2023-04-07 03:05:02 +00:00
Yiwei Zhang
9c19d426cd venus: add VK_EXT_load_store_op_none support
There's no feature/properties structs associated with this extension.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22243>
2023-04-07 03:05:02 +00:00
Yiwei Zhang
303a2136a4 venus: sync latest protocol for layering extensions
- VK_EXT_load_store_op_none
- VK_EXT_rasterization_order_attachment_access

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22243>
2023-04-07 03:05:02 +00:00
Sajeesh Sidharthan
ab3507691a radeonsi/vcn: optimize bitstream buffer resize logic
bitstream buffer is unmapped, resized and mapped again if new size
is greater than the current bitstream buffer size. This will be done
for each input buffer. This patch will avoid that and do resize
only once irrespective of number of input buffers. With the new logic,
total size is calculated first and call unmap, resize and map only once.

Signed-off-by: Sajeesh Sidharthan <sajeesh.sidharthan@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Reviewed-by: Veerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22308>
2023-04-07 02:31:24 +00:00
Alyssa Rosenzweig
d1b569d26f nir/print: Don't print sampler_index for txf
NIR's docs for sampler_index say

    The following operations do not require a sampler and, as such, this
    field should be ignored:
       - nir_texop_txf
       - nir_texop_txf_ms
       - nir_texop_txs
       - nir_texop_query_levels
       - nir_texop_texture_samples
       - nir_texop_samples_identical

Contrary to this documentation, we were still printing the sampler_index anyway,
even though the value is formally undefined. This was helpful for
PIPE_CAP_TEXTURE_BUFFER_SAMPLER drivers that (despite the NIR docs) respected the
sampler_index anyway. There are no longer any such drivers, so we should stop
printing sampler_index for txf to avoid confusion (and noise).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22223>
2023-04-07 01:15:41 +00:00
Alyssa Rosenzweig
a9f9953928 docs/gallium: Note samplers are not used for txf
Now that PIPE_CAP_TEXTURE_BUFFER_SAMPLER is gone, txf does not require samplers
for any texture on any Gallium driver. NIR already requires drivers to ignore
sampler_index for non-sampler operation (mainly txf), and nowadays all Gallium
drivers ingest NIR. So, document that samplers aren't bound for txf (etc) as
part of the Gallium frontend-driver contract.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22223>
2023-04-07 01:15:41 +00:00
Alyssa Rosenzweig
6ba29d37c8 gallium: Remove PIPE_CAP_TEXTURE_BUFFER_SAMPLER
No more users. It was already not respected by rusticl so you couldn't set it if
you wanted OpenCL support. I regret introducing the CAP in the first place, and
no more drivers should use it.

Reverts d5d3f77e4a ("gallium: Add new cap PIPE_CAP_TEXTURE_BUFFER_SAMPLER").

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22223>
2023-04-07 01:15:41 +00:00
Alyssa Rosenzweig
e406e74aa4 panfrost: Unset TEXTURE_BUFFER_SAMPLERS
We no longer need this CAP, as we can easily synthesize our own internal sampler
for this case. Gallium doesn't need to know about this quirk of our hardware.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22223>
2023-04-07 01:15:41 +00:00
Alyssa Rosenzweig
b9cc2b2a98 pan/{mdg,bi}: Always use sampler 0 for txf
Now that we upload workaround samplers for txf, sampler 0 is guaranteed to be
valid but other samplers are not. So ignore whatever the current sampler_index
value is (it's formally undefined in NIR) and use 0, which we know is valid. We
already do this on Valhall for OpenCL, just need to generalize for Midgard and
Bifrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22223>
2023-04-07 01:15:41 +00:00
Alyssa Rosenzweig
e15603bdf1 panfrost: Always upload a workaround sampler
The hardware requires a valid sampler even for texelFetch (txf), even though its
contents are ignored. We'd rather not pass on this requirement to the frontends,
so we should handle it by uploading our own workaround sampler in the case when
no sampler is already present. We already do this on Valhall (for rusticl), so
we just need to port the same workaround back to Midgard/Bifrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22223>
2023-04-07 01:15:40 +00:00
Mike Blumenkrantz
06bfe07212 zink: don't try copying multiple results for conditional render copy
conditional render is only a single result, so multiple results need
to first be aggregated

fixes #8798

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22345>
2023-04-07 00:52:27 +00:00
Ian Romanick
72a9d12c96 nir/tests: Port almost all loop_analyze tests to new macro-based infastructure
The one test that remains would have an automatically generated name
that would conflict with another test. This test is also a little
special (per the comment in the test), so it's probably best to leave it
separate anyway.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3445>
2023-04-06 23:50:27 +00:00
Yevhenii Kolesnikov
9427aaeab7 nir/loop_analyze: Determine iteration counts for more kinds of loops
If loop iterator is incremented with something other than regular
addition, it would be more error prone to calculate the number of
iterations theoretically. What we can do instead, is try to emulate the
loop, and determine the number of iterations empirically.

These operations are covered:
 - imul
 - fmul
 - ishl
 - ishr
 - ushr

Also add unit tests for loop unrollment.

Improves performance of Aztec Ruins (sixonix
gfxbench5.aztec_ruins_vk_high) by -1.28042% +/- 0.498555% (N=5) on Intel
Arc A770.

v2 (idr): Rebase on 3 years. :( Use nir_phi_instr_add_src in the test
cases.

v3 (idr): Use try_eval_const_alu in to evaluate loop termination
condition in get_iteration_empirical. Also restructure the loop
slightly. This fixed off by one iteration errors in "inverted" loop
tests (e.g., nir_loop_analyze_test.ushr_ieq_known_count_invert_31).

v4 (idr): Use try_eval_const_alu in to evaluate induction variable
update in get_iteration_empirical. This fixes non-commutative update
operations (e.g., shifts) when the induction varible is not the first
source. This fixes the unit test
nir_loop_analyze_test.ishl_rev_ieq_infinite_loop_unknown_count.

v5 (idr): Fix _type parameter for fadd and fadd_rev loop unroll
tests. Hopefully that fixes the failure on s390x. Temporarily disable
fmul. This works-around the revealed problem in
glsl-fs-loop-unroll-mul-fp64, and there were no shader-db or fossil-db
changes.

v6 (idr): Plumb max_unroll_iterations into get_iteration_empirical. I
was going to do this, but I forgot. Suggested by Tim.

v7 (idr): Disable fadd tests on s390x. They fail because S390 is weird.

Almost all of the shaders affected (OpenGL or Vulkan) are from gfxbench
or geekbench. A couple shaders in Deus Ex (OpenGL), Dirt Rally (OpenGL),
Octopath Traveler (Vulkan), and Rise of the Tomb Raider (Vulkan) are
helped.

The lost / gained shaders in OpenGL are an Aztec Ruins shader that goes
from SIMD16 to SIMD8. The spills / fills affected are in a single Aztec
Ruins (Vulkan) compute shader.

shader-db results:

Skylake, Ice Lake, and Tiger Lake had similar results. (Tiger Lake shown)
total loops in shared programs: 5514 -> 5470 (-0.80%)
loops in affected programs: 62 -> 18 (-70.97%)
helped: 37 / HURT: 0

LOST:   2
GAINED: 2

Haswell and Broadwell had similar results. (Broadwell shown)
total loops in shared programs: 5346 -> 5298 (-0.90%)
loops in affected programs: 66 -> 18 (-72.73%)
helped: 39 / HURT: 0

fossil-db results:

Skylake, Ice Lake, and Tiger Lake had similar results. (Tiger Lake shown)
Instructions in all programs: 157374679 -> 157397421 (+0.0%)
Instructions hurt: 28

SENDs in all programs: 7463800 -> 7467639 (+0.1%)
SENDs hurt: 28

Loops in all programs: 38980 -> 38950 (-0.1%)
Loops helped: 28

Cycles in all programs: 7559486451 -> 7557455384 (-0.0%)
Cycles helped: 28

Spills in all programs: 11405 -> 11403 (-0.0%)
Spills helped: 1

Fills in all programs: 19578 -> 19588 (+0.1%)
Fills hurt: 1

Lost: 1

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3445>
2023-04-06 23:50:27 +00:00
Yevhenii Kolesnikov
f051967f19 nir/loop_analyze: Track induction variables incremented by more operations
These operations are covered:

 - imul
 - fmul
 - ishl
 - ishr
 - ushr

The only cases that can be currently affected are those where the
calculated loop-trip count would be zero.

v2 (idr): Split out from original commit. Rebase on lots of other work.

v3 (idr): Move operand size assertion. This code only cares that the
operands have the same size for the iadd and fadd cases. In other
cases, such as shifts, the sizes may not match. Fixes assertion
failures in
tests/spec/arb_gpu_shader_int64/glsl-fs-loop-unroll-ishl-int64.shader_test.

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

Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3445>
2023-04-06 23:50:27 +00:00
Ian Romanick
bc170e895f nir/loop_analyze: Use try_eval_const_alu and induction variable basis info
This dramatically simplifies will_break_on_first_iteration, and, much
more importantly, makes it significantly more flexible. It is now
possible to handle loops with more complex exit condition and other
kinds of increment operations.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3445>
2023-04-06 23:50:27 +00:00
Ian Romanick
99a7a6648d nir/loop_analyze: Change invert_cond instead of changing the condition
This ensures that scenarios like
nir_loop_analyze_test.iadd_inot_ilt_rev_known_count_5 don't regress in
the next commit. It also means we don't change float comparisons. These
are probably fine... but it still made me a little uneasy.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3445>
2023-04-06 23:50:27 +00:00
Ian Romanick
aeb8af1141 nir/loop_analyze: Track induction variable basis information
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3445>
2023-04-06 23:50:27 +00:00
Ian Romanick
30879a760c nir/loop_analyze: Add a function to evaluate an ALU as constant
...with a substitution. This function is largely a copy-and-paste of
try_fold_alu (nir_opt_constant_folding.c), and an argument could be made
that this function belongs in that file.

v2: Some changes were mistakenly squashed in to "nir/loop_analyze: Use
try_eval_const_alu and induction variable basis info" that should have
been here.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3445>
2023-04-06 23:50:27 +00:00
Ian Romanick
2e942909c8 nir/tests: Add many loop analysis tests for induction variables modified by imul
Loop analysis doesn't currently treat values updated by multiplication
as induction variables. Future patches will change this.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3445>
2023-04-06 23:50:27 +00:00
Ian Romanick
a210fcd9c7 nir/tests: Add more loop analysis tests for induction vars updated by shifts
These reverse the order of the comparison (e.g., -2 >= i vs i >= -2). I
split this into a separate commit because the previous commit was so
large.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3445>
2023-04-06 23:50:27 +00:00
Ian Romanick
45518d2eba nir/tests: Add many loop analysis tests for induction vars updated by shifts
Loop analysis doesn't currently treat values updated by shifts as
induction variables. Future patches will change this.

v2: Don't use the contradiction ilt(x, INT_MIN).

v3: Delete some errant code in UNKNOWN_COUNT_TEST. Noticed by Tim.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3445>
2023-04-06 23:50:27 +00:00
Sajeesh Sidharthan
4f1646d73f radeonsi/vcn: set bitstream buffer size to encoded bitstream size
initial bitstream size was set to width * height * 2 which is
larger than yuv size. set initial bitstream size to encoded
bitstream size approximately to optimize memory consumption.
This is just an initial size setting, it will get resized later
if it's not big enough. As a result of this change, we don't need to
allocate super big size at the every beginning. Only allocate
big size when needed in order to save some memory

Signed-off-by: Sajeesh Sidharthan <sajeesh.sidharthan@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Acked-by: Veerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21918>
2023-04-06 22:55:59 +00:00
Jesse Natalie
a3e5e6ceaa dzn: Fix bindless descriptor sets with multiple dynamic buffers that need custom descriptors
Fixes: 5d2b4ee4 ("dzn: Allocate descriptor sets in buffers for bindless mode")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
04fa6c715b dzn: Batch command lists together
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
e16b55d861 dzn: Don't do initial-layout barriers for simultaneous-access resources
Fixes: 4daeac01 ("dzn: Enhanced barriers fixes/workarounds")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
023f7b26dc dzn: Attempt to force depth write states for depth access in LAYOUT_GENERIC
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
c914d53d13 dzn: Ensure buffer offsets are aligned
If the app passes us unaligned buffer offsets, we need to align them
down to the nearest aligned offset, and then put the difference into
the descriptor set buffer.

Fixes: 8bd5fbf8 ("dzn: Bind buffers for bindless descriptor sets")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
eaa8c8097c dzn: Don't use write-combine memory for cache-coherent UMA
Cache coherent UMA implies that the GPU is reading data through the
CPU caches. Using write-combined CPU pages for such a system would
be bad, since the GPU would then be reading uncached data. One
example of such a system is WARP. This significantly improves WARP's
performance for some apps (including the CTS).

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
3db019a816 dzn: Ensure pipeline variants are used for dynamic stencil masks
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
460ee81913 dzn: Align descriptor sets in the bindless buffer
Fixes: 5d2b4ee4 ("dzn: Allocate descriptor sets in buffers for bindless mode")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
84c0f40490 dzn: Report some more caps correctly that are supported
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
a348b49901 dzn: Raise max number of descriptor sets to 8
DOOM Eternal just assumes you support at least 5, which caused corruption
due to overrunning arrays. We can just bump this up. 8 should work with
and without bindless.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
f2a5a03d3b dzn: Fix SRV barrier state on compute command lists
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
fb5abb956d dzn: Add a driconf option for enabling subgroup ops in VS/GS
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
89879d8fe2 dzn: Add a driconf entry for enabling 8bit loads and stores
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
e28328ca2c spirv2dxil: Add some more supported caps
8-bit loads and stores work via lowering, but they do work

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
6d5ff875d2 microsoft/compiler: Fix large shifts
Unlike DXBC, DXIL's shift instructions don't have the implicit behavior
that they only take the 5 bits. This is observable if you try to have
DXC do a shift of a dynamic value, e.g. a constant buffer value, where
the compiler inserts the appropriate 'and' op. We need to do the same.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
4f56cede6d microsoft/compiler: Assign 1D wave IDs based on local thread ID
Fixes corruption/flickering seen in DOOM Eternal's decals/lighting.
It seems the shader has an implicit assumption about this property.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
eeb67362da microsoft/compiler: Fix barrier for wave ID computation
Fixes: 2f8a8b59 ("microsoft/compiler: Add lowering passes for basic subgroup vars")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Jesse Natalie
477332a347 microsoft/compiler: Fix 8-bit loads and stores when supporting 16-bit DXIL
Shifts should always use 32bit shift values, and when lowering to
masked, we need to use 32-bit atomics. That means that we should also
treat 24bit stores as a single masked op rather than one 16bit unmasked
and one 8bit masked.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22225>
2023-04-06 22:08:28 +00:00
Adam Jackson
e89e1f5049 glx: Fix error handling yet again in CreateContextAttribs
Unlike the legacy CreateContext path, we would try to send the
GLXCreateContextAttribs request regardless of whether we'd successfully
created the client context state. And there's not a lot on the server
side to go wrong besides BadAlloc, so if the request succeeded but
the client side didn't we'd need to destroy the server context and
synthesize an X error. Since that itself involves more X protocol it's
tricky to get the request number right in the error, and tests and apps
can notice when you get it wrong.

Since we have now fixed client-side validation to generate the right
errors at the right times, this patch does something simpler, we match
CreateContext and fail early if the client-side setup fails. Now there's
no question of what request number to use, because we haven't sent any
protocol, the error is for the request as if it'd been sent.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4763
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12006>
2023-04-06 21:29:54 +00:00
Adam Jackson
86fd72448c glx: Disable the indirect fallback in CreateContextAttribs
If your app cares enough to use CreateContextAttribs it's probably not
going to be happy with the pre-GL-1.5 indirect experience.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12006>
2023-04-06 21:29:54 +00:00
Adam Jackson
5dba6726f7 glx/dri: Fix error generation for invalid GLX_RENDER_TYPE
This needs to throw BadValue.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12006>
2023-04-06 21:29:54 +00:00
Adam Jackson
dd67c079a0 dri: Validate more of the context version in validate_context_version
There's two kinds of "bad version" you might encounter here, either the
combination does not name a defined version (like 1.7) or it names
something the driver can't do (like asking r300 to do 4.0). EGL does not
distinguish these cases, but GLX calls them BadMatch and GLXBadFBConfig
respectively.

Since api_mask is the set of driver supported APIs, and we can only
support defined APIs, don't check it early in driCreateContextAttribs,
just let it fall out from validate_context_version.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12006>
2023-04-06 21:29:54 +00:00
Adam Jackson
9c76682d80 glx/dri: Use X/GLX error codes for our create_context_attribs
This has no functional change because everyone calling this is
discarding the error code, because we're relying on the server to
generate the right thing for us. But we create the direct context first
and the server isn't going to enforce everything we want it to
(supported GL versions for example). Convert out from DRI error codes to
X/GLX error codes so we can fail the right way on the client side. We're
still throwing the error away in all of the callers but that'll change
shortly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12006>
2023-04-06 21:29:54 +00:00
Ian Romanick
12e11fa3e4 intel/fs: White space fixes
Trivial

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22299>
2023-04-06 19:07:50 +00:00
Ian Romanick
6dfb7061e0 intel/fs: Preserve meta data more often in brw_nir_move_interpolation_to_top
This pass rarely makes any changes, so work a little harder to preserve
more meta data.

On my Ice Lake laptop (using a locked CPU speed and other measures to
prevent thermal throttling, etc.) using a debugoptimized build, improves
performance of Vulkan CTS "deqp-vk --deqp-case='dEQP-VK.*spir*'" by
-0.2% ± 0.1% (n = 5, pooled s = 0.431885).

v2: Add some parenthesis. Suggested by Lionel.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22299>
2023-04-06 19:07:50 +00:00
Ian Romanick
3037603b70 intel/fs: Linked list micro optimizations in brw_nir_move_interpolation_to_top
Two linked list management changes:

- Use the list head sentinel as the initial cursor. It is, after all, a
  proper node in the list.

- Iterate the list of blocks starting with the second block instead of
  skipping the first block in the loop.

On my Ice Lake laptop (using a locked CPU speed and other measures to
prevent thermal throttling, etc.) using a release build, improves
performance of compiling shaders from batman_arkham_city_goty.foz by
-0.24% ± 0.09% (n = 5, pooled s = 0.324106).

v2: Use nir_cursor instead of direct list manipultion. Suggested by
Lionel.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22299>
2023-04-06 19:07:50 +00:00
Ian Romanick
78ee74de4a intel/compiler: Micro optimize regions_overlap
On my Ice Lake laptop (using a locked CPU speed and other measures to
prevent thermal throttling, etc.) using a release build, improves
performance of compiling shaders from batman_arkham_city_goty.foz by
-1.09% ± 0.084% (n = 5, pooled s = 0.354471)

Reduces the size of a release build by 26k.

   text	   data	    bss	    dec	    hex	filename
23163641 400720	 231360	23795721	16b1809	before/lib64/dri/iris_dri.so
23137264 400720	 231360	23769344	16ab100	after/lib64/dri/iris_dri.so

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22299>
2023-04-06 19:07:50 +00:00
Ian Romanick
7873edee6e intel/fs: Use specialized version of regions_overlap in opt_copy_propagation
Since one of the register must always be either VGRF or FIXED_GRF, much
of regions_overlap and reg_offset can be elided.

On my Ice Lake laptop (using a locked CPU speed and other measures to
prevent thermal throttling, etc.) using a debugoptimized build, improves
performance of Vulkan CTS "deqp-vk --deqp-case='dEQP-VK.*spir*'" by
-0.29% ± 0.097% (n = 5, pooled s = 0.361697).

Using a release build, improves performance of compiling shaders from
batman_arkham_city_goty.foz by -3.3% ± 0.04% (n = 5, pooled s =
0.178312).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22299>
2023-04-06 19:07:50 +00:00
Ian Romanick
43cb42df7c intel/compiler: Micro optimize inst_is_in_block
This function only exists in builds with assertions, so it only matters
there.

On my Ice Lake laptop (using a locked CPU speed and other measures to
prevent thermal throttling, etc.) using a debugoptimized build, improves
performance of Vulkan CTS "deqp-vk --deqp-case='dEQP-VK.*spir*'" by
-5.2% ± 0.16% (n = 5, pooled s = 0.657887).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22299>
2023-04-06 19:07:50 +00:00
Ian Romanick
d47f521ee4 intel/compiler: Use NIR_PASS instead of NIR_PASS_V
Reduce debug log spam by only logging the shader if a pass made some
changes. This can also elide some nir_validate calls in debug builds.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22299>
2023-04-06 19:07:50 +00:00
Ian Romanick
fb950a9edf intel/compiler: Remove one overload of backend_instruction::insert_before
The version that takes a list of instructions is not used. I did not do
any archaeology to find out when the last user was removed.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22299>
2023-04-06 19:07:50 +00:00
Tomeu Vizoso
179a694232 etnaviv: don't read too much from uniform arrays
Fixes: 77af1ca690 ("etnaviv: add disk cache")
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22210>
2023-04-06 16:51:36 +00:00
Italo Nicola
c45ce64ea0 etnaviv: implement nir_op_uclz and lower find_{msb,lsb} to uclz
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22210>
2023-04-06 16:51:36 +00:00
Italo Nicola
9dc4ee9121 etnaviv: lower (un)pack_{2x16,2x32}_split and extract_{byte,word}
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22210>
2023-04-06 16:51:36 +00:00
Tomeu Vizoso
70bb190279 etnaviv: print writemask of store operations
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22210>
2023-04-06 16:51:36 +00:00
Tomeu Vizoso
194327c136 etnaviv: handle missing alu conversion opcodes
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22210>
2023-04-06 16:51:36 +00:00
Italo Nicola
2a111d520e etnaviv: add default clear_buffer and clear_texture APIS
These are required to support rusticl.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22210>
2023-04-06 16:51:35 +00:00
Italo Nicola
201a141798 etnaviv: use stderr for compiler error logging
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22210>
2023-04-06 16:51:35 +00:00
Italo Nicola
3b7d35bb99 etnaviv: abort() instead of assert(0) on compiler error
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22210>
2023-04-06 16:51:35 +00:00
Marek Olšák
debc543904 amd/registers: use gfx9 packet definitions for gfx940
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:54 +00:00
Marek Olšák
ba74d10950 amd/registers: update gfx940.json
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:54 +00:00
Marek Olšák
e3bc800d5d amd/registers: fix the parser to include CP_COHER registers for gfx940
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:54 +00:00
Marek Olšák
e917db3b42 amd/registers: simplify integer division by 0x1000 in the parser
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:54 +00:00
Marek Olšák
81a6601979 radeonsi: don't set registers that don't exist on gfx940
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Sathishkumar S
69397180f6 radeonsi/vcn: enable RGBA/ARGB formats on gfx940 jpeg
enable RGBA/ARGB format on gfx940 to aid RGBA/ARGB conversion after decode

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Sathishkumar S
6d675feff7 frontends/va: support crop region in jpeg decode
propogate region of interest co-ordinates for crop region decode

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Sathishkumar S
4b0d4d5ca6 radeonsi/vcn: reset to default value when ROI/FC is not used
when decoding without ROI/FC feature reset the registers to default value.

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Sonny Jiang
74bf0cdc9d radeonsi/vcn: Add decode support for gfx940
Add VCN decode for gfx940

Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Sonny Jiang
73ba47e87b radeonsi/vcn: Add video capabilities support for gfx940
Add VCN codec caps support for gfx940

Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Sonny Jiang
5639b23644 amd/common: Add gfx940 codec query support
Add support for GFX940 VCN query

Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Sathishkumar S
b4efb1ef35 radeonsi/vcn: set jpeg reg version for gfx940
select appropriate jpeg register version for gfx940

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Sathishkumar S
334919b8ed radeonsi/vcn: support ARGB/RGBA conversion on JPEG 4.0.3
enable ARGB/RGBA conversion feature on JPEG 4.0.3

v2: fix regression caused due to uninitialized variable

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Sathishkumar S
d0477cbd07 radeonsi/vcn: add support for picture crop on JPEG 4.0.3
set the crop region and enable the feature if requested

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Sathishkumar S
74572084d8 radeonsi/vcn: use register versions for jpeg
update the register version and select appropriate registers during decoder create

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Sathishkumar S
9422627074 radeonsi/vcn: add register definitions for JPEG 4.0.3
Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Ganesh Belgur Ramachandra
d75f0d6c26 ac/nir: fix CDNA image lowering for array textures
The x,y coordinates were not added.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Marek Olšák
eaf98b1422 ac/nir: implement image opcode emulation for CDNA, enable it in radeonsi
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Marek Olšák
e3c6ed0685 radeonsi: add an emulated image descriptor for gfx940
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Marek Olšák
96913bbf3e ac/surface: force linear image layout for chips not supporting image opcodes
Image opcodes will be emulated.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Marek Olšák
8277e6fda3 radeonsi: always use ffma32 on gfx940
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Marek Olšák
72354667cb radeonsi: use COMPUTE_DISPATCH_SCRATCH_BASE on gfx940
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Marek Olšák
d3b03fedd8 amd: add initial code for gfx940
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Marek Olšák
46639eb056 amd: add gfx940 register definitions
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22158>
2023-04-06 15:00:53 +00:00
Eric Engestrom
91a6c9cccf Revert "broadcom/ci: run gl jobs on arm64, just like vk"
This reverts commit ba4eeaf435.

Looks like we have a lot of memory issues on arm64; revert the pre-merge
CI to armhf until we've been able to figure out the problem and fix it.

Closes https://gitlab.freedesktop.org/mesa/mesa/-/issues/8788

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22335>
2023-04-06 14:34:06 +00:00
Alyssa Rosenzweig
2242bb703e nv50,nvc0: Use u_pipe_screen_get_param_defaults
Other than nouveau, every single Gallium driver relies on
u_pipe_screen_get_param_defaults to get the default values of CAPs.

For the driver, this is much more concise. Unsupported new features -- or
supported features that virtually all Gallium drivers support -- do not need to
written out explicitly. Their absence (or presence) is implied as the default.
If there's any doubt over whether the CAP is exposed, it's easy to check in
u_pipe_screen_get_param_defaults.

For the Gallium tree in general, this brings a number of benefits:

* Unused CAPs are easy to delete, because there is only a single place
  (u_pipe_screen_get_param_defaults) where they are referenced and need to be
  deleted from.

* New CAPs are easy to introduce, for the same reason.

* It's straightforward to audit which drivers support (or don't support) a given
  CAP by grepping for the name (for example, when determining whether a CAP is
  unused and can be garbage collected, or a CAP is so widely supported that it
  can be made default.). You still need to check the source code in case it's
  conditionally exposed (common for layered drivers) but the search space is
  limited to drivers that reference the CAP by name.

Unfortunately, all of these benefits rely on all Gallium drivers cooperating.
The status quo is much less nice:

* Unused CAPs need to be deleted both from common code, and also specially from
  nouveau. Why is nouveau special?

* New CAPs need to be added both to common code, and also specially to nouveau.
  Again, why is nouveau special?

* When grepping for CAPs, nouveau (only) needs to be ignored, since it's
  spurious.  Unless sometimes it's not, in which case you need to open nouveau
  source code anyway to check.

Compounding on the fun, you have to do the special nouveau step twice, once for
nvc0 and once for nv50.

Why might it be benefical to list CAPs explicitly instead of relying on the
defaults?

* Maybe easier auditing nouveau driver for CAP correctness? In practice this has
  not been an issue for any of the drivers I've worked on, especially because
  the defaults are quite reasonable.

* Maybe forcing people adding CAPs to think about nouveau specially? This isn't
  fair to the tree in general, why should nouveau get this special
  treatment? Instead, CAPs are generally added to gate functionality that may
  not be supported on all drivers, and the default is disabling the new
  functionality until a developer for a given driver can wire it up. There's
  already no expectation that the person adding CAPs needs to also add the
  functionality to nouveau (if that's even possible) -- unless the CAP is being
  added for the particular nouveau's benefit of course -- so this isn't helpful.

* Maybe forcing people removing CAPs to think about nouveau specially? Similar
  issues apply here, and it's not clear how this would even work.

* Maybe keeping novueau developers aware of CAP churn? Again nouveau should not
  be special here and it isn't sustainable to do this for every driver. So, if
  this is something that nouveau developers want to do -- and they choose not to
  follow Gallium-tagged merge requests -- then the git log of
  src/gallium/include/pipe/p_defines.h or indeed
  src/gallium/auxiliary/util/u_screen.c may be consulted.

So, without an excellent reason why nouveau should be treated specially, and
with several reasons why it should not, let's bring nouveau in line with the
rest of Gallium and rely on the defaults.

I've left in CAPs with attached comments even when they are returning the
default value to preserve information from before the commit. Otherwise, this
commit aims to remove explicit cases that match the default value, as other
drivers generally aim to do.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22245>
2023-04-06 14:13:00 +00:00
Guilherme Gallo
fe60fa898e Revert "ci: disable Collabora's LAVA lab for maintance"
This reverts commit 86ad0356b6.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22329>
2023-04-06 08:49:23 -03:00
Tapani Pälli
44053c0947 intel/common: limit the amount of SLM with Wa_14017341140
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22307>
2023-04-06 10:54:47 +00:00
Rohan Garg
e21cca78ea anv,blorp,iris: Set PreferredSLMAllocationSize on gfx125+
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22307>
2023-04-06 10:54:47 +00:00
Rohan Garg
3b6dbf8902 intel/genxml: Add the preferred slm size enum for gen125
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22307>
2023-04-06 10:54:46 +00:00
Anuj Phogat
606a39f9d1 intel/genxml/125: Add preferred SLM allocation size field
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22307>
2023-04-06 10:54:46 +00:00
Jesse Natalie
767c5425da CI/windows: Increase timeout for build container job
These jobs can take upwards of 40 minutes just to upload
the built container images...

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22320>
2023-04-06 09:14:22 +00:00
Jesse Natalie
24fce05f3f CI/windows: Update headers and Agility redist to 1.710.0-preview
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22320>
2023-04-06 09:14:22 +00:00
Timothy Arceri
5a29af262c glsl: move some GL ES checks to the NIR linker
Eventually we should aim to remove the GLSL IR linker.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22305>
2023-04-06 08:07:35 +00:00
Timothy Arceri
bf8f11a2de mesa: add _mesa_is_api_gles2() helper
The glsl compiler has been reworked to avoid passing gl_context around
so that we can avoid expensive recompiles across the code base for
minor changes. This helper will help us avoid passing gl_context around
where its otherwise unrequired.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22305>
2023-04-06 08:07:35 +00:00
Sergi Blanch Torne
86ad0356b6 ci: disable Collabora's LAVA lab for maintance
This is to inform you of some planned downtime in the LAVA lab as follows:

    Start: 2023-04-06 07:30 GMT
    End: 2023-04-06 09:00 GMT

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22185>
2023-04-06 06:04:57 +00:00
Chia-I Wu
a38de4c011 radv: disable tc_compatible_cmask on GFX9 in some cases
There seems to be issues when sample count > 2 on GFX9.  More precisely,
CTS has issues when sample count > 2.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21615>
2023-04-06 05:27:01 +00:00
Chia-I Wu
bd5fb29db6 radv: add RADV_FMASK_COMPRESSION_PARTIAL
RADV_FMASK_COMPRESSION_PARTIAL means the fmask is decompressed but not
expanded.  It is desired for sampling when the cmask is not
TC-compatible.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21615>
2023-04-06 05:27:01 +00:00
Chia-I Wu
3cf7ac4e9c radv: rework radv_layout_fmask_compressed
Rename radv_layout_fmask_compressed and make it return an enum.  We will
add partial compression (fmask decompressed and not expanded) in a
following commit.

Drop the check for VK_IMAGE_USAGE_STORAGE_BIT and
VK_IMAGE_USAGE_TRANSFER_DST_BIT.  When transitioning to
VK_IMAGE_LAYOUT_GENERAL, we should decompress and expand FMASK even when
those usage bits are not set.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21615>
2023-04-06 05:27:01 +00:00
Emma Anholt
8e84a23697 ci/zink: Disable a630 portal-2-v2 due to kernel OOMs.
It's been popular for flakes due to oomkilling or kernel kmalloc failure
recently.  Is it ultimately the source of running out of memory?  Who
knows, but hopefully it's at least a big part of the problem.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
ffa867b535 tgsi: Drop TGSI_OPCODE_DFRACEXP.
This is no longer emitted by nir_to_tgsi, so let's drop it.  This unlocks
some more TGSI DCE, since now all instructions have a single dest, but
that's a project for another day.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
ba5bc2677f glsl: Drop PIPE_SHADER_CAP_DFRACEXP_DLDEXP_SUPPORTED.
All drivers should now be using the appropriate NIR lowering, so we can
drop this pile of code.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
7325f699db glsl: Drop frontend lowering of 32-bit frexp.
All the users should now be calling the appropriate NIR lowering function.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
fca4857091 nir_to_tgsi: Always lower frexp_exp/sig.
The GLSL frontend was already lowering 32-bit frexp, so only 64-bit frexp
is possible as an op in the incoming NIR.  However, svga and nouveau don't
set PIPE_SHADER_CAP_DFRACEXP_DLDEXP_SUPPORTED, leaving just r600's
non-default TGSI mode potentially using it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
3f2328c629 panfrost/midgard: Enable nir_lower_frexp.
Needed for dropping the GLSL frontend lowering.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
094b5a71d7 agx: Enable nir_lower_frexp.
Needed for Vulkan, and for dropping GLSL frontend lowering for the deqp
coverage override case.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
862235ecaa v3d: Lower frexp in the GL compiler like we do in Vulkan.
Needed for dropping GLSL's frontend lowering.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
04c31c6ada zink: Enable nir_lower_frexp.
This will enable GLSL to drop its frexp lowering in the frontend.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
7c57061b77 nouveau: Enable frexp lowering in the backend.
This would be desired for NVK using this backend, but also for getting
lowering out of the GLSL frontend.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
3a336a8ffd nouveau: Add missing nir_opt_algebraic_late.
This was needed for nir_lower_frexp, but it's a win anyway.  shader-db
results:

total gpr in shared programs: 1143621 -> 1143502 (-0.01%)
gpr in affected programs: 33918 -> 33799 (-0.35%)

total instructions in shared programs: 7829415 -> 7820124 (-0.12%)
instructions in affected programs: 1204967 -> 1195676 (-0.77%)

total bytes in shared programs: 71802760 -> 71717352 (-0.12%)
bytes in affected programs: 11031888 -> 10946480 (-0.77%)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
f2228902ed ir3: Move turnip's nir_lower_frexp to the shared compiler.
We had NIR lowering for Vulkan, and rely on GLSL's lowering in the
frontend, but this will let us drop the GLSL lowering.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
f1ea6c1b40 intel: Always call nir_lower_frexp.
We have NIR lowering for Vulkan, and rely on GLSL's lowering in the
frontend, but this will let us drop the GLSL lowering.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
fb60edf4e9 state_tracker: Lower frexp before lowering doubles.
We don't have softfp64 for frexp, it has been lowered in GLSL up until
now.  I didn't bother splitting out 32 from 64 because it's not worth any
effort.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
261c1f9ee1 glsl/softfp64: Add fisfinite lowering.
This is generated by nir_lower_frexp, and if we leave fisfinite in place
then the late algebraic pass lowering it to this pattern will cause an
un-lowered fabs64 to be emitted.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:01 +00:00
Emma Anholt
7ff899dd6e glsl/softfp64: GC the temp vars after we lower them to SSA.
They don't serve any purpose other than taking up memory and cluttering
your compiler output at this point.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:00 +00:00
Emma Anholt
2a33ea95d6 glsl: Retire ldexp lowering in favor of the nir lowering flag.
Compilers need to set the nir flag anyway for vulkan, so just pass ldexp
through to NIR and let that handle it.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:00 +00:00
Emma Anholt
675f4ff596 zink: Add mapping for nir_op_ldexp, but disable it for 64-bit's sake.
We previously had GLSL do ldexp lowering to bitops, but NIR can do it
instead.  It's tempting to just pass the NIR op through to the host Vulkan
driver, but to do that we'd need to split up NIR's flag between 32 and
64-bit support, and that's not worth anyone's time for an op we've never
seen used.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:00 +00:00
Emma Anholt
46bf687882 glsl: Move ForceGLSLAbsSqrt handling to glsl-to-nir.
Cutting more GLSL lowering pass in favor of nir builder.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>
2023-04-06 02:32:00 +00:00
Mike Blumenkrantz
a73c28fdce radv: fix leak of nir from retained shaders
if shaders are found in the app cache above, execution will goto done:
and the nir must still be freed

Fixes: 03d2bd6042 ("radv: ensure to retain NIR shaders for GPL libs found in the cache")

fixes #8786

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22317>
2023-04-06 01:53:28 +00:00
Eric Engestrom
e6c84b8a00 panfrost: assign the correct create_for_resource from the start
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22322>
2023-04-05 23:15:35 +00:00
Rob Clark
66d4dbd960 util/disk_cache: Move blob_put_cb to the async queue
Move deflate and put to the queue for the blob cache case.  This moves
the overhead out of the app thread when storing new shaders.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22248>
2023-04-05 20:25:04 +00:00
Rob Clark
dab1bd5a77 util/disk_cache: Use queue state to skip put
If we move the blob-cache path into the async queue, then
path_init_failed is no longer a good way to check if puts
should be a no-op.  But fortunately checking if the queue
is initialized is, and is a more obvious check because
what it is guarding is a util_queue_add_job().

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22248>
2023-04-05 20:25:04 +00:00
Rob Clark
213627e94b util/disk_cache: Add NONE type
Add an explicit enum for the DISK_CACHE_NONE type so that we don't
confuse with the MULTI_FILE case on android when the blob-cache is
used.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22248>
2023-04-05 20:25:04 +00:00
Rob Clark
afb350906e util/disk_cache: Split out queue initialization
Split out a helper to initialize the queue, as we'll want to re-use this
for the blob-cache case.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22248>
2023-04-05 20:25:04 +00:00
Jordan Justen
eef7a117a1 intel/compiler: Support fmul_fsign opt for fp64 when int64 isn't supported
MTL support fp64, but not int64. The fsign(double(x))*FOO optimization
would try to use a 64-bit int xor operation to conditionally toggle
the sign bit off the result.

Since this only affects high bit of the result, we can do a 32-bit
move of the low dword, and a 32-bit xor on the high dword.

Fixes dEQP-VK.spirv_assembly.instruction.compute.float_controls.fp64.input_args.modf_denorm_flush_to_zero
on MTL.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22259>
2023-04-05 18:48:21 +00:00
Timur Kristóf
7abd8c499b radv/amdgpu: Remove can_patch and chained submit code path.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22220>
2023-04-05 17:10:25 +00:00
Timur Kristóf
6aa518ea86 radv: Chain cmd buffers in queue code when possible, not in winsys.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22220>
2023-04-05 17:10:25 +00:00
Timur Kristóf
c876e99aa4 radv/amdgpu: Unchain CS array in queue code not in winsys.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22220>
2023-04-05 17:10:25 +00:00
Timur Kristóf
44f7e42665 radv/amdgpu: Walk chained CS objects for BO list.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22220>
2023-04-05 17:10:25 +00:00
Timur Kristóf
d7fc114788 radv/amdgpu: Remember which CS the current one is chained to.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22220>
2023-04-05 17:10:25 +00:00
Timur Kristóf
ba87ade6d0 radv/amdgpu: Extract radv_amdgpu_add_cs_to_bo_list function.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22220>
2023-04-05 17:10:25 +00:00
Timur Kristóf
9d22125f05 radv/amdgpu: Expose CS chain and unchain on the winsys.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22220>
2023-04-05 17:10:25 +00:00
Timur Kristóf
aa9558698e radv/amdgpu: Extract CS chain and unchain functions.
Also add a comment that explains what chaining means
and add a check to make sure the HW IP type supports it.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22220>
2023-04-05 17:10:25 +00:00
David Heidelberg
e261e46c09 ci: implement sections for cuttlefish
Reviewed-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22005>
2023-04-05 16:26:20 +00:00
Samuel Pitoiset
981f512037 radv: emit the PS epilog after the graphics pipeline
Otherwise, SPI_SHADER_PGM_RSRC1_PS is overwritten when the graphics
pipeline is emitted.

Fixes: 5c362cde33 ("radv: update PS num_vgprs in case of epilogs rather than overallocating VGPRs")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22310>
2023-04-05 14:48:00 +00:00
Eric Engestrom
368a6f2330 vc4/ci: add another sync flake
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/39377396

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22312>
2023-04-05 14:15:25 +00:00
Mike Blumenkrantz
a17317d2a0 glthread: use id 0 for internal buffer objects
-1 is an invalid buffer index which breaks app expectations, specifically
apitrace, which checks for return value of 0 from checking buffer bindings
to determine whether to inject user vertex buffer bindings and create functional
traces

this should fix capturing traces with drivers using glthread

fixes #8383

cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22293>
2023-04-05 13:28:44 +00:00
Lionel Landwerlin
e25aee8e34 intel/fs: also allow vec8+ vectorization of load_global_const_block_intel
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>
2023-04-05 12:32:56 +00:00
Lionel Landwerlin
a358b97c58 intel/fs: optimize uniform SSBO & shared loads
Using divergence analysis, figure out when SSBO & shared memory loads
are uniform and carry the data only once in register space.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>
2023-04-05 12:32:56 +00:00
Lionel Landwerlin
2cf93f7632 nir: add 2 new intel intrinsics for uniform ssbo/shared loads
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>
2023-04-05 12:32:56 +00:00
Lionel Landwerlin
2259e1e932 nir: reuse nir_component_mask() where it makes sense
Avoiding local bit field manipulations.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>
2023-04-05 12:32:56 +00:00
Lionel Landwerlin
275ad509c1 intel/fs: factor out lsc surface descriptor settings
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>
2023-04-05 12:32:56 +00:00
Lionel Landwerlin
76698f3abd intel/fs: copy instruction sources in logical send lowering
Having references to inst->src[X] when you're also modifying
inst->src[X] is a receipe for disaster. Making changes to the lowering
code I've been bitten quite a few times by this take copies of all
sources to do the lowering.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>
2023-04-05 12:32:56 +00:00
Lionel Landwerlin
adb8c30436 intel/fs: UNDEF fixup_nomask_control_flow temp register
Ensure that the register's liveness is not expanded to loops.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>
2023-04-05 12:32:56 +00:00
Lionel Landwerlin
362a07db3a intel/fs: don't consider fixup_nomask_control_flow SENDs predicate
Those SENDs are still doing a full register write. We just inserted
some predication for a workaround.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>
2023-04-05 12:32:56 +00:00
Lionel Landwerlin
34d8bfe65f intel/fs: run VGRF compaction just before max live register accounting
There are a number of instances of the dead code elimination pass that
could reduce the count. For some reason this also seems to affect
register allocation itself.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>
2023-04-05 12:32:56 +00:00
Marcin Ślusarz
554b28d0b1 anv: ignore structure types handled in vk_device_memory_create
Without that we get warning from anv_debug_ignored_stype, called in
the default case.

Fixes: 4b0b75c27a ("anv: Use the new vk_device_memory base struct")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22295>
2023-04-05 11:53:29 +00:00
Eric Engestrom
ba4eeaf435 broadcom/ci: run gl jobs on arm64, just like vk
These were running on armhf because that's the default in the custom
distro that Raspberry Pi provides, but arm64 is ~20% faster, and we
already run weekly tests on both arm64 & armhf, so let's keep only the
faster one in the pre-merge path.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22272>
2023-04-05 09:35:34 +01:00
Gert Wollny
0cb6437f4f r600/sfn: fix container allocators
This fixes leaks in TexInstr and in Shader.

Thanks to Patrick Lerda for pointing out the bug.

Fixes: 79ca456b48
    r600/sfn: rewrite NIR backend

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22300>
2023-04-05 07:50:34 +00:00
Samuel Pitoiset
9085c9d43e radv: fix VS prologs with GPL and static binding stride
When a graphics pipeline library is created with only the vertex input
state, the driver binds this state at pipeline bind time. Though the
vertex binding stride is not necessarily dynamic, in this case the
pipeline stride should be used.

This fixes GPU hangs with recent
dEQP-VK.pipeline.fast_linked_library.vertex_input.*.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22285>
2023-04-05 07:18:37 +00:00
Iago Toral Quiroga
9217c565b2 v3d,v3dv: stop trying to force 16-bit TMU output for shadow comparisons
In V3D we were doing this incorrectly by peeking into the sampler state
unconditionally, which is not correct if the TMU operations don't use
sampler state at all (like PBOs). This was causing us to fail the second
test in this sequence when both tests run back back to back in the same
process:

dEQP-GLES3.functional.texture.shadow.2d.linear.greater_or_equal_depth_component32f
dEQP-GLES3.functional.texture.specification.teximage2d_pbo.rg32f_cube

Here, the first test would setup sampler state for shadow comparisons and
the second test would setup a PBO upload, which would incorrectly pick
up the sampler state to decide about the TMU output size for the PBO
operation.

In V3DV we were doing this right looking through each texture/sampler
instruction and checking if they all involved shadow comparisons or had
relaxed precission, defaulting to 32-bit otherwise.

This special-casing for shadow comparisons also leaks from drivers
into the compiler where we are forced to emit some pieces of sampler
state for 32-bit outputs, so we had to special-case shadow instructions
there as well and we also had a fix for CS textures not having correct
sampler state representing shadow operations too. Finally,
we also had  at least a couple of bugs where forcing 32-bit TMU output
through V3D_DEBUG wasn't correctly forcing shadow comparisons to actually
be 32-bit in all the right places, leading to visual bugs with the
option enabled (Sponza being one example of this). This change eliminates
all of these issues.

Finally, the performance improvement observed from special casing shadow
comparison is negligible, and in specific scenarios it can even be
detrimental to performance due to increased register pressure (Sponza with
PCF filtering set to 4 is an example of this again).

Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8684
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22284>
2023-04-05 06:52:51 +00:00
Iago Toral Quiroga
1bbbdbe666 vulkan/wsi/display: set pDisplay to NULL on error
the spec for vkGetDrmDisplayEXT says:

  "If there is no VkDisplayKHR corresponding to the connectorId on the
   physicalDevice, the returning display must be set to VK_NULL_HANDLE.
   The provided drmFd must correspond to the one owned by the physicalDevice.
   If not, the error code VK_ERROR_UNKNOWN must be returned. (...)
   The given connectorId must be a resource owned by the provided drmFd.
   If not, the error code VK_ERROR_UNKNOWN must be returned"

We were only setting the display pointer to VK_NULL_HANDLE if the provided
drmFd was valid, however, there are CTS tests checking that it is also set
to NULL when it is not.

Fixes the following test on all drivers exposing EXT_acquire_drm_display
(tested with Intel and V3DV):
dEQP-VK.wsi.acquire_drm_display.acquire_drm_display_invalid_fd

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22283>
2023-04-05 06:21:26 +00:00
Iago Toral Quiroga
d28cf0dbd5 v3dv: always acquire display device before checking if we can present
Usually, we postpone acquisition until a swapchain is created, but there are
some cases with display extensions (at least with EXT_acquire_drm_display)
where we need to acquire before a swapchain is ever created.

Fixes various tests in:
dEQP-VK.wsi.acquire_drm_display.*

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22283>
2023-04-05 06:21:26 +00:00
Iago Toral Quiroga
74d0886475 v3dv: drop unused parameter
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22283>
2023-04-05 06:21:25 +00:00
Brian Paul
6eaf2e7c16 llvmpipe: clean-up llvmpipe_get_query_result()
Get rid of the uint64 result pointer which was used by some query
types.  Handle each switch case with self-contained code.  Remove
unneeded casts.  Use MIN2/MAX2 macros.

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22281>
2023-04-05 03:49:16 +00:00
Brian Paul
58fbd75de2 llvmpipe: s/unsigned/enum pipe_query_type/
Note we should do the same for pipe_context::create_query()'s
query_type parameter.  That would touch quite a few files.

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22281>
2023-04-05 03:49:16 +00:00
Brian Paul
76605c1cb9 llvmpipe: s/tabs/spaces/
Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22281>
2023-04-05 03:49:16 +00:00
Brian Paul
3658fd6823 llvmpipe: rename some vars related to occlusion query and ps invocations
More consistent naming.

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22281>
2023-04-05 03:49:16 +00:00
Brian Paul
43773fdda7 llvmpipe: fix ps invocations query bug
We were not initializing the PS invocation count to zero before
computing the sum of the per-thread results.

This fixes an issue where querying the result of the query more
than once would cause the result to grow larger each time.

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22281>
2023-04-05 03:49:16 +00:00
Felix DeGrood
840e98f19e iris: report draw count for perfetto
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22296>
2023-04-05 02:13:49 +00:00
Erik Faye-Lund
72cd7e0079 ci: remove unused rules
These are no longer used.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22263>
2023-04-04 23:49:53 +00:00
Erik Faye-Lund
1b7a4029d0 virgl/ci: clean up manual rules for virgl
In f6c06ef2f6 ("ci: Add manual rules variations to disable irrelevant
driver jobs."), we fixed this for *most* driver. This fixes up the last
driver, hopefully removing an annoying needless button in the UI for
some MRs.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22263>
2023-04-04 23:49:53 +00:00
Erik Faye-Lund
67750f138b ci: move virgl-rules after intel-rules
We're about to add a dependency on stuff from the intel-rules, and
moving virgl down here allows us to depend on them without having to
move the definition out of the intel-section.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22263>
2023-04-04 23:49:53 +00:00
Mike Blumenkrantz
61451af5a2 zink: rework choose_pdev (again)
there are two cases to be handled here:
* normal
* software

the latter case requires env vars based on the frontend, and if a sw
device isn't found then init should fail

the former case should (in theory) just yolo the first device and assume
that's what the user wanted based on whatever env vars and layers are
in use

fixes #7508, #7132

maybe also affects #8152

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22184>
2023-04-04 23:32:46 +00:00
Pedro J. Estébanez
32e3c77a11 Revert "microsoft/compiler: Use SRVs for read-only images"
This reverts commit 54c32aeba6.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22289>
2023-04-04 22:50:05 +00:00
Pedro J. Estébanez
88acbcadbb spirv: Assume input attachments are read-only
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22289>
2023-04-04 22:50:05 +00:00
Pedro J. Estébanez
e59fdcb93c spirv2dxil: Split read-only image as SRV logic into declared and inferred
Fixes: e0a090ad ("spirv2dxil: Only lower readonly images to SRVs when the option is set")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22289>
2023-04-04 22:50:05 +00:00
Jesse Natalie
9663546cf4 dzn: Claim fillModeNonSolid
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22277>
2023-04-04 21:48:19 +00:00
Jesse Natalie
69a9a3ea3c dzn: Handle polygon point mode
Note: The meaning of clockwise vs counter-clockwise changes after the
yz flip, therefore the determination of winding needs to be done before
the yz flip logic. Therefore the yz flip is moved to the GS and applied
as a lowering on top of the base GS.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22277>
2023-04-04 21:48:19 +00:00
Jesse Natalie
bcf50b7532 dzn: Add a helper to generate triangle->point GS
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22277>
2023-04-04 21:48:19 +00:00
Jesse Natalie
83fd7e9460 spirv2dxil: Expose yz flip pass to external callers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22277>
2023-04-04 21:48:19 +00:00
Jesse Natalie
b723962418 d3d12: Move forward-front-face pass to common DXIL code
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22277>
2023-04-04 21:48:19 +00:00
Patrick Lerda
e0ed2b29f4 r600: fix typo that could lead to a possible crash
For instance, with "piglit/bin/arb_shader_image_load_store-host-mem-barrier --quick -auto -fbo":
==18549==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61200000a059 at pc 0x7f65d8937b80 bp 0x7fff6ed19a00 sp 0x7fff6ed199f8
READ of size 1 at 0x61200000a059 thread T0
    #0 0x7f65d8937b7f in evergreen_set_shader_images ../src/gallium/drivers/r600/evergreen_state.c:4277
    #1 0x7f65d6b471b8 in st_bind_images ../src/mesa/state_tracker/st_atom_image.c:172
    #2 0x7f65d6b76b26 in st_validate_state ../src/mesa/state_tracker/st_util.h:129
    #3 0x7f65d6b76b26 in prepare_draw ../src/mesa/state_tracker/st_draw.c:88
    #4 0x7f65d6b77c8a in st_draw_gallium ../src/mesa/state_tracker/st_draw.c:141
    #5 0x7f65d72698a2 in _mesa_draw_arrays ../src/mesa/main/draw.c:1202

Fixes: a6b3792843 ("r600: add core pieces of image support.")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22273>
2023-04-04 21:35:05 +00:00
Eric Engestrom
db0c4a8965 vc4/ci: add arm64 failure to flakes as it works on armhf
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22297>
2023-04-04 21:00:06 +00:00
Sonny Jiang
7360aa020c gallium/pipe: change PIPE_DEFAULT_DECODER_FEEDBACK_TIMEOUT_NS to 1 second
Fixes: 5e1bd07a ("radeonsi: vcn: implement the get_decoder_fence vfunc")
The commit [5e1bd07a] puts a timeout on fence_wait which causes a 8k AV1
decoding regression on gfx940. By adding DECODER_FEEDBACK_TIMEOUT to
add fence wait time.

Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22268>
2023-04-04 20:05:26 +00:00
Emma Anholt
3ede37f8a6 docs: Claim less functionality for glsl_compiler.
It doesn't generate GPU code, just GLSL IR code.  Also, clarify where to
find the built tool, and what the options do.

Closes: #8674
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22271>
2023-04-04 20:00:17 +00:00
Emma Anholt
c346413d9c ci: Add missing dependency on doxygen sources for docs-generation jobs.
!22191 broke docs generation and marge didn't notice because of missing
 deps.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22271>
2023-04-04 20:00:17 +00:00
Emma Anholt
6fc9540176 docs: Update Vulkan renderpass docs for !22191
Fixes: 6ad5f885af ("vulkan: Drop VkRenderingSelfDependencyInfoMESA")
Closes: #8773
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22271>
2023-04-04 20:00:17 +00:00
Ryan Neph
59a5340f74 i915: hook new get_fd proc for drm winsys
Fixes: 853b4801f2 ("i915: Add support for `get_screen_fd`")
Signed-off-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22294>
2023-04-04 19:39:02 +00:00
Ryan Neph
94b3a7e3ff virgl: hook new get_fd proc for drm winsys
Fixes: 2ade6917da ("virgl: Add support for `get_screen_fd`")
Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22292>
2023-04-04 19:21:59 +00:00
Daniel Schürmann
5c362cde33 radv: update PS num_vgprs in case of epilogs rather than overallocating VGPRs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22267>
2023-04-04 18:35:43 +00:00
Daniel Schürmann
4c7a5b1e51 aco: don't use shared VGPRs for shaders consisting of multiple binaries
When using multiple binaries, we don't know the required number of VGPRs beforehand,
which means we either have to over-allocate VGPRs or avoid shared VGPRs.
As bpermute is the only instructions needing shared VGPRs, we decide for the latter.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22267>
2023-04-04 18:35:43 +00:00
Daniel Schürmann
37df8edf34 aco/ra: adjust_max_used_regs() for fixed Operands
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22267>
2023-04-04 18:35:43 +00:00
Daniel Schürmann
8c68aba678 aco: split ps_epilog args before exporting them
This avoids some unnecessary copies from extracting from the input vectors.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22267>
2023-04-04 18:35:42 +00:00
Sagar Ghuge
10fc12fd17 anv: Drop dead code that sets the L3BypassDisable field
These helper functions will only get invoked for GFX < 11 and the
L3BypassDisable field is present starting from GFX12+.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22275>
2023-04-04 17:39:20 +00:00
Sagar Ghuge
e3b172d75d anv: Drop unused param from add_surface_reloc
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22275>
2023-04-04 17:39:20 +00:00
Emma Anholt
a1277b89a1 ci/zink: Disable godot-tps-gles3 on a630.
This trace used too much memory to be run in parallel with our other
traces.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22279>
2023-04-04 15:37:14 +00:00
Collabora's Gfx CI Team
91b06ea8b2 Uprev Piglit to 2391a83d1639a7ab7bbea02853b922878687b0e5
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22279>
2023-04-04 15:37:14 +00:00
Samuel Pitoiset
c5b7efa293 radv: enable shaders cache for libraries with GPL
This was the last missing feature for GPL. The main problem is that
the on-disk shaders cache size will increase a lot because we don't
deduplicate shaders but there is on-going work to improve that.

We also can't use the shaders cache for libraries created with the
RETAIN_LINK_TIME_OPTIMIZATION flag and module identifiers because we
don't know the SPIR-V and thus can't retain NIR shaders for linking.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22264>
2023-04-04 14:47:39 +00:00
Samuel Pitoiset
03d2bd6042 radv: ensure to retain NIR shaders for GPL libs found in the cache
Even if we are able to get the assembly from the shaders cache for
graphics pipeline libraries, we still need to retain NIR shaders in
case the LTO pipelines won't be find in the cache.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22264>
2023-04-04 14:47:39 +00:00
Samuel Pitoiset
5e62d8d1bd radv: add VkGraphicsPipelineLibraryFlag to the graphics pipeline key
This is to generate a different key for a library created with
FRAGMENT_SHADER_BIT and no FS (ie. it would generate a noop FS) and
a library created with FRAGMENT_OUTPUT_INTERFACE with no CB attachments.

Otherwise, the same key would be generated and this would corrupt
the cache.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22264>
2023-04-04 14:47:39 +00:00
Samuel Pitoiset
47c0820dc7 radv: remove dead code in radv_pipeline_get_nir()
We either import the NIR or the assembly, so this was never reached.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22264>
2023-04-04 14:47:39 +00:00
Samuel Pitoiset
a9529d9644 radv: allow to create/insert PS epilogs from/to the cache for libs
To cache PS epilogs compiled inside graphics pipeline libraries.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22264>
2023-04-04 14:47:39 +00:00
Samuel Pitoiset
ba967e1a28 radv: rely on non-NULL binaries when inserting shaders to the cache
With GPL, a stage can be imported from a library which means that the
binary is NULL (it's freed right after compilation) but the shader is
non-NULL. To avoid crashing, rely on non-NULL binaries because this
implies that the shader is non-NULL as well.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22264>
2023-04-04 14:47:39 +00:00
Samuel Pitoiset
1239fcab4d radv: only copy non-NULL shaders when loaded from the cache
With GPL, we don't necessarily load all stages from the same cache
entry and other stages might have been imported from libraries, so
don't overwrite them.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22264>
2023-04-04 14:47:39 +00:00
Connor Abbott
0977925c53 nir, spirv: Add support for VK_EXT_fragment_density_map
This involves two new system values.

Reviewed-by: Faith Ekstrand <faith@gfxstrand.net>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20303>
2023-04-04 13:14:35 +00:00
Emma Anholt
6c0a8a7f06 ci/zink: Drop validation exception for leaks at device destroy.
Between the recent glthread and zink fixes, we should be good to go.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22237>
2023-04-04 11:50:58 +00:00
Pierre-Eric Pelloux-Prayer
4c3e1f6529 radeonsi: update test results
This test was fixed by bf910c94e0 ("glsl: fix gl_CullDistance lowering
from float[8] to vec4[2]").

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22237>
2023-04-04 11:50:58 +00:00
Pierre-Eric Pelloux-Prayer
c1368685c3 util/vbuf: fix index_bo leak
When indices are unrolled we still have to release the index_bo
references passed to us.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8272
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22237>
2023-04-04 11:50:58 +00:00
Pierre-Eric Pelloux-Prayer
c19a3a6ddf util/vbuf: clarify indirect draws handling
It wasn't obvious from the u_vbuf code alone that num_draws
is guaranteed to be 1 in the indirect case.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22237>
2023-04-04 11:50:58 +00:00
Pierre-Eric Pelloux-Prayer
2b717f01f7 mesa: fix invalid index_bo refcounting
If take_index_buffer_ownership is true, then we should reserve
enough references of index_bo or we'll get an underflow later.

Fixes: 819627041e ("mesa: set pipe_draw_info::index::resource directly and remove gl_bo")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8747
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22237>
2023-04-04 11:50:58 +00:00
Mike Blumenkrantz
09320705f0 zink: be explicit about separate shader dsl indexing during creation
this fixes a minor issue where a fs without a vs dsl would have the wrong
index

Fixes: e3b746e3a3 ("zink: use GPL to handle (simple) separate shader objects")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22269>
2023-04-04 11:29:01 +00:00
Tapani Pälli
b0cdd5a1d2 anv: check for MESA_SHADER_TESS_CTRL with get_tcs_prog_data
Fixes: 86d931724d ("anv: Implement Wa_14015297576")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22282>
2023-04-04 10:42:12 +03:00
Tapani Pälli
98c6db3fc8 anv: take primitive ID override to account Wa_14015297576
Commit ca4ec49b0e took primitive ID override fields in to use, this
has to be checked as part of Wa_14015297576.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22282>
2023-04-04 10:41:58 +03:00
Mike Blumenkrantz
e84cf80fe1 zink: always store nir serialized
this saves a ton of memory and has minimal, if any cpu impact

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:41 +00:00
Mike Blumenkrantz
4e1668384d zink: store num_inlinable_uniforms separately for cs programs
compute is a special case because the zink_shader itself is created
in a thread, which means it cannot be accessed directly at bind time
since it may not have finished creating itself yet

to avoid prematurely waiting on an async fence, the one value needed
at bind time can instead be stored separately

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:41 +00:00
Mike Blumenkrantz
517146f540 zink: move nir cloning out to callers of zink_shader_compile
this will make more sense with future changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:41 +00:00
Mike Blumenkrantz
dfa8c15164 zink: break out nir blob deserializing
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:41 +00:00
Mike Blumenkrantz
0563499db0 zink: simplify assign_io() further
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:41 +00:00
Mike Blumenkrantz
fd2714b5a9 zink: store nir as serialized on zink_shader structs
nir_shader objects are hefty, and they really add up when there's a lot
of them. there's also not much use in keeping them around, as any time
they'll be used, they're always cloned first, and deserializing isn't
likely to be any slower than a clone

cuts driver memory usage by ~40% for tomb raider

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:41 +00:00
Mike Blumenkrantz
e40134aea8 zink: streamline nir cloning for assign_io
more relics from the time of pipe_shader_type

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:41 +00:00
Mike Blumenkrantz
2e1ad9f817 zink: directly return nir from zink_shader_tcs_create
not currently used but will be

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:41 +00:00
Mike Blumenkrantz
d3c9112404 zink: swap nir pointers when compiling compute shaders
these are the same pointer, just use a different one

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:41 +00:00
Mike Blumenkrantz
fdb9c91922 zink: pass nir directly to zink_shader_tcs_create()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:41 +00:00
Mike Blumenkrantz
6524b9285f zink: simplify fbfetch output detection from fs
this should be identical to the previous code, except it also
handles depth/stencil (not yet supported)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:41 +00:00
Mike Blumenkrantz
edc804e50f zink: use zink_shader::info instead of zink_shader::nir::info
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:40 +00:00
Mike Blumenkrantz
b33d5d1a98 zink: generate flat_flags during shader creation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:40 +00:00
Mike Blumenkrantz
f26526ff33 zink: pass nir_shader to update_so_info()
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:40 +00:00
Mike Blumenkrantz
f7b76d681b zink: add and populate a shader_info struct to zink_shader
this avoids the need to use the nir pointer to access shader info

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:40 +00:00
Mike Blumenkrantz
eb30744562 zink: delete shader reordering in assign_io()
this is a relic of when pipe_shader_type was different than gl_shader_stage

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
2023-04-04 01:37:40 +00:00
Alejandro Piñeiro
bbd124fd00 v3dv/pipeline: use pipeline depth bias enabled to fill up CFG packet
Even if the VkPipelineRasterizationStateCreateInfo sets
depthBiasEnable, internally we comput if it is really makes sense, and
use that to decide for example if we emit the Depth Offset packet.

But we were not using this to enable Depth Bias through the depth
offset enable field on the CFG packet.

So in some tests we were enabling depth bias, but not emitting the
packet to configure it, that seemed somewhat inconsistent.

This didn't cause any issue so far, but let's be conservative.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22252>
2023-04-04 00:06:38 +00:00
Lionel Landwerlin
a88aedbfa5 intel/perf: fix OA format selection on MTL
Anything Gfx12.5+ has a different format.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 90c86fe63e ("intel: add MTL performance metrics")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22257>
2023-04-03 23:34:17 +00:00
Lionel Landwerlin
c61101f151 intel/dev: set a default valid kmd_type
src/intel/perf/intel_perf_query_layout.c needs a valid kmd type to
look at the metrics

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 757e2dd692 ("intel/perf: Disable it for Xe KMD")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22257>
2023-04-03 23:34:17 +00:00
Ian Romanick
2016d9f46c intel/fs: Rework the loop of opt_combine_constants that collects constants
This is a bit more wordy, but it will greatly simplify some future
changes.

v2: Rebase on ADD3 changes.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Tested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22274>
2023-04-03 21:50:06 +00:00
Ian Romanick
9e4bb4bfcf intel/fs: Refactor part of opt_combine_constants to a separate function
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Tested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22274>
2023-04-03 21:50:06 +00:00
Ian Romanick
593cde0432 intel/fs: Output opt_combine_constants debug to stderr
It's a lot more useful to have it in the same stream with the
INTEL_DEBUG=fs output.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Tested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22274>
2023-04-03 21:50:06 +00:00
Iván Briano
eadc64ab24 vulkan/wsi/display: do not dereference a NULL pointer
Fixes dEQP-VK.wsi.direct_drm.swapchain.simulate_oom.*

Cc: mesa-stable

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19025>
2023-04-03 20:21:17 +00:00
Faith Ekstrand
6ad5f885af vulkan: Drop VkRenderingSelfDependencyInfoMESA
It's no longer needed as VK_EXT_attachment_feedback_loop_layout provides
everything we need.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22191>
2023-04-03 18:13:01 +00:00
Faith Ekstrand
b4c18b9b76 vulkan: Drop vk_render_pass_state::*self_dependenc*
ANV was the only driver using them and now it's on feedback loop flags.
Other drivers should convert instead of depending on the old version.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22191>
2023-04-03 18:13:01 +00:00
Faith Ekstrand
6d4e605378 hasvk/pipeline: Use feedback loop flags for self-dependencies
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22191>
2023-04-03 18:13:01 +00:00
Faith Ekstrand
8df8a3c19b anv/pipeline: Use feedback loop flags for self-dependencies
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22191>
2023-04-03 18:13:01 +00:00
Faith Ekstrand
f3876db1ee vulkan: Plumb rendering flags through vk_graphics_pipeline_state
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22191>
2023-04-03 18:13:01 +00:00
Connor Abbott
f4b534d50f vk/render_pass: Support VK_EXT_fragment_density_map
Support emulating "classic" FDM with dynamic rendering.

Reviewed-by: Faith Ekstrand <faith@gfxstrand.net>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22191>
2023-04-03 18:13:01 +00:00
Connor Abbott
df9694e98e tu: Use vk_pipeline_get_renderpass_flags()
With this we can remove usage of VkSelfDependencyInfoMESA.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22191>
2023-04-03 18:13:01 +00:00
Jason Ekstrand
bd26ae0086 vulkan: Record pipeline flags in the render pass
This records any rendering pipeline flags in the render pass.  This
provides much-needed information for the VK_KHR_fragment_shading_rate
and VK_EXT_fragment_density_map extensions as well as provides an
alternative to VkRenderingSelfDependencyInfoMESA which is based on
VK_EXT_attachment_feedback_loop_layout.

v2 (Connor): Name something more general
v3 (Faith): Also add the FSR flag

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22191>
2023-04-03 18:13:01 +00:00
Samuel Pitoiset
9582c1e52a radv/ci: add one more flake
This one is randomly failing.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22258>
2023-04-03 17:20:13 +00:00
Samuel Pitoiset
d74790a865 zink/ci: remove primitive-id-no-gs-quads from the NAVI10 fail list
It has been fixed too.

Fixes: 5fb8ba0eb8 ("zink/ci: remove `primitive-id-no-gs-quads` from radv-vangogh-fails")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22258>
2023-04-03 17:20:13 +00:00
Rhys Perry
f92994bb83 radv/gfx11: improve RT scratch allocation
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22232>
2023-04-03 16:35:17 +00:00
Timur Kristóf
50e9a8f7c2 radv: Use linear_dispatch info in GFX11 task/mesh draw packet.
This helps the CP (command processor) optimize mesh shader
dispatch when Y = Z = 1.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22222>
2023-04-03 15:36:02 +00:00
Timur Kristóf
e42d2bd534 nir: Gather compile time constant task->mesh dispatch size.
Some GPUs such as AMD RDNA3 can use this information
to optimize mesh shader dispatches.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22222>
2023-04-03 15:36:02 +00:00
Timur Kristóf
836204da25 aco: Better phi lowering for merge block when else-side is const.
Add a new special case for binary merge blocks to boolean
phi lowerig. This special case benefits shaders that
have divergent branches with an empty else block,
for example all NGG culling shaders.

Fossil DB stats on Rembrandt (NGG culling enabled):

Totals from 61778 (45.79% of 134913) affected shaders:
SpillVGPRs: 2268 -> 2284 (+0.71%); split: -1.10%, +1.81%
CodeSize: 164317952 -> 162962772 (-0.82%); split: -0.83%, +0.00%
Instrs: 31249824 -> 30910686 (-1.09%); split: -1.09%, +0.00%
Latency: 154948555 -> 154781097 (-0.11%); split: -0.12%, +0.02%
InvThroughput: 30397664 -> 30370872 (-0.09%); split: -0.13%, +0.04%
VClause: 529239 -> 529229 (-0.00%); split: -0.00%, +0.00%
SClause: 783417 -> 783430 (+0.00%)
Copies: 2627570 -> 2595161 (-1.23%); split: -1.25%, +0.02%
Branches: 976506 -> 976508 (+0.00%); split: -0.00%, +0.00%

Fossil DB stats on GFX11 (NGG culling disabled):

Totals from 895 (0.66% of 134913) affected shaders:
SpillVGPRs: 2258 -> 2322 (+2.83%); split: -0.44%, +3.28%
CodeSize: 6229152 -> 6215880 (-0.21%); split: -0.37%, +0.16%
Scratch: 216576 -> 215808 (-0.35%); split: -0.47%, +0.12%
Instrs: 1202077 -> 1198396 (-0.31%); split: -0.43%, +0.13%
Latency: 15921336 -> 16000561 (+0.50%); split: -0.74%, +1.24%
InvThroughput: 7425765 -> 7474891 (+0.66%); split: -0.67%, +1.33%
VClause: 22976 -> 23008 (+0.14%); split: -0.03%, +0.17%
SClause: 38269 -> 38271 (+0.01%)
Copies: 123244 -> 123896 (+0.53%); split: -0.30%, +0.83%
Branches: 47570 -> 47574 (+0.01%); split: -0.00%, +0.01%

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/21493>
2023-04-03 14:36:07 +00:00
Timur Kristóf
81b4806d64 aco: Call dominator_tree before lower_phis.
This just makes it possible to use the dominator
tree information during phi lowering.

No Fossil DB changes on GFX11.

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/21493>
2023-04-03 14:36:07 +00:00
Timur Kristóf
0eb7c49c7f aco: Pop branch operands when targets are same in SSA elimination.
The branch instruction is no longer conditional when the targets are the
same, so the operand is not necessary and can be removed.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21493>
2023-04-03 14:36:07 +00:00
Timur Kristóf
739bd03c37 aco: Don't verify branch exec read when eliminating exec writes.
Verifying that the branch instruction reads exec is not actually
necessary because the pattern that we look for already implies that.

This prepares for the next commit which will remove the exec operand
from branches that have the same target. These branches will no
longer read exec, but they should still get the same optimization.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21493>
2023-04-03 14:36:07 +00:00
Timur Kristóf
9eb04d8f96 aco: Simplify get_phi_operand using Operand::c32_or_c64.
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/21493>
2023-04-03 14:36:07 +00:00
Timur Kristóf
0211e66f65 aco: Don't remove exec writes that also write other registers.
Don't eliminate an instruction that writes registers other than exec and scc.
It is possible that this is eg. an s_and_saveexec and the saved value is
used by a later branch.

Fixes: bc13049747
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21493>
2023-04-03 14:36:07 +00:00
Timur Kristóf
54da863956 aco: Consider p_cbranch_nz as divergent branch too.
A p_cbranch_nz instruction that reads exec is divergent too.

Fixes: f030b75b7d
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21493>
2023-04-03 14:36:07 +00:00
David Heidelberg
78644c9bb0 ci: disable lima farm, currently out-of-space, needs to be fixed
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22265>
2023-04-03 14:41:15 +02:00
Tatsuyuki Ishi
7fe469d6c8 radv: Pre-compute descriptor set layout hash.
While analyzing cache loading performance, hashing the pipeline layout was
surprisingly consuming around 4% of time, sometimes close to the cost of
hashing shader modules.

Turns out we were hashing the pipeline layout on every pipeline creation.
Considering that pipeline layouts are usually deduplicated by the
application, this was amplifying the hashing cost by a big margin.

With Graphics Pipeline Library, we do need to rebuild the pipeline layout
by combining those from each library, but we can memoize the hash of the
descriptor set layout. The cost of re-hashing hashes is negligible since
each descriptor set layout can amount to 1–2KB in size.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22254>
2023-04-03 08:46:08 +00:00
Nataraj Deshpande
71fe9dfe07 anv: Bump VkDeviceMemory objects limit to 4GB
Android CTS 13_r4 tests dEQP-VK.memory.allocation.random* fail
with VK_ERROR_OUT_OF_DEVICE_MEMORY on ADL boards with 32GB memory
as memory allocation requests from DEQP are much larger(~2.9GB+)
based on device heap size/8.

Increase the limit to unsigned 32bit max(~4GB) which helps to
fix the dEQP-VK.memory.allocation.random* tests.

v1: Bound allocation by the largest memory heap size (Lionel Landwerlin)

v2: Clean up comments to reflect the code change (Ivan Briano)
    Update the value of MAX_MEMORY_ALLOCATION_SIZE (Lionel Landwerlin)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22066>
2023-04-03 06:18:52 +00:00
Lionel Landwerlin
b7e5b3e318 isl: update max buffer size for SKL+
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22066>
2023-04-03 06:18:52 +00:00
Lionel Landwerlin
00fc927e52 anv: take care of maxStorageBufferRange being uint32_t
Not fixing anything, but required for another fix.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22066>
2023-04-03 06:18:52 +00:00
Qiang Yu
7be81a680b ac/llvm: remove ac_build_opencoded_load_format
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22045>
2023-04-03 01:35:06 +00:00
Qiang Yu
1165758b8b ac/llvm,radeonsi: remove abi->load_inputs implementation
No nir_load_input in VS now.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22045>
2023-04-03 01:35:06 +00:00
Qiang Yu
894d92995c radeonsi: monolithic VS emit prolog in nir directly
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22045>
2023-04-03 01:35:06 +00:00
Qiang Yu
531acf548a ac/llvm: move ac_fixup_ls_hs_input_vgprs to amd common
To be shared with radeonsi.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22045>
2023-04-03 01:35:06 +00:00
Qiang Yu
297f97a42b ac/llvm: vs_rel_patch_id can also be fixed up
It's currently used when LS store output to LDS.
The LS/HS bug fix seems does not affect this case.
But we'd better treat it as other fixed args.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22045>
2023-04-03 01:35:06 +00:00
Qiang Yu
7ab7eccddd radeonsi: add si_nir_lower_vs_inputs
Ported from llvm:
* si_load_vs_input
* ac_build_opencoded_load_format
* ac_ufN_to_float
* get_vertex_index
* ac_build_fast_udiv_nuw

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22045>
2023-04-03 01:35:06 +00:00
Qiang Yu
003d84b660 ac/nir: add ac_nir_load_arg_at_offset
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22045>
2023-04-03 01:35:06 +00:00
Qiang Yu
e6f69853be radeonsi: expose si_nir_load_internal_binding
PS polygon stippling is going to use it too.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22045>
2023-04-03 01:35:06 +00:00
Mauro Rossi
b40e7dcf82 hasvk: include "vk_android.h" header in anv_android.c
Fixes the following building errors:

../src/intel/vulkan_hasvk/anv_android.c:387:34: error: implicit declaration of function 'vk_alloc_ahardware_buffer' is invalid in C99 [-Werror,-
Wimplicit-function-declaration]
   struct AHardwareBuffer *ahw = vk_alloc_ahardware_buffer(pAllocateInfo);
                                 ^
../src/intel/vulkan_hasvk/anv_android.c:387:28: error: incompatible integer to pointer conversion initializing 'struct AHardwareBuffer *' with an expression of type 'int' [-Werror,-Wint-conversion]
   struct AHardwareBuffer *ahw = vk_alloc_ahardware_buffer(pAllocateInfo);
                           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.

Fixes: b16cfe23 ("vulkan,anv,hasvk,radv: Unify Android hardware buffer creation")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22251>
2023-04-02 23:30:42 +02:00
Timur Kristóf
4de9a4b2b8 ac/nir: When task->mesh dispatch Y or Z are 0, also set X to 0.
AMD recommends doing this to speed up the CP when it processes
the draw ring entries. LLPC also does this.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22211>
2023-04-01 14:46:50 +00:00
Timur Kristóf
4683b21399 ac/nir: Store only lowest 8 bits for task draw ring DWORD3.
When writing the draw ready bit, don't write the high 24 bits
of DWORD3, because that is used by the HW for something else
according to LLPC.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22211>
2023-04-01 14:46:50 +00:00
Rhys Perry
6974e5479c aco: fix nir_var_shader_out barriers for task shaders
These will be used in a future commit.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22211>
2023-04-01 14:46:50 +00:00
Rob Clark
d698bf0523 freedreno: Support the disable_throttling=true driconf option
At this point, mostly just to make it easier to disable throttling for
performance debugging.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22224>
2023-04-01 13:53:31 +00:00
Rob Clark
77a5778836 freedreno: Move driconf settings into sub-struct
Organize all one of them in a single place before adding more.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22224>
2023-04-01 13:53:31 +00:00
Rob Clark
8620b64930 freedreno: Avoid looping shader stages if nothing dirty
We have corresponding global dirty bits for each of the per-stage dirty
bits.  We can use this to skip iterating over shader stages when there
is no per-stage dirty state to handle.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22224>
2023-04-01 13:53:31 +00:00
Rob Clark
0a62a874fc freedreno: Re-work dirty-resource tracking
If a resource is dirty but already tracked by the current batch, no need
to process it at draw time.

Note that the batch could change (ie. new fb state bound, etc) after the
check if we need resource dirty tracking, but in these cases all the
dirty-resource state is marked dirty.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22224>
2023-04-01 13:53:31 +00:00
Rob Clark
4c0fdef42c freedreno: Inline single-use helpers
bind_sampler_states() / set_sampler_views() have just a single caller.
So inline them.  Needed for next commit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22224>
2023-04-01 13:53:31 +00:00
Rob Clark
7099f628c5 freedreno: Extract out a helper
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22224>
2023-04-01 13:53:31 +00:00
Rob Clark
0408ddcda9 freedreno: Hoist dirty vars
Prep to re-work how we track dirty-resource.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22224>
2023-04-01 13:53:31 +00:00
Rob Clark
19a138adcf freedreno: Stop being too clever by half
This wasn't taking into account a change in corresponding bit in
writeable_bitmask, causing problem if an SSBO was first bound for
read, and then rebound for write, we wouldn't update the buffers
valid range.  Instead just drop the premature optimization.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22224>
2023-04-01 13:53:31 +00:00
Connor Abbott
b123ee707d freedreno: Fix or/and'ing two BitmaskEnums
Previously when there was an & or | with two BitmaskEnums, the compiler
would try to cast the RHS and find a matching overload, but there were
many different casts (to the enum itself, to an integer, to a boolean,
etc.) each with a matching overload which meant that it couldn't pick
one and errored out due to an ambiguous overload. Fix this by
explicitly providing an overload that takes a BitmaskEnum on the RHS.
It has to also provide a BitmaskEnum output, so that subsequent
operators with the result on the LHS (e.g. when or'ing together three
BitmaskEnums without any parentheses tricks) also get the right
overload.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22224>
2023-04-01 13:53:31 +00:00
Pavel Ondračka
5825f9dd68 nine: use separate register for aL emulation
NIR loop unrolling is only working if the loop counter is a scalar.
So keep the loop counter separate and move the aL emulation and
the aL increment to a new register.

This allows loop unrolling with vec4 backends where unconditional
scalarizing of phi nodes is undesirable, like for example r300.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Axel Davy <davyaxel0@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7222
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21243>
2023-04-01 11:12:55 +00:00
Karol Herbst
ac993ae828 rusticl/kernel: make use of cso info
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>
2023-03-31 20:29:00 +00:00
Karol Herbst
c7dd3677dc panfrost: implement get_compute_state_info
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>
2023-03-31 20:29:00 +00:00
Karol Herbst
87aeea20ac panfrost: move max_thread_count and take reg_count into account
We'll need it to report proper thread counts for OpenCL.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>
2023-03-31 20:29:00 +00:00
Karol Herbst
3212ac4658 nvc0: implement get_compute_state_info
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>
2023-03-31 20:29:00 +00:00
Karol Herbst
52f03f63e7 nv50: implement get_compute_state_info
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>
2023-03-31 20:29:00 +00:00
Karol Herbst
c1c0362d34 iris: implement get_compute_state_info
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>
2023-03-31 20:29:00 +00:00
Karol Herbst
5fa297dadd lp: implement get_compute_state_info
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>
2023-03-31 20:29:00 +00:00
Karol Herbst
6305d1cb1c gallium: add get_compute_state_info
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>
2023-03-31 20:29:00 +00:00
Karol Herbst
87147e2b09 rusticl/kernel: set has_variable_shared_mem on the nir
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>
2023-03-31 20:29:00 +00:00
Karol Herbst
0e5722cd22 nir: track existence of variable shared memory
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19855>
2023-03-31 20:29:00 +00:00
Sil Vilerino
1995762d68 Revert "d3d12: Honor suggested driver profile/level for H264/HEVC encode"
This reverts commit 37652da616.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22239>
2023-03-31 20:13:20 +00:00
Rhys Perry
0f60c18f29 aco: don't optimize s_or_b64(v_cmp_u_f32(a, b), cmp(a, a))
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/22214>
2023-03-31 19:41:54 +00:00
Charlie Birks
46e7a127d9 docs: add a few vulkan extensions supported by multiple drivers
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11445>
2023-03-31 19:35:36 +00:00
Konstantin Seurer
7b837531e8 radv/ci: Update ray tracing pipeline fail/skip lists
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22018>
2023-03-31 19:05:17 +00:00
Samuel Pitoiset
e98aded527 radv: fix binding raytracing/compute pipelines
If a compute pipeline is bound after a raytracing pipeline, the
computes shader slot (aka RT prolog) will be overwritten.

To fix this, move the RT prolog outside of the compute shader slot.

Fixes: d109362a3d ("radv: copy bound shaders to the cmdbuf state")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22235>
2023-03-31 18:29:05 +00:00
Samuel Pitoiset
56493a5f8a radv: add the raygen shader BO to the cmdbuf list
Found by inspection.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22235>
2023-03-31 18:29:05 +00:00
Timur Kristóf
115958b6f0 ac/nir/ngg: Slightly improve attribute ring offset calculation.
Inspired by Nicolai Hähnle's commit in LLPC.
Instead of using a SALU instruction to add to the scalar
offset, rely on the buffer swizzling and use constant offset.

Fossil DB stats on GFX1100:

Totals from 47910 (35.51% of 134913) affected shaders:
CodeSize: 87927612 -> 86968136 (-1.09%)
Instrs: 17584007 -> 17440094 (-0.82%)
Latency: 97232173 -> 97126311 (-0.11%)
InvThroughput: 9904586 -> 9905288 (+0.01%); split: -0.02%, +0.02%
VClause: 544430 -> 542566 (-0.34%)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22227>
2023-03-31 17:02:17 +00:00
Timur Kristóf
61003e3600 radv: Use radv_get_shader to get vertex shader when binding pipeline.
The shaders[MESA_SHADER_VERTEX] can be NULL for merged shaders.

Fixes: b2ac40e734
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8749
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22229>
2023-03-31 16:42:39 +00:00
Samuel Pitoiset
f8558d1fb5 radv: configure PA_SC_MODE_CNTL_1 during cmdbuf recording
Two graphics pipeline parameters need to be copied to the cmdbuf
state.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22218>
2023-03-31 16:07:11 +00:00
Samuel Pitoiset
66da73e863 radv: set PS_ITER_SAMPLE(1) for sample shading during cmdbuf recording
This shouldn't be configured in the pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22218>
2023-03-31 16:07:11 +00:00
Samuel Pitoiset
b750fe4c6a radv: copy db_render_control to the cmdbuf state
This register is only used for meta operations.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22218>
2023-03-31 16:07:11 +00:00
José Roberto de Souza
e6c9b6eddc iris: Implement Xe version of bo_madvise() and bo_set_caching()
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22060>
2023-03-31 15:40:27 +00:00
Maarten Lankhorst
c10ff19704 iris: Place scanout buffers only into lmem for discrete GPUs
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22060>
2023-03-31 15:40:27 +00:00
José Roberto de Souza
d72705ce43 iris: Handle allocation of scanout buffers in Xe
Bos that will be scanout in display need to be allocated with
flags = XE_GEM_CREATE_FLAG_SCANOUT in Xe and that implies to different
caching rules for this buffer.

So here not allowing to get scanout buffer from cache or allow it
to be placed in a cache bucket for reuse.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22060>
2023-03-31 15:40:27 +00:00
José Roberto de Souza
ccffcec03e iris: Handle allocation of exported buffers in Xe kmd
Bos that will be exported need to be allocated with vm_id = 0 in Xe,
so don't try to get a bo from cache that was allocated with a
valid vm_id.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22060>
2023-03-31 15:40:27 +00:00
José Roberto de Souza
41ddecc8b2 iris: Add BO_ALLOC_SHARED
Xe KMD requires special handling for exported buffers during creation.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22060>
2023-03-31 15:40:27 +00:00
Faith Ekstrand
4b0b75c27a anv: Use the new vk_device_memory base struct
Reviewed-by: Lina Versace <lina@kiwitree.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22038>
2023-03-31 14:57:03 +00:00
Faith Ekstrand
c0cc508cd0 vulkan: Add a vk_device_memory base struct
This lets us provide a vk_device_memory_range helper similar to what's
provided for buffers for dealing with VK_WHOLE_SIZE.  We can also handle
flags and some annoyance around Android hardware buffer import.

Reviewed-by: Lina Versace <lina@kiwitree.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22038>
2023-03-31 14:57:03 +00:00
Faith Ekstrand
b16cfe23ef vulkan,anv,hasvk,radv: Unify Android hardware buffer creation
Reviewed-by: Lina Versace <lina@kiwitree.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22038>
2023-03-31 14:57:03 +00:00
Faith Ekstrand
d75f797246 radv: Set vk_image.ahardware_buffer_format
Reviewed-by: Lina Versace <lina@kiwitree.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22038>
2023-03-31 14:57:03 +00:00
Faith Ekstrand
0a86df21d0 anv,hasvk: Set vk_image.ahardware_buffer_format
This effectively just modifies it for YCbCr images where the common code
doesn't have a useable format mapping.

Reviewed-by: Lina Versace <lina@kiwitree.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22038>
2023-03-31 14:57:03 +00:00
Faith Ekstrand
906944b210 vulkan: Add an ahardware_buffer_format field to vk_image
Reviewed-by: Lina Versace <lina@kiwitree.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22038>
2023-03-31 14:57:03 +00:00
Faith Ekstrand
dc0749adab vulkan/android: Fix hardware buffer usage flags
We now add the correct usage flags for input attachments, storage
images, and depth/stencil attachments.

Reviewed-by: Lina Versace <lina@kiwitree.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22038>
2023-03-31 14:57:03 +00:00
Faith Ekstrand
41f88be282 vulkan,anv,hasvk,radv: Add a common vk_image_usage_to_ahb_usage helper
Reviewed-by: Lina Versace <lina@kiwitree.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22038>
2023-03-31 14:57:03 +00:00
Felix DeGrood
49f34675f3 anv: set CFE_STATE.OverDispatchControl to default
BSpec specifies default value for CFE_STATE.OverDispatchControl
is 2, or 50% overdispatch. No observed performance impact.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22179>
2023-03-31 14:18:59 +00:00
Felix DeGrood
ecb709c853 anv: only emit CFE_STATE when scratch space increases
On Gen12.5+, we only need to emit CFE_STATE when scratch space
has changed, not on every pipeline binding. Also, only grow the
scratch space, never shrink it. Need to reset after secondary buf.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22179>
2023-03-31 14:18:58 +00:00
Lionel Landwerlin
c88de6c18c anv: move queue check helpers to anv_private
Also fix missing trace point stuff in command buffer begin/end

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22179>
2023-03-31 14:18:58 +00:00
Lionel Landwerlin
546a6752ac anv: compute the largest GRL kernel scratch size
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22179>
2023-03-31 14:18:58 +00:00
Felix DeGrood
97e64aef60 anv: cs_stall during compute state flush on < gen12.5
The CS Stall in cmd_buffer_flush_compute_state is only required
on HW that uses MEDIA_VFE_STATE, gen12 and previous.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22179>
2023-03-31 14:18:58 +00:00
Lucas Fryzek
cffa67af01 gallium: Modify default path for DMABUF to use DRM
Modify the code path taken in `u_pipe_screen_get_param_defaults`
to call DRM to check if `PIPE_CAP_DMABUF` is supported. This is
required for overriding the behavior in `dri2_init_screen_extensions`
to support importing DMA bufs on drivers that don't support DRM, by
simply changing how `PIPE_CAP_DMABUF` is handled in their driver.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21654>
2023-03-31 13:39:07 +00:00
Lucas Fryzek
59efea9f63 d3d12/llvmpipe/softpipe: Add support for get_screen_fd
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21654>
2023-03-31 13:39:07 +00:00
Lucas Fryzek
0c0e7d5c1a r300/r600/radeon_si: Add support for get_screen_fd
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21654>
2023-03-31 13:39:07 +00:00
Lucas Fryzek
2ade6917da virgl: Add support for get_screen_fd
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21654>
2023-03-31 13:39:06 +00:00
Lucas Fryzek
cf1c3c96ab svga: Add support for get_screen_fd
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21654>
2023-03-31 13:39:06 +00:00
Lucas Fryzek
853b4801f2 i915: Add support for get_screen_fd
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21654>
2023-03-31 13:39:06 +00:00
Lucas Fryzek
0f5fdd9ca4 iris: Add support for get_screen_fd
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21654>
2023-03-31 13:39:06 +00:00
Lucas Fryzek
29a7bc6172 zink: Add support for get_screen_fd
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21654>
2023-03-31 13:39:06 +00:00
Lucas Fryzek
28275598df nouveau: Add support for get_screen_fd
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21654>
2023-03-31 13:39:06 +00:00
Lucas Fryzek
70a8292b17 tegra: Add support for get_screen_fd
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21654>
2023-03-31 13:39:05 +00:00
Lucas Fryzek
b18f259177 crocus: Add support for get_screen_fd
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21654>
2023-03-31 13:39:05 +00:00
Mike Blumenkrantz
4faa0c2f10 lavapipe: advertise EXT_shader_object
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22233>
2023-03-31 13:19:27 +00:00
Mike Blumenkrantz
8b3022c918 lavapipe: implement EXT_shader_object
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22233>
2023-03-31 13:19:27 +00:00
Mike Blumenkrantz
469a1d8c11 lavapipe: break out pipeline layout creation for reuse
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22233>
2023-03-31 13:19:27 +00:00
Corentin Noël
1eaea97f3a venus/ci: Only run one crosvm instance
As venus now has separate render server processes it is better to use a single
crosvm instance to run all the tests.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21693>
2023-03-31 12:39:49 +00:00
Corentin Noël
c08c2a0963 ci: Uprev crosvm and virglrenderer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21693>
2023-03-31 12:39:49 +00:00
Samuel Pitoiset
df3536cd4a vulkan: Update XML and headers to 1.3.246
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22231>
2023-03-31 11:43:20 +00:00
antonino
c682de95fb zink: update requirements now that pv mode can be emulated
Zink can now emulate provoking vertex mode when the extention is
missing, update requirements to reflect this.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22162>
2023-03-31 11:03:48 +00:00
antonino
302302a8a1 zink: always advertize provoking vertex mode support
Require VK_EXT_provoking_vertex for optimal_keys and always advertize
PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION since it can now be
emulated

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22162>
2023-03-31 11:03:48 +00:00
antonino
5a4083349f zink: add provoking vertex mode lowering
Can be used as fallback for when VK_EXT_provoking_vertex is missing

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22162>
2023-03-31 11:03:48 +00:00
antonino
9466a6e2f8 zink: add field to 'zink_gs_key' and enum
Add enum for pv emulation primitives and `lower_pv_mode`
to `zink_gs_key`

The enum contains the possible values of the lower_pv_mode key

This key will be non 0 whenever provoking vertex mode needs to be
emulated and it's exact value encodes relevant information about the
primitive that needs to be emulated

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22162>
2023-03-31 11:03:48 +00:00
antonino
34faab07da zink: simplify logic to call zink_set_primitive_emulation_keys
The logic had grown to check every primitive indivdually, instead just
check wehether `rast_prim` has changed

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22162>
2023-03-31 11:03:48 +00:00
antonino
15b3d77b40 nir: only handle flat interpolation when needed in nir_create_passthrough_gs
When turning primitives into line strips this function needs to move
attributes around, but this is not needed in other cases.

Fixes: 1a5bdca2dd ("zink: implement flat shading using inlined uniforms")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22162>
2023-03-31 11:03:48 +00:00
xurui
744cdf4262 panfrost: Check the return value of drmGetVersion
Signed-off-by: xurui <xurui@kylinos.cn>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22203>
2023-03-31 09:45:19 +00:00
Erik Faye-Lund
1aa09f3346 docs: make code-block indents consistent
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22052>
2023-03-31 09:39:17 +00:00
Erik Faye-Lund
eec6564258 docs: format code-block as toml
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22052>
2023-03-31 09:39:17 +00:00
Erik Faye-Lund
e7f00ee2c8 docs: format code-block as ini
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22052>
2023-03-31 09:39:17 +00:00
Friedrich Vock
b8ee90188b radv: Work around use-after-free compiler errors
Fixes: 4dafb69d ("radv/rt: defer library_pipeline allocation")
Tested-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21981>
2023-03-31 08:52:16 +00:00
Samuel Pitoiset
56b98bb36d radv: add dynamic support for rectangles enable/mode
This is in VK_EXT_discard_rectangles version 2.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21360>
2023-03-31 07:59:18 +00:00
Samuel Pitoiset
1577906d9f vulkan: add dynamic support for rectangles enable/mode
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21360>
2023-03-31 07:59:18 +00:00
Samuel Pitoiset
552f877b2d radv: fix sample shading when a new fragment shader is bound
Sample shading can be enabled from the pipeline and from the fragment
shader, in that case we need to re-emit some states.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22215>
2023-03-31 07:09:15 +00:00
Sagar Ghuge
a064e8ff29 intel/decoder: Bump the binding table guess value to 32
Let's bump the binding table value guess to 32 instead of 8 and also stop
decoding the binding table entries as soon as we hit the zero
initialized value in the map.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22221>
2023-03-31 01:01:53 +00:00
Alyssa Rosenzweig
4d2c8bf859 docs: Remove docs about macOS hardware drivers
We dropped support for hardware macOS drivers in afe134a49c ("asahi: Drop macOS
backend"), so drop the corresponding documentation. Layered and software drivers
are still supported on macOS for better or worse, so the main "Notes on macOS"
page can stay I think.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22213>
2023-03-31 00:55:44 +00:00
Jesse Natalie
31778ac869 microsoft/clc: Add shader model / validator to compiler API
Shader model 6.2 was the upper bounds of what *could* be generated
before, but not all devices support it. And other devices support
even more. So, let's pass in the shader model / validator that will
be used by the API caller.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21178>
2023-03-31 00:37:19 +00:00
Alyssa Rosenzweig
cd03392c7e panfrost: Choose hierarchy masks by vertex count
Currently, we always use a hierarchy mask with all levels enabled. While this is
efficient for geometry-heavy workloads like 3D games, it is wasteful for 2D
applications that draw very few vertices. For drawing just a few textured quads,
the overhead of small bin sizes outweighs any performance advantages, so it's a
bit slower. More problematically, small bin sizes require tremendous amounts of
memory for the polygon lists, leading to significant memory consumption (~10MB)
for the polygon list for even the simplest of 2D blits.

To reduce our memory footprint, we need to choose our hierarchy masks more
carefully. In general, we want to allow small bin sizes for geometry-heavy
workloads but not for geometry-light workloads. We estimate vertex count in the
driver as a proxy for this, and use a simple heuristic to select a bin size
based on the estimated vertex count. None of this is an exact science, and the
heuristic could probably be tuned. Nevertheless, the heuristic used (comparing
framebuffer size to vertex count) works well in practice, significantly reducing
the memory footprint of 2D applications like Firefox without hurting the
performance of 3D applications.

I originally wrote this patch while diagnosing high memory footprints on my
Midgard laptop, which is why only Midgard is in scope here. On Bifrost and
Valhall, we have a similar hiearchy mask selection problem. It seems likely that
the same heuristic would work there too, but it's a different code path that I
have not integrated or tested. I'll leave that for the adventurous reader, to
get the memory footprint win there too.

(It's also possible the win is smaller on newer Malis than on Midgard, since Arm
claims they optimized the tiler data structures on the newer parts. There's
probably still some merit to the idea.)

On Mali-T860, glmark2 -bdesktop frametime decreased by 1.35% +/- 0.91% at 95%
confidence, showing a slight win for 2D workloads No statistically significant
difference for glmark2 -bshading:shading=phong, since 3D workloads continue to
use the same hierarchy masks.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19482>
2023-03-31 00:19:18 +00:00
Alyssa Rosenzweig
1887b26845 panfrost: Estimate vertex count for hier mask
In the next commit, we will refine our algorithm to select hierarchy masks based
on the vertex count. In preparation, augment the driver to track rough estimates
of the vertex count so we have a "geometry complexity" input for the heuristic.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19482>
2023-03-31 00:19:18 +00:00
Alyssa Rosenzweig
cabed30111 panfrost: Clean up tiler calculations
We're about to do some work on this file. Clean it up first.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19482>
2023-03-31 00:19:18 +00:00
Danylo Piliaiev
9f43bc73da freedreno/computerator: Add support for a7xx
Not everything works correctly, e.g. stib seems flakey while stg
seems alright.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22148>
2023-03-30 23:40:48 +00:00
Danylo Piliaiev
f32eb48095 freedreno/computerator: Templatize a6xx backend
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22148>
2023-03-30 23:40:48 +00:00
Danylo Piliaiev
8558d07014 freedreno: Add dummy a730/a740 definition
Needed for assembly/disassembly.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22148>
2023-03-30 23:40:48 +00:00
Danylo Piliaiev
3389c3b84c freedreno: Move fd6_pack.h to common code accessible by computerator
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22148>
2023-03-30 23:40:48 +00:00
Danylo Piliaiev
48ad485d1c freedreno/computerator: Convert to C++
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22148>
2023-03-30 23:40:48 +00:00
Danylo Piliaiev
1ae595873f freedreno: C++ fixes for computerator to compile
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22148>
2023-03-30 23:40:48 +00:00
Danylo Piliaiev
6826a0ab14 freedreno/computerator: C++ proofing
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22148>
2023-03-30 23:40:48 +00:00
Danylo Piliaiev
5d2ddce99f freedreno/registers: More a7xx regs
Based on 011c54b0 from Jonathan Marek.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22148>
2023-03-30 23:40:48 +00:00
Danylo Piliaiev
899d142336 freedreno/registers: Document new CP_EVENT_WRITE::SEQNO
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22148>
2023-03-30 23:40:48 +00:00
Alyssa Rosenzweig
1e67f71324 panfrost: Add a v9 fast path for no images
The usual case.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21848>
2023-03-30 23:21:59 +00:00
Alyssa Rosenzweig
e6529d6dcc panfrost: Don't update access with a single batch
drawoverhead test 25 from 462->492

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21848>
2023-03-30 23:21:59 +00:00
Alyssa Rosenzweig
c224bc6f70 panfrost: Mark packs as ALWAYS_INLINE
As Intel does. These functions are written with the expectation that they will
be inlined away, allowing gcc's copy-prop and constant folding to eliminate the
template struct and any unused fields.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21848>
2023-03-30 23:21:59 +00:00
Alyssa Rosenzweig
f8b29f47a0 panfrost: Don't redundantly call emit_const_buf
On Valhall, we were calling emit_const_buf in two places:

1. The main "handle dirty flags" code shared with Bifrost
2. A Valhall-specific shader environment emitter

The latter was not dirty tracked, and the former was not used. That meant we
were calling emit_const_buf way too much. It's not a cheap routine, either.

Instead, use the results from the dirty tracked function in the shader
environment emitter, to avoid the redundant call and get the expected dirty
tracking.

In a Dolphin trace I'm looking at, fps increases 27->33.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21848>
2023-03-30 23:21:59 +00:00
Alyssa Rosenzweig
6ba62be633 panfrost: Print perf debug on seqnum overflow
Another unexpected source of flushes.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21830>
2023-03-30 22:53:16 +00:00
Alyssa Rosenzweig
9d3e01ddef panfrost: Print perf debug when flushing everything
..Even if the only batch is the one that's currently bound.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21830>
2023-03-30 22:53:16 +00:00
Mike Blumenkrantz
70b7c24206 zink: stop caching vertex states
I tried to be too clever and ended up wasting cpu cycles. it's
much, much, much, much faster to just generate this one struct array
every time than it is to do set lookups with thousands of members

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22116>
2023-03-30 22:28:38 +00:00
Mike Blumenkrantz
91ddfe55b5 zink: use fast popcnt for vstate draws
also delete some unused stubs for no dynamic vertex input since I'm never
gonna implement that path

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22116>
2023-03-30 22:28:38 +00:00
Mike Blumenkrantz
11a61ab424 zink: don't swizzle velems state for vstate draws
this isn't ever used, so don't touch it

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22116>
2023-03-30 22:28:38 +00:00
Mike Blumenkrantz
f676704fca zink: explicitly pass null velems when creating pipelines with dynamic vinput
this may or may not be a usable pointer, and it's not being read, so
don't pass it at all

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22116>
2023-03-30 22:28:38 +00:00
Mike Blumenkrantz
1ead8f7375 zink: add another vstate draw template for popcnt presence
matching radeonsi

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22116>
2023-03-30 22:28:38 +00:00
Mike Blumenkrantz
41983630c4 zink: bind vertex state directly from draw hook
this is more streamlined and readable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22116>
2023-03-30 22:28:38 +00:00
Mike Blumenkrantz
837168db20 zink: use search_or_add for masking vstate
this should be a significant perf boost instead of multiple lookups

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22116>
2023-03-30 22:28:38 +00:00
Mike Blumenkrantz
4be5caba67 zink: flag vertex buffers for rebind after vstate draws
vstate draws bind their own vertex buffers unrelated to the bound
gallium buffers, so any draw occurring after a vstate draw must
rebind vertex buffers to ensure the correct ones are bound

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22116>
2023-03-30 22:28:38 +00:00
Mike Blumenkrantz
6c3b5921b2 zink: omit VkPipelineVertexInputStateCreateInfo with dynamic vinput
this should never be used/needed

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22116>
2023-03-30 22:28:38 +00:00
Konstantin Seurer
f6147051e2 radv: Stop counting user SGPRS separately
Renames radv_declare_shader_args to declare_shader_args and runs it
twice to first gather the user SGPR count without push constants and
descriptor sets.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22119>
2023-03-30 21:52:03 +00:00
Konstantin Seurer
0c915ba501 radv: Set user SGPR locations when declaring args
Merge shader arg declaration with setting up the user data locations.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22119>
2023-03-30 21:52:03 +00:00
Harri Nieminen
fd767a4517 bin: Fix typos
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22189>
2023-03-30 21:37:00 +00:00
Mike Blumenkrantz
db582e5e7d zink: block resolves where src extents > dst extents
vulkan resolves only provide "extents" instead of src and dst regions like
GL, which means vk resolves can't be used to downscale images, as such
operations will instead just crop the image

fixes #8655

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22195>
2023-03-30 21:13:40 +00:00
Samuel Pitoiset
373c6346f5 radv: add push constant state to the cmdbuf state
Push constants are handled per bind point internally. Using a separate
structure in the cmdbuf state would allow us to update it easily
without relying on bound pipelines.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22209>
2023-03-30 20:41:23 +00:00
Samuel Pitoiset
a0baefa033 radv: copy need_indirect_descriptor_sets to radv_cmd_state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22209>
2023-03-30 20:41:23 +00:00
Samuel Pitoiset
eeefe18f05 radv: add a helper to convert a VkPipelineBindPoint
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22209>
2023-03-30 20:41:23 +00:00
Rob Clark
88f3676019 freedreno: Optimize repeated finishes
Sometimes apps (glances at stk) spin on a syncobj with very short
timeouts.  But ensuring the fence is flushed all the way through to
the kernel (including handling TC unflushed fences) only needs to
be done once.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22098>
2023-03-30 19:42:01 +00:00
Rob Clark
8416bc1c60 freedreno/drm: Disable threaded-submit for msm
We've had drm/sched support on the kernel side for more than a year and
a half.  This makes submit ioctl async by handling fence waits from the
sched's kthread, which is what threaded submit was originally working
around.  For now, threaded submit is only used for virtgpu, which does
not (yet?) have drm/sched support.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22098>
2023-03-30 19:42:01 +00:00
Rob Clark
a16533c43e freedreno/drm: Make threaded-submit optional
We've had gpu-sched support in the kernel for a while now, so our fence
waits are not synchronous in the ioctl path.  The only reason this path
still exists is that virtgpu does not have gpu-sched.  So lets disable
it on msm.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22098>
2023-03-30 19:42:01 +00:00
Rob Clark
cacbbfd6a8 mesa: Add a few more function traces
Sprinkle around a few more traces that were useful in locating fence
waits.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22098>
2023-03-30 19:42:01 +00:00
Rob Clark
c2194552e7 freedreno/drm: Stop cleanup at first active BO
Buffers are added to the deferred freelist at the tail.  And frequently
the last reference is dropped immediately after the submit.  So almost
always, once we see a still-busy BO, the remaining in the list will also
still be busy.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22098>
2023-03-30 19:42:01 +00:00
Rob Clark
712c26e2b6 freedreno/drm: Fast path for idle check
If already idle, no need to cleanup_fences() (and take related lock).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22098>
2023-03-30 19:42:00 +00:00
Mike Blumenkrantz
77c7198d76 zink: fix quads emulation gs with array variables
this was broken for e.g., gl_ClipDistance, which uses explicit array
types and therefore cannot be directly read/written

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22208>
2023-03-30 19:21:52 +00:00
Rob Clark
f9a074dd55 dri2/android: Bypass throttling
The android window system (SurfaceFlinger, et al) already does it's own
throttling.  Trying to do this also in mesa's egl is counterproductive.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22197>
2023-03-30 18:46:04 +00:00
Konstantin Seurer
816f434efc radv/rq: Rematerialize inv_dir before proceed
Helps with register pressure.

Quake II RTX:
Totals from 7 (14.29% of 49) affected shaders:

VGPRs: 688 -> 672 (-2.33%)
CodeSize: 167496 -> 167560 (+0.04%); split: -0.01%, +0.05%
MaxWaves: 70 -> 72 (+2.86%)
Instrs: 31716 -> 31760 (+0.14%); split: -0.02%, +0.16%
Latency: 385343 -> 386040 (+0.18%); split: -0.01%, +0.19%
InvThroughput: 78878 -> 78045 (-1.06%); split: -1.22%, +0.17%
VClause: 596 -> 600 (+0.67%)
Copies: 4774 -> 4747 (-0.57%); split: -0.98%, +0.42%
PreVGPRs: 617 -> 592 (-4.05%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20469>
2023-03-30 18:15:11 +00:00
Mike Blumenkrantz
9c73312248 zink: set src access when rebinding buffers, unset unordered_*
this ensures that the buffer is marked active and prevents promotion
in cases where reordering would break rendering

unordered_read prohibits write reordering for buffers, so setting
this flag must be done when the buffer is actually used, ideally as
late as possible

setting it at the time of (re)bind catches all the buffer rebind cases
which might otherwise erroneously permit reordering

fixes #8381

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22205>
2023-03-30 17:54:11 +00:00
Danylo Piliaiev
2cc9364c20 tu/drm: Support cached non-coherent memory
Requires some hand rolled assembly:
- DC CVAC / DC CIVAC for aarch64
- DCCMVAC / DCCIMVAC for arm32, unfortunately it seems that it is
  illegal to call them from userspace.
- clflush for x86-64

We handle x86-64 case because Turnip may run in x86-64 guest
e.g. in FEX-Emu or Box64.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20550>
2023-03-30 15:50:47 +00:00
Danylo Piliaiev
5a59410962 turnip: add cached and cached-coherent memory types
vkd3d requires cached memory type.

MSM backend doesn't have a special ioctl for memory
flushing/invalidation, we'd have to use cvac and civac
arm assembly instructions (would be done in following commit).

KGSL has an the ioctl for this, which is used in this commit.

Note, CTS tests doesn't seem good at testing flushing and
invalidating, the ones I found passed on KGSL with both
functions being no-op.

Based on the old patch from Jonathan Marek.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7636

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20550>
2023-03-30 15:50:47 +00:00
Erik Faye-Lund
bd816084c6 zink: enable spir-v 1.6 for vulkan 1.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18274>
2023-03-30 14:06:54 +00:00
Erik Faye-Lund
99bd1eaf3d zink: use spir-v 1.6 local-size when needed
The WorkgroupSize built-in is deprecated in SPIR-V 1.6, so let's switch
to using LocalSizeId instead, like the spec recommends.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18274>
2023-03-30 14:06:54 +00:00
Erik Faye-Lund
da895596da zink: use demote from spir-v 1.6 when possible
With SPIR-V 1.6, we don't need to enable the extension for demote any
more.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18274>
2023-03-30 14:06:54 +00:00
Erik Faye-Lund
636bfc6358 zink: emit terminate for spir-v 1.6
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18274>
2023-03-30 14:06:54 +00:00
Mike Blumenkrantz
67462ed014 zink: add spirv builder function for terminate
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18274>
2023-03-30 14:06:54 +00:00
Mike Blumenkrantz
db1371cce1 llvmpipe: fix handling of unused color attachments
if an attachment doesn't have blending or color output from the shader,
nothing should touch the attachment

this is consistent with vulkan spec and needed for upcoming cts coverage

cc: mesa-stable

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22135>
2023-03-30 12:04:22 +00:00
Mike Blumenkrantz
6a5dcd2776 llvmpipe: fix linear fs analysis with nonzero fs outputs
linear fs only works with output 0

cc: mesa-stable

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22135>
2023-03-30 12:04:22 +00:00
Samuel Pitoiset
15f1d5cc8f radv: copy ia_multi_vgt_param to the cmdbuf state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22194>
2023-03-30 11:43:06 +00:00
Samuel Pitoiset
0daffade14 radv: copy uses_{drawid,baseinstance} to the cmdbuf state
As well as the vertex user sgpr info. This also needs to be copied
for merged shaders (ie. VS+TCS).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22194>
2023-03-30 11:43:06 +00:00
Samuel Pitoiset
8fd915098d radv: copy rast_prim to the cmdbuf state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22194>
2023-03-30 11:43:06 +00:00
Samuel Pitoiset
6ee8d33ef4 radv: add a helper that returns the current rasterized primitive
For tess/geom/mesh the rasterized primitive is part of the shader
info and primitive topology should be ignored.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22194>
2023-03-30 11:43:06 +00:00
Samuel Pitoiset
b0a007583d radv: copy custom blend mode to the cmdbuf state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22194>
2023-03-30 11:43:06 +00:00
Samuel Pitoiset
bc39fa9500 radv: rework emitting inner coverage when a fragment shader is bound
To stop relying on the pipeline. The state is now flagged when a new
fragment shader with a different inner coverage setting is bound.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22194>
2023-03-30 11:43:06 +00:00
Samuel Pitoiset
5231643900 radv: remove radv_graphics_pipeline::vb_desc_alloc_size
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192>
2023-03-30 11:21:19 +00:00
Samuel Pitoiset
b2ac40e734 radv: remove radv_graphics_pipeline::vb_desc_usage_mask
Use the VS shader info instead.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192>
2023-03-30 11:21:19 +00:00
Samuel Pitoiset
2b1a0c0a29 radv: adjust vb_desc_usage_mask for dynamic VS inputs in the info pass
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192>
2023-03-30 11:21:19 +00:00
Samuel Pitoiset
d87c813da1 aco: remove unused aco_shader_info::vb_desc_usage_mask
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192>
2023-03-30 11:21:19 +00:00
Samuel Pitoiset
c7784f1409 radv: remove radv_graphics_pipeline::can_use_simple_input
Use the VS shader info instead.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192>
2023-03-30 11:21:19 +00:00
Samuel Pitoiset
53b2b30d0b radv: remove radv_graphics_pipeline::next_vertex_stage
Use the active stages bitfield instead.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192>
2023-03-30 11:21:18 +00:00
Samuel Pitoiset
f224e9f1a5 radv: remove radv_graphics_pipeline::last_vertex_attrib_bit
Use the VS shader info instead.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192>
2023-03-30 11:21:18 +00:00
Samuel Pitoiset
99bca4cb50 radv: remove radv_graphics_pipeline::use_per_attribute_vb_descs
Use the VS shader info instead.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22192>
2023-03-30 11:21:18 +00:00
Patrick Lerda
5d85966805 intel: fix memory leak related to brw_nir_create_passthrough_tcs()
Indeed, the parameter "mem_ctx" was not processed.

For instance, this issue is triggered with the crocus driver and
"piglit/bin/shader_runner tests/spec/arb_tessellation_shader/execution/compatibility/tes-clip-vertex-different-from-position.shader_test -auto -fbo":
SUMMARY: AddressSanitizer: 235216 byte(s) leaked in 48 allocation(s).

Fixes: 96ba0344db ("intel: Use common helpers for TCS passthrough shaders")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22173>
2023-03-30 10:52:07 +00:00
Pierre-Eric Pelloux-Prayer
9c90deefb2 radeonsi: don't use alignment_log2 of imported buffers
This value isn't passed to the importer by the kernel
so we can't check it.

Fixes: f7a4051b83 ("radeonsi: Check pitch and offset for validity.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8431
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22170>
2023-03-30 10:14:31 +00:00
Erik Faye-Lund
ba6336ce3e docs: use version-number as toctree-title for relnotes
Using the full titles makes most of these take up two lines in the
toctree. The version number is really the only thing we should care
about, though.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21956>
2023-03-30 10:09:01 +00:00
Erik Faye-Lund
b09e1ecef0 docs: move old relnotes to _extra directory
These aren't built, so they won't get copied out into the public folder
unless we put is inside the _extra folder.

This has been broken all since the conversion to Sphinx, whoops!

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21956>
2023-03-30 10:09:01 +00:00
Lina Versace
655150918b venus: Enable VK_EXT_memory_budget
Tested dEQP-VK.info.device_memory_budget on Intel with vtest.  When the
test is ran at approximately the same time on the native driver and on
vtest, the qpa result files each report approximately the same memory
budget.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22099>
2023-03-30 09:55:40 +00:00
Lina Versace
85007a5caf venus: Refactor vn_physical_device_init_memory_properties
Improve readability.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22099>
2023-03-30 09:55:40 +00:00
Lina Versace
436a0d2609 venus: Delete vn_renderer_info::has_cache_management
It has been false since commit 247232d596, when Venus was merged
upstream in April 2021.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22099>
2023-03-30 09:55:39 +00:00
Lina Versace
e58352930e venus: Update protocol for VK_EXT_memory_budget
Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22099>
2023-03-30 09:55:39 +00:00
Karol Herbst
72b7e20bf7 nvc0: enable fp helper invocation memory loads on Turing+
Starting with GSP this will be the only way of doing so, for older gens
we'll just fix it up on the kernel side.

Cc: mesa-stable
Acked-by: M Henning <drawoc@darkrefraction.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21989>
2023-03-30 09:40:22 +00:00
Samuel Pitoiset
d147cf5a56 radv: use serialized NIR for graphics libs with the RETAIN flag
Cloning NIR shaders consumes too much RAM and this can easily explode
in memory for games that create a ton of graphics libraries. Using
serialized NIR shaders help considerably.

This reduces RAM usage in dota2 with GPL from 3GiB to 400MiB.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22143>
2023-03-30 09:02:20 +00:00
Eric Engestrom
5e413f4919 ci/broadcom: slightly increase coverage of vk tests
The previous commit has freed up a couple of runners, so let's repurpose
them to make vk test jobs take less time; with that spare time, let's
increase the coverage a little bit.

Most jobs now take 10-12 minutes, just like they used to.

Stress-tested over 40+ runs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21902>
2023-03-30 08:21:23 +00:00
Eric Engestrom
a96e51382c ci/broadcom: consolidate v3d-rpi4* jobs into a single v3d-rpi4-gl:armhf
Using now 12 instead of 14 runners, most jobs take 11-13 minutes, which
is about the same as when they were all running separately (10-13 min).

Stress-tested over 8 runs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21902>
2023-03-30 08:21:23 +00:00
Eric Engestrom
8e09be4616 ci/broadcom: consolidate vc4-rpi3* jobs into a single vc4-rpi3-gl:armhf
Without reducing the coverage and using 4 runners instead of 9, most
runs take 10-13 minutes instead of 12-13 minutes for the egl job, 9-11
minutes for the piglit job, and 6-8 minutes for the deqp job.

Stress-tested over 40+ runs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21902>
2023-03-30 08:21:23 +00:00
Rob Clark
f277d3c651 Revert "CI: Disable freedreno"
This reverts commit 6a16ed8d79.

The proxy has been rebooted

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22168>
2023-03-30 06:44:53 +00:00
Timur Kristóf
c0692dbfab radv: Move I/O lowering functions into a new file.
Also ran clang-format on the affected code.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21971>
2023-03-30 05:59:13 +00:00
Timur Kristóf
93e4382438 radv, ac/nir: Move sin/cos lowering to a common pass.
Also ran clang-format on the affected code.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21971>
2023-03-30 05:59:13 +00:00
Timur Kristóf
90bf9ed759 radv: Move radv_nir_export_multiview to new file.
Also ran clang-format on the affected code.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21971>
2023-03-30 05:59:13 +00:00
Timur Kristóf
685dcecb57 radv: Move radv_nir_lower_viewport_to_zero to new file.
Also ran clang-format on the affected code.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21971>
2023-03-30 05:59:13 +00:00
Timur Kristóf
67de4b54fe radv: Move radv_nir_lower_view_index to new file.
Also ran clang-format on the affected code.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21971>
2023-03-30 05:59:13 +00:00
Timur Kristóf
1e2a5858f4 radv: Move radv_nir_lower_intrinsics_early to new file.
Also ran clang-format on the affected code.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21971>
2023-03-30 05:59:13 +00:00
Timur Kristóf
87e7dfb5f8 radv: Move radv_nir_lower_fs_intrinsics to new file.
Also ran clang-format on the affected code.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21971>
2023-03-30 05:59:12 +00:00
Timur Kristóf
838defc5eb radv: Move radv_nir_lower_primitive_shading_rate to new file.
Also ran clang-format on the affected code.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21971>
2023-03-30 05:59:12 +00:00
Timur Kristóf
1978eaf5b2 radv: Move radv_nir_* to a new folder.
Also ran clang-format on the affected code.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21971>
2023-03-30 05:59:12 +00:00
Mike Blumenkrantz
dd8d52cabc kopper: apply ancillary invalidation through glthread on swapbuffers
this fixes invalidations with tc's renderpass parsing so they get picked
up before the renderpass ends

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21910>
2023-03-30 05:06:47 +00:00
Mike Blumenkrantz
bd74da9d2a glthread: add _mesa_glthread_invalidate_zsbuf()
this allows frontends to trigger ancillary invalidation before syncing

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21910>
2023-03-30 05:06:47 +00:00
Mike Blumenkrantz
0c7994bb2d mapi: add InternalInvalidateFramebufferAncillaryMESA
this allows glthread to handle ancillary buffer invalidation

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21910>
2023-03-30 05:06:47 +00:00
Mike Blumenkrantz
aa9d823318 lavapipe: move default rasterizer state values to rendering_state init
these should always be set

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
38e3132dfa lavapipe: avoid uniformly unsetting gs_output_lines
instead fix the conditional now that it's possible to tell whether
a gs is bound

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
ddf8917b2d lavapipe: only unset tess_states pointers on tes bind
this is otherwise irrelevant

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
5feeb2535b lavapipe: only update shader access for bind/unbind stages
also squash a loop

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
770d162318 lavapipe: split out gfx stage unbinding
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
42ebb995c5 lavapipe: don't double unbind gfx stages on pipeline bind
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
d97d921634 lavapipe: dynamically bind noop fs at draw time when needed
this is simpler than special casing it everywhere

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
3366b4a9b9 lavapipe: unify lvp_pipeline_nir creation
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
5880fc00c2 lavapipe: add a ref for the tess_ccw nir on creation
not sure if it matters but good to be consistent

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
d127c134eb lavapipe: refactor pipeline destroy a bit
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
30db1800e9 lavapipe: delete unused struct member
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
25a47e3cc6 lavapipe: break out all the important parts of gfx pipeline setting for reuse
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
ac1f843b28 lavapipe: pull out dynamic tess origin check in gfx pipeline bind
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
295141b39b lavapipe: don't access pipeline shader structs as much during bind
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
062bf6f455 lavapipe: PIPE_SHADER_ -> MESA_SHADER_
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
ef4df9bc01 lavapipe: merge some loops in handle_graphics_pipeline()
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
8aa59f57a0 lavapipe: refactor compute shader binding
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
39bb7785e6 lavapipe: stop using rendering_state::pipeline
access shaders directly now

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:36 +00:00
Mike Blumenkrantz
d5857240bb lavapipe: add a device member to rendering_state
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:35 +00:00
Mike Blumenkrantz
b7197451d0 lavapipe: track bound shader stages on rendering_state
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:35 +00:00
Mike Blumenkrantz
771e0e14a8 lavapipe: refactor shader compile functions to not take pipeline params
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:35 +00:00
Mike Blumenkrantz
f986f85fdc lavapipe: don't memcpy tess_ccw when copying pipeline library shaders
this gets handled later

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:35 +00:00
Mike Blumenkrantz
9193fb2efd lavapipe: always copy streamout info when creating shaders
llvmpipe should be smart enough to figure this out internally

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21866>
2023-03-30 04:50:35 +00:00
Daniel Stone
80bde78084 ci/radeonsi: Skip really slow tests on stoney
These allocate way more memory than is reasonable, a bunch of times. I'd
guess they pushed the machine pretty deep into memory pressure which is
why it was all taking like 3 minutes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22193>
2023-03-30 04:16:50 +00:00
Daniel Stone
7d425b5a9b ci/radeonsi: sort and dedup stoney skips
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22193>
2023-03-30 04:16:50 +00:00
Georg Lehmann
dae13f3dc1 aco: add tests for neg(mul) with opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:35 +00:00
Georg Lehmann
02b94037f6 aco/tests: run optimize.mad_mix.input_conv.modifiers on gfx11
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:35 +00:00
Georg Lehmann
728146b2fc aco: add test for min/max combining with opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:35 +00:00
Georg Lehmann
9499f202e8 aco: add tests for cmp ordering with opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:35 +00:00
Georg Lehmann
22903bcded aco: add tests for swap operand with opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:35 +00:00
Georg Lehmann
0b29dc5c06 aco: add tests for dpp with opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
f7bb794dda aco: add tests for fma with opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
bb7c2b70c1 aco/optimizer: remove to_SDWA
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
e699a4181c aco: keep label_mul/usedef/minmax in apply_extract
16bit int mad/fma/minmax combining can work with opsel set.

All other optimizations should already check if the instruction uses sdwa,
because we don't check this when applying the label initially.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
7014145ab2 aco/optimizer: use opsel for VOP12C
Foz-DB GFX1100:
Totals from 11759 (8.72% of 134864) affected shaders:
VGPRs: 848288 -> 844556 (-0.44%); split: -0.44%, +0.00%
SpillSGPRs: 8527 -> 8543 (+0.19%)
SpillVGPRs: 1411 -> 1423 (+0.85%); split: -0.21%, +1.06%
CodeSize: 114337120 -> 113882472 (-0.40%); split: -0.40%, +0.01%
Scratch: 128768 -> 129024 (+0.20%); split: -0.20%, +0.40%
MaxWaves: 250962 -> 252014 (+0.42%)
Instrs: 22187426 -> 22062378 (-0.56%); split: -0.57%, +0.00%
Latency: 232655375 -> 232376977 (-0.12%); split: -0.20%, +0.08%
InvThroughput: 28292530 -> 28217699 (-0.26%); split: -0.45%, +0.18%
VClause: 352463 -> 352364 (-0.03%); split: -0.12%, +0.10%
SClause: 659282 -> 659354 (+0.01%); split: -0.02%, +0.04%
Copies: 1371369 -> 1342340 (-2.12%); split: -2.30%, +0.19%
Branches: 495903 -> 495941 (+0.01%); split: -0.00%, +0.01%
PreSGPRs: 867295 -> 863664 (-0.42%)
PreVGPRs: 793480 -> 790549 (-0.37%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
9650724370 aco/gfx11: allow opsel for VOP12C
Foz-DB GFX1100:
Totals from 515 (0.38% of 134864) affected shaders:
CodeSize: 2768228 -> 2761076 (-0.26%)
Instrs: 520301 -> 518523 (-0.34%)
Latency: 5190860 -> 5187254 (-0.07%)
InvThroughput: 2120844 -> 2119447 (-0.07%)
Copies: 57238 -> 56101 (-1.99%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
3907c54443 aco: don't label mul with opsel as abs/neg
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
ace017bba8 aco/ir: copy opsel when converting to DPP
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
a60b9313d3 aco: swap opsel when swapping VOP2/C operands
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
fc1bf9c3b4 aco: return true in usesModifiers for VOP12C with opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
82f7b3acfa aco: support neg(mul)/abs(mul) optimization in more cases
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
9d841507e1 aco: support v_cvt_f32_f16 with opsel in combine_mad_mix
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
9d6e223a7a aco: update match_op3_for_vop3 for VOP12C opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
0896ecec9a aco: handle opsel in combine_constant_comparison_ordering
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
d8f07a0ddc aco: handle opsel in combine_ordering_test
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
4db43415e5 aco: handle opsel in combine_comparison_ordering
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
8e6d79d10d aco/optimizer: preserve opsel when fusing fma
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
32d7a11acf aco/ra: prepare for VOP12C opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
8ee1519cee aco/to_hw_instr: use VOP1 opsel for v_mov_b16
Foz-DB GFX1100:
Totals from 4661 (3.46% of 134864) affected shaders:
CodeSize: 36500568 -> 36391704 (-0.30%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
066cee0896 aco: validate VOP12C opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
2c49b7babf aco/assembler: support VOP12C opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
9b4ea9ff90 aco/vn: hash opsel for VOP12C
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Georg Lehmann
c62e5ef82e aco/ra: don't reallocate VOP3 instruction for non-vcc lane mask
This would need to copy opsel soon but we can just reuse the old instruction.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>
2023-03-30 03:34:34 +00:00
Friedrich Vock
424825c6e5 aco: Un-swap addressable VGPRs/SGPRs in RT prolog
Fixes: 6446b79168 ("aco: implement select_rt_prolog()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22188>
2023-03-30 02:55:54 +00:00
Friedrich Vock
83a38987b1 radv/rt: Also adjust the SGPR count in postprocess_rt_config
Fixes: bea022d1f6 ("radv/rt: Add shader config combination/postprocessing utils")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22188>
2023-03-30 02:55:53 +00:00
Emma Anholt
c443503e07 perfetto: Move intel's cmdbuf/queue annotation code to the shared util.
This will let other drivers use the same way of presenting annotations
without duplicating the whole hash table thing.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22157>
2023-03-30 02:19:35 +00:00
Emma Anholt
9c364a346f perfetto: Deduplicate clock sync packet emit from renderstage sources.
This is way more horrifying than I hoped -- I can't figure out a way to
have the method be on TraceContext, so it's a static method of the
datasource, but then you have to name the templated types over and over.
You have to pass in a TraceContext because intel emits the clock sync
packet within a Trace(), and perfetto just silently corrupts the trace if
you Trace() in a Trace().

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22157>
2023-03-30 02:19:35 +00:00
Emma Anholt
3fd825d3e2 perfetto: Make a MesaRenderpassDataSource with common setup/start/stop.
Deduplicates some code from intel/tu/freedreno, and will be a common place
to put other shared code.

The downside I can see is this logging:

[013.129]      tu_perfetto.cc:122 Tracing started
[013.129]  intel_driver_ds.cc:133 Tracing started

("oh, huh, apparently data sources for both drivers are registered?  wild")

becomes:

[142.906] erfetto_renderpass.h:50 Tracing started
[142.907] erfetto_renderpass.h:50 Tracing started

("huh, why is my driver's data source being started twice?").
Unfortunately we can't easily get a string for the data source type due to
not having rtti.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22157>
2023-03-30 02:19:34 +00:00
Emma Anholt
42f1df1ec5 intel/perfetto: Drop unused "pipelined" field.
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22157>
2023-03-30 02:19:34 +00:00
Emma Anholt
da78d5d729 perfetto: Add a .clang-format for the directory.
I was frustrated trying to write code and not be able to just mash ^K^F to
format what I'd written.  This .clang-format is just cargo-cult of turnip
with a few tweaks to reduce the diff to the current directory contents.
The remaining deltas in the reformat look decent to me, and mostly bring
things closer to mesa-vague-consensus style.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22157>
2023-03-30 02:19:34 +00:00
José Roberto de Souza
66a8f7dcdb anv: Add assert in functions not supported by Xe kmd
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22171>
2023-03-30 01:57:44 +00:00
José Roberto de Souza
74ff665bd0 anv: Disable anv_bo_sync_type for Xe kmd
anv_bo_sync_type is only supported with i915, if necessary it will be
implemented for Xe kmd.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22171>
2023-03-30 01:57:44 +00:00
José Roberto de Souza
fdea48df5e anv: Implement Xe version of anv_queue_exec_locked() and queue_exec_trace()
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22171>
2023-03-30 01:57:44 +00:00
José Roberto de Souza
91ee00a741 anv: Move to a function code to clflush batch buffers
This also need to be executed in Xe kmd, so moving it to a function.
No changes in behavior intended here.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22171>
2023-03-30 01:57:44 +00:00
Juston Li
88d074cb8f util/disk_cache: use posix_fallocate() for index files
ftruncate() allocates disk space lazily. If the disk is full and it is
unable to allocate disk space when accesed via mmap(), it will crash
with a SIGBUS.

Switch to posix_fallocate(), which ensures disk space is allocated
otherwise it fails if there isn't enough disk space. The disk cache
won't be enabled in this case.

For normal cases, a small increase in disk usage as the 1.3MB index
file will be fully allocated when initialized now.

fallback to ftruncate() if posix_fallocate() isn't found.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22097>
2023-03-30 01:09:10 +00:00
Lionel Landwerlin
ba670f0cdf anv: hash immutable sampler conversion data not pointers
The conversion pointer has a vk_object_base containing pointers.

Previous commits had a similar issue, storing an internal pointer to
the array of formats in anv_format.c

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22160>
2023-03-30 00:31:20 +00:00
Ian Romanick
71e5530c07 nir/algebraic: Undistribute fsat from fmax
To be helpful, the thing inside the fsat has to be used with and without
the fsat. Otherwise it just moves a saturate destination modifier
around. To not be harmful, the fsat has to only be used by the bcsel.

All Broadwell and newer Intel platforms had similar results. (Ice Lake shown)
total instructions in shared programs: 20174475 -> 20174449 (<.01%)
instructions in affected programs: 3913 -> 3887 (-0.66%)
helped: 13 / HURT: 0

total cycles in shared programs: 866844832 -> 866844719 (<.01%)
cycles in affected programs: 46037 -> 45924 (-0.25%)
helped: 10 / HURT: 1

All Intel platforms had similar results. (Ice Lake shown)
Instructions in all programs: 161491468 -> 161491372 (-0.0%)
helped: 31 / HURT: 8

Cycles in all programs: 10933090736 -> 10933024716 (-0.0%)
helped: 32 / HURT: 18

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22169>
2023-03-29 23:48:19 +00:00
Ian Romanick
782de1932c intel/fs: Don't copy propagate from saturate to sel
There are already NIR algebraic optimizations (see also ac6646129f
("nir: Move fsat outside of fmin/fmax if second arg is 0 to 1.") that
will try to remove the saturate from things like

    fmax(0.5, fsat(x))

This basically reverts 40aeb558ce ("i965/fs: Allow propagation of
instructions with saturate flag to sel"). That commit message had no
shader-db information, so it's unclear whether this actually helped
anything ever.

No shader-db changes on any Intel platform.

One shader in Far Cry New Dawn was affected.

Cycles in all programs: 10933090738 -> 10933090736 (-0.0%)
Cycles helped: 1

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22169>
2023-03-29 23:48:19 +00:00
Rhys Perry
125ecd7e2d radv: fix setting radv_shader_info::user_data_0 with rt
Fixes raytracing pipelines.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 0e81ec98ce ("radv: move user_data_0 to the shader info pass")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22187>
2023-03-29 22:18:33 +00:00
Guilherme Gallo
47774d2414 ci/zink: Reduce zink-tu-a618-traces parallelism
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22155>
2023-03-29 21:30:19 +00:00
Guilherme Gallo
a5de0174af ci/zink: Fix zink-tu-a618-traces perf job rules
The pipeline should create this job only when it is under performance
enabled workflow, represented by the presence of
MESA_CI_PERFORMANCE_ENABLED variable.

For example:
The following pipeline
https://gitlab.freedesktop.org/gallo/mesa/-/pipelines/840525 has
`zink-tu-a618-traces-performance` job, even if it was not triggered by
marge-bot, which means that performance jobs should be disabled.

This job should appear in pipelines with performance jobs enabled
https://gitlab.freedesktop.org/gallo/mesa/-/pipelines/840529

Fixes: 93e3d37b47
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22155>
2023-03-29 21:30:19 +00:00
Marek Olšák
43dc19f44d radeonsi: simplify binning settings to work around GPU hangs
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22084>
2023-03-29 20:36:10 +00:00
Marek Olšák
281126f1d6 radeonsi/gfx11: reduce MSAA samples to 8 for no-attachment framebuffer
EQAA is unsupported

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22084>
2023-03-29 20:36:09 +00:00
Marek Olšák
e0d449dd40 amd: set the correct LLVM processor name for gfx1036
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22084>
2023-03-29 20:36:09 +00:00
Marek Olšák
0b6a7cba0b amd: rename GFX1036 -> RAPHAEL_MENDOCINO
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22084>
2023-03-29 20:36:09 +00:00
Marek Olšák
52b6886992 amd: update addrlib
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22084>
2023-03-29 20:36:09 +00:00
antonino
5fb8ba0eb8 zink/ci: remove primitive-id-no-gs-quads from radv-vangogh-fails
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
1c3a4ab896 zink: unbind generated gs in bind_last_vertex_stage
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
303e06b19d zink: improve generated gs unbinding
Avoid looping by using the new `parent` field to check if a generaetd gs
is bound and use `bind_gs_state` insted of `bind_gfx_stage` so that
`bind_last_vertex_stage` is automatically called

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
431795b9b9 zink: zink: add parent to zink_shader::non_fs
For a generated gs this field will store a pointer to the shader that
"owns" it.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
d80a35a7f7 zink: unified zink_set_primitive_emulation_keys and zink_create_primitive_emulation_gs
Those two functions shared most of the code

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
d786f52f1f zink: prevent crash when freeing
If the same vertex shader is used for more than one pipeline where for some a gs
is generated but not for others then the logic to free pipeline
libraries might use the incorrect stage_mask and try to free a non
existing gs.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
2748301a09 zink: advertise support for the quad primitive
Zink now exposes the `PIPE_PRIM_QUADS` among supported primitives and
handles them with geometry shaders.

Previously, while not exposing this capability, gallium would internally
generate an index buffer to draw them with triangles.

However the information necessary to avoid drawing the diagonal line
when using the line primitive was not preserved.

fails are added for wireframe xfb quads tests

xfb is expected to output tessellatated quads while showing a quad
without a diagonal, however there is no sane way of achieving this.

As part of the test quads will be rendered with and without xfb and the
results compared.

Now to avoid breaking xfb zink has to always split quads into triangles
when xfb is enabled. This means that the test will fail.

Previously the diagonal was always present so the test passed

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
49329b8904 zink: keep xfb properties in quad emulation gs
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
2bd72a4101 nir: keep xfb properties in nir_create_passthrough_gs
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
1c7d846bcc zink: handle provoking vertex mode for filled quads
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
0b65514775 nir/zink: handle provoking vertex mode in nir_create_passthrough_gs
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
1a5bdca2dd zink: implement flat shading using inlined uniforms
Zink will now handle flat interpolation correctly when line loops
are generated from primitives.

The flat shading information is passed to the emulation gs using constant
uniforms which get inlined.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
009ba806c9 zink: add needs_inlining to zink_shader
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
a6de15eff5 zink: add flags to zink_gfx_program and zink_context
Adds `optimal_keys` and `needs_inlining` to `zink_gfx_program` and
`is_generated_gs_bound` to `zink_context`

Those will be needed for shaders that rely on some uniforms to be
inlined

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
027ba4ccef zink: fix flat shading on filled quads
Quads emulated by zink will now have the correct provoking vertex.

Also outputs of the previous shader stage that would normally
not be passed down to the FS (when no GS is bound) will now be skipped.

Different provoking vertex modes are not handled yet.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
7eab64f1c6 zink: handle quads
Zink can now handle the quad primitive by emulating it in a gs

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
f48b699654 zink: add zink_rast_prim enum
Adds an enum with primitives that are natively by vulkan

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
e2220ee55e zink: filled quad emulation gs generation function
This change adds a function to generate a geometry shader that will take a quad
as an input (passed as a line strip with adjacency because quads are not
available as an input primitives for GS) and generate a triangle strip.

This can be used to emulate the quad primitive.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
0cb81ac38c zink: force line strip out when emulating stipple
Fixes a bug where, whenever a primtiive that has more than 2 vertices is rendered
with line stipple, the edge between the first and last vertex will have
stretched out stipple.

This happens because interpolation will occur between two non consecutive
stipple counters for the last edge
(which is between the last and first vertices).

Forcing `nir_create_passthrough_gs` to generate a line strip avoids
this because the last vertex will be duplicated and will have
the correct stipple counter for each edge.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
3b5fb8b060 nir: allow to force line strip out in nir_create_passthrough_gs
`nir_create_passthrough_gs` now allows the user to force the generated GS
to always output a line strip from the primitive
regardless of whether edgeflags are present.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
90a8525d70 zink: handle edgeflags
Vulkan has no support for edgeflags.

If the user has a geometry shader bound nothing needs to be done as edgeflags
don't work with them, otherwise a geometry shader that emulates them
is generated.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
a93685ef55 zink: add has_edgeflags flag to zink_shader and zink_gfx_program
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
24535ffb3d nir: handle edge flags in nir_create_passthrough_gs
`nir_create_passthrough_gs` will now take a boolean argument to decide
whether it needs to handle edgeflags.

When true is passed it will output a line strip where edges that
shouldn't be visible are not emitted.

This is usefull because geometry shaders will generally throw away
edgeflags so for a passthrough GS to act transparently it needs to emulate them.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
a0751e8088 nir: calculate number of vertices in nir_create_passthrough_gs
`nir_create_passthrough_gs` has been changed to take the type of primitive
as opposed to the number of vertices as an argument.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:40 +00:00
antonino
edecb66b01 nir: avoid generating conflicting output variables
Because not all vertex outputs can have corresponding fragment inputs
(eg. edgeflags) some logic is needed to correctly generate variables in
a passthough gs.

Before this change some output variables ened up with the same location.

Fixes: d0342e28b3 ("nir: Add helper to create passthrough GS shader")

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:39 +00:00
antonino
ea14579f3d nir: handle primitives with adjacency
`nir_create_passthrough_gs` can now handle primitives with adjacency where some
vertices need to be skipped.

Fixes: d0342e28b3 ("nir: Add helper to create passthrough GS shader")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:39 +00:00
antonino
eedbf9046e zink: handle switching between primitives
Zink will generate geometry shaders to emulate certain features, however there
might be different variants of those depending on the primitive type.

This commits adds the logic to generate or bind the correct emulation GS
in the case where nothing changes except the primitive type.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21238>
2023-03-29 19:18:39 +00:00
Marcin Ślusarz
32107d8b5a intel/compiler: compactify locations of mesh outputs
Needed in support of anv code for Wa_14015590813.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17622>
2023-03-29 18:35:55 +00:00
Marcin Ślusarz
1f41198772 anv: work around for per-prim attributes corruption
Wa_14015590813 for gfx 12.5

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17622>
2023-03-29 18:35:55 +00:00
Eric Anholt
f113b55e25 ci/broadcom: Skip another texelfetch case.
This one has also flaked a pipeline recently with a timeout.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22177>
2023-03-29 17:36:53 +00:00
Eric Anholt
ae0aae797f ci/freedreno: Flake KHR-GL45.shader_image_load_store.basic-allTargets-store
It has UnexpectedPassed a couple of times recently.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22177>
2023-03-29 17:36:53 +00:00
Sil Vilerino
0d0221a574 nir: Fix use of alloca() without #include c99_alloca.h
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22150>
2023-03-29 16:56:42 +00:00
Emma Anholt
d3bbbc4c6c glsl: Drop dead prototype.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21940>
2023-03-29 16:06:03 +00:00
Emma Anholt
d2a3fa7569 glsl: Remove the TessLevel lowering special case from xfb.
The NIR vectorized tess level pass applies later, and it leaves the name
as-is, so we don't need to mess around with
gl_TessLevelInnerMesa/OuterMesa.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21940>
2023-03-29 16:06:03 +00:00
Emma Anholt
84006587d7 glsl: Delete the lower_tess_level pass.
NIR i/o lowering and sysval lowering can handle the compact var fine at
this point.

Affects: nouveau, virgl, svga, radeonsi, r600, llvmpipe.  Does not affect
PIPE_CAP_NIR_COMPACT_ARRAYS drivers like crocus, iris, d3d12, freedreno,
zink.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21940>
2023-03-29 16:06:03 +00:00
Emma Anholt
c2a9dd693b nir_to_tgsi: Handle stores to compact outputs.
We had been relying on glsl lowering to a vec4 output, but we can just do
a tiny override here to support compact variables and drop the lowering
pass.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21940>
2023-03-29 16:06:03 +00:00
Emma Anholt
ceef2b9982 nir/lower_sysvals: Add support for un-lowered tess_level_inner/outer.
GLSL has been responsible for doing this, but we can just extract the
array index here.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21940>
2023-03-29 16:06:03 +00:00
Emma Anholt
6ee4cd239d gallivm: Skip loads/stores that are definitely outside of compact vars.
As I reduce GLSL lowering code, OOB TessLevel accesses can end up making
it to the backend.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21940>
2023-03-29 16:06:03 +00:00
Ryan Neph
ac9d36a42a venus: re-use VN_DEBUG_NO_ABORT to disable ring monitoring abort()
Useful to keep the hung guest process alive while debugging the renderer
process.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22176>
2023-03-29 15:48:38 +00:00
Timur Kristóf
b688a6d227 nir: Remove IB address and stride intrinsics.
RADV used these to emulate firstTask for NV_mesh_shader.
They are no longer needed.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22139>
2023-03-29 15:08:55 +00:00
Timur Kristóf
b0cae2fafe ac/nir: Remove ac_nir_apply_first_task_to_task_shader.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22139>
2023-03-29 15:08:55 +00:00
Timur Kristóf
3093622f35 ac/nir/ngg: Remove NV_mesh_shader support.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22139>
2023-03-29 15:08:55 +00:00
Timur Kristóf
a677fc5999 radv: Clean up emitting zero mesh shader draw id.
When task shaders are also used,
the draw id is undefined in mesh shaders.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22139>
2023-03-29 15:08:55 +00:00
Timur Kristóf
8a426be553 radv: Remove first_task and ib_addr/ib_stride.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22139>
2023-03-29 15:08:55 +00:00
Timur Kristóf
945384b504 radv: Remove NV_mesh_shader API entrypoints.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22139>
2023-03-29 15:08:55 +00:00
Timur Kristóf
faf8375fc3 radv: Don't expose NV_mesh_shader and don't use it in CI.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22139>
2023-03-29 15:08:55 +00:00
Lionel Landwerlin
937924f2a5 iris: implement recommended flush/wait of AUX-TT invalidation
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22183>
2023-03-29 13:18:49 +00:00
Lionel Landwerlin
763854f7e3 anv: implement recommended flush/wait of AUX-TT invalidation
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22183>
2023-03-29 13:18:49 +00:00
Jarred Davies
d1b5b2901f pvr: Mark all normalized formats as supporting with_packed_usc_channel
Avoids assert seen in dEQP-VK.api.smoke.triangle

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22174>
2023-03-29 13:00:37 +00:00
Erik Faye-Lund
c825303a0f docs: drop reference to modindex
We don't render such a page, so there's no point in linking to it.

Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22022>
2023-03-29 12:53:26 +00:00
Samuel Pitoiset
a19fd0f634 radv: replace pipeline->force_vrs_per_vertex during cmdbuf recording
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
09f81e024c radv: replace pipeline->is_ngg occurrences during cmdbuf recording
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
0e81ec98ce radv: move user_data_0 to the shader info pass
Using the next stage is enough to determine the base reg.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
dd855c7772 radv: determine and store the next graphics stage to radv_shader_info
This will be useful in many cases.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
d109362a3d radv: copy bound shaders to the cmdbuf state
To stop relying on the pipeline everywhere.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
16bd3664da radv: move dirtying flags for mesh shading to radv_bind_pre_rast_shader()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
0fbe0c4d1b radv: stop using last_vgt_api_stage_{locs} during cmdbuf recording
Use the last VGT shader instead.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
2dfe49a948 radv: determine the last VGT shader at pipeline bind time
And replace streamout_shader by last_vgt_shader which is similar.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
19c329f4f9 radv: keep track of active stages as part of the cmdbuf state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
6caa180dc7 radv: add an assertion about shader stage to radv_bind_pre_rast_shader()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
1f878334c0 radv: add radv_bind_shader() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
59a2a4f87f radv: pass a shaders array to radv_get_shader()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Samuel Pitoiset
52fa8e1f61 radv: pass shader/base_reg to radv_emit_view_index_per_stage
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22128>
2023-03-29 10:18:24 +00:00
Eric Engestrom
1f552f1bf3 kmsro: sort drivers alphabetically
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22144>
2023-03-29 09:34:30 +00:00
Eric Engestrom
5cf91a6406 kmsro: uniformize renderonly creation
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22144>
2023-03-29 09:34:30 +00:00
Eric Engestrom
c7723da5be vc4: change create_renderonly signature to uniformize it
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22144>
2023-03-29 09:34:30 +00:00
Eric Engestrom
ed12e071ab v3d: change create_renderonly signature to uniformize it
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22144>
2023-03-29 09:34:30 +00:00
Eric Engestrom
6caa166ffe panfrost: change create_renderonly signature to uniformize it
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22144>
2023-03-29 09:34:29 +00:00
Eric Engestrom
b5082223be lima: change create_renderonly signature to uniformize it
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22144>
2023-03-29 09:34:29 +00:00
Eric Engestrom
d0c845ecb0 freedreno: change create_renderonly signature to uniformize it
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22144>
2023-03-29 09:34:29 +00:00
Eric Engestrom
09f42948ad etnaviv: change create_renderonly signature to uniformize it
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22144>
2023-03-29 09:34:29 +00:00
Eric Engestrom
49996def65 asahi: change create_renderonly signature to uniformize it
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22144>
2023-03-29 09:34:29 +00:00
Mike Blumenkrantz
66fe427ebc zink: stop leaking separate shader nir
this is a huge memleak

Fixes: e3b746e3a3 ("zink: use GPL to handle (simple) separate shader objects")

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22175>
2023-03-29 08:14:01 +00:00
Emma Anholt
ba48753b5f ci/zink: Update the tgl manual run xfails.
These have been consistent for 3 runs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22146>
2023-03-29 07:52:45 +00:00
Emma Anholt
4219a3c049 ci/etnaviv: Polish the gc2000 xfails a bit.
These were consistent in the last 3 CI runs.  The rest of the failures in
those runs were flakes spread all around the general shader tests, which
are correlated with GPU hangs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22146>
2023-03-29 07:52:45 +00:00
Emma Anholt
04d1c71e4d ci/crocus: Fix 1.3.5.0 xfails.
Whoops, copy and pasted the wrong lines from another board, this GPU is
GL4.6 not 4.5.

Fixes: ecca3b9655 ("ci/crocus: Update expectations from VK CTS 1.3.5.0.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22146>
2023-03-29 07:52:45 +00:00
Sai Teja Pottumuttu
11d32fb44f anv: Fix stride mismatch in mesa and minigbm
It is observed that in display resolutions where width is not equal to
stride, vulkan rendering is being distorted. This is happening due to
stride calculation mismatch between minigbm and mesa.

This fix makes sure that the stride calculated in minigbm is passed to
anv and isl.

The issue was found while debugging the following android cts tests and
thus fixes them as well.
android.graphics.cts.VulkanPreTransformTest#testVulkanPreTransformNotSetToMatchCurrentTransform
android.graphics.cts.VulkanPreTransformTest#testVulkanPreTransformSetToMatchCurrentTransform

Signed-off-by: Sai Teja Pottumuttu <sai.teja.pottumuttu@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22163>
2023-03-29 07:09:28 +00:00
Tapani Pälli
ca4ec49b0e anv: use primitive ID override when shader does not supply it
Patch moves over this fix from iris driver.

Fixes following test on DG2:
   dEQP-VK.rasterization.culling.primitive_id

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com> [v1]
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22130>
2023-03-29 02:43:57 +00:00
Samuel Pitoiset
84faaca38a radv: stop using the pipeline for emitting shaders
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22095>
2023-03-29 02:20:50 +00:00
Samuel Pitoiset
8f9b0088ab radv: pass the ES shader to radv_pipeline_emit_hw_ngg()
This allows to remove the radv_pipeline dependency.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22095>
2023-03-29 02:20:50 +00:00
Samuel Pitoiset
69da185793 radv: use the ES type to apply a workaround for NGG on GFX10
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22095>
2023-03-29 02:20:50 +00:00
Samuel Pitoiset
73ac2a22ec radv: use the shader info stage to simplify emitting NGG shaders
Instead of relying on the pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22095>
2023-03-29 02:20:50 +00:00
Samuel Pitoiset
09d713ee53 radv: stop using the pipeline for emitting PS inputs
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22095>
2023-03-29 02:20:50 +00:00
Samuel Pitoiset
168f282908 radv: add radv_get_last_vgt_shader() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22095>
2023-03-29 02:20:50 +00:00
Samuel Pitoiset
5c3c80be45 radv: emit the GS copy shader outside of radv_pipeline_emit_hw_gs()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22095>
2023-03-29 02:20:50 +00:00
Samuel Pitoiset
d071e36851 radv: stop using get_vs_output_info() when emitting VS/NGG shaders
It's always the current shader outinfo struct.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22095>
2023-03-29 02:20:50 +00:00
Luigi Santivetti
71fd9c2be0 pvr: fix segfault in dEQP-VK.ycbcr.query.*
Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22061>
2023-03-29 00:17:40 +00:00
Georg Lehmann
fd3ea4ffc2 aco: clean up to_mad_mix
These instructions are 32bit, so they don't support opsel anyway.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22103>
2023-03-28 23:30:08 +00:00
Samuel Pitoiset
51237a6508 radv/ci: update CI lists for Polaris10 and Pitcairn
Recent ac/surface changes fixed those.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22127>
2023-03-28 22:56:15 +00:00
Mike Blumenkrantz
4147dbdb7e zink: use c++ template to deduplicate image barrier functions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22057>
2023-03-28 22:28:59 +00:00
Mike Blumenkrantz
46d324e9a7 zink: minor tweaks for image barriers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22057>
2023-03-28 22:28:59 +00:00
Mike Blumenkrantz
60af511fc6 zink: use c++ template to deduplicate all the buffer barrier code
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22057>
2023-03-28 22:28:59 +00:00
Mike Blumenkrantz
bf0af0f8ed zink: move all barrier-related functions to c++
this will enable a lot of deduplication

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22057>
2023-03-28 22:28:59 +00:00
Mike Blumenkrantz
f5fe8d4f5c zink: break out a src region barrier check for reuse
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22057>
2023-03-28 22:28:59 +00:00
Mike Blumenkrantz
d8f3f6613a zink: fix some type mismatches for c++ compilation
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22057>
2023-03-28 22:28:59 +00:00
Alyssa Rosenzweig
145295e517 asahi: Don't lie about seamless cube maps
Now that mesa/st is setting seamless_cube_map properly we don't need to play any
games here. Remove the hack workaround.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21978>
2023-03-28 21:30:12 +00:00
Alyssa Rosenzweig
bf3027c391 mesa/st: Normalize wrap modes for seamless cubes
The OpenGL specification requires that seamless cube maps ignore the wrap mode,
but some hardware may try to respect the wrap mode even for seamless cubes
contrary to the spec. Since OpenGL maps samplers 1:1 to textures (at least
without bindless texture support...), it's easy to override the wrap mode for
seamless cubes to something that works for the hardware.

I'm not sure if there is value in gating this behaviour behind a CAP. On one
hand, there is a tiny bit of extra CPU overhead added to change samplers. On the
other hand, normalizing wrap modes might improve CSO caching, and normalizing to
a non-BORDER mode avoids the expensive border colour code later in the function.

We will need a different workaround in our Vulkan driver. Potentially, we'll
have to duplicate *every* sampler to have a cubemap version and a non-cubemap
version, selecting a sampler in the shader based on the texture opcode. That
sucks and implementing it would depend on subtle details of how we implement
descriptor sets, so it's not like we would share that code with the GL driver
anyway. In the mean time, let's get this right for GL without the performance
hit of duplication.

Fixes dEQP-GLES3.functional.texture.filtering.cube.* on Asahi, as well as a
smattering of dEQP-GLES31.functional.texture.filtering.cube_array.* fails on
softpipe.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21978>
2023-03-28 21:30:12 +00:00
Alyssa Rosenzweig
f2506780c8 mesa/st: Only set seamless for GLES3
6148e3aae7 ("mesa: Fix ctx->Texture.CubeMapSeamless") introduced a hack, where
seamless cube maps would be requested even for GLES2 contexts despite the spec,
on the assumption that GLES2 gallium drivers would ignore the bit. But that
requires Gallium drivers to know what GLES version they advertise, which is a
horrible layering violation. When the commit was written 8 years ago, there were
classic drivers to contend with so it made sense as a fix to get GLES 3.0 up and
running. With classic drivers gone, it's time to sunset the hack and restore the
intended behaviour by setting ctx->Texture.CubeMapSeamless only once we know the
version.

In addition to fixing a semantic issue in the Gallium contract and preventing a
regression from the next commit, this fixes cube maps on Mali-T720 under
Panfrost. In general, Panfrost supports GLES3 (and honours the seamless flag
everywhere) but on T720 we only advertise GLES2 due to missing MRT support on
older Midgard devices, so we need the flag set properly to distinguish these
cases.

Cc: mesa-stable
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21978>
2023-03-28 21:30:12 +00:00
Paul Gofman
1646f7d977 driconf: add a workaround for Kaiju-A-Gogo
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22152>
2023-03-28 20:35:11 +00:00
Qiang Yu
aa314c746f radeonsi: monolithic PS emit epilog in nir directly
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21552>
2023-03-28 19:57:11 +00:00
Qiang Yu
c182154456 ac/nir: add ac_nir_lower_ps
Lower ps output to nir_export_amd.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21552>
2023-03-28 19:57:11 +00:00
Qiang Yu
bf9c1699cd nir: add nir_fisnan helper function
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21552>
2023-03-28 19:57:11 +00:00
Qiang Yu
c9d60547ef nir,radeonsi: add and implement nir_load_alpha_reference_amd
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21552>
2023-03-28 19:57:11 +00:00
Qiang Yu
67f295f1e2 aco: implement float16 nir_op_pack_(s|u)norm_2x16
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21552>
2023-03-28 19:57:11 +00:00
Qiang Yu
3df1c4455e ac/llvm: implement float16 nir_op_pack_(s|u)norm_2x16
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21552>
2023-03-28 19:57:11 +00:00
Qiang Yu
6848e05f9c nir: pack_(s|u)norm_2x16 support float16 as input
For AMD GPU which has instruction to normalize and pack two float16
inputs, and used when fragment shader export color output.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21552>
2023-03-28 19:57:11 +00:00
José Roberto de Souza
c30194e9ec intel: Allocate mesh shader URB space before task shader
A future platform requires that mesh shader URB space be allocated
before task shader URB space.

If task shader is enabled, it will align the mesh shader URB size to
8Kb and give the remaning back to task shader. Otherwise, no aligment
is needed, and mesh shader will have all the URB space.

BSpec: 56229, 56230
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21603>
2023-03-28 19:25:34 +00:00
Konstantin Seurer
b69ec8bde3 radv/rt: Refactor rq_load lowering
This just gets rid of all the bcsel emissions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21455>
2023-03-28 16:55:30 +00:00
Mike Blumenkrantz
83929f9955 aux/trace: fix GALLIUM_TRACE_NIR handling
this now correctly doesn't dump nir when the counter is zero

Fixes: f99eab23ad ("aux/trace: delete GALLIUM_TRACE_NIR log message")

Reviewed-by: Matti Hämäläinen <ccr@tnsp.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22164>
2023-03-28 16:17:39 +00:00
Mike Blumenkrantz
62789086e4 aux/trace: dump blend states with enums
this is more readable

Reviewed-by: Matti Hämäläinen <ccr@tnsp.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22164>
2023-03-28 16:17:39 +00:00
Pierre-Eric Pelloux-Prayer
c1050b5330 radv: add RADV_DEBUG=extra_md
This enables the use of UMD metadata v2. This allows tools (eg umr)
import buffers.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21984>
2023-03-28 15:17:28 +00:00
Pierre-Eric Pelloux-Prayer
f315774727 radeonsi: don't use si_decompress_dcc if the blitter is running
Otherwise this will cause a blitter recursion which will crash at
some point.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21984>
2023-03-28 15:17:28 +00:00
Pierre-Eric Pelloux-Prayer
46d2655a18 radeonsi: add AMD_DEBUG=extra_md
When this debug flag is set, the driver sets the umd metadata for
all color textures and enables the use of extended metadata.

Extended metadata allows umr to import textures and setting these
on all color texture allows to import non-exported textures
(eg: dGPU draw surface when DRI_PRIME=1 is used).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21984>
2023-03-28 15:17:28 +00:00
Pierre-Eric Pelloux-Prayer
7f94b80001 ac/surface: introduce umd metadata v2
Update the metadata format. For gfx8- chips nothing change.

For gfx9 chips:
* for textures without a valid modifier a dw is added at index=10
  containing the stride
* for textures with a valid modifier the modifier is stored at
  index 10 and 11. Then the number of planes is stored at 12.
  Then for each plane the offset and the stride are stored.

The goal here is to be able to create textures from dmabuf from
umr - without these changes this is impossible because these
values can't be guessed.

The new layout is compatible with version=1 so old/new UMD can
be used together without issues and isn't used by default.
For radeonsi, it will be possible to use it with a AMD_DEBUG=...
option.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21984>
2023-03-28 15:17:28 +00:00
Pierre-Eric Pelloux-Prayer
4abb911bd2 amd/surface: rename metadata functions
Use more specific verbs to avoid confusion:
   set -> apply
   get -> compute

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21984>
2023-03-28 15:17:28 +00:00
Pierre-Eric Pelloux-Prayer
e272e59e40 mesa: fix CopyImageSubDataOES with GL_TEXTURE_EXTERNAL_OES
GL_TEXTURE_EXTERNAL_OES is allowed on GLES (any version) and glCopyImageSubDataOES
is implemented as an alias of CopyImageSubData.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21984>
2023-03-28 15:17:28 +00:00
Marcin Ślusarz
0c76e088f2 anv: call nir_shader_gather_info early
Shader info is needed for mesh in linking (in nir_lower_io_to_scalar_early,
see commit 5e144454) and will be needed once MR !17622 (anv: work around
for per-prim attributes corruption) lands.

We still need to call nir_shader_gather_info in anv_pipeline_lower_nir,
because the information got stale between anv_graphics_pipeline_load_nir
and anv_pipeline_lower_nir. Some examples:
- some FS inputs were marked as per-primitive during linking
  (brw_nir_link_shaders) affecting per_primitive_inputs mask
- some inputs and outputs were removed, because they are not used
  (nir_remove_unused_varyings) affecting outputs_written and inputs_read

This fixes func.mesh.ext.outputs.per_primitive.unused crucible test on DG2.
(I didn't know this test wasn't fixed by 5e144454, because I was testing
with !17622 merged-in, which added its own nir_shader_gather_info before
nir_lower_io_to_scalar_early).

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21787>
2023-03-28 14:41:54 +00:00
Daniel Stone
6a16ed8d79 CI: Disable freedreno
The proxy has been broken ever since the network went down.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22161>
2023-03-28 13:09:08 +00:00
Georg Lehmann
16c03fd756 aco/util: override default assignment operator for bitfield helpers
Otherwise, the default assignment operator copies the whole uint,
not just few bits we are interested in.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: e7559da757 ("aco: add bitfield array helper classes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22154>
2023-03-28 10:49:07 +00:00
Georg Lehmann
ed03696ed9 aco/ir: fix copy paste bug in convert_to_SDWA
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: 60cd3ba39f ("aco: copy abs/neg with assignment")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22154>
2023-03-28 10:49:07 +00:00
Friedrich Vock
1979e551a8 aco: Swap operands for v_and_b32 in RT prolog
The second operand must be a VGPR, only the first can be a literal.
With a literal, this code was wrongly assembled and resulted in artifacts on GFX11.

Fixes: 6446b79168 ("aco: implement select_rt_prolog()")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8642
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22142>
2023-03-28 09:16:56 +00:00
Timur Kristóf
fd1e27a8f8 radv: Fix swizzled VS input loads when some components are unused.
Fix how out-of-bounds loads are decided.
It was incorrect because it mismatched the swizzle.
The decision is now made using the loaded num_components.

Fixes: 27c8131978
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8712
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22124>
2023-03-28 08:37:28 +00:00
Samuel Pitoiset
5bf6f6fed1 radv/rt: bind the pipeline stack when it's not dynamic
This overwrites the rt_stack_size cmdbuf state when a new rt pipeline
with a static stack size is bound.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22126>
2023-03-28 06:56:14 +00:00
Alyssa Rosenzweig
0f974d1f90 asahi: Convert to SPDX headers
Also drop my email address in the copyright lines and fix some "Copyright 208
Alyssa Rosenzweig" lines, I'm not *that* old. Together this drops a lot of
boilerplate without losing any meaningful licensing information. SPDX is already
in use for the MIT-licensed code in turnip, venus, and a few other scattered
parts of the tree, so this should be ok from a Mesa licensing standpoint.

This reduces friction to create new files, by parsing the copy/paste boilerplate
and being short enough you can easily type it out if you want.  It makes new
files seem less daunting: 20 lines of header for 30 lines of code is
discouraging, but 2 lines of header for 30 lines of code is reasonable for a
simple compiler pass. This has technical effects, as lowering the barrier to
making new files should encourage people to split code into more modular files
with (hopefully positive) effects on project compile time.

This helps with consistency between files. Across the tree we have at least a
half dozen variants of the MIT license text (probably more), plus code that uses
SPDX headers instead. I've already been using SPDX headers in Asahi manually, so
you can tell old vs new code based on the headers.

Finally, it means less for reviewers to scroll through adding files. Minimal
actual cognitive burden for reviewers thanks to banner blindness, but the big
headers still bloat diffs that add/delete files.

I originally proposed this in December (for much more of the tree) but someone
requested I wait until January to discuss. I've been trying to get in touch with
them since then. It is now almost April and, with still no response, I'd like to
press forward with this. So with a joint sign-off from the major authors of the
code in question, let's do this.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Emma Anholt <emma@anholt.net>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Rose Hudson <rose@krx.sh>
Acked-by: Lyude Paul [over IRC: "yes I'm fine with that"]
Meh'd-by: Rob Clark <robdclark@chromium.org>

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22062>
2023-03-28 05:14:00 +00:00
Lina Versace
ede5fed450 mailmap: Add Lina's new google.com address
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22153>
2023-03-28 03:37:43 +00:00
Harri Nieminen
ecf7a7da1b docs/svga3d: Fix typo
Found by codespell

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22149>
2023-03-28 02:31:05 +00:00
Harri Nieminen
1ffd591562 docs/panfrost: Fix typo
Found by codespell

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22149>
2023-03-28 02:31:05 +00:00
Harri Nieminen
eff5d950ea docs/freedreno: Fix typos
Found by codespell

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22149>
2023-03-28 02:31:05 +00:00
Harri Nieminen
c9378106ed docs/gallium: Fix typos
Found by codespell

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22149>
2023-03-28 02:31:05 +00:00
Harri Nieminen
8ebc01ee0b docs/specs: Fix typos
Found by codespell

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22149>
2023-03-28 02:31:05 +00:00
Filip Gawin
fa6ecd0032 crocus: don't quantize the clear value
Helps with:
spec@!opengl 1.0@depth-clear-precision-check@depth32f_stencil8,UnexpectedPass
spec@!opengl 3.0@clearbuffer-bug,UnexpectedPass

Cc: mesa-stable

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22137>
2023-03-27 23:15:41 +00:00
Marek Olšák
5d8f0c570e amd/llvm: remove no-op code for vec3 loads in ac_build_tbuffer_load
Formatted loads always support vec3, so this code didn't do anything.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22117>
2023-03-27 22:38:07 +00:00
Marek Olšák
03c97b212e amd/llvm: fix handling of unsupported vec3 loads on gfx6
VMEM loads promoted from vec3 to vec4 didn't trim the vector, thus
returning vec4 on gfx6 and vec3 on later generations, which callers
don't expect.

SMEM loads were adding an extra component on gfx6, causing same issues.

Fixes: 82919e2d - amd: lower subdword UBO loads in NIR
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8693

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22117>
2023-03-27 22:38:07 +00:00
Georg Lehmann
dde7c5506c aco: make .clang-format usable with tests
Code between BEGIN_TEST and END_TEST should be indented,
and comments used by the test itself should not be reformatted.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22122>
2023-03-27 20:43:22 +00:00
Iago Toral Quiroga
40a00fc065 v3dv: fix format swizzle for buffer views
Fixes:
dEQP-VK.api.buffer_view.access.uniform_texel_buffer.b8g8r8a8_unorm

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22131>
2023-03-27 20:16:04 +00:00
Iago Toral Quiroga
3647b05ae9 v3dv: pause occlusion queries during vkCmdClearAttachments
We implement this by emitting a draw call, which should not be registered
during occlusion query counting.

Fixes:
dEQP-VK.query_pool.occlusion_query*clear*

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22131>
2023-03-27 20:16:04 +00:00
Samuel Pitoiset
e61d68ac8a radv: move {esgs,gsvs}_ring_size to radv_legacy_gs_info
To update the ring info when a geometry shader is bound.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22134>
2023-03-27 18:54:50 +00:00
Samuel Pitoiset
c1c8aa49c8 radv: rename gfx9_gs_info to radv_legacy_gs_info
This was misleading because it's also needed on GFX6-8.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22134>
2023-03-27 18:54:50 +00:00
Jarred Davies
bc6f95c53e pvr: Add robustness buffer support
The robustness buffer is used when no vertex attribute can be loaded and
robustBufferAccess is enabled.

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21579>
2023-03-27 18:36:32 +00:00
Jarred Davies
5fdfcc9913 pvr: Rename pvr_xgl_pds.c to pvr_pipeline_pds.c
Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21579>
2023-03-27 18:36:32 +00:00
Jarred Davies
bb8d47b09b pvr: Always mark robustBufferAccess as supported
As per the Vulkan spec, this is a required feature for graphics implementations.

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21579>
2023-03-27 18:36:32 +00:00
Ilya K
679c84142f intel/vk/grl: don't install libgrl.a
It isn't used by anything at runtime and shouldn't be installed.
Saves about 3MB of space on the final artifacts on x86_64-linux.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8711
Fixes: 63966505 ("anv/grl: Build OpenCL kernels")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22133>
2023-03-27 18:00:48 +00:00
Samuel Pitoiset
cb9f94f84c radv: stop checking dynamic states when emitting the guardband state
If the primitive topology is part of the PSO, it's copied at pipeline
bind time to the dynamic state, so this checks is unnecessary.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22105>
2023-03-27 17:29:03 +00:00
Samuel Pitoiset
66fec16238 radv: add DI_PT_RECTLIST to si_conv_prim_to_gs_out()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22105>
2023-03-27 17:29:02 +00:00
Georg Lehmann
5e9ea15484 aco: fix p_interp_gfx11 comment
It no longer uses a tmp exec and scc.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22107>
2023-03-27 15:09:21 +00:00
Georg Lehmann
b1668aedaf aco: don't check usesModifiers for pseudo instructions
This can't happen.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22106>
2023-03-27 14:22:07 +00:00
Lucas Stach
9df5a2bd62 etnaviv: fix texture barrier implementation
The current implementation has a number of issues:
- it doesn't flush the depth cache, even though this can also be changed
  due to fragment shader operations and thus is included in the definition
  of glTextureBarrier
- it doesn't flush the vertex sampler cache
- it doesn't stall the pipeline until the flushes are done

Fix those issues and drop the comment, as it's pretty clear from the
code what is being done.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22104>
2023-03-27 14:03:53 +00:00
Lucas Stach
77ab87e5a7 etnaviv: flush VS texture cache when texture data is changed
If a sampler resource is changed the vertex texture caches also need to
be flushed, as those are separate from the fragment texture caches.

It seems that some cores need the VS sampler cache flush to be in a
separate state. I have seen no adverse effects of merging the TEXTUREVS
flush into a single flush state emission on GC3000 and up, but the blob
always emits the vertex sampler cache flush as a separate state, so do
the same here to avoid nasty surprises.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22104>
2023-03-27 14:03:53 +00:00
Erik Faye-Lund
e7ee11f89a docs/freedreno: fix turnip-heading level
Having two top-level headings in an article confuses Sphinx, and makes
both appear as separate articles in the toc-tree.

It doesn't seem like there's a good reason why the following headings
should be nested under the "Turnip"-heading anyway, so let's just make
it a sibling to the "Hardware architecture" heading.

Acked-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21948>
2023-03-27 10:01:23 +00:00
Samuel Pitoiset
8f6998ad8a radv: separate the sample shading state between FS and graphics pipeline
Sample shading can be enabled inside the fragment shader and also
per-pipeline. Separate both cases to be able to enable sample shading
by only binding a FS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22110>
2023-03-27 09:29:12 +00:00
Samuel Pitoiset
774e055823 radv: move uses_user_sample_locations to radv_multisample_state
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22110>
2023-03-27 09:29:11 +00:00
Samuel Pitoiset
609edd6e96 radv: copy the multisample state to radv_cmd_state
To avoid relying on the pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22110>
2023-03-27 09:29:11 +00:00
Tatsuyuki Ishi
f5e8944dd6 amd: Add radv_foreach_stage to ForEachMacros.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22092>
2023-03-27 08:29:35 +00:00
Marcin Ślusarz
698135fd3e anv,hasvk: remove stale comments
Added in 060a6434ec.
The field it described was removed in c1f4343807.

Fixes: c1f4343807 ("anv: Set up memory types and heaps during physical device init")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22113>
2023-03-27 07:48:17 +00:00
Samuel Pitoiset
4dc40c3b64 radv: move radv_meta_* to a new folder
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22046>
2023-03-27 06:27:49 +00:00
David Heidelberg
5e0c8a6555 ci/broadcom: test occasionally fails, but typically passes
Flake still present.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22125>
2023-03-27 02:10:43 +02:00
Erik Faye-Lund
04bfb71fa1 docs: prefer http-links over ftp
None of the major browsers supports FTP links. While it's fine to have
FTP links as alternatives, let's change these links into HTTP links
instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22033>
2023-03-26 19:46:48 +00:00
Faith Ekstrand
5b5fd8d437 CODEOWNERS: s/jekstrand/gfxstrand
My gitlab handle changed, update to the right one.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22120>
2023-03-26 00:16:26 +00:00
Faith Ekstrand
877473b4a0 util: Update some copyright tags
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22120>
2023-03-26 00:16:26 +00:00
Faith Ekstrand
9d1c1379e7 vulkan: vk_android.c should be copyright Intel
That's where I copied+pasted it from.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22120>
2023-03-26 00:16:26 +00:00
Faith Ekstrand
e001995dc5 util,mesa,panfrost: Drop some author tags
This is what git blame is for

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22120>
2023-03-26 00:16:25 +00:00
Faith Ekstrand
789992b7c9 intel: Drop some author comments and update Faith's name
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22120>
2023-03-26 00:16:25 +00:00
Faith Ekstrand
cf1da3ef40 spirv: Drop a bunch of Authors tags
This is what git blame is for

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22120>
2023-03-26 00:16:25 +00:00
Faith Ekstrand
01275a1a95 nir: Drop a bunch of Authors tags
This is what git blame is for.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22120>
2023-03-26 00:16:25 +00:00
Faith Ekstrand
329398b99a docs: Fix Faith's name in relnotes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22120>
2023-03-26 00:16:25 +00:00
Faith Ekstrand
a02ed15067 intel/blorp: Drop the TODO file
Most of this stuff is done.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22120>
2023-03-26 00:16:25 +00:00
Bas Nieuwenhuizen
0f045d43d6 ac/surface,radv: Opt out of stencil adjust.
We never implemented it, and having broken mipmaps works out better
for applications and CTS. Actually implementing stencil adjust is
going to be a major pain due to stuff like the GENERAL layout.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21869>
2023-03-25 18:15:08 +00:00
Bas Nieuwenhuizen
3bfa0d44fb ac/surface: Only allow stencil pitch adjustment for mipmaps.
Otherwise we can just have addrlib do the depth pitch adjustment
and have no copies.

v2: update CI expectations (olv)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21869>
2023-03-25 18:15:08 +00:00
Bas Nieuwenhuizen
71a50bdaad ac/surface,radv: Avoid pitch weirdness if image not used for rendertarget.
Literally no point to it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21869>
2023-03-25 18:15:08 +00:00
Rob Clark
102445d2c3 freedreno/registers: Add control reg for zap fw base
The zap shader knows the offset of the embedded shader within the zap
sqe instructions, but uses this control reg to get it's own address in
memory, in order to calculate the address of the compute shader part of
the zap shader.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21748>
2023-03-25 16:21:28 +00:00
Rob Clark
c3ed8d0e7b freedreno/afuc: Add raw mode for disasm
Add a mode which doesn't try to find/process a jmptable.  Useful for
looking at zap shaders.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21748>
2023-03-25 16:21:28 +00:00
Mike Blumenkrantz
e5dae7d945 driconf: make glthread=true default for source games
this yields a sizable gain for source-based games, so it shouldn't be
limited to radeonsi

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20611>
2023-03-25 01:44:27 +00:00
Sagar Ghuge
cece2aa2c1 intel/compiler: Add Wa_14014063774 for slm_fence
Before SLM fence compiler needs to insert SYNC.ALLWR in order to avoid
the SLM data race.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22050>
2023-03-25 00:45:04 +00:00
Ryan Neph
4a4b05869a venus: check and configure new ringMonitoring feature
At ring creation, if supported by renderer, we can request
ringMonitoring. During driver ring waits, the ring's new ALIVE status
bit will be checked periodically at the configured rate. If the bit is
not set, the renderer must have crashed and the driver should do the
same to signal a problem to the app/user.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22036>
2023-03-24 23:27:53 +00:00
Ryan Neph
c4c09464ce venus: update to latest protocol for ringMonitoring
Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22036>
2023-03-24 23:27:53 +00:00
Ryan Neph
476c771e34 venus: init exp features before ring init again
This reverts commit dda85cf94b ("venus:
move exp features init back to use ring submit"), and additionally adds
per stream shmem caching to determine when vkSetReplyCommandStreamMESA
is needed.

Checking renderer features before setting up ring means that the bound
shmem for replies on the ring will no longer be implicitly set on first
shmem creation (it was set for the renderer stream instead). So the
test for when another vkSetReplyCommandStreamMESA is needed must
independently consider the last stream set on renderer/ring(s)

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22036>
2023-03-24 23:27:53 +00:00
Ryan Neph
3812a946d2 venus: set/check ring status bits independently
prepare for manipulation of the new VK_RING_STATUS_ALIVE_BIT_MESA during
ring monitoring.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22036>
2023-03-24 23:27:53 +00:00
Ryan Neph
bb4c10f85e venus: add vn_relax_init/_fini()
Use a new calling contract so we can do pre/post-work around every ring-waiting
iteration. All looping uses of `vn_relax()` must now call `vn_relax_init()` and
`vn_relax_fini()` before/after their loop bodies.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22036>
2023-03-24 23:27:52 +00:00
Sagar Ghuge
0f14724039 iris: Implement Wa_14015297576
Disable tessellation distribution when primitive id is enabled.

v2: some changes squashed from Tapani:
   - leave mode initially as TEDMODE_OFF (0) so we can merge
   - take fs primitive ID overrides in to account

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21982>
2023-03-24 22:37:09 +00:00
Sagar Ghuge
86d931724d anv: Implement Wa_14015297576
Disable tessellation distribution when primitive id is enabled.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21982>
2023-03-24 22:37:09 +00:00
Guilherme Gallo
7f04fa7364 ci/zink: Add zink-tu-a618-traces-performance job
It will be needed to compare the performance of zink+turnip against
turnip only jobs.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
Guilherme Gallo
38074e8d6d ci/zink: Add zink-turnip-manual-rules
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
Guilherme Gallo
2bb917282a ci/zink: Add zink-a618 trace jobs
May be used as replacement for zink-a630-traces job, since a618 is similar
to a630.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
Guilherme Gallo
bbfc9b517d ci/freedreno: create a618-traces and perf jobs
Performance jobs should work better if we fix the device under test to
be the same in every test, instead of using any device from a group of
devices of the same type.

We can do it quickly in LAVA, but it seems more
complicated on Google's farm. So, let's replace the a630 (in Google
farm) with a fixed a618 device to test freedreno traces performance.

Add a618-traces job as well, as we need to confirm that a618 is
generating stable traces with good results before proceeding to track
its performance

Co-authored-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
Guilherme Gallo
93e3d37b47 ci: Add piglit traces hidden jobs
To better organize traces and traces-performance jobs that uses piglit
to replay traces.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
David Heidelberg
cadceac2a7 ci/freedreno: Make traces work on LAVA caching proxy
Explicitily define the caching proxy via piglit
`--download-caching-proxy-url` argument.
We have different URLs for caching proxy for LAVA and freedreno farms.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
David Heidelberg
a114bf1cd2 ci/freedreno: define Google farm specific includes
This should prevent mixing them with LAVA freedreno devices.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
David Heidelberg
748c02f86c ci/freedreno: split deqp from other jobs
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
David Heidelberg
4286e559cc ci: remove deqp from lava piglit and traces runs
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
David Heidelberg
bc5a48d48b ci: create lava-test without deqp HWCI_TEST_SCRIPT
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
David Heidelberg
2314a0d59b ci: rename .lava-test to .lava-test-deqp to describe it correctly
.lava-test hidden job was setting the HWCI_TEST_SCRIPT variable to deqp
runner. But that is not always the case. When we run piglit traces jobs,
we use piglit-traces.sh instead, for example.

Splitting into:
- .lava-test-deqp (deqp-runner + deqp)
- .lava-traces (deqp-runner + piglit)
- .lava-piglit (piglit-runner + piglit)

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Co-authored-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
Guilherme Gallo
8e5c33f8a2 ci: Fix freedreno-rules-performance
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
Guilherme Gallo
2112d8b1f2 ci: Improve piglit-traces "no-perf" filter
We filter out traces that work only in standard replay mode but not
profile one via yq (jq for YAML) manipulation.

The previous query needed to be fixed in some scenarios, such as traces
labeled with only `["no-perf"]`, which was being ignored by the query.

This commit updates the yq query with newer syntax to cover all current
cases (at least for freedreno).

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22065>
2023-03-24 21:58:22 +00:00
José Roberto de Souza
f868c1727d anv: Fetch max_context_priority from drm_xe_query_config
A new property was added to drm_xe_query_config with the max engine
priority for running process, so we can use it directly on
anv_xe_physical_device_get_parameters() and nuke
anv_xe_physical_device_max_priority_update().

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22112>
2023-03-24 21:28:47 +00:00
José Roberto de Souza
972d2a89d9 anv: Partialy import drm-uapi/gpu_scheduler.h and use it
To replace the hard-coded values.
Not fully importing gpu_scheduler.h because it includes several Linux
specific headers that will make the life of anyone porting Xe to
other Unix harder.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22112>
2023-03-24 21:28:47 +00:00
José Roberto de Souza
073fc34e4b intel: Sync xe_drm.h
Based on commit f6e26dff8fa3 ("drm/xe: Add max engine priority to xe query")

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22112>
2023-03-24 21:28:47 +00:00
Nicolas F
fed462a011 driconf: remove the adaptive sync special case for mpv
mpv didn't ask to be on this list, was never consulted about being
on this list and to the best of my knowledge has no problem with
adaptive sync. If there is an issue exposed by mpv having adaptive
sync enabled, then it should be reported to mpv, so that it can be
fixed in mpv.

The only problem I could remotely imagine with mpv and VRR is that
its display-resample mode tries to do something similar, and the
two mechanisms will likely race each other to the bottom, but the
display-resample mode is not the default and this is already a
known issue on Windows so users wouldn't expect this to behave any
differently on Linux.

In short, please don't try to make a list of all applications that
are not video games, it is not conducive to having a good time on
the computer.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20701>
2023-03-24 20:10:25 +00:00
Daniel Schürmann
56b6ca411f radv/rt: Fix VK_KHR_pipeline_executable_properties
We don't provide executable properties for the prolog shader.

Fixes: f123d65e9f ('radv/rt: use prolog for raytracing shaders')
Fixes: dEQP-VK.pipeline.monolithic.shader_module_identifier.pipeline_from_id.ray_tracing_libs.*
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22111>
2023-03-24 19:50:46 +00:00
Daniel Schürmann
2cf6813c19 radv: fix radv_shader_binary member fields to 32 bit.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22029>
2023-03-24 19:03:29 +00:00
Daniel Schürmann
3806cd83f2 radv: skip pipeline caching with RADV_DEBUG=shaders
in order to create reproducible cache entries.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22029>
2023-03-24 19:03:29 +00:00
Daniel Schürmann
493d93f26c radv: refactor shader_compile()
- change the return type to radv_shader_binary *
- setup options at the caller side

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22029>
2023-03-24 19:03:29 +00:00
Daniel Schürmann
5051980ff8 radv: remove radv_create_gs_copy_shader()
We can replace the call with radv_shader_nir_to_asm().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22029>
2023-03-24 19:03:29 +00:00
Daniel Schürmann
55caea6453 radv: move gl_shader_stage from radv_binary to radv_shader_info
This way, both radv_shader and radv_shader_binary, provide the stage.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22029>
2023-03-24 19:03:29 +00:00
Daniel Schürmann
2c8d101c71 radv: separate radv_capture_shader_executable_info() from radv_shader_create()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22029>
2023-03-24 19:03:29 +00:00
Daniel Schürmann
43ad3d3917 radv: inline radv_postprocess_config()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22029>
2023-03-24 19:03:29 +00:00
Daniel Schürmann
13c55a8e86 radv: remove unnecessary copy of binary->config
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22029>
2023-03-24 19:03:29 +00:00
Daniel Schürmann
fe716c2428 radv: separate radv_postprocess_binary_config() from radv_shader_create()
The goal is to make radv_shader_create() a function that creates a shader
from a binary without any additional information.
Postprocessing the config is only needed after compilation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22029>
2023-03-24 19:03:29 +00:00
Daniel Schürmann
0fec7819f4 radv: remove unused parameter from radv_open_rtld_binary()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22029>
2023-03-24 19:03:29 +00:00
Patrick Lerda
68babdd227 r600: fix refcnt imbalance related to shader
Indeed, gs_copy_shader was not freed.

Fixes: commit 1371d65a7f
    r600g: initial support for geometry shaders on evergreen (v2)

For instance, with "piglit/bin/shader_runner generated_tests/spec/arb_gpu_shader_int64/execution/built-in-functions/gs-abs-i64vec2.shader_test -auto -fbo"
while setting GALLIUM_REFCNT_LOG=refcnt.log.

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22087>
2023-03-24 17:21:06 +00:00
José Roberto de Souza
8ec0cb120c iris: Ajust gem buffer allocation size in Xe kmd
gem buffer size must also be aligned to mem_alignment otherwise
vm binds can fail when Xe kmd checks if vm bind range is bigger than
gem buffer size.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22059>
2023-03-24 16:47:18 +00:00
José Roberto de Souza
a25ef68f68 iris: Implement gem_vm_bind() and gem_vm_unbind() in Xe kmd backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22059>
2023-03-24 16:47:18 +00:00
José Roberto de Souza
c83a76339f iris: Add vm bind and unbind to kmd backend
At this time this is a nop for i915 but in future we will have a
Xe implementation.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22059>
2023-03-24 16:47:18 +00:00
José Roberto de Souza
db781f01d4 iris: Prepare iris_bufmgr functions for vm bind error paths
vm bind and unbind can fail, so error paths will be needed.
Here I'm just preparing the code paths for that.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22059>
2023-03-24 16:47:18 +00:00
Samuel Pitoiset
879ddf9720 radv: rework binding shaders to cmdbuf by introducing new helpers
For future work.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22101>
2023-03-24 16:21:49 +00:00
Danylo Piliaiev
b30f2bf790 tu: Generate entrypoints for each gen
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:26 +00:00
Danylo Piliaiev
3db70be04b freedreno/regs: Include assert.h in generated headers
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:26 +00:00
Danylo Piliaiev
7e833713d8 vk/entry_points: Add option to generate template entrypoints
As a C++ alternative to genX macros.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:26 +00:00
Danylo Piliaiev
c82ddf4f98 tu: compile as C++
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:26 +00:00
Danylo Piliaiev
8baa7acd82 freedreno/msm: Rename drm_msm_gem_submit_reloc::or in C++ code
Clashes with C++ `or` keyword

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
ae47b4e937 tu: C++-proofing: misc fixes
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
903072ea03 tu: C++-proofing: cast result when extracting field from reg value
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
28a703ea43 tu: C++-proofing: prevent taking address from rvalue
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
aec1e9ecf7 tu: C++-proofing: ease access to global bo struct
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
40b7e5c48a tu: C++-proofing: fix casting from void * fpermissive warnings
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
c618e2a2d4 tu: C++-proofing: Initialize tu_reg_value in-order by pack funcs
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
685dbce850 tu: C++-proofing: fix extension table initialization
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
e02e51df5b tu: C++-proofing: fix designator initializer order
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
a8dc6fbf83 tu: C++-proof: do not goto over variables initialization
That is not permitted by C++

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
af3e075f05 tu: C++-proofing: various enum fixes
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
5430d10d06 tu: C++-proofing: fix struct initializers
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
8a0f1a6d70 tu: C++-proofing: fix offsetof with dynamic array index
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
1510b97c70 ir3: C++-proofing
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
485bdae420 freedreno/common: C++-proof freedreno_uuid.h
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
1600b310bc vk/util: Generate defines to help casting structs with vk_find_struct
C++ doesn't like implicit casts from void *.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
de5c3900ca vk/util: remove (void *) casts from vk_foreach_multi_draw macros
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
4d79703b91 vk/wsi: C++-proof wsi_common_drm.h
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
815960d88f vk/vk_extension_gen: Make table struct initializable in C++ on older gcc
Before GCC 11.2 initializing anonymous struct with extensions gave:

 error: too many initializers for 'vk_device_extension_table'

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
330b64d1d1 spirv: sort spirv_supported_capabilities
Makes easier for c++ driver to keep initializer in order.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
d60b551b90 util/format: Make format_table compatible with C++
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Danylo Piliaiev
24fca432ab util/perf: C++-proof util/perf
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
2023-03-24 15:49:25 +00:00
Konstantin Seurer
200e551cbb nir/lower_shader_calls: Remat derefs before lowering resumes
Closes: #7923
cc: mesa-stable

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20399>
2023-03-24 14:55:37 +00:00
Samuel Pitoiset
af1bc7f4ce radv: remove radv_pipeline::device completely
This is unecessary and this prevents using a ton of functions without
a radv_pipeline object.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22090>
2023-03-24 13:48:40 +00:00
antonino
8e9262fefd gallium: decompose quad strips into quads if supported
This changes gallium to decompose quad strips into quads instead of triangles
when the driver advertises support for them.

This should result in a more correct result when those are drawn
with the line raster primitve (avoids showing the diagonal line).

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21987>
2023-03-24 13:11:12 +00:00
antonino
d4a6c97779 mesa: correctly allocate space for converted primtives
Previosuly it was assumed that primitives where always converted to
triangles if the driver did not support all primitives, however that's
not true for a driver that supports quads but not quad strips.

Fixes piglit spec@!opengl 1.1@dlist-fdo3129-01 on Panfrost

Fixes: dcbf2423d2 ("vbo/dlist: add vertices to incomplete primitives")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21987>
2023-03-24 13:11:12 +00:00
Samuel Pitoiset
d9e68f4e40 radv: pass a radv_shader to radv_emit_dispatch_packets()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22102>
2023-03-24 12:43:51 +00:00
Samuel Pitoiset
d07c81d87e radv: move cs_regalloc_hang_bug to radv_shader_info
This is more like a shader property.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22102>
2023-03-24 12:43:51 +00:00
Georg Lehmann
48ba17b823 amd: remove duplicate from .clang-format
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22077>
2023-03-24 10:56:31 +00:00
Georg Lehmann
687b756073 aco: remove duplicates from .clang-format
The latest clang-format doesn't support this anymore.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22077>
2023-03-24 10:56:31 +00:00
Lionel Landwerlin
9448c2628e anv: add utrace support for queue debug utils
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22006>
2023-03-24 09:38:20 +02:00
Lionel Landwerlin
b868f22b46 anv: rename anv_utrace_flush_copy in anv_utrace_submit
We want to use this for submission of traces outside command buffers,
so it won't just execute copies of timestamp buffers.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22006>
2023-03-24 09:38:17 +02:00
Lionel Landwerlin
becfbb2a19 anv: fixup locking for utrace submission increments
This is supposed to happen under the device lock.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: e760c5b37b ("anv: add perfetto source")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22006>
2023-03-24 09:38:13 +02:00
Lionel Landwerlin
87a1d6423c anv: fix incorrect utrace bo release
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c67c9688c3 ("anv/utrace: use a bo pool for utrace buffers")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22006>
2023-03-24 09:38:10 +02:00
Lionel Landwerlin
68bc4c56ff intel/ds: rename frame timeline row to queue
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22006>
2023-03-24 09:38:08 +02:00
Lionel Landwerlin
1c64952e65 vulkan/runtime: also copy strings on queue debug utils
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22006>
2023-03-24 09:38:06 +02:00
Lionel Landwerlin
d55d74bb72 util/u_trace: move needs_cs_param option to tracepoints
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22006>
2023-03-24 09:37:57 +02:00
Teng, Jin Chung
de8b14f8ea d3d12: AV1 Dec - Set anchor_frame_idx only when large_scale_tile equals 1
Signed-off-by: Teng, Jin Chung <jin.chung.teng@intel.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22048>
2023-03-24 01:51:07 +00:00
Teng, Jin Chung
2e4f2472cc frontend/va: Add large_scale_tile from VADecPictureParameterBufferAV1
Signed-off-by: Teng, Jin Chung <jin.chung.teng@intel.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22048>
2023-03-24 01:51:07 +00:00
Mike Blumenkrantz
14507927a6 zink: flag rp layout change if zsbuf usedness changes on dsa/fs state bind
this should (correctly) trigger the expected zsbuf elimination and
avoid hitting asserts

fixes #8679

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22086>
2023-03-24 00:32:56 +00:00
Alyssa Rosenzweig
822090e802 panfrost: Remove Midgard RSD fields from Bifrost
These were removed and replaced by new Bifrost RSD fields, don't print the wrong
values. Harmless but noises up the decoding.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
c358c6cd43 panvk: Lower blending late
Since 50b82ca818 ("nir/lower_blend,agx,panfrost: Use lowered I/O"),
nir_lower_blend needs to be called after lowering I/O rather than before.
Furthermore, after lowering blend, we need (in general) to lower the resulting
load_output intrinsics. Now that we have a proper preprocess_nir hook, there is
a natural place in panvk_vX_shader to do this.

Fixes dEQP-VK.pipeline.blend.*

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
ecd29fdf38 pan/bi: Call pan_nir_lower_zs_store late
This will give the driver [notably, PanVK] a chance to lower dual source
blending without having the dual stores turned into store_combined_output_pan.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
24693d8a7c pan/bi: Export bifrost_nir_lower_load_output
If new load_output are created after preprocessing NIR (namely, from blend
lowering in panvk), this lowering needs to be called to lower load_output to the
vendor intrinsic with conversion descriptor.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
f888994679 panfrost: Move panfrost_sysvals to GL driver
This shouldn't be used by anything else at this point.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
56288a7cfb panvk: Remove unused function
Erroneously referencing sysvals.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
3e64b13193 panfrost: Move sysvals to GL driver struct
Only the GL driver produces/consumes these, they shouldn't be in the common
shader_info.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
ffb9919c2f panfrost: Lower sysvals in GL
Drop the backend compiler sysval handling in favour of the pass in the GL
driver, bringing us into compliance with Ekstrand's rule.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
455a76f10a panfrost: Add NIR-based sysval lowering pass
Add a NIR pass to lower all the sysvals seen in the GL driver to load_ubo
intrinsics. These load_ubo intrinsics will be pushed to uniforms by the backend
compiler as usual. This will let us remove all sysval handling from the backend
compilers.

This is a direct NIR port of the existing pan_sysvals.c infrastructure and the
consumers in the Midgard/Bifrost compilers. It aims to be bug-for-bug compatible
to ease bisection.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
3ec9b18332 panvk: Inline blend constants as syvals
Blend constants are sysvals, it's just that they can sometimes be inlined
depending on the pipeline state. The old "inline blend constant" pass is a
special case of the new "lower all sysvals" pass in panvk.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
819313ff99 panvk: Don't use vec4 for vertex_instance_offsets
Not needed with the new lowering.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
5b3870d858 panvk: Lower sysvals in NIR
Per Ekstrand's Rule. This avoids the "fixed sysval" hack that Faith introduced
to get this behaviour with the GL sysval handling.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
f79697123e panfrost: Remove stale TODO
While the text here is still nominally accurate, we should be seeing so few
shader variants at this point that the locking contention isn't a big deal.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
c65a9be421 panfrost: Preprocess shaders at CSO create time
Now the only passes that depend on the shader key can run late, so we can
preprocess ahead-of-time once and throw away the original shader. This reduces
the cost of shader variants, as well as deduplicates some lowering for
transform feedback shaders.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
683d1b6078 panfrost: Effectively lower gl_FragColor late
nir_lower_fragcolor takes the number of colour buffers as input, but it's an
early pass, so we don't want to use the key for it. Instead, we can overestimate
and then optimize out late with an easy pass.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
b722410544 panfrost: Lower texcoords late
Use the _late version of this lowering instead of the early one.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
21ad75d4b9 panfrost: Lower clip_fs late
This pass works both early and late, so this is an easy one to sink down.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
2745daa05a pan/lower_framebuffer: Lower MSAA blend shaders
Do it explicitly in NIR rather than implicitly in the Midgard compiler. This
avoids a nasty sideband input for the render target formats and sample count,
for blend shaders on midgard only.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
ca2042f359 panfrost: Preprocess shaders in the driver
This is a flag-day change to how we compile. We split preprocessing NIR into a
separate step from compiling, giving the driver a chance to apply its own
lowerings on the preprocessed NIR before the final optimization loop. During
that time, the different producers of NIR (panfrost, panvk, blend shaders, blit
shaders...) will be able to (differently) lower system values.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
2a356cefba pan/blit: Lower load_sampler_lod_parameters_pan
This will be needed to decouple the lowering in the Midgard compiler from the
specific sampler descriptors used in the blit code.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
bccd6d3880 pan/lower_framebuffer: Use nir_shader_instructions_pass
Removes a lot of indentation, and improves metadata handling.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
8059eb1577 pan/lower_framebuffer: Only call for FS
It doesn't make sense for shader stages other than fragment (and blend which is
fragment-like), assert this.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
ee2a5d6bc6 pan/mdg: Split out early preprocessing from late
To prepare for the new compile flow, where this will be called by the driver
instead of internally in the compiler.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
0cdd82a892 pan/bi: Split out early preprocessing from late
To prepare for the new compile flow, where this will be called by the driver
instead of internally in the compiler.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
924f68fe4b pan/mdg: Only lower once
Nothing in the optimization loop should remat the lowered instructions, so
there's no need to do it inside the loop.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
02f570e33d pan/bi: Only lower once
Nothing in the optimization loop should remat the lowered instructions, so
there's no need to do it inside the loop.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
c333c0ea57 panfrost: Remove unused inputs.nr_cbufs
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:46 +00:00
Alyssa Rosenzweig
da0815fb9b panfrost: Remove inputs->blend.rt
This sideband input is now unused, as the information is available locally
within the NIR as it should be.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:45 +00:00
Alyssa Rosenzweig
edf24f1887 pan/mdg: Use I/O semantics for MRT blend stores
This avoids the silly reliance on the sideband.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:45 +00:00
Alyssa Rosenzweig
f2b56c8dd8 pan/bi: Remove bi_load_sysval
It is unused and should stay unused, as any use is a violation of Ekstrand's
rule.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:45 +00:00
Alyssa Rosenzweig
91ffd10351 pan/bi: Lower gl_VertexID in NIR
This gets rid of the hidden gl_BaseVertex system value which violates Ekstrand's
rule.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:45 +00:00
Alyssa Rosenzweig
540d556a8f pan/bi: Allow specializing bifrost_nir_options by arch
We need different settings for Bifrost and Valhall. Keeping everything static
simplifies lifetimes.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:45 +00:00
Alyssa Rosenzweig
8db30010dc pan/bi: Lower load_output to make sysval explicit
See previous commits for justification. Later, we'll split up NIR processing in
a few steps to give the caller a chance to lower the sysval, at which point the
goofy inputs here will go away.

v2: Only lower in fragment shaders. Likely harmless to run elsewhere but still
wrong because the location enum is defined per-stage.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:45 +00:00
Alyssa Rosenzweig
5c9ffaad8f pan/bi: Lower sample mask writes in NIR
This uses the new NIR sysvals to avoid materializing magic sysvals in the
driver, getting us closer to the Ekstrand Rule.

v2: Only lower for fragment shaders. Lowering in vertex shaders should be a
no-op, except that FRAG_RESULT_SAMPLE_MASK shadows a VARYING_SLOT for fog
coords, causing v1 of this patch to regress fog. Caught by the G52 piglit job in
CI. Thank you, Marge.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:45 +00:00
Alyssa Rosenzweig
6f3a761e81 pan/bi: Don't duplicate texture op cases
These two switches are redundant.

Furthermore, bi_tex_op could previously assume its input was a supported texop,
so it returned undefined values for unsupported texops. Now, without the guard
in front of it, bi_tex_op should check for supported texops, so we need to drop
the unsupported texops from the switch.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:45 +00:00
Alyssa Rosenzweig
f247f57f52 panfrost: Use 0/~0 boolean for MSAA sysval
For consistency with NIR.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:45 +00:00
Alyssa Rosenzweig
47ed0b41be nir: Add Mali load_output taking converison
Mali's LD_TILE instruction (mapping to NIR's load_output) requires a "conversion
descriptor" specifying how to convert from the register foramt to the tilebuffer
format. To implement framebuffer fetch on OpenGL without shader variants, we
generate these descriptors in the driver and pass them in a uniform. However, to
comply with the Ekstrand Rule, we can't have magically materialized system
values -- they should come only from the NIR where the driver can lower as it
pleases (e.g. PanVK can lower to a constant because it knows the framebuffer
format at pipeline create time). Add intrinsics to model this.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:45 +00:00
Alyssa Rosenzweig
60bfc4deb9 nir: Add Panfrost intrinsics to lower sample mask
We want to lower this in NIR instead of the backend IR to give the driver a
chance to lower the "is multisampled?" system value, which makes more sense to
do in NIR. This gets rid of one of the magic compiler materialized sysvals.

Plus, this will let us constant fold away the lowering in Vulkan when we know
that the pipeline is single-sampled / multi-sampled.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20906>
2023-03-23 23:53:45 +00:00
Mark Janes
8eceff48cd intel/dev: use GFX_VERx10 to detect genX compilation
Depending on the ordering of includes, GFX_VER may not defined for
intel_device_info.h.  The failure mode of this case is silent:
BITSET_TEST will be called when it could be compiled out.

GFX_VERx10 should be used in place of GFX_VER.  GFX_VERx10 is defined
by a compiler flag, and is always present for genX compilation units.

Fixes: 3c9a8f7a6d ("intel/dev: generate helpers to identify platform workarounds")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21908>
2023-03-23 23:23:52 +00:00
Mark Janes
8c78dd6320 intel/dev: fix macro naming convention in gen_wa_helpers.py
intel_device_info.h tests macros in the form `INTEL_WA_{id}_GFX_VER`.
gen_wa_helpers.py produced macros in the form `INTEL_GFX_VER_WA_{id}`

Change the generated code to follow intel_device_info.h

Fixes: 3c9a8f7a6d ("intel/dev: generate helpers to identify platform workarounds")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21908>
2023-03-23 23:23:52 +00:00
Mark Janes
52c71cf959 intel/dev: fix macro string concatenation for INTEL_WA_{id}_GFX_VER
`INTEL_WA_##id_GFX_VER` evaluates to `INTEL_WA_id_GFX_VER`
instead of numbered identifiers like `INTEL_WA_220579888_GFX_VER`.

Fixes: 3c9a8f7a6d ("intel/dev: generate helpers to identify platform workarounds")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21908>
2023-03-23 23:23:52 +00:00
Jesse Natalie
4d48fc6fe5 dzn: Use mesa_loge for DXIL validation errors
This allows them to be printed to OutputDebugString

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
7750e23c7f dzn: Enable variable size bindings
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
19818ecc37 dzn: Support descriptor indexing via bindless
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
c93dda6bee dzn: Add a debug option for enabling bindless mode
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
ebc8a86df1 dzn: Apply bindless lowering when compiling pipelines
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
35a789dbb7 dzn: Only bind descriptor sets up to the used amount of the current layout
Prevents setting a root SRV into a slot that's not declared as an SRV
in the root signature if a set is bound into a higher slot from a previous
draw/dispatch op.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
a227ef2983 dzn: Ensure root signatures are re-bound after a meta op
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
7edff267cc dzn: When binding a bindless root signature, bind descriptor heaps first
The D3D spec says it must be so, and not doing this causes problems
on some hardware.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
8d52a480fe dzn: Add a binding classification in the pipeline layout remapping
This is needed so that we can handle two special cases:
* Dynamic buffer data is allocated out of a command-buffer-owned buffer,
  rather than a descriptor-set-owned buffer, so the remapping puts them
  in their own register space.
* Static samplers should be left alone and not converted to bindless.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
8bd5fbf8ed dzn: Bind buffers for bindless descriptor sets
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
5f61e66024 dzn: Use separate dirty bits for descriptor sets/dynamic buffers
We'll be able to take advantage of this granularity in bindless mode

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
1846426195 dzn: Don't dirty bindings if root signature doesn't change
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
5d2b4ee4f4 dzn: Allocate descriptor sets in buffers for bindless mode
Modify the root signature stored in the pipeline layout too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
a1881bc7ee dzn: Delete unused function
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
ac0b0731ea dzn: Remove defragmenting of descriptor pools
Rather than trying to perfectly defrag, let's just allow re-use.
When a set is allocated for the first time, it locks in its range of
the heap that it'll use. If the last set in the heap is used, then
those descriptors go back to being free, but if a set in the middle
of the heap is freed, those descriptors remain assigned to that set.
A later allocation attempt can reclaim them, as long as the new set
fits.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
079f3deafb dzn: When bindless, only allocate one descriptor per layout entry
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
4c4431b674 dzn: Add initial bindless infrastructure
When operating in "bindless" mode, the device will own 2 descriptor
heaps, one for views, and one for samplers. Every time a view is
created (image view, buffer view), a slot is allocated for it out
of the device view heap for each usage type (sampled vs storage).

Then, in a future change, descriptor sets will just contain view/
sampler indices instead of actual descriptors. Instead of copying
these to a cmdbuf-owned descriptor heap, we can directly bind the
descriptor set as a buffer. We'll also modify shaders to perform
an indirection and index into the device heap.

Buffers also get views set up on creation. In a perfect world, we
could just put addresses/sizes in the descriptor set, but DXIL
doesn't support loading from addresses, we need descriptors. When
robust buffer access is disabled *or* descriptor set buffer views
reference the remainder of the buffer, we can just re-use a view
from the buffer and use an offset.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
f977c10f3c dzn: Skip setting up UAVs for depth resources
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
60b3637e76 dzn: Set up SRV descs for 3D textures correctly
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
0bf1a43601 dzn: Don't use plane slice 1 for depth+stencil SRVs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:44 +00:00
Jesse Natalie
442d456b28 dzn: Consistently order depth formats before stencil
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
4c5100f94a dzn: Put UAVs first for storage images/buffers in descriptor tables
When running in a bindless mode, we won't ever be using SRVs for these.
Change terminology for determining descriptor offsets from "writable"
to "alt" to match naming already used elsewhere.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
8887852d20 dzn: Add some docs around descriptor sets and remove redundant/unused data
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
492d61cfbb dzn: Fix a leak in descriptor set layout creation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
3f2e13eaf8 dzn: Remove descriptor heap type from descriptor heap wrapper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
599abf5b1a dzn: Remove device pointers from descriptor heaps
A future change is going to add descriptor heaps *to* the dzn_device,
and having 3x ID3D12Device pointers in a single object just seems
wrong. All of the callers already had a device, so just pass it
along where needed.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
79ef6e4e8f spirv2dxil: Support descriptor indexing capabilities
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
e0a090adfd spirv2dxil: Only lower readonly images to SRVs when the option is set
This handles the case where readonly is explicitly marked in the shader,
rather than just inferred based on opt_access.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
b125575f95 spirv2dxil: Add a pass to lower deref tex/image and vulkan ubo/ssbo to bindless
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
4f31d1a7e0 microsoft/compiler: Update header docs for binding modes supported by compiler
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
4fc7d2480a microsoft/compiler: Use store_dest instead of store_dest_value more
The 16bit SSBO load support missed setting the 16bit shader flag.
Make it harder to miss that by only using store_dest_value for things
that don't have a type.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
ce004e6391 microsoft/compiler: Support descriptor heap indexing for UBO/SSBO
Treat load_vulkan_descriptor on an input that didn't come from
vulkan_resource_index as a descriptor heap index instead of a
binding index.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
88e4edeb2b microsoft/compiler: Handle "bindless" image/tex sources as heap indices
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
068f1ada9a microsoft/compiler: Split handle annotation into two parts
The first part gets the resource props struct, and the second
actually emits the annotate instruction. Later changes will
get the resource props struct from different sources.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
6220fb454f microsoft/compiler: Add helpers for getting res_props structs
Currently we can get one by looking up already-emitted resource
metadata, but in the future we'll want to be able to get this
info from a call site alone. Depending on the type of call site,
we'll have different sets of info, so add helpers for the
various different kinds of call sites we can support.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
abc2412ccc microsoft/compiler: Refactor type -> resource kind helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
a838f095ef microsoft/compiler: Only set typed UAV load feature bit for multi-comp loads
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Jesse Natalie
273a7cf0e2 microsoft/compiler: Fix setting bit 31 in feature flags
Fixes: a84208ee ("microsoft/compiler: Fill out and sort the shader/module flags")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21913>
2023-03-23 21:48:43 +00:00
Mark Janes
33d03e57ad intel/fs: use generated helpers for Wa_14013363432 / Wa_14012688258
Wa_14013363432 is a clone of Wa_14012688258.  It does not apply to all
gfx 12.5 platforms.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21745>
2023-03-23 19:13:09 +00:00
David Heidelberg
c029b1499f freedreno/decode: fix possible overflow
```
../src/freedreno/decode/rddecompiler.c:242:65: error: 'sscanf' may overflow; destination buffer in argument 3 has size 32, but the corresponding specifier may require size 33 [-Werror,-Wfortify-source]
         if (sscanf(info->name, "%32[A-Z0-6_][%32[x0-9]].%32s", reg_name,
                                                                ^
../src/freedreno/decode/rddecompiler.c:243:21: error: 'sscanf' may overflow; destination buffer in argument 4 has size 32, but the corresponding specifier may require size 33 [-Werror,-Wfortify-source]
                    reg_idx, field_name) != 3) {
                    ^
../src/freedreno/decode/rddecompiler.c:243:30: error: 'sscanf' may overflow; destination buffer in argument 5 has size 32, but the corresponding specifier may require size 33 [-Werror,-Wfortify-source]
                    reg_idx, field_name) != 3) {
                             ^
```

Reviewed-by: Rob Clark <robclark@freedesktop.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22015>
2023-03-23 18:56:34 +00:00
David Heidelberg
6c5888b890 ci/freedreno: do not build tools executables without explicitly enabling them
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22015>
2023-03-23 18:56:34 +00:00
Jesse Natalie
79725115c6 d3d12: Remove now-unused UAV format from shader info
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22093>
2023-03-23 18:34:52 +00:00
Jesse Natalie
4f56f2188c d3d12: Fix buffer SRV/UAV creation
Get the format right for UAVs (using the image view instead of
relying on the shader having a format specified) and limit the size
to the API-reported size.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22093>
2023-03-23 18:34:52 +00:00
Jesse Natalie
efe3f246b1 d3d12: Report correct texel buffer max size
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22093>
2023-03-23 18:34:52 +00:00
Jesse Natalie
78fc1197eb microsoft/compiler: Handle writable buffer UAV size queries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22093>
2023-03-23 18:34:52 +00:00
Sil Vilerino
0016b8c9ea d3d12: Encode - Only upload headers when written headers size is > 0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22091>
2023-03-23 18:15:44 +00:00
Sil Vilerino
cd575ff72b d3d12: Encode H264/HEVC - Do not write PPS unless different from active
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22091>
2023-03-23 18:15:44 +00:00
Sil Vilerino
4cb76bd280 d3d12: H264/HEVC Encode - Set both VBV InitialCapacity/Size in CBR Rate Control to same value when requested
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22091>
2023-03-23 18:15:44 +00:00
Rob Clark
75d029b717 freedreno/rnn: Fix reg names for regs with variants
Fixes reg names with headergen2, so that if we have separate a6xx and
a7xx variants for a register we get REG_A6XX_foo and REG_A7XX_foo
instead of both being REG_A6XX_foo.  Otherwise generated headers for the
kernel wouldn't compile.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22035>
2023-03-23 17:54:57 +00:00
Amber
8da3494d53 freedreno, nir, ir3: implement GL_EXT_shader_framebuffer_fetch
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21260>
2023-03-23 16:59:56 +00:00
Amber
ca92183845 nir: Add memory coherency information to shaders.
Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21260>
2023-03-23 16:59:56 +00:00
Amber
1462da2a70 nir: allow nir_lower_fb_read to support multiple render targets
Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21260>
2023-03-23 16:59:56 +00:00
Connor Abbott
c54b8dfe67 tu: Fix tile_align_h on a650
This matches what the blob on a650 does and fixes errors when
calculating the tile size due to tile_align_h not being a power of two.

Fixes: 60bc7c0e ("freedreno: Specify GMEM tile alignment per GPU")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22088>
2023-03-23 15:47:43 +00:00
Eric Engestrom
f5d325a8d0 v3d: add link to issue investigating failure
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22089>
2023-03-23 15:22:05 +00:00
Boyuan Zhang
2c1da7fbde frontends/va: check decoder in va surface call
Add a check to see if decoder is valid before using it. Currently we
only support decode and encode operations, return unsupported error
for all other entrypoints.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21905>
2023-03-23 10:14:14 -04:00
José Roberto de Souza
3f544150bb anv: Implement Xe version of execute_simple_batch()
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22058>
2023-03-23 13:27:39 +00:00
José Roberto de Souza
41cba37c4a anv: Handle Xe queue/engine priority
As Xe requires engine info, it is not possible to fetch max priority
from anv_physical_device_get_parameters() call chain, so here
anv_xe_physical_device_max_priority_update() was added.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22058>
2023-03-23 13:27:39 +00:00
José Roberto de Souza
45cb2819f6 anv: Implement Xe version of check_status()
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22058>
2023-03-23 13:27:39 +00:00
José Roberto de Souza
13874840bf anv: Create Xe engines
Xe engine is not equal to hardware engine, it is just a submission
queue that will be scheduled in the hardware engine during process
time slice of the GPU.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22058>
2023-03-23 13:27:39 +00:00
José Roberto de Souza
0818d18d48 anv: Replace I915_ENGINE_CLASS_VIDEO by INTEL_ENGINE_CLASS_VIDEO
Using the value that is not dependent on the KMD uapi.

Not marking as a fixes because both have the same value, so we
don't need a backport.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22058>
2023-03-23 13:27:39 +00:00
Timur Kristóf
e743ddbbb4 radv: Enable mesh shading on GFX11.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
59a4fb6af7 ac/nir/ngg: Store special MS outputs in attribute ring for PS to read.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
b2a71c56d9 ac/nir/ngg: Fix mesh shader layer on GFX11.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
9d2f5a4ada ac/nir/ngg: Split legacy workgroup index function.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
240e16fc8e ac/nir/ngg: Use attribute ring for mesh shader params.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
0af22af548 ac/nir/ngg: Clarify mesh shader scratch ring.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
36edbebe8b radv: Adjust mesh draw packets for GFX11.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
9c1571bc56 radv: Include per-prim params in NUM_INTERP on GFX11.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
500f3e0bde radv: Use PRIM_ATTR for PS inputs on GFX11.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
09b81c7570 radv: Add extra offset to per-prim params.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
552614e15a radv: Use per-prim params in has_param_exports.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
d0f25109f6 radv: Add per-prim attributes to ring_attr stride.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
7cc9a72913 radv: Use new mesh shading packet defines.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
2023-03-23 11:49:35 +00:00
Timur Kristóf
da3eb6e6a5 ac: Add more defines for mesh shading packets.
Add some set macro defines for mesh shading packets.
The naming convention is:
S_(packet opcode)(dword index)_FIELD_NAME

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21409>
2023-03-23 11:49:35 +00:00
David Heidelberg
781c088d92 ci: bump Alpine to 3.17 (again)
Now with fixed ccache 4.7.5.

`ccache` changelog:
Disabled the inode cache by default again since there have reports of ccache
processes hanging on futex calls related to the inode cache.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22037>
2023-03-23 11:19:56 +00:00
Juan A. Suarez Romero
2413cb2965 v3d: fix condition for EZ disabling when stencil on
When stencil is enabled and it isn't non-op, Early-Z must be disabled.

The condition that checks this for stencil[0] is correct, but the one
for stencil[1] is wrong: it uses an "and" instead of "or" condition.

This affects dEQP-GLES3.functional.fragment_ops.interaction.basic_shader.14

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22081>
2023-03-23 08:51:10 +00:00
Lionel Landwerlin
7941db652e intel/dev: fold Gfx12 URB entries in Gfx12 HW info
Also add a non-zero URB size for intel_stub_gpu

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21949>
2023-03-23 08:08:49 +00:00
Lionel Landwerlin
25cb4805f5 intel/devinfo: initialize pci_device_id with from_pci_id()
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Suggested-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21949>
2023-03-23 08:08:49 +00:00
Lionel Landwerlin
19c9391a2c intel/devinfo: dedicated entries for XeHP
Also fixing the max URB entries for VS stage.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reported-by: Chuansheng Liu <chuansheng.liu@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21949>
2023-03-23 08:08:49 +00:00
Lionel Landwerlin
de5ee891f0 intel/dev: use generated WA helpers for Wa_22012575642
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21949>
2023-03-23 08:08:49 +00:00
Lionel Landwerlin
9b1660c727 intel/devinfo: printout URB entries
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21949>
2023-03-23 08:08:49 +00:00
Lionel Landwerlin
a42a5bf87e intel/devinfo: add an option to pick platform to print
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21949>
2023-03-23 08:08:49 +00:00
Jesse Natalie
24d5bdbb6e ci/windows: Update warp to 1.0.5
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22034>
2023-03-23 07:07:29 +00:00
Qiang Yu
0cd89a27ed ac/llvm: add missing type convert for nir_load_buffer_amd
Fixes: afcbccb078 ("ac/llvm: implement ACCESS_USE_FORMAT_AMD as buffer_load/store_format")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22043>
2023-03-23 01:55:20 +00:00
Qiang Yu
5ddb46e963 ac/llvm: respect channel_type when ac_build_buffer_load
Mainly for nir_load_smem_buffer_amd which pass i32 for this parameter.

Fixes: 8030fbcf16 ("nir,ac/llvm: add nir_load_smem_buffer_amd")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22043>
2023-03-23 01:55:20 +00:00
Emma Anholt
772cacff32 glsl: Write a new test for GLSL and NIR mediump lowering.
The mediump lowering tests are important for poking at the lowering pass
behavior, since you can't really assert the behavior in any given driver,
given that the GLSL spec allows any mediump op to be done in highp.

But, in hacking on mediump lowering, I wanted several things that the old
test couldn't do:

- Be able to assert about the actual NIR code we expect to generate for a
  hypothetical driver (important if other compiler stages might do invalid
  transformations like eliminating highp temps, or if we were to move the
  lowering after GLSL IR)
- Run faster (gtest unit tests rather than python forking off the standalone
  glsl compiler per testcase).
- Express expectations with a lot less escaping of typical syntax.
- High-quality logs for displaying failures.

This new test does all of that, I think, though I haven't converted all of
the unit tests over yet.  In converting, I dropped some of the
combinatorial explosion for float/int variations, instead only doing so
when it gets at some different code path (default precision flags).  I've
also included some new tests I wrote in the process of writing my proposed
gl_nir mediump lowering.

Even if the conversion isn't complete, getting these tests to run faster
is probably a good idea on its own, for anyone iterating running Mesa's
unit tests (80 tests in 25ms, compared to 109 tests in 1.5s!).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21886>
2023-03-22 22:52:45 +00:00
Emma Anholt
41f51fe815 glsl/standalone: Make all standalone contexts have NewProgram set.
It was in the standalone compiler but not unit tests.  Only the standalone
compiler had done linking and needed it, so far.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21886>
2023-03-22 22:52:45 +00:00
Emma Anholt
9b5326bdc1 glsl/standalone: Pull out a helper function for adding GLSL source shaders.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21886>
2023-03-22 22:52:45 +00:00
Emma Anholt
1c47609888 glsl/standalone: Pull program create/destroy out to a public function.
For reuse with unit tests.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21886>
2023-03-22 22:52:45 +00:00
Rob Clark
79ac6197a9 freedreno/a6xx: Restore mode
We set the "mode" to 1 for CS because we want CP_SET_DRAW_STATE to
immediately execute the state groups.  But in the 3d path, we don't
restore the value in the sysmem path.  This was causing GPU faults
on 7c3 and presumably other a6xx gen4 things.  But somehow not on
a6xx gen1.

Let's just set it as part of initial state restore where we are
ensuring that the GPU is in a sane state.

Fixes: dec49ec50a ("freedreno/a6xx: Move CS state to PROG state group")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22080>
2023-03-22 20:53:17 +00:00
Eric Engestrom
8af8c5bd07 ci/docs: start documenting ci_run_n_monitor.py
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22079>
2023-03-22 20:48:14 +00:00
Tapani Pälli
6538c5bcd4 intel/fs: restore message layout changes for cube array
This reverts commit bc04e2daca that handled the change as a WA while
this is about a new feature, change done in message layout. Patch also
changes the original comment to not refer to Wa but bspec page.

Fixes: bc04e2daca ("intel/fs: use generated helpers for Wa_1209978020 / Wa_18012201914")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mark Janes <markjanes@swizzler.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22068>
2023-03-22 20:18:11 +00:00
Oleksii Bozhenko
3d2d4728aa Move combining clip and cull optimization before linking
As far gl_nir_link_glsl fills xfb data we should do it after lowering clip and cull in order to get correct locations.

Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7152
Signed-off-by: Oleksii Bozhenko <oleksii.bozhenko@globallogic.com>

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21625>
2023-03-22 19:01:40 +00:00
Marek Olšák
48e218b49d egl: don't expose swrast device if swrast is not built
This fixes piglit/egl_ext_device_base without swrast.

Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20951>
2023-03-22 18:23:37 +00:00
Marek Olšák
5952715064 egl: reorder code in _eglQueryDevicesEXT, add *swrast variable
This is a preparation for the next commit. No change in behavior.

Reviewed-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20951>
2023-03-22 18:23:37 +00:00
Eric Engestrom
63f1b4531b ci: deduplicate compiler wrappers
Signed-off-by: Eric Engestrom <eric@igalia.com>
Suggested-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21997>
2023-03-22 17:28:07 +00:00
Eric Engestrom
16d5f65502 ci: always use the -Werror wrapper
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21997>
2023-03-22 17:28:07 +00:00
Eric Engestrom
dc53b39173 ci: add linker wrapper for clang
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21997>
2023-03-22 17:28:07 +00:00
Eric Engestrom
6a0f12ba5f ci: centralize detection of ccache in link-werror wrapper
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21997>
2023-03-22 17:28:07 +00:00
Martin Roukala (né Peres)
ab46f6974b zink/ci: add a test to the fails list
KHR-GL46.multi_bind.dispatch_bind_image_texture has been failing on
both Navi10 and VanGogh, so let's document that.

Zmike says he could not reproduce the fails on a newer version of
glcts, so the next release should address this issue.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22055>
2023-03-22 16:42:29 +00:00
Martin Roukala (né Peres)
09ea80466a radv/ci: update the navi10 expectations
As part of https://gitlab.freedesktop.org/tanty/mesa-valve-ci/-/jobs/38416444,
we saw the following flakes:

 - dEQP-VK.dynamic_rendering.primary_cmd_buff.basic.2_cmdbuffers_resuming
 - dEQP-VK.dynamic_rendering.primary_cmd_buff.basic.contents_secondary_2_primary_cmdbuffers_resuming
 - dEQP-VK.pipeline.fast_linked_library.extended_dynamic_state.two_draws_static.topology_line

And the following failure (seen 4/4 times in the run):

 - dEQP-VK.draw.dynamic_rendering.primary_cmd_buff.linear_interpolation.offset_min_2_samples,Fail

Samuel told me that these are usual flakes, so let's document all of them.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22055>
2023-03-22 16:42:29 +00:00
Rohan Garg
5e8866a35a anv,hasvk: cleanup unused enum
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22070>
2023-03-22 15:00:16 +00:00
Mike Blumenkrantz
3eea22039c zink: track whether zsbuf is unused
zink_is_zsbuf_used updates dynamically, so its return may not reflect
the actual state of the current renderpass

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22054>
2023-03-22 13:00:30 +00:00
Italo Nicola
2362e02f29 panfrost: fix strict-aliasing violations when packing fb ptrs
Compilers are free to make the assumption that pointers don't violate
strict aliasing. If that assumption is incorrect, as it is with the
framebuffer pointer packing code here, the job can fail.

This depends heavily on the compiler and optimization levels, so it's
hard to reproduce, but it did happen for at least two users running with
-O2 on gcc.

Fixes: 67cbbf9417 ("panfrost: Use framebuffer pointer XML")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8627
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21991>
2023-03-22 11:50:36 +00:00
Erico Nunes
b6d5cb0d39 lima/ci: restore swap buffers egl tests
With the weston idle-time issue fixed, these no longer timeout and
can be enabled again.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22012>
2023-03-22 11:12:18 +00:00
Rhys Perry
e99ba0b6d3 nir/range_analysis: use perform_analysis() in nir_analyze_range()
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/21381>
2023-03-22 09:24:18 +00:00
Rhys Perry
2b03db39b3 nir/range_analysis: use perform_analysis() in nir_unsigned_upper_bound()
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/21381>
2023-03-22 09:24:18 +00:00
Rhys Perry
29a38b09cf nir/range_analysis: add helpers for limiting stack usage
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/21381>
2023-03-22 09:24:18 +00:00
Rhys Perry
2145cf3dd1 nir/range_analysis: add missing masking of shift amounts
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Fixes: 72ac3f6026 ("nir: add nir_unsigned_upper_bound and nir_addition_might_overflow")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21381>
2023-03-22 09:24:18 +00:00
Rhys Perry
63e8f77d8e util/dynarray: allow an initial stack allocation to be used
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/21381>
2023-03-22 09:24:18 +00:00
Jason Ekstrand
87efb9c3b3 intel/isl: Support Yf/Ys/Tile-64 in isl_surf_get_image_offset_sa
All that's really needed here is to handle the array offsetting by using
an Z or array offset instead of the Y offset.

This patch originally changed get_image_offset_sa_gfx9_1d(), but since
we only use linear with the 1d case, it was dropped.

Rework:
 * Jordan: Include ISL_TILING_64 as well
 * Jordan: Drop change to get_image_offset_sa_gfx9_1d as
   recommended by Nanley

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21113>
2023-03-22 08:32:52 +00:00
Samuel Pitoiset
d4bce9508b radv: use common GetBufferMemoryRequirements2()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22047>
2023-03-22 07:50:04 +00:00
Eric Engestrom
099a537e51 v3d/ci: group dEQP-GLES3.functional.texture.specification.teximage2d_pbo.* flakes and add another one
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22063>
2023-03-22 07:24:28 +00:00
Alyssa Rosenzweig
52e28d6e6e ir3: Use umod_imm
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22010>
2023-03-22 06:18:18 +00:00
Alyssa Rosenzweig
968c5c6334 radv: Use umod_imm
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22010>
2023-03-22 06:18:18 +00:00
Alyssa Rosenzweig
7b0133b30f v3d,v3dv: Use udiv_imm/umod_imm
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22010>
2023-03-22 06:18:18 +00:00
Alyssa Rosenzweig
e80f209df9 blorp,anv,hasvk: Use umod_imm
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22010>
2023-03-22 06:18:18 +00:00
Alyssa Rosenzweig
2933af7576 nir/builder: Add nir_umod_imm helper
Like nir_udiv_imm, we can do a similar power-of-two trick. It's also really
convenient.

v2: Assert reasonable bounds on the modulus (Faith).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> [v1]
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> [v1]
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22010>
2023-03-22 06:18:18 +00:00
Georg Lehmann
cec04adcee nir: optimize i2f(f2i(fsign))
Foz-DB Navi10:
Totals from 3013 (2.23% of 134906) affected shaders:
VGPRs: 138068 -> 136964 (-0.80%); split: -0.80%, +0.00%
CodeSize: 10476416 -> 10391800 (-0.81%)
MaxWaves: 79118 -> 80088 (+1.23%)
Instrs: 1963227 -> 1945003 (-0.93%)
Latency: 24734883 -> 24649279 (-0.35%); split: -0.39%, +0.05%
InvThroughput: 6366777 -> 6334735 (-0.50%); split: -0.50%, +0.00%
VClause: 36845 -> 36882 (+0.10%); split: -0.26%, +0.36%
SClause: 59249 -> 59273 (+0.04%); split: -0.25%, +0.29%
Copies: 108570 -> 108501 (-0.06%); split: -0.19%, +0.13%
PreSGPRs: 105371 -> 105862 (+0.47%)
PreVGPRs: 117675 -> 116625 (-0.89%); split: -0.89%, +0.00%

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22003>
2023-03-22 05:34:55 +00:00
Jarred Davies
a7b34ad8f2 pvr: Don't allocate/upload 0 size coeff programs
Fixes assert seen in dEQP-Vk.api.smoke.triangle

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>

Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22051>
2023-03-22 04:15:57 +00:00
Frank Binns
49ed1e55d8 pvr: fix clang-format issue
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22056>
2023-03-22 03:58:19 +00:00
David Heidelberg
7dcd02bd32 aco: drop leftover variable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8652
Fixes: 44fdd2ebcb ("aco: end reduce tmp after control flow, when used within control flow")

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22011>
2023-03-22 03:39:56 +00:00
Emma Anholt
f39ffc6911 ci/etnaviv: Get the gc2000_piglit manual job mostly working.
It was timing out, and the xfails were rather stale.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22039>
2023-03-21 23:46:13 +00:00
Emma Anholt
dfec80aed1 ci/hasvk: Update some xfails from the 8-sample fast clear disable.
Fixes: e509afacf3 ("hasvk: Disable non-zero fast clears for 8xMSAA images")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22039>
2023-03-21 23:46:13 +00:00
Emma Anholt
ecca3b9655 ci/crocus: Update expectations from VK CTS 1.3.5.0.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22039>
2023-03-21 23:46:13 +00:00
Emma Anholt
f2c356a095 ci/iris: Update more manual job xfails from the Wayland build change.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22039>
2023-03-21 23:46:13 +00:00
Samuel Pitoiset
cb5701eed9 radv: implement VK_KHR_map_memory2
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22032>
2023-03-21 23:08:03 +00:00
Samuel Pitoiset
cd59db8c46 radv: pass radv_shader to radv_shader_need_indirect_descriptor_sets()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21878>
2023-03-21 20:36:13 +00:00
Samuel Pitoiset
0d95660a03 radv: pass radv_ray_tracing_pipeline to radv_rt_pipeline_compile()
The base.base is redundant but this will allow us to move the shaders
array out of radv_pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21878>
2023-03-21 20:36:13 +00:00
Samuel Pitoiset
88137cd710 radv: rework dumping shaders when a GPU hang is reported
Preliminary work for moving the shaders array outside of radv_pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21878>
2023-03-21 20:36:13 +00:00
Samuel Pitoiset
444c5887c2 radv: pass radv_shader to radv_dump_shader_stats()
Preliminary work for moving the shaders array outside of radv_pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21878>
2023-03-21 20:36:13 +00:00
Samuel Pitoiset
0514c015e6 radv: use a separate compute path in radv_flush_constants()
radv_get_shader() will be a radv_graphics_pipeline only function.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21878>
2023-03-21 20:36:12 +00:00
Samuel Pitoiset
e7bbd610b8 radv: pass shader/base_reg to radv_emit_userdata_address()
Preliminary work for moving the shaders array outside of radv_pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21878>
2023-03-21 20:36:12 +00:00
Samuel Pitoiset
1e3cac8d5e radv: pass shader/base_reg to radv_emit_inline_push_consts()
Preliminary work for moving the shaders array outside of radv_pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21878>
2023-03-21 20:36:12 +00:00
Samuel Pitoiset
c2e71729af radv: pass shader/base_reg to radv_emit_descriptor_pointers()
Preliminary work for moving the shaders array outside of radv_pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21878>
2023-03-21 20:36:12 +00:00
Samuel Pitoiset
d7c5b6fb94 radv: replace radv_lookup_user_sgpr() by radv_get_user_sgpr()
radv_get_user_sgpr() no longer relies on radv_pipeline which is
another step for moving the shaders array outside of it.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21878>
2023-03-21 20:36:12 +00:00
Samuel Pitoiset
4066e3a951 radv: stop using radv_get_shader_shader() for task shaders
radv_get_shader() should only be used for VS or TES, no need to add
another indirection for task shaders. While we are at it, rename
compute_shader to task_shader.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21878>
2023-03-21 20:36:12 +00:00
Alyssa Rosenzweig
9169025d06 gallium: Fix u_stream_outputs_for_vertices with QUADS
Per the spec. This helper is only used in nv50 and panfrost, the latter is known
to have a completely broken transform feedback implementation and I'd be
unsurprised if the same is true for nv50. So unsurprising that compatibility
profile interaction was missed.

This is part of the Piglit ext_transform_feedback-tessellation quads puzzle.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22013>
2023-03-21 18:33:42 +00:00
Erik Faye-Lund
69cbc2e7ee docs: remove old thanks-article
This article is so out of date it's of no real use any more, and
updating it seems quite pointless. Let's just move it to the graveyard,
and forward any readers to the version we have in the amber-release.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22028>
2023-03-21 16:39:28 +00:00
Erik Faye-Lund
1c69fbff47 docs: move developers article to main website
This isn't content that relates directly to a specific release of Mesa,
and it's also quite out-of-date. Let's move it to the main mesa website
instead, where we have an updated version.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22028>
2023-03-21 16:39:28 +00:00
Timur Kristóf
d044eeb658 ac/nir/ngg: Rename repacked variables to clarify their name.
Signed-off-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/21995>
2023-03-21 15:47:32 +00:00
Timur Kristóf
5b50b9631c ac/nir/ngg: Create separate variable for repacked rel_patch_id.
This should be handled separately from the other repacked
variables, because it doesn't use a dword.

Signed-off-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/21995>
2023-03-21 15:47:32 +00:00
Timur Kristóf
30ce47cc00 ac/nir/ngg: Remove some superfluous variables.
These mostly existed because of the long name of the state variable
and are not really necessary.

Signed-off-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/21995>
2023-03-21 15:47:32 +00:00
Timur Kristóf
c22f9442f6 ac/nir/ngg: Rename state variables to "s".
It was a bad idea to give them a long name, let's correct it.

Signed-off-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/21995>
2023-03-21 15:47:32 +00:00
Timur Kristóf
0068dbee96 ac/nir/ngg: Move divergence analysis call to analyze_shader_before_culling.
It actually belongs there.

Signed-off-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/21995>
2023-03-21 15:47:32 +00:00
Timur Kristóf
a0a341f644 ac/nir/ngg: Split some functions out of save_reusable_variables.
To make the function a little easier to read and understand.

Signed-off-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/21995>
2023-03-21 15:47:32 +00:00
Timur Kristóf
091dffdfc9 ac/nir/ngg: Rename saved_uniform to reusable_nondeferred_variable.
We are planning to reuse more than just uniforms later,
hence let's clarify the name of these.

Signed-off-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/21995>
2023-03-21 15:47:32 +00:00
Timur Kristóf
c904c7dbf1 ac/nir/ngg: Remove usused lds_es enum values.
These were meant to explain the LDS layout, but
the actual LDS usage is better explained by:
ngg_nogs_get_culling_pervertex_lds_size().
Also add some comments there.

Signed-off-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/21995>
2023-03-21 15:47:32 +00:00
Erik Faye-Lund
1ca29408f1 docs/zink: clean up requirements-language
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22053>
2023-03-21 15:42:50 +00:00
Erik Faye-Lund
adc7170d85 docs/zink: mention vk1.2 mirror-clamp feature option
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22053>
2023-03-21 15:42:50 +00:00
Pierre-Eric Pelloux-Prayer
3f272fd15e ac/llvm: fix build with LLVM 17
This builds with LLVM 12 -> 17 and a running a simple app seems to work.

I couldn't test LLVM 11 because meson fails with:

    Looking for a fallback subproject for the dependency llvm (modules:
    bitwriter, engine, mcdisassembler, mcjit, core, executionengine,
    scalaropts, transformutils, instcombine, amdgpu, bitreader, ipo, native)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8297
Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22021>
2023-03-21 15:05:25 +00:00
Constantine Shablya
4659a94cfe vulkan: depend idep_vulkan_runtime_headers on vk_physical_device_features.h
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8643
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21958>
2023-03-21 14:25:40 +00:00
Constantine Shablya
46c9e84ead vulkan: fix building with python3.8
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8640
Reviewed-by: Ricardo Garcia <rgarcia@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21958>
2023-03-21 14:25:40 +00:00
Samuel Pitoiset
5082b6b034 radv: add support for caching PS epilogs
For PS epilogs created at link time because libraries are still not
cached.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21897>
2023-03-21 13:53:59 +00:00
Samuel Pitoiset
228afe1a2f radv: make radv_shader_part_create() non-static
It will be used when creating shaders from the cache.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21897>
2023-03-21 13:53:59 +00:00
Samuel Pitoiset
83c20b95dd radv: allow to return the PS epilog binary to the pipeline
To add it to the shaders cache.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21897>
2023-03-21 13:53:59 +00:00
Samuel Pitoiset
eba315d2bf radv: upload prologs/epilogs as part of radv_shader_part_create()
Don't need to duplicate this code.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21897>
2023-03-21 13:53:59 +00:00
Samuel Pitoiset
aa15d64949 radv: store the total radv_shader_part_binary size
Similar to radv_shader. This will be used for the shaders cache.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21897>
2023-03-21 13:53:59 +00:00
Samuel Pitoiset
aec9fd394f radv: store spi_shader_col_format to radv_shader_part_binary
For PS epilogs in the cache.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21897>
2023-03-21 13:53:58 +00:00
Samuel Pitoiset
a455e0c99f radv: stop storing the binary as part of radv_shader_part
It's unnecessary to keep a pointer to the binary.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21897>
2023-03-21 13:53:58 +00:00
Samuel Pitoiset
2803b786f0 radv: remove set but never used num_preserved_sgprs
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21897>
2023-03-21 13:53:58 +00:00
Tapani Pälli
415b824bc6 iris: implement occlusion query related Wa_14017076903
Fixes artifacts on some games that relied on occlusion query
results when no PS or depth buffers are bound.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21721>
2023-03-21 12:56:51 +00:00
Tapani Pälli
c34916f841 anv: implement occlusion query related Wa_14017076903
Fixes artifacts on some games that relied on occlusion query
results when no PS or depth buffers are bound.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21721>
2023-03-21 12:56:51 +00:00
Juan A. Suarez Romero
c10a9372d6 v3d: implement NV_conditional_render extension
The hardware doesn't support native conditional rendering, so it is
implemented by software.

Code borrowed from Freedreno and Panfrost.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17373>
2023-03-21 12:31:24 +00:00
Juan A. Suarez Romero
94de8767aa v3d: include offset as part of streamout target
When dealing with multiple Transform Feedback buffers, each of them
needs to have their own offset, so when resuming from one to another we
know exactly were to continue adding primitives.

Fixes "spec@arb_transform_feedback2@change objects while paused (gles3)"
piglit test.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17373>
2023-03-21 12:31:24 +00:00
Juan A. Suarez Romero
6d21d563a1 v3d: cache pipe query results
As the BO storing the results is destroyed after getting the query
results, store the results in case requesting the results again.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17373>
2023-03-21 12:31:24 +00:00
Lionel Landwerlin
957186102f anv: report shader max dispatch width in pipeline props
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22014>
2023-03-21 11:53:04 +00:00
Lionel Landwerlin
2acc2f18ea intel/compiler: report max dispatch width statistic
Most tools looking at shader stats assume that there is only a single
resulting binary shader out of a single input. On Intel HW this is not
always the case. So having a statistic on each variant that reports
the maximum dispatch width helps showing improvement on a single
shader in terms of how large we manage to compile it.

For shaders that can be compiled in multiple SIMD width (like fragment
shaders), this will report the maximum dispatch width in the
statistics of each variants.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22014>
2023-03-21 11:53:04 +00:00
Iago Toral Quiroga
1e28f2a6f2 broadcom/compiler: track pending ldtmu count with each TMU lookup
And use this information when scheduling QPU to avoid merging
a new TMU request into a previous ldtmu instruction when doing
so may cause TMU output fifo overflow due to a stalling ldtmu.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22044>
2023-03-21 11:29:05 +00:00
Erik Faye-Lund
c09482b293 docs: fixup broken indentation
This extra indentation caused these to be inside <blockquote>-tags,
which obviously isn't what we want.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21927>
2023-03-21 11:24:13 +00:00
Erik Faye-Lund
46143ecc4c docs: escape a few more strings
This makes it more obvious that these are not just plain english words.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21896>
2023-03-21 11:19:41 +00:00
Erik Faye-Lund
331601abda docs: fixup broken envvar-role syntax
This needs a leading colon, otherwise it renders as "envvar:" followed
with environment variable using the c-expression role.

Fixes: 4c19426fd6 ("docs/envvars: add missing mesa disk cache envvars")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21896>
2023-03-21 11:19:41 +00:00
Samuel Pitoiset
f2aa0e80a0 radv: enable fullyCoveredFragmentShaderInputVariable on GFX9+
For vkd3d-proton Tier 3.

It's passing CTS and vkd3d-proton tests.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8311
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21497>
2023-03-21 08:44:09 +00:00
Samuel Pitoiset
8e84251cc7 radv: implement fullyCoveredFragmentShaderInputVariable
1 means INNER_COVERAGE.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21497>
2023-03-21 08:44:09 +00:00
Samuel Pitoiset
ebbb0d3f1b radv: enable SAMPLE_COVERAGE_ENA if the fully covered built-in is used
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21497>
2023-03-21 08:44:09 +00:00
Samuel Pitoiset
2a02f567aa radv: lower nir_intrinsic_load_fully_covered
The sample coverage VGPR input would be the inner coverage and 0 means
it's uncovered.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21497>
2023-03-21 08:44:09 +00:00
Samuel Pitoiset
bb7e0c4280 spirv,nir: add support for SpvBuiltInFullyCoveredEXT
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21497>
2023-03-21 08:44:09 +00:00
Samuel Pitoiset
cf2bc83c60 spirv: add SpvCapabilityFragmentFullyCoveredEXT
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21497>
2023-03-21 08:44:09 +00:00
Benjamin Cheng
e57caf9893 radv: initialize cmd_buffer upload list earlier
When cs allocation fails in radv_create_cmd_buffer,
radv_destroy_cmd_buffer is called before returning
VK_ERROR_OUT_OF_HOST_MEMORY. At that point, the upload list is not
initalized yet, so SIGSEGV will occur when trying to iterate through the
upload bo list. Initialize the upload list earlier to avoid this.

Signed-off-by: Benjamin Cheng <ben@bcheng.me>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22016>
2023-03-21 08:06:24 +00:00
Mike Blumenkrantz
270f9c0b06 zink: add ZINK_DEBUG=flushsync
this disables the submission thread

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22040>
2023-03-20 22:12:40 -04:00
Mike Blumenkrantz
6a45e0d991 zink: don't update fbfetch in db mode if inputAttachmentDescriptorSize==0
turnip gets away with this somehow, so silence harmless validation errors

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22040>
2023-03-20 22:12:22 -04:00
Mike Blumenkrantz
46212427f9 zink: rework handling of unordered->ordered write buffer barriers
this improves handling for barriers that originate from a write in the
unordered cmdbuf, adding tracking to resources to better determine access
in the unordered cmdbuf and then utilizing that to generate a single split
memory barrier added at the end of the unordered cmdbuf for all the buffers
written to on that cmdbuf

the next step will be to also merge the read access down onto the end-of-cmdbuf
barrier so that all stream upload-type functionality becomes a single barrier

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Mike Blumenkrantz
e83513832b zink: always set sampler layouts when unbinding fb images while rp optimizing
this may or may not always be accurate, but in the cases where it is, it should
avoid some renderpass splitting, and in the cases where it isn't, there may
already be issues

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Mike Blumenkrantz
c2b3c7b6be zink: only run post-fb-unbind layout stuff if the resource isn't being destroyed
if refcount==1, the resource won't be used any further, and all the code
in this block is only for resources that will be used as samplers,
so don't run any of it

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Mike Blumenkrantz
b442ea4700 zink: add an assert to ensure zsbuf invalidation doesn't break rendering
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Mike Blumenkrantz
ad9a5c252a zink: force unordered_write=false when binding image descriptors
there's no way to link up image layouts between the unordered cmdbuf
and the main one, so if an op is promoted to unordered after an image
is used as a descriptor, the layout will be broken

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Mike Blumenkrantz
eaeb1350be zink: fix unordered access for image descriptors
previously the unordered access flags would be set before the deferred
barrier was added, which would guarantee no descriptor barriers could
be deferred and thus terminate renderpasses any time a new descriptor
was bound that was both an image and needed a layout change

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Mike Blumenkrantz
5018bc1358 zink: add batch refs for framebuffer surfaces on bind and ref update
if this scenario occurs:

* bind fb on ctx A
* draw
* flush + change context to B
* read fb on ctx B
* delete ctx A

then a dead batch write will be left on the fb bo

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Mike Blumenkrantz
c2d2cb5e45 zink: flag some rp ends as unsafe
the only "safe" rp ends are:
* set_framebuffer_state (new rp)
* flush_resource (present)
* flush (end of rp)

any other rp end needs its rp info sanitized to avoid e.g., reapplying clears

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Mike Blumenkrantz
7ca5656c49 zink: never split a renderpass for a loadop change
not sure if this was possible, but make sure it's not

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Mike Blumenkrantz
61c236bc31 zink: delete unused barrier api
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Mike Blumenkrantz
30d59c469a zink: simplify resource_check_defer_buffer_barrier()
this is a remnant of when the function was used for both images
and buffers

no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Mike Blumenkrantz
ca43ecefa4 zink: handle swapchain creation failure less lazily
this is a real scenario

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22027>
2023-03-21 01:39:39 +00:00
Emma Anholt
5873dcb32f nir/lower_mediump: Fix assertion about copy_deref lowering matching.
Copy and paste typo.  We shouldn't have copy_derefs during this pass,
anyway, but caught a failure with my upcoming unit testing.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21666>
2023-03-21 00:51:24 +00:00
Emma Anholt
1fff562929 glsl/lower_precision: Add actual spec quotes for "check_parameters"
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21666>
2023-03-21 00:51:24 +00:00
Emma Anholt
4a51944639 glsl: Fix the precision of atomic counter builtin function args.
More special-casing dropped from GLSL lower_precision.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21666>
2023-03-21 00:51:24 +00:00
Emma Anholt
b251f94e15 glsl/lower_precision: Drop most special-casing of builtin arg precision.
bitCount is still special in that our lowering would try to demote its arg
based on the precision of its output, and it shouldn't do that.  But the
other special cases now have appropriate qualifiers on them at the IR
level.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21666>
2023-03-21 00:51:24 +00:00
Emma Anholt
18e096769c glsl: Set the precision of function return value temporaries.
The signature should dictate the precision of the temp we store into.
This ends up ignored by lower_precision for now, which always rewrites it
so as to handle custom lowering of builtin precision..

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21666>
2023-03-21 00:51:24 +00:00
Emma Anholt
b1d228e9d5 glsl: Handle highp promotion of builtin function args in the builtins.
It's what the spec says to do.  This will may help us avoid special-casing
these functions if we ever lower precision after builtin inlining.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21666>
2023-03-21 00:51:24 +00:00
Emma Anholt
be2731f445 glsl: Set the precisions of builtin function arguments and returns.
These have precision qualifiers defined in the spec, in which case we
should emit them them while generating builtin signatures and code.  We've
been special-casing them in GLSL lower_precision, but now we can just rely
on the precision qualifier of the builtin if non-NONE.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21666>
2023-03-21 00:51:24 +00:00
Emma Anholt
2e85c9a422 glsl/lower_precision: Add a cut-down testcase for #8124
This pattern is the core of the webgl conformance failure, I think.  And,
I think actually lower_precision was doing the right thing, just the
conformance test going through ANGLE was screwing up.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21666>
2023-03-21 00:51:24 +00:00
Emma Anholt
41be2caa6d glsl/lower_precision: Add a unit test that I thought we might fail at.
If you lowered precision too late, it would be easy to break this.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21666>
2023-03-21 00:51:24 +00:00
Emma Anholt
9a2d66f5a5 glsl: Simplify vector constructors from scalars.
No need to generate a temp in this case.  Cleanup I noticed while looking
at lower_precision behavior (and I've included a testcase to sanity check
that things work out).

This causes a tiny amount of scheduling change on freedreno:

total instructions in shared programs: 11010012 -> 11010012 (0.00%)
instructions in affected programs: 147 -> 147 (0.00%)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21666>
2023-03-21 00:51:24 +00:00
Faith Ekstrand
92ea49edcb anv: Implement VK_KHR_map_memory2
Reviewed-by: Iván Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22031>
2023-03-20 23:11:09 +00:00
Faith Ekstrand
f4a5b2d59e anv: Limit memory maps to the client-allocated size
No need to expose extra padding or CCS data to the client map.  Now that
we have the data, we can also make the BindBufferMemory asserts a bit
more accurate.

Reviewed-by: Iván Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22031>
2023-03-20 23:11:09 +00:00
Faith Ekstrand
b4497e54be vulkan: Provide wrappers for VK_EXT_map_memory2 functions
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Iván Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22031>
2023-03-20 23:11:09 +00:00
Faith Ekstrand
8af4fa3d4b vulkan: Update XML and headers to 1.3.244
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Iván Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22031>
2023-03-20 23:11:09 +00:00
Mike Blumenkrantz
efa6387a09 zink: convert luminance/alpha clear colors in dynamic texture clear
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22025>
2023-03-20 22:19:09 +00:00
Mike Blumenkrantz
600b8ba75c zink: split out luminance/alpha clear conversion code for reuse
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22025>
2023-03-20 22:19:08 +00:00
Patrick Lerda
84762bb1cf glx: fix memory leak related to __glXCloseDisplay()
Indeed, the unbind function is not called which could lead
to an unbalanced refcount state for the "drawable" object.

For instance, with "piglit/bin/glx-fbo-binding -auto"
while setting GALLIUM_REFCNT_LOG=refcnt.log.

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22024>
2023-03-20 21:12:54 +00:00
Lang Yu
19b89c8077 amd/common: fix a typo
Fixes: 35f053ba8c ("radv: Fix corrupted mipmap copies on GFX9+")

Signed-off-by: Lang Yu <lang.yu@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22000>
2023-03-20 20:30:32 +00:00
Konstantin Seurer
deb537de3c radv/rt: Handle load_constant instructions when inlining shaders
Fixes the following tests:
dEQP-VK.ray_query.builtin.rayqueryterminate.ahit.aabbs,Fail
dEQP-VK.ray_query.builtin.rayqueryterminate.ahit.triangles,Fail
dEQP-VK.ray_query.builtin.rayqueryterminate.call.aabbs,Fail
dEQP-VK.ray_query.builtin.rayqueryterminate.call.triangles,Fail
dEQP-VK.ray_query.builtin.rayqueryterminate.chit.aabbs,Fail
dEQP-VK.ray_query.builtin.rayqueryterminate.chit.triangles,Fail
dEQP-VK.ray_query.builtin.rayqueryterminate.miss.aabbs,Fail
dEQP-VK.ray_query.builtin.rayqueryterminate.miss.triangles,Fail
dEQP-VK.ray_query.builtin.rayqueryterminate.rgen.aabbs,Fail
dEQP-VK.ray_query.builtin.rayqueryterminate.rgen.triangles,Fail
dEQP-VK.ray_query.builtin.rayqueryterminate.sect.aabbs,Fail
dEQP-VK.ray_query.builtin.rayqueryterminate.sect.triangles,Fail

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8647
Fixes: fda262f ("radv/rt: move Ray Tracing shader creation into separate file")
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22002>
2023-03-20 19:04:34 +00:00
Mike Blumenkrantz
23cd81686c zink: further eliminate zs implicit feedback loops for read-only access
if all access is read-only then there is no feedback loop

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>
2023-03-20 18:24:07 +00:00
Mike Blumenkrantz
a702e5038c zink: explicitly eliminate feedback loops for unused zsbufs
this avoids a GENERAL/FEEDBACK_LOOP layout transition where possible

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>
2023-03-20 18:24:07 +00:00
Mike Blumenkrantz
618c3651ff zink: rename add_implicit_color_feedback_loop()
this is used for zs too

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>
2023-03-20 18:24:07 +00:00
Mike Blumenkrantz
2d099c46cc zink: allow zink_is_zsbuf_used() without tc / rp optimizing
this info should be up-to-date and usable now in all cases

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>
2023-03-20 18:24:07 +00:00
Mike Blumenkrantz
c900b9e35f zink: don't flag rp layout check on next draw when rp optimizing
this will always be a no-op, so save the cpu cycles

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>
2023-03-20 18:24:07 +00:00
Mike Blumenkrantz
d6e40b7d54 zink: improve no-oping of write -> readonly zsbuf layouts
if descriptor binds exist this will have to change layouts anyway,
so allow readonly since it might be a more compatible layout

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>
2023-03-20 18:24:07 +00:00
Mike Blumenkrantz
93d7bde9dc zink: add a fixup case for readonly zsbuf clears
this shouldn't currently be possible to hit, but in the future it may

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>
2023-03-20 18:24:07 +00:00
Mike Blumenkrantz
e2e079eef4 zink: track whether the fb zsbuf is readonly
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>
2023-03-20 18:24:07 +00:00
Mike Blumenkrantz
1b9e9a54ab zink: fix dsa state parsing for tc info
stencil test implies zs write

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>
2023-03-20 18:24:07 +00:00
Mike Blumenkrantz
d8bb8af4f5 zink: track zsbuf info even when rp optimizing is disabled
this should allow zsbuf elimination in some cases

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>
2023-03-20 18:24:07 +00:00
Samuel Pitoiset
d750ad19fd radv: fix NGG streamout with VS and GPL on GFX11
With GPL it's not possible to know the primitive topology when
compiling the pre-rasterization stages. For NGG, we use the maximum
number of vertices per prim and rely on the hardware to ignore the
extra bits for points/lines.

Though, this can't work for NGG streamout because the number of
vertices per prim is used to compute a streamout offset. The only
way to solve this is to pass the number of vertices per prim through
a new user SGPR.

This fixes a bunch of streamout tests with Zink/RADV on GFX11.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21833>
2023-03-20 17:47:03 +00:00
José Roberto de Souza
491887c9f2 intel: Add TODO about removal of 2Mb alignment in i915
Xe kmd don't suffer this yet because it still lacks MTL support.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21972>
2023-03-20 17:18:04 +00:00
José Roberto de Souza
96302900aa anv: Apply memory alignment requirements in Xe kmd
Without alignment vm bind will fail and during gem buffer creation
size also need to be aligned otherwise the range in vm bind can be
bigger than allocated size for smem.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21972>
2023-03-20 17:18:04 +00:00
José Roberto de Souza
7dc8474c3b intel: Set mem_alignment in Xe kmd
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21972>
2023-03-20 17:18:04 +00:00
José Roberto de Souza
bfc1782ad6 anv: Use intel_device_info memory alignment
It was also necessary to initialize mem_alignment in the tests
otherwise vma allocation would fail with stubs.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21972>
2023-03-20 17:18:04 +00:00
José Roberto de Souza
2ab3d5f436 intel: Move memory aligment information to intel_device_info
This same information is also used in ANV, so intel_device_info is
a better place to have it.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21972>
2023-03-20 17:18:03 +00:00
Eric Engestrom
12cf314dd8 v3d/ci: add another depthstencil-default_fb-drawpixels-* to the flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22026>
2023-03-20 16:51:18 +00:00
Erik Faye-Lund
859bcd605d ci: move docs-stuff out of root .gitlab-ci.yml
Unlike most other cases, we don't put the YAML-file in a ci-folder,
because we already have one for the CI-specific docs. So let's just
leave the YAML file directly in the docs-folder.

This should fix the problem that any docs-changes that touches the
CI-rules needs a full CI run just because of touching the root
.gitlab-ci.yml file. This causes needless friction and wastes CI
resources.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21953>
2023-03-20 15:27:37 +00:00
Jarred Davies
220356e083 pvr: Add initial support for VK_FORMAT_S8_UINT
Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>

Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21594>
2023-03-20 14:47:34 +00:00
Jarred Davies
317a3fe49b pvr: Select a single aspect format for the texture state of DS image views
This change also means the texture state words will be based off of the
image view's format instead of the image's format.

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>

Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21594>
2023-03-20 14:47:34 +00:00
Jarred Davies
26671b5d63 pvr: Add support for multiple emits from EOT program
Co-authored-by: Simon Perretta <simon.perretta@imgtec.com>

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21596>
2023-03-20 14:35:19 +00:00
Jarred Davies
4162c37d57 pvr: Generate dummy emit for renders without any emits
Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21596>
2023-03-20 14:35:19 +00:00
Jarred Davies
de5258ae2b pvr: Generate EOT program at runtime
Also removes hardcoded EOT program.

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21596>
2023-03-20 14:35:19 +00:00
Samuel Pitoiset
0badfd8b20 radv: add helpers for destroying various pipeline types
Much cleaner than having a single function for everything.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21894>
2023-03-20 13:56:32 +00:00
Samuel Pitoiset
abfdc06b01 radv: rename RADV_PIPELINE_LIBRARY to RADV_PIPELINE_RAY_TRACING_LIB
This seems more consistent with graphics pipeline libraries and it
avoids any confusion.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21894>
2023-03-20 13:56:32 +00:00
Collabora's Gfx CI Team
10622ccc73 Uprev Piglit to 60e7f0586bac0cfcfcb5871046e31ca2057a5117
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21640>
2023-03-20 12:17:20 +00:00
Eric Engestrom
20ba9b9faa v3dv: use vk_get_physical_device_features
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21959>
2023-03-20 12:00:10 +00:00
Eric Engestrom
d94625d110 v3dv: reorder features as 1.0, 1.1, 1.2, 1.3
Easier to follow than 1.0, 1.3, 1.2, 1.1 :)

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21959>
2023-03-20 12:00:09 +00:00
Eric Engestrom
a0be8597ac v3dv: use common GetPhysicalDeviceFeatures
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21959>
2023-03-20 12:00:09 +00:00
Samuel Iglesias Gonsálvez
4378906885 docs/developers: Add Igalia as Mesa consultancy
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22020>
2023-03-20 11:51:34 +00:00
Eric Engestrom
a7c051b5ac v3d: fix dirty bitset being too small to accept V3D_DIRTY_SSBO
Many of the `V3D_DIRTY_*` flags are above 32 bits, but for now the only
one used here is V3D_DIRTY_SSBO.

`shader->uniform_dirty_bits`, where `dirty` ends up, is already 64 bits.

Fixes: 45bb8f2957 ("broadcom: Add V3D 3.3 gallium driver called "vc5", for BCM7268.")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22019>
2023-03-20 09:29:40 +00:00
Timothy Arceri
29c71b8eb0 util/00-mesa-defaults: add Akka Arrh workaround
Cc: mesa-stable

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21979>
2023-03-20 07:18:41 +00:00
volodymyr.o
47e7b49c61 mesa ctx->API --> _mesa_is_foo(ctx)
replaces direct API checks with _mesa_is_...() checks

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8340

Signed-off-by: Volodymyr Obohzyn volodymyr.obozhyn@globallogic.com

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21556>
2023-03-20 06:39:57 +00:00
Brian Paul
5e039dbf8e gallium/xlib: call fence_finish() in XMesaSwapBuffers()
Before we can present the buffer we need to wait for the fence to
finish.  This fixes severe flickering of unfinished rendering in
many demos/tests.  This has been broken for a while, I think.

Note, this is for the non-DRI / Xlib-based GLX.

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21993>
2023-03-20 06:05:47 +00:00
Oleksii Bozhenko
bbde684ca0 ci: Uprev Piglit
Signed-off-by: Oleksii Bozhenko <oleksii.bozhenko@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21810>
2023-03-20 04:19:23 +00:00
Oleksii Bozhenko
bf910c94e0 glsl: fix gl_CullDistance lowering from float[8] to vec4[2]
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7152
Fixes: ad355652c2 ("glsl: Extend lowering pass for gl_ClipDistance to support other arrays")

Signed-off-by: Oleksii Bozhenko oleksii.bozhenko@globallogic.com

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21810>
2023-03-20 04:19:23 +00:00
Mike Blumenkrantz
ec31535ce0 zink: add debug markers for draws
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21962>
2023-03-20 03:57:32 +00:00
Mike Blumenkrantz
af9bffd07d zink: catch zs u_blitter ops for draw markers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21962>
2023-03-20 03:57:32 +00:00
Mike Blumenkrantz
c56b46638c zink: round geometry for u_blitter debug markers
this otherwise gets weird values

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21962>
2023-03-20 03:57:32 +00:00
Mike Blumenkrantz
3a9f7d7038 zink: implement unordered u_blitter calls
as long as a few bits of state are swapped around and none of the "main"
cmdbuf state is applied, it becomes possible to promote the entire
u_blitter operation to the unordered cmdbuf and execute it there as
a "transfer" operation that can continue to enable further reordering

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21906>
2023-03-20 02:26:20 +00:00
Mike Blumenkrantz
4593f335f6 zink: add zink_context::unordered_blitting to preserve unordered flags
not currently used but will be used to wrap u_blitter

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21906>
2023-03-20 02:26:20 +00:00
Mike Blumenkrantz
887f72990e zink: split out pipeline rp info update function
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21906>
2023-03-20 02:26:20 +00:00
Mike Blumenkrantz
9746e7253e zink: manually apply barriers whenever zink_context::blitting is set
this simplifies some codepaths at runtime by short-circuiting some
of the more complex operations since it's already known in advance
exactly which images will be used for which purpose

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21906>
2023-03-20 02:26:20 +00:00
Mike Blumenkrantz
07a5ede65a zink: reset fb clears using the clears_enabled mask
iterating was fine before, but it will become problematic to reset
all the clears once they start being stashed for unordered ops

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21906>
2023-03-20 02:26:20 +00:00
Mike Blumenkrantz
7411264ca6 zink: add a dynamic render version of clear_texture hook
this avoids the (sizable) overhead of going through the previous path
with set_frame_buffer state et al, instead just firing off a quick
begin+end rendering with a clear

it's also easily reorderable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21906>
2023-03-20 02:26:20 +00:00
Mike Blumenkrantz
e1621d3e6d zink: add a function for applying u_blitter barriers
this handles transitions for a sampler_view src -> framebuffer dst
operation

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21906>
2023-03-20 02:26:20 +00:00
Mike Blumenkrantz
22fb4578a0 zink: end rp earlier in set_framebuffer_state
this way any barriers occuring from unbinds won't have to do rp calc

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21906>
2023-03-20 02:26:20 +00:00
Mike Blumenkrantz
63f425c7d2 zink: double check layouts for possible feedback loop images
if a feedback loop hasn't yet been added for an image with both
descriptor and fb binds, queue a check for that to avoid mismatch

affects godot-tps-gles3-high.trace

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21906>
2023-03-20 02:26:19 +00:00
Mike Blumenkrantz
7812f3844b zink: add some asserts for zs layout in dynamic render
assert all the things

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21906>
2023-03-20 02:26:19 +00:00
David Heidelberg
dc34413f43 meson: implement quirk for the compilation under armv7 GCC with LTO
Until https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108163 gets fixed.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21554>
2023-03-19 15:21:22 +00:00
David Heidelberg
afb82e553b ci: disable weston session timeout for llvmpipe
Fixes: d57a4b57df ("ci: disable weston session timeout")

Cc: mesa-stable
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22004>
2023-03-19 15:39:31 +01:00
David Heidelberg
fb3632d24f ci: distribute XDG_RUNTIME_DIR with setup-test-env script
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8615
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8646

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22004>
2023-03-19 15:39:12 +01:00
Rob Clark
210c6c11cc freedreno+tu: Add a690 support
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21573>
2023-03-18 18:21:53 +00:00
Rob Clark
b012a4a9cd freedreno+tu: Big GMEM support
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21573>
2023-03-18 18:21:53 +00:00
Rob Clark
60bc7c0e22 freedreno: Specify GMEM tile alignment per GPU
They differ presumably based on # of CCU/SP and DDR bus topology.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21573>
2023-03-18 18:21:53 +00:00
Bas Nieuwenhuizen
ad4271439c Update my mailmap aliases
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21998>
2023-03-18 17:19:00 +00:00
Konstantin Seurer
0f18bb4076 radv: Fix inserting stack_size into the cache
Fixes: 3e03fe4 ("radv/rt: move stack_sizes into radv_ray_tracing_module")
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21969>
2023-03-18 14:57:51 +00:00
Konstantin Seurer
3887f64dc3 radv: Fix loading stack_size from the cache
Fixes: 3e03fe4 ("radv/rt: move stack_sizes into radv_ray_tracing_module")
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21969>
2023-03-18 14:57:51 +00:00
David Heidelberg
3823d4696a ci/intel: add dEQP-EGL.functional.wide_color.window_fp16_default_colorspace flake
Occasionally flake since Wayland got enabled.

Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21990>
2023-03-18 14:20:44 +01:00
David Heidelberg
161799d2c7 ci/traces: add two skips due to flakes
The unvanquished flaked time to time from beginning, minetest-v2 has
occasional 1 tiny change in the pixel.

Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21990>
2023-03-18 14:20:41 +01:00
David Heidelberg
9e6c88c96b ci/freedreno: add recent occasional flakes
Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21990>
2023-03-18 14:20:21 +01:00
Mike Blumenkrantz
9ed6487ba0 zink: expand ZINK_DEBUG=sync to cover copy ops
useful for debugging

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21999>
2023-03-18 11:44:38 +00:00
Mike Blumenkrantz
e1bfae1d4d zink: add tracing for copy ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21999>
2023-03-18 11:44:38 +00:00
Iván Briano
4dd81b4e2f intel/fs: handle interpolation modes for at_sample and at_offset too
Fixes dEQP-VK.draw.*.linear_interpolation.*

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19647>
2023-03-18 10:18:15 +00:00
Tatsuyuki Ishi
22d6556a4b radv: Fix missing wait of GS copy shader upload for dmashaders.
Fixes: 0cde42a506 ("radv: Wait for shader uploads asynchronously.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21985>
2023-03-18 03:04:15 +00:00
Jesse Natalie
3ce2b71193 dzn: Claim the arithmetic subgroup bit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21996>
2023-03-18 02:33:42 +00:00
Jesse Natalie
b4de74165d spirv2dxil: Handle arithmetic subgroup ops
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21996>
2023-03-18 02:33:42 +00:00
Jesse Natalie
ccc9540dae microsoft/compiler: Add a lowering pass for scan ops that aren't supported
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21996>
2023-03-18 02:33:42 +00:00
Jesse Natalie
981fe2bf42 microsoft/compiler: Implement wave reduce/exclusive scan ops that are supported
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21996>
2023-03-18 02:33:42 +00:00
Marek Olšák
082368cd84 radeonsi: remove unused vs_output_param_mask
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21920>
2023-03-17 23:58:28 +00:00
Marek Olšák
6eddc6dd5a ac/nir: use plural correctly in the ac_nir_export_parameters name
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21920>
2023-03-17 23:58:28 +00:00
Marek Olšák
3626bc2daa ac/nir: don't emit duplicated parameter exports
Can you spot the problem?
    exp param0 v6, v5, v5, v5
    exp param1 v7, off, off, off
    exp param1 v7, off, off, off

radeonsi uses ac_nir_optimize_outputs to eliminate output stores with
identical SSA defs (i.e. duplicated), which then causes 2 outputs to
map to the same parameter export.

This is a regression. The old LLVM code was correctly emitting each
export only once. vs_output_param_mask was supposed to be used for
this instead of vs_output_param_offset.

Fixes: 80506be31b - ac/nir/ngg,radv,radeonsi: nogs use ac_nir_export_(position|parameter)

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21920>
2023-03-17 23:58:28 +00:00
José Roberto de Souza
c86d6c8af8 iris: Move to iris_i915_batch.c code to destroy i915 context
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21965>
2023-03-17 23:29:43 +00:00
José Roberto de Souza
cb40ff3ecb iris: Move to i915/iris_batch.c code to create and replace i915 context
Some helper functions in iris_bufmgr were also moved because the only
caller is in iris_i915_batch.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21965>
2023-03-17 23:29:43 +00:00
José Roberto de Souza
7a1d0b31a6 iris: Store iris_context's priority
This way when replacing a broken context we don't need to ask to
kernel what is the priority of the context being replaced.

Also this will be necessary for Xe kmd as it don't have any uapi to
query engine priority.

While doing that also taking the oportunity to move more code from
iris_bufmgr.c/h that only has one caller.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21965>
2023-03-17 23:29:43 +00:00
Brian Paul
75b9d0b3d8 llvmpipe: remove debug printf spam in lp_setup_wait_empty_scene()
Remove some stray debug code which spams the terminal.

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21994>
2023-03-17 23:02:35 +00:00
Martin Roukala (né Peres)
a882cf09c3 ci/b2c: increase the console timeout to 4 minutes
When downloading new containers, we can often trip the 2 minutes
console activity timeout. This will be improved in the next b2c
version[1] but let's increase it until we address it.

[1] https://gitlab.freedesktop.org/mupuf/boot2container/-/issues/51

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21983>
2023-03-17 22:27:01 +00:00
Martin Roukala (né Peres)
d3c1cc9261 radv/ci: update VanGogh's expectations
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21983>
2023-03-17 22:27:01 +00:00
Eric Engestrom
8e6ac35658 asahi: fix a few typos
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21947>
2023-03-17 22:11:33 +00:00
Kenneth Graunke
b6878d456f st/mesa, iris: Add optional CPU-based ASTC void extent denorm flushing
Intel Gen9 GPUs have hardware ASTC support, but have a bug where they
don't handle denormalized values in void extent blocks correctly.  This
isn't that hard to work around - on upload, we can detect such blocks,
and flush any denorms to zero.  Because we're altering the data behind
the application's back, and applications can theoretically ask to
download the original unaltered image data, we unfortunately need to
maintain shadow copies of the data.

To make sure that we don't accidentally skip the void-extent flushing
via any fast-upload paths, and support download correctly, we plug this
into the st/mesa compressed texture format fallback paths, which store
a CPU copy of the original image data, and upload altered data.

This is unfortunately common code for what's likely to be a single
driver's issue (on a single generation), but it beats replicating an
entire framework we already have inside the driver.

Fixes dEQP-GLES3.functional.texture.compressed.astc.void_extent_ldr.*
using iris on Intel Gen9 GPUs.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4167
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21943>
2023-03-17 21:30:48 +00:00
Alyssa Rosenzweig
f534c36ca5 ci: Enforce clang-format for asahi
Some drivers use clang-format exclusively. We would like to lint for correct
formatting in CI to catch style issues before they land, because mixing
clang-format and not clang-format within a codebase is a recipe for conflicts.

We don't expect this lint to ever fail in "normal" usage, since we expect
developers on these drivers to setup automatic formatting in their editor.
However, it can be useful as a failsafe or for drive-by contributors who don't
know the style guide.

Enable the linting for Asahi. We'll enable for Panfrost shortly, but Panfrost
isn't clang-format clean quite yet.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20553>
2023-03-17 19:59:21 +00:00
Alyssa Rosenzweig
5c1b360eaa ci: Add clang-format to the amd64 container
We need clang-format available in order to check for formatting errors later.
Add it to the amd64 container only (this requires some shenigans to avoid
multi-arch conflicts).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20553>
2023-03-17 19:59:21 +00:00
José Roberto de Souza
d2621ef81d iris: Implement gem_mmap() in Xe kmd backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21937>
2023-03-17 19:31:56 +00:00
José Roberto de Souza
16dbf50ad9 iris: Implement gem_create() in Xe kmd backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21937>
2023-03-17 19:31:56 +00:00
José Roberto de Souza
c9fdfae334 iris: Implement the function to destroy VM in Xe
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21937>
2023-03-17 19:31:56 +00:00
José Roberto de Souza
60f4bd61b6 iris: Implement the Xe version of iris_bufmgr_init_global_vm()
As Xe KMD requires VM, iris_bufmgr_init_global_vm() now is returing
a boolean telling if bufmgr creationg should continue or not.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21937>
2023-03-17 19:31:56 +00:00
José Roberto de Souza
7f65b94451 iris: Only mark buffer as exported if drmPrimeHandleToFD() succeed
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21966>
2023-03-17 17:36:15 +00:00
Rhys Perry
596f2ef361 aco: set needs_flat_scr=true for RT
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Fixes: 39c828cb9f ("aco: remove aco::rt_stack variable")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21961>
2023-03-17 16:55:57 +00:00
Rhys Perry
184cf1cb79 aco/gfx11: fix RT prolog scratch initialization
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Fixes: 6446b79168 ("aco: implement select_rt_prolog()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21961>
2023-03-17 16:55:57 +00:00
Michel Dänzer
2ead574abe ci: Enable LTO for fedora-release job
Requires -Wno-error=... to be passed to the linking stage.

NOTE: This does not imply that it's safe to enable LTO for Fedora
package builds yet. It just helps prevent moving further away from that
long term goal.

v2:
* Keep passing -Wno-error=array-bounds & -Wno-error=stringop-overread.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:34 +00:00
Michel Dänzer
eb9cd45ef6 ci: Install procps-ng in Fedora image
For GCC LTO wrapper scripts.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:34 +00:00
Michel Dänzer
2b739ca31d ci: Drop ccache from Fedora image
It started hanging in F36 as well.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:34 +00:00
Michel Dänzer
bca2bcfec9 ci: Make ccache optional
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:34 +00:00
Michel Dänzer
fe53fa5117 ci: Allow passing c{,pp}_link_args to meson
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:34 +00:00
Michel Dänzer
b6e0bf8b76 ci: Pass -Werror to compiler linking stage for LTO
With LTO, some compiler warnings are generated only at the compiler's
linking stage. Therefore -Werror needs to be passed to the linking stage
as well for warnings to be turned into errors.

Meson should really do this when both werror and b_lto are enabled, but
meanwhile let's do it ourselves.

We can't just add -Werror to c{,pp}_link_args, because those are passed
for Meson's feature checks, some of which generate warnings, resulting
in false negatives. We use gcc/g++ wrapper scripts instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:33 +00:00
Michel Dänzer
86c6634897 intel/vk/grl: Do not use no_override_init_args for C++
It's only valid for C code.

Avoids

cc1plus: error: command-line option '-Wno-override-init' is valid for C/ObjC but not for C++ [-Werror]

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:33 +00:00
Michel Dänzer
66e34fe914 ci: Split up -Werror workarounds for debian-mingw32-x86_64 job
Most of them are only needed for C++ code, one of them only for C.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:33 +00:00
Michel Dänzer
86496167ea ci: Remove some -Werror workarounds for debian-android job
No more corresponding warnings.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:33 +00:00
Michel Dänzer
2f3dc68948 iris: Use ralloc_free for memory allocated with rzalloc
Pointed out by GCC with LTO:

../src/gallium/drivers/iris/iris_context.c: In function 'iris_create_context':
../src/gallium/drivers/iris/iris_context.c:304:7: error: 'free' called on pointer 'block_180' with nonzero offset 48 [-Werror=free-nonheap-object]
  304 |       free(ctx);
      |       ^
[...]
../src/gallium/drivers/iris/iris_context.c:313:7: error: 'free' called on pointer 'block_180' with nonzero offset 48 [-Werror=free-nonheap-object]
  313 |       free(ctx);
      |       ^

v2:
* Use ice pointer instead of ctx. (Karol Herbst)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:33 +00:00
Michel Dänzer
c65948a34b crocus: Use ralloc_free for memory allocated with rzalloc
Pointed out by GCC with LTO:

../src/gallium/drivers/crocus/crocus_context.c: In function 'crocus_create_context':
../src/gallium/drivers/crocus/crocus_context.c:261:7: error: 'free' called on pointer 'block_174' with nonzero offset 48 [-Werror=free-nonheap-object]
  261 |       free(ctx);
      |       ^

v2:
* Use ice pointer instead of ctx. (Karol Herbst)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:33 +00:00
Michel Dänzer
c67633be62 r600: Use container_of instead of direct pointer cast
Fixes strict aliasing violation:

In function 'r600_init_resource_fields',
    inlined from 'r600_buffer_create' at ../src/gallium/drivers/r600/r600_buffer_common.c:578:2:
../src/gallium/drivers/r600/r600_buffer_common.c:139:48: warning: array subscript 'struct r600_texture[0]' is partly outside array bounds of 'unsigned char[264]' [-Warray-bounds]
  139 |         if ((res->b.b.target != PIPE_BUFFER && !rtex->surface.is_linear) ||
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/util/os_memory.h:37,
                 from ../src/util/u_memory.h:38,
                 from ../src/gallium/include/pipe/p_state.h:47,
                 from ../src/gallium/auxiliary/util/u_inlines.h:34,
                 from ../src/gallium/auxiliary/pipebuffer/pb_buffer.h:49,
                 from ../src/gallium/include/winsys/radeon_winsys.h:46,
                 from ../src/gallium/drivers/r600/r600_pipe_common.h:37,
                 from ../src/gallium/drivers/r600/r600_cs.h:33,
                 from ../src/gallium/drivers/r600/r600_buffer_common.c:27:
In function 'r600_alloc_buffer_struct',
    inlined from 'r600_buffer_create' at ../src/gallium/drivers/r600/r600_buffer_common.c:576:34:
../src/util/os_memory_stdc.h:41:27: note: object of size 264 allocated by 'malloc'
   41 | #define os_malloc(_size)  malloc(_size)
      |                           ^~~~~~~~~~~~~
../src/util/u_memory.h:46:24: note: in expansion of macro 'os_malloc'
   46 | #define MALLOC(_size)  os_malloc(_size)
      |                        ^~~~~~~~~
../src/util/u_memory.h:54:41: note: in expansion of macro 'MALLOC'
   54 | #define MALLOC_STRUCT(T)   (struct T *) MALLOC(sizeof(struct T))
      |                                         ^~~~~~
../src/gallium/drivers/r600/r600_buffer_common.c:554:19: note: in expansion of macro 'MALLOC_STRUCT'
  554 |         rbuffer = MALLOC_STRUCT(r600_resource);
      |                   ^~~~~~~~~~~~~

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:33 +00:00
Michel Dänzer
ff73392774 nouveau: Make getSize return unsigned int
This matches the type of the underlying size member, and is consistent
with other getSize methods.

Avoids compiler warning with LTO enabled:

In member function '__ct ',
    inlined from 'convertToSSA' at ../src/nouveau/codegen/nv50_ir_ssa.cpp:401:26,
    inlined from 'convertToSSA' at ../src/nouveau/codegen/nv50_ir_ssa.cpp:310:28,
    inlined from 'nv50_ir_generate_code' at ../src/nouveau/codegen/nv50_ir.cpp:1331:22:
../src/nouveau/codegen/nv50_ir_ssa.cpp:407:48: error: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=]
  407 |    stack = new Stack[func->allLValues.getSize()];
      |                                                ^
/usr/include/c++/12/new: In function 'nv50_ir_generate_code':
/usr/include/c++/12/new:128:26: note: in a call to allocation function 'operator new []' declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21781>
2023-03-17 16:08:33 +00:00
Alejandro Piñeiro
20a066e9ab v3dv/debug: add debug option to disable TFU codepaths
This can have two main uses:
  * If we suspect a problem with TFU copies, we can disable it and
    check if other codepaths gets a test/app working.
  * To test other codepaths, as in general, TFU is the preferred
    option for copies.

Note that for now this is only for v3dv, as for v3d, mipmap generation
uses TFU without an alternative codepath.

With this option we also adds an assert if we try to submit a TFU job,
just in case we keep adding other methods that use TFU, and forget to
include the debug option there.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21952>
2023-03-17 15:20:25 +00:00
Mike Blumenkrantz
46813ffecb zink: only flag rp info for updating on flush, don't actually update
this is more consistent with actual usage

also sanitize rp info on flush to ensure it isn't reused

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
430db81071 aux/tc: rework inter-batch renderpass info handling
the tricky part of tracking renderpass info in tc is handling batch
flushing. there are a number of places that can trigger it, but
there are only two types of flushes:
* full flushes (all commands execute)
* partial flushes (more commands will execute after)

the latter case is the important one, as it effectively means that
the current renderpass info needs to "roll over" into the next one,
and it's really the next info that the driver will want to look at.
this is made trickier by there being no way (for the driver) to distinguish
when a rollover happens in order to delay beginning a renderpass for
further parsing

to solve this, add a member to renderpass info to chain the rolled-over info,
which tc can then process when the driver tries to wait. this works "most"
of the time, except when an app/test blows out the tc batch count, in which
case this pointer will be non-null, and it can be directly signaled as a less
optimized renderpass to avoid deadlocking

also sometimes a flush will trigger sub-flushes for buffer lists, so
add an assert to ensure nobody tries using this with driver_calls_flush_notify=true

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
3d96049191 aux/tc: make some of the rp tracking api private
this enables some more under-the-hood changes without touching the header
that will force all of gallium to be recompiled

also update/clarify rules for using rp tracking; these haven't changed,
but the documentation was less clear before

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
64a256c66a aux/tc: fix initial rp info allocation
this value is -1 by default, which means the initial allocation yields
9 info structs instead of 10 (though this has no bearing on functionality)

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
1a9ba0aaa3 aux/tc: add a function to reset rp info
drivers should be maintaining a local copy of the rp info, and this
provides a consistent way to reset that info if a renderpass is ended
early

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
4a5d3590d6 aux/tc: don't sync for get_sample_position
no drivers actually use the context for this, so a sync is pointless

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
4f58507855 aux/tc: track the number of active queries
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
0f4c3cb05c aux/tc: fix renderpass splitting on flush
it's expected that a driver won't immediately trigger a deferred flush
if a fence is present, so don't split the renderpass in this case since
that breaks everything

Fixes: 07017aa137 ("util/tc: implement renderpass tracking")

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
454772c123 aux/tc: use a local 'deferred' variable in tc_flush()
no functional changes

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
767ef6e02e aux/tc: flag late zs clears as partial clears
this ensures drivers can't optimize out a zs attachment that gets
a late clear

Fixes: 07017aa137 ("util/tc: implement renderpass tracking")

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
4c359f785f zink: trigger oom flushes more aggressively from copy ops
this cuts down on needing to flush from set_fb or draw

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
11b1ad9f3f zink: disable tc flush notify with rp optimizing
this is extremely broken and nonfunctional since it randomly flushes
mid-renderpass and triggers invalidations

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
e3f0eaf5f9 zink: disable queries when flushing clears from set_fb
this otherwise has weird side effects, especially with rp optimizing enabled

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:38:00 +00:00
Mike Blumenkrantz
5d94887f08 zink: add and use a function for "safely" ending renderpasses
these are all points at which a renderpass should be split, so make sure
renderpass data isn't reset in any way here

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:37:59 +00:00
Mike Blumenkrantz
64b9cf5760 zink: reset tc fb info upon splitting a renderpass
not sure if this actually affects anything, but if a renderpass has
to be split for some reason, ensure subsequent renderpasses don't lose
data

also ensure that rp data isn't lost when triggering primgen clears and
delete a now-invalid assert

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:37:59 +00:00
Mike Blumenkrantz
73528dd3b7 zink: don't use/update tc rp info while blitting
this is illegal

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:37:59 +00:00
Mike Blumenkrantz
a858bcbb37 zink: add an assert to catch renderpass optimizing bugs
this should only trigger if tc has a bug

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>
2023-03-17 14:37:59 +00:00
Francisco Jerez
76b4255cd8 intel/fs: Fix register coalesce in presence of force_writemask_all copy source writes.
This fixes the behavior of register coalesce in cases where the source
of a copy is written elsewhere in the program by a force_writemask_all
instruction, which could cause the overwrite to be executed for an
inactive channel under non-uniform control flow, causing
can_coalesce_vars() to give incorrect results.  This has been reported
in cases like:

> while (true) {
>    x = imageSize(img);
>    if (non_uniform_condition()) {
>       y = x;
>       break;
>    }
> }
> use(y);

Currently the register coalesce pass would coalesce x and y in the
example above, which is invalid since in the example above imageSize()
is implemented as a force_writemask_all SEND message, whose result is
broadcast to all channels, so when a given channel executes 'y = x'
and breaks out of the loop, another divergent channel can execute a
subsequent iteration of the loop overwriting 'x' with a different
value, hence coalescing y and x into the same register changes the
behavior of the program.

Note that this is a regression introduced by commit a4b36cd3dd.  In
order to avoid the problem without reverting that patch, we prevent
register coalesce if there is an overwrite of the source with
force_writemask_all behavior inconsistent with the copy and this
occurs anywhere in the intersection of the live ranges of source and
destination, even if it occurs lexically before the copy, since it
might be physically executed after the copy under divergent loop
control flow.

Fixes: a4b36cd3dd ("intel/fs: Coalesce when the src live range is contained in the dst")
Reported-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21351>
2023-03-17 03:05:24 -07:00
Francisco Jerez
d4015bcb38 intel/fs: Fix copy propagation dataflow analysis in presence of force_writemask_all ACP overwrites.
This fixes the behavior of copy propagation in cases where either the
source or destination of an ACP is overwritten elsewhere in the
program by a force_writemask_all instruction, which could cause the
overwrite to be executed for an inactive channel under non-uniform
control flow, causing the current per-channel dataflow propagation to
give incorrect results.  This has been reported in cases like:

> while (true) {
>    x = imageSize(img);
>    if (non_uniform_condition()) {
>       y = x;
>       break;
>    }
> }
> use(y);

Currently the copy propagation pass would propagate copy 'y = x' into
'use(y)', which is invalid since in the example above imageSize() is
implemented as a force_writemask_all SEND message, whose result is
broadcast to all channels, so when a given channel executes 'y = x'
and breaks out of the loop, another divergent channel can execute a
subsequent iteration of the loop overwriting 'x' with a different
value, hence replacing 'y' with 'x' at 'use(y)' changes the behavior
of the program.

This patch extends the global dataflow analysis algorithm to determine
whether there is any control flow path from a given copy to an
overwrite of its source or destination which has force_writemask_all
behavior inconsistent with the copy, and in such case prevents copy
propagation for that ACP entry at any point of the program which can
be reached from the overwrite, even if the copy is statically
re-executed along all such control flow paths (as in the example
above), since the execution of the overwrite for a given channel i may
corrupt other channels j!=i inactive for the subsequently re-executed
copy.

Note that a simpler solution has been attempted which fully shuts down
copy propagation if such a force_writemask_all ACP overwrite is
present /anywhere/ in the program regardless of its location in the
control flow graph, however that led to large shader-db regressions in
some programs from shader-db (like a CS from Car Chase which would
emit 53% more instructions).  With this solution the only handful of
shaders that suffer instruction count regressions seem to be getting
misoptimized right now (e.g. some compute shaders from Deus Ex
Mankind).  This solution doesn't seem to affect the run-time of
shader-db significantly, it's less than 1% higher with the fix
applied.

Reported-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21351>
2023-03-17 03:05:20 -07:00
Francisco Jerez
1c1be23497 intel/fs: Track force_writemask_all behavior of copy propagation ACP entries.
force_writemask_all determines whether all channels of the copy are
actually valid, and may be required to be set for it to be propagated
safely in cases where the destination of the copy is used by another
force_writemask_all instruction, or when the copy occurs in a
divergent control flow block different from its use.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21351>
2023-03-17 03:05:18 -07:00
Kenneth Graunke
14f9f98dcb i965/vec4: Implement uclz in the vec4 backend
Commit 28311f9d02 moved ufind_msb lowering to NIR and started emitting
uclz.  Unfortunately, the vec4 backend never actually implemented uclz.

It's trivial to do.  Now it does.

Fixes: 28311f9d02 ("nir: intel/compiler: Move ufind_msb lowering to NIR")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21974>
2023-03-17 09:01:18 +00:00
Kenneth Graunke
e7ea2aa46c intel/fs: Make bld.F16TO32 actually emit F16TO32 not F32TO16
Ahem, "add builder helpers that work on Gfx7"...now might actually work.
Too much copy and paste...

Fixes: 966995d911 ("intel/fs: Add builder helpers for F32TO16/F16TO32 that work on Gfx7.x")
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21974>
2023-03-17 09:01:18 +00:00
Kenneth Graunke
84197bc0a4 intel/vec4: Retype texture/sampler indexes to UD
generate_tex() asserts that sampler_index.type == UD, but commit
83fd7a5ed1 removed the uint temporary, which caused us to see D at
some points.  Really, either should be fine, but let's just put the
UD retype back.  This fixes a ton of things in crocus.

Fixes: 83fd7a5ed1 ("intel: Use nir_lower_tex_options::lower_index_to_offset")
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21974>
2023-03-17 09:01:18 +00:00
Jesse Natalie
49885f87c3 nir: Propagate alignment when rematerializing cast derefs
Fixes: 878a8daca6 ("nir: Add alignment information to cast derefs")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21975>
2023-03-17 08:16:03 +00:00
Mike Blumenkrantz
9df68c633e zink: track tc fences better
tc fence lifetimes can exceed the lifetimes of their parent contexts,
which means they can be destroyed after mfence->fence has been destroyed

to avoid invalid memory access on a destroyed fence, store all the assigned
tc fences into an array on the real fence and then use that to unset fence
pointers on any outstanding tc fences

fixes flakiness in dEQP-EGL.functional.sharing.gles2.multithread.random_egl_sync.images.texsubimage2d.12

in caselist:
dEQP-EGL.functional.query_context.get_current_surface.rgba4444_pbuffer
dEQP-EGL.functional.create_surface.platform_window.rgba5551_depth_no_stencil
dEQP-EGL.functional.query_surface.simple.pbuffer.rgb888_depth_no_stencil
dEQP-EGL.functional.color_clears.multi_context.gles2.rgb888_pixmap
dEQP-EGL.functional.color_clears.multi_context.gles1_gles2.rgba8888_window
dEQP-EGL.functional.color_clears.multi_context.gles1_gles2_gles3.rgb888_window
dEQP-EGL.functional.render.multi_thread.gles2_gles3.rgba5551_pbuffer
dEQP-EGL.functional.sharing.gles2.multithread.random_egl_sync.buffers.buffersubdata.3
dEQP-EGL.functional.sharing.gles2.multithread.random_egl_sync.programs.link.6
dEQP-EGL.functional.sharing.gles2.multithread.random_egl_sync.images.texsubimage2d.12

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21843>
2023-03-17 07:58:10 +00:00
Giancarlo Devich
7edae456e2 d3d12: Track up to 16 contexts worth of batch references locally in bos
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21909>
2023-03-17 07:43:08 +00:00
Giancarlo Devich
70af7fd5e8 d3d12: Unroll shader variant selection loop
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21909>
2023-03-17 07:43:08 +00:00
Giancarlo Devich
777e6b43bc d3d12: Reduce gs variant key init cost; unnecessary validate gs calls
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21909>
2023-03-17 07:43:08 +00:00
Giancarlo Devich
9bbf5505f0 d3d12: Use short circuit in shader key compare; update key hash
Move common key compare to the final step; change to short circuit from
memcmp.

Update key hash to treat varying pointers as uint64.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21909>
2023-03-17 07:43:08 +00:00
Giancarlo Devich
32e058017d d3d12: Use context-level sampler_state array for filling shader keys
This significantly reduces the size of d3d12_shader_key

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21909>
2023-03-17 07:43:08 +00:00
Giancarlo Devich
7854f9283c d3d12: Don't unnecessarily recompute manual_depth_range
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21909>
2023-03-17 07:43:08 +00:00
Giancarlo Devich
8a3ac98524 d3d12: Track up to 16 contexts worth of pending barriers locally in bos
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21909>
2023-03-17 07:43:08 +00:00
Mike Blumenkrantz
d862d708e2 zink: use res->queue to auto-handle queue transitions back to gfx queue
much simpler

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21733>
2023-03-17 07:25:04 +00:00
Mike Blumenkrantz
d7b04c110b zink: remove redundant dmabuf_acquire setting
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21733>
2023-03-17 07:25:04 +00:00
Mike Blumenkrantz
2fd2133c9d zink: track current queue for resources
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21733>
2023-03-17 07:25:04 +00:00
David Heidelberg
f4a6993b1f ci/traces: disable nheko trace with zink since it flakes
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21976>
2023-03-17 05:51:07 +00:00
Sviatoslav Peleshko
1648e3b4b9 glsl: Fix codegen for constant ir_binop_{l,r}shift with mixed types
Fixes: 13106e10 ("glsl: Generate code for constant ir_binop_lshift and ir_binop_rshift expressions")

Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17787>
2023-03-17 05:00:22 +00:00
Mike Blumenkrantz
cf973fe299 zink: fix layer check for compressed format surface creation
this is a universal check, not a check based on mutable state

Fixes: 56108b411f ("zink: verify compressed format layer count when creating surfaces")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21881>
2023-03-17 01:25:32 +00:00
Timur Kristóf
a42c57dc01 aco: Always enable idxen for swizzled buffer access on GFX11.
This helps pass the mesh shader I/O tests.
Swizzled buffer addressing seems to be broken on GFX11
when the idxen bit is 0.

No Fossil DB changes on Rembrandt (GFX10.3).

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21930>
2023-03-17 00:34:21 +00:00
Timur Kristóf
1f9e44c181 aco: Disable MUBUF/MTBUF offsets when they are zero.
Fossil DB stats on Rembrandt (GFX10.3):

Totals from 1264 (0.94% of 134920) affected shaders:
VGPRs: 69504 -> 69336 (-0.24%)
CodeSize: 6885468 -> 6886224 (+0.01%); split: -0.02%, +0.03%
MaxWaves: 24632 -> 24670 (+0.15%)
Instrs: 1287027 -> 1287209 (+0.01%); split: -0.04%, +0.05%
Latency: 6830411 -> 6831165 (+0.01%); split: -0.06%, +0.07%
InvThroughput: 1220643 -> 1220438 (-0.02%); split: -0.04%, +0.02%
VClause: 24737 -> 24751 (+0.06%); split: -0.25%, +0.30%
SClause: 42774 -> 42911 (+0.32%); split: -0.13%, +0.45%
Copies: 75408 -> 75600 (+0.25%); split: -0.62%, +0.88%
PreVGPRs: 60544 -> 59809 (-1.21%)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21930>
2023-03-17 00:34:21 +00:00
Timur Kristóf
40676da381 aco: Use zero for MUBUF/MTBUF when soffset is undefined.
No Fossil DB changes on Rembrandt (GFX10.3).

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21930>
2023-03-17 00:34:21 +00:00
Timur Kristóf
b3933ffe60 aco: Don't add soffset to swizzled MUBUF base.
No Fossil DB changes on Rembrandt (GFX10.3).

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21930>
2023-03-17 00:34:20 +00:00
Helen Koike
1d0cc57086 android/ci: raise error on script when not related to the tests
The cuttlefish-runner.sh script was failing before reaching the test
suite execution (which was not executing the complete test suite due to
the previous non-catched failures, and was erroneous passing) and we
were not catching that.
Add set -e so we can catch those.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21941>
2023-03-16 22:13:05 +00:00
Helen Koike
89432213ef android/ci: Fix call to adb
Call to adb should be made with ADB variable, following the pattern from
the script.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21941>
2023-03-16 22:13:05 +00:00
Helen Koike
cbe11f6f8d android/ci: fix removal of inexistent file
file libEGL_mesa.so doesn't exist and the rm command was failing,
replace by libGLES_mesa.so which exists.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21941>
2023-03-16 22:13:05 +00:00
Friedrich Vock
89590c1d84 radv: Add RT shader stage names for executable properties
Now that we use raygen shaders, we also need to support RT stages for
executable properties.

Fixes: f123d65e9f ("radv/rt: use prolog for raytracing shaders")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21960>
2023-03-16 21:28:03 +00:00
Yiwei Zhang
9678becbf9 Revert "zink/kopper: Add extra swapchain images for Venus"
This reverts commit 10f8240caf.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21963>
2023-03-16 20:56:53 +00:00
Asahi Lina
04387269dd asahi: Extend batch tracking for explicit sync
Now that we have stub sync support in the submission API, we can
implement the batch tracking changes required to support an explicit
sync world. This excludes the UAPI-specific bits (command decoding and
status parsing).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21620>
2023-03-16 20:42:01 +00:00
Asahi Lina
c41f10eb9e asahi: Make agx_flush_resource reallocate non-shareable resources
It's not legal to share a resource that isn't PIPE_BIND_SHARED, but
flush_resource needs to prepare a resource for potential sharing.
Let's allocate a new resource and blit it over when this happens.

See also:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13154

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21620>
2023-03-16 20:42:01 +00:00
Asahi Lina
e6b565699f asahi: Support importing sync objects on BO export
When a BO is exported, implicit sync convention requires that writers
signal a fence on the object when complete. We already do this for BOs
that are *already* exported, but it is possible for a BO to be written
to, then exported for the first time.

Add a field to agx_bo to keep track of the current writer syncobj
handle. On first export, we use this to import it into the DMA-BUF.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21620>
2023-03-16 20:42:01 +00:00
Alyssa Rosenzweig
c4aa7828b3 asahi: Use a dynarray for writers
We don't want a writer hash table with persistent pointers to resources, because
the resources could be freed without the hash table being updated (even though
the underlying BO will not be freed until it's ready). To avoid the reference
count hell, do away with the pointer hash table and instead use a flat dynarray
for mapping BO (handles) to writer (batch indices).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21620>
2023-03-16 20:42:01 +00:00
Tatsuyuki Ishi
0cde42a506 radv: Wait for shader uploads asynchronously.
This introduces tracking of the required semaphore values in pipelines,
which is then propagated to cmd_buffers on bind. Each queue also keeps
track the maximum count it has waited for, so that we can avoid the waiting
overhead once all the shaders are loaded and referenced.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16271>
2023-03-16 18:02:57 +00:00
Tatsuyuki Ishi
a8c5fd3b1b radv: Upload shaders to invisible VRAM on small BAR systems.
Following PAL's implementation, this patch avoids allocating shader code
buffers in BAR and use SDMA to upload them to invisible VRAM
directly.

For some games like HZD, shaders can take as much as 400MB, which exceeds
the non-resizable BAR size (256MB) and cause inconsistent spilling
behavior. The kernel will normally move these to invisible VRAM on its own,
but there are a few cases that it does not reliably happen. This patch does
the moving explicitly in the driver to ensure predictable results.

In this patch, we upload the shaders synchronously; so the shader will be
ready as soon as vkCreate*Pipeline returns. A following patch will make
this asynchronous and don't block until we see a use of the pipeline.

As a side effect, when SQTT is used we now store the shaders on a cacheable
buffer which would speed up writing the trace to the disk.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16271>
2023-03-16 18:02:57 +00:00
Tatsuyuki Ishi
3b258ae2d9 radv: Introduce sdma_copy_buffer for GFX7+.
Helper salvaged from radeonsi (before SDMA removal).

This will be used for driver internal submissions to DMA shaders from GTT
to invisible VRAM.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16271>
2023-03-16 18:02:56 +00:00
Tatsuyuki Ishi
d4fb3db748 radv: Use radeon_cmdbuf for sdma_copy_image.
For consistency with the sdma_copy_buffer helper that will be added next.

As a general justification, SDMA commands require little state tracking and
using radeon_cmdbuf makes it more suitable for driver internal use.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16271>
2023-03-16 18:02:56 +00:00
Jesse Natalie
25b1a11401 Revert "CI: Disable Windows runners"
This reverts commit 023d7e860e.

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21932>
2023-03-16 16:07:14 +00:00
Jesse Natalie
f8566533ea radv: Fix returning an expression from a void function
Fixes: d5de56bf ("radv: add RT shader args")
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21932>
2023-03-16 16:07:14 +00:00
Jesse Natalie
5c4c9fd454 vulkan/wsi: Fix Windows build
The headless path doesn't build for Windows (yet, anyway).

Fixes: d4a2c0fc ("vulkan/wsi: add a headless swapchain implementation/option")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21932>
2023-03-16 16:07:14 +00:00
Anuj Phogat
a455f80395 iris: implement TES distribution mode WA 22012785325
Set TEDMODE_RR_STRICT when TEEnable is set.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21899>
2023-03-16 14:42:53 +00:00
Anuj Phogat
b4b43aa912 anv: implement TES distribution mode WA 22012785325
Set TEDMODE_RR_STRICT when TEEnable is set.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21899>
2023-03-16 14:42:53 +00:00
Eric Engestrom
cb7e9a6cfb asahi: replace copies of .clang-format with symlinks
Avoid all the issues of having to keep them in sync, and few-enough
people (read: probably no-one ever) will be working on the asahi driver
from a Windows machine, so symlinks can be relied upon, especially for
something optional like automatic code formatting.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21951>
2023-03-16 14:28:20 +00:00
Tatsuyuki Ishi
9faaff4561 radv/rt: Don't upload the prolog twice.
radv_shader_create already calls radv_shader_binary_upload.

Fixes: 4b92a53285 ("radv: add radv_create_rt_prolog()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21945>
2023-03-16 12:27:21 +00:00
Eric Engestrom
8f6126e21a v3dv/ci: fix test name (,Fail is not part of the test name)
Fixes: a0bf0adade ("ci/broadcom: move rare failure to the flakes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21954>
2023-03-16 12:03:14 +00:00
Martin Roukala (né Peres)
77c3df53ae zink/ci: update the radv expectations
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21873>
2023-03-16 11:31:04 +00:00
Martin Roukala (né Peres)
c69e2849a6 zink/ci: increase the parallelism of zink-radv-vangogh-valve
It current takes 17 minutes to run this job, which is above the 15
minutes target for Mesa CI. Let's increase the parallelism to reduce
exec time to closer to 13 minutes.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21873>
2023-03-16 11:31:04 +00:00
Martin Roukala (né Peres)
928aab57a3 radv/ci: reduce the parallelism for vkcts-vangogh
We are about to enable pre-merge testing for radv-zink on vangogh,
which would mean the steam decks would be used for the following jobs:

 * Mesa pre-merge CI:
  * zink: 3 (~12 minutes)
 * Mesa Post-merge CI:
   * vkcts: 4 (~30 minutes)
   * vkd3d: 1 (~5 minutes)
 * DXVK CI: 1 (takes ~4 hours)

This means we could have 9 jobs running at the same time on steam
decks, despite only having 6 available. By reducing the number of decks
allocated for VKCTS runs from 4 to 2, we get closer to the actual
availability, and since vkd3d is so short + DXVK CI runs so
infrequently, we should never have to wait for a deck for too long!

Unfortunately, with the change of parallelism, a known flake started
failing more consistently, so I added it to the flakes list.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21873>
2023-03-16 11:31:03 +00:00
Erik Faye-Lund
5c5c114fa2 meson: correct typo in comment
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21868>
2023-03-16 10:31:04 +00:00
Gert Wollny
3ddbf64e41 virgl: Lower binding start into buffer indices
This requires that we limit the number of max combinded SSBOs to 31,
otherwisewe shaders that use SSBO binding points with higher values
will break on the host.

Fixes CTS:
  KHR-GL43.shader_storage_buffer_object.basic-atomic-case1
  KHR-GL43.shader_storage_buffer_object.basic-atomic-case2
  KHR-GL43.shader_storage_buffer_object.advanced-indirectAddressing-case2
  KHR-GL43.shader_storage_buffer_object.advanced-usage-case1
  KHR-GL43.shader_storage_buffer_object.advanced-usage-sync
  KHR-GL43.shader_storage_buffer_object.advanced-matrix

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21586>
2023-03-16 09:30:00 +00:00
Gert Wollny
99416624e5 ntt: add option to lower SSBO bindings to buffer index
When a shader uses SSBOs in various shader stages, then we have to track
the binding locations in order to be able to properly bind these SSBOs.

Therefore add a flag that enables adding the start index of the bindings to
the SSBO index.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21586>
2023-03-16 09:30:00 +00:00
Gert Wollny
1247b23f28 virgl: Don't try to do re-alloc or readback by transfer for blob resources
Blob resources are mapped directly, no need to copy data around, and
in any case, neither the resource nor the transfer info will have an
IOV attached to it, so the transfer would result error out on the host
anyway.

In addition, blob resources should not use re-allocation.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21586>
2023-03-16 09:30:00 +00:00
Gert Wollny
831e7818aa virgl: Enable AMD_vertex_shader_(layer|viewport_index) when host supports it
This increase the number of cases when the texture upload from buffer
can use the PBO upload code path.

v2: Fix logic combination (Corentin)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21586>
2023-03-16 09:30:00 +00:00
Constantine Shablya
d53aba56db anv: use vk_get_physical_device_features
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21754>
2023-03-16 08:23:29 +00:00
Alyssa Rosenzweig
ded810ded5 panvk: Use vk_get_physical_device_features
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21754>
2023-03-16 08:23:28 +00:00
Constantine Shablya
723825f5c7 vulkan: use vk_features for vk_device::enabled_features
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21754>
2023-03-16 08:23:28 +00:00
Constantine Shablya
c7300a6a3b vulkan: add hepler for vkGetPhysicalDeviceFeatures2
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21754>
2023-03-16 08:23:28 +00:00
Constantine Shablya
efaf3fd5fc vulkan: delete trailing namespace
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21754>
2023-03-16 08:23:28 +00:00
Constantine Shablya
cd35ab9570 vulkan: tidy up vk_physical_device_features
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21754>
2023-03-16 08:23:28 +00:00
Constantine Shablya
b0b3b9e8b1 vulkan: relocate rmv to its correct home
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21754>
2023-03-16 08:23:28 +00:00
Qiang Yu
51e725df29 radeonsi: monolithic TCS emit tessfactor in nir directly
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21437>
2023-03-16 04:33:31 +00:00
Qiang Yu
3f5d42a28a radeonsi: lower nir_load_ring_tess_factors_offset_amd
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21437>
2023-03-16 04:33:30 +00:00
Qiang Yu
719366c2b2 ac/llvm,radeonsi: lower nir_load_ring_tess_factors_amd
No one implement this intrinsic in llvm, so remove the
llvm entry too.

This will be used in TCS nir tess factor write.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21437>
2023-03-16 04:33:30 +00:00
Qiang Yu
99828e0390 ac/nir: handle tess factor output missing case
tcs_tess_lvl_(in|out)_loc may be not set if user miss tess
factor output.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21437>
2023-03-16 04:33:30 +00:00
Qiang Yu
700e24941c ac/nir: init tess factor location with IO remap
Radeonsi is going to use nir tess factor write, so need to
remap tess factor location.

RADV set tess factor driver location to be 0 and 1 in
get_linked_variable_location(). While radeonsi also set them
to be 0 and 1 in st->map_io aka. si_shader_io_get_unique_index_patch().

We could just set them to be 0 and 1 at the beginning of
ac_nir_lower_hs_outputs_to_mem(), but in order to keep the
location map at the same place, we still do this in
lower_hs_output_store().

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21437>
2023-03-16 04:33:30 +00:00
Qiang Yu
c06329eb3f ac/nir: tcs write tess factor support pass by reg
For radeonsi usage.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21437>
2023-03-16 04:33:30 +00:00
Qiang Yu
e070a9e8d0 ac/nir: move store_var_components to common place
It will be shared by other nir lowering too.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21437>
2023-03-16 04:33:30 +00:00
Alyssa Rosenzweig
f2617944bf panfrost: Don't round up Midgard polygon list BOs
Rounding up the polygon list BO can waste large amounts of memory. In a common
case I observed, it rounded up 11MB to 16MB, wasting 5MB. That adds up quickly
across processes, especially on the 2GB machines.

This only applies to Midgard. On Bifrost and newer, the driver does not
explicitly allocate this data structure. Cc stable because this rounding is
incorrect and the increase in RAM usage can cause real problems (especially
given how slow the shrinker is).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21831>
2023-03-16 04:13:46 +00:00
Timothy Arceri
174d6e6a54 glsl: allow 64-bit integer on RHS of shift
Fixes: 9ba9a7f854 ("glsl: Add 64-bit integer support to some operations.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6862

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21919>
2023-03-16 02:26:30 +00:00
Daniel Schürmann
39c828cb9f aco: remove aco::rt_stack variable
Since we initialize scratch in the RT proglog,
there is no need for this variable anymore.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:30 +00:00
Daniel Schürmann
f123d65e9f radv/rt: use prolog for raytracing shaders
Co-authored-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:30 +00:00
Friedrich Vock
bea022d1f6 radv/rt: Add shader config combination/postprocessing utils
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:30 +00:00
Friedrich Vock
0569b350ed radv: Emit RT shader VA user SGPR
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:30 +00:00
Daniel Schürmann
a16df842a6 radv: compile rt_prolog
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:30 +00:00
Daniel Schürmann
4b92a53285 radv: add radv_create_rt_prolog()
Co-authored-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:30 +00:00
Daniel Schürmann
6446b79168 aco: implement select_rt_prolog()
Co-authored-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:30 +00:00
Daniel Schürmann
7d35bf24f6 aco: create hw_init_scratch() function for p_init_scratch lowering
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:30 +00:00
Daniel Schürmann
2fee99a36c aco: implement load_ray_launch_{id|size}
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:30 +00:00
Daniel Schürmann
c7c68e1193 aco: move rt_dynamic_callable_stack_base_amd to VGPR
In future, we will use a VGPR arg for that between RT stages.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:30 +00:00
Daniel Schürmann
1f01a86b36 aco: don't set private_segment_buffer/scratch_offset on GFX9+
It is unused. Also don't initialize scratch in raytracing stages as it gets
initialized in the prolog shader.

Co-authored-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:30 +00:00
Daniel Schürmann
a33b9d43d8 aco: add RT stage enums
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:29 +00:00
Daniel Schürmann
c38b8678c9 radv: add RT shader handling to radv_postprocess_config
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:29 +00:00
Daniel Schürmann
3f03eebf04 radv: add RT stages to radv_get_shader_name()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:29 +00:00
Daniel Schürmann
650f386bdd radv: handle RT stages in radv_nir_shader_info_pass()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:29 +00:00
Daniel Schürmann
d5de56bf59 radv: add RT shader args
Co-authored-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:29 +00:00
Daniel Schürmann
5ede3b1c6b mesa: add gl_shader_stage_is_rt()
to indicate raytracing shader stages.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21780>
2023-03-16 01:40:29 +00:00
Rob Clark
b78fc0ae48 driconf: Work around incorrect GI discard/invalidate
Genshin Impact does a depth+stencil invalidate (or discard, not sure
which entrypoint they are using) and then proceeds to do draws with
depth test enabled.  For IMRs (or freedreno in sysmem mode) this is no
problem.  But for tilers that use this as a hint that they can skip the
z/s tile load, it is.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Mike Blumenkrantz <michael.blumenkrantz@gmail.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21916>
2023-03-16 00:56:37 +00:00
Rob Clark
a66c62420e driconf: Add ignore_discard_framebuffer option
Some apps use glDiscardFramebuffer()/glInvalidateFramebuffer() when they
only kidding.  Add a knob to disable that.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Mike Blumenkrantz <michael.blumenkrantz@gmail.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21916>
2023-03-16 00:56:37 +00:00
Rob Clark
976d964a35 mesa: Rework discard_framebuffer()
Decouple the logic turning API attachment enums into gl_buffer_index.
This will make it easier to re-use discard_attachments() internally (See
!21910)

Signed-off-by: Rob Clark <robdclark@chromium.org>
Mike Blumenkrantz <michael.blumenkrantz@gmail.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21916>
2023-03-16 00:56:37 +00:00
Lynne
f5e5ec180c aco_validate: allow for wave32 in p_dual_src_export_gfx11
Fixes RADV_PERFTEST=pswave32

Fixes: bb90d29660 ("aco: add p_dual_src_export_gfx11 for dual source blending on GFX11")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21934>
2023-03-15 23:55:41 +00:00
Mark Janes
a2e5e7daa0 intel: use generated helpers for Wa_1409433168/Wa_16011107343
HSD 1306463417 is a hardware defect.  The originating software
workaround for the issue is Wa_1409433168.  Convert all references to
the software workaround number, and use generated helpers instead of
GFX comparisons.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21914>
2023-03-15 23:31:08 +00:00
Emma Anholt
4466098324 ci/turnip: Move some more of the 1.3.5 new xfails under links.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21915>
2023-03-15 23:07:21 +00:00
Emma Anholt
5e3d36199f ci/turnip: Disable dEQP-VK.image.queue_transfer.* for now.
We're waiting on the upstream CTS fix to land.  Until then, quiet the spam
in #freedreno-ci to see if we have any other flakes we need to be managing
right now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21915>
2023-03-15 23:07:21 +00:00
Emma Anholt
45dc05d455 ci/turnip: Clear out stale xfails.
These were all fixed in the CTS, but missed from removal due to fractional runs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21915>
2023-03-15 23:07:21 +00:00
Emma Anholt
78d4a82d30 turnip: Don't push inline uniform buffer contents outside constlen.
This would apparently lead to trying to load from this inline uniform
buffer in later submits.

Fixes: 37cde2c634 ("tu: Rewrite inline uniform implementation")
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8219
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21915>
2023-03-15 23:07:21 +00:00
Mike Blumenkrantz
f99eab23ad aux/trace: delete GALLIUM_TRACE_NIR log message
this is not only annoying, it breaks trace xml output

cc: mesa-stable

Acked-by: Simon Zeni <simon@bl4ckb0ne.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21609>
2023-03-15 20:43:52 +00:00
José Roberto de Souza
eec5ddd0ed anv: Handle external objects allocation in Xe
External(imported or exported) objects needs to have vm_id set to 0.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21885>
2023-03-15 18:17:11 +00:00
José Roberto de Souza
b2d82c25fb anv: Properly alloc buffers that will be promoted to framebuffer in Xe KMD
Xe KMD does a special caching handling for buffers that will be
scanout to display, so that is why it needs a flag set during
allocation.

Checking if VK_STRUCTURE_TYPE_WSI_MEMORY_ALLOCATE_INFO_MESA
is available in AllocateMemory() and marking the buffer as scanout.

All WSI code paths but one sets
VK_STRUCTURE_TYPE_WSI_MEMORY_ALLOCATE_INFO_MESA.
The only one that doesn't requires that WSI is initialize with
wsi_device_options.sw_device = true to be executed, what is not the
case for ANV.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21885>
2023-03-15 18:17:11 +00:00
José Roberto de Souza
a311c031f6 anv: Implement Xe version of anv_physical_device_get_parameters()
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21885>
2023-03-15 18:17:11 +00:00
antonino
1538a28803 zink: fix final_hash update in zink_gfx_program_update
The logic that updates `ctx->gfx_pipeline_state.final_hash` assumed that
the program is replaced. It is supposed to xor `final_hash` with the
hash first and then with the new hash however when the program is
updated it end up xor-ing the new hash twice so it does nothing.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fixes: 15450d2c2e ("zink: incrementally hash all pipeline component hashes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21925>
2023-03-15 18:00:20 +00:00
SoroushIMG
78198d634d zink: Add driver name and API version to renderer name
Having driver name in the renderer will be useful to differentiate
between open source and proprietary drivers as they can have different
feature sets/quirks.

Vulkan API version is also added to the name to match up with ANGLE.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21922>
2023-03-15 17:40:16 +00:00
Mike Blumenkrantz
81a4163375 zink: fix copy box merging adjacency
these cases need to increase the box size, not just adjust the offset

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21921>
2023-03-15 16:42:19 +00:00
Mike Blumenkrantz
32f74c4db5 zink: fix copy box iteration when adding
need to use the iterator, not the base pointer

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21921>
2023-03-15 16:42:19 +00:00
Timur Kristóf
6185e4f2ff aco, radv: Remove VS IO information from ACO.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805>
2023-03-15 14:54:28 +00:00
Timur Kristóf
819ba6f7ae ac/llvm: Remove unused function ac_build_struct_tbuffer_load.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805>
2023-03-15 14:54:28 +00:00
Timur Kristóf
2f78700f89 radv: Remove VS inputs code from LLVM backend.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805>
2023-03-15 14:54:28 +00:00
Timur Kristóf
3b0394d063 aco: Rename visit_load_input to visit_load_fs_input.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805>
2023-03-15 14:54:28 +00:00
Timur Kristóf
c602092033 aco: Remove VS inputs from visit_load_input.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805>
2023-03-15 14:54:28 +00:00
Timur Kristóf
27c8131978 radv: Apply swizzle and alpha adjust in radv_nir_lower_vs_inputs.
Deal with VS input related things in a single pass instead of
having two different passes.

Fossil DB stats on Rembrandt (GFX10.3):

Totals from 174 (0.13% of 134913) affected shaders:
VGPRs: 7736 -> 7520 (-2.79%)
CodeSize: 354004 -> 353604 (-0.11%); split: -0.17%, +0.06%
MaxWaves: 4196 -> 4248 (+1.24%)
Instrs: 65228 -> 65139 (-0.14%); split: -0.19%, +0.06%
Latency: 265823 -> 265728 (-0.04%); split: -0.12%, +0.08%
InvThroughput: 84629 -> 84644 (+0.02%); split: -0.08%, +0.10%
VClause: 1618 -> 1606 (-0.74%); split: -0.93%, +0.19%
SClause: 1382 -> 1379 (-0.22%); split: -0.36%, +0.14%
Copies: 5586 -> 5566 (-0.36%); split: -0.55%, +0.20%
PreSGPRs: 4994 -> 5037 (+0.86%); split: -0.10%, +0.96%
PreVGPRs: 4948 -> 4955 (+0.14%); split: -0.04%, +0.18%

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805>
2023-03-15 14:54:27 +00:00
Timur Kristóf
a46acdbc3f radv: Lower non-dynamic VS inputs in NIR.
Add a new RADV specific NIR pass which lowers VS input
loads to AMD specific buffer load instructions.
We do this because we want to remove the RADV specific
VS input handling from the shader compiler back-ends.

Fossil DB stats on Rembrandt (GFX10.3):

Totals from 32507 (24.09% of 134913) affected shaders:
VGPRs: 1245512 -> 1245344 (-0.01%); split: -0.35%, +0.34%
SpillSGPRs: 1068 -> 1102 (+3.18%)
CodeSize: 90333192 -> 90327232 (-0.01%); split: -0.07%, +0.06%
MaxWaves: 881816 -> 881388 (-0.05%); split: +0.23%, -0.28%
Instrs: 17264710 -> 17264562 (-0.00%); split: -0.09%, +0.09%
Latency: 87300501 -> 86586480 (-0.82%); split: -1.07%, +0.25%
InvThroughput: 13700046 -> 13685931 (-0.10%); split: -0.20%, +0.10%
VClause: 361520 -> 361301 (-0.06%); split: -1.32%, +1.26%
SClause: 441018 -> 441505 (+0.11%); split: -0.54%, +0.65%
Copies: 1371477 -> 1373838 (+0.17%); split: -0.57%, +0.75%
Branches: 496639 -> 496611 (-0.01%); split: -0.01%, +0.00%
PreSGPRs: 1122956 -> 1122663 (-0.03%); split: -0.09%, +0.06%
PreVGPRs: 976051 -> 995717 (+2.01%); split: -0.12%, +2.14%

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805>
2023-03-15 14:54:27 +00:00
Timur Kristóf
22ca8c8561 ac/llvm: Implement typed buffer load intrinsic.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805>
2023-03-15 14:54:27 +00:00
Timur Kristóf
477cb943f6 aco: Implement load_typed_buffer_amd.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805>
2023-03-15 14:54:27 +00:00
Timur Kristóf
022e55557b nir: Add load_typed_buffer_amd intrinsic.
This new intrinsic maps to the MTBUF instruction format on AMD GPUs
and represents a typed buffer load in NIR.

Also add an unsigned upper bound for the new intrinsic.
Code for that ported from aco_instruction_selection_setup.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805>
2023-03-15 14:54:27 +00:00
Timur Kristóf
7d63d8882a aco: Remove vtx_binding from MUBUF/MTBUF instructions.
We haven't measured any noteworthy perf improvement
from these, and they are difficult to port to NIR,
so remove them before the NIR based VS input lowering
in order to make it easier to bisect and analyze stats.

Fossil DB stats on Rembrandt (GFX10.3):

Totals from 21750 (16.12% of 134913) affected shaders:
VGPRs: 868512 -> 868664 (+0.02%); split: -0.00%, +0.02%
CodeSize: 64406804 -> 64397572 (-0.01%); split: -0.08%, +0.07%
MaxWaves: 567904 -> 567888 (-0.00%); split: +0.00%, -0.00%
Instrs: 12327212 -> 12324851 (-0.02%); split: -0.10%, +0.08%
Latency: 61367324 -> 61371204 (+0.01%); split: -0.04%, +0.05%
InvThroughput: 9687734 -> 9686000 (-0.02%); split: -0.03%, +0.01%
VClause: 248207 -> 303449 (+22.26%); split: -0.02%, +22.28%
SClause: 314942 -> 315564 (+0.20%); split: -0.09%, +0.29%
Copies: 921581 -> 921820 (+0.03%); split: -0.16%, +0.19%
Branches: 341964 -> 341967 (+0.00%); split: -0.00%, +0.00%

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16805>
2023-03-15 14:54:27 +00:00
Marek Olšák
999b956ebc radeonsi: correct an assertion if we get a display list with no vertex buffers
It's possible to get a display list with no vertex buffers if the linker
eliminates all VS inputs or if the list was built with glArrayElement with
no enabled attribs.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21860>
2023-03-15 13:16:34 +00:00
Marek Olšák
9fad7ca659 radeonsi: don't use fp16_rtz for FP formats in the compute blit
It doesn't change the test results.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21860>
2023-03-15 13:16:34 +00:00
Marek Olšák
bcdde99675 radeonsi: don't convert to fp16 in the compute blit if not testing
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21860>
2023-03-15 13:16:34 +00:00
Marek Olšák
e7d7fc6740 radeonsi: fix AMD_TEST=computeblit being rejected on gfx < 11
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21860>
2023-03-15 13:16:34 +00:00
Marek Olšák
f67b41e53b radeonsi: don't print the base non-view texture format for AMD_TEST=computeblit
it's confusing in the output and it affects nothing

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21860>
2023-03-15 13:16:34 +00:00
Marek Olšák
f8070b3dc2 radeonsi: add AMD_DEBUG=nowcstream to enable caching for stream_uploader
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21860>
2023-03-15 13:16:34 +00:00
Marek Olšák
e32700c503 radeonsi: rework MSAA resolve averaging to exploit instruction-level parallelism
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21860>
2023-03-15 13:16:34 +00:00
Marek Olšák
1d978917a0 radeonsi: remove duplicated gfx11 check in si_msaa_resolve_blit_via_CB
The function really does that twice. You'll find the same code a few lines
above this change.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21860>
2023-03-15 13:16:34 +00:00
Marek Olšák
d76bb15c51 radeonsi: replace nonir,noir,noasm,preoptir options with new reworked options
New options depending on what you want to print:
- initnir  = initial NIR of shader CSOs
- nir      = final NIR of variants after all lowering
- initllvm = LLVM IR before optimizations
- llvm     = final LLVM IR
- asm      = asm

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21860>
2023-03-15 13:16:34 +00:00
Marek Olšák
c3df9973a3 radeonsi: dump shader stats only if dumping asm shaders
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21860>
2023-03-15 13:16:34 +00:00
Marek Olšák
c2f3339783 radeonsi: remove unused TCS/TES SGPR fields
We stopped using them when we switched to ac_nir_lower_hs_outputs_to_mem.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21860>
2023-03-15 13:16:34 +00:00
Yogesh Mohan Marimuthu
2b04d6cada radv: set RADEON_SURF_NO_TEXTURE flag in radv_get_surface_flags()
In vkCreateImage() if block comrpessed format and VK_IMAGE_TILING_LINEAR is
used, then the app crashes in vega gpu.

This is because addrlib does not support BC + linear as from function
ValidateSwModeParams(). From Marek Olšák the addrlib behaviour is correct.

In pal driver, flags.texture is not set in DetermineSurfaceFlags() function
if BC + linear. pal driver does it because it is expected that the
BC + linear image is only used as transfer resource.

This patch sets RADEON_SURF_NO_TEXTURE flag if usage is not
VK_IMAGE_USAGE_SAMPLED_BIT and and VK_IMAGE_USAGE_STORAGE_BIT.
flags.texture flag is not set if RADEON_SURF_NO_TEXTURE and this fixes
the crash.

v1: set NO_TEXTURE if not SAMPLED or STORAGE (Marek Olšák)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21422>
2023-03-15 12:25:33 +00:00
Yogesh Mohan Marimuthu
de0885cdb8 amd/surface: add RADEON_SURF_NO_TEXTURE flag
Block compressed + linear format is not supported in addrlib. But these
surface can be used as transfer resource. RADEON_SURF_NO_TEXTURE flag
indicates not to set flags.texture flag in gfx9_compute_surface().

This will help to fix the vkCreateImage() crash where block
compressed + linear format image is requested.

v2: combine RADEON_SURF_NO_TEXTURE to below line (Marek Olšák)
v1: add RADEON_SURF_NO_TEXTURE flag (Marek Olšák)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21422>
2023-03-15 12:25:33 +00:00
Rohan Garg
becc1c5615 anv: break out of the loop when the first color attachment is found
Fixes: 2bd304bc ("anv: Skip the RT flush when doing depth-only rendering")
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21903>
2023-03-15 10:52:50 +00:00
Marek Olšák
3bc374ca93 vbo: fix current attribs not updating gallium vertex elements
An initial workaround that helped discover this was written by:
Illia Polishchuk illia.a.polishchuk@globallogic.com

Closes: #8440
Fixes: a18b9d07 ("st/mesa: optimize uploading zero-stride vertex attribs")

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21805>
2023-03-15 10:04:50 +00:00
Alyssa Rosenzweig
e6f9444567 asahi: Fix occlusion query lifetime
Theoretical lifetime issue, now easy to hit with the batch sync changes. Fixes
memory badness.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21857>
2023-03-15 08:46:09 +00:00
Emma Anholt
a74d2ef17d ci/iris: Add skips for slow tests on APL.
These get reported as flakes for timing out before passing when the shader
cache is hot.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21879>
2023-03-15 08:15:37 +00:00
Emma Anholt
e61b423074 ci/turnip: Extend a630 vk full timeout to 3 hours.
With the CTS coverage and tu featureset extending, these jobs have been
reliably timing out for a while.  I've updated the xfails based on a
single run, we'll see how that goes in the upcoming nightlies.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21879>
2023-03-15 08:15:37 +00:00
Emma Anholt
343426b95c ci/zink: Update TGL xfails/flakes based on the last nightly pipelines.
The 2f8073f87c fix changed some results, qbo
changed a week or so ago, and spec@ext_texture_array@compressed
texsubimage pbo has been crashing for a long time.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21879>
2023-03-15 08:15:36 +00:00
Patrick Lerda
aba16defa8 radeonsi: fix memory leak related to ureg_get_tokens()
Indeed, ureg_get_tokens() returns an allocated string that should be
freed using ureg_free_tokens().

For instance, with "piglit/bin/arb_shader_image_load_store-invalid -auto -fbo"
Direct leak of 768 byte(s) in 2 object(s) allocated from:
    #0 0x7fa819a78b48 in __interceptor_realloc (/usr/lib64/libasan.so.6+0xb1b48)
    #1 0x7fa80e189e04 in tokens_expand ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:239
    #2 0x7fa80e189e04 in get_tokens ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:262
    #3 0x7fa80e191f6e in copy_instructions ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:2079
    #4 0x7fa80e191f6e in ureg_finalize ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:2129
    #5 0x7fa80e19447b in ureg_get_tokens ../src/gallium/auxiliary/tgsi/tgsi_ureg.c:2206
    #6 0x7fa80ec68b91 in si_create_fmask_expand_cs ../src/gallium/drivers/radeonsi/si_shaderlib_tgsi.c:564

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21871>
2023-03-15 06:41:28 +00:00
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
Emma Anholt
761bbb2c6f ci: Update trace expectations for GLSL constant prop removal.
Somewhere along the way there were minor pixel value changes.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21751>
2023-03-15 03:29:19 +00:00
Emma Anholt
e395e57f07 glsl: Delete constant-variables pass.
Now that we don't do GLSL IR constant propagation or constant folding, we
can leave constant variable detection and handling to NIR.  This also
avoids some OOB array access in GLSL IR in a piglit test!

Freedreno stats again look like noise:

total instructions in shared programs: 2718412 -> 2718746 (0.01%)
instructions in affected programs: 80497 -> 80831 (0.41%)
total last-baryf in shared programs: 110015 -> 110510 (0.45%)
last-baryf in affected programs: 35263 -> 35758 (1.40%)
total full in shared programs: 189486 -> 189480 (<.01%)
full in affected programs: 52 -> 46 (-11.54%)
total constlen in shared programs: 494540 -> 494496 (<.01%)
constlen in affected programs: 452 -> 408 (-9.73%)
total sstall in shared programs: 198297 -> 197928 (-0.19%)
sstall in affected programs: 3691 -> 3322 (-10.00%)
total systall in shared programs: 432150 -> 431799 (-0.08%)
systall in affected programs: 6070 -> 5719 (-5.78%)
total waves in shared programs: 435098 -> 435110 (<.01%)
waves in affected programs: 92 -> 104 (13.04%)

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21751>
2023-03-15 03:29:19 +00:00
Emma Anholt
329ab85a89 glsl: Delete constant folding pass.
NIR is happy to take care of constant folding for us, and it's easier to
do in SSA.

This required adjusting of lower_precision unit tests to have un-folded
constants.

freedreno results look like noise.  Some excerpts:

total instructions in shared programs: 2718343 -> 2718412 (<.01%)
instructions in affected programs: 6847 -> 6916 (1.01%)
total last-baryf in shared programs: 109992 -> 110015 (0.02%)
last-baryf in affected programs: 117 -> 140 (19.66%)
total sstall in shared programs: 198312 -> 198297 (<.01%)
sstall in affected programs: 148 -> 133 (-10.14%)
total systall in shared programs: 432163 -> 432150 (<.01%)
systall in affected programs: 1016 -> 1003 (-1.28%)

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21751>
2023-03-15 03:29:19 +00:00
Emma Anholt
7f39c9f24e glsl: Delete constant propagation pass.
freedreno results look like noise.  Excerpts:

total instructions in shared programs: 2718355 -> 2718343 (<.01%)
instructions in affected programs: 2001 -> 1989 (-0.60%)
total last-baryf in shared programs: 109960 -> 109992 (0.03%)
last-baryf in affected programs: 789 -> 821 (4.06%)
total sstall in shared programs: 198273 -> 198312 (0.02%)
sstall in affected programs: 140 -> 179 (27.86%)
total systall in shared programs: 432224 -> 432163 (-0.01%)
systall in affected programs: 241 -> 180 (-25.31%)

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21751>
2023-03-15 03:29:19 +00:00
Emma Anholt
470214cb82 glsl_to_nir: Use a variable's constant_value if it wasn't const-propped out.
glsl has been constant-propagating out references to ir->constant_value
(the value of a variable declared as const), but we can get rid of that
whole pass if we just have glsl-to-nir hand the constant propagating
problem off to NIR.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21751>
2023-03-15 03:29:19 +00:00
Emma Anholt
dccbecbef5 glsl/nir: Include early glsl-to-nir output in NIR_DEBUG=print.
These passes were missing the macros to handle debug output and extra
validation.  But also, for working on GLSL, it's nice to see the raw
output of glsl-to-nir before you move on.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21751>
2023-03-15 03:29:19 +00:00
José Roberto de Souza
a10388224d iris: Move iris_bufmgr_init_global_vm() to i915/iris_bufmgr.c and prepare for Xe KMD
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21887>
2023-03-15 02:05:58 +00:00
José Roberto de Souza
631756db56 iris: Drop usage of i915 EXEC_OBJECT_WRITE
The whole usage of this flag is to call iris_use_pinned_bo() with
writable argument, for that we don't need any i915_drm.h specific type.
IRIS_BLORP_RELOC_FLAGS_EXEC_OBJECT_WRITE could have any other value but
keeping the same as i915_drm.h.

With this we can drop 2 i915_drm.h imports from generic Iris code.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21887>
2023-03-15 02:05:58 +00:00
José Roberto de Souza
660877cf38 iris: Drop I915_EXEC_FENCE types
Those are i915_drm.h specific types and should not be in code paths
shared by i915 and Xe KMD.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21887>
2023-03-15 02:05:58 +00:00
Mike Blumenkrantz
747c3ddb9d glthread: align small buffer uploads to 4 bytes
some apps (e.g., supertuxkart) use a ton of 4 byte subdata calls, and
this halves their memory consumption

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21875>
2023-03-15 01:22:12 +00:00
Mohamed Ahmed
5ada09412f anv: remove GetBufferMemoryRequirements2()
Signed-off-by: Mohamed Ahmed <mohamedahmedegypt2001@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21898>
2023-03-15 00:30:35 +00:00
Mohamed Ahmed
2649ee0724 vulkan/runtime: implement vkGetBufferMemoryRequirements2()
Signed-off-by: Mohamed Ahmed <mohamedahmedegypt2001@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21898>
2023-03-15 00:30:35 +00:00
Mohamed Ahmed
10a4412966 vulkan/runtime: move common buffer related entrypoints to vk_buffer.c
Signed-off-by: Mohamed Ahmed <mohamedahmedegypt2001@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21898>
2023-03-15 00:30:35 +00:00
Corentin Noël
3b55d4a6b7 ci: Allow to use crosvm-runner before deqp-runner
Since the addition of unified sections, many scripts need to be aware of the content
of the setup-test-env.sh file. The use of bash is also mandatory to have exports of
function declarations.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21900>
2023-03-14 23:59:37 +00:00
Corentin Noël
ce43cc32e2 ci: Setup XDG_RUNTIME_DIR in crosvm-init
This environment variable has to be set to use the wayland platform.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21900>
2023-03-14 23:59:37 +00:00
Alyssa Rosenzweig
2bab56737c panfrost: Note glDrawRangeElements underflow
Hopefully this helps someone wiring up robustness later on.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>
2023-03-14 23:10:01 +00:00
Alyssa Rosenzweig
c832831a6f panfrost/ci: Remove fbo-mrt-new-bind fail+flake
Seems to pass reliably now.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>
2023-03-14 23:10:01 +00:00
Alyssa Rosenzweig
179ed2ff60 panfrost/ci: Add some Piglit skips
Skip heavyweight crashing tests that have the potential to take down not just
themselves but also other Piglit tests running concurrently via piglit-runner
(which would otherwise become piglit-runner level flakes).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>
2023-03-14 23:10:01 +00:00
Alyssa Rosenzweig
e060513533 panfrost/ci: Identify some Piglit flakes
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>
2023-03-14 23:10:01 +00:00
Alyssa Rosenzweig
6788d37a1f panfrost/ci: Skip draw_buffers_indexed.random.* on Midgard
These are (have always been) quite broken. Given that the whole section is
already in the flakes.txt, and there's no plan for improving this (I've tried
and fails), I'd rather just skip the section and reduce the noise in
the #panfrost-ci channel.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>
2023-03-14 23:10:01 +00:00
Alyssa Rosenzweig
a0e9f9278d panfrost: Handle null textures robustly
This is really dumb.

But this fixes arb_shader_language_420pack-active-sampler-conflict on v7 which
otherwise dereferences a null pointer trying to access the nonexistant texture
arrays, or DATA_INVALID_FAULTs if you give it a texture array filled with
zeroes. But it seems happy if you bind in null textures. This is dumb but less
faults in Piglit is good for reducing flakes.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>
2023-03-14 23:10:01 +00:00
Alyssa Rosenzweig
b8b6bb18f5 panfrost: Defeature 24-bit textures
mesa/st doesn't like to use 24-bit textures, preferring RGBX over true RGB even
for texture views where this isn't valid. Given how silly true RGB is in
practice, I'd rather drop support and fix texture views than go against the
grain and risk more issues down the line since nobody else in tree is testing
these paths and apps really shouldn't be caring.

Fixes page faults in arb_texture_view-rendering-formats_gles3 which tries to
sample an R8G8B8_UINT texture with a R8G8B8X8_UNORM view in one subcase. That
test is now passing reliably.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>
2023-03-14 23:10:01 +00:00
Alyssa Rosenzweig
7dda731a38 panfrost: Assert that we don't see unsupported vertex formats
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>
2023-03-14 23:10:00 +00:00
Alyssa Rosenzweig
589a0fe865 panfrost: Identify "Base vertex offset" signedness
This is signed, not unsigned. We were already passing negatives and silently
relying on 2's complement and C to do the right thing. But that's silly. We
should just, actually do the right thing.

Found while struggling to debug primitive-restart-draw-mode.

v2: Update the other architectures too, including a decode_csf.c change for the
v10 incarnation of this v4-era field.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net> [v1]
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>
2023-03-14 23:10:00 +00:00
Alyssa Rosenzweig
90e78f6008 pan/bi: Ignore signedness in vertex fetch
We just want a bit-exact transfer for integers. Using .auto32 accomplishes this
without any clamping shenanigans. Fixes gl-3.0-vertexattribipointer.

Note we can't use .auto32 unconditionally, since reading a uint vertex as float
is supposed to convert (or something like that, gl-2.0-vertexattribpointer tests
the bad case at any rate).

Fixes: 482cc273af ("pan/bi: Implement load attribute with the builder")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>
2023-03-14 23:10:00 +00:00
Alyssa Rosenzweig
62497d4860 util/prim_convert: Don't set index_bounds_valid
draw->index_bounds_valid tells drivers that the values of min_index/max_index
are set correctly and can be used e.g. to allocate memory for varyings. If set
incorrectly, the GL promises badness.

But, with primconvert, we go mucking with index buffers and then never update
the bounds. So it doesn't matter if the original index bounds were valid, we
can't promise the original bounds are *still* valid. If we were trying to
optimize CPU overhead, we could try to preserve the new min/max index but seeing
as only older Mali cares about this flag, and if you're using primconvert you're
already screwed, I'm not too inclined to go rework primconvert.

Fixes* page faults in primitive-restart-draw-mode on Mali-G52 for GL_QUAD_STRIPS
and GL_POLYGON, which hit the primconvert path. The full dmesg splat looks like:

[ 5438.811727] panfrost ffe40000.gpu: Unhandled Page fault in AS0 at VA 0x000000100A16BAC0
             Reason: TODO
             raw fault status: 0x25002C1
             decoded fault status: SLAVE FAULT
             exception type 0xC1: TRANSLATION_FAULT_1
             access type 0x2: READ
             source id 0x250

Notice that a high bit is randomly set in the address, this is trying to read
a varying from the actual varying buffer in the vicinity of 0xa16bac0. What's
actually happening is that we're trying to read index #0 despite promising the
driver a minimum index of 2, causing an integer underflow as we try to read
index -2, or as the hardware sees, 4294967294.

As long as we stop lying to panfrost about the bounds being correct, panfrost is
able to calculate the real (post-primconverted) bounds on its own, fixing the
test.

* Alternatively, maybe Panfrost should just ignore this bit, in which I don't
  know why we have it in Gallium, since it's probably not conformant to fault on
  out-of-range glDrawRangeElements.

Fixes: 72ff53098c ("gallium: add pipe_draw_info::index_bounds_valid")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>
2023-03-14 23:10:00 +00:00
Mike Blumenkrantz
2409ddb5db zink: fix copy box iteration
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21907>
2023-03-14 21:25:55 +00:00
Mike Blumenkrantz
7d41b8fe4e tu: don't set startup debug on debug builds
this is incredibly annoying on normal linux systems

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21809>
2023-03-14 19:48:24 +00:00
Jarred Davies
1115a29025 pvr: Fix segfaults when pDepthStencilAttachment is NULL
depth_stencil_attachment has been changed from a pointer to the attachment idx
to just the attachment idx, as this avoids the driver having to check for NULL
when comparing attachments indexes with depth_stencil_attachment.

Anyplace that relies on depth_stencil_attachment being a valid index must
already check that depth_stencil_attachment is not VK_ATTACHMENT_UNUSED, so
this change avoids having to check both the pointer and the index for the same
information.

Noticed when running dEQP-VK.api.smoke.triangle

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>

Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21690>
2023-03-14 19:27:27 +00:00
Eric Engestrom
7176e0c160 ci: group RESULT logic in a single place
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21884>
2023-03-14 18:53:51 +00:00
Eric Engestrom
755282accc ci/rustfmt: print which files are checked
And how long that took, in case it ever becomes a problem.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21884>
2023-03-14 18:53:51 +00:00
Eric Engestrom
6c2d177896 ci/rustfmt: simplify getting all the rust files
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21884>
2023-03-14 18:53:51 +00:00
Eric Engestrom
488d5c6fa6 ci: drop redundant .no_scheduled_pipelines-rules + .core-rules since the latter already includes it
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21884>
2023-03-14 18:53:50 +00:00
Eric Engestrom
a0bf0adade ci/broadcom: move rare failure to the flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21901>
2023-03-14 18:26:31 +00:00
Yiwei Zhang
179fadb332 venus: make external fence and semaphore export async
This also makes vn_QueueSignalReleaseImageANDROID async since it makes
use of a queue submit followed by an external fence export internally.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21716>
2023-03-14 18:07:38 +00:00
Yiwei Zhang
a37771b42a venus: refactor to add vn_sync_payload_external
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21716>
2023-03-14 18:07:38 +00:00
Yiwei Zhang
891af34bca venus: make common wsi bo submission async
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21716>
2023-03-14 18:07:38 +00:00
Yiwei Zhang
0a3f612ab3 venus: let vn_instance_submit_command track ring seqno
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21716>
2023-03-14 18:07:38 +00:00
Yiwei Zhang
1cb42a629f venus: make vn_instance_wait_roundtrip asynchronous
vn_instance_roundtrip does 2 things:
1. vn_instance_submit_roundtrip
   - before: encode a cmd to write vq seqno to ring extra field
   - after: encode a cmd to update vq seqno against a ring
   - submit the encoded cmd via vq
2. vn_instance_wait_roundtrip
   - before: wait until ring extra field has the vq seqno
   - after: let renderer ring thread wait for the vq seqno

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21716>
2023-03-14 18:07:38 +00:00
Yiwei Zhang
9b7a78cac6 venus: switch to use 64bit roundtrip seqno
This is to prepare for later async roundtrip waiting while seamlessly
compatible with legacy way.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21716>
2023-03-14 18:07:38 +00:00
Yiwei Zhang
932073d3e6 venus: sync to latest protocol for asyncRoundtrip
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21716>
2023-03-14 18:07:38 +00:00
Martin Roukala (né Peres)
82f0a01291 ci/valve-farm-rules: allow running jobs from outside the mesa namespace
This has been requested as it breaks the stress and uprev tools, so
the requirement was dropped in the Valve farms. This commit mirrors
the change in Mesa.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21872>
2023-03-14 17:22:07 +00:00
Martin Roukala (né Peres)
9dd4c03dd6 ci: bring back the valve farm online
All the farms have been updated, and the `out of files` error has been
fixed, and I also believe that the vast majority of the
`file could not be opened successfully` should also be fixed with this
update.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21872>
2023-03-14 17:22:07 +00:00
Martin Roukala (né Peres)
10e0c5fd46 ci/b2c: move away from the hand-rolled initscript
Up until now, we have been handrolling part of the init-stage2.sh in
the b2c command line. Let's stop doing that and instead use the same
script as every other HW farms.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21872>
2023-03-14 17:22:07 +00:00
Martin Roukala (né Peres)
a0d8ed757e ci/init-stage2: always set XDG_RUNTIME_DIR
This seems to be needed now that we compile mesa with wayland support.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21872>
2023-03-14 17:22:07 +00:00
Martin Roukala (né Peres)
226c247945 ci/init-stage2: allow sourcing the job env vars from the CWD
This will make it easier for the b2c jobs to use this script, as I
don't think I should extract the job folder to /.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21872>
2023-03-14 17:22:07 +00:00
SoroushIMG
4affc3b361 zink: rename shadow key to zs swizzle
No functional change.

The shadow shader swizzle pass has been extended to optionally
include all z/s textures.
Rename the structs/variables to reflect this now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21571>
2023-03-14 17:03:30 +00:00
SoroushIMG
24a2530ed8 zink: workaround undefined swizzle 1 for z/s textures
using swizzle 1 with z/s textures returns undefined data
on some Imagination hardware.
Work around this by using the same shader swizzling used for
shadow samplers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21571>
2023-03-14 17:03:30 +00:00
SoroushIMG
2cf117ee39 zink: add depth/stencil needs shader swizzle workaround field
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21571>
2023-03-14 17:03:30 +00:00
SoroushIMG
cc15dbc4f8 zink: extend shadow swizzle pass to all zs textures
if needs_zs_shader_swizzle is used, apply constant swizzles to all
depth/stencil textures and not just shadow samplers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21571>
2023-03-14 17:03:30 +00:00
SoroushIMG
79557c2747 zink: add needs_zs_shader_swizzle shader key
This will be used later, but for now it should always be disabled.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21571>
2023-03-14 17:03:30 +00:00
SoroushIMG
b707cdccf5 zink: minor formatting change
that line was becoming too long.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21571>
2023-03-14 17:03:30 +00:00
SoroushIMG
f7257b1c75 zink: track shadow swizzle for all shader stages
this will be used later on to enable the pass in all
shader stages.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21571>
2023-03-14 17:03:29 +00:00
SoroushIMG
a83e63437f zink: fix shadow mask change logic when binding sampler views
First make sure shadow mask change sets dirty state.
Second move shadow mask bit removal to unbind_samplerview which
is cleaner and correctly clears the shadow bit when binding buffer texture.

Fixes: 5193f4f712 ("zink: add a fs shader key member to indicate depth texturing mode")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21571>
2023-03-14 17:03:29 +00:00
SoroushIMG
5903868f99 zink: fix stale point sprite mode state
Fixes: cf8ca77be1 ("zink: handle point sprite")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21840>
2023-03-14 16:41:48 +00:00
Mike Blumenkrantz
4b4306fe10 zink: super reorder buffer copies
usually zink_get_cmdbuf() is enough for reordering operations, but
with new technology, it becomes possible to promote even the most stubborn
buffers to the unordered cmdbuf

first, check the src buffer to ensure that there's no pending writes in
the main cmdbuf that would prohibit reordering

second, apply a TRANSFER_DST to the dst buffer using the util function
to determine whether it can be reordered

if both the src and dst can be reordered for their respective regions
and read/write usage, then the entire op can be promoted regardless of
the unordered_read/unordered_write flags

this optimizes out patterns like
upload index buffer (offset=0)
draw
upload index buffer (offset=128)
draw
upload index buffer (offset=256)
draw
...

so that the uploads and draws can be separated and batched

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21802>
2023-03-14 16:23:06 +00:00
Mike Blumenkrantz
128d19da5e zink: rename zink_check_transfer_dst_barrier()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21802>
2023-03-14 16:23:06 +00:00
Mike Blumenkrantz
e0c53554ae zink: unify image TRANSFER_DST barrier checks
this should be consistent with buffers

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21802>
2023-03-14 16:23:06 +00:00
Mike Blumenkrantz
e55e9014b3 zink: return the unordered state from zink_resource_buffer_transfer_dst_barrier()
convenience usage

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21802>
2023-03-14 16:23:06 +00:00
Mike Blumenkrantz
fe6f0692ed zink: rework zink_resource::valid_buffer_range
this is now the valid buffer region for the "main" command buffer,
and all transfer ops store their regions in the copy boxes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21802>
2023-03-14 16:23:06 +00:00
Mike Blumenkrantz
8c51c8697a ci: fix LVP_POISON_MEMORY usage
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21847>
2023-03-14 14:52:25 +00:00
Mike Blumenkrantz
8b38c4f43c lavapipe: beef up LVP_POISON_MEMORY
this makes lavapipe behave more like a tiler and completely annihilate
any existing data for DONTCARE load/store ops

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21847>
2023-03-14 14:52:24 +00:00
Lionel Landwerlin
d4a2c0fcaa vulkan/wsi: add a headless swapchain implementation/option
I wanted to find slow pieces of code in our Anv driver using our
drm-shim stub.

The last bit of code still talking to the compositor was the WSI
swapchain code and failing because none of the submissions are taking
place (because of the stub).

This change introduces a new variable MESA_VK_WSI_HEADLESS_SWAPCHAIN
which when set turns every swapchain creation into a headless
swapchain. This swapchain does not present anything, allowing the
application to spin as many frames as possible. Thus helping to
identify slow spots in command buffer building path.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6156>
2023-03-14 14:03:31 +00:00
Dave Airlie
4e0d4aab48 anv: fix image height for field pictures.
Fixes: 98c58a16ef ("anv: add initial video decode support for h264.)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21807>
2023-03-14 13:34:53 +00:00
Lionel Landwerlin
56474fae93 intel/fs: fix subgroup invocation read bounds checking
nir->info.subgroup_size can be set to an enum :
  SUBGROUP_SIZE_VARYING = 0
  SUBGROUP_SIZE_UNIFORM = 1
  SUBGROUP_SIZE_API_CONSTANT = 2
  SUBGROUP_SIZE_FULL_SUBGROUPS = 3

So compute the API subgroup size value and compare it to the dispatch
size to determine whether we need some bound checking.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 9ac192d79d ("intel/fs: bound subgroup invocation read to dispatch size")
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21856>
2023-03-14 12:15:48 +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
Emma Anholt
5bb9ab896c ci: Re-enable some swrast testing using fd.o's shared runners for now.
I'm not planning to stand mesa-swrast back up until we get Kata set up, so
turn the testing back on at a reduced fraction on so that
venus/llvmpipe/etc. dev can still get some coverage.

I haven't turned lavapipe back on, because it is now unstable in memory
model / atomics tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21880>
2023-03-14 11:31:34 +00:00
Lionel Landwerlin
bf59cfcee1 intel/fs: prevent large vector ops generated by peephole_ffma
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21782>
2023-03-14 10:38:50 +00:00
Lionel Landwerlin
bc08f43991 intel/fs: add MOV source count validation
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21782>
2023-03-14 10:38:50 +00:00
Lionel Landwerlin
ed3c2f73db intel/fs: fixup sources number from opt_algebraic
Fixes issues with register_coalesce :

fossilize-replay: brw_fs_register_coalesce.cpp:297: bool fs_visitor::register_coalesce(): Assertion `mov[i]->sources == 1' failed.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21782>
2023-03-14 10:38:50 +00:00
Lionel Landwerlin
18bdc71459 intel/fs: fix nir_opt_peephole_ffma max vec assumption
There can be larger vec than vec4.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21782>
2023-03-14 10:38:50 +00:00
Lionel Landwerlin
efde1917c9 intel/fs: don't SEND messages as partial writes
For instance, to load uniform data with the LSC we usually rely on
tranpose messages which have to execute in SIMD1. Those end up being
considered as partial writes so within loops their life span spread to
the whole loop, increasing register pressure.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21867>
2023-03-14 10:10:32 +00:00
Lionel Landwerlin
adcdc38f3b anv: more formats for acceleration structure vertices
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21821>
2023-03-14 09:34:27 +00:00
Dave Airlie
cb24faf1a6 anv/video: disable picture id reampping.
This isn't needed at the hw level with vulkan

Fixes: 98c58a16ef ("anv: add initial video decode support for h264.")
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21433>
2023-03-14 07:32:00 +00:00
Dave Airlie
f85b2cbe33 anv/video: fix chroma qp to be a integer value.
This is just a cleanup to the genxml

Fixes: 98c58a16ef ("anv: add initial video decode support for h264.")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21433>
2023-03-14 07:32:00 +00:00
Mike Blumenkrantz
c28c995645 lavapipe: add command debugging
I keep adding this in locally. it's great for debugging

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21814>
2023-03-14 06:16:32 +00:00
Mike Blumenkrantz
e6e1d01be0 lavapipe: set render_condition_enabled=false for vkCmdClearDepthStencilImage
this command ignores conditional rendering

fixes:
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_host_memory_expect_noop
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_host_memory_secondary_buffer_expect_noop
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_host_memory_secondary_buffer_expect_noop_inverted
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_host_memory_secondary_buffer_inherited_expect_noop
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_local_memory_expect_noop_inverted
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_local_memory_secondary_buffer_expect_noop
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_local_memory_secondary_buffer_expect_noop_inverted
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_local_memory_secondary_buffer_inherited_expect_noop

Fixes: fe53c22294 ("lavapipe: fix only clearing depth or stencil paths.")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21814>
2023-03-14 06:16:32 +00:00
Mike Blumenkrantz
c9e757c61e lavapipe: fix dynamic depth clamping
on pipeline bind with dynamic state, depth_clip_near needs to either be set by
* applying the dynamic state
* using the pipeline state

the previous code always used the pipeline state

fixes:
dEQP-VK.pipeline.*.extended_dynamic_state.between_pipelines.depth_clamp_enable

Fixes: 650880105e ("vulkan,lavapipe: Use a tri-state enum for depth clip enable")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21814>
2023-03-14 06:16:31 +00:00
Corentin Noël
cd39a5ac8b ci: uprev virglrenderer and crosvm
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21794>
2023-03-14 05:22:21 +00:00
Lionel Landwerlin
f406a9efa9 docs: update Anv features support
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21870>
2023-03-14 02:08:01 +00:00
Lionel Landwerlin
d8013976c7 anv: export EXT_pipeline_library_group_handles only with RT
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21870>
2023-03-14 02:08:01 +00:00
Eric Engestrom
76b591d8f7 broadcom/ci: no need to skip the tests that swap buffers anymore
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21877>
2023-03-14 01:31:19 +00:00
Eric Engestrom
d57a4b57df ci: disable weston session timeout
-iN, --idle-time=N
           Set  the idle timeout to N seconds. The default timeout is
           300 seconds. When there has not been any user input for the idle
           timeout, Weston enters an inactive mode. The screen fades to black,
           monitors may switch off, and the shell may lock the session.
           A value of 0 effectively disables the timeout.

We don't want the session to get locked and monitors to switch off while tests
are running, as many of them depend on swapping buffers.

Cc: mesa-stable
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21877>
2023-03-14 01:31:19 +00:00
Mike Blumenkrantz
43facca195 aux/tc: use renderpass tracking to optimize texture_subdata calls
if it's known that a renderpass is active and the driver wants to do
renderpass optimizing, help out by not forcing a sync and instead doing
what the driver would do: create a staging buffer and copy it to the
image

this requires that the driver already handles buffer -> image copies
with resource_copy_region

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21801>
2023-03-14 00:53:28 +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
Mark Collins
715adcb884 tu: fix tu_GetInstanceProcAddr not handling null instance
It is legal to pass in nullptr as an instance into
vkGetInstanceProcAddr when resolving any global addresses, this
wasn't handled correctly and an illegal access to a member of
a null struct was made.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21827>
2023-03-13 19:31:33 +00:00
Mark Collins
9c808043f3 tu: KGSL backend rewrite
This commit rewrites the KGSL backend to utilize vk common wherever
possible to bring the codebase in line with DRM while implicitly
fixing minor API bugs that may have occurred as a result of manually
implementing VK functions.

As a part of moving to vk common, KGSL sync is now implemented
atop vk common sync and vastly expanded in terms of functionality
such as:
* Import/Export of sync FDs - A required capability for properly
  supporting the Android WSI and as these functions were stubbed
  when a presentation operation used semaphores, it would cause a
  leak of FDs that were imported due to the expectation that the
  driver would close them. As well as causing UB around due to
  ignoring the imported FD or not exporting a valid FD.
* Supporting pre-signalled fences - Vulkan allows fences to be
  created in a signalled state which was stubbed prior and can
  lead to UB.
* Timeline semaphore support - As a result of utilizing vk common
  as the backbone for synchronization, its timeline semaphore
  emulation has been utilized to provide support for them without
  needing kernel support. (Note: On newer versions of KGSL,
  timeline semaphores can be implemented natively rather than
  using emulation as they support wait-before-signal)

Fixes freezes due to semaphore usage with presentation on:
* Genshin Impact
* Skyline Emulator

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21651>
2023-03-13 18:59:50 +00:00
Pierre-Eric Pelloux-Prayer
88989379b1 Revert "driconf: add a workaround for plasmashell freezing"
This reverts commit 41eb491fb6.

The underlying issue was fixed by the previous commit.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20887>
2023-03-13 18:28:15 +00:00
Pierre-Eric Pelloux-Prayer
a98e4195f5 yegl/wayland: fix glthread deadlocks
We need to make sure that glthread is idle before using wl_*
functions or they might be used from 2 threads at the same
time.

Thanks to @deltib for the investigation of this issue.

Fixes: 58f90fd03f ("egl/wayland: fix glthread crashes")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7624
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8136
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20887>
2023-03-13 18:28:15 +00:00
Daniel Stone
95e8be29a7 ci/panfrost: Add texturesize flake seen in the wild
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20887>
2023-03-13 18:28:15 +00:00
Rob Clark
ea3e9d541f freedreno/a6xx: Simplify iova emit
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:24 +00:00
Danylo Piliaiev
5ca3481b5d freedreno/register: Define chip enum values
Otherwise it cannot be used in templates

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:24 +00:00
Rob Clark
6b2c1b00ff freedreno/registers: Define rest of CP_REG_WRITE
Enough that we can use OUT_PKT() to emit it, which will be needed when
we use it to write regs that are different btwn a6xx and a7xx.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:24 +00:00
Rob Clark
6dd5b4ca5f freedreno/registers: Fix nameless fields
Originally if we had an anonymous field (ie. field declared as part of
the register definition itself) the name in the generated field struct
would include the gen prefix (ie. .a6xx_rb_stencil_buffer_pitch), but
this doesn't work for variants because the variant regs would have
different gen prefixes.  Fix this by using reg name instead of the
full_name.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:24 +00:00
Rob Clark
dc43237d1a freedreno/registers: Add c++ magic for register variants
For regs with multiple variants, generate a template'ized function to
pack the reg value.  If the template param is known at compile time
(which is the expected usage) this will optimize to the same thing as
the "traditional" reg packing.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:24 +00:00
Rob Clark
d58af7b5c7 freedreno/registers: Split out regpair builder helper
We are going to want to re-use this in the next commit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:24 +00:00
Rob Clark
d54edcfc72 freedreno/registers: Track varset
Track varset and assert that variants refer to a valid varset enum
value.  This adds a bit of extra sanity checking, but becomes more
useful in the next commit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:23 +00:00
Rob Clark
f011189642 freedreno/registers: Start adding stuff for a7xx
Start adding the bits needed for userspace.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:23 +00:00
Rob Clark
b90d4a0701 freedreno/decode: Start adding a7xx support
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:23 +00:00
Rob Clark
dd6e7041ab freedreno/registers: Start adding a7xx pipe/control regs
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:23 +00:00
Rob Clark
56f9371f7e freedreno/registers: Merge a6xx and a7xx regs
They have more similarities than differences, so merge them and use
"variant" attribute as needed to manage differences.

Note initially using "variant" conservatively when it comes to regs
known on a7xx but not a6xx.  It could be that they exist also on later
versions of a6xx as well, for example.  For ex, LPAC related regs/bits
likely existed on later a6xx (eg. a660 family) but BV stuff is not.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:23 +00:00
Rob Clark
684931166d freedreno/registers: Add prefix="variant"
To merge a7xx and a6xx regs, using variant property to manage the
differences, we'll want regs/etc to be named according to the first
generation it is use rather than the domain name.  Add a new prefix
type to accomplish this.  By default, if no variant property, things
will still be named based on domain (ie. REG_A6XX_...), and things
that have variant="A6XX" will also end up as they currently are
(since the chip enum matches domain name), but things that have
variant="A7XX" will end up as REG_A7XX_...

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:23 +00:00
Rob Clark
fadf76b938 freedreno/registers: Fix designator order
C++ is picky about order matching for some reason.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:23 +00:00
Rob Clark
4a528e8f5f freedreno/a6xx: Convert to c++
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:23 +00:00
Rob Clark
ce336097f1 freedreno/a6xx: Fix designator initializer order
Clang seems more relaxed about this, allowing C99 style initializers
without requiring ordering.  But unfortunately g++ is more picky :-/

TODO this doesn't completely fix everything with g++, namely sparse
array initialization.. for ir3 driver-params, I think we can convert
these to structs.  But there are still one or two others to deal with.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:23 +00:00
Rob Clark
96ca37b9af freedreno/a6xx: Add missing "inline"
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
af2f0c3d9b freedreno/a6xx: Rework texture_clear fallback
C++ is more picky about a goto jumping over variable initialization,
even if unused after the goto label (presumably because of destructors
that can be called after a variable goes out of scope).  Since there is
only a single fallback path, get rid of the goto.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
f921b7c09b freedreno: c++-proofing
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
05958fa6c9 freedreno: Un-inline buffer-mask enum
Also, fix obsolete comment.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
37a036500a freedreno/ir3: Add missing driver params
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
5eed59cc87 freedreno/ir3+tu: Calculate subgroup size in ir3
TBD if the size changes for a7xx, but at least let's have it in one
place instead of duplicating in turnip and gallium.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
c449e63809 freedreno/ir3: c++-proof the headers
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
bff0ff5ae3 freedreno/ir3: Don't use negative opc for meta instructions
Stricter compilers complain about this, ie:

  error: left operand of shift expression ‘(-1 << 7)’ is negative [-fpermissive]

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
7c7761574e freedreno/ir3: Un-inline enums
It seems to be a thing that c++ dislikes

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
69947b284e freedreno: Quiet c++ warning about designated initializers
And various other things that c++ is more strict about.  Perhaps we
re-instate a few of the more reasonable warnings over time.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
64e93ca9a1 freedreno/registers: Add regs for a690
New regs needed on kernel side.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
44d0365a4d freedreno/registers: Schema validation for gen_header.py
Lets catch issues at build time, and not relying on someone remembering
to run the unit tests.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:22 +00:00
Rob Clark
963729af2a freedreno: Nerf strict-aliasing warning for all of gcc
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>
2023-03-13 17:31:21 +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
Jordan Justen
48ff68820e intel/dev: Enable MTL PCI ids
Ref: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/drm/i915_pciids.h?h=v6.0-rc4#n736
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18481>
2023-03-13 10:17:51 +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
Vinson Lee
29c6a09887 pps: Fix build errors.
In file included from ../src/tool/pps/pps_device.cc:10:
../src/tool/pps/pps_device.h:23:11: error: ‘uint32_t’ does not name a type
   23 |    static uint32_t device_count();
      |           ^~~~~~~~

In file included from ../src/tool/pps/pps_counter.cc:10:
../src/tool/pps/pps_counter.h:22:4: error: ‘uint32_t’ does not name a type
   22 |    uint32_t id;
      |    ^~~~~~~~

Fixes: 1cc72b2aef ("pps: Gfx-pps v0.3.0")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8186
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21714>
2023-03-13 01:22:46 +00:00
Marek Olšák
c455ea6144 glthread: qualify the *cmd unmarshal parameter with restrict
This seems like a logical thing to do. Clearly the memory can't be
accessed with any other pointer.

Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21777>
2023-03-12 17:56:18 -04:00
Marek Olšák
862b00b795 mesa: put dispatch table initialization into one place
We have 3 new/changed functions with this commit:
1. _mesa_alloc_dispatch_tables creates all dispatch tables that are not
   created on demand and sets them to nop. This operates on gl_dispatch,
   so it's reusable (e.g. glthread will want to use it)
2. _mesa_free_dispatch_tables frees everything
3. _mesa_initialize_dispatch_tables initializes gl_dispatch for GL
   (not glthread)

Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21777>
2023-03-12 17:56:16 -04:00
Marek Olšák
dae902e11e mesa: rename CurrentClientDispatch to GLApi
I like this more. The name self-documents itself. It's always equal
to the dispatch set in glapi.

GLAPI is a definition, so can't use that.

Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21777>
2023-03-12 17:56:15 -04:00
Marek Olšák
6b22642e21 mesa: move ctx->Table -> ctx->Dispatch.Table except Client & MarshalExec
There is a new struct gl_dispatch, which I'd like to reuse in glthread.
This allows building code around gl_dispatch that can be shared between
mesa and glthread. This is only refactoring.

Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21777>
2023-03-12 17:56:11 -04:00
Marek Olšák
ef0e327d9f glapi: inline the meson list files_mapi_util
so that people can easily tell where these files are used by searching
for the file names in the meson files.

Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21777>
2023-03-12 17:56:10 -04:00
Marek Olšák
eed145004b glapi: move files specific to shared-glapi into the shared-glapi subdirectory
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21777>
2023-03-12 17:56:03 -04:00
David Heidelberg
7cf7d497e7 ci/clover: disable the jobs
Prepare for Clover removal; don't waste resources on Clover anymore.

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21865>
2023-03-12 20:50:14 +01:00
Daniel Schürmann
3d4f6a00b8 aco/spill: allow for disconnected CFG
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20853>
2023-03-12 18:07:18 +00:00
Daniel Schürmann
caec48529b aco/insert_exec_mask: allow for disconnected CFG
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20853>
2023-03-12 18:07:18 +00:00
Daniel Schürmann
7f7a70778f aco/dead_code_analysis: don't add artificial uses to p_startpgm
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20853>
2023-03-12 18:07:18 +00:00
Daniel Schürmann
fb99bc5f30 aco/value_numbering: clear hashmap between disconnected CFGs
There is no dominance-relationship between two disconnected CFGs,
thus no CSE is possible.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20853>
2023-03-12 18:07:18 +00:00
Daniel Schürmann
678aef9f06 aco/dominance: set immediate dominator for any BB without predecessors
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20853>
2023-03-12 18:07:18 +00:00
Daniel Stone
8731721489 CI: Disable mingw job
mingw just hangs somewhere in Meson, with a totally unclear cause, when
trying to run winepath:

Program winepath found: YES (/usr/bin/winepath)
Running command: /usr/bin/winepath -w /builds/mesa/mesa/_build/src/util/process_test.exe
[... hangs forever ...]

root          27  0.0  0.0   4044  3232 ?        S    17:10   0:00 bash .gitlab-ci/meson/build.sh
root          35  0.0  0.0 2811920 55800 ?       Sl   17:10   0:00 Xvfb :0 -screen 0 1024x768x16
root          40  0.1  0.0  45484 40740 ?        S    17:10   0:00 /usr/bin/python3 /usr/local/bin/meson setup _build --native-file=native.file --wrap-mode=nofallback --force-fallback-for perfetto -D prefix=/builds/mesa/mesa/install -D libdir=lib -D buildtype=debug -D build-tests=true -D c_args=-Wno-error=format -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=sign-compare -Wno-error=narrowing -D cpp_args=-Wno-error=format -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=sign-compare -Wno-error=narrowing -D enable-glcpp-tests=false -D libunwind=disabled -D gallium-opencl=icd -D gallium-rusticl=false -D opencl-spirv=true -D microsoft-clc=enabled -D static-libclc=all -D llvm=enabled -D gallium-va=enabled -D video-codecs=h264dec,h264enc,h265dec,h265enc,vc1dec -D gallium-drivers=swrast,d3d12,zink -D vulkan-drivers=swrast,amd,microsoft-experimental -D video-codecs=h264dec,h264enc,h265dec,h265enc,vc1dec -D werror=true -D min-windows-version=7 -D spirv-to-dxil=true -D gles1=enabled -D gles2=enabled -D osmesa=true -D cpp_rtti=true -D shared-glapi=enabled -D zlib=enabled --cross-file=.gitlab-ci/x86_64-w64-mingw32
root        1366  0.0  0.0      0     0 ?        Z    17:10   0:00 [winepath.exe] <defunct>
root        1375  0.0  0.0   8544  7188 ?        Ss   17:10   0:00 /usr/lib/wine/wineserver64 -p0
root        1381  0.0  0.0 2018764 11080 ?       Ssl  17:10   0:00 C:\windows\system32\services.exe
root        1384  0.0  0.0 1821312 10044 ?       Sl   17:10   0:00 C:\windows\system32\plugplay.exe
root        1386  0.0  0.0 1856096 23016 ?       Sl   17:10   0:00 C:\windows\system32\explorer.exe /desktop
root        1393  0.0  0.0 1822712 11000 ?       Sl   17:10   0:00 C:\windows\system32\winedevice.exe
root        1402  0.0  0.0 1778832 21456 ?       S    17:10   0:00 winedbg --auto 26 80
root        1405  0.0  0.0 1891516 12192 ?       Sl   17:11   0:00 C:\windows\system32\winedevice.exe

Disable it until we can figure it out.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21864>
2023-03-12 17:25:12 +00:00
Daniel Stone
023d7e860e CI: Disable Windows runners
They are currently being rebuilt, with no firm ETA for their return.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21864>
2023-03-12 17:01:56 +00:00
Daniel Stone
5b697d1921 Revert "ci: Disable Collabora LAVA farm"
This reverts commit c1aa876747.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21864>
2023-03-12 17:01:44 +00:00
Kai Wasserbäch
bb2db56ffe fix: gallivm: fix LLVM #include of Host.h, moved to TargetParser
Upstream moved Host.h from Support to TargetParser in LLVM 17.

This shouldn't lead to a FTBFS, since there is a forwarding include left
behind. Sadly the added deprecation warning #pragma is invalid and thus
causes a build failure right away. But since we would have to follow the
move anyway in the future, just do it right away.

Reference: d768bf994f
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Closes: #8275
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21263>
2023-03-12 14:02:23 +00: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
ef5cba56a0 vulkan: Add vk_shader_module_init
This will be used for allocating shader modules using ralloc by RADV.

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
David Heidelberg
2b00eaaedc ci/iris: update apl and glk expectations, after enabling Wayland support
After enabling the Wayland platform for x86_64,
multiple new tests were triggered, some of which timed out.

Also wayland-dEQP-EGL.functional.negative_api.create_pixmap_surface now pass.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21786>
2023-03-12 00:11:09 +00:00
David Heidelberg
2f8073f87c ci: build Wayland support for the amd64
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21786>
2023-03-12 00:11:09 +00:00
Alyssa Rosenzweig
45554a957a agx: Lower discard late
Fixes regression with Dolphin's ubershaders.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21855>
2023-03-11 23:34:56 +00:00
Mike Blumenkrantz
c04a7c9267 zink: ignore renderdoc if ZINK_RENDERDOC isn't in use
this otherwise has some weird side effects

Fixes: 48a0478126 ("zink: add renderdoc handling")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21816>
2023-03-11 22:10:38 +00:00
Alyssa Rosenzweig
7e908878c1 ail: Restructure generated tests
Currently, the generated tests consist of some boilerplate, generated
test cases, and at the very end the actual test. This is bad for readability,
because the actual code is all the way at the bottom. It's also bad for
clang-format linting: even though the test cases are /* clang-format off */,
they still take an exceptionally long time to parse when linting. I suspect this
is a clang-format bug, but it's easy enough to workaround.

To solve these issues, restructure so that the test cases are in separate files
(containing the actual data), but the manually written test functions are
consolidated into a new family of generated layout tests. This is probably
cleaner.

Parallel clang-format linting is now 10x faster on the M1, which means it's
now practical to lint in my "publish branch" hook.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21854>
2023-03-11 20:45:42 +00:00
José Roberto de Souza
43e21702f6 anv: Integrate gem vm bind and unbind kmd backend functions
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21698>
2023-03-11 17:56:01 +00:00
José Roberto de Souza
37fa2fa30e anv: Add gem VM bind and unbind to backend
Not using it yet, that will be done in the next patch.
Xe only supports submission using VM.
For i915 the backend functions are just a noop.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21698>
2023-03-11 17:56:01 +00:00
José Roberto de Souza
324d22d684 anv: Implement gem close and mmap for Xe backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21698>
2023-03-11 17:56:01 +00:00
José Roberto de Souza
149e945ad4 anv: Implement Xe functions to create and destroy VM
Also using the vm_id to create gem buffers.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21698>
2023-03-11 17:56:01 +00:00
José Roberto de Souza
d5f767edf9 anv: Implement gem_create for Xe backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21698>
2023-03-11 17:56:01 +00:00
Isabella Basso
59fea8af3a nir/algebraic: remove duplicate bool conversion lowerings
While [1] added some boolean conversion lowering patterns, those were
already dealt with on [2].

[1] - b86305bb ("nir/algebraic: collapse conversion opcodes (many patterns)")
[2] - d7e0d47b ("nir/algebraic: nir: Add a bunch of b2[if] optimizations")

Fixes: b86305bb ("nir/algebraic: collapse conversion opcodes (many patterns)")
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Isabella Basso <isabellabdoamaral@usp.br>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20965>
2023-03-11 17:21:38 +00:00
Isabella Basso
a553d3cd29 nir/algebraic: make patterns for float conversion lowerings imprecise
As noted on [1], lowering patterns of the form
floatS -> floatB -> floatS ==> floatS
cannot require precision since this may cause flush denorming.

[1] 3f779013 ("nir: Add an algebraic optimization for float->double->float")

Fixes: b86305bb ("nir/algebraic: collapse conversion opcodes (many patterns)")
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Isabella Basso <isabellabdoamaral@usp.br>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20965>
2023-03-11 17:21:37 +00:00
Isabella Basso
79c94ef52e nir/algebraic: extend lowering patterns for conversions on smaller bit sizes
Conversions on smaller bit sizes should also be collapsed when composed.

This also adds more patterns on the
intS -> intB -> floatB ==> intS -> floatB
lowering so as to deal with any int size C > B instead of a fixed intB.

Closes: #7776
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Isabella Basso <isabellabdoamaral@usp.br>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20965>
2023-03-11 17:21:37 +00:00
Isabella Basso
a27bcd63d0 nir/algebraic: extend mediump patterns
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Suggested-by: Italo Nicola <italonicola@collabora.com>
Signed-off-by: Isabella Basso <isabellabdoamaral@usp.br>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20965>
2023-03-11 17:21:37 +00:00
Isabella Basso
b3685f3ba7 nir/algebraic: insert patterns inside optimizations list
Some patterns were outside the list of optimizations.

Fixes: b86305bb ("nir/algebraic: collapse conversion opcodes (many patterns)")

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Isabella Basso <isabellabdoamaral@usp.br>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20965>
2023-03-11 17:21:37 +00:00
Alyssa Rosenzweig
2ba48eea88 nir/lower_point_size: Use shader_instructions_pass
Sleepy code deletion mood.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21750>
2023-03-11 16:42:36 +00:00
Alyssa Rosenzweig
933b5c76f6 agx: Switch to scoped_barrier
Rather than ingesting separate control and memory barriers, ingest only the
combined and optimized scoped_barrier intrinsic. For barriers originating from
GLSL, this makes it easier to ensure correctness. For barriers originating from
SPIR-V, this is required for translation at all, as spirv_to_nir knows only
scoped barriers. So this gets us closer to Vulkan and OpenCL.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21752>
2023-03-11 16:20:06 +00:00
David Heidelberg
84767a5160 ci/lava: every LAVA job doesn't want to run gles2 deqp, drop it
Very annoying when adding new job and not getting failure due to missing
`DEQP_VER: `

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21702>
2023-03-11 14:48:20 +00:00
David Heidelberg
8cdbb894ca ci/panfrost: correct the job name, as it runs on gles2
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21702>
2023-03-11 14:48:20 +00:00
David Heidelberg
e3660c2820 ci/amd: move skqp and va jobs on raven from XOrg to the XWayland
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21702>
2023-03-11 14:48:20 +00:00
David Heidelberg
1e262f129b ci: add and utilize dalboz devices
New 10 devices - asus-CM1400CXA-dalboz hosted on Collabora farm.

1x Move VA-API tests to the dalboz (more resources). One timeout dropped.
9x Run VKCTS on dalboz.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21702>
2023-03-11 14:48:20 +00:00
Sil Vilerino
3067bda0f3 d3d12: Fix video decode for interlaced streams with reference only textures required
Fixes: d8206f6286 ("d3d12: Add video decode implementation of pipe_video_codec")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21832>
2023-03-11 14:31:32 +00:00
Alyssa Rosenzweig
b768a254f7 agx: Use nir_lower_mem_access_bit_sizes
Lowers away 64-bit loads, which we'll create in the sysval lowering for
dynamically indexed UBOs/VBOs. The lowering generates pack_64_2x32 instructions,
so lower those too.

No shader-db changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21674>
2023-03-11 14:15:50 +00:00
Alyssa Rosenzweig
8a53050d7d agx: Implement extract_[ui]16
Instead of lowering to bitwise ops. Yet another way of subdividing in NIR.
Probably insignificant but makes it easy to check that the pass ordering from the
previous pass is right. It does let us get much better codegen for
unpacksnorm2x16, whatever that's worth.

No shader-db changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21674>
2023-03-11 14:15:50 +00:00
Alyssa Rosenzweig
706815488e agx: Fix subdivision coalescing
As intended. We can't CSE with partial null destinations in the way, so we
shouldn't eliminate dead destinations until after CSE has run. But we should
still eliminate dead instructions to ensure CSE doesn't move things around
needlessly, hurting register pressure.

Noticed while debugging live range splitting.

No GLES3.0 shader-db changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21674>
2023-03-11 14:15:50 +00:00
Alyssa Rosenzweig
5ea9c2e634 agx: Make partial DCE optional
Our dead code elimination pass does two things:

1. delete instructions that are entirely unnecessary
2. delete unnecessary destinations of necessary instructions

To deal with pass ordering issues, we sometimes want to do #1 without #2.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21674>
2023-03-11 14:15:50 +00:00
Alyssa Rosenzweig
16f8bfb042 agx: Don't set lower_pack_split
We should handle nir_op_unpack_32_2x16_split_* natively, since we can generate
better code with agx_subdivide (coalescing the ops away) than the bitshift
lowering.

That said, we do need some extra instructions for the floating point
conversions.

No shader-db changes (which makes sense because we're targetting the GLES3.0
shader-db, which doesn't have the packing GLSL functions).

The real motivation of this change isn't optimizing some GLSL pack functions,
though, it's avoiding a code regression from using NIR's memory bit size
lowering in a future MR. That lowering will turn things like "load i16vec4" into
"load i32vec2 + unpack_32_2x16", so we need to be able to coalesce that unpack.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21674>
2023-03-11 14:15:50 +00:00
Daniel Stone
c1aa876747 ci: Disable Collabora LAVA farm
Looks like a power or network issue.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21851>
2023-03-11 11:59:31 +00:00
Eric Engestrom
9cf636834c ci: take valve farm offline
It seems to be experiencing networking issues

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21851>
2023-03-11 11:59:18 +00:00
Daniel Stone
50378f59a7 ci: Actually run Piglit on LAVA
At some point in a refactoring long ago, our 'Piglit' runs on arm64
started actually being dEQP-GLES2 runs. Oh dear.

Surprisingly, there are a number of expectation changes; added every
fail I saw from a long overnight stress test.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21851>
2023-03-11 11:58:30 +00:00
Alyssa Rosenzweig
b190d08a8a pan/mdg: Remove reference to removed macro
This will soon be more confusing than helpful.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20445>
2023-03-11 06:30:02 +00:00
Alyssa Rosenzweig
cc16e7322f panfrost: Remove MALI_POSITIVE macro
Now unused.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20445>
2023-03-11 06:30:02 +00:00
Alyssa Rosenzweig
131845eb84 panfrost: Inline the last MALI_POSITIVE use
Big shrug on this one.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20445>
2023-03-11 06:30:02 +00:00
Alyssa Rosenzweig
14eb964e59 panfrost: Remove FBD tag enum from XML
This was a hack to avoid modelling the full data structure.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20445>
2023-03-11 06:30:02 +00:00
Alyssa Rosenzweig
67cbbf9417 panfrost: Use framebuffer pointer XML
Rather than manipulating the raw pointers. This is cleaner.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20445>
2023-03-11 06:30:02 +00:00
Alyssa Rosenzweig
1a5546293c panfrost: Add XML for framebuffer pointers
We shouldn't have to open-code these. They are real data structures, model them
as such in the architecture XML files.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20445>
2023-03-11 06:30:02 +00:00
Alyssa Rosenzweig
35985be275 panfrost: Handle fixed-point packing in GenXML
Minimum/maximum LOD and LOD bias are unsigned and signed fixed point formats
respectively. They are not unsigned integers. Introduce fixed-point types into
our GenXML and use them in the XML, rather than packing in sidebands. This makes
the XML more correct and fixes pretty-printing of texture and sampler
descriptors.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20445>
2023-03-11 06:30:02 +00:00
Alyssa Rosenzweig
17c55e0d12 panfrost: Don't use DECODE_FIXED16 for sample position
Strictly this is a signed fixed-point, anyway.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20445>
2023-03-11 06:30:02 +00:00
Alyssa Rosenzweig
e0752673be docs/panfrost: Move description of instancing
Connor Abbott wrote a nice explanation of how instance divisors work on Mali.
Let's add it to the driver docs instead of letting it languish in a forgotten
header file.

This is mostly pasted from the existing header in tree, with a few local changes
applied.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20445>
2023-03-11 06:30:02 +00:00
Alyssa Rosenzweig
07b43d6231 panfrost: Remove some unused definitions
Nowadays, formats are defined with GenXML, not the old panfrost-job.h, so most
of the format #defines in panfrost-job.h are unused. That said, a few are still
in use as a backdoor for compressed format queries to avoid a GenXML dependency.
That's not great but cleaning that up isn't the subject of this MR.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20445>
2023-03-11 06:30:02 +00:00
Felix DeGrood
341f1011a6 intel/perf: Hide extended metrics by default
XE architecture enables many more metrics, perhaps too many for
the average user. Reduce reported metrics to smaller subset,
known as non-extended metrics, by default. Can re-enable extended
metrics with env var INTEL_EXTENDED_METRICS=1

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21841>
2023-03-11 05:05:06 +00:00
Alyssa Rosenzweig
6b22a02f90 asahi,agx: Implement buffer textures with gnarly NIR
Implement buffer textures in full generality.  There are a few issues here:

* OpenGL requires buffer textures support a minimum size of 65536 elements,
  however 1D textures in AGX are (at most) 8192 elements.

* OpenGL 4.0 (and OpenGL ES) require buffer textures to support the "RGB32"
  texture formats. These are 3 packed channels of 32-bits each. In general,
  non-power-of-two texel sizes are problematic. AGX does not support any such
  formats and we rely on the GL frontend to lower to a padded format (RGBX) if
  necessary. Such a lowering cannot work for buffer textures, however, so we
  need to find a way to implement RGB32 buffer textures.

We solve these issues in the follow way:

* Use 2D texture descriptors for buffer textures, with a large fixed
  power-of-two size along one axis. Then large texel indices may be accessed at
  a small vec2 texel coordinate, and since the fixed dimension is a
  power-of-two, that vector may be recovered by simply shifting and masking.
  This effectively avoids size restriction. We do need to clamp texel indices to
  the buffer size to avoid faulting on OOB reads, since we may read past the end
  of the buffer (if the app binds a non-page-aligned offset into the buffer).

* Use a general purpose memory load for RGB32 buffer textures. Lower the texture
  load instruction to a memory load from the buffer and some address arithmetic.
  There's no format conversion needed for RGB32, other than maybe filling in a
  format-appropriate alpha, so this is straightforward. Again, we need to clamp
  the texel index for robustness with OOB reads.

Each of these solutions brings its own problem.

* Using 2D textures instead of 1D requires physically rounding up the buffer
  size when packing the descriptor, so we can no longer implement textureSize()
  by reading off the texture descriptor like normal.

* We don't know at compile-time whether a given texture load will read from an
  RGB32 buffer texture or not, so we need to emit code for both. In Vulkan, we
  can't key the shader to this property, either, since it's descriptor set state
  and not pipeline state.

And each of these problems in turn brings its own solution:

* The texture descriptor is linear, so the "compression buffer address" field is
  ignored by the hardware. We stash the real buffer size there so that
  textureSize becomes a load from the texture descriptor like usual, without
  requiring a sideband (which would complicate bindless textures).

* If we determine a texture descriptor contains RGB32 data, then it will never
  be interpreted by the hardware and hence does not need to be a valid texture
  descriptor. So, we extend the hardware's format enum to contain a
  software-defined RGB32 format enum. Then, when lowering texture buffer loads,
  we either read it as a typed RGB32 memory load or as a texture load depending
  on the value of the format field in the texture descriptor.

All of this is accomplished with a big NIR pass generating a pile of strange
looking code. But it should be good enough in practice for this silly feature.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21672>
2023-03-11 02:26:31 +00:00
Alyssa Rosenzweig
826649ba19 asahi, agx: Implement dummy samplers
In NIR, texelFetch (txf) does not use a sampler, but in AGX, it does -- even
though the contents of the sampler are semantically irrelevant. Rather than
requiring the state tracker to bind a sampler anyway (indicated for texture
buffers with PIPE_CAP_TEXTURE_BUFFER_SAMPLER), just add a dummy sampler
ourselves if txf is used and there are otherwise no samplers. This is helpful
because PIPE_CAP_TEXTURE_BUFFER_SAMPLER isn't honoured by Rusticl or seemingly
mesa/st's PBO code, and after implementing this dummy sampler workaround in
Panfrost for Rusticl, I realized this CAP is silly and shouldn't exist in the
first place. (And I regret pushing for its reinclusion.)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21672>
2023-03-11 02:26:31 +00:00
Guilherme Gallo
bc178c044e ci/baremetal: Wrap artifact download curl with xtrace
Setting `set -x`can be useful to known via trace which URL baremetal
used to download artifacts.
Today its only printed the command with the environment variables.

Also, this commit fixes multiple `section_end` for the related Gitlab
sections.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21804>
2023-03-10 21:40:23 +00:00
Guilherme Gallo
256e7888fd ci: Fix release build use for performance jobs
This commit ensures that we are using mesa release builds in performance
jobs.

To achieve that, some modifications were made on top of
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21492.

- Append the `BUILDTYPE` variable into the S3 artifact name
  (MINIO_ARTIFACT_NAME environment variable) to allow for better
  artifact management.

- The ./artifacts directory has been added to the list of artifact
  directories for build-common. This ensures that the debian-release and
  debian-arm64-release jobs are the only ones necessary for running
  performance jobs. These jobs only produce artifacts via
  prepare-artifacts.sh when we are under performance workflow.

- Make lava-submit.sh behave similar to baremetal jobs regarding
  MINIO_ARTIFACT_NAME variable. For example, users can now easily
  differentiate between mesa-arm64.tar.zstd and
  mesa-arm64-release.tar.zstd by looking inside the `Downloading
  artifacts from s3` Gitlab section.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21804>
2023-03-10 21:40:23 +00:00
José Roberto de Souza
91a129b44a iris: Move i915 submit_batch() to i915 backend
No changes in behavior intented here.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21700>
2023-03-10 20:13:56 +00:00
José Roberto de Souza
21d5034edb iris: Add batch_check_for_reset() to kmd backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21700>
2023-03-10 20:13:56 +00:00
José Roberto de Souza
e0ce31d7cf iris: Add gem_mmap() to kmd backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21700>
2023-03-10 20:13:56 +00:00
José Roberto de Souza
c5888bf610 build: Block build of HASVK, Crocus and i915 in non-x86 architectures
HASVK, Crocus and i915 drivers only supports integrated GPUs.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21773>
2023-03-10 19:41:14 +00:00
José Roberto de Souza
757e2dd692 intel/perf: Disable it for Xe KMD
Xe still don't have support for performance metrics.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21773>
2023-03-10 19:41:14 +00:00
José Roberto de Souza
266d961fdc iris: Don't mark protected bo as reusable
The check in alloc_bo_from_cache() was skiping any try to get a bo
from cache but after use a protected bo was still being put in some
cache bucket and could be used for cases that don't require a
protected bo.

Using a protected bo in cases that don't require it can have
performance implications.

So here returning NULL when trying to get a cache bucket for a
protected bo, this will cause bo->real.reusable to be set to false
avoiding the bo to be reused.

Fixes: 9402ac8023 ("iris: handle protected BO creation")
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21824>
2023-03-10 18:59:59 +00:00
Alyssa Rosenzweig
e61d6540e6 asahi: Don't allow linear depth/stencil buffers
We don't have a way to tell the ZLS hardware to use linear buffers, so if a
buffer could be used for depth/stencil, we have to twiddle. This isn't a problem
in practice, since depth/stencil buffers can't be shared across processes or
mapped directly as linear.

Fixes faults in depthstencil-render-miplevels, which was picking linear for one
buffer because of a STAGING bind flag. But that won't work :-)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21753>
2023-03-10 18:29:52 +00:00
Daniel Stone
e61d022313 ci/android: Use a more aggressive timeout for the job
This job sometimes - very, very, rarely - fails to start Cuttlefish,
the Android VM environment. Given that we don't have any structural
monitoring and restarting (unlike LAVA/BM/B2C) for this, just stick a
more aggressive timeout on the job, so it'll be retried if it fails to
start.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21837>
2023-03-10 16:39:36 +00:00
Ian Romanick
0cadc3830f nir/lower_int64: Optionally lower ufind_msb using uadd_sat
v2: Fix inverted condition for applying the optimization. Noticed by
Ken.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
2023-03-10 15:27:17 +00:00
Ian Romanick
831f9d3f61 nir/algebraic: Optimize some ifind_msb to ufind_msb
On Intel platforms, the uclz lowering if ufind_msb is either one
instruction better (Gfx7 and newer) or two instructions better (all
older platforms) than the ifind_msb implementations.

On platforms that use lower_find_msb_to_reverse, there should be no
difference.

All Haswell and newer Intel platforms had similar results. (Ice Lake shown)
total instructions in shared programs: 19938662 -> 19938634 (<.01%)
instructions in affected programs: 850 -> 822 (-3.29%)
helped: 2 / HURT: 0

total cycles in shared programs: 858467067 -> 858465538 (<.01%)
cycles in affected programs: 10080 -> 8551 (-15.17%)
helped: 2 / HURT: 0

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
2023-03-10 15:27:17 +00:00
Ian Romanick
db6d1edc1b nir: Restrict ufind_msb and ufind_msb_rev to 32- or 64-bit sources
4d802df3aa loosened the type restrictions
on these opcodes to enable support for 64-bit ballot operations.  In
doing so, it enabled 8-bit and 16-bit sizes as well.

It's impossible to get these sizes through GLSL or SPIR-V.  None of the
lowering in nir_opt_algebraic can handle non-32-bit sizes.  Almost no
drivers can handle non-32-bit sizes.

It doesn't seem possible to enforce anything other than "one bit size"
or "all bit sizes" in nir_opcodes.py.  The only way it seems possible to
enforce this is in nir_validate.  This is not ideal, but it be what it
be.

v2: Remove restriction on find_lsb. It is acutally possible to get this
via GLSL by doing findLSB() on a lowp value. findMSB declares its
parameter as highp, so that path is still impossible.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
2023-03-10 15:27:17 +00:00
Ian Romanick
2d6f48f6ef nir/algebraic: Do not generate 8- or 16-bit find_msb
The next commit will add validation to restrict this instruction (and
others) to only 32-bit or 64-bit sources.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
2023-03-10 15:27:17 +00:00
Ian Romanick
2119ab7319 nir/builder: Do not generate 8- or 16-bit find_msb
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
2023-03-10 15:27:17 +00:00
Ian Romanick
28311f9d02 nir: intel/compiler: Move ufind_msb lowering to NIR
Fossil-db results:

All Intel platforms had similar results. (Ice Lake shown)
Cycles in all programs: 9098346105 -> 9098333765 (-0.0%)
Cycles helped: 6

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
2023-03-10 15:27:17 +00:00
Ian Romanick
a4052e70ea nir/algebraic: Only lower ufind_msb with 32-bit sources
The 31-ufind_msb_rev(x) lowering only produces the correct result for
32-bit sources. ufind_msb_rev can also have 64-bit sources, and most
platforms are expected to lower this to 32-bit instructions with extra
logic operations.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
2023-03-10 15:27:17 +00:00
Ian Romanick
08ca862ef8 intel/compiler: Tighter src and dest size bounds checking for some opcodes
Enforce the sizes listed in the Skylake PRM:

BFREV:
    source types: *D
    destination types: *D

CBIT:
    source types: UB, UW, UD
    destination types: UD

FBH:
    source types: D, UD
    destination types: UD

FBL:
    source types: UD
    destination types: UD

LZD:
    source types: D, UD
    destination types: UD

v2: Update BFREV commit message documentation. Suggested by Ken.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
2023-03-10 15:27:17 +00:00
Ian Romanick
0cc7bf63b7 nir: intel/compiler: Move ifind_msb lowering to NIR
Unlike ufind_msb, ifind_msb is only defined in NIR for 32-bit values, so
no @32 annotation is required.

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

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
2023-03-10 15:27:17 +00:00
Ian Romanick
15c6c859cf intel/compiler: Lower find_lsb in NIR
No shader-db or fossil-db changes on any Intel platform.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
2023-03-10 15:27:17 +00:00
Ian Romanick
66840b98e4 nir: ifind_msb_rev can only have int32 sources
Just like ifind_msb.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19042>
2023-03-10 15:27:17 +00:00
antonino
29be4e9e9b zink: fix stipple pattern in oblique lines
Stipple lines now appear correctly when they are oblique.

Previously the number of steps of the stipple counter between two vertices
was calculated as the euclidian distance between them in screen space, however
the length occupied by pixel along a line is only `1` for lines that are either
vertical or horizontal and will be anywhere between `1` and `sqrt(2)`
for other cases.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21290>
2023-03-10 14:52:01 +00:00
Alyssa Rosenzweig
ee6785309e agx: Handle indirect texture/samplers
Get the texture/sampler index from the texture/sampler_offset source (which
is an offset from 0 thanks to the lower_index_to_offset lowering) and feed it in
as corresponding 16-bit texture instruction sources.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21704>
2023-03-10 14:14:42 +00:00
Alyssa Rosenzweig
e12bf97153 agx: Pack indirect texture/sampler handles
For indirect indexing into the binding table. Note this does not handle packing
the bindless forms, since that's a bit more involved.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21704>
2023-03-10 14:14:42 +00:00
Erik Faye-Lund
30b456021c docs/zink: fixup wording of the GL 4.6 requirements
Seems the copy-pasta was strong in this one. Whoops!

Fixes: 5deac5c156 ("docs: document zink GL 4.6 requirements")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21813>
2023-03-10 14:02:07 +00:00
Erik Faye-Lund
d6ce7bc020 docs/zink: remove some trailing spaces
These went unnoticed until now, let's fix them.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21813>
2023-03-10 14:02:07 +00:00
Erik Faye-Lund
33d7592489 docs/zink: use vk-feat role for features
This gives us links to the features, instead of just mentioning them.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21813>
2023-03-10 14:02:06 +00:00
Erik Faye-Lund
923a41ac99 docs: implement new vk-feat role
This makes it easy to link to a specific Vulkan feature from the docs.
Useful for the Zink docs.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21813>
2023-03-10 14:02:06 +00:00
Pino Toscano
9d42e31b54 symbols-check: support OSes based on GNU toolchain
Some of the symbols listed in PLATFORM_SYMBOLS are not only specific
to Linux, but rather specific to the GNU toolchain. Hence, use them
when inspecting ELF binaries produced by a GNU toolchain: this means
on Hurd ('GNU'), and on e.g. kFreeBSD ('GNU/kFreeBSD').

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21825>
2023-03-10 13:25:48 +00:00
Mike Blumenkrantz
e5b29e6735 Revert "Revert "ci: disable mesa-swrast runner jobs""
This reverts commit 7ae0d9d2e8.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21836>
2023-03-10 12:37:56 +00:00
Eric Engestrom
e29772f134 v3dv: split out broadcom_shader_stage_to_gl() calls to improve readability
This is an inline function with a compile-constant switch, so I expect
the compiler wouldn't produce any better code like this, but for humans
it's easier to read when function calls are not embedded into other
function calls.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21835>
2023-03-10 10:38:43 +00:00
Eric Engestrom
f5d3d1e7ed meson: inline gtest_test_protocol now that it's always 'gtest'
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21485>
2023-03-10 07:20:29 +00:00
Eric Engestrom
a18f439f52 meson: allow feature options to take true/false to mean enabled/disabled
This reduces the pain of Meson having picked inconsistent value names.

See also https://github.com/mesonbuild/meson/pull/11279 where Meson devs
argue that allowing `foo=false` could be interpreted by users to mean
either `disabled` or `auto`, which I personally don't see.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21485>
2023-03-10 07:20:29 +00:00
Eric Engestrom
049086cd58 meson: bump minimum version to 0.60
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21485>
2023-03-10 07:20:29 +00:00
Sagar Ghuge
9a34b2ab0e intel/compiler: Add swsb_stall debug option
When enabled, on gfx12 plus, we will add the sync nop instruction after
each instruction to make sure that current instruction depends on the
previous instruction explicitly.

This option will help us to get a hint if something is missing or broken
in software scoreboard pass.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21797>
2023-03-10 06:55:39 +00:00
Alyssa Rosenzweig
cdf63e6dce agx: Fix clang-formatting
Not sure how this one slipped in.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21828>
2023-03-10 06:33:01 +00:00
Emma Anholt
7ae0d9d2e8 Revert "ci: disable mesa-swrast runner jobs"
This reverts commit aef0f3efdf.

We've got a new set of runners now (mesa-swrast-4, 5, and 7 because
counting is hard)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21826>
2023-03-10 04:04:59 +00:00
Lionel Landwerlin
5aec829f97 iris: trace frames with u_trace
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/21648>
2023-03-10 00:36:41 +00:00
Lionel Landwerlin
2cc9791cd3 docs: fix invalid link
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/21648>
2023-03-10 00:36:40 +00:00
Kenneth Graunke
dfe652fb03 intel/eu: Simplify brw_F32TO16 and brw_F16TO32
Now that we aren't using them on Gfx8+ we can drop a lot of cruft.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21783>
2023-03-09 23:26:17 +00:00
Kenneth Graunke
c590a3eadf intel/fs: Move packHalf2x16 handling to lower_pack()
This mainly lets the software scoreboarding pass correctly mark the
instructions, without needing to resort to fragile manual handling in
the generator.

We can also make small improvements.  On Gfx 8LP-12.0, we no longer have
the restrictions about DWord alignment, so we can simply write each half
into its intended location, rather than writing it to the low DWord and
then shifting it in place.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21783>
2023-03-09 23:26:17 +00:00
Kenneth Graunke
f5e5705c91 intel/fs: Use F32TO16/F16TO32 helpers in fquantize16 handling
I originally thought that we were intentionally emitting the legacy
opcodes here to make them opaque to the optimizer, so that it wouldn't
eliminate the explicit type conversions, as they're actually required
to do the quantization.  But...we don't actually optimize those away
currently anyway.  So...go ahead and use the helpers for consistency.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21783>
2023-03-09 23:26:17 +00:00
Kenneth Graunke
44c6ccb197 Revert "intel/fs: Fix inferred_sync_pipe for F16TO32 opcodes"
With the previous patch, we no longer need to special case this, as we
emit a MOV with an HF source, rather than F16TO32 with an UW source,
on all platforms that need scoreboarding.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21783>
2023-03-09 23:26:17 +00:00
Kenneth Graunke
309ec3725a intel/fs: Use new F16TO32 helpers for unpack_half_split_* opcodes
This gets us a MOV at the IR level on Gfx8+ which should be more
optimizable than F16TO32.  It also removes confusion about which
pipe which the instruction will run on.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21783>
2023-03-09 23:26:17 +00:00
Kenneth Graunke
78bf53904e intel/fs: Delete a TODO about using brw_F32TO16.
We can just use the new builder helpers to get the optimization
advantages of a MOV on Gfx8+ while also getting the necessary F32TO16
on Gfx7.x and yet not worry too hard about it.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21783>
2023-03-09 23:26:17 +00:00
Kenneth Graunke
966995d911 intel/fs: Add builder helpers for F32TO16/F16TO32 that work on Gfx7.x
These take care of emitting the F32TO16/F16TO32 instructions on Gfx7.x
but otherwise just emit a type converting MOV on Gfx8+.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21783>
2023-03-09 23:26:17 +00:00
Kenneth Graunke
3864049184 intel/fs: Fix inferred_sync_pipe for F16TO32 opcodes
For converting half-float to float, we currently emit BRW_OPCODE_F16TO32
with a UW source, to match legacy Gfx7 behavior.  In the generator, this
becomes a MOV with a HF source on Gfx8+.  Unfortunately, this UW source
confuses the scoreboarding pass into thinking it's an integer source,
leading to incorrect SWSB annotations on Alchemist.

We should ultimately fix the IR to stop being so...legacy...here, but
this is the simplest fix for stable branches.

Fixes misrendering in Elden Ring and likely Sekiro: Shadows Die Twice.

Cc: mesa-stable
Tested-by: Chuansheng Liu <chuansheng.liu@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
References: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8018
References: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8375
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21783>
2023-03-09 23:26:17 +00:00
Mark Janes
4978db6b9e intel: use generated workaround helpers for Wa_1409600907
Wa_1409600907 was enabled for gen12+.  It should not be applied for
platforms after gen12.0.  Use generated helpers to ensure application
to all relevant platforms.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21743>
2023-03-09 22:56:51 +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
David Heidelberg
6a1be0fb95 ci/weston: add background PID
Needed for process tracking for LAVA.

Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21711>
2023-03-09 21:06:16 +00:00
David Heidelberg
5052185039 ci/weston: before testing, verify that XWayland is really running
When Xorg already running, Weston XWayland should pick DISPLAY=:1

Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21711>
2023-03-09 21:06:16 +00:00
David Heidelberg
675f757ffb ci/lava: implement the priority
Before: kernelci 38; Mesa3D 75

Priority now:
 - 38 ‒ kernelci
 - 40 ‒ after merge and performance
 - 50 ‒ user runs
 - 75 ‒ marge-bot (MUST be prioritized)

Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21812>
2023-03-09 20:28:07 +00:00
Daniel Stone
ae893089e9 ci/radv: Lower stoney CTS load
CTS runs on stoney are currently taking ~20min to complete, which seems
to have begun with the upgrade to CTS 1.3.5.0. This is a bit too long in
and of itself, but it means that - assuming zero contention - a job that
has to be retried because the machine hung can take 40 minutes.

Aim to drop this to 15min turnaround by lowering the overall fraction
from 1/8th of the CTS to 1/11th.

As the jobs we run have been reshuffled, this adds a lot more expected
fails. As most of them categorise easily into patterns, group the
failures together in the file. Non-strict wide lines has passed since we
last ran it; the other failures all group into existing classes seen
for a long time.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21791>
2023-03-09 19:34:58 +00:00
Daniel Stone
f07c69d8b6 ci/zink: Add flake seen in the wild
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21820>
2023-03-09 19:15:13 +00:00
David Heidelberg
aef0f3efdf ci: disable mesa-swrast runner jobs
Temporarily.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21815>
2023-03-09 18:01:09 +00:00
Daniel Stone
6f1aa8cfc1 ci/fdno: Add a618 Vulkan flakes
It looks like descriptors are generically a bit broken, which takes out
a massive number of tests periodically.

The pipeline-library tests also have some unknowable issues.

cf. #8219

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21740>
2023-03-09 14:47:57 +00:00
Georg Lehmann
13ff4a5f64 aco: use bitfield_array for temporary neg/abs/opsel
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21766>
2023-03-09 14:15:14 +00:00
Georg Lehmann
d0eebb0e8b aco: access neg/abs as int in usesModifiers
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21766>
2023-03-09 14:15:14 +00:00
Georg Lehmann
828aff2a2d aco: use array indexing for opsel/opsel_lo/opsel_hi
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21766>
2023-03-09 14:15:13 +00:00
Georg Lehmann
a47c3f84fb aco: use integer access for neg_lo/neg_hi
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21766>
2023-03-09 14:15:13 +00:00
Georg Lehmann
60cd3ba39f aco: copy abs/neg with assignment
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21766>
2023-03-09 14:15:13 +00:00
Tapani Pälli
5fdbc4a23e intel/isl: disable TILE64 for YCRCB formats
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21723>
2023-03-09 13:50:39 +00:00
Daniel Stone
fad9c69e42 ci/radv: Drop raven quick_shader load
It currently takes ~21 minutes to complete. That's not quick.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21793>
2023-03-09 09:56:31 +00:00
Eric Engestrom
a19739f1b0 v3dv/ci: add a test to the known failures
New test since the 1.3.5 update, and running it on older mesa it would
have always failed, so it's not a regression
-> let's just mark it as a known failure

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21792>
2023-03-09 09:19:21 +00:00
Emma Anholt
ec513270e3 zink: Pass the cmdbuf to the end of the marker, too.
Otherwise the end wanders off to some unrelated cmdbuf.

Fixes: 271ebdd735 ("zink: pass cmdbuf to debug marker begin")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21799>
2023-03-09 06:53:37 +00:00
David Heidelberg
11a4e10fe2 ci/zink: fixup the zink-lvp job
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8501
Fixes: 4cc0cec473 ("ci: implement unified sections")

Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21796>
2023-03-09 06:27:39 +00:00
antonino
27c8d6ca7b drirc: set zink_emulate_point_smooth for Quake II
Quake II uses GL_POINT_SMOOTH to render particles.
Zink currently requires `zink_emulate_point_smooth` to support that feature.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21731>
2023-03-09 04:38:24 +00:00
antonino
ffe36abf7c zink: handle point_smooth emulation
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21731>
2023-03-09 04:38:24 +00:00
antonino
3a59b2a670 nir: handle output beeing written to deref in nir_lower_point_smooth
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21731>
2023-03-09 04:38:24 +00:00
antonino
4b07182c8c zink/nir_to_spirv: add support for nir_intrinsic_load_point_coord
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21731>
2023-03-09 04:38:24 +00:00
antonino
e121b6d9eb zink: add lower_point_smooth to zink_fs_key
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21731>
2023-03-09 04:38:24 +00:00
antonino
c32a5b8d04 zink: add zink_emulate_point_smooth driconf
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21731>
2023-03-09 04:38:24 +00:00
antonino
e280d6a7c9 zink: fix line smooth lowering
Fixes: 80285db9ef ("zink: lower smooth-lines if not supported")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21731>
2023-03-09 04:38:24 +00:00
Eric Engestrom
5f5e30b5bb docs: update calendar for 22.3.7
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21795>
2023-03-09 03:31:23 +00:00
Eric Engestrom
1f61bca5fe docs/relnotes: add sha256sum for 22.3.7
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21795>
2023-03-09 03:31:23 +00:00
Eric Engestrom
2488afec11 docs: add release notes for 22.3.7
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21795>
2023-03-09 03:31:23 +00:00
Dylan Baker
b8b0a0d135 docs/relnotes: add 23.0.0 to relnotes.rst
I used an old version of the script to generate the notes, which didn't
generate this. It is being kept separate instead of being squashed so
that the commits on the 23.0 branch and those on main match

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21500>
2023-03-09 03:25:31 +00:00
Dylan Baker
b687a62566 docs: Add sha256 sum for 23.0.0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21500>
2023-03-09 03:25:31 +00:00
Dylan Baker
882c4ef59b docs: add release notes for 23.0.0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21500>
2023-03-09 03:25:31 +00:00
Dylan Baker
0ad320af12 docs: Add calendar entries for 23.0 release.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21500>
2023-03-09 03:25:31 +00:00
Eric Engestrom
c28f144c81 osmesa: add exported symbols check
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1308>
2023-03-09 02:55:49 +00:00
Emma Anholt
8b75b72613 anv+hasvk: Use driconf to disable 16-bit for zink.
The HW can technically execute 16-bit operations, but the restrictions on
16-bit ALU ops are so great that it ends up not being a win for
GLES-on-Vulkan to lower mediump to 16-bit operations, at least with the
current state of the Intel compiler.  This brings zink-on-anv in line with
iris and angle-on-anv for mediump behavior (ANGLE uses RelaxedPrecision,
which we ignore).

Perf on some angle traces on my brya (ADL) and i9-9900K (CFL):

ADL zink pubg_mobile_battle_royale:  +13.4574% +/- 5.2046% (n=5)
CFL zink pubg_mobile_battle_royale:  +29.5332% +/- 0.646585% (n=6)
ADL zink aztec_ruins_high:           +5.78027% +/- 4.80645% (n=4)
CFL zink aztec_ruins_high:           -1.10641% +/- 0.140562% (n=12)
ADL zink trex_200:                   +5.86956% +/- 2.09633% (n=10)
CFL zink trex_200:                   +9.72136% +/- 0.749261% (n=10)

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21775>
2023-03-09 02:27:01 +00:00
Daniel Stone
daa1468b54 intel/isl: Don't scream FINISHME into logs for 3D vs. CCS
This would probably be a nice optimisation to have, but it really does
make the CTS logs awful:
    https://gitlab.freedesktop.org/mesa/mesa/-/jobs/37692447

Just demote this isl_finishme() to a comment; given it's been unfinished
since 2019, we can probably live without it.

Fixes: 126c9562d9 ("isl: Redefine the CCS layout for Gen12")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21788>
2023-03-09 01:36:54 +00:00
Daniel Stone
df7b40d002 ci/anv: Temporarily halve TGL testing load
Our TGL machines are currently slightly oversubscribed (max. 17 jobs in
a pipeline on 15 DUTs). They're also currently suffering from
thermally-induced GPU throttling (being investigated), and a
thundering-herd network load effect: as all 15 jobs start at once, we
end up saturating one of our network links.

The combination of all three of these things means that TGL is often our
long pole in CI runs. Until we can ameliorate the two issues
constraining throughput (and a third where an unreliable hardware UART
sometimes kills jobs when it shouldn't), halve the workload so we at
least have some breathing room to absorb them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21790>
2023-03-09 01:07:36 +00:00
Lionel Landwerlin
b801724352 util: allow align64() to do alignments >= 4Gb
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
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
Lionel Landwerlin
11bc2bde83 anv: force MEDIA_INTERFACE_DESCRIPTOR_LOAD reemit after 3D->GPGPU switch
Seems to fix a hang in the following titles :
   - Age of Empire 4
   - Monster Hunter Rise

where the HW is hung on a PIPE_CONTROL after a GPGPU_WALKER but no
MEDIA_INTERFACE_DESCRIPTOR_LOAD was emitted since the switch from 3D
to GPGPU.

This would happen in the following case :

   vkCmdBindPipeline(COMPUTE, cs_pipeline);
   vkCmdDispatch(...);
   vkCmdBindPipeline(GRAPHICS, gfx_pipeline);
   vkCmdDraw(...);
   vkCmdDispatch(...);

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17247>
2023-03-08 23:09:36 +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 Stone
3af675dfc1 ci/radv: Skip vkCreateInstance memory-fail test
This has been failing a bit ever since CTS 1.3.5.0. Skip it for now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21789>
2023-03-08 21:35:27 +00:00
Georg Lehmann
0614c2e8bd aco: don't reallocate fma{mk,ak,_mix} instruction
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21762>
2023-03-08 18:42:21 +00:00
Georg Lehmann
a4873071e6 aco/optimizer: don't reallocate instruction when converting to VOP3
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21762>
2023-03-08 18:42:21 +00:00
Mike Blumenkrantz
7413ce7e0d lavapipe: break out main shader lowering into separate function
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21778>
2023-03-08 18:25:01 +00:00
Mike Blumenkrantz
f2765cd6d6 lavapipe: move uniform inline functions to shader struct
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21778>
2023-03-08 18:25:01 +00:00
Mike Blumenkrantz
7718d7f31a lavapipe: rename inline uniform function params
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21778>
2023-03-08 18:25:01 +00:00
Mike Blumenkrantz
990fa82c61 lavapipe: move xfb init to shader struct
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21778>
2023-03-08 18:25:01 +00:00
Mike Blumenkrantz
b221f6c128 lavapipe: more small shader struct usage tweaks
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21778>
2023-03-08 18:25:01 +00:00
Mike Blumenkrantz
a0c9609e59 lavapipe: pass shader struct and layout to scan_pipeline_info()
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21778>
2023-03-08 18:25:01 +00:00
Mike Blumenkrantz
6e5fe71599 lavapipe: split out shader struct members into their own struct
kinda gross but simplifies some code

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21778>
2023-03-08 18:25:01 +00:00
Mike Blumenkrantz
2af3476639 lavapipe: split out spirv compile of shaders
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21778>
2023-03-08 18:25:01 +00:00
Mike Blumenkrantz
bf1b4ed54e vulkan/wsi: fix crash in failed swapchain creation for wayland
this otherwise calls wsi_wl_swapchain_chain_free() before the wsi
pointer has been set

ref #6578

cc: mesa-stable

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21563>
2023-03-08 17:33: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
Daniel Schürmann
cd1e5b1858 aco: fix NIR infinite loops
The previous solution breaks potential loop header phis.
Move the dummy-break to the bottom of the loop.

Fixes: dEQP-VK.reconvergence.subgroup_uniform_control_flow_ballot.*
Fixes: a9c4a31d8d ('aco: handle NIR loops without breaks')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21736>
2023-03-08 16:59:41 +00:00
Daniel Schürmann
3073810397 nir/gather_info: allow terminate() in non-PS
RADV will use terminate() to end ray-tracing shaders.

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
Rhys Perry
98cb7e0108 nir: add nir_lower_alu_width_test.fdot_order
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20812>
2023-03-08 14:38:26 +00:00
Rhys Perry
50f7e21481 nir: make fdph lowering match fdot
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20812>
2023-03-08 14:38:26 +00:00
Rhys Perry
3668da7c83 nir: use xyzw order for precise fdot
Fixes flickering grass in Immortals Fenyx Rising.

fossil-db (gfx1100):
Totals from 13969 (10.38% of 134574) affected shaders:
MaxWaves: 442794 -> 442878 (+0.02%)
Instrs: 4861105 -> 4901408 (+0.83%); split: -0.02%, +0.85%
CodeSize: 24316100 -> 24396272 (+0.33%); split: -0.03%, +0.35%
VGPRs: 446256 -> 445572 (-0.15%); split: -0.20%, +0.05%
Latency: 28122456 -> 28162233 (+0.14%); split: -0.10%, +0.24%
InvThroughput: 2899673 -> 2904323 (+0.16%); split: -0.07%, +0.23%
VClause: 119599 -> 119631 (+0.03%); split: -0.07%, +0.09%
SClause: 186636 -> 186265 (-0.20%); split: -0.23%, +0.03%
Copies: 301370 -> 300386 (-0.33%); split: -0.75%, +0.42%
Branches: 85066 -> 85047 (-0.02%); split: -0.02%, +0.00%
PreSGPRs: 436167 -> 436137 (-0.01%)
PreVGPRs: 329715 -> 329809 (+0.03%); split: -0.01%, +0.04%

fossil-db (gfx1100, RADV_DEBUG=invariantgeom):
Totals from 43116 (32.04% of 134574) affected shaders:
MaxWaves: 1332938 -> 1333012 (+0.01%); split: +0.01%, -0.00%
Instrs: 16424513 -> 16658021 (+1.42%); split: -0.06%, +1.48%
CodeSize: 81258868 -> 81827860 (+0.70%); split: -0.07%, +0.77%
VGPRs: 1720368 -> 1719648 (-0.04%); split: -0.19%, +0.15%
SpillSGPRs: 1670 -> 1600 (-4.19%); split: -5.27%, +1.08%
Latency: 82063766 -> 82425418 (+0.44%); split: -0.23%, +0.67%
InvThroughput: 9665803 -> 9727810 (+0.64%); split: -0.09%, +0.73%
VClause: 449662 -> 451099 (+0.32%); split: -0.32%, +0.64%
SClause: 498841 -> 498639 (-0.04%); split: -0.24%, +0.20%
Copies: 1001020 -> 1000770 (-0.02%); split: -1.20%, +1.17%
Branches: 237580 -> 239637 (+0.87%); split: -0.01%, +0.88%
PreSGPRs: 1198167 -> 1198024 (-0.01%); split: -0.01%, +0.00%
PreVGPRs: 1225202 -> 1225035 (-0.01%); split: -0.06%, +0.05%

fossil-db (navi10):
Totals from 13969 (10.38% of 134563) affected shaders:
MaxWaves: 474386 -> 474508 (+0.03%); split: +0.05%, -0.03%
Instrs: 3740895 -> 3771566 (+0.82%); split: -0.00%, +0.82%
CodeSize: 19426592 -> 19459916 (+0.17%); split: -0.00%, +0.18%
VGPRs: 389916 -> 389852 (-0.02%); split: -0.09%, +0.07%
Latency: 25452927 -> 25502482 (+0.19%); split: -0.14%, +0.34%
InvThroughput: 3880807 -> 3923144 (+1.09%); split: -0.07%, +1.16%
VClause: 66835 -> 66712 (-0.18%); split: -0.38%, +0.20%
SClause: 178805 -> 178802 (-0.00%); split: -0.01%, +0.01%
Copies: 167601 -> 167625 (+0.01%); split: -0.54%, +0.56%
Branches: 83788 -> 83784 (-0.00%)
PreSGPRs: 388229 -> 388216 (-0.00%)
PreVGPRs: 342984 -> 343062 (+0.02%); split: -0.01%, +0.03%

fossil-db (navi10, RADV_DEBUG=invariantgeom):
Totals from 43116 (32.04% of 134563) affected shaders:
MaxWaves: 1260184 -> 1256414 (-0.30%); split: +0.10%, -0.40%
Instrs: 12804951 -> 12983628 (+1.40%); split: -0.01%, +1.41%
CodeSize: 65813224 -> 66137852 (+0.49%); split: -0.03%, +0.52%
VGPRs: 1556396 -> 1561340 (+0.32%); split: -0.09%, +0.41%
SpillSGPRs: 1377 -> 1395 (+1.31%)
Latency: 76095867 -> 76355111 (+0.34%); split: -0.32%, +0.66%
InvThroughput: 13546863 -> 13788789 (+1.79%); split: -0.05%, +1.84%
VClause: 310910 -> 311283 (+0.12%); split: -0.63%, +0.75%
SClause: 474878 -> 474941 (+0.01%); split: -0.09%, +0.10%
Copies: 639367 -> 637610 (-0.27%); split: -1.03%, +0.76%
Branches: 240178 -> 240185 (+0.00%); split: -0.00%, +0.00%
PreSGPRs: 1056594 -> 1056590 (-0.00%); split: -0.00%, +0.00%
PreVGPRs: 1247950 -> 1247798 (-0.01%); split: -0.05%, +0.04%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7920
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20812>
2023-03-08 14:38:26 +00:00
Mike Blumenkrantz
6ee5337d94 aux/tc: fix rp info resizing clobbering current info
the recording rp_info may be a pointer to a member of the array being
reallocated, so test for this and re-set it to avoid invalid memory
access

found with this caselist:
KHR-GL46.texture_gather.offset-gather-unorm-2darray
KHR-GL46.texture_view.view_sampling

cc: mesa-stable

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21729>
2023-03-08 14:10:01 +00:00
Lionel Landwerlin
10057d19f2 anv: report max register pressure in pipeline properties
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21756>
2023-03-08 13:37:07 +00:00
Lionel Landwerlin
09cdb77a92 intel/fs: report max register pressure in shader stats
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21756>
2023-03-08 13:37:07 +00:00
Lionel Landwerlin
8dd960e056 anv/iris: report counter symbols with debug option
v2: rename to INTEL_DEBUG=perf-symbol-names

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17672>
2023-03-08 12:45:43 +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
Pierre-Eric Pelloux-Prayer
79ab787a8f radeonsi: fix fast depth_clear_value/stencil_clear_value
We need to update the when promoting from non-TC-compatible to
TC-compatible or we'll get incorrect values in the buffer.

Fixes: 9defe8aca9 ("radeonsi: implement fast Z/S clears using clear_buffer on HTILE")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8418
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21726>
2023-03-08 10:56:21 +00:00
Pierre-Eric Pelloux-Prayer
b75acbf88f radeonsi: don't use PKT3_SET_SH_REG_INDEX on gfx9 and older
Fixes: ccaaf8fe04 ("amd: massively simplify how info->spi_cu_en is applied")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8464
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21726>
2023-03-08 10:56:21 +00:00
Pierre-Eric Pelloux-Prayer
49913fa418 radeonsi/test: update test results
Depends on https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/779
to fix glx-make-current GLX errors.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21726>
2023-03-08 10:56:21 +00:00
Pierre-Eric Pelloux-Prayer
9eb05801ad radeonsi/test: use gbm-skips.txt
Use shared skips file to avoid running tests that can't pass on gbm.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21726>
2023-03-08 10:56:21 +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
31d699106d ac/surface: add RADEON_SURF_VRS_RATE for selecting swizzle mode on GFX11
On GFX11, VRS rate images can't use linear tiling and the swizzle mode
must be either SW_Z or SW_R.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.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
Lionel Landwerlin
e8793f2a86 anv: enable VK_EXT_pipeline_library_group_handles
A noop for us.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20929>
2023-03-08 08:59:52 +00:00
Marek Olšák
461ccb00e1 radeonsi: increase NGG workgroup size to 256 for VS/TES with streamout and GS
NGG streamout performance is limited by the workgroup size, so make it as
large as possible.

Since this uses si_get_max_workgroup_size() to set the NGG workgroup size,
the side effect is that all GS is also getting an increase to 256, which
is OK.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Marek Olšák
43fd552872 radeonsi: allow using 64K LDS for NGG to allow larger workgroups
This should help with NGG streamout performance, which is limited by
the workgroup size (it should be as large as possible).

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Marek Olšák
e01d505291 radeonsi: other cosmetic changes in si_state_shaders.cpp
VS_W32_EN has no effect on Gfx11, but we better not set it.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Marek Olšák
ef965d5681 radeonsi: reorganize si_shader_ps
To make branching based on gfx_level nicer and the code in a logical order.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Marek Olšák
c9d297fc77 radeonsi: reorganize si_shader_ngg
To make branching based on gfx_level nicer and the code in a logical order.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Marek Olšák
1664aad43c radeonsi: reorganize si_shader_hs
To make branching based on gfx_level nicer and the code in a logical order.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Marek Olšák
b3459eae7a radeonsi: reindent si_shader_ls, si_shader_es, si_shader_gs, si_shader_vs
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Marek Olšák
7e0ed2c4f0 radeonsi: set pm4.atom.emit in si_get_shader_pm4_state
except gfx10_shader_ngg, which isn't as trivial

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Marek Olšák
4c1475fc1c radeonsi: lower nir_texop_sampler_descriptor_amd
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Marek Olšák
1417ced72c radeonsi: separate nir_texop_descriptor_amd lowering
This moves the code to a separate branch to make it less intertwined
with the rest to allow sampler descriptor lowering later.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Marek Olšák
54ebd90739 radeonsi: merge si_emit_initial_compute_regs with si_init_cs_preamble_state
It's better to set all immutable registers in one place.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Marek Olšák
ddded6fbb5 radeonsi: emulate VGT_ESGS_RING_ITEMSIZE in the shader on gfx9-11
The hardware uses the register to premultiply GS vertex indices
in input VGPRs.

This changes the behavior as follows:
- VGT_ESGS_RING_ITEMSIZE is always 1 on gfx9-11, set in the preamble.
- The value is passed to the shader via current_gs_state (vs_state_bits).
- The shader does the multiplication.

The reason is that VGT_ESGS_RING_ITEMSIZE will be removed in the future.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Timur Kristóf
fb819fdb13 ac/nir: clear nir_var_shader_out from TCS barriers
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21403>
2023-03-08 07:29:09 +00:00
Timur Kristóf
87de5b2b9e aco: Don't include headers from radv.
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
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
3058ab6090 aco: Generalize vs_inputs to args_pending_vmem.
Handle arguments that need a waitcnt without relying on
RADV specific VS input information.

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
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
Timur Kristóf
1a7b5979df ac: Add pending_vmem field to args.
This is to indicate when an argument was loaded from VMEM
and needs a waitcnt before it can be used.

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
Rob Clark
d5376c3feb freedreno: Promote non-drawing batches to sysmem
Sometimes we can end up with a sequence where we need to flush a batch
with no clears and no draws (for ex, to get a fence).  Promote these to
sysmem.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21747>
2023-03-08 04:10:45 +00:00
Mike Blumenkrantz
aaed609e57 zink: hook up buffer TRANSFER_DST barrier optimizing
this should massively optimize e.g., incremental index buffer overwrites

ref #8358

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21779>
2023-03-08 03:50:33 +00:00
Mike Blumenkrantz
fe469a7618 zink: add a driver workaround to disable copy box optimizations
turnip is nonconformant regarding cache access (see noted issue),
meaning that any attempt to omit barriers breaks things

qcom proprietary may also be affected

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21779>
2023-03-08 03:50:33 +00:00
Mike Blumenkrantz
46f98da188 zink: add a mechanism to trigger copy box resets from batch state reset
the resource isn't available during batch state reset, so a new flag
is needed to force a reset the next time the copy boxes would be used

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21779>
2023-03-08 03:50:33 +00:00
Mike Blumenkrantz
aaca91eb79 zink: add a mechanism for managing TRANSFER_DST buffer barriers
this enables successive or unrelated transfer writes to avoid triggering
barriers, and ensuing reads of those writes should trigger their own
barriers

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21779>
2023-03-08 03:50:33 +00:00
Mike Blumenkrantz
54f3c589d5 zink: track the last write access for resources
this enables some optimization

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21779>
2023-03-08 03:50:33 +00:00
SureshGuttula
30a89323ad radeonsi: Add support for DPB resize
This patch will add support for dpb resize when low to high resolution
change/ svc use-cases.

With DPB tier1 type,vp9 svc decoder use cases are failed. This
Change will fix this[VCN1/VCN2].

Signed-off-by: SureshGuttula <suresh.guttula@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21548>
2023-03-08 02:19:58 +00:00
Rose Hudson
e54ec96f35 asahi: disable disk cache in debug runs
With debug flags enabled, shaders might get compiled differently and
running compilation might be desired e.g. for logging, so don't try to
cache them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21776>
2023-03-08 02:07:44 +00:00
Rose Hudson
5e9538c12e agx: isolate compiler debug flags
The gallium disk cache is about to depend on these, and I don't want to
create a dependency on agx_opcodes.h.py for that. So, make a new header
for them that doesn't have build dependencies.
Rename them to agx_compiler_* too, to avoid collisions with the other
driver debug flags.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21776>
2023-03-08 02:07:44 +00:00
Väinö Mäkelä
78d742290b intel/ci: Remove skipped float_controls tests from hasvk xfails
These tests are skipped now because preserving denorms isn't supported.

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21719>
2023-03-08 01:46:00 +00:00
Väinö Mäkelä
840b4b856e intel/ci: Remove hasvk xfails missing from the CTS
These broken tests no longer exist in the CTS and all dynamic rendering
tests pass now.

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21719>
2023-03-08 01:46:00 +00:00
Väinö Mäkelä
82a78b7e9f intel/ci: Remove outdated hasvk copy_and_blit xfails
These were fixed by commit e509afac.

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21719>
2023-03-08 01:46:00 +00:00
Patrick Lerda
ff7446ba0c mesa/program: fix memory leak triggered by arb alias
The function _mesa_symbol_table_add_symbol() copies the string with strdup(),
the original string should be freed.

For instance, with "piglit/fp-fragment-position -auto -fbo":
Direct leak of 7 byte(s) in 1 object(s) allocated from:
    #0 0xffff99c59050 in __interceptor_strdup (/usr/lib64/libasan.so.6+0x59050)
    #1 0xffff8f53d24c in handle_ident ../src/mesa/program/program_lexer.l:129
    #2 0xffff8f53d24c in _mesa_program_lexer_lex ../src/mesa/program/program_lexer.l:312
    #3 0xffff8f529d10 in yylex ../src/mesa/program/program_parse.y:289
    #4 0xffff8f529d10 in yyparse src/mesa/program/program_parse.tab.c:2140
    #5 0xffff8f5341a4 in _mesa_parse_arb_program ../src/mesa/program/program_parse.y:2589
    #6 0xffff8f51e96c in _mesa_parse_arb_fragment_program ../src/mesa/program/arbprogparse.c:82
    #7 0xffff8f4d867c in set_program_string ../src/mesa/main/arbprogram.c:402

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21728>
2023-03-07 23:11:29 +00:00
Patrick Lerda
a692fe418e mesa/program: fix memory leak triggered by multiple targets used on one texture image unit
For instance, with "piglit-2000/bin/asmparsertest ARBfp1.0 tests/asmparsertest/shaders/ARBfp1.0/shadow-02.txt":
Direct leak of 192 byte(s) in 2 object(s) allocated from:
    #0 0x7f6e8378f987 in calloc (/usr/lib64/libasan.so.6+0xb1987)
    #1 0x7f6e7769d620 in asm_instruction_copy_ctor ../src/mesa/program/program_parse.y:2146
    #2 0x7f6e7769d620 in yyparse ../src/mesa/program/program_parse.y:439
    #3 0x7f6e776a6725 in _mesa_parse_arb_program ../src/mesa/program/program_parse.y:2590
    #4 0x7f6e77687f69 in _mesa_parse_arb_fragment_program ../src/mesa/program/arbprogparse.c:82
    #5 0x7f6e77630765 in set_program_string ../src/mesa/main/arbprogram.c:402
    #6 0x7f6e76ec3e8a in _mesa_unmarshal_ProgramStringARB src/mapi/glapi/gen/marshal_generated2.c:4152
    #7 0x7f6e76a0e585 in glthread_unmarshal_batch ../src/mesa/main/glthread.c:122
    #8 0x7f6e76a1031d in _mesa_glthread_finish ../src/mesa/main/glthread.c:383
    #9 0x7f6e76a1031d in _mesa_glthread_finish ../src/mesa/main/glthread.c:348
    #10 0x7f6e76e6a062 in _mesa_marshal_GetError src/mapi/glapi/gen/marshal_generated1.c:1809

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21728>
2023-03-07 23:11:29 +00:00
Patrick Lerda
444250a5e7 mesa/program: fix memory leak triggered by invalid extended swizzle selector
For instance, with "piglit/bin/asmparsertest ARBfp1.0 tests/asmparsertest/shaders/ARBfp1.0/swz-04.txt":
Direct leak of 18 byte(s) in 2 object(s) allocated from:
    #0 0x7f97e99050 in __interceptor_strdup (/usr/lib64/libasan.so.6+0x59050)
    #1 0x7f8d4160ac in handle_ident ../src/mesa/program/program_lexer.l:129
    #2 0x7f8d4160ac in _mesa_program_lexer_lex ../src/mesa/program/program_lexer.l:312
    #3 0x7f8d402b50 in yylex ../src/mesa/program/program_parse.y:289
    #4 0x7f8d402b50 in yyparse src/mesa/program/program_parse.tab.c:2140
    #5 0x7f8d40d01c in _mesa_parse_arb_program ../src/mesa/program/program_parse.y:2590
    #6 0x7f8d3f77ac in _mesa_parse_arb_fragment_program ../src/mesa/program/arbprogparse.c:82
    #7 0x7f8d3ad468 in set_program_string ../src/mesa/main/arbprogram.c:402

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21728>
2023-03-07 23:11:29 +00:00
Georg Lehmann
57557e8815 aco/assembler/gfx11: simplify 16bit VOP12C promotion to VOP3
With the shared struct for modifies, this is can be a lot cleaner now.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21761>
2023-03-07 22:38:39 +00:00
Marek Olšák
ae50b66251 radeonsi/gfx11: only allocate GDS OA for streamout, GDS memory is not needed
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/21584>
2023-03-07 22:08:47 +00:00
Marek Olšák
61da19a262 amd/llvm,radeonsi/gfx11: switch to using GDS_STRMOUT registers
This is required by register shadowing (required by the new PAIRS packets),
preemption, user queues, and we only have to wait for VS after streamout,
not PS. This is how gfx11 streamout should have been done.

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/21584>
2023-03-07 22:08:47 +00:00
Marek Olšák
f7076d129d amd: add nir_intrinsic_xfb_counter_sub_amd and fix overflowed streamout offsets
Fixes: 5ec79f9899 - ac/nir/ngg: nogs support streamout

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/21584>
2023-03-07 22:08:47 +00:00
Mark Janes
08649e3673 intel/fs: use generated workaround helpers for Wa_14017989577
Wa_14017989577 is a clone of Wa_14015360517, which applies to several
platforms beyond INTEL_PLATFORM_DG2_G10.

Update references to Wa_14017989577, and use the generated workaround
helper to ensure application to the proper platforms.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21744>
2023-03-07 21:43:11 +00:00
Emma Anholt
5fd9abae90 ci/etnaviv: Drop the dEQP-GLES2.functional.uniform_api.random.94 xfail.
This has been consistently passing.  I think I just missed it in my
previous update.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21769>
2023-03-07 21:03:33 +00:00
Emma Anholt
d52cf80bcb ci: Add some xfail updates from VKCTS 1.3.5.0 for the manual jobs.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21769>
2023-03-07 21:03:33 +00:00
Mike Blumenkrantz
53da1534b5 llvmpipe: fix LP_PERF=no_depth to ignore depth format
cc: mesa-stable

Reviewed-by: Brian Paul brianp@vmware.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21582>
2023-03-07 20:42:43 +00:00
Juan A. Suarez Romero
baff509924 v3d/v3dv: define performance counters in common
Both OpenGL and Vulkan drivers share the same performance counters.

Let's move them to a common place instead of duplicating.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21420>
2023-03-07 18:57:41 +00:00
Antonio Gomes
161e3f29f4 iris: Add support for 2d images created from buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20378>
2023-03-07 18:24:56 +00:00
Antonio Gomes
4f096d0d88 llvmpipe: Add new caps PIPE_CAP_LINEAR_IMAGE_(PITCH_ALIGNMENT|BASE_ADDRESS_ALIGNMENT)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20378>
2023-03-07 18:24:56 +00:00
Antonio Gomes
06daa03c5c rusticl: Implement spec for cl_khr_image2d_from_buffer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20378>
2023-03-07 18:24:56 +00:00
Antonio Gomes
010c18c443 gallium: Add new caps PIPE_CAP_LINEAR_IMAGE_(PITCH_ALIGNMENT|BASE_ADDRESS_ALIGNMENT)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20378>
2023-03-07 18:24:56 +00:00
Antonio Gomes
7839341d8f lvmpipe/cs: Add support for 2d images created from buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20378>
2023-03-07 18:24:56 +00:00
Antonio Gomes
9cbdf3673b mesa/st, nine, nouveau: Fix uninitialized pipe_sampler_view structs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20378>
2023-03-07 18:24:56 +00:00
Antonio Gomes
cc36fd0f61 gallium, rusticl: Add tex2d_from_buf in image_view and sampler_view
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20378>
2023-03-07 18:24:56 +00:00
Antonio Gomes
07270ece45 rusticl: Enable mapImage for images created from buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20378>
2023-03-07 18:24:56 +00:00
Antonio Gomes
9dda1e4872 rusticl: Enable copy for images created from buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20378>
2023-03-07 18:24:56 +00:00
Antonio Gomes
3c51db3f21 rusticl: Enabling image fill for images created from buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20378>
2023-03-07 18:24:56 +00:00
Antonio Gomes
e40fd3bd60 rusticl: Enabling reading/writing for images created from buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20378>
2023-03-07 18:24:56 +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
José Roberto de Souza
a6dcd62f44 iris: Move iris_bo_wait_gem() to i915/iris_bufmgr.c
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21494>
2023-03-07 16:16:10 +00:00
José Roberto de Souza
97becc1b6f iris: Move iris_bo_busy_gem() to i915/iris_bufmgr.c
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21494>
2023-03-07 16:16:10 +00:00
José Roberto de Souza
7553d921f6 iris: Move bo_set_caching to kmd backend
For the platforms that call it, it a function in the hot path so
moving it to kmd backend.

After this patch i915/iris_bufmgr.c is empty but not removing it
as next patch will add functions to it.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21494>
2023-03-07 16:16:10 +00:00
José Roberto de Souza
bdfcc98001 iris: Move bo_madvise to kmd backend
bo_madvise() is on hot path, so moving it to kmd backend.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21494>
2023-03-07 16:16:10 +00:00
José Roberto de Souza
d636e772c0 intel/common: Implement the Xe functions for intel_gem
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21699>
2023-03-07 15:41:36 +00:00
José Roberto de Souza
19aa1fb851 intel/common: Implement the Xe functions for intel_engine
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21699>
2023-03-07 15:41:36 +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
Tapani Pälli
889c3ee6b8 anv: fix sends_count_expectation assert on simd32
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21758>
2023-03-07 14:37:31 +00:00
Yogesh Mohan Marimuthu
347a5b79f9 ac/surface: only adjust pitch if surf_pitch was modified
Modifying pitch for all LINEAR surface isn't correct;
the original change that modified surf_pitch was only
intended for YUV textures.

This fixes vkGetImageSubresourceLayout rowPitch return value
for VK_FORMAT_BC3_UNORM_BLOCK + VK_IMAGE_TILING_LINEAR.

Fixes: fcc499d5 (ac/surface: adjust gfx9.pitch[*] based on surf->blk_w)

v2: add check for UYVY format (Pierre-Eric)
v3: move blk_w division to above if check (Pierre-Eric)

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21595>
2023-03-07 13:50:31 +00:00
David Heidelberg
f72774f13f ci/lavapipe: fixes typo
Fixes: 5ee724e180 ("ci/lavapipe: add recent occasional flake")

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21759>
2023-03-07 13:26:52 +00:00
Georg Lehmann
de4805f25f aco: use bitfield array helpers for valu modifiers
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21023>
2023-03-07 11:53:23 +00:00
Georg Lehmann
e7559da757 aco: add bitfield array helper classes
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21023>
2023-03-07 11:53:23 +00:00
Georg Lehmann
097a97cc42 aco: remove VOP[123C]P? structs
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21023>
2023-03-07 11:53:23 +00:00
Georg Lehmann
08542318e7 aco/optimizer: simplify using VALU instruction
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21023>
2023-03-07 11:53:23 +00:00
Georg Lehmann
4591703e79 aco/print_ir: simplify using VALU instruction
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21023>
2023-03-07 11:53:23 +00:00
Georg Lehmann
17ff2e8c52 aco: validate VALU modifiers
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21023>
2023-03-07 11:53:23 +00:00
Georg Lehmann
fc193ab4db aco/ra: set opsel_hi to zero when converting to VOP2
Otherwise the new modifier validation will fail.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21023>
2023-03-07 11:53:23 +00:00
Georg Lehmann
366cf4efaa aco/ir: rework IR to have one common valu instruction struct
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21023>
2023-03-07 11:53:23 +00:00
Georg Lehmann
77afe7d960 aco: treat VINTERP_INREG as VALU
It's just v_fma with fixed DPP8 and builtin s_waitcnt_expcnt, so it can mostly
be handled as a pure VALU instruction.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21023>
2023-03-07 11:53:23 +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
Lionel Landwerlin
a278eeb719 nir: fix nir_ishl_imm
Both GLSL & SPIRV have undefined values for shift > bitsize. But SM5
says :

   "This instruction performs a component-wise shift of each 32-bit
    value in src0 left by an unsigned integer bit count provided by
    the LSB 5 bits (0-31 range) in src1, inserting 0."

Better to not hard code the wrong behavior in NIR.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: e227bb9fd5 ("nir/builder: add ishl_imm helper")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@colllabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21720>
2023-03-07 08:14:34 +00: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
Karol Herbst
1aca36815e gallivm: fix lp_vec_add_offset_ptr for 32 bit builds
The function assumed ptrs are always 64 bit sized.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8267
Fixes: 442d1fe5ad ("gallivm: use masked intrinsics for global and scratch access.")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21604>
2023-03-07 04:17:15 +00:00
Karol Herbst
4c24ff0a34 rusticl/kernel: Images arg sizes also have to match the host pointer size
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8267
Fixes: b0d698c532 ("rusticl: correctly check global argument size")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21604>
2023-03-07 04:17:15 +00:00
Alyssa Rosenzweig
66f806d01d agx: Assert that memory index is 32-bit reg
Semantics will be wrong otherwise (reading garbage).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21643>
2023-03-07 02:58:35 +00:00
Alyssa Rosenzweig
2a174f0019 agx/lower_address: Handle 16-bit offsets
These need to be upconverted for correctness.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21643>
2023-03-07 02:58:35 +00:00
Alyssa Rosenzweig
9f5a4a9604 agx/lower_address: Fix handling of 64-bit immediates
We can't add a 64-bit immediate with the hardware iadd, that won't work. What we
can do is add a 32-bit immediate, derived as the low 32-bits of a 64-bit
nir_ssa_def.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21643>
2023-03-07 02:58:35 +00:00
Alyssa Rosenzweig
4bd0e1d097 agx/lower_address: Handle 8-bit load/store
Should work ok with the implicit up-conversion that the backend does.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21643>
2023-03-07 02:58:35 +00:00
Alyssa Rosenzweig
5865e23a07 agx/lower_address: Handle large shifts
If we manage to fold in a left shift that's bigger than the hardware can do, we
should at least avoid generating a useless right shift to feed the hardware
rather bailing completely.

For motivation, this form of address arithmetic is encountered when indexing
into arrays with large power-of-two element sizes (array-of-structs).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21643>
2023-03-07 02:58:35 +00:00
Alyssa Rosenzweig
6203503196 agx/lower_address: Optimize "shift + constant"
Optimize address arithmetic of the form

   base + u2u64((index << shift) + const)

into hardware operands

   base, index << (shift - format_shift) + const'

which (if format_shift = shift) can be simply

   base, index + const'

rather than the current naive translation

   base, ((index << shift) + const) >> format_shift

This saves at least one pointless shift. We can't do this optimization with
nir_opt_algebraic, because explicitly optimizing "(a << #b) >> #b" to "a" isn't
sound due to overflow. But there's no overflow issue here, which is what this
whole pass is designed around.

For motivation, this address arithmetic implements "dynamically indexing into an
array inside of a C structure", where the const is the offset of the array
relative to the structure.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21643>
2023-03-07 02:58:35 +00:00
Alyssa Rosenzweig
dccf6f569b agx/lower_address: Break on match
Once we've matched a summand, commit to it. This avoids needlessly checking the
second source if the first matched, and removes some indentation/funny control
flow.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21643>
2023-03-07 02:58:35 +00:00
Sergi Blanch Torne
36f6eb88cb Revert "ci: disable Collabora's LAVA lab for maintance"
This reverts commit 6be7469df1

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21356>
2023-03-07 02:23:00 +00:00
Mike Blumenkrantz
b5fc941f2f zink: always set batch usage for descriptors after barrier
this otherwise breaks unordered promotion calc

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
2023-03-07 01:57:41 +00:00
Mike Blumenkrantz
afb56bad1c zink: set dynamic pcp for unordered cmdbuf
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
2023-03-07 01:57:41 +00:00
Mike Blumenkrantz
c5f901dbc6 zink: bind descriptor buffers to unordered cmdbuf
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
2023-03-07 01:57:41 +00:00
Mike Blumenkrantz
20c9cfb30f zink: always set color writes on the unordered cmdbuf
this state has to be set, so ensure it is

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
2023-03-07 01:57:41 +00:00
Mike Blumenkrantz
8e3ee9aad6 zink: explicitly flush src clears when u_blittering
this otherwise relies on set_framebuffer_state flushing them,
which may or may not be accurate/desired

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
2023-03-07 01:57:41 +00:00
Mike Blumenkrantz
1aa62912b7 zink: don't unset existing access when adding resource binds
this breaks barrier calcs, but it was fine since there was a pre-barrier

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
2023-03-07 01:57:41 +00:00
Mike Blumenkrantz
a0f3d171f6 zink: eliminate pre barrier for adding resource binds
this will automatically be handled by the copies below

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
2023-03-07 01:57:41 +00:00
Mike Blumenkrantz
d133f95084 zink: check for layout updates when unbinding samplerviews
not sure if it's a bug, but it should be consistent with shader image
unbinding, so here it is

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
2023-03-07 01:57:41 +00:00
Mike Blumenkrantz
a4b1ae1f03 zink: propagate valid_buffer_range when replacing buffer storage
this is otherwise unreliable

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
2023-03-07 01:57:41 +00:00
Mike Blumenkrantz
7145ccfa05 zink: fix descriptor update flagging on null ssbo set
this could unset the update flag if the last ssbo was null, which would
be a bug if it could ever be triggered

found by inspection

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
2023-03-07 01:57:41 +00:00
Mike Blumenkrantz
e0dfe058c4 zink: only add deferred barrier on fb unbind when layout needs to change
this otherwise may have been a surface that was never drawn to or
already had its layout corrected, in which case a deferred barrier
is not only unnecessary, it might be broken

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
2023-03-07 01:57:41 +00:00
Mark Janes
bc04e2daca intel/fs: use generated helpers for Wa_1209978020 / Wa_18012201914
Wa_1209978020 is a clone of Wa_18012201914.  Update references to
refer to the originating bug, and use generated helpers to ensure it
is applied to future platforms as needed.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21741>
2023-03-07 01:41:53 +00:00
Caio Oliveira
c92d589597 intel/compiler: Drop non-scoped barrier handling
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21634>
2023-03-07 00:41:13 +00:00
Alyssa Rosenzweig
02eef8ca98 gallivm: Drop non-scoped barrier handling
Now unreachable.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21634>
2023-03-07 00:41:13 +00:00
Alyssa Rosenzweig
c8147e69d3 ir3: Drop non-scoped barrier handling
Now unreachable.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21634>
2023-03-07 00:41:13 +00:00
Alyssa Rosenzweig
fc93e8e537 pan/mdg: Drop control_barrier handling
Now unreachable.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21634>
2023-03-07 00:41:13 +00:00
Alyssa Rosenzweig
cb0f4b8146 pan/bi: Drop control_barrier handling
Now unreachable.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21634>
2023-03-07 00:41:13 +00:00
Alyssa Rosenzweig
f47ea3f992 glsl/nir: Use scoped_barrier for control barrier
Rather than control_barrier. This avoids the need to handle control_barrier at
all for backends that set use_scoped_barrier. This effectively matches what
spirv_to_nir emits, so Vulkan-capable compilers should be ok.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21634>
2023-03-07 00:41:13 +00:00
Caio Oliveira
07de034791 intel/compiler: Drop brw_nir_lower_scoped_barriers
Now that we handle scoped barriers with execution scope during
NIR -> Backend IR translation, this lowering is not needed anymore.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21634>
2023-03-07 00:41:13 +00:00
Caio Oliveira
dfc34b1a65 intel/vec4: Handle scoped barriers with execution scope
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21634>
2023-03-07 00:41:13 +00:00
Caio Oliveira
db0a09c9e2 intel/fs: Handle scoped barriers with execution scope
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21634>
2023-03-07 00:41:13 +00:00
Yiwei Zhang
ae6eb3229e venus: revert back the warn order
This reverts
- commit 4ae4e4362c
- commit f54aa49c14

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21542>
2023-03-07 00:25:07 +00:00
Yiwei Zhang
28bdf8db18 venus: vn_relax to abort on ring fatal status upon warn order
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21542>
2023-03-07 00:25:07 +00:00
Yiwei Zhang
adb51eeba5 venus: propagate vn_ring to vn_relax
This is to prepare for vn_relax to check ring status as well as pinging
renderer.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21542>
2023-03-07 00:25:07 +00:00
Yiwei Zhang
15a55198ec venus: abort ring submit when ring is in fatal status
This change also migrates to use the protocol defined status enums.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21542>
2023-03-07 00:25:07 +00:00
Yiwei Zhang
0b45893823 venus: sync to latest protocol for ring status enum
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21542>
2023-03-07 00:25:07 +00:00
Mark Janes
b96019f82b intel/fs: use generated workaround helpers for Wa_14010017096
This workaround does not apply beyond gen 12.0.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21746>
2023-03-07 00:10:33 +00:00
Mark Collins
66d2ae0386 meson: forcefully disable libdrm when host doesn't have it
Signed-off-by: Mark Collins <mark@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21724>
2023-03-06 22:40:55 +00:00
Alyssa Rosenzweig
952bd63d6d nir/opt_barrier: Generalize to control barriers
For GLSL, we want to optimize code like

   memoryBarrierBuffer();
   controlBarrier();

into a single scoped_barrier intrinsic for the backend to consume. Now that
backends can get scoped_barriers everywhere, what's left is enabling backends to
combine these barriers together. We already have an Intel-specific pass for
combining memory barriers; it just needs a teensy bit of generalization to allow
combining all sorts of barriers together.

This avoids code quality regression on Asahi when switching to purely scoped
barriers. It's probably useful for other backends too.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21661>
2023-03-06 22:09:27 +00:00
Faith Ekstrand
83fd7a5ed1 intel: Use nir_lower_tex_options::lower_index_to_offset
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21546>
2023-03-06 21:38:32 +00:00
Alyssa Rosenzweig
4b6d98a40c ir3: Use lower_index_to_offset
Instead of doing the add ourselves.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21546>
2023-03-06 21:38:32 +00:00
Alyssa Rosenzweig
510d3ab93d pan/bi: Use lower_index_to_offset
Instead of doing the add ourselves.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21546>
2023-03-06 21:38:32 +00:00
Alyssa Rosenzweig
282aeb9b9c nir/lower_tex: Add lower_index_to_offset
Some backends can handle a constant texture index or a dynamic texture index but
not a constant texture index plus a dynamic texture offset. Add a nir_lower_tex
option to lower to one of these options.

v2: Use more straightforward code proposed by Faith.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21546>
2023-03-06 21:38:32 +00:00
Sam Edwards
9de997bde6 nouveau: Fix null dereference in nouveau_pushbuf_destroy
This may happen if the Nouveau device fails to initialize before
the pushbuf is set up; the abort logic will call this either way.

Signed-off-by: Sam Edwards <CFSworks@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21611>
2023-03-06 20:25:10 +00:00
Daniel Stone
34d45df8ff ci/fdno: Only run full tests on a limited subset of machines
Though not many people run full test runs, it occupies 2/7 a630 slots
for nearly 2 hours. If more than one person does this at a time, it can
be an effective DoS and make merges time out.

Limit full runs to a subset of the runners, such that at least some of
them will always be available for us.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21737>
2023-03-06 19:56:39 +00:00
Rob Clark
399012a911 freedreno/common: Replace or_mask() with BitsetEnum<T>
Use template and operator overloading to make dealing with bitmask enums
shared between C and C++ easier.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21535>
2023-03-06 19:27:19 +00:00
Eric Engestrom
30d469215b v3d/ci: add dEQP-GLES3.functional.texture.specification.teximage2d_pbo.*_cube flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21735>
2023-03-06 19:02:37 +00:00
Mike Blumenkrantz
62f1a8a3a6 zink: unbind fb on context destroy
this ensures that batch refs are added for fb surfaces on unbind, which
prevents stale batch tracking from persisting on resources
after the context is destroyed

fixes:
*EGL.functional.render.multi_context*

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21727>
2023-03-06 18:47:41 +00:00
Guilherme Gallo
7600e2cca2 ci: Handle carriage return characters in LAVA logs
This commit updates LogFollower class to handle carriage return
characters in LAVA logs. LAVA treats carriage return characters as a
line break, so each carriage return in an output console is mapped to a
console line in LAVA.

The updated LogFollower class now merges lines that end with a carriage
return character into a single line, making the Gitlab sections work
correctly. In addition, the `remove_trailing_whitespace` method has been
updated to remove trailing `\r\n` characters from log lines.

The `test_lava_log_merge_carriage_return_lines` test function has also
been updated to test for carriage returns at the end of the previous
line.

Closes: #8242

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21614>
2023-03-06 17:17:32 +00:00
Italo Nicola
3174cfcaf2 hud: add GALLIUM_HUD_OPACITY envvar
GALLIUM_HUD_OPACITY can be used with a % value from 0 to 100, to specify
the opacity of the gallium hud background.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Tested-by: Chris Healy <healych@amazon.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20339>
2023-03-06 16:50:27 +00:00
Italo Nicola
7ace1bab73 hud: use defines for default scale/rotation/visibility values
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20339>
2023-03-06 16:50:27 +00:00
Ruijing Dong
0f3370eede raseonsi/vcn: fix a h264 decoding issue
reason:
   some h264 streams have some strange pictures, from
   vaapi input these pictures don't have a reference frame,
   however, they are not intra only pictures, in MB layer
   these pictures are looking for some references, if they
   cannot find it. It could cause PF.

   when reference pictures exist, it will need to set used_for
   reference_flags, therefore if that is set, however the
   number of reference frames is zero, which is odd, it
   should be avoided.

solution:
   In the above case,  to scan the ref list so that it will
   make at least one reference available to avoid crash, since
   this is not accurate enough, it could cause some artifacts.
   And in that case, it will need to be checked individually
   for another solution.

closes: https://gitlab.freedesktop.org/drm/amd/-/issues/1462
closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8401
Cc: mesa-stable

Tested-by: llyyr <llyyr.public@gmail.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21732>
2023-03-06 16:38:19 +00:00
Mike Blumenkrantz
340f2d1a25 zink: add frame trace markers on the queue
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21655>
2023-03-06 16:23:21 +00:00
Sonny Jiang
bb796f70a1 radeonsi: Add NV12 support for AV1
8bit av1 decoding cannot use NV12 output, which is caused by missing NV12 RT format.
It's a regression caused by commit [0504a3b0].
Fixes: 0504a3b0  ("radeonsi: correctly declare YUV420_10 RT Format support for AV1")
Cc: mesa-stable

Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Reviewed-by: David Wu <David.Wu3@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21697>
2023-03-06 16:10:40 +00:00
Samuel Pitoiset
0ed28d2715 wsi: move an assertion in wsi_xxx_surface_get_capabilities2()
Hit this with vulkaninfo on X11, probably a vulkaninfo bug. Though
moving the assertion doesn't hurt.

Fixes: be0dcbdfa2 ("wsi/x11: Implement EXT_swapchain_maintenance1.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21722>
2023-03-06 14:40:02 +00:00
Mike Blumenkrantz
c3cc8455d4 zink: when skipping a TRANSFER_DST image barrier, set access tracking
this otherwise breaks subsequent barriers if the first barrier of the batch
is a TRANSFER_DST on an image that can skip such a barrier

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
e650ff4ea0 zink: remove debug markers for u_blitter ops
these don't actually work; it creates the marker for the op, but
then the "end" of the marker is effectively determined to be the end
of the cmdbuf

instead, detect whether a draw is from u_blitter and add a marker there

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
271ebdd735 zink: pass cmdbuf to debug marker begin
this is otherwise broken with cmdbuf reordering

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
60496f6376 zink: reorder some blit debug markers
avoid capturing barrier and other ops in these

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
d677c00f6d zink: be more descriptive with perfetto buffer barriers
this should print some nice info in the graphs now

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
8c037193fb zink: determine whether debug markers are used on screen create
make this easier to reuse

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
8c226ba242 zink: skip buffer barriers if the buffer can be easily proved idle
this should have no pending write hazards, which means this barrier
can just be used for tracking

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
0a7092b285 zink: use split image barriers if the image can be easily proved idle
this should have no pending write hazards, which means this transition
has no dependencies and can occur immediately

also delete some old comments

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
5be506c16e zink: fix zink_resource_access_is_write()
this was accurately returning whether the access had only write flags,
but it was incorrectly returning false for READ|WRITE

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
772d92bfa6 zink: add functions for faster batch-usage completion checks
in cases where only a simple, non-definitive check is needed, these
can be used to eliminate some ioctl overhead

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
5b64d7267b zink: skip attachment barrier for redundant layout-setting if !valid
an invalidated image doesn't need synchronization, so this can be skipped

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
1694678294 zink: avoid unnecessary read-only layout changes for zs attachments
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +00:00
Mike Blumenkrantz
73df715c11 zink: add perfetto tracing for barriers
at least shows where they are

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
2023-03-06 14:22:01 +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
Daniel Schürmann
3e03fe44e7 radv/rt: move stack_sizes into radv_ray_tracing_module
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21667>
2023-03-06 13:58:54 +00:00
Daniel Schürmann
48edcd03c5 radv/rt: introduce struct radv_ray_tracing_module
This is preliminary work for separate shader functions.
The ray_tracing_module is eventually intended as self-contained
pipeline struct per RT group.

For now, these modules only contain the group handles.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21667>
2023-03-06 13:58:54 +00:00
Daniel Schürmann
4dafb69d61 radv/rt: defer library_pipeline allocation
We will need the number of groups at allocation time.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21667>
2023-03-06 13:58:54 +00:00
Daniel Schürmann
a62d699664 radv/rt: rename library_pipeline->groups to library_pipeline->group_infos
'groups' will later be used for ray_tracing_modules.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21667>
2023-03-06 13:58:54 +00:00
David Heidelberg
d79d62c638 ci: do not exit when an error happens inside the section
Let CI handle that case as it did before. The only thing which needs to be done by the error() function is to get out of the section.

Fixes the issue where a job is not saving artifacts after failure.
Fixes: 4cc0cec473 ("ci: implement unified sections")

Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21715>
2023-03-06 11:59:42 +00:00
Błażej Szczygieł
944a3af531 glx: Fix glXGetFBConfigFromVisualSGIX
Get list of configs returned by glXChooseFBConfig, return it's first
element, free memory.

Fixes: 4ccd253588 ("glx: Require GLX 1.3")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8273

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21607>
2023-03-06 11:16:48 +00:00
Sergi Blanch Torne
5d30d11ccc ci: include setup test environment script in the output artifacts
In mesa/mesa !20272, some bash functions introduce a standard wait to setup
gitlab ci sections, but the file collecting them needed to be included in the
artifacts exported by mesa. Other projects that use tests like deqp-runner
need to load these bash functions.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21680>
2023-03-06 09:47:16 +00:00
Erik Faye-Lund
c305f97257 nir: add a print_internal debug-flag
It can sometimes be useful to also print the shaders that are marked as
internal, so let's add a flag that lets us do that.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21681>
2023-03-06 09:13:52 +00:00
Samuel Pitoiset
7c1563aebe radv/ci: update CI lists for CTS 1.3.5.0 on GFX110/POLARIS10/PITCAIRN
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21689>
2023-03-06 08:53:31 +00:00
Samuel Pitoiset
81eaf7b9e4 radv/ci: stop skipping some graphics pipeline library tests
They are fixed in CTS 1.3.5.0.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21689>
2023-03-06 08:53:30 +00:00
Sergi Blanch Torne
9e919a9bd9 ci: disable Collabora's LAVA lab for maintance
This is to inform you of some planned downtime in the LAVA lab as follows:

    Start: 2023-03-06 08:00 GMT
    End: 2023-03-06 12:00 GMT

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21355>
2023-03-06 07:01:05 +00:00
Mike Blumenkrantz
0d8a54f913 zink: avoid ballooning of copy box tracking
* if the proposed box is smaller than an existing box then don't add it,
* if the proposed box is adjacent to an existing box, expand
* if the proposed box is larger than an existing box, replace

this reduces the chances of having a ton of copy boxes to iterate over

also add a perf warning in case a ton of copy boxes exist

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21665>
2023-03-06 03:47:06 +00:00
Mike Blumenkrantz
d2de2bb9c5 util/box: fix off-by-one calc error in intersection funcs
the "right-most" boundary needs the -1 since it isn't inclusive

oops

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21665>
2023-03-06 03:47:06 +00:00
Mike Blumenkrantz
3c0fad058a zink: eliminate internal qbo copy barrier
the values written here will never overlap, so no barrier is necessary

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21581>
2023-03-06 02:22:39 +00:00
Mike Blumenkrantz
b31c414e28 zink: set predicate_dirty on query creation
ensure this is set when it needs to be

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21581>
2023-03-06 02:22:39 +00:00
Mike Blumenkrantz
5374605ea9 zink: merge qbo update copies when possible
if a single query is being started and stopped frequently, update
the internal qbo with a single copy call instead of one copy per result

not actually that useful in practice because of how query pools are shared,
but could help somewhere in theory

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21581>
2023-03-06 02:22:39 +00:00
Mike Blumenkrantz
7f956435a0 zink: rework xfb queries for drivers with poor primgen support
for drivers lacking one of:
* EXT_color_write_enable
* primitivesGeneratedQueryWithRasterizerDiscard

terrible things must happen. specifically, dummy surfaces have to
be used in a framebuffer with rast-discard enabled for the duration
of the query

now that queries are only started/stopped in renderpasses, however,
there are new hurdles. with tc renderpass optimizing, queries can be
started outside the renderpass, which would trigger recursion when
trying to start a primgen query outside the renderpass if any clears
are enabled, as those must be flushed onto the real surfaces

to solve all of this:
* block tc renderpass optimizing if at least one of the above features is missing
* detect a pending primgen query start during renderpass start
* activate rast-discard and set dummy surfaces before beginning renderpass
  * this recurses and automatically flushes clears
* finally, start the real renderpass

BUT WAIT THERE'S MORE!

because there's also drivers that support EXT_color_write_enable and don't support
primitivesGeneratedQueryWithRasterizerDiscard, which means they do need rast-discard,
but they don't need dummy surfaces, and so the clears still have to be flushed,
so they need an explicit (recursive) renderpass start/stop in advance to
ensure the clears are applied as expected

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21628>
2023-03-06 02:00:06 +00:00
Mike Blumenkrantz
5144c8a858 zink: track whether a primgen query is suspended and needing color write hacks
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21628>
2023-03-06 02:00:06 +00:00
Mike Blumenkrantz
9bc871199c zink: only resume queries inside renderpasses from set_active_query_state
match new default query behavior

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21628>
2023-03-06 02:00:06 +00:00
Mike Blumenkrantz
81de7a1c25 zink: resume queries after conditional render and clears are processed
this should have no functional effect other than ensuring primgen queries
don't recurse when detecting clears

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21628>
2023-03-06 02:00:06 +00:00
Mike Blumenkrantz
f7d1fff23f zink: disable queries for clear_texture()
this otherwise can do weird things

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21628>
2023-03-06 02:00:06 +00:00
David Heidelberg
26dc5b3737 ci/ci_run_n_monitor: while we usually disable many jobs, print them inline
Saving scrolling time...

Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21713>
2023-03-06 01:51:59 +01:00
Friedrich Vock
f5061758be radv: Use LDS for closest-hit hit attributes
Q2RTX: 23.1ms -> 22.9ms

shader-db:
Totals from 19 (0.69% of 2764) affected shaders:

MaxWaves: 197 -> 208 (+5.58%)
Instrs: 87702 -> 87817 (+0.13%); split: -0.03%, +0.16%
CodeSize: 474320 -> 475128 (+0.17%)
VGPRs: 1840 -> 1728 (-6.09%)
Latency: 2771599 -> 2773173 (+0.06%); split: -0.13%, +0.18%
InvThroughput: 561281 -> 533010 (-5.04%); split: -5.16%, +0.12%
VClause: 2782 -> 2788 (+0.22%); split: -0.18%, +0.40%
Copies: 12115 -> 12136 (+0.17%); split: -0.45%, +0.63%
Branches: 4116 -> 4122 (+0.15%)
PreVGPRs: 1665 -> 1638 (-1.62%); split: -1.92%, +0.30%
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21635>
2023-03-05 21:53:34 +00:00
Friedrich Vock
c1651a1032 radv: Extend hit attribute lowering for LDS
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21635>
2023-03-05 21:53:34 +00:00
Alyssa Rosenzweig
61663859bc asahi: Wire up compute kernels
Now that we have multiple sysval tables, implementing compute kernels --
including with indirect dispatch and load_num_workgroups -- is straightforward.
This patch adds the straightforward launch_grid implementation.

As usual needs UAPI support patches to actually do anything, but the relevant
compute tests are passing downstream.

It's not possible to properly test compute shaders support right now (pending
support for images), so we don't update the CAPs or features.txt here. This is
more about flushing out the piles of downstream patches we have (and getting
reviewed!) in preparation for cutting a downstream release soon.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21703>
2023-03-05 19:40:43 +00:00
Alyssa Rosenzweig
c086f2770b asahi: Rework system value lowering
The previous lowering was insufficient in two areas:

* No support for indirection. This is required for dynamically indexing into
  UBOs, SSBOS, etc in OpenGL ES 3.2

* Only a single table supported. Multiple tables are required to implement
  indirect dispatch/draws efficiently, in order to bind the indirect buffer as
  uniforms.

The first problem is addressed here by reworking the lowering of
system values to happen in NIR, decoupled from the uniform register assignment
details, such that we can handle 1:n lowerings in a straightforward way.
Namely, indirect sysvals are lowered to indirect memory loads relative to the
base address of the sysval table, where the table address is itself pushed as a
(direct) sysval.

The second problem is addressed in this patch by generalizing to multiple
uniform tables.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21703>
2023-03-05 19:40:43 +00:00
Alyssa Rosenzweig
f92738eaaa agx: Handle fragment shader side effects
Fragment shaders with side effects need to be lowered to ensure they execute for
all shaded pixels but no helper threads. Add a lowering pass to handle this.

Fixes dEQP-GLES31.functional.shaders.opaque_type_indexing.atomic_counter.const_literal_fragment

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21712>
2023-03-05 19:12:35 +00:00
Alyssa Rosenzweig
290f3b76f3 agx: Disable tri merging with side effects
As Metal does.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21712>
2023-03-05 19:12:35 +00:00
David Heidelberg
b20c9adb4e crocus/meson: add dependency on libintel_dev also for versioned static libraries
Fixes: a0fa31bcdd ("intel/dev: create a helper dependency for libintel_dev")

Reviewed-by: Mark Janes <markjanes@swizzler.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21709>
2023-03-05 18:44:54 +00:00
Rob Clark
8e7511ea7f vk/runtime: Use libdrm shim
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21636>
2023-03-05 16:31:51 +00:00
Rob Clark
44f7ec40ef loader: Use libdrm shim
Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21636>
2023-03-05 16:31:51 +00:00
Rob Clark
5f5ccf4bec turnip: Use libdrm shim
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21636>
2023-03-05 16:31:51 +00:00
Rob Clark
e05abb1345 util: Add a simple no-op libdrm shim
Make it easier to deal with build configs that do not have libdrm.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21636>
2023-03-05 16:31:51 +00:00
David Heidelberg
b73b701579 ci/freedreno: rare flake KHR-GL45.sample_variables.mask.rgba8i.samples_4.mask_3
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21718>
2023-03-05 14:34:33 +00:00
David Heidelberg
5ee724e180 ci/lavapipe: add recent occasional flake
Issue: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8441

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21717>
2023-03-05 14:35:45 +01:00
Gert Wollny
9b09f244f0 r600/sfn: Fix atomic lowering
Fixes: 56dedf052f
  r600/sfn: add r600 specific lowering pass for atomics and use it

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21684>
2023-03-05 09:54:08 +00:00
Gert Wollny
3c3ecdab36 r600/sfn/tests: Add a test for the copy prop into a group
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21684>
2023-03-05 09:54:08 +00:00
Gert Wollny
244cc152d1 r600/sfn: redirect copy propagation to alu parent group
If an ALU instruction was emitted from the get-go as group, then
we have to make sure that replacing a source doesn't violate the
readport configuration in the group.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8374

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21684>
2023-03-05 09:54:08 +00:00
Gert Wollny
2028465bd8 r600/sfn: Add print method to AluReadportValidation
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21684>
2023-03-05 09:54:08 +00:00
Gert Wollny
ee0010213f r600/sfn: Add method to AluGroup to replace sources
Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8374

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21684>
2023-03-05 09:54:08 +00:00
Gert Wollny
6180721005 r600/sfn: Split AluInstr replace_source into test and actual replace
Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8374

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21684>
2023-03-05 09:54:08 +00:00
Gert Wollny
afa545b926 r600/sfn: Add AluGroup method to update readport validation from scratch
Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8374

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21684>
2023-03-05 09:54:08 +00:00
Alyssa Rosenzweig
ed587ae6ac asahi/meta: Use lowered I/O
No point in creating a variable when we can just synthesize the store_output
directly.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21430>
2023-03-05 09:27:02 +00:00
Alyssa Rosenzweig
485eddcc85 asahi: Bump shader buffers
No reason to limit it, it's direct access anyway.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21430>
2023-03-05 09:27:02 +00:00
Alyssa Rosenzweig
c7b5f01461 agx: Only lower int64 late
This is required for address arithmetic to be lowered properly for compute
kernels, which may have u2u64 in the source NIR.

No shader-db changes (for GLES3.0).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21430>
2023-03-05 09:27:02 +00:00
Alyssa Rosenzweig
811f8b899d agx: Don't print pre-optimization shader
It's usually too noisy to be useful, especially before DCE. The optimized (but
pre-RA) shader is usually the useful bit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21430>
2023-03-05 09:27:02 +00:00
Alyssa Rosenzweig
ea37d7f81f agx: Use agx_emit_collect for st_tile
Instead of open coding.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21430>
2023-03-05 09:27:02 +00:00
Alyssa Rosenzweig
7bb8112fd1 agx: Refactor vector creation
agx_vec4 is unused, drop in, and split out the common logic since we'll use it
in a new helper.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21430>
2023-03-05 09:27:02 +00:00
Alyssa Rosenzweig
037609f1dc agx: Constify agx_print
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21430>
2023-03-05 09:27:02 +00:00
Alyssa Rosenzweig
a9c5956f2f agx: Inline 16-bit load/store offsets
Most integer immediates are only 8-bit, but load/store instructions allow their
immediate offsets to be 16-bit instead. Take advantage of this in the optimizer.
This eliminates 36% of the instructions in
dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer.36, a fitting
percentage.

Insignificant effect on dEQP-GLES31.functional.ssbo.* performance... Only a
small % of our compile-time pie is actually spent in the backend anyway (as
opposed to NIR passes or GLSL IR).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21430>
2023-03-05 09:27:02 +00:00
Alyssa Rosenzweig
c9728b41d5 agx: Factor out allows_16bit_immediate check
The optimizer needs this information to inline immediates effectively.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21430>
2023-03-05 09:27:02 +00:00
Alyssa Rosenzweig
445ca949cd agx: Clean up after lowering address arithmetic
This avoids creating silly preambles that don't actually do anything except push
a constant that we could've inlined for cheaper anyway, since nir_opt_preamble's
cost model is sensitive to e.g. constant folding.

This avoids a pointless preamble in split-hell.

As a nice bonus, this also improves compile-time on address-heavy shaders. With
a release build, CPU time in dEQP-GLES31.functional.ssbo.* reduces from 12.87s
to 10.77... a 16% improvement is nothing to sneeze at.

shader-db results are mostly noise.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21430>
2023-03-05 09:27:02 +00:00
Alyssa Rosenzweig
4b1f4b86ea agx: Add AGX_MESA_DEBUG=nopreamble option
Useful both for ruling out issues with shader preambles as well as (in some
cases) making for a nicer reading experience of the compiled assembly.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21430>
2023-03-05 09:27:02 +00:00
Alyssa Rosenzweig
c22a18c9af agx: Don't write sample mask from preambles
It doesn't make sense, they're basically little compute kernel environments.
Noticed while debugging dEQP-GLES31.functional.fbo.no_attachments.multisample.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21710>
2023-03-05 08:20:09 +00:00
Alyssa Rosenzweig
e9f7d14de6 asahi: Mark PIPE_FORMAT_NONE "supported"
Kinda silly but fixes
dEQP-GLES31.functional.state_query.integer.max_framebuffer_samples_* which
queries the number of samples of a NONE format, required for
ARB_framebuffer_no_attachments to make sense.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21710>
2023-03-05 08:20:09 +00:00
Alyssa Rosenzweig
8bb40ce4ad agx: Fix 2D MSAA array texture register allocation
Sample index and layer index are both 16-bits, even though they are zero
extended for compiler simplicity in some cases. In particular this means that 2D
MSAA arrays consume 6 half-regs for their coordinates, not 8. This is what the
IR translation (actually agx_nir_lower_texture) produces, we just need to fix
the calculation in agx_read_registers to agree.

Fixes validation failure in tests like
dEQP-GLES31.functional.texture.multisample.samples_4.use_texture_color_2d_array

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21708>
2023-03-05 08:06:43 +00:00
Alyssa Rosenzweig
3032e3ad23 agx: Mask shifts in the backend
This gives our shifts SM5 behaviour at the cost of a little extra ALU. That way,
we match NIR's shifts.

This fixes unsoundness of GLSL expressions like "a << (b & 31)", where the &
would mistakenly get optimized away.

Closes: #8181
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reported-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21673>
2023-03-05 07:52:22 +00:00
Alyssa Rosenzweig
f4e2b22646 asahi: Advertise dual-source blending
This is handled entirely in common code.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21545>
2023-03-05 07:38:36 +00:00
Yogesh Mohan Marimuthu
af953616a1 wsi/display: check alloc failure in wsi_display_alloc_connector()
vulkancts test dEQP-VK.wsi.direct_drm.surface.create_simulate_oom is failing
because in wsi_display_alloc_connector() function memory allocation for
connector is not checked for return NULL. create_simulate_oom test simulates
out of memory, hence memory allocation fails for connector and later when
tried to dereference connector program will segfault.

This patch fixes the dEQP-VK.wsi.direct_drm.surface.create_simulate_oom test
segfault issue by checking if connector is NULL afer memory allocation.

Cc: mesa-stable
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21701>
2023-03-04 21:20:54 +00:00
Rob Clark
82cc236458 freedreno/a6xx: Fix mirror x/y blits
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21706>
2023-03-04 19:13:40 +00:00
Rob Clark
ec9e03fb39 freedreno/a6xx: Convert blitter to OUT_REG()
We'll need this to add a7xx support, since some of the regs are
different btwn a6xx and a7xx and reg variants are not supported with
the legacy reg builders.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21706>
2023-03-04 19:13:40 +00:00
Rob Clark
149f2a2e81 freedreno/a6xx: Namespace reg/pkt packer vars
Otherwise they could conflict with parameters to the reg/pkt.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21706>
2023-03-04 19:13:40 +00:00
Alyssa Rosenzweig
1d2c1b8bd6 pan/mdg: Use nir_lower_helper_writes
It's now in common code, drop our (buggier) copy.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21413>
2023-03-04 13:31:05 -05:00
Alyssa Rosenzweig
586da7b329 nir: Add nir_lower_helper_writes pass
This NIR pass lowers stores in fragment shaders to:

   if (!gl_HelperInvocaton) {
      store();
   }

This implements the API requirement that helper invocations do not have visible
side effects, and the lowering is required on any hardware that cannot directly
mask helper invocation's side effects. The pass was originally written for
Midgard (which has this issue) but is also needed for Asahi. Let's share the
code, and fix it while we're at it.

Changes from the Midgard pass:

1. Add an option to only lower atomics.

   AGX hardware can mask helper invocations for "plain" stores but not for
   atomics.  Accordingly, the AGX compiler wants this lowering for atomics but
   not store_global. By contrast, Midgard cannot mask any stores and needs the
   lowering for all store intrinsics. Add an option to the common pass to
   accommodate both cases.

   This is an optimization for AGX. It is not required for correctness, this
   lowering is always legal.

2. Fix dominance issues.

   It's invalid to have NIR like

      if ... {
         ssa_1 = ...
      }

      foo ssa_1

   Instead we need to rewrite as

      if ... {
         ssa_1 = ...
      } else {
         ssa_2 = undef
      }
      ssa_3 = phi ssa_1, ssa_2

      foo ssa_3

   By default, neither nir_validate nor the backends check this, so this doesn't
   currently fix a (known) real bug. But it's still invalid and fails validation
   with NIR_DEBUG=validate_ssa_dominance.

   Fix this in lower_helper_writes for intrinsics that return data (atomics).

3. Assert that the pass is run only for fragment shaders. This encourages
   backends to be judicious about which passes they call instead of just
   throwing everything in a giant lower everything spaghetti.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21413>
2023-03-04 13:31:05 -05:00
Asahi Lina
1dd872ec17 asahi: Assert on TIB strides > 64
These just don't seem to work. macOS falls back to eMRT here...

dEQP-GLES3.functional.draw_buffers_indexed.random.max_implementation_draw_buffers.13
from Fail -> Crash. Proper solution will come when we implement eMRT later on.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21705>
2023-03-04 10:58:10 -05:00
Rhys Perry
aa32dc704f nir/range_analysis: fix vectorized phis and intrinsics
Found by inspection.

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/21288>
2023-03-04 12:58:38 +00:00
Eric Engestrom
a19a37e8d7 vk: be stricter about symbols check between android and other platforms
Don't allow HMI on non-Android, don't allow non-HMI on Android, and
don't allow missing HMI on Android.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21631>
2023-03-04 07:41:10 +00:00
Eric Engestrom
2a6fbc4bb2 android/vk: drop unnecessary symbols
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21631>
2023-03-04 07:41:10 +00:00
Eric Engestrom
4e1eb53b5e vn: add linker script to fix android symbols
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21631>
2023-03-04 07:41:10 +00:00
Eric Engestrom
2b1e9b0fd6 anv: add linker script to fix android symbols
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21631>
2023-03-04 07:41:10 +00:00
Eric Engestrom
6f654d532b tu: add linker script to fix android symbols
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21631>
2023-03-04 07:41:10 +00:00
Eric Engestrom
c4e2400461 v3dv: add linker script to fix android symbols
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21631>
2023-03-04 07:41:10 +00:00
Eric Engestrom
78578a6ddb vk: move radv's linker symbols scripts for use in all drivers
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21631>
2023-03-04 07:41:10 +00:00
Lionel Landwerlin
938f7a48b2 anv: VK_EXT_image_sliced_view_of_3d
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21376>
2023-03-04 06:12:46 +00:00
Faith Ekstrand
7e1b62ea5b isl: Set Depth to array len for 3D storage images
This is necessary for RESINFO to work properly.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21376>
2023-03-04 06:12:46 +00:00
Faith Ekstrand
74e6e207fe intel/blorp: Set array_len for 3D images properly
We need to minify the depth so we don't set a size that's out-of-bounds.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21376>
2023-03-04 06:12:46 +00:00
Lionel Landwerlin
4ee1908ab6 vulkan/runtime: only consider slice info with 3D image views
Because we can have 2D views of 3D images, we want to consider the
slice info only with 3D *image views*.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 66e3ccbcac ("vulkan/runtime: store parameters of VK_EXT_sliced_view_of_3d")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21376>
2023-03-04 06:12:46 +00:00
Faith Ekstrand
3384e4f768 vulkan/runtime: Rename and document storage image Z range
This makes it more clear that the fields specifically apply to the Z
range and aren't array slices.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21376>
2023-03-04 06:12:46 +00:00
Juston Li
464cae9497 venus: shader cache fossilize replay fix
venus utilizes the host side shader cache.

This is a WA to generate shader cache files containing headers with
a unique cache id that will change based on host driver identifiers.
This allows fossilize replay to detect if the host side shader cache
is no longer up to date.
The shader cache is destroyed after creating the necessary files and
not utilized by venus.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21664>
2023-03-04 05:56:04 +00:00
David Heidelberg
60ae5b106f ci/zink: add skip for the Single-GL46.enhanced_layouts.ssb_member_align_non_power_of_2
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21668>
2023-03-04 04:02:03 +00:00
David Heidelberg
5353fc94e5 ci: Retry, retry, retry... No one likes to trigger Marge more than once.
Sadly, have to decrease retry attempts from 2 to 1 for `runner_system_failure` since it's not doable while keeping one attempt for every other failure.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21668>
2023-03-04 04:02:03 +00:00
David Heidelberg
d73d383ed2 ci: deqp-runner: drop already unused function
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21668>
2023-03-04 04:02:03 +00:00
David Heidelberg
1fbdf57c48 ci: make meson build and test uncollapsed
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8419

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21668>
2023-03-04 04:02:03 +00:00
Sil Vilerino
fb82371558 d3d12: VP9 Decode - Fix use_prev_in_find_mvs_refs calculation
Fixes: c8e8ce83 ("d3d12: Add VP9 Decode support")

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21694>
2023-03-04 03:22:48 +00:00
Sil Vilerino
6fea823dc0 frontend/va: Keep track of some VP9 previous frame data for current frame use_prev_in_find_mvs_refs
Fixes: c8e8ce83 ("d3d12: Add VP9 Decode support")

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21694>
2023-03-04 03:22:48 +00:00
Konstantin Seurer
f094e69469 radv/rt: Use ushr for extracting the cull mask
Fixes the following tests:
dEQP-VK.ray_tracing_pipeline.acceleration_structures.ray_cull_mask.gpu_built.ahit.4_bits
dEQP-VK.ray_tracing_pipeline.acceleration_structures.ray_cull_mask.gpu_built.ahit.16_bits
dEQP-VK.ray_tracing_pipeline.acceleration_structures.ray_cull_mask.gpu_built.chit.4_bits
dEQP-VK.ray_tracing_pipeline.acceleration_structures.ray_cull_mask.gpu_built.chit.16_bits
dEQP-VK.ray_tracing_pipeline.acceleration_structures.ray_cull_mask.gpu_built.isec.4_bits
dEQP-VK.ray_tracing_pipeline.acceleration_structures.ray_cull_mask.gpu_built.isec.16_bits

Fixes: 2d93ab7 ("radv/rt: Pre shift cull_mask")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21659>
2023-03-03 23:56:49 +00:00
Timur Kristóf
d89aea73e2 util: Add util_format_get_array.
This is a poor man's version of MESA_ARRAY_FORMAT.
Implemented based on a gigantic switch-case
with some help from the C preprocessor.
Thank you, preprocessor!

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21692>
2023-03-03 23:08:57 +00:00
Asahi Lina
26c51bb8d8 asahi: clang-format the world again
Some things were missed (like winsys) and there's still some bad include
orders lying around and some other randomness.

We should set up CI checks for this soon... ^^;;

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21687>
2023-03-03 22:55:59 +00:00
Jordan Justen
b02600cde1 intel/vk/grl: genX-ify grl_cl_kernel_name()
I don't see any code calling this, but with multiple gens, the symbol
name would conflict.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21670>
2023-03-03 21:37:19 +00:00
Jordan Justen
d68c9e0dcf intel/vk/grl: genX-ify genX_grl_uuid.cpp
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21670>
2023-03-03 21:37:19 +00:00
Jordan Justen
14007a525b intel/vk/grl: Allow grl/grl_cl_kernel.h to be included by C++ files
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21670>
2023-03-03 21:37:19 +00:00
Jordan Justen
4a7ddc4841 intel/vk/grl: Allow genX_grl.h to be included by C++ files
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21670>
2023-03-03 21:37:19 +00:00
Jordan Justen
3251db1270 intel/vk/grl: Don't include anv_private.h in genX_grl.h
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21670>
2023-03-03 21:37:19 +00:00
Eric Engestrom
a535f213d7 asahi/winsys: add .clang-format
Copied from src/asahi/.clang-format

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21691>
2023-03-03 21:23:03 +00:00
Asahi Lina
af8d97d096 asahi: Destroy the renderonly context on screen destroy
This fixes an fd leak due to leaving behind the dup'd renderonly fd.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21677>
2023-03-03 21:11:47 +00:00
Asahi Lina
0a5f3556a1 asahi: Fix device fd leak in agx_close_device
I'm not sure if this was always broken downstream or just got dropped at
some point, but it's definitely UAPI-agnostic and missing now that we
have all the non-UAPI bits upstream.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21677>
2023-03-03 21:11:47 +00:00
Alyssa Rosenzweig
f083e1807d asahi/decode: Handle VDM barriers
We emit these now (for transform feedback).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21675>
2023-03-03 20:54:18 +00:00
Alyssa Rosenzweig
2eb1efd181 docs/feature: Mark ARB_sync as done on Asahi
Strictly, this extension was already advertised, but it didn't seem nice to mark
it DONE when there was no sync support in the driver whatsoever. Mark it done
now that we do have proper explicit sync (well, in conjunction with the "add
Linux UAPI" patches that are blocked on getting the kernel driver upstream, but
that's needed for *any* of these extensions to be there!)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21676>
2023-03-03 20:47:40 +00:00
Timur Kristóf
05e6d945ad radv: Emulate VGT_ESGS_ITEMSIZE in shaders on GFX9+.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21434>
2023-03-03 20:15:10 +00:00
Rhys Perry
8aff7152a0 aco: make IDSet sparse
Improves compilation time of huge shaders.

A ray tracing pipeline of Hellblade: Senua's Sacrifice compiles in about
half the time, with this patch.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8179
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21022>
2023-03-03 17:45:14 +00:00
Asahi Lina
8e0c832c30 asahi: Fix scissor culling check when out of bounds for FB/viewport
Fixes a bunch of the `assert(maxx > minx && maxy > miny)` failures in
dEQP-EGL and probably others.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21678>
2023-03-03 16:42:18 +00:00
Asahi Lina
1313787c12 asahi: Do not overread user index buffers
We need to align the extent to 4 for the GPU, but we can't copy more
than the original size out of the user buffer. Always alloc the exact
size we need.

This does mean the GPU gets an IB extent that could include some other
stuff later in the pool, if not aligned. This is probably safe? Given
the base alignment, it should never cross a page boundary and fault or
anything like that.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21686>
2023-03-03 16:28:46 +00:00
José Roberto de Souza
1fecb26634 iris: Add iris_bo_set_caching()
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21688>
2023-03-03 16:02:46 +00:00
José Roberto de Souza
5dc0f18333 iris: Move iris_bo_madvise() to i915/iris_bufmgr.c
Start to split functions that are not in hot paths to specific i915
files.

Also making it static as iris_bo_madvise() is only called from
iris_bufmgr.c and adding a enum iris_madvice to be used among all
backends.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21688>
2023-03-03 16:02:46 +00:00
Rhys Perry
736d6643bb aco/tests: add tests for v_fma_f32 with 2 fp16 literals
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/21633>
2023-03-03 14:20:55 +00:00
Lionel Landwerlin
afb0289d7c blorp: add dependency on idep_intel_dev
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 3c9a8f7a6d ("intel/dev: generate helpers to identify platform workarounds")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8421
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21679>
2023-03-03 13:04:23 +00:00
Marcin Ślusarz
75ce0bfd85 crocus/meson: add back dependency on libintel_dev
Fixes: a0fa31bcdd ("intel/dev: create a helper dependency for libintel_dev")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21679>
2023-03-03 13:04:23 +00:00
Lionel Landwerlin
1d9cf8f381 anv: add gfx9 generated draw support
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
3ac7d5f258 anv: remove unused item_count parameter
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
ec66054426 anv: use a list of generated shaders
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
b32303c369 anv: move common shader code into header
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
ac71719d4a anv: pack more data into generated draws input
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
200cec935d anv: use 64bit int support in generation shaders
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
a2026bf5f9 anv: rename generated draws for Gfx11
We'll need different shaders for Gfx9

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
caf2389bc5 anv: use a single generation shader for indirect draws
The indirect draw count shader can be used as a more generic case of
the indirect draw one. We'll never enter the last condition of the
shader (writing the MI_BATCH_BUFFER_START) with non count variants of
draws.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
897a92f576 anv: remove MI_NOOPs at the end of the generation batch
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
aa18d52728 anv: make sure mi_memcpy lands before push constant loads
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: e2dc32d755 ("anv: move functions around to plan for generated draws")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
e68615aeaa anv: fix indirect draws VF cache tracking of index buffer
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: e2dc32d755 ("anv: move functions around to plan for generated draws")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
1454b789b1 anv: fix 3DSTATE_PS emission in generation shaders
We have to use the helper and also were missing the vector mask
programming.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
8f16ca8741 anv: remove commented code
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
f5dc88910f anv: remove pre hasvk split assert
With softpin we should not always expect a BO in addresses.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
ae398284c9 anv: limit push constant dirtyness with generation shaders
We only use the fragment shader push constants.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
2ea106e758 anv: correctly program 3DSTATE_SF in generation shaders
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
e698040061 anv: remove BTI related flush in generation shaders
Earlier versions of the generation shaders were using the binding
table. We since switch to A64 messages. So the flush can be removed.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
1dcb536acd anv: remove copied code from generation shader
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
63fa6d9f49 anv: fix generated forward jump with more than 67M draws
The issue here is that for draw indirect count variants, we want to
jump after the last generated draw call to the next location where
commands are. But if we have more than 67M draws (8k * 8k chunks), we
only know the location once we've generated each of the 8k * 8k
chunks.

This change adds a CPU side pointer in the push constant struct so
that we can create a single linked list of chunks to edit and go
through to write the correct jump address after all the generated
space has been allocated.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
c1c680c08b anv: correctly reset generation address on command buffer reset
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
4246a519f3 anv: fix incorrect parameter
cmd_buffer_update_dirty_vbs_for_gfx8_vb_flush takes a value RANDOM/SEQUENTIAL. Not a boolean.
Fortunately this worked okay because true == RANDOM

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Lionel Landwerlin
234505f013 util/glsl2spirv: add support for include directive
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
2023-03-03 11:30:54 +00:00
Eric Engestrom
eae5aa943a panfrost/ci: add EGL tests
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21504>
2023-03-03 10:14:29 +00:00
Lionel Landwerlin
6ee7a2ecfa anv: pull Wa_14016118574 out of some loop not changing state
The WA is meant to be here to apply some state that is not propagated
properly inside the HW. But if you have a loop like :

for ( ... ) {
  emit(3DPRIMITIVE, some param);
}

You're not really changing any state, just push more draws into the
pipeline.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: f2645229c2 ("anv: implement Wa_14016118574")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21660>
2023-03-03 09:34:16 +00:00
Lionel Landwerlin
d82e8e01c8 anv: fixup condition for Wa_14016118574
We don't want the WA to kick-in if it's not point/line topology.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: f2645229c2 ("anv: implement Wa_14016118574")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21660>
2023-03-03 09:34:16 +00:00
Samuel Pitoiset
3e4541bb56 radv/ci: adjust timeouts for Vega10 and Renoir
With latest CTS it takes much more time.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21390>
2023-03-03 08:23:22 +00:00
Samuel Pitoiset
f775873f81 ci: uprev CTS to 1.3.5.0
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21390>
2023-03-03 08:23:21 +00:00
Samuel Pitoiset
3b9937c85e radv: stop allocationg the attr ring BO for compute queues on GFX11
Only needed for graphics. This saves ~8Mib of 32-bit VRAM per compute
queue.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21632>
2023-03-03 07:27:21 +00:00
José Roberto de Souza
23f8b5b7a2 iris: Add initial skeleton of kmd backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21369>
2023-03-03 05:57:05 +00:00
José Roberto de Souza
cebffb404f iris: Use DRM_IOCTL_I915_GEM_CREATE_EXT in all supported kernels
As we start to refactor the iris code base to support Xe KMD here I'm
dropping DRM_IOCTL_I915_GEM_CREATE usage as much as possible and
unifying all graphics memory allocation calls to
DRM_IOCTL_I915_GEM_CREATE_EXT.

The kernel version that implemented DRM_I915_QUERY_MEMORY_REGIONS uAPI
also implemented DRM_IOCTL_I915_GEM_CREATE_EXT so we can use that
to safely call DRM_IOCTL_I915_GEM_CREATE_EXT.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21369>
2023-03-03 05:57:05 +00:00
José Roberto de Souza
65d129ec15 iris/bufmgr: Add i915_gem_set_domain()
Avoids code duplication.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21369>
2023-03-03 05:57:05 +00:00
José Roberto de Souza
d6754c1e04 iris: Convert drm_i915_gem_memory_class_instance to intel_memory_class_instance
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21369>
2023-03-03 05:57:05 +00:00
José Roberto de Souza
a24d93aa89 intel/dev: Query and compute hardware topology for Xe
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21368>
2023-03-03 05:25:35 +00:00
José Roberto de Souza
4b81a80f55 intel/dev: Implement Xe functions to handle hwconfig
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21368>
2023-03-03 05:25:35 +00:00
José Roberto de Souza
bc24091c52 intel/dev: Implement Xe functions to fill intel_device_info
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21368>
2023-03-03 05:25:35 +00:00
José Roberto de Souza
545d7e07ca intel/dev: Add INTEL_KMD_TYPE_XE
As mentioned in the previous patch, if intel-xe-kmd is disabled
it will fail to detected in run time but it will still compile all
Xe files.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21368>
2023-03-03 05:25:35 +00:00
José Roberto de Souza
7d34ec4691 intel: Add Meson parameter to enable Xe KMD support
The plan is to compile all the Xe files but in run time it will fail
to detect the KMD loaded and it will fall back to software
rendering(if build).

Compiling Xe files makes sure newer commits don't break Xe even if
developers don't have Xe enabled in their build folder.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21368>
2023-03-03 05:25:35 +00:00
José Roberto de Souza
ee510e2c50 intel: Pull in xe_drm.h
This is the uapi of the new Xe kernel driver.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21368>
2023-03-03 05:25:35 +00:00
Mark Janes
276f4a9d8c intel/dev: Print required workarounds with intel_dev_info
With the addition of workarounds, the output from this tool is more
verbose than some users will want.  Provide optional parameters for
enabling hwconfig and workaround details.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21639>
2023-03-03 04:55:08 +00:00
Hans-Kristian Arntzen
b7926303e6 radv: Expose VK_EXT_swapchain_maintenance1.
Passes dEQP-VK.wsi.*.maintenance1.*.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20235>
2023-03-03 03:59:13 +00:00
Hans-Kristian Arntzen
3d0258c679 wsi/win32: Implement VK_EXT_swapchain_maintenance1.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Jesse Natalie <jenatalie@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20235>
2023-03-03 03:59:13 +00:00
Hans-Kristian Arntzen
1b047ceac2 wsi/display: Implement EXT_swapchain_maintenance1.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20235>
2023-03-03 03:59:13 +00:00
Hans-Kristian Arntzen
07ac177c3f wsi/wayland: Implement EXT_swapchain_maintenance1.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20235>
2023-03-03 03:59:13 +00:00
Hans-Kristian Arntzen
ad71d584cf wsi/common: Add function to modify present mode.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20235>
2023-03-03 03:59:13 +00:00
Hans-Kristian Arntzen
d79fa8a03a wsi/common: Add comment about DEFERRED_ALLOCATION_BIT_EXT.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20235>
2023-03-03 03:59:13 +00:00
Hans-Kristian Arntzen
ae920c8420 wsi/common: Implement swapchain present fence.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20235>
2023-03-03 03:59:13 +00:00
Hans-Kristian Arntzen
be0dcbdfa2 wsi/x11: Implement EXT_swapchain_maintenance1.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20235>
2023-03-03 03:59:13 +00:00
Hans-Kristian Arntzen
8ece1ade5b wsi/common: Add common implementation of vkReleaseSwapchainImagesEXT.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20235>
2023-03-03 03:59:13 +00:00
Marek Olšák
c1fa7fe785 lavapipe/ci: add a new flake
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19399>
2023-03-03 03:27:40 +00:00
Marek Olšák
4f7e353237 amd: lower multi-component subdword SSBO loads in NIR
because the hw and LLVM only support subdword single-component SSBO loads,
and ac_nir_to_llvm splits multi-component loads because of that, which is
inefficient.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19399>
2023-03-03 03:27:40 +00:00
Marek Olšák
82919e2dcb amd: lower subdword UBO loads in NIR
This fixes broken subdword UBO loads with LLVM.

It's only needed for LLVM, but it's done for both LLVM and ACO because
the pass can be fully validated only with ACO and the Vulkan CTS right now.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19399>
2023-03-03 03:27:40 +00:00
Marek Olšák
1a424fee4a ac/llvm: implement nir_op_unpack_32_4x8
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19399>
2023-03-03 03:27:40 +00:00
Marek Olšák
6aee999131 aco: implement nir_op_unpack_32_4x8
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19399>
2023-03-03 03:27:40 +00:00
Marek Olšák
09005e6dfc ac/nir: add ac_nir_lower_subdword_loads to lower 8/16-bit loads to 32 bits
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19399>
2023-03-03 03:27:40 +00:00
Marek Olšák
b80bd58265 nir: skip nir_op_unpack_32_4x8 in nir_lower_alu_width
The pass can't handle it just like the other unpack opcodes and generates
invalid NIR.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19399>
2023-03-03 03:27:40 +00:00
Marek Olšák
ec38758e86 nir: return progress from nir_lower_io_to_scalar
oversight?

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19399>
2023-03-03 03:27:40 +00:00
Faith Ekstrand
9a4641cf6b intel/nir: Limit unaligned loads to vec4
This probably doesn't affect Vulkan or GL because they can't have
anything bigger than a vec4 anyway unless it's a u64vec4 and those have
to be at least 8B aligned.  This may affect CL apps if they use
__attribute__((packed)) on something with big vectors, depending on how
LLVM decides to translate that.

Fixes: f8aa83f0c8 ("intel/nir: Use nir_lower_mem_access_bit_sizes()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21524>
2023-03-03 02:00:39 +00:00
Faith Ekstrand
c11ac5e446 nir: Handle wider unaligned loads in lower_mem_access_bit_size
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21524>
2023-03-03 02:00:39 +00:00
Faith Ekstrand
7e8a10be67 nir: Make chunk_align_offset const in lower_mem_load()
This should make things more clear than changing the value from earlier
in the loop.  Also, rename chunk_offset to load_offset so they match.

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21524>
2023-03-03 02:00:39 +00:00
Faith Ekstrand
eb9a56b6ca nir: Rename nir_mem_access_size_align::align_mul to align
It's a simple alignment so calling it align_mul is a bit misleading.

Suggested-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21524>
2023-03-03 02:00:39 +00:00
Faith Ekstrand
802bf1d9a6 nir: Rename align to whole_align in lower_mem_load
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21524>
2023-03-03 02:00:39 +00:00
Faith Ekstrand
ca4d73ba36 nir: Add a combined alignment helper
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@colllabora.com>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21524>
2023-03-03 02:00:39 +00:00
Faith Ekstrand
e433a7c4fa nir: Add UBO support to nir_lower_mem_access_bit_sizes
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21524>
2023-03-03 02:00:39 +00:00
Faith Ekstrand
116a851264 nir: Add mode filtering to lower_mem_access_bit_sizes
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21524>
2023-03-03 02:00:39 +00:00
Faith Ekstrand
4b06b1a7c5 nir: Check against combined alignment in nir_lower_mem_access_bit_sizes
Checking against align_mul is insufficient if align_offset > 0.  We need
to check against the combined alignment instead.

Fixes: 2e2d7803c7 ("nir: Add a load/store bit size lowering pass")
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21524>
2023-03-03 02:00:39 +00:00
Patrick Lerda
352fee176c mesa/framebuffer: fix gl_framebuffer.resolve refcnt imbalance
Indeed, "resolve" is not freed at the gl_framebuffer destroy
stage.

For instance, this issue is triggered and detected with
"piglit/bin/fbo-depthstencil clear default_fb -samples=2 -auto"
while setting GALLIUM_REFCNT_LOG=refcnt.log.

Fixes: f5bde99cbd ("gallium: plumb resolve attachments through from frontends -> pipe_framebuffer_state")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21663>
2023-03-03 01:28:47 +00:00
Marek Olšák
73c91c4c8a radeonsi: assume shader is never NULL in si_emit_shader_*
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:49 +00:00
Marek Olšák
ab802a1f91 radeonsi: simplify encoding VGPRS and SGPRS
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:49 +00:00
Marek Olšák
63d5eb35f4 radeonsi: check the pm4.reg_va_low_idx assertion unconditionally
This is not a hot path. We can always do this.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:49 +00:00
Marek Olšák
51e4437eee radeonsi: add si_pm4_set_reg_va to simplify setting reg_va_low_idx for RGP
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:49 +00:00
Marek Olšák
8a564f72e5 radeonsi: reindent code in si_state_binning.c
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:49 +00:00
Marek Olšák
3a26d2b1a7 radeonsi: don't merge SET_* packets that have a different index in si_pm4_state
Oops.

Fixes: c8e2c6faf6 ("radeonsi: use SET_SH_REG_INDEX with index=3 for registers containing CU_EN")

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:49 +00:00
Marek Olšák
0d543d76d7 radeonsi: reorganize si_emit_framebuffer_state for better readability
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:49 +00:00
Marek Olšák
0669d7c29b radeonsi: remove Smart Access Memory because CPU access has large overhead
Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8176

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:49 +00:00
Marek Olšák
1862c8296c radeonsi/ci: update flakes and gfx8-polaris11 results
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:48 +00:00
Marek Olšák
3c9aa3e201 amd/rtld: allow 64K LDS for all shader stages except for gfx6
Gfx6 can only use 32K LDS per workgroup.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:48 +00:00
Marek Olšák
ccaaf8fe04 amd: massively simplify how info->spi_cu_en is applied
Instead of having ac_set_reg_cu_en that sets the register, replace it with
ac_apply_cu_en that only returns the modified register value,
which allows a large simplification in both drivers because a lot of code
becomes duplicated after it's switched to ac_apply_cu_en.

RADV also didn't apply it to a few registers. Fixed.

This removes 82 lines of code in total.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:48 +00:00
Marek Olšák
2b3f551ed8 ac/nir: don't use load_esgs_vertex_stride_amd on gfx6-8
An improvement for 9f1e6d8f70.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:48 +00:00
Marek Olšák
79732416fd amd: query cache sizes from the kernel
Also rename l1_cache_size -> tcp_cache_size. L1 means shader array cache.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:48 +00:00
Marek Olšák
6e2e89e6d8 amd,radeonsi: change enabled_rb_mask to 64 bits
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:48 +00:00
Marek Olšák
03ffb8d77c amd: update amdgpu_drm.h
From kernel commit 817714d9665e.

Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
2023-03-03 00:41:48 +00:00
Asahi Lina
8e86ba3dd4 asahi: Pull device name from device struct
This isn't filled in yet, but will be once the UAPI init function is
added.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21662>
2023-03-03 00:28:48 +00:00
Asahi Lina
f1dac37b3d asahi: Add agx_bo_mmap() calls to transfer path
We have the prototype for this already.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21662>
2023-03-03 00:28:48 +00:00
Asahi Lina
3716f72413 asahi: Add result buffer to context/batches
The result buffer is where the kernel places statistics and fault
information after the GPU executes a command. Dummy structure pending
UAPI.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21662>
2023-03-03 00:28:48 +00:00
Asahi Lina
798fc2730b asahi: Add agx_debug_fault() helper
We expect to forward GPU fault information to userspace. Since Mesa can
get that information, we can look up the fault address to log what was
the containing or nearest BO. Add a helper for that, so it can be called
from the driver.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21662>
2023-03-03 00:28:48 +00:00
Asahi Lina
240e9dc5dc asahi: Add APIs for DMA-BUF sync file import/export
These are generic ioctls, so it is safe to add them now.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21662>
2023-03-03 00:28:48 +00:00
Asahi Lina
d610f40e17 asahi: Implement Linux driver scaffolding, sans UAPI
With macOS support out of the way, we can start implementing a lot of
the Linux driver interface and bookkeeping without actually adding the
UAPI proper. Let's do that to reduce the size of the UAPI patchset.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21662>
2023-03-03 00:28:48 +00:00
Asahi Lina
942d9cc17b asahi: Align device submission API with upcoming UAPI
Nothing implemented, but this lets us get the batch tracking bits in,
including explicit sync/DMA-BUF integration which uses generic ioctls.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21662>
2023-03-03 00:28:48 +00:00
Asahi Lina
7f2e24d2ef asahi: Add nocluster,sync,stats debug flags
These are only useful with the upcoming Linux UAPI, but there's no harm
in getting the debug scaffolding in now.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21662>
2023-03-03 00:28:48 +00:00
Asahi Lina
afe134a49c asahi: Drop macOS backend
This might be useful in the future, but it is best reimplemented in
terms of the upcoming Linux UAPI instead of having parallel codepaths.
Let's drop it.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21662>
2023-03-03 00:28:48 +00:00
Yiwei Zhang
b5e7a22c2e venus: ensure invariance of buffer memory requirement size
Need to align the size for the initial cache miss.

Fixes: ef255444c1 ("venus: switch to lazy VkBuffer cache")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21644>
2023-03-03 00:07:23 +00:00
Marek Olšák
2e2605e297 mesa: initialize VertexProgram._VaryingInputs before the first use
Noticed by code inspection.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21438>
2023-03-02 23:38:12 +00:00
Marek Olšák
0a71957a9b mesa: remove a redundant call to _mesa_update_edgeflag_state_vao
It's called again a few lines later.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21438>
2023-03-02 23:38:12 +00:00
Marek Olšák
0293f8d8ce mesa: fix glPopClientAttrib with fixed-func VP and zero-stride varyings
This was missed.

Fixes: 3a294ff01f - mesa: move the _mesa_set_varying_vp_inputs call to where the state changes
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8246

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21438>
2023-03-02 23:38:12 +00:00
Alexandros Frantzis
689ce66a43 vulkan/wsi/wayland: Fix destruction of event queue with proxies still attached.
Destroy the surface dmabuf feedback proxy before destroying the event
queue that the proxy is attached to.

This silences a warning that libwayland 1.22 emits for programs that use
Vulkan/Wayland:

warning: queue 0x557a4efbcf70 destroyed while proxies still attached:
  zwp_linux_dmabuf_feedback_v1@18 still attached

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21647>
2023-03-02 19:09:29 +00:00
Alexandros Frantzis
ee5d2250fd egl/wayland: Fix destruction of event queue with proxies still attached.
Destroy the display wrapper proxy before destroying the event queue that
the proxy is attached to.

This silences a warning that libwayland 1.22 emits for programs that use
EGL/Wayland:

warning: queue 0x562a5ed2cd20 destroyed while proxies still attached:
  wl_display@1 still attached

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21646>
2023-03-02 18:32:02 +00:00
Lionel Landwerlin
f1e4d5c910 anv: fix scratch buffer reloc in 3DSTATE_HS
We need to have the scratch buffer added to the pipeline BO tracking
list, so it's added to the batch buffer and finally to the execbuffer
list. Otherwise we pagefault (or read the default scratch page on
i915).

Fixes
dEQP-VK.subgroups.ballot_broadcast.graphics.subgroupbroadcast_u16vec4
on CI (and probably other tests).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 2028f1caa3 ("anv: emit 3DSTATE_HS in cmd_buffer_flush_gfx_state")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21653>
2023-03-02 17:51:41 +00:00
Väinö Mäkelä
e509afacf3 hasvk: Disable non-zero fast clears for 8xMSAA images
Using texelFetch to read samples from an 8xMSAA fast cleared image on
Haswell can read transparent black pixels around triangles from where
there should be none. This issue isn't present when using sample
shading, resolving the image using vkCmdResolveImage or in a copy the
image. The easiest way to fix this is by just disabling non-zero fast
clears for 8xMSAA images.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7587

Cc: mesa-stable
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21444>
2023-03-02 17:26:09 +00:00
Rhys Perry
dc01f03d1b radv: remove is_internal pipeline creation parameter
Instead, check if the cache is the meta shader cache. This catches the
shaders created by radv_create_radix_sort_u64().

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21606>
2023-03-02 16:48:09 +00:00
Karmjit Mahil
9905322df9 pvr: Advertise STORAGE_IMAGE_BIT for B10G11R11_UFLOAT_PACK32
For optimalTilingFeatures we should be advertising
STORAGE_IMAGE_BIT for B10G11R11_UFLOAT_PACK32 too.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21649>
2023-03-02 16:33:53 +00:00
Karmjit Mahil
225ae96357 pvr: Don't advertise currently unsupported features
This commit removes the advertising of features that are currently
unsupported by the driver and aren't strictly necessary for
Vulkan 1.0.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21649>
2023-03-02 16:33:53 +00:00
Samuel Pitoiset
4ec6850210 radv: fix DCC decompress on GFX11
The hardware requires one color output to be set by CB registers,
otherwise the DCC decompression does nothing.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8127
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8175
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8370
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21629>
2023-03-02 16:03:31 +00:00
Tatsuyuki Ishi
57ab623f0b radv: Use common helpers to translate format in SDMA copy.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21585>
2023-03-02 15:29:47 +00:00
Tatsuyuki Ishi
4f681d5e2c radv: Remove SDMA padding from copy helpers.
These are handled in winsys already; no need to duplicate and complicate
the code paths.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21585>
2023-03-02 15:29:47 +00:00
Tatsuyuki Ishi
e9a55b332a radv: SDMA v4 size field is size - 1
After cross-checking with kernel and the old buffer copy code, it seems
that the size field should be size - 1 instead.

Fixes: 7b5ab48c40 ("radv: partial sdma support")

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21585>
2023-03-02 15:29:47 +00:00
Tatsuyuki Ishi
4f50497a96 radeonsi: SDMA v4 size field is size - 1
After cross-checking with kernel and the old buffer copy code, it seems
that the size field should be size - 1 instead.

Fixes: 46c95047bd ("radeonsi: implement si_sdma_copy_image for gfx7+")

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21585>
2023-03-02 15:29:47 +00:00
Lionel Landwerlin
c914e70bce anv/hasvk: speed up null image/view descriptor writes
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reported-by: Chuansheng Liu <chuansheng.liu@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21642>
2023-03-02 15:03:25 +00:00
Kai-Heng Feng
646cff13bc Revert "iris: Avoid abort() if kernel can't allocate memory"
This reverts commit f9d8d9acbb.

Now ENOMEM is handled in submit_batch(), we don't need to check it for
resetting anymore.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20449>
2023-03-02 14:30:17 +00:00
Kai-Heng Feng
5aae8a0526 iris: Retry DRM_IOCTL_I915_GEM_EXECBUFFER2 on ENOMEM
We are seeing endless DRM_IOCTL_SYNCOBJ_WAIT ioctl when system memory is
under pressured.

Commit f9d8d9acbb ("iris: Avoid abort() if kernel can't allocate
memory") avoids the abort() on ENOMEM by resetting the batch. However,
when there's an ongoing OpenGL query, resetting the batch will make the
snapshots_landed never be flipped, so iris_get_query_result() gets stuck
in the while loop forever.

Since there's no guarantee that the next batch after resetting won't hit
ENOMEM, so instead of resetting the batch, be patient and wait until kernel has
enough memory. Once the batch is submiited and snapshots_landed gets
flipped, iris_get_query_result() can proceed normally.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6851
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20449>
2023-03-02 14:30:17 +00:00
Tapani Pälli
207eb94445 intel/compiler: add comment about workaround on simd width
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21619>
2023-03-02 14:06:36 +00:00
Samuel Pitoiset
427fd83d27 radv: use new EVENT_WRITE_ZPASS packet3 on GFX11
Ported from RadeonSI.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21621>
2023-03-02 12:53:27 +00:00
Samuel Pitoiset
87444bb7ab radv: ignore alpha_is_on_msb on GFX11 because the hw ignores it
Ported from RadeonSI.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21621>
2023-03-02 12:53:27 +00:00
Georg Lehmann
0a3387a190 nir/lower_mediump: don't use fp16 for constants if the result is denormal
Image stores are not required to preserve denorms.

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/21622>
2023-03-02 11:42:10 +00:00
Georg Lehmann
ede0630f9e aco: use v_fma_mix_f32 for v_fma_f32 with 2 fp16 representable, different literals
We can pack two fp16 literals into one 32bit literal and use opsel to select
the correct value. Note that LLVM currently disassembles these instructions
incorrectly.

Foz-DB Navi21:
Totals from 13365 (9.91% of 134913) affected shaders:
VGPRs: 840880 -> 840016 (-0.10%); split: -0.11%, +0.01%
SpillSGPRs: 724 -> 722 (-0.28%)
CodeSize: 82439364 -> 82451336 (+0.01%); split: -0.06%, +0.08%
MaxWaves: 244858 -> 244980 (+0.05%)
Instrs: 15265976 -> 15247201 (-0.12%); split: -0.13%, +0.01%
Latency: 223316180 -> 223272495 (-0.02%); split: -0.03%, +0.02%
InvThroughput: 41981375 -> 41969917 (-0.03%); split: -0.04%, +0.01%
VClause: 266775 -> 266558 (-0.08%); split: -0.14%, +0.06%
SClause: 646602 -> 645996 (-0.09%); split: -0.16%, +0.07%
Copies: 794703 -> 776075 (-2.34%); split: -2.46%, +0.12%
Branches: 296317 -> 296316 (-0.00%)
PreSGPRs: 658796 -> 656479 (-0.35%); split: -0.35%, +0.00%
PreVGPRs: 744014 -> 743679 (-0.05%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20587>
2023-03-02 10:59:05 +00:00
Georg Lehmann
ed349951cb aco: mark mad definition as precise if the mul/add were precise
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20587>
2023-03-02 10:59:05 +00:00
Samuel Pitoiset
f19fccd9f8 amd,ac/rgp: fix SQTT memory types
This crashed on Steam Deck because the memory type is LPDDR5 and it
wasn't not handled in the switch. It seems the kernel changed the
memory type returned for VanGogh because it used to work.

Fixes: aef7ea868f ("ac/gpu_info: handle LPDDR4 and 5 in ac_memory_ops_per_clock")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21627>
2023-03-02 07:54:35 +00:00
Emma Anholt
bb122202b6 gallivm: Add some notes about other invocation_0_must_be_active usages.
So that the next person trying to cut down LLVM compile times doesn't trip
over this.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21142>
2023-03-02 04:47:35 +00:00
Emma Anholt
66dff3d39c gallivm: Use first_active_invocation for scalar SSBO loads.
Again, this should reduce the complexity of the LLVM IR we emit in some
cases.  We don't use it for shared loads, due to the noted corner case.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21142>
2023-03-02 04:47:35 +00:00
Emma Anholt
a2b054c8f0 gallivm: Use first_active_invocation for ubo/kernel memory loads.
If we're just loading memory, we can take the scalar offset_is_uniform
paths even the first active invocation is nonzero, saving a bunch of
looping and bounds checking for per-element loads.  And, if we don't have
an active invocation, doing the load for element 0 (which is
bounds-checked to return 0 if element 0 had a bad value in it) before
throwing away the result is still better than doing bounds-checked loads
for each element before throwing away the result.

dEQP-VK.ubo.random.16bit.scalar.92 goes from 16.5 to 14.0 seconds.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21142>
2023-03-02 04:47:35 +00:00
Emma Anholt
1be626b618 gallivm: Return 0 for first active invocation when no invocations are active.
gallivm doesn't actuially jump across branches where no invocations are
active, so my previous assertion about the exec mask being nonzero was
incorrect.  This means that we'll always use a defined invocation for the
various LLVMBuildExtractElements using the result value, which is an
improvement over my even the code before my cttz change that would use
undefined values for the element to be extracted.

Fixes: 8c2493d041 ("gallivm: Use cttz instead of a loop for first_active_invocation().")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21142>
2023-03-02 04:47:35 +00:00
Chia-I Wu
e2c67ed63e ci/radv: remove dEQP-VK.image.sample_texture.* fails/flakes
They were fixed since commit 11b2a063bf ("vulkan: Unconditionally add
barriers for missing external subpass deps").

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21616>
2023-03-02 00:56:16 +00:00
Mark Janes
3c9a8f7a6d intel/dev: generate helpers to identify platform workarounds
Workarounds for defects in Intel silicon have been manually
implemented:

 - consult defect database for the current platform

 - add workaround code behind platform ifdef or devinfo->ver checks

Some bugs have occurred due to the manual process.  Typical failure
modes:

 - defect database is updated after a platform is enabled

 - version checks are overly broad (eg gfx11+) for defects that were
   fixed (eg in gfx12)

 - version checks are too narrow for defects that were extended to
   subsequent platforms.

 - missed workarounds

This commit automates workaround handling:

 - Internal automation queries the defect database to collate and
   summarize defect documentation in json.

 - mesa_defs.json describes all public defects and impacted platforms.
   Defects which are extended to subsequent platforms are listed under
   the original defect.

 - gen_wa_helpers.py generates workaround helpers to be called
   in place of version checks:

   - NEEDS_WORKAROUND_{ID} provides a compile time check suitable for
     use in genX routines.

   - intel_device_info_needs_wa() provides a more precise runtime
     check, differentiating platforms within a generation and
     platform steppings.

Internal automation will generate new mesa_defs.json as needed.
Workarounds enabled with these helpers will apply correctly based on
updated information in Intel's defect database.

Reviewed-by: Dylan Baker <dylan@pnwbakers>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20825>
2023-03-02 00:01:27 +00:00
Mark Janes
f11aab743b util: add macro to support gcc/clang poison
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20825>
2023-03-02 00:01:27 +00:00
Dylan Baker
a0fa31bcdd intel/dev: create a helper dependency for libintel_dev
This ensures that users of libintel_dev.a won't be compiled until
include files are generated, and that they are recompiled when the
header changes.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20825>
2023-03-02 00:01:27 +00:00
Marek Olšák
98198a7782 glthread: fix a perf regression due to draw_always_async flag, fix DrawIndirect
Performance regressed by 31% in one VP2020/Creo subtest because
the draw_always_async flag wasn't implemented correctly. Remove it
instead of fixing it.

While removing it, I noticed that our DrawIndirect async conditions
were incorrect. I fixed them.

Fixes: 3b897719e6 - glthread: add ctx->GLThread.draw_always_async to simplify draw checking

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21566>
2023-03-01 23:18:10 +00:00
Illia Polishchuk
1eab7e69e2 glx: fix indirect initialization crash
Fixes: b090246a ("glx: Only compute client GL extensions for indirect contexts")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8393

Reviewed-by: Adam Jackson <ajax@redhat.com>

Signed-off-by: Illia Polishchuk <illia.a.polishchuk@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21591>
2023-03-01 19:54:00 +00:00
Giancarlo Devich
cc3c8c241e d3d12: Use memcmp for full tcs/gs variant keys
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21610>
2023-03-01 19:40:06 +00:00
Giancarlo Devich
f53188b7fa d3d12: Cache varying info to reduce compare/copy cost
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21610>
2023-03-01 19:40:06 +00:00
Giancarlo Devich
e4ba343ac9 d3d12: Compare shader key common parts with memcmp, instead of if's
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21610>
2023-03-01 19:40:06 +00:00
Giancarlo Devich
623a01827c d3d12: Compare shader keys with union-encompassing fields all at once
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21610>
2023-03-01 19:40:06 +00:00
Giancarlo Devich
ebd925e79c d3d12: Compare shader keys with a switch, instead of cascading if's
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21610>
2023-03-01 19:40:06 +00:00
Iván Briano
4887b88d22 anv: use the parameter passed to the macro
The two points calling this macro pass dyn->rs.provoking_vertex to it,
which is why it works, but it's cleaner to use the parameter instead.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21613>
2023-03-01 19:07:41 +00:00
Dylan Baker
a8691f916b intel/mi: use 64bit constant for bitshift
Coverity complains that we could end up rolling over on a 32bit
platform, which isn't really true because of the assertion, but there's
also no harm in ensuring that we have exactly the same behavior for both
32 bit and 64 bit platforms.

CID: 1515989
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21572>
2023-03-01 18:42:25 +00:00
Yiwei Zhang
054a83492d venus: fix VK_EXT_image_view_min_lod feature query
Fixes: 8b81098519 ("venus: enable VK_EXT_image_view_min_lod")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21617>
2023-03-01 17:24:26 +00:00
Karmjit Mahil
1dfd535124 pvr: Setup SPM background object
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21575>
2023-03-01 17:10:53 +00:00
Timothy Arceri
d75a36a9ee glsl: remove do_copy_propagation_elements() optimisation pass
Since 13b859de do_copy_propagation_elements() has a flaw where
the time it takes to complete grows exponentially slowers as the number
of nested loops increases. It can also hurt rather than help verses
just letting NIR optimise the code. So if the NIR linker is enabled we
let it handle it instead.

shader-db results Iris (BDW):

total instructions in shared programs: 11177181 -> 11199739 (0.20%)
instructions in affected programs: 119424 -> 141982 (18.89%)
helped: 109
HURT: 65
total cycles in shared programs: 368946819 -> 372277173 (0.90%)
cycles in affected programs: 116539428 -> 119869782 (2.86%)

total spills in shared programs: 3983 -> 8785 (120.56%)
spills in affected programs: 2072 -> 6874 (231.76%)
helped: 0
HURT: 6

total fills in shared programs: 2016 -> 6068 (200.99%)
fills in affected programs: 230 -> 4282 (1761.74%)
helped: 0
HURT: 6

LOST:   85
GAINED: 77

freedreno results:

total instructions in shared programs: 11011122 -> 11011620 (<.01%)
instructions in affected programs: 939829 -> 940327 (0.05%)
total full in shared programs: 762725 -> 762674 (<.01%)
full in affected programs: 1096 -> 1045 (-4.65%)
total constlen in shared programs: 1772092 -> 1771596 (-0.03%)
constlen in affected programs: 2780 -> 2284 (-17.84%)
total stp in shared programs: 4040 -> 4058 (0.45%)
stp in affected programs: 3656 -> 3674 (0.49%)
total ldp in shared programs: 2160 -> 2178 (0.83%)
ldp in affected programs: 1748 -> 1766 (1.03%)
stp HURT:   shaders/robclark-shaders/gfxbench5/gl_5_high_off/13.shader_test CL: 1231 -> 1234 (0.24%)
stp HURT:   shaders/robclark-shaders/gfxbench5/gl_5_normal_off/13.shader_test CL: 1231 -> 1234 (0.24%)
stp HURT:   shaders/robclark-shaders/gfxbench5/gl_5_high_off/15.shader_test CL: 453 -> 456 (0.66%)
stp HURT:   shaders/robclark-shaders/gfxbench5/gl_5_normal_off/15.shader_test CL: 453 -> 456 (0.66%)
stp HURT:   shaders/robclark-shaders/gfxbench5/gl_5_high_off/17.shader_test CL: 144 -> 147 (2.08%)
stp HURT:   shaders/robclark-shaders/gfxbench5/gl_5_normal_off/17.shader_test CL: 144 -> 147 (2.08%)

however, those stp counts are misleading -- gfxbench gl-5-normal actually
gets its scratch (ldp/stp) stored as 16 bits instead of 32 thanks to
better NIR copy prop, and the result is 2.64398% +/- 0.0991923% perf
improvement!

i915 results:

total instructions in shared programs: 510528 -> 510489 (<.01%)
instructions in affected programs: 3303 -> 3264 (-1.18%)
total tex_indirect in shared programs: 16708 -> 16717 (0.05%)
tex_indirect in affected programs: 134 -> 143 (6.72%)
total temps in shared programs: 30181 -> 30169 (-0.04%)
temps in affected programs: 1268 -> 1256 (-0.95%)
LOST:   0
GAINED: 1

i915 highlights:
instructions HURT:   shaders/closed/steam/legend-of-grimrock/47.shader_test FS: 141 -> 144 (2.13%)
instructions HURT:   shaders/closed/steam/steamworld-dig/22.shader_test FS: 84 -> 108 (28.57%)
temps HURT:   shaders/closed/steam/left-4-dead-2/medium/3682.shader_test FS: 7 -> 13 (85.71%)

r300 results:

total instructions in shared programs: 1340439 -> 1340845 (0.03%)
instructions in affected programs: 32354 -> 32760 (1.25%)
total temps in shared programs: 179394 -> 179329 (-0.04%)
temps in affected programs: 1505 -> 1440 (-4.32%)
total consts in shared programs: 1177742 -> 1177885 (0.01%)
consts in affected programs: 1107 -> 1250 (12.92%)
total lits in shared programs: 24992 -> 25019 (0.11%)
lits in affected programs: 138 -> 165 (19.57%)
instructions HURT:   shaders/closed/steam/legend-of-grimrock/26.shader_test FS: 47 -> 52 (10.64%)
instructions HURT:   shaders/closed/steam/sanctum-2/6072.shader_test FS: 43 -> 48 (11.63%)
instructions HURT:   shaders/closed/steam/champions-of-regnum/2378.shader_test VS: 35 -> 40 (14.29%)

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13288>
2023-03-01 16:09:25 +00:00
Emma Anholt
106019a5d8 nir/split_64bit_vec3_and_vec4: Handle 64-bit matrix types.
The offset handling should already work for flattening to our split vars,
just need to make sure we have enough (or any!) array elements.

Fixes: #7154
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13288>
2023-03-01 16:09:25 +00:00
Caio Oliveira
5f79e78911 spirv: Add skip_os_break_in_debug_build option to use in unit tests
When running in the CI environment, instead of crashing the test
binary, it is preferable to just fail gracefully (in this case return
a NULL shader) like is done in release mode, so other tests continue
to be executed.

For convenience add a variable break_on_failure to the test so the
breaking behavior can be re-enable in individual tests when debugging.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21512>
2023-03-01 13:47:57 +00:00
Caio Oliveira
8a91a33b7c spirv/tests: Add some basic control flow tests
The DISABLED test currently fails parsing.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21512>
2023-03-01 13:47:57 +00:00
Caio Oliveira
4e5b520286 spirv/tests: Parametrize stage in get_nir() helper
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21512>
2023-03-01 13:47:57 +00:00
Caio Oliveira
131f328a18 spirv/tests: Add script to generate C array from SPIR-V source
This is useful for generating the C code to embed the SPIR-V
when adding a new test.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21512>
2023-03-01 13:47:57 +00:00
Caio Oliveira
17e0c75441 spirv/tests: Subclass spirv_test helper to namespace the tests
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21512>
2023-03-01 13:47:57 +00:00
David Heidelberg
4cc0cec473 ci: implement unified sections
in after_script, variable $SCRIPTS_DIR is lost

Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20272>
2023-03-01 12:02:24 +00:00
David Heidelberg
5bfc17b2da ci: alpine: install bash and coreutils for date -d
bash is needed for consistency.
coreutils is needed for `date -d`.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20272>
2023-03-01 12:02:24 +00:00
David Heidelberg
6f0fcb0a0c ci/alpine: keep the curl inside the image
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20272>
2023-03-01 12:02:24 +00:00
Georg Lehmann
aeb68c29b4 nir/opt_algebraic: add patterns for iand/ior of feq/fneu with 0
Foz-DB Navi21:
Totals from 1245 (0.92% of 134913) affected shaders:
VGPRs: 66232 -> 66248 (+0.02%); split: -0.01%, +0.04%
CodeSize: 5874976 -> 5868168 (-0.12%); split: -0.17%, +0.05%
MaxWaves: 25278 -> 25274 (-0.02%); split: +0.01%, -0.02%
Instrs: 1087502 -> 1085267 (-0.21%); split: -0.21%, +0.00%
Latency: 6531489 -> 6531672 (+0.00%); split: -0.04%, +0.05%
InvThroughput: 1531774 -> 1532327 (+0.04%); split: -0.02%, +0.05%
VClause: 22218 -> 22202 (-0.07%); split: -0.08%, +0.00%
SClause: 45906 -> 45873 (-0.07%); split: -0.08%, +0.01%
Copies: 64004 -> 64102 (+0.15%); split: -0.24%, +0.39%
Branches: 21529 -> 21534 (+0.02%); split: -0.00%, +0.03%
PreSGPRs: 51936 -> 51850 (-0.17%)
PreVGPRs: 55393 -> 55398 (+0.01%); split: -0.02%, +0.03%

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21576>
2023-03-01 11:24:43 +00:00
Samuel Pitoiset
3ced4ae816 radv: only expose EXT_pipeline_library_group_handles if RT is enabled
VK_EXT_pipeline_library_group_handles requires
VK_KHR_ray_tracing_pipeline to be enabled.

Fixes dEQP-VK.info.device_extensions.

Fixes: ed76833705 ("radv: Implement & expose VK_EXT_pipeline_library_group_handles.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21618>
2023-03-01 10:55:00 +00:00
Caio Oliveira
863cbb3e02 spirv: Don't specify nir_var_uniform or nir_var_mem_ubo in barriers
These are constant read-only data and don't need to be synchronized.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21517>
2023-03-01 09:53:29 +00:00
Sai Teja Pottumuttu
530ae32c5d iris: Fix to release BO immediately if not busy
Currently the iris driver is adding the buffer objects to zombie list
without checking if it is busy or not. It checks for it after 1 second
which adds delay to buffer release.

This fix checks if the bo is busy or not before adding it to zombie list.

Without this fix, the applications expecting immediate buffer release would
fail.

The fix is identified while debugging below android cts tests:
android.graphics.cts.BitmapTest#testDrawingHardwareBitmapNotLeaking
android.graphics.cts.BitmapTest#testHardwareBitmapNotLeaking

Signed-off-by: Sai Teja Pottumuttu <sai.teja.pottumuttu@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21460>
2023-03-01 09:17:48 +00:00
Lionel Landwerlin
42e8a2c1d6 genxml: fix border color offset field on Gfx12+
I wonder if the docs are correct for Gfx11 because this is the
generation that gave us the Bindless Sampler Heap of 4Gb. So it would
make sense that the border colors can also be placed anywhere in that
4Gb heap.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21600>
2023-03-01 08:45:11 +00:00
Lionel Landwerlin
58b687d77b genxml: Fix STATE_BASE_ADDRESS::BindlessSurfaceStateSize field size
BSpec 44507

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21600>
2023-03-01 08:45:11 +00:00
Dave Airlie
24c09d4b16 radv: add video format support to format probing.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21457>
2023-03-01 07:16:47 +00:00
Tatsuyuki Ishi
bab235106e radv: Replace radv_trap_handler_shader with radv_shader.
Now that the upload memory is tied to the shader itself, the trap handler
shader no longer needs an additional wrapper.

This is a cleanup to ease introduction of a new shader uploading code path.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21541>
2023-03-01 05:12:10 +00:00
Dave Airlie
1f0fdcb619 anv: always pick graphics queue to execute prime blits on.
This will change when we get transfer queues but this should avoid
video queues being picked by accident.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21204>
2023-03-01 03:37:36 +00:00
Asahi Lina
494cb2e5ca asahi: Flush USC caches on the first draw
It seems that when batches are submitted back to back, the USC can
retain cache contents between them. This causes a problem when the CPU
updates a VBO between batches, since some of those updates might not be
visible to the USC.

Looks like the VDM barrier command with one magic bit set fixes this, so
let's try that.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21538>
2023-03-01 01:04:29 +00:00
Asahi Lina
70169c7488 asahi: Identify USC cache invalidate
Signed-off-by: Asahi Lina <lina@asahilina.net>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21538>
2023-03-01 01:04:29 +00:00
Asahi Lina
860ac5c149 asahi: Add readonly BO flag
Signed-off-by: Asahi Lina <lina@asahilina.net>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21538>
2023-03-01 01:04:29 +00:00
Asahi Lina
0498ad3e26 asahi: Add BO_SHAREABLE flag
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21538>
2023-03-01 01:04:29 +00:00
Lionel Landwerlin
672b2f9ad1 anv: remove more Gfx7 code
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21599>
2023-02-28 23:49:27 +00:00
Lionel Landwerlin
fc7680b7df iris: fix Wa_16011107343 for Gfx12
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: df9f71d795 ("iris: emit 3DSTATE_HS for each primitive on gfx12")
Acked-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21605>
2023-02-28 23:03:21 +00:00
Lionel Landwerlin
3cd72a2840 anv: fixup Wa_16011107343 for Gfx12 only
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 75968398f3 ("anv: emit 3DSTATE_HS for each primitive on gfx12")
Acked-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21605>
2023-02-28 23:03:21 +00:00
Guilherme Gallo
6cb0c8b6d7 ci: Reuse MESA_CI_PERFORMANCE_ENABLED in performance-rules
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21492>
2023-02-28 22:19:48 +00:00
Guilherme Gallo
5b9a610604 ci: Use workflow to make CI aware of performance jobs
With the workflow keyword, we can have more control over how pipelines
are created.

One of the features is to set a variable for the entire pipeline
depending on the rule. These variables would be available for all jobs
manifest and can be used inside job rules, for example.

We can use that to set a variable to enable performance jobs in the
pipeline, both at the YAML and script levels.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21492>
2023-02-28 22:19:48 +00:00
Guilherme Gallo
c91f4b2efb ci: Use release builds in perf jobs
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21492>
2023-02-28 22:19:48 +00:00
Guilherme Gallo
2fcd6df107 ci: Create debian-arm64-release job
To be able to upload the mesa's release build for arm64 to S3 and use it
in performance jobs.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21492>
2023-02-28 22:19:48 +00:00
Guilherme Gallo
c65eb88f0b ci: Upload debian-release artifact to S3
This will enable performance jobs to use release versions for
performance tracking, since they download the artifacts from S3.

We were using debugoptimized versions, which are not the most performant
ones.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21492>
2023-02-28 22:19:48 +00:00
Dave Airlie
53dda476a9 llvmpipe: fix compute address bits to return native pointer size.
On 32-bit systems llvm will only be dealing with 32-bit ptrs

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21601>
2023-02-28 21:55:09 +00:00
Jarred Davies
67904a36a6 pvr: Don't update fragment signal sync when fragment stage is disabled
Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21577>
2023-02-28 21:39:49 +00:00
Jarred Davies
4af1cf89ab pvr: Clear wait syncs after job submission
Avoids the fw having to process redundant waits.

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21577>
2023-02-28 21:39:49 +00:00
Jarred Davies
18fb8d3b55 pvr: Enable threaded submit when supported
Adds a winsys feature flag to enable threaded submit.

Currently pvrsrvkm can't support threaded submit as pvrsrvkm syncs don't
support VK_SYNC_FEATURE_WAIT_PENDING.

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21577>
2023-02-28 21:39:49 +00:00
Jarred Davies
5be2e44095 pvr: Add support for VK_KHR_timeline_semaphore
pvrsrvkm will run with VK_DEVICE_TIMELINE_MODE_EMULATED and
powervr will run with VK_DEVICE_TIMELINE_MODE_ASSISTED.

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21577>
2023-02-28 21:39:49 +00:00
Jarred Davies
80f864cd23 pvr: Use common queue submit implementation
A simplification of the synchronization code is also undertaken as part
of this commit to account for the implicit guarantee the FW gives the driver
that jobs submitted to the same context will be run in submission order.

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>

Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21577>
2023-02-28 21:39:49 +00:00
Konstantin Seurer
5ce99bc568 radv: Only init geometry infos if RRA is enabled
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21532>
2023-02-28 20:49:33 +00:00
Konstantin Seurer
7bd265bc86 radv: Move header and geometry info init into separate functions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21532>
2023-02-28 20:49:33 +00:00
Marcin Ślusarz
e74a3284f5 anv: halve the push constants space in mesh pipelines
It's only used by fragment shaders, so halving it matches the size
used in the most optimal primitive pipeline (VS + FS).

This change frees some URB space for mesh and task shaders and as
a result improves vk_meshlet_cadscene performance by up to 2%,
depending on the model.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21559>
2023-02-28 20:18:01 +00:00
Dylan Baker
814eb9e2ce iris: consider bufmgr creation to have failed if duping of the fd fails
Coverity points out that we can pass a negative value to `close()`,
which results in an unchecked error. While this is technically true, it
really isn't a problem as `close()` is speced to return -1 in that case
(which we ignore). However, what is true is that if we fail to dup the
fd (the only case where we could end up with a negative value), then
we're in an unrecoverable error state anyway, and should go to the error
cleanup code.

CID: 1521539
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21568>
2023-02-28 19:58:58 +00:00
David Heidelberg
0912b14b3a ci/freedreno: add flaking KHR-GL45.buffer_storage.map_persistent_flush
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21598>
2023-02-28 17:28:06 +00:00
David Heidelberg
baea3b328b intel/vulkan: add missing dependency on generated headers
Adding correct dependencies prevents occasional build flakes with parallel builds.

```
FAILED: src/intel/vulkan/libanv_common.a.p/anv_generated_indirect_draws.c.o
ccache cc -Isrc/intel/vulkan/libanv_common.a.p -Isrc/intel/vulkan -I../src/intel/vulkan -Iinclude -I../include -Isrc -I../src -Isrc/mapi -I../src/mapi -Isrc/mesa -I../src/mesa -I../src/gallium/include -Isrc/intel -I../src/intel -Isrc/compiler -I../src/compiler -Isrc/compiler/nir -I../src/compiler/nir -Isrc/vulkan/util -I../src/vulkan/util -Isrc/vulkan/runtime -I../src/vulkan/runtime -Isrc/vulkan/wsi -I../src/vulkan/wsi -Isrc/intel/genxml -Isrc/intel/vulkan/shaders -Isrc/intel/ds -I/usr/local/include -I/usr/local/include/libdrm -fvisibility=hidden -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -std=c11 -O2 -g -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DPACKAGE_VERSION="23.1.0-devel"' '-DPACKAGE_BUGREPORT="https://gitlab.freedesktop.org/mesa/mesa/-/issues"' -DHAVE_OPENGL=1 -DHAVE_OPENGL_ES_1=1 -DHAVE_OPENGL_ES_2=1 -DHAVE_SWRAST -DHAVE_VIRGL -DHAVE_RADEONSI -DHAVE_ZINK -DHAVE_CROCUS -DHAVE_IRIS -DHAVE_I915 -DVIDEO_CODEC_VC1DEC=1 -DVIDEO_CODEC_H264DEC=1 -DVIDEO_CODEC_H264ENC=1 -DVIDEO_CODEC_H265DEC=1 -DVIDEO_CODEC_H265ENC=1 -DHAVE_X11_PLATFORM -DHAVE_SURFACELESS_PLATFORM -DHAVE_DRM_PLATFORM -DHAVE_XCB_PLATFORM -DHAVE_ST_VDPAU -DENABLE_ST_OMX_BELLAGIO=0 -DENABLE_ST_OMX_TIZONIA=0 -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DALLOW_KCMP -DENABLE_SHADER_CACHE -DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE -DHAVE___BUILTIN_TYPES_COMPATIBLE_P -DHAVE_FUNC_ATTRIBUTE_CONST -DHAVE_FUNC_ATTRIBUTE_FLATTEN -DHAVE_FUNC_ATTRIBUTE_MALLOC -DHAVE_FUNC_ATTRIBUTE_PURE -DHAVE_FUNC_ATTRIBUTE_UNUSED -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT -DHAVE_FUNC_ATTRIBUTE_WEAK -DHAVE_FUNC_ATTRIBUTE_FORMAT -DHAVE_FUNC_ATTRIBUTE_PACKED -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL -DHAVE_FUNC_ATTRIBUTE_ALIAS -DHAVE_FUNC_ATTRIBUTE_NORETURN -DHAVE_FUNC_ATTRIBUTE_VISIBILITY -DHAVE_UINT128 -DHAVE_REALLOCARRAY -D_GNU_SOURCE -DUSE_SSE41 -DUSE_GCC_ATOMIC_BUILTINS -DUSE_X86_64_ASM -DMAJOR_IN_SYSMACROS -DHAS_SCHED_H -DHAS_SCHED_GETAFFINITY -DHAVE_LINUX_FUTEX_H -DHAVE_ENDIAN_H -DHAVE_DLFCN_H -DHAVE_SYS_SHM_H -DHAVE_CET_H -DHAVE_SYS_INOTIFY_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_TIMESPEC_GET -DHAVE_MEMFD_CREATE -DHAVE_RANDOM_R -DHAVE_FLOCK -DHAVE_STRTOK_R -DHAVE_GETRANDOM -DHAVE_GNU_QSORT_R -DHAVE_STRUCT_TIMESPEC -DHAVE_PROGRAM_INVOCATION_NAME -DHAVE_ISSIGNALING -DHAVE_POSIX_MEMALIGN -DHAVE_DIRENT_D_TYPE -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DSUPPORT_INTEL_INTEGRATED_GPUS -DHAVE_ZLIB -DHAVE_COMPRESSION -DHAVE_PTHREAD -DHAVE_PTHREAD_SETAFFINITY -DHAVE_LIBDRM -DLLVM_AVAILABLE '-DMESA_LLVM_VERSION_STRING="13.0.1"' -DLLVM_IS_SHARED=1 -DDRAW_LLVM_AVAILABLE -DUSE_LIBELF -DMESA_EXECMEM -DHAVE_LIBUNWIND -DHAVE_OPENMP -DHAVE_DRI -DHAVE_DRI2 -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -DHAVE_DRISW_KMS -DHAVE_PERFETTO -mtls-dialect=gnu2 -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=empty-body -Werror=incompatible-pointer-types -Werror=int-conversion -Wimplicit-fallthrough -Wmisleading-indentation -Wno-missing-field-initializers -Wno-format-truncation -Wno-nonnull-compare -fno-math-errno -fno-trapping-math -fno-common -Wno-unused-function -Werror=format -Wformat-security -ffunction-sections -fdata-sections -fPIC -DVK_USE_PLATFORM_XCB_KHR -DVK_USE_PLATFORM_XLIB_KHR -DVK_USE_PLATFORM_DISPLAY_KHR -DVK_USE_PLATFORM_XLIB_XRANDR_EXT -Wno-override-init -DANV_SUPPORT_RT=0 -MD -MQ src/intel/vulkan/libanv_common.a.p/anv_generated_indirect_draws.c.o -MF src/intel/vulkan/libanv_common.a.p/anv_generated_indirect_draws.c.o.d -o src/intel/vulkan/libanv_common.a.p/anv_generated_indirect_draws.c.o -c ../src/intel/vulkan/anv_generated_indirect_draws.c
../src/intel/vulkan/anv_generated_indirect_draws.c:34:10: fatal error: shaders/generated_draws_spv.h: No such file or directory
   34 | #include "shaders/generated_draws_spv.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
```

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21592>
2023-02-28 17:09:32 +01:00
Samuel Pitoiset
c356f1b4ed radv: fix draw calls with 0-sized index buffers and robustness on NAVI10
The correct workaround is to bind an internal index buffer to handle
robustness2 correctly.

Fixes dEQP-VK.robustness.index_access.* in CTS 1.3.5.0 on NAVI10.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21471>
2023-02-28 14:12:29 +00:00
Frank Binns
b1c19498c6 pvr: replace nop binary shader with run-time compiled shader
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21536>
2023-02-28 12:25:18 +00:00
Eric Engestrom
fa1cf83217 meson: allow checking for null pointers even if they're supposed to be non-null
../src/c11/impl/time.c: In function 'timespec_get':
    ../src/c11/impl/time.c:71:8: error: 'nonnull' argument 'ts' compared to NULL [-Werror=nonnull-compare]
       71 |     if (!ts)
          |        ^
    cc1: all warnings being treated as errors

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21558>
2023-02-28 11:46:20 +00:00
Mario Kleiner
bf5cfb6486 v3dv: Enable (leased) direct display extensions.
Enable support for the following extensions, which are already supported
by the driver and shared wsi code, and were just missing enables inside
v3dv_device:

VK_EXT_direct_mode_display, VK_EXT_acquire_drm_display,
VK_EXT_acquire_xlib_display.

Successfully tested on RPi 400, RaspberryPi OS 11, with X11 RandR output
leasing to lease a RandR output and use it for direct display mode.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21529>
2023-02-28 11:30:07 +00:00
Frank Binns
12f0daddfc pvr: initialise size for placeholder "zeroed" shaders
Fixes an assert() in pvr_gpu_upload_usc().

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/21537>
2023-02-28 10:59:13 +00:00
Eric Engestrom
c9f3ba987f glapi/meson: drop duplicate line in deps
Fixes: 0842bc879b ("meson: wire the new generator for es1 and es2")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21562>
2023-02-28 10:31:37 +00:00
Samuel Pitoiset
7c62f6fa01 radv: fix flushing non-coherent images in EndCommandBuffer()
The condition was inverted.

This doesn't fix anything known.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21549>
2023-02-28 09:35:07 +00:00
Samuel Pitoiset
6750a9094f radv: fix flushing non-coherent images inside secondaries on GFX9+
Fixes
dEQP-VK.draw.dynamic_rendering.complete_secondary_cmd_buff.multi_draw.mosaic.*
on VEGA10 (related to the use of HTILE).

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21549>
2023-02-28 09:35:07 +00:00
Eric Engestrom
78c95b2865 glsl: align definition of _mesa_problem with the one in main/error.h
The ctx pointer not used by that function anyway, so const'ing it makes
no difference.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21557>
2023-02-28 09:04:47 +00:00
Dylan Baker
ff494361be util: rzalloc and free hash_table_u64
Otherwise we're prone to leaking the table itself, since it's not freed
in the destroy function

CID: 1516552
fixes: 6649b840c3
       ("mesa/util: add a hash table wrapper which support 64-bit keys")

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21499>
2023-02-28 08:35:32 +00:00
Tapani Pälli
75968398f3 anv: emit 3DSTATE_HS for each primitive on gfx12
This is Wa_16011107343, same workaround as commit 880a3efe6c
but for gfx12.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21551>
2023-02-28 08:07:01 +00:00
Tapani Pälli
df9f71d795 iris: emit 3DSTATE_HS for each primitive on gfx12
This is Wa_16011107343, same workaround as commit a043ae8e24
but for gfx12.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21551>
2023-02-28 08:07:01 +00:00
Qiang Yu
4b3a22fcd4 aco: only ls and ps use store output now
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21435>
2023-02-28 07:19:29 +00:00
Qiang Yu
e9616d1d2a ac/llvm: only init outputs when fragment shader for radv
LS pass output to TCS by reg is not enabled when LLVM.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21435>
2023-02-28 07:19:29 +00:00
Qiang Yu
ee9ccd7ac5 radeonsi: only init llvm output when needed.
These are the cases which still uses nir_store_output.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21435>
2023-02-28 07:19:29 +00:00
Emma Anholt
87ec94f6aa glsl: Move lower_vector_insert to GLSL-to-NIR.
We already have a nir_builder equivalent for generating this code, just
use that instead of doing it in GLSL.

No change on r300 shader-db.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21476>
2023-02-28 06:13:06 +00:00
Emma Anholt
f16a23aa9d panfrost/midgard: Drop redundant arg to emit_explicit_constant.
Every caller passed the same value twice.  Just reuse it?

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21476>
2023-02-28 06:13:05 +00:00
Emma Anholt
63aa5909b4 panfrost/midgard: Fix handling of csel with a vector constant condition.
If it's not all true or all false, then you'll have a csel with a vector
constant, and the backend failed to translate appropriately.  Expand the
constant to fix it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21476>
2023-02-28 06:13:05 +00:00
Yiwei Zhang
35c85c0ae6 venus: fix device memory export alloc info
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
23c350517a venus: fix external image creation
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
953ff3cf55 venus: simplify support for non-AHB external images
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
ca96f94aee venus: simplify ahb image creation
Those excessive asserts are only useful when bringing up Android.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
768017f72b venus: refactor image create info pnext tracking
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
4d616fb919 venus: remove redundant abstractions for wsi struct search
Doing that won't avoid linking wsi headers, and in fact we have already
included both android and common wsi headers. For swapchain info, it's
currently disabled by the swapchain spec version advertised on Android.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
21a0608395 venus: fix external buffer creation
Move buffer create info scrub into core venus.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
09f5033232 venus: distinguish external memory from mappable memory support
Mappable memory support is a must for Venus core, but the support of
such can be transparent to the driver. Thus the renderer external memory
type won't expose opaque fd type.

External memory over vtest can be exposed and the wsi support on top can
be made explicit as long as masking out the importable bit.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
19c3608672 venus: tighten up the sync fd requirements for Android wsi
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
657cd2e1d4 venus: refactor sync fd fence and sempahore features
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
05791b6ae0 venus: clean up globalFencing
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
344be4405c venus: clean up memoryResourceAllocationSize
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
6f8fe78e3b venus: start requiring all experimental features
This is to prepare for promoting exp features to core.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
9d76ed9638 venus: replace binary search with hardcode for max buffer size
Avoid the couple test buffer creations without maintenance4.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Yiwei Zhang
417de28e43 venus: further disallow sparse resource
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21379>
2023-02-28 04:56:14 +00:00
Georg Lehmann
e1eabab6fe aco/optimizer_postRA: assume all registers are untrackable in loop headers
Register writes from the pre-header might not be correct for any but
the first loop iteration because they can be clobbered inside the loop.

Foz-DB Navi21:
Totals from 18 (0.01% of 134913) affected shaders:
CodeSize: 251384 -> 251508 (+0.05%)
Instrs: 47644 -> 47664 (+0.04%)
Latency: 801801 -> 801852 (+0.01%)
InvThroughput: 177579 -> 177593 (+0.01%)
Copies: 4752 -> 4771 (+0.40%)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8376
Fixes: d3b0f78110 ("aco/optimizer_postRA: Initialize loop header with preheader information")

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21540>
2023-02-28 04:27:05 +00:00
Mike Blumenkrantz
4c978d5445 zink: skip buffer barriers for ACCESS_NONE -> ACCESS_READ / ACCESS_WRITE
these do nothing and may cause unnecessary driver flushing

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21427>
2023-02-28 04:08:08 +00:00
Emma Anholt
fef6e6588b ci: Update traces expectations for gutting glsl opt_algebraic.
All look like harmless changes.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:09 +00:00
Emma Anholt
2f53188f18 glsl: Remove unused as_rvalue_to_saturate().
This is not where saturate recognition happens.  Dead code since
5598458e69 ("i965/vec4: Remove try_emit_saturate") in 2014!

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:09 +00:00
Emma Anholt
d76fb3b2b1 glsl/opt_algebraic: Drop the flrp recognizer.
No change to r300.

freedreno looks mixed but slightly positive in instructions:

total instructions in shared programs: 11012472 -> 11012453 (<.01%)
instructions in affected programs: 8250 -> 8231 (-0.23%)
helped: 16
HURT: 50

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:09 +00:00
Emma Anholt
579aca894f glsl/opt_algebraic: Drop the ftrunc pattern recognizer.
Now that it's in NIR, there's no change to r300 or freedreno shader-db
when we do.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:09 +00:00
Emma Anholt
6d52e6fd2c nir: Port a floor->truncate algebraic opt pattern from GLSL.
Prevents regression when dropping code from the GLSL optimizer.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:09 +00:00
Emma Anholt
6229d34b91 glsl/opt_algebraic: Drop some fmul simplifications.
Looks like mostly noise, trending slightly positively.

freedreno:

total instructions in shared programs: 11012781 -> 11012472 (<.01%)
instructions in affected programs: 114072 -> 113763 (-0.27%)
helped: 123
HURT: 153

r300:

total instructions in shared programs: 1338236 -> 1337897 (-0.03%)
instructions in affected programs: 3460 -> 3121 (-9.80%)
helped: 61
HURT: 11

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:09 +00:00
Emma Anholt
4bf65ce221 glsl/opt_algebraic: Drop the flrp/ffma simplifiers.
NIR seems to do a better job.  Freedreno:

total instructions in shared programs: 11013096 -> 11012781 (<.01%)
instructions in affected programs: 258358 -> 258043 (-0.12%)
helped: 470
HURT: 269

r300:

total instructions in shared programs: 1338237 -> 1338236 (<.01%)
instructions in affected programs: 161 -> 160 (-0.62%)
helped: 1
HURT: 0
total presub in shared programs: 45127 -> 44881 (-0.55%)
presub in affected programs: 1719 -> 1473 (-14.31%)
helped: 246
HURT: 0

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:09 +00:00
Emma Anholt
3f632ce764 glsl/opt_algebraic: Drop no-op pack/unpack optimization.
No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
d589760f44 glsl/opt_algebraic: Drop the eq/neq add-removal optimization.
No change on freedreno or r300 shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
d352bd9737 glsl/opt_algebraic: Drop scalar all_eq/any_neq -> eq/neq opt.
No change in r300 or freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
62afead36f glsl/opt_algebraic: Drop fdot 0-channel optimizations.
No change on i915g shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
ef02581590 nir: Add optimization for fdot(x, 0) -> 0.
We had all these nice fdot opts to drop individual channels that were 0,
but nothing handling it being entirely 0!  Avoids r300g regression when
dropping them from GLSL.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
b328c97e11 glsl/opt_algebraic: Drop csel(true/false, x, y) optimization.
No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
652ff42f14 glsl/opt_algebraic: Drop x + -x -> 0 optimization.
No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
69b178ac90 glsl/opt_algebraic: Drop add/sub with 0 optimizations.
Looks like minor instruction selection noise in freedreno shader-db:

total instructions in shared programs: 11013100 -> 11013096 (<.01%)
instructions in affected programs: 2714 -> 2710 (-0.15%)
helped: 8
HURT: 6

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
c6908fc8ac glsl/opt_algebraic: Drop fdiv(1,x) -> frcp(x) and fdiv(x,1) -> x optimizations.
No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
4fc9342fc6 glsl/opt_algebraic: Drop and/or/xor optimizations.
NIR has them, and if anything freedreno shader-db prefers that NIR sees them:

total instructions in shared programs: 11013112 -> 11013100 (<.01%)
instructions in affected programs: 26266 -> 26254 (-0.05%)
helped: 4
HURT: 0

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
ab7a9b4538 glsl/opt_algebraic: Drop rcp optimizations.
No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
6b53d4b825 glsl/opt_algebraic: Drop pow optimizations.
These should all be covered by NIR.  Minor shader-db changes on freedreno,
which appear to be scheduling noise.

total instructions in shared programs: 11013132 -> 11013112 (<.01%)
instructions in affected programs: 3408 -> 3388 (-0.59%)

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
bb1b37e6c1 glsl/opt_algebraic: Drop shifts of 0 optimizations.
No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
71c0c73f8e glsl/opt_algebraic: drop fsat(fadd(b2f(x), b2f(y))) -> b2f(ior(x, y)) opt.
No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
144b61437a glsl/opt_algebraic: Drop f2i(trunc(x)) -> f2i(x) optimization.
No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
47657b2ffe glsl/opt_algebraic: Drop -(-x) -> x optimization.
No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
766f551cb5 glsl/opt_algebraic: Drop abs(-x) -> abs(x) and abs(abs(x)) -> abs(x).
NIR does this.  No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
7a8a50106e glsl/opt_algebraic: Drop pow-recognizer.
NIR handles pow recognizing, too.  No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
d79061dba1 glsl/opt_algebraic: Drop log(exp(x)) -> x and exp(log(x)) -> x optimisations.
No change on freedreno shader-db.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Emma Anholt
2bd0343ba0 glsl/opt_algebraic: Drop ~~x == x transformation.
No change on freedreno shader-db.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21475>
2023-02-28 03:36:08 +00:00
Mike Blumenkrantz
36a916f3f4 zink: use tc renderpass optimizing to more optimally start queries
if tc has determined that no queries are ended inside a renderpass,
it becomes possible to start queries outside of a renderpass, which
is more performant on some hw

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
7c96e98975 zink: always start/stop/resume queries inside renderpasses
this avoids potentially splitting renderpasses by ensuring that
all (non-cs) query operations always occur inside renderpasses

zink_query_update_gs_states() now has to be called inside renderpass
to catch the active queries

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
cbbc7c98c4 zink: pull 'was_line_loop' into ctx for query updating
make this a bit more flexible

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
5492e927e7 zink: use more consistent check for deleting zink_query::stats_list links
the linkage of this may vary depending on the query's active state,
so avoid issues by just checking the linkage directly

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
b4deaf7b2c zink: break out query suspend functionality for reuse
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
53c9f60ce4 zink: track whether queries were started in a renderpass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
e5d517f362 zink: rework query pool overflow
now when a query pool is full, a new query pool can be created and the
previous one can be dropped from reuse to be freed at a later time

this has the added benefit of avoiding yet another place where a renderpass
might get split

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
7da78ffb69 zink: create/use query pools dynamically
this fits the concept of "pools are shared between queries" a bit
better and leaves the pool ownership/destruction to their users

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
e56d4f9264 zink: rework find_or_allocate_qp()
this and its caller are now a bit more streamlined with regards to
functionality of the surrounding code

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
bf782503e1 zink: reorder some query code
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
8fdbf81ff0 zink: try updating qbos on query resume if !in_rp
this is another logical place to do the update since it won't split
a renderpass

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
49deb9cbe7 zink: only update qbo for TIME_ELAPSED on start if !in_rp
this otherwise splits the current renderpass for no reason

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
93a7187f34 zink: handle null query results for conditional render
this just needs to have a zero blasted into the buffer

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
cf60c7fbfa zink: handle null query results
it's possible that a query may have no results at all, so shortcut
everything and return zero as fast as possible for those cases

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
6bcf4721dc zink: only try doing qbo updates on query suspend if !in_rp
this otherwise creates infinite recursion trying to end a currently
ending renderpass

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
2440c98b3b zink: refuse to start cs invocation queries in renderpass
these can't produce data in renderpasses, so ensure they aren't accidentally
started inside a renderpass where they'll have to later be restarted outside
of one

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
74a65363ea zink: don't double suspend queries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:42 +00:00
Mike Blumenkrantz
9d0c3d3fb1 zink: un-suspend queries if they end while suspended
ensure they don't accidentally resume themselves after suspend

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Mike Blumenkrantz
34e2d2ec58 zink: add zink_query::suspended to indicate suspended state of queries
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Mike Blumenkrantz
74af46230c zink: don't auto-sync qbos on query end
these can now be synced later all at once

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Mike Blumenkrantz
c870c7c942 zink: handle multiple query starts in qbo update
this still isn't used due to how queries are started/stopped, but it should
be a bit more robust

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Mike Blumenkrantz
d60c864c45 zink: delete zink_query::last_start_idx
this was always zero

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Mike Blumenkrantz
c46d68235e zink: make zink_vk_query unref consistent
the no-check free seems suspicious

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Mike Blumenkrantz
eb5e0f5ab5 zink: fix possible query destroy leak
if the starts array has been reset, then the counter will be inaccurate,
and some of the members will leak, so this needs to iterate over the capacity
of the array instead of the contents

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Mike Blumenkrantz
10389698a0 zink: fix zink_query_start initialization
not sure if this was a bug, but it would have fully zeroed the struct
and prevented previous zink_vk_query members from being unrefed

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Mike Blumenkrantz
2a938c3e22 zink: rewrite zink_query_start struct
making the non-pool members easier to zero

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Mike Blumenkrantz
ed9909e3a0 zink: reset queries on the promoted cmdbuf when possible
this avoids splitting renderpasses just to reset queries

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Mike Blumenkrantz
96f7fe7191 zink: remove suspended queries from list before resuming
this avoids double-starting primgen queries from recursion when
needs_rast_discard_workaround is true

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Mike Blumenkrantz
4f53997574 zink: move zink_batch_no_rp call for query reset
this could otherwise pointlessly terminate a renderpass

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
2023-02-28 03:15:41 +00:00
Patrick Lerda
7e613d2a32 mesa/shaderapi: fix path memory leak
For instance, with "piglit/arb_shading_language_include-api -auto -fbo" or
"piglit/shader_runner tests/spec/arb_shading_language_include/execution/replacement.shader_test -auto -fbo":
Direct leak of 66 byte(s) in 6 object(s) allocated from:
    #0 0x7fa4b59050 in __interceptor_strdup (/usr/lib64/libasan.so.6+0x59050)
    #1 0x7f9a098fe0 in validate_and_tokenise_sh_incl ../src/mesa/main/shaderapi.c:3383
    #2 0x7f9a0a43e8 in _mesa_NamedStringARB ../src/mesa/main/shaderapi.c:3547

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21553>
2023-02-28 01:17:35 +00:00
Giancarlo Devich
e7c5a8b3f8 d3d12: Don't loop in update_draw_indirect_with_sysvals
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21567>
2023-02-27 23:00:41 +00:00
Giancarlo Devich
bf6c214b25 d3d12: Create varying structures as necessary, reference them
This changes instances of d3d12_varying_info to d3d12_varying_info*,
significantly reducing the size of the d3d12_shader_key,
d3d12_gs_variant_key, and d3d12_tcs_variant_key.

Associated changes to key fill, compare, hashing, and gs and tcs variant
maps significantly reduce the amount of time spent clearing and
comparing memory.

The biggest win here is not having to re-zero _or_ re-fill varyings in
d3d12_fill_shader_key, validate_geometry_shader_variant, and
validate_tess_ctrl_shader_variant.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21527>
2023-02-27 22:05:34 +00:00
Giancarlo Devich
41d5e76f2c d3d12: Don't memcmp gs/tcs keys
This is unnecessary and incomplete. Not only is it covered by the hash
map lookup, but also does not consider the other key members.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21527>
2023-02-27 22:05:34 +00:00
Giancarlo Devich
30883c0145 d3d12: Don't unnecessarily zero out gs/tcs keys
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21527>
2023-02-27 22:05:34 +00:00
Giancarlo Devich
56d30bf591 d3d12: Track max varying slot, set and compare less bytes
Often, the full range of available slots don't need to participate in
the comparison or be zeroed out.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21527>
2023-02-27 22:05:34 +00:00
Giancarlo Devich
9a3820fe11 d3d12: Don't recompute has_flat_varyings or missing_dual_src_outputs
Per shader selection, these two flags can be expensive to compute.
Instead, recompute their values as neccessary, and save them in the
context.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21527>
2023-02-27 22:05:34 +00:00
Emma Anholt
d246948ce3 anv: Skip BTI RT flush if we're doing an op that doesn't use render targets.
rt_flushes emitted on zink sauer.trace --loop=500 -2.02118% +/- 1.15992% (n=8).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21508>
2023-02-27 21:44:56 +00:00
Emma Anholt
2bd304bc8f anv: Skip the RT flush when doing depth-only rendering.
The spec citation says it's just for when the RT write message BTI might
point to a different RT, and if we don't have any color attachments then
we won't have one of those at all.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21508>
2023-02-27 21:44:56 +00:00
Mike Blumenkrantz
6992aa951d aux/tc: only call tc_parse_draw() when parsing renderpass info
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21533>
2023-02-27 21:04:56 +00:00
Mike Blumenkrantz
ad0d5a24aa aux/tc: track whether queries have been terminated in a renderpass
on tilers it's important to know whether a query is ended mid-renderpass
so that the query begin can occur inside/outside of the renderpass

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21533>
2023-02-27 21:04:56 +00:00
Caio Oliveira
91fa939763 panfrost: Use NIR scoped barriers instead of memory barriers
Now both GLSL and SPIR-V will produce the scoped barriers, so no
need to handle the old ones.

Control barriers are still present in some cases, so keep that
for now.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
2023-02-27 20:24:01 +00:00
Caio Oliveira
901bc6d53c pan/midgard: Handle nir_intrinsic_scoped_barrier in Midgard compiler
Behave the same as the existing more specific barrier intrinsics.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
2023-02-27 20:24:01 +00:00
Caio Oliveira
64a0266260 pan/compiler: Fix handling of nir_intrinsic_scoped_barrier
Only emit anything if this is a control barrier, i.e. contains an
execution scope.  Also change the assertion to look at that scope
instead of the memory scope.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
2023-02-27 20:24:01 +00:00
Caio Oliveira
c80268a20d intel/compiler: Mark various memory barriers intrinsics unreachable
Now that both SPIR-V and GLSL are using scoped barriers, we can stop
handling the specialized ones.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
2023-02-27 20:24:01 +00:00
Caio Oliveira
fe908ffefa glsl: Implement use_scoped_barrier option for lowering memory barriers
When the option is enabled, lower memory barriers to the
unified nir_intrinsic_scoped_barrier.

The translation of the following is based on
https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_gl_spirv.txt

- memoryBarrier()
- memoryBarrierBuffer()
- memoryBarrierImage()
- memoryBarrierShared()
- groupMemoryBarrier()

Also use scoped barrier for the memory counterparts of the GLSL
(control) barrier() when the option is enabled.  The execution
part of a (control) barrier() remains using the old intrinsic.

For memoryBarrierAtomicCounter() there's no corresponding
nir_var_atomic_counter mode. Since atomic counters are lowered
to SSBOs, use the nir_var_mem_ssbo mode in the scoped barrier
instead.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Acked-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
2023-02-27 20:24:01 +00:00
Caio Oliveira
2178a8da51 gallivm: Fix handling of nir_intrinsic_scoped_barrier
A scoped barrier only has a control barrier behavior if there's
an execution scope.

Fixes: 13d900de0d ("llvmpipe: set nir_shader_compiler_options::use_scoped_barrier")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
2023-02-27 20:24:01 +00:00
Caio Oliveira
e411e0afd3 microsoft/compiler: Handle scoped barrier in Tess splitting
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
2023-02-27 20:24:01 +00:00
Caio Oliveira
1db7e6a261 nir: Support use_scoped_barrier in nir_lower_atomics_to_ssbo
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Acked-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
2023-02-27 20:24:01 +00:00
Rob Clark
e45bbcf649 Revert "freedreno: Account for multi-draw in num_draws"
autotune already divides draw-cost by # of draws, but only increments
the draw-cost once per multi-draw.  We could either _also_ account for
draw-cost by multiply by # of draws for treat multi-draw as a single
draw.  The latter saves an integer multiply per draw.

Fixes a performance regression triggered by transition from GMEM to
sysmem rendering.

This reverts commit 6bfee9e669.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21543>
2023-02-27 18:30:09 +00:00
Emma Anholt
cc55a2e77d ci/crocus: Mark unvanquished as flaky.
It's started rendering something different again, with a similar sort of
bad rendering to what's linked in the bug report (though this time it's a
'P' that became a white square).  Commit range 65b62db0..964323fe has
nothing particularly likely in it, so I expect this is some sort of cache
flushing fail or something.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21565>
2023-02-27 18:16:07 +00:00
Emma Anholt
eac875a78e ci/crocus: Add new tess xfails and a link to the regression bug report.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21565>
2023-02-27 18:16:07 +00:00
Samuel Pitoiset
ca2d2ea60b zink/ci: skip one more test that timeout with RADV
It usually takes more than 60s to run.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21564>
2023-02-27 18:23:38 +01:00
Karol Herbst
4fb0adc43c ci/zink: move threading tests to flakes
We have some failed CI jobs where some of those tests randomly pass.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21561>
2023-02-27 17:05:20 +00:00
Mike Blumenkrantz
afd5a95d61 docs: add pipeline library support for tu
Acked-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21560>
2023-02-27 17:00:12 +00:00
Ryan Neph
03ffbcb29a Revert "venus: temporarily redirect VkDrmFormatModifierPropertiesListEXT to "2" variant"
No longer need to redirect, since the renderer should use the fixed
decoder for VkDrmFormatModifierPropertiesListEXT::drmFormatModifierCount
by now.

This reverts commit 525b8c582f.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21395>
2023-02-27 16:45:02 +00:00
Ryan Neph
1d12d7c33c venus: update venus-protocol headers to fix WA1
Follow-up to previous commit, this time to fix encoding/decoding for
VkDrmFormatModifierPropertiesListEXT::drmFormatModifierCount. Fixes a
workaround (WA1) in the venus-protocol.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21395>
2023-02-27 16:45:02 +00:00
Alyssa Rosenzweig
4eabd6586b nir/lower_blend: Don't dereference null
If a dual source blend colour is never written, src1 will be null and it will be
invalid to dereference it. src1 is dereferenced both for the f2fN instruction
but also if a dual blend factor is used... even if the latter isn't strictly
valid, segfaulting in the NIR pass seems a lot meaner than blending with zero.

The referenced commit hosed Asahi, causing anything that used blending to crash.
Panfrost is unaffected since it always supplies a dual colour due to our crude
construction of blend shaders.

Fixes: 8313016543 ("nir/lower_blend: Consume dual stores")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21544>
2023-02-27 15:47:33 +00:00
Rhys Perry
75d9a4a6ce aco: always update orig_names in get_reg_phi()
No idea why this wasn't done if pc.first was a renamed temporary.

Fixes navi10 RA validation error with
dEQP-VK.binding_model.descriptor_buffer.multiple.graphics_geom_buffers1_sets3_imm_samplers

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8349
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21501>
2023-02-27 15:10:22 +00:00
Eric Engestrom
735df516e9 radv: split linker script for android since it requires different symbols
Fixes: 4956f6d0bf ("radv: Add Android module info to linker script.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8338
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21518>
2023-02-27 14:34:16 +00:00
Yonggang Luo
669a68489d meson: Use sse2_arg and sse2_args to replace usage of c and c_sse2_args
And now c_sse2_arg and c_sse2_args are remvoed

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21375>
2023-02-27 13:50:11 +00:00
Yonggang Luo
ddf708a1ff meson: Split sse2_arg and sse2_args out of c_cpp_args
This is used to replace c_sse2_arg and c_sse2_args in latter commits

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21375>
2023-02-27 13:50:11 +00:00
Yonggang Luo
446630ab42 meson: When sse2 enabled, both c and cpp using sse2 options
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21375>
2023-02-27 13:50:11 +00:00
Mike Blumenkrantz
c1a62476ac vulkan/wsi/x11: make 4 image minimum for xwayland driver-specific
this avoids adding extra frames of latency to drivers that don't need
it

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21447>
2023-02-27 13:21:21 +00:00
Mike Blumenkrantz
7c8a5f6e37 vulkan/wsi: switch to using an options struct for last param
this makes adding values easier since the drivers won't need to be updated

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21447>
2023-02-27 13:21:21 +00:00
Georg Lehmann
1c5c2f77c3 aco: use and swizzle mask in dpp quad perm
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21412>
2023-02-27 11:09:42 +00:00
Georg Lehmann
8fabde3be4 aco/gfx11: use dpp_row_xmask and dpp_row_share
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21412>
2023-02-27 11:09:42 +00:00
Georg Lehmann
b7cd0eb439 aco: use v_permlane(x)16_b32 for masked swizzle
Should be cheaper than ds_swizzle.

Totals from 8 (0.01% of 134913) affected shaders:
CodeSize: 16316 -> 16388 (+0.44%)
Instrs: 3088 -> 3086 (-0.06%)
Latency: 49558 -> 49508 (-0.10%)
InvThroughput: 9180 -> 9198 (+0.20%)
Copies: 376 -> 384 (+2.13%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21412>
2023-02-27 11:09:42 +00:00
Georg Lehmann
9f155c21c3 amd: d16 uses rtz conversion for 32bit float
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21404>
2023-02-27 09:55:34 +00:00
Georg Lehmann
77252687fa amd: don't use d16 for integer loads
D16 saturates to min/max instead of just truncating.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21404>
2023-02-27 09:55:34 +00:00
Georg Lehmann
a00b50d820 nir: change 16bit image dest folding option to per type
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21404>
2023-02-27 09:55:34 +00:00
Samuel Pitoiset
a14d46fde2 radv: enable primitiveUnderestimation on GFX9+
It's passing dEQP-VK.rasterization.conservative.underestimate.* on
NAVI21.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21459>
2023-02-27 09:04:01 +00:00
Samuel Pitoiset
dba7a66429 radv: set MSAA_NUM_SAMPLES to 0 for underestimate rasterization
Based on PAL.

Fixes
dEQP-VK.rasterization.conservative.underestimate.samples_*.triangles.normal.test.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21459>
2023-02-27 09:04:01 +00:00
Samuel Pitoiset
0eae617826 radv: stop setting ENABLE_POSTZ_OVERRASTERIZATION to 1
According to PAL this isn't set.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21459>
2023-02-27 09:04:01 +00:00
Samuel Pitoiset
05732f4519 radv: cleanup radv_emit_{conservative,msaa}_state() functions
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21459>
2023-02-27 09:04:01 +00:00
Mike Blumenkrantz
34e7c17cfe lavapipe: EXT_image_sliced_view_of_3d
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21514>
2023-02-27 07:49:48 +00:00
Lionel Landwerlin
66e3ccbcac vulkan/runtime: store parameters of VK_EXT_sliced_view_of_3d
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21514>
2023-02-27 07:49:48 +00:00
Tatsuyuki Ishi
ed03821442 radv/sqtt: Use code buffer from radv_shader directly instead of copying.
The reference-counted radv_shader always outlives the pipeline, so we can
use this buffer directly when dumping code objects to the trace.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21513>
2023-02-27 07:16:48 +00:00
Tatsuyuki Ishi
ea070fb83a radv: Keep shader code ptr in a separately allocated buffer.
RGP traces need a dump of shader code in order to display ISA and
instruction trace. Previously, this was read back from GPU at trace
creation time. However, for future changes that implements upload shader
to invisible VRAM, the upload destination will be a temporary staging
buffer and will be only accessible during shader creation.

To allow dumping in such cases, copy the shader code to a separate buffer
at creation time, if thread tracing is enabled.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21513>
2023-02-27 07:16:48 +00:00
Mike Blumenkrantz
52f27cda05 zink: allow direct memory mapping for any COHERENT+CACHED buffer
some drivers may provide this in heaps that get used by non-staging resources,
so avoid extra copies in that case

unlike the previous attempt at this optimization, this utilizes the screen-based
context for thread-safe transfers, which should avoid races/crashes

fix #8171

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21452>
2023-02-27 03:50:14 +00:00
Mike Blumenkrantz
d78de2a962 zink: add locking for zink_screen::copy_context and defer creation
the copy context isn't always used, so this allows its creation to
be deferred and potentially save a bunch of memory

also add locking for multi-context thread safety

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21452>
2023-02-27 03:50:14 +00:00
Mike Blumenkrantz
a7b98dd4be zink: avoid adding ubo/ssbo bindings multiple times for different bitsizes
these are valid variables, but the descriptor binding needs to be unique

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21522>
2023-02-27 03:11:44 +00:00
Mike Blumenkrantz
db1af91f1b zink: simplify/rework image typing in ntv
the array approach was broken if a shader contained both bindless
and non-bindless resources, whereas a hash table is simpler and can
handle both images and samplers

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21522>
2023-02-27 03:11:44 +00:00
Mike Blumenkrantz
ac5f72a023 zink: delete unused emit_image param in ntv
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21522>
2023-02-27 03:11:44 +00:00
Mike Blumenkrantz
fb4fd03db9 zink: fix bindless texture barrier generation
whenever I redid barriers I forgot to handle bindless textures,
which meant they weren't getting barriers added

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21522>
2023-02-27 03:11:44 +00:00
Mike Blumenkrantz
75e9ba85de zink: rework descriptor unbind params to use is_compute directly
much simpler

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21522>
2023-02-27 03:11:44 +00:00
Mike Blumenkrantz
ddb116d755 zink: fix shader read access removal for barrier generation
barrier access is based on total binds per gfx/compute, not per stage

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21522>
2023-02-27 03:11:44 +00:00
Mike Blumenkrantz
00288d4f53 zink: delete dead uniform variables
this just obfuscate nir, so delete them now

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21522>
2023-02-27 03:11:44 +00:00
Alyssa Rosenzweig
760f367386 agx: Lower sampler LOD bias
G13 does not support sampler descriptor LOD biasing, so this needs to be lowered
to shader code for APIs that require this functionality. Add an option to do
this lowering while doing our other backend texture lowerings. This generates
lod_bias_agx texture instructions which the driver is expected to lower
according to its binding model.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21276>
2023-02-27 02:35:41 +00:00
Alyssa Rosenzweig
23f271833f asahi: Lower lod_bias_agx to uniform registers
Track the LOD bias of samplers and upload them at draw time to uniform
registers. This could be optimized in the future.

Vulkan will probably want to pull from a descriptor set instead.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21276>
2023-02-27 02:35:41 +00:00
Alyssa Rosenzweig
8058d31a25 nir: Add nir_texop_lod_bias_agx
Add a new texture opcode that returns the LOD bias of the sampler. This will be
used on AGX to lower sampler LOD bias to txb and friends. This needs to be a
texture op (and not a new intrinsic) to handle both bindless and bindful
samplers across GL and Vulkan in a uniform way.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21276>
2023-02-27 02:35:41 +00:00
Qiang Yu
822e756511 ac/llvm,radeonsi: lower fbfetch in abi
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21436>
2023-02-27 09:43:53 +08:00
Qiang Yu
28c2527e42 radeonsi: add num_component param to load_internal_binding
Prepare for different component number, ie. 8 when image desc.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21436>
2023-02-27 09:39:41 +08:00
Qiang Yu
5c44404b5f ac/llvm,radeonsi: lower nir_load_barycentric_at_sample in abi
RADV already did this in radv_lower_fs_intrinsics().

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21436>
2023-02-27 09:39:41 +08:00
Marek Olšák
0c8e7ad47e nir: lower to fragment_mask_fetch/load_amd with EQAA correctly
Fixes: 194add2c23 ("nir: lower image add lower_to_fragment_mask_load_amd option")
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21436>
2023-02-27 09:39:41 +08:00
Alyssa Rosenzweig
8313016543 nir/lower_blend: Consume dual stores
Now that we're working on lowered I/O, passing in the dual source blend colour
via a sideband doesn't make any sense. The primary source blend colours are
implicitly passed in as the sources of store_output intrinsics; likewise, we
should get dual source blend colours from their respective stores. And since
dual colours are only needed by blending, we can delete the stores as we go.
That means nir_lower_blend now provides an all-in-one software lowering of dual
source blending with no driver support needed! It even works for 8 dual-src
render targets, but I don't have a use case for that.

The only tricky bit here is making sure we are robust against different orders
of store_output within the exit block. In particular, if we naively lower

   x = ...
   primary color = x
   y = ...
   dual color = y

we end up emitting uses of y before it has been defined, something like

   x = ...
   primary color = blend(x, y)
   y = ...

Instead, we remove dual stores and sink blend stores to the bottom of the block,
so we end up with the correct

   x = ...
   y = ...
   primary color = blend(x, y)

lower_io_to_temporaries ensures that the stores will be in the same (exit)
block, so we don't need to sink further than that ourselves.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21426>
2023-02-26 17:35:08 -05:00
Alyssa Rosenzweig
44bdcb7214 panfrost: Use proper locations in blend shaders
Rather than always blending to FRAG_RESULT_DATA0. This removes silly special
cases in the compiler.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21426>
2023-02-26 17:35:07 -05:00
Francisco Jerez
4420251947 intel/rt: Fix L3 bank performance bottlenecks due to SW stack stride alignment.
Power-of-two SW stack sizes are prone to causing collisions in the
hashing function used by the L3 to map memory addresses to banks,
which can cause stack accesses from most DSSes to bottleneck on a
single L3 bank.  Fix it by padding the SW stack stride by a single
cacheline if it was a power of two.  This has been reported by Felix
DeGrood to improve Quake2 RTX performance by ~30% on DG2-512 in
combination with other RT patches Lionel Landwerlin has been working
on.

Many thanks to Felix DeGrood for doing much of the legwork and
providing several iterations of Q2RTX performance counter dumps which
eventually prompted me to consider the hash collision theory and
motivated this patch, and for providing additional performance counter
dumps confirming that there is no longer an appreciable imbalance in
traffic across L3 banks after this change.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21461>
2023-02-26 11:48:33 -08:00
Friedrich Vock
de4e3da4c4 docs: Fix formatting for RMV tracing docs
Fixes: e1cbff22 ("docs: Add short documentation about RMV tracing variables")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21502>
2023-02-26 19:15:44 +00:00
David Heidelberg
be2961de09 meson: print c_cpp_args
Acked-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21539>
2023-02-26 16:55:30 +01:00
Konstantin Seurer
2d93ab795b radv/rt: Pre shift cull_mask
This removes the need for masking the instance mask.

Totals from 14 (14.43% of 97) affected shaders:
CodeSize: 378696 -> 378308 (-0.10%); split: -0.12%, +0.02%
Instrs: 70854 -> 70855 (+0.00%); split: -0.02%, +0.02%
Latency: 1651235 -> 1651215 (-0.00%); split: -0.00%, +0.00%
InvThroughput: 336290 -> 336285 (-0.00%); split: -0.00%, +0.00%
Copies: 9915 -> 9923 (+0.08%); split: -0.03%, +0.11%
PreSGPRs: 890 -> 896 (+0.67%)

 PERCENTAGE DELTAS Shaders  CodeSize   Instrs   Latency  InvThroughput   Copies   PreSGPRs
 q2rtx-pipe        48        -0.02%    -0.02%    -0.00%      -0.00%      -0.03%      .
 q2rtx_1           49        -0.10%    +0.02%    +0.00%      +0.00%      +0.14%    +0.31%
 -------------------------------------------------------------------------------------------
 All affected      14        -0.10%    +0.00%    -0.00%      -0.00%      +0.08%    +0.67%
 -------------------------------------------------------------------------------------------
 Total             97        -0.06%    +0.00%    -0.00%      -0.00%      +0.06%    +0.16%

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21530>
2023-02-26 12:58:13 +00:00
Frank Binns
964323fe97 pvr: remove duplicate define
The same define appears a few lines above.

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/21495>
2023-02-25 22:58:25 +00:00
Frank Binns
cbfa4d52ed pvr: stop restricting the compiler to the Sascha Willems triangle demo
Do this by removing the compatibility table and only using hard coded shaders
when present. The hard coded shaders, along with the hard coding framework
itself, can be dropped once the compiler is capable of compiling the hard coded
shaders. In the meantime we don't want to risk regressing things that we know
work because we temporarily can't test them.

This restriction is being dropped now as the new compiler framework has been
merged and we want to make use of it so it can be developed further.

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/21495>
2023-02-25 22:58:25 +00:00
Giancarlo Devich
cb7403b909 d3d12: Track up to 16 active context resource states locally in d3d12_bo
After 16 entries, we fall back to the previous logic that used a hash
map to link the resource's state per context.

Preventing hash map churn by cheaply tracking up to 16 context's worth
of states per resource significantly reduces CPU cost in
find_or_create_state_entry

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21528>
2023-02-25 18:14:37 +00:00
Giancarlo Devich
2c00c069fe d3d12: Assign up to 16 simultaneously active contexts unique IDs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21528>
2023-02-25 18:14:37 +00:00
Giancarlo Devich
bd0e1b3d02 d3d12: Move d3d12_context_state_table_entry to d3d12_resource_state.h
Also renamed desired_resource_state to d3d12_desired_resource_state,
since it's also in the header now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21528>
2023-02-25 18:14:37 +00:00
Rob Clark
4c711460d4 tu/kgsl: Propagate tu_physical_device_init() errors
Should fix dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21394>
2023-02-25 17:02:34 +00:00
Rob Clark
6a28986eb4 tu+meson: Re-work KMD selection
Now that turnip can support multiple kernel-mode drivers in a single
build, re-work the meson option to have a single list of KMDs, rather
than special options to enable kgsl for turnip or virtio for gallium.

It is temporarily a bit awkward as gallium does not yet support kgsl
and turnip does not yet support virtio.  But both of those are planned
or in-progress, so long term a single list is the most sensible option.

TODO freedreno/drm support to build with only virtio support.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21394>
2023-02-25 17:02:34 +00:00
Rob Clark
407e4929de turnip: Refactor device loading
1) Allow the two different entrypoints for drm vs non-drm (kgsl) to
   coexist.
2) Split the generic drm related device initialization from the msm
   specifics.  This will simplify adding support for additional drm
   based kernel mode drivers (ie. virtgpu)

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21394>
2023-02-25 17:02:34 +00:00
Rob Clark
3b3882d4c5 turnip: Handle kgsl vs drm specifics at runtime
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21394>
2023-02-25 17:02:34 +00:00
Rob Clark
fc06e35a58 turnip: Move QueueWaitIdle entrypoint to kgsl
Handle in the same way as other kgsl specific entrypoints.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21394>
2023-02-25 17:02:34 +00:00
Rob Clark
1170efcf01 turnip: Allow knl backend specific entrypoints
Because kgsl sync primitives are not drm_syncobj, the kgsl kernel
support needs the ability to patch in it's own entrypoints related
to fences, etc.  The current entrypoint table magic using weak syms
won't work if we are building both kgsl and drm support into one
binary, so switch to runtime patching in the kgsl specific entry-
points.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21394>
2023-02-25 17:02:34 +00:00
Rob Clark
fd2b014a12 turnip: Split out vfuncs for kernel interface
To allow support for multiple KMD's to coexist, split out vfuncs.  This
doesn't quite *yet* let us have kgsl and msm coexist, because of the
different vk entrypoints needed by the kgsl backend.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21394>
2023-02-25 17:02:34 +00:00
Rob Clark
f84fce767d turnip: drm code-motion
Move a few functions around in prep for next commit.  Only code-motion.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21394>
2023-02-25 17:02:34 +00:00
Rob Clark
1cb702def4 turnip: Move things to prep for multi-kernel support
The end goal is a single build that supports kgsl (non-drm) as well
as msm and virtgpu (both drm).  First lets move around some files to
accomodate that.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21394>
2023-02-25 17:02:34 +00:00
Rob Clark
73dfcbf7e8 vk/runtime: Allow enumerate and try_create_for_drm to coexist
For drivers that can support both drm and non-drm kernel mode drivers it
is useful to be able to provide both entrypoints.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21394>
2023-02-25 17:02:34 +00:00
David Heidelberg
08ba87481b ci/freedreno: add flaking KHR-GL45.buffer_storage.map_persistent_dispatch
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21531>
2023-02-25 16:21:18 +00:00
Erik Faye-Lund
54f2074ebe docs: update link to intel optimization reference manual
Seems this document has moved since last we updated this link. But
instead of chasing the exact CDN link, let's link to the document on
Intel's website. There's both a download-link there, as well as the
ability to read the document online.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21448>
2023-02-25 15:47:18 +00:00
Erik Faye-Lund
8203618d45 ci: correct typo in name of linkcheck job
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21448>
2023-02-25 15:47:18 +00:00
David Heidelberg
b52917f9fc intel: use c_see2_arg instead of explicit -msse2
This allows us to also inherit `-mfpmath=sse` added in previous commit.

Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21371>
2023-02-25 15:34:33 +01:00
David Heidelberg
1851ca714b intel: enable -mfpmath=sse on x86
It's not enabled by default until `-msse2` and -ffast-math is passed.
We pass only the `-msse2`. Let's align it with main `meson.build`.

See: https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html (-mfpmath).

Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21371>
2023-02-25 15:34:00 +01:00
Gert Wollny
182066538f r600/sfn: Fix minimum required registers
Don't count the local registers, just the arrays, because local
registers might be renamed during register allocation.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8100

Fixes: 9fd9f3cd10
   r600/sfn: Set minimum required registers based on array allocation

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21523>
2023-02-25 14:01:55 +00:00
Konstantin Seurer
13a9ce7f2f radv/rt: Merge cull_mask and flags
Since cull_mask is only one byte, we can trivially store it in the same
register as the flags. This leaves us with a 2% performance gain in
Quake II RTX:

Totals from 7 (14.00% of 50) affected shaders:
VGPRs: 720 -> 688 (-4.44%)
CodeSize: 213052 -> 212980 (-0.03%); split: -0.05%, +0.02%
MaxWaves: 67 -> 70 (+4.48%)
Instrs: 39429 -> 39394 (-0.09%); split: -0.15%, +0.06%
Latency: 1096258 -> 1096943 (+0.06%); split: -0.05%, +0.11%
InvThroughput: 230661 -> 222963 (-3.34%); split: -3.42%, +0.08%
VClause: 1208 -> 1206 (-0.17%); split: -0.25%, +0.08%
Copies: 5321 -> 5269 (-0.98%); split: -1.22%, +0.24%
Branches: 1903 -> 1902 (-0.05%)
PreVGPRs: 650 -> 645 (-0.77%)

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21470>
2023-02-25 12:07:46 +00:00
Konstantin Seurer
8ae5a42990 nir: Add cull_mask_and_flags_amd intrinsic
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21470>
2023-02-25 12:07:46 +00:00
Lionel Landwerlin
8441d565ec anv: remove assert typed write support when using NULL surface
A number of apps hit this assert in debug mode.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21382>
2023-02-25 09:20:01 +00:00
Ryan Neph
65b62db0fb ci: uprev virglrenderer
Update virglrenderer to bring in venus protocol fixes described in
https://gitlab.freedesktop.org/olv/venus-protocol/-/issues/4.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21496>
2023-02-25 02:10:10 +00:00
Philipp Zabel
297fda6cf1 zink: fix build with -Dvulkan-beta=true
Fix a build error with -Dvulkan-beta=true:

  ../src/gallium/drivers/zink/zink_screen.c: In function ‘zink_internal_create_screen’:
  ../src/gallium/drivers/zink/zink_screen.c:2764:20: error: ‘struct zink_device_info’ has no member named ‘have_KHR_portability_subset’
   2764 |    if (screen->info.have_KHR_portability_subset) {
        |                    ^
  ../src/gallium/drivers/zink/zink_screen.c:2765:60: error: ‘struct zink_device_info’ has no member named ‘portability_subset_feats’
   2765 |       screen->have_triangle_fans = (VK_TRUE == screen->info.portability_subset_feats.triangleFans);
        |                                                            ^

Fixes: e02cdb397e ("zink: prefer vulkan_core.h over vulkan.h")
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21491>
2023-02-25 00:23:56 +00:00
Mike Blumenkrantz
f1acdeba6b zink: fix slab allocator sizing
now that the mem type is passed directly to pb, there have to be enough
slabs to allocate all the mem types (not heaps), so create memoryTypeCount
slabs to allow this

fixes #8369

Fixes: f6d3a5755f ("zink: zink_heap isn't 1-to-1 with memoryTypeIndex"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21526>
2023-02-25 00:02:06 +00:00
Patrick Lerda
fe4271c42d vbo/save: fix possible crash related to fixup_vertex()
Indeed, buffer_in_ram could be reallocated by fixup_vertex()
which triggers this issue.

For instance, with "piglit/gl-1.0-dlist-materials -auto -fbo":
==28392==ERROR: AddressSanitizer: heap-use-after-free on address 0x607000010024 at pc 0x7f3f416fcf18 bp 0x7f3f33d12800 sp 0x7f3f33d127f8
WRITE of size 4 at 0x607000010024 thread T6
    #0 0x7f3f416fcf17 in _save_Materialfv ../src/mesa/vbo/vbo_save_api.c:1405
    #1 0x7f3f418199de in _mesa_unmarshal_Materialfv src/mapi/glapi/gen/marshal_generated0.c:5006
    #2 0x7f3f413c6863 in glthread_unmarshal_batch ../src/mesa/main/glthread.c:65
    #3 0x7f3f4124d368 in util_queue_thread_func ../src/util/u_queue.c:309
    #4 0x7f3f41391eba in impl_thrd_routine ../src/c11/impl/threads_posix.c:67
    #5 0x7f3f4c619c6b in start_thread glibc-2.35/nptl/pthread_create.c:442
    #6 0x7f3f4c69e1fb in __clone3 (/lib64/libc.so.6+0x10c1fb)

0x607000010024 is located 20 bytes inside of 80-byte region [0x607000010010,0x607000010060)
freed by thread T6 here:
    #0 0x7f3f4f093b48 in __interceptor_realloc (/usr/lib64/libasan.so.6+0xb1b48)
    #1 0x7f3f416e5b0c in grow_vertex_storage ../src/mesa/vbo/vbo_save_api.c:417
    #2 0x7f3f416e69bc in fixup_vertex ../src/mesa/vbo/vbo_save_api.c:1266
    #3 0x7f3f416fb13e in _save_Materialfv ../src/mesa/vbo/vbo_save_api.c:1405
    #4 0x7f3f418199de in _mesa_unmarshal_Materialfv src/mapi/glapi/gen/marshal_generated0.c:5006
    #5 0x7f3f413c6863 in glthread_unmarshal_batch ../src/mesa/main/glthread.c:65
    #6 0x7f3f4124d368 in util_queue_thread_func ../src/util/u_queue.c:309
    #7 0x7f3f41391eba in impl_thrd_routine ../src/c11/impl/threads_posix.c:67
    #8 0x7f3f4c619c6b in start_thread glibc-2.35/nptl/pthread_create.c:442

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21419>
2023-02-24 22:44:58 +00:00
Iván Briano
b71957635f anv: stop tracking color blend state in the pipeline
Now that all color blend bits are dynamic, emit_cb_state() is doing
almost nothing and half of that is wrong.

In the case that color write enable is dynamic, at the time the pipeline
state is emitted, it sees all the color attachments as having write
disabled and stores the WriteDisabled bit for each channel.
When all dynamic state is flushed, we have the right values already but
the values recorded into the command buffer get ORed with the ones
stored in the pipeline, and so WriteDisabled tag along when they
shouldn't.

Since all disabled color attachments are handled already when dynamic
state is flushed, there's no point in doing so at pipeline creation
time too. And since the only other thing done by emit_cb_state() is
writing three hardcoded values, they might as well be taken care of in
the same place as everything else.

Fixes CTS from the future:
dEQP-VK.pipeline.*.extended_dynamic_state.*.color_blend_equation_*dynamic*
dEQP-VK.pipeline.*.extended_dynamic_state.*.color_blend_all_*

Fixes: fc3fd7c69e (anv: dynamic color write mask)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21509>
2023-02-24 22:07:52 +00:00
Iván Briano
dd5c6446b4 anv: fix testing for dynamic color blend bits
Fixes: fc3fd7c69e (anv: dynamic color write mask)
Fixes: 9dc6bed9a1 (anv: dynamic state for logic op enable)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21509>
2023-02-24 22:07:52 +00:00
Iván Briano
6e60612d42 vulkan: track the right value on CmdSetColorWriteMasks
Fixes: 092be5a329 ("vulkan: Add more dynamic color blend states")

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21509>
2023-02-24 22:07:52 +00:00
Marek Olšák
9f1e6d8f70 nir,amd: add and use nir_intrinsic_load_esgs_vertex_stride_amd
This will emulate VGT_ESGS_RING_ITEMSIZE, which does the multiplication
for us. It's beneficial to stop setting VGT_ESGS_RING_ITEMSIZE to reduce
context rolls, and also the register will be removed in the future.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
5e837f9594 amd/gpu_info: add a workaround for SI_FORCE_FAMILY=gfx1100
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
df6380ddc9 amd: implement conformant TRUNC_COORD behavior for gfx11
For testing, the conformant behavior can be enabled by setting
conformant_trunc_coord to true manually and running this to enable
the conformant behavior in hw:
    umr -w *.*.regTA_CNTL2 0x40000

The layer index rounding and TRUNC_COORD resetting workarounds can disabled
in the shader compiler.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
39fefeabee radeonsi/gfx11: change the default of COMPUTE_DISPATCH_INTERLEAVE to 256
This is an internal recommendation.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
3e8bd05020 radeonsi: don't set PACKET_TO_ONE_PA for line stippling
A hw guy told me this.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
4ca32bbc79 radeonsi: reorganize si_init_depth_surface for better readability
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
f5a98ba30c radeonsi: reorganize si_initialize_color_surface for better readability
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
236890608f radeonsi: reorganize emit_db_render_state and simplify VRS code
for better readability

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
be8c61b4f6 amd/registers: only define SPI and COMPUTE registers in the 0xB000 range
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
82926d93b4 radeonsi: don't clamp z_samples to fix Unreal Tournament 99
Fixes: a29218b5 - radeonsi/gfx11: always set MSAA_NUM_SAMPLES=0 for DCC_DECOMPRESS
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8261

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
80c0efa50f amd: query the per-SIMD VGPR counts from the kernel, don't hardcode them
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
26208698ae radeonsi: rename esgs_itemsize -> esgs_vertex_stride
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
32b8d0c19d radeonsi: correct and clean up obsolete vs_state_bits comments
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
23e7d44a88 radeonsi: always add 1 to lshs_vertex_stride now that LS_OUT_PATCH_SIZE is gone
LS_OUT_PATCH_SIZE limited the maximum value.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
b9c6ef7f51 radeonsi: remove unused VS_STATE_LS_OUT_PATCH_SIZE
This became unused when we switched to nir_lower_hs_inputs_to_mem.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
461b05c281 radeonsi: remove a gfx11 check in si_shader_gs (legacy GS)
Gfx11 doesn't support legacy GS.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
f6d8e776fd radeonsi: reformat emit_cb_render_state, create_blend_state, create_rs_state
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
8e9968e3a1 radeonsi: remove returns from si_emit_global_shader_pointers
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
98eee7dee3 amd: replace SI_BIG_ENDIAN with UTIL_ARCH_BIG_ENDIAN
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
e0c8b24e22 amd/registers: unify VRS combiner definition names between gfx103 and gfx11
use gfx11 names

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
091268944d amd,radeonsi: remove unused LLVM functions
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
d8b17b1752 radeonsi: disable Smart Access Memory because CPU access has large overhead
It will be remove completely in the next commit.

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8176

Cc: mesa-stable

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
d61cd39026 radeonsi: replace si_screen::has_out_of_order_rast with the radeon_info field
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
5b85fa6031 radeonsi/gfx11: ignore alpha_is_on_msb because the hw ignores it
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:24 +00:00
Marek Olšák
52f5b7a970 radeonsi: set PA_SU_VTX_CNTL consecutively with PA_CL_GB_VERT_CLIP_ADJ
because they are all next to each other.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
429f43f088 radeonsi: use SPI_SHADER_USER_DATA_HS_0 definition instead of LS_0
The value is the same, but LS_0 is for gfx9 only, and HS_0 is for everything
except gfx9.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
6dcd60206a radeonsi: remove no-op setting of THDS_PER_SUBGRP
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
742c9f411b radeonsi: change si_shader::ctx_reg to a nameless union for better readability
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
3e9863f496 radeonsi: move a few DB_SHADER_CONTROL states into si_shader_ps
They can be set si_shader_ps.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
ee83ba5771 radeonsi/gfx11: set CB_COLORi_INFO.MAX_COMP_FRAG on GFX1103_R2
Fixes: caa09f66ae - amd: add chip identification for gfx1100-1103

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
c54635a033 radeonsi/gfx11: don't set non-existent VGT_STRMOUT_BUFFER_CONFIG
Fixes: 9fecac091f - radeonsi/gfx11: scattered register deltas

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
31438fbab5 radeonsi/gfx11: fix the CU_EN clear mask for RSRC4_GS
Fixes: 9fecac091f - radeonsi/gfx11: scattered register deltas

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
34c01cf718 amd: bump AMD_MAX_SE and change the CU mask type to 16 bits
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
63b21e3066 amd: add missing gfx11 register definitions
Fixes: caa09f66ae - amd: add chip identification for gfx1100-1103

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
ac0e83375a amd: fix LOD_BIAS on gfx6-9 and adjust the lod bias CAP
Fixes: e673bb4ae4 - amd,util: fix how lod bias is converted to fixed-point

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
98328a71dc radeonsi: fix COMPAT_MODE on gfx8-9
It was set in the wrong dword.

Fixes: e673bb4ae4 ("amd,util: fix how lod bias is converted to fixed-point")

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Marek Olšák
fb70d8cf9c Revert "radeonsi/ci: Update stoney test expectations"
This reverts commit 53cc509288.

This MR fixes it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
2023-02-24 21:27:23 +00:00
Faith Ekstrand
96c832c47e spirv: Always emit deref_buffer_array_length intrinsics
All the drivers have been converted to setting this option now except
imagination and they don't support SSBOs yet.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3993
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21446>
2023-02-24 20:37:10 +00:00
Faith Ekstrand
fbeb81d812 v3dv: Set spirv_options::use_deref_buffer_array_length
It'll get lowered to get_ssbo_size by nir_lower_explicit_io() so the
driver should never notice this change.

Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21446>
2023-02-24 20:37:10 +00:00
Faith Ekstrand
1386e1476a lavapipe: Set spirv_options::use_deref_buffer_array_length
It'll get lowered to get_ssbo_size by nir_lower_explicit_io() so the
driver should never notice this change.

Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21446>
2023-02-24 20:37:10 +00:00
Faith Ekstrand
85634a70ec turnip: Set spirv_options::use_deref_buffer_array_length
It'll get lowered to get_ssbo_size by nir_lower_explicit_io() so the
driver should never notice this change.

Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21446>
2023-02-24 20:37:10 +00:00
Faith Ekstrand
00218ab73f panvk: Drop our manual SSBO size handling
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21446>
2023-02-24 20:37:10 +00:00
Faith Ekstrand
7594a64ebe hasvk: Drop our manual SSBO size handling
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21446>
2023-02-24 20:37:10 +00:00
Faith Ekstrand
a1c82fa42f anv: Drop our manual SSBO size handling
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21446>
2023-02-24 20:37:10 +00:00
Faith Ekstrand
e41753cf17 nir/lower_io: Handle buffer_array_length for more address modes
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21446>
2023-02-24 20:37:10 +00:00
Sil Vilerino
ee129301a9 frontend/va: Remove duplicate code in format support checking/reporting.
In config.c there are multiple copies of the code checking for VA_FORMAT_RT_*, this can lead
to confusion and is hard to maintain without knowing to change the code in all the places.

This commit extracts out the duplicated code into a function that checks format support
for a given profile and entrypoint, then this function is called from several places that
had the copies of this code in vlVaCreateConfig/vlVaGetConfigAttributes.

Please also note that after this change, all entrypoints/profiles will be checked for all
formats in the pipe_screen: YUV420/YUV420_10/YUV422/RGB32/YUV400/YUV444

Acked-by: Ruijing Dong <ruijing.dong@amd.com>
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21466>
2023-02-24 13:46:38 -05:00
Sil Vilerino
1a6865eae3 frontend/va: Add format support checks for VA_RT_FORMAT_* in VaCreateConfig/VaGetConfigAttributes
Before this change some formats like YUV420, YUV422 and RGB32 are hardcoded as supported
in VaCreateConfig/VaGetConfigAttributes. This is not always the case, different gallium
drivers and hardware will support different formats. The frontend should delegate the support
check call by using the is_video_format_supported(...) function from pipe_screen.

Acked-by: Ruijing Dong <ruijing.dong@amd.com>
Tested-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21466>
2023-02-24 13:37:51 -05:00
Roland Scheidegger
a4fa489002 lavapipe, nir: Fix wrong array index scaling in nir_collect_src_uniforms
The scaling needs to be ubo * MAX_INLINABLE_UNIFORMS, not
ubo * PIPE_MAX_CONSTANT_BUFFERS, otherwise accesses beyond buffer size
will result for ubo >= 4 (and we'd also access the wrong values later
for other non-zero ubo indices).

Fixes: a7696a4d98 ("lavapipe: Fix bad array index scale factor in lvp_inline_uniforms pass")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21506>
2023-02-24 16:13:55 +00:00
Gert Wollny
b6303d33ec r600/sfn: Fix readport cylce map
This is currently of no consequence, because the bank swizzle
codes are only used to check legal ALU group configuration
and the bank swizzles are not yet allocated to the instruictions
here.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21516>
2023-02-24 15:59:03 +00:00
Gert Wollny
b5b7ca0ad3 r600/sfn: be more conservative with channel use in multi-slot ops
The current approach to check the bank swizzle doesn't allow to
re-evaluate bank-swizzle for instructions that where emitted
earlier, so we might end up with impossile constellations when we
allow three uses of the same channel

Fixes: edabd5cd84
  r600/sfn: check used channels when evaluating allowed mask

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8350

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21516>
2023-02-24 15:59:03 +00:00
Konstantin Seurer
e2fa9ba9c6 radv: Use indirect header filling for compact builds
Sets the accel struct size fields to the correct values which should
allow for more compaction.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konstantin Seurer
40e9efa2de radv/bvh: Add a shader for filling the header
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konstantin Seurer
c83ea20683 radv/bvh: Move the size header field up
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konstantin Seurer
b0fd43f1f7 radv: Move the geometry infos before the BVH
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konstantin Seurer
0800450cb9 radv: Use compact encoding
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konstantin Seurer
07c1b23022 radv/bvh: Implement compact encoding
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konstantin Seurer
71ccc8d600 radv: Add a build config for compact builds
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konstantin Seurer
da4f498f6f radv/bvh/encoder: Move dst_node initialization into the loop
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konstantin Seurer
2792d012d2 radv/bvh/encode: Introduce is_root_node
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konstantin Seurer
2c0e158ae2 radv/bvh/encode: Move bvh_offset NULL check to the top of the loop
NULL nodes don't have to be encoded and they also don't carry over any
information to their children.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konstantin Seurer
4e87a01b93 radv/bvh: Replace is_final_tree with bvh_offset
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konstantin Seurer
688f598237 radv/bvh/encode: Use the node type for identifying internal nodes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20818>
2023-02-24 15:14:40 +00:00
Konrad Dybcio
6d93f4f867 freedreno: Add A2xx REG_A2XX_RBBM_PM_OVERRIDE2 bitfields
Required for good-looking kernel code

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21480>
2023-02-24 14:48:27 +00:00
Konrad Dybcio
891a8bfb2d freedreno: Add A2xx perf counter reg values
Required for good-looking kernel code

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
[rob: fixup CI expectations]

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21480>
2023-02-24 14:48:27 +00:00
Karmjit Mahil
9e2572903b pvr: Remove component_alignment
We don't support output register subdivision so no need to keep
track of how many bytes have been allocated within the output regs.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21386>
2023-02-24 14:36:36 +00:00
Karmjit Mahil
0244719a12 pvr: Remove unused msaa_mode field
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21386>
2023-02-24 14:36:36 +00:00
Karmjit Mahil
ca04882117 pvr: Setup SPM EOT state
On entering SPM we need to store the tile data for the current
render into the scratch buffer so we need to setup an EOT program
to do so.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21386>
2023-02-24 14:36:36 +00:00
Karmjit Mahil
f59c6eef16 pvr: Move PBE START_POS into csb enum helpers header
This commit adds 'pvr_pbestate_source_pos()' and moves
`enum pvr_pbe_source_start_pos` into pvr_csb_enum_helpers.h .
The enum will be needed in other files in the commits following.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21386>
2023-02-24 14:36:36 +00:00
Samuel Pitoiset
d2ff8b673a radv: advertise VK_EXT_image_sliced_view_of_3d on GFX10+
Pass dEQP-VK.pipeline.monolithic.sliced_view_of_3d_image.* on NAVI21.

Looks like older generations can't support it.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21359>
2023-02-24 14:12:22 +00:00
Samuel Pitoiset
5520a40e05 radv: implement VK_EXT_image_sliced_view_of_3d on GFX10+
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21359>
2023-02-24 14:12:22 +00:00
Samuel Pitoiset
e82c11df66 ac/nir: add resinfo lowering for sliced storage 3D views
The first layer isn't necessarily 0 and depth shouldn't be minified.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21359>
2023-02-24 14:12:22 +00:00
Karmjit Mahil
806f146eea pvr: Add support for blend constants.
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21388>
2023-02-24 13:59:01 +00:00
David Heidelberg
46091832d8 util/process_test: make the error variable static
Make the `error` variable static to prevent a clash with
the glibc error() function when LTO is used.

Fixes the LTO build.
Otherwise, it'll fail in the linking phase with a conflict:
```
[411/2321] Linking target src/util/process_test
FAILED: src/util/process_test
c++  -o src/util/process_test src/util/process_test.p/tests_process_test.c.o -flto -Wl,--as-needed -Wl,--no-undefined -Wl,--fatal-warnings -Wl,--start-group src/util/libmesa_util.a src/util/format/libmesa_format.a src/util/libmesa_util_sse41.a src/c11/impl/libmesa_util_c11.a subprojects/perfetto/libperfetto.a /usr/lib/x86_64-linux-gnu/libz.so -pthread -lm -ldl /usr/lib/x86_64-linux-gnu/libunwind.so -Wl,--end-group
mold: error: symbol type mismatch: error
>>> defined in /tmp/process_test.SLc9I6.ltrans0.ltrans.o as STT_OBJECT
>>> defined in /lib/x86_64-linux-gnu/libc.so.6 as STT_FUNC
```

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21511>
2023-02-24 13:30:09 +01:00
Simon Perretta
b4ab54976b pvr: Add encodings for index registers
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
6122dd5488 pvr: Amend definitions for ST and IDF
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
66500c28d2 pvr: Add late op lowering pass and conditional execution
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
8719f7cb8d pvr: Add support for MOVC
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
c38c119617 pvr: Add basic support for manual instruction grouping
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
b642e77cdd pvr: Add support for TST
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
de64dfe940 pvr: Add branch support
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
b1064e91f1 pvr: Add support for ST
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
c4b7128d84 pvr: Add support for IDF
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
73d07bbb52 pvr: Add support for generating NOP program
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
4ddcda8369 pvr: Add support for generating per-job EOT program
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
88e42e18d9 pvr: Fix descriptor set address calculation
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
5287edd6d2 pvr: Register allocation improvements
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
eb65c4be88 pvr: Add support for WOP
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
432fea181d pvr: Add support for emitpix
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
bdbd69edb8 pvr: Add support for validating modifier combos
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
8ef839374e pvr: Add support for sample instructions
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
1c11f1afbd pvr: Add support for fitr.pixel
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
0ce53b002f pvr: Amend subarray ownership code
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Simon Perretta
af0685d05e pvr: Add NIR pass to lower vars to SSA
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474>
2023-02-24 11:29:48 +00:00
Sviatoslav Peleshko
07b57deea2 anv: Move WA MEDIA_VFE_STATE after stalling PIPE_CONTROL
Fixes: bc612536 ("anv: Emit a dummy MEDIA_VFE_STATE before switching from GPGPU to 3D")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6172
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21472>
2023-02-24 10:08:43 +00:00
Friedrich Vock
c0c911d9ba mesa: Report GL_SHADER_BINARY_FORMAT_SPIR_V as supported
GL_ARB_gl_spirv introduced it, but its corresponding format was never listed in GL_SHADER_BINARY_FORMATS.

Fixes: 5bc03d25 ("mesa: implement SPIR-V loading in glShaderBinary")
Closes: #7644
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19559>
2023-02-24 09:39:17 +00:00
Pierre-Eric Pelloux-Prayer
2b655e267e radeonsi: fix incorrect vgpr indices in the ps_prolog
In monolithic PS shaders, we need to account for PERSP_PULL_MODEL even
if we don't use it; si_get_ps_prolog_key already does the same thing
to determine color_interp_vgpr_index.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8280
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21483>
2023-02-24 09:17:20 +00:00
Pavel Ondračka
a8e1e5b5c2 r300: simplify KILL transformation
We had some special cases before when we could actually get some IFs on
R300 with VDPAU. Now that VDPAU is gone and everything goes through
ntt, we don't have to worry anymore. Remove the complicated logic and
just always transform KILL into KIL none.-1

No shader-db change on RV530 or RV370.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21503>
2023-02-24 08:59:53 +00:00
Emma Anholt
fc0f694676 ci/zink: Add a glx flake on anv
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21366>
2023-02-24 07:31:36 +00:00
Emma Anholt
f2dc37454e ci: Fix stage of etnaviv manual runs.
Fixes: f6c06ef2f6 ("ci: Add manual rules variations to disable irrelevant driver jobs.")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21366>
2023-02-24 07:31:36 +00:00
Emma Anholt
ae0e1eb0af ci/hasvk: Add a synchronization flake.
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21366>
2023-02-24 07:31:36 +00:00
Emma Anholt
0b976dee49 ci/zink+turnip: Disable flaky minetest trace.
random 1-pixel changes sometimes.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21366>
2023-02-24 07:31:36 +00:00
Emma Anholt
2a7debd1ca ci/turnip: Drop the #8219 xfail.
It hasn't showed up in the last couple runs, the other test is no longer
showing up in the caselist so the fail isn't triggered.  Bug is still
there, though.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21366>
2023-02-24 07:31:36 +00:00
Emma Anholt
0cc34b7bb9 ci/freedreno: Drop a530 piglit_gl coverage.
It hasn't worked in a long time -- the board gets wedged 20 minutes in and
then we reboot it and try again until failure.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21366>
2023-02-24 07:31:36 +00:00
Emma Anholt
be32dba99c ci/etnaviv: Drop one more gc7000 xfail.
Looks like I missed it in the last full-run update.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21366>
2023-02-24 07:31:36 +00:00
Sviatoslav Peleshko
4bf38f5652 anv: Handle all fields in VkAccelerationStructureBuildRangeInfoKHR
Add handling of primitiveOffset and firstVertex.

Fixes: f3ddfd81 ("anv: Build BVHs on the GPU with GRL")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8296
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21342>
2023-02-24 07:08:05 +00:00
Caio Oliveira
070f042e10 spirv: Implement SPV_KHR_subgroup_rotate
Map SpvOpGroupNonUniformRotateKHR to nir_intrinsic_rotate.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19797>
2023-02-24 06:33:51 +00:00
Caio Oliveira
3328714295 nir/lower_subgroups: Add option lower_rotate_to_shuffle
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19797>
2023-02-24 06:33:51 +00:00
Caio Oliveira
e40b1df432 nir: Add nir_intrinsic_rotate
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19797>
2023-02-24 06:33:51 +00:00
Pavel Ondračka
a06ab9849d r300: drop VDPAU support
There is no UVD and the mpeg2 shader-based decoding is broken and doesn't
lead to CPU savings anyway. VDPAU output works, but there is no real
benefit so just disable VDPAU altogether so we can clean the backend a
bit and also open a way to potentially drop the mpeg2 deconding altogether
from the fronted.

Acked-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20524>
2023-02-24 06:04:32 +00:00
Mike Blumenkrantz
865e9311a2 zink: utilize copy box tracking to avoid barrier emission for buf2img copies
this should reduce synchronization during e.g., miplevel population

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21397>
2023-02-24 05:27:31 +00:00
Mike Blumenkrantz
4ad64552b8 zink: add a util function for optimizing TRANSFER_DST image barriers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21397>
2023-02-24 05:27:31 +00:00
Mike Blumenkrantz
fa6e6545b1 zink: add some tracking for copy box regions
this enables tracking per-miplevel pipe_boxes for copy operations that
can then be used to avoid emitting barriers for successive copy operations
without overlapping regions

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21397>
2023-02-24 05:27:31 +00:00
Mike Blumenkrantz
935184ca44 util/box: add intersection test functions for 1d/3d
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21397>
2023-02-24 05:27:31 +00:00
Caio Oliveira
8f3d0141de anv, hasvk: Align workaround address to 32B
Not necessary but, all things being equal, be consistent with Iris.

Now that intel_debug_write_identifiers() already add the padding,
there's no need to include extra "+ 8" to the offset.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21479>
2023-02-24 04:57:40 +00:00
Caio Oliveira
a4a0417263 iris, crocus: Align workaround address to 32B
The workaround address is used as a source for push constants when
there's no resource available, that address must be 32B aligned.

This fixes invalid address being used for buffers in
3DSTATE_CONSTANT_* packets.

Now that intel_debug_write_identifiers() already add the padding,
there's no need to include extra "+ 8" to the offset.

Thanks to Xiaoming Wang that contributed to find and fix this issue.

Fixes: 2a4c361b06 ("iris: add identifier BO")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21479>
2023-02-24 04:57:40 +00:00
Caio Oliveira
ea0ec8c562 intel: Add extra zeros at the end of debug identifiers
Add at least a full aligned uint64_t of zero padding at the end
to make the identifiers easier to spot.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21479>
2023-02-24 04:57:40 +00:00
David Heidelberg
387d131f96 ci/llvmpipe: add flake timeout for rusticl program@execute@builtin@builtin-float-sincos-1.0
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21510>
2023-02-24 04:37:49 +00:00
Sil Vilerino
9490633723 d3d12: Fix VP9 Decode - Checking 0xFF instead of 0x7F for invalid frame_ref[i].Index7Bits
Fixes: c8e8ce8359 ("d3d12: Add VP9 Decode support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21507>
2023-02-24 01:49:28 +00:00
Caio Oliveira
fb2a6248d2 hasvk: Update driver name in debug information
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21481>
2023-02-24 00:41:09 +00:00
Bas Nieuwenhuizen
ed76833705 radv: Implement & expose VK_EXT_pipeline_library_group_handles.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21406>
2023-02-23 22:17:30 +00:00
Bas Nieuwenhuizen
d0f7587109 radv: Use group handles based on shader hashes.
Should be stable.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21406>
2023-02-23 22:17:30 +00:00
Bas Nieuwenhuizen
913de78731 radv: Use provided handles for switch cases in RT shaders.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21406>
2023-02-23 22:17:30 +00:00
Bas Nieuwenhuizen
430170702e radv: Hash group handles as part of RT pipeline key.
So that we can start varying them  to avoid collisions while keeping
handles stable.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21406>
2023-02-23 22:17:30 +00:00
Bas Nieuwenhuizen
9eb76ab638 radv: Add helper to hash stages.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21406>
2023-02-23 22:17:30 +00:00
Mike Blumenkrantz
211ed8745f zink: add debug marker tracing for qbo updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21425>
2023-02-23 21:47:20 +00:00
Mike Blumenkrantz
26aedae568 zink: add ZINK_DEBUG=map
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21425>
2023-02-23 21:47:20 +00:00
Mike Blumenkrantz
03610a5aab zink: actually hook up ZINK_DEBUG=norp
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21425>
2023-02-23 21:47:20 +00:00
Rob Clark
9e8450b65c freedreno/crashdec: Disable GALLIUM_DUMP_CPU
We don't want util_cpu to vomit cpu caps all over the test output.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Rob Clark
3f227957d6 freedreno/crashdec: Handle multi-IB prefetching
Add helper to scan the CP_INDIRECT_BUFFERs, and then work backwards
accounting for data buffered via ROQ prefetch to deduce the actual
SQE position at the time of the crash.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Rob Clark
ddc4e87438 freedreno/crashdec: Add another prefetch test
Constructed with an invalid packet (0xdeadd00d) so there is no ambiguity
in the crash location.

This is expected to fail until the next commit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Rob Clark
643ee85103 freedreno/crashdec: Refactor crashdec tests
Simplify the process of adding additional tests.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Connor Abbott
7417432a28 freedreno/crashdec: Add prefetch test
Add a crash where this was seen "in the wild" on a CTS test in
!17943 which requires handling multi-IB prefetching to correctly
location the crash location.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Rob Clark
9ececfc6e6 freedreno/cffdec: Fix hang location detection
We were previously checking only every 8 dwords within the packet.  We
should instead just check if the hang location comes within the packet.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Rob Clark
924f264081 freedreno/cffdec: Add helper to parse CP_INDIRECT_BUFFER
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Rob Clark
c01ac4b583 freedreno/cffdec: Add helper to find next pkt
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Rob Clark
cb13e24758 freedreno/cffdec: Fix unitialized count for pkt2
This was causing us to use the size of the previous packet.  Which just
happened to land on a valid packet because pkt2 only followed a
CP_INDIRECT_BUFFER.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Connor Abbott
4060cf5772 freedreno/crashdec: Fix apparent off-by-one with ROQ size
I have multiple examples where this register is too large by one
when comparing to the ROQ read/write pointers in CP_ROQ_*_STAT and the
ROQ data itself, as if it includes the dword most recently read too. I
have an example where it's off by 2 compared to the read pointer, but
the read pointer is also off by 1 itself judging by the SQE program
counter, so that may just be them not getting synchronized. This
off-by-one was getting in the way of figuring out exactly IB2 was being
processed in the next commit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Connor Abbott
ce7225c0f9 freedreno/a6xx: Fill in ROQ status registers
We had a bunch of registers only defined for some parts of ROQ but now
that we know the pattern for ROQ-related registers it's easy to fill in
the rest.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Connor Abbott
44054b1f3b freedreno/a6xx: Fix CP_ROQ_THRESHOLDS_1
Just by adding the ROQ_*_STAT registers following the previous pattern
it becomes obvious what these fields actually are.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Connor Abbott
aba8aea2be freedreno/a6xx: Add CP_ROQ_*_STAT
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Connor Abbott
8c6d741e26 freedreno/a6xx: Rename CP_CSQ_IB*_STAT
These don't correspond to the a3xx *_STAT registers, which we're about
to add so we need to rename them. The closest analogue is CP_CSQ_AVAIL,
although the sense is inverted (and we're not sure what the low 16 bits
are about). Also, the a3xx distinction between CSQ and STQ doesn't exist
anymore so don't use these outdated terms.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
2023-02-23 20:02:26 +00:00
Tapani Pälli
880a3efe6c anv: implement emission of 3DSTATE_HS for Wa_1306463417
We need to emit 3DSTATE_HS for each primitive with tessellation.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21308>
2023-02-23 19:30:03 +00:00
Tapani Pälli
f8a1100ca1 anv: limit generated draws to pipelines without HS stage
This is done for gfx11 specific workaround.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21308>
2023-02-23 19:30:03 +00:00
Tapani Pälli
2028f1caa3 anv: emit 3DSTATE_HS in cmd_buffer_flush_gfx_state
Patch packs 3DSTATE_HS state during pipeline creation but it
gets emitted only before 3DPRIMITIVE. We will later need this
to implement a workaround.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21308>
2023-02-23 19:30:03 +00:00
Tapani Pälli
a043ae8e24 iris: implement emission of 3DSTATE_HS for Wa_1306463417
We need to emit 3DSTATE_HS for each primitive with tessellation.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21308>
2023-02-23 19:30:03 +00:00
Mark Collins
e4ebb541c5 meson: update flex/bison requirement to cover all usages
Meson silently drops outputs such as libvulkan-freedreno when
dependencies on flex/bison can't be satisfied rather than providing
an error which this commit fixes.

Signed-off-by: Mark Collins <mark@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21488>
2023-02-23 19:00:19 +00:00
Eric Engestrom
61f45a6f44 gbm: drop unnecessary vulkan dependency
gbm doesn't actually include vulkan headers

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21489>
2023-02-23 18:31:22 +00:00
Eric Engestrom
2bf24c84f3 glx: include directly the useful vulkan header, instead of including everything
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21489>
2023-02-23 18:31:22 +00:00
Eric Engestrom
c8d7e0c023 egl: include directly the useful vulkan header, instead of including everything
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21489>
2023-02-23 18:31:22 +00:00
Chia-I Wu
e97ed4fc89 anv: process utrace payloads on queue submission
anv_QueuePresentKHR is not called by apps that do not use WSI.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21456>
2023-02-23 18:06:16 +00:00
Karmjit Mahil
aa791961a8 pvr: Add support for dynamic buffers descriptors
This is based on the new approach of having a descriptor set
addresses table in memory. To handle dynamic offsets provided on
vkCmdBindDescriptorSets() we duplicate the set with dynamic
descriptors, apply the offsets, and write the new bo's address
into the table. There are better ways of handling dynamic
descriptors but this implementation won't require many/if any
changes in the compiler code.

The descriptor set itself doesn't allocate and reserve space for
the dynamic descriptors since they would all be collected together
when creating the pipeline layout. While copying the descriptor
set we allocate extra space at the end for the dynamic primaries
and secondaries to account for that.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21391>
2023-02-23 16:26:51 +00:00
Väinö Mäkelä
2bef26ed04 ci/intel: Update hasvk HSW xfails
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19876>
2023-02-23 16:02:14 +00:00
Väinö Mäkelä
d6d8edf9ae hasvk: Handle subpass self-dependencies for stencil shadow copies
Always copying when dstAccessMask includes texture operations is not
optimal, but it's good enough.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19876>
2023-02-23 16:02:13 +00:00
Väinö Mäkelä
d3162f97b5 hasvk: Mark VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL as stencil write optimal
VK_KHR_synchronization2 added VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL, which
was not previously recognized by vk_image_layout_stencil_write_optimal.

Would close https://gitlab.freedesktop.org/mesa/mesa/-/issues/5578 if it
wasn't already closed.

Fixes: b996fa8efa ("anv: implement VK_KHR_synchronization2")

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19876>
2023-02-23 16:02:13 +00:00
Väinö Mäkelä
79a58cb79b hasvk: Enable PixelShaderKillsPixel when omask is used
From the Haswell PRM Vol. 2b, 3DSTATE_WM::Pixel Shader Kill Pixel:
    "This bit is required to be ENABLED in the following situations:
     - The API pixel shader program contains "killpix" or "discard"
       instructions, or other code in the pixel shader kernel that can
       cause the final pixel mask to differ from the pixel mask received
       on dispatch.
     - A sampler with chroma key enabled with kill pixel mode is used by
       the pixel shader.
     - Any render target has Alpha Test Enable or AlphaToCoverage Enable
       enabled.
     - The pixel shader kernel generates and outputs oMask."

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19876>
2023-02-23 16:02:13 +00:00
Mike Blumenkrantz
15b302179a aux/tc: add a 'has_resolve' member to tc_renderpass_info
this indicates that the first color buffer gets resolved

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21365>
2023-02-23 15:33:47 +00:00
Lionel Landwerlin
ce68824bdf anv: fix invalid masking of 48bit address
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4d05be49c2 ("anv: implement vkCmdTraceRaysIndirect2KHR")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21486>
2023-02-23 15:02:45 +00:00
José Roberto de Souza
af994570f0 intel/blorp: Allocate only necessary amount of VERTEX_BUFFER_STATE
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21031>
2023-02-23 14:27:30 +00:00
José Roberto de Souza
a364f23a6c intel: Make gen12 URB space reservation dependent on compute engine presence
Tigerlake PRM: Volume 2c: Command Reference: Registers Part 2 - Registers M through Z
RCU_MODE :: Compute Engine Enable

   This bit indicates if Compute Engine (a.k.a Dual Context or Multi
   Context) is enabled or not. This bit must be treated as global
   control for enabling and disabling of compute engine. Hardware
   allocates required resources for the compute engine based on this
   bit.
   ....
   HW reserves 4KB of URB space...

Right now no gen12 platform has Dual Context enabled in kernel side,
exposing a compute engine but that can change, so here adding
has_compute_engine to intel_device_info and only reserving URB space
if compute engine is available.

While at it also fixing the error path when pb_slabs_init() fails.

Bspec: 46034
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21031>
2023-02-23 14:27:30 +00:00
Karmjit Mahil
63278778c6 pvr: Add push consts support to descriptor program.
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21387>
2023-02-23 10:14:17 +00:00
Eric Engestrom
fbd644c59d meson: replace vk_wsi_args with dependencies to let meson take care of transitivity
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19497>
2023-02-23 09:42:46 +00:00
Eric Engestrom
f059213f5d meson: reuse vulkan_wsi_list for defining vk_wsi_args
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19497>
2023-02-23 09:42:46 +00:00
Eric Engestrom
22c1f4be8c docs: mention meson configure and drop broken workaround script
The script is broken, and nobody noticed so it wasn't used much.

Meson has had support for printing the options by pointing to the source
dir for a while (not sure the exact version though) so I think we can
just recommend users do that.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21469>
2023-02-23 08:50:40 +00:00
Eric Engestrom
e5cf283121 docs: mention the meson summary
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21469>
2023-02-23 08:50:40 +00:00
Marcin Ślusarz
512126b26d intel/compiler: remove unused field from fs_thread_payload
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20957>
2023-02-23 08:04:24 +00:00
Patrick Lerda
9b4eb73907 r600: fix shader blob memory leak
Fixes: 5b205ef413
   r600: Store nir shaders serialized to save memory

Direct leak of 4096 byte(s) in 1 object(s) allocated from:
    #0 0x7faf89c3bb48 in __interceptor_realloc (/usr/lib64/libasan.so.6+0xb1b48)
    #1 0x7faf7be5981d in grow_to_fit ../src/util/blob.c:67
    #2 0x7faf7be5a538 in grow_to_fit ../src/util/blob.c:49
    #3 0x7faf7be5a538 in blob_reserve_bytes ../src/util/blob.c:177
    #4 0x7faf7be5a538 in blob_reserve_uint32 ../src/util/blob.c:190
    #5 0x7faf7d248a8c in nir_serialize ../src/compiler/nir/nir_serialize.c:2109
    #6 0x7faf7df4fdbb in r600_pipe_shader_create ../src/gallium/drivers/r600/r600_shader.c:401

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21443>
2023-02-23 07:06:42 +00:00
Juston Li
cc3c97d8c9 venus: Add VkBuffer cache statistics for debug
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21324>
2023-02-23 03:38:10 +00:00
Juston Li
7d53d4d078 venus: add VN_DEBUG_CACHE flag
General debug flag for dumping statistics for various caching done by
venus.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21324>
2023-02-23 03:38:10 +00:00
Juston Li
ef255444c1 venus: switch to lazy VkBuffer cache
Instead of creating a static VkBuffer cache at init with hardcoded
CreateInfo's, lazily cache VkBuffers that the app requests.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21324>
2023-02-23 03:38:10 +00:00
Karol Herbst
56a9aad401 nir/deref: don't replace casts with deref_struct if we'd lose the stride
The result might be used in a deref_ptr_as_array, which requires a proper
stride within lower_explicit_io. If we'd lose that information or end up
with a different stride don't execute this optimization.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8289
Fixes: b779baa9bf ("nir/deref: fix struct wrapper casts. (v3)")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21458>
2023-02-23 01:44:25 +00:00
Sajeesh Sidharthan
fa9a8c85e2 radeonsi/vcn: disable fence for JPEG decoding
5e1bd07a is causing JPEG decoding regression issue.
Therefore, disable fence for JPEG decoding until fence issue is fixed.

Signed-off-by: Sajeesh Sidharthan <sajeesh.sidharthan@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21442>
2023-02-23 01:08:09 +00:00
Eric Engestrom
c392cdf750 v3d: update supertuxkart reference after 1c028a4d5b
The smoke effect now looks smoother instead of having hard steps, which
looks like a reasonable change given that 1c028a4d5b added
several float formats:
https://eric.pages.freedesktop.org/-/mesa/-/jobs/36691458/artifacts/results/summary/results/trace@broadcom-rpi4@supertuxkart@supertuxkart-mansion-egl-gles-v2.trace.html

Fixes: 1c028a4d5b ("v3d: support r{g,gba}16f formats for vertex buffers")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21462>
2023-02-22 23:08:21 +00:00
Sviatoslav Peleshko
4229d9324f iris: Avoid creating uncompressed view with unaligned tile offsets on BDW
Fixes: 60568d5d ("iris: Use isl_surf_get_uncompressed_surf")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7990
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21147>
2023-02-22 22:33:08 +00:00
Eric Engestrom
7ebdddf319 docs: update calendar for 22.3.6
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21477>
2023-02-22 22:27:27 +00:00
Eric Engestrom
2ad5927816 docs/relnotes: add sha256sum for 22.3.6
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21477>
2023-02-22 22:27:27 +00:00
Eric Engestrom
e581901132 docs: add release notes for 22.3.6
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21477>
2023-02-22 22:27:27 +00:00
Emma Anholt
ecabc824c2 glsl: Drop the (v.x + v.y + v.z + v.w) -> dot(v, 1.0) optimization.
It's not connected up to anything at the moment, and even if I do enable
it for crocus HSW it only shaves 3 instructions off of one particular VS
in an old synthetic benchmark, not affecting anything else in shader-db.
I don't think anyone will care to ever fix or port this to NIR, let's just
retire it.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21353>
2023-02-22 21:45:35 +00:00
Rob Clark
3c668513b9 freedreno/a6xx: Fix view_seqno in tex cache key
If the view's seqno increments, it needs to happen *before* the tex cache
key is constructed.  Normally this happens when the sampler views are
bound.  But if the texture backing a current sampler view is rebound we
need to handle this before the cache lookup.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>
2023-02-22 21:26:28 +00:00
Rob Clark
818b49932a freedreno/a6xx: Static-ify sampler_view_update()
It doesn't need to be visible elsewhere since commit a93d3f1498
("freedreno/a6xx: Move tex state building")

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>
2023-02-22 21:26:28 +00:00
Rob Clark
e9fa92d6fa freedreno/a6xx: Small cleanup
Move the rb allocation to the place where it is populated (ie. where we
know how large it must be).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>
2023-02-22 21:26:28 +00:00
Rob Clark
936f2ebb46 freedreno/a6xx: Remove needs_invalidate flag
Whether the rsc seqno has changed tells us whether we need to update.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>
2023-02-22 21:26:27 +00:00
Rob Clark
b6778995d7 freedreno/a6xx: Add a way to assert valid format
Layout transitions caused by access as a various format must happen at
state bind time, before batch_draw_tracking().  Add a helper to assert
this fact.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>
2023-02-22 21:26:27 +00:00
Rob Clark
ea9d1cfb20 freedreno/a6xx: Fix sampler view rsc_seqno for X32_S8X24
Elsewhere we are comparing it against the seqno for the "primary" z32
buffer, so be consistent.  Otherwise we'll think we need to re-validate
every time the sampler view is bound.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>
2023-02-22 21:26:27 +00:00
Rob Clark
b40e3c9e6c freedreno/a6xx: Drop unneed fd6_texture_state() arg
It is redundant with shader type (stage).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>
2023-02-22 21:26:27 +00:00
Rob Clark
29445505f6 freedreno/a6xx: Fix set_sampler_views(start != 0)
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>
2023-02-22 21:26:27 +00:00
Rob Clark
a3c73987ab freedreno/a6xx: Move rsc seqno out of tex cache key
Since we invalidate tex cache entries if an associated pipe_resource is
rebound, we don't rely on the rsc_seqno being part of the tex cache key.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21408>
2023-02-22 21:26:27 +00:00
Rhys Perry
94abccf3ce aco: fix pathological case in LdsDirectVALUHazard
Similar to bfd4ac4581.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Fixes: 296b4d95a3 ("aco/gfx11: workaround LdsDirectVALUHazard")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21423>
2023-02-22 20:46:12 +00:00
Georg Lehmann
ee47cc8256 amd,nir: remove byte_permute_amd intrinsic
It's unused and if we ever want to use it again we should make it an alu
opcode instead.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21445>
2023-02-22 20:13:52 +00:00
Eric Engestrom
e316416dd0 docs: include explicit setup in instructions
The implicit `meson builddir/` is deprecated, and while we have fixed
our scripts, we forgot to update the docs we give our users ^^'

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21468>
2023-02-22 20:07:16 +00:00
Pierre-Eric Pelloux-Prayer
a502f4fc13 radeonsi/video: use specific PIPE_BIND_ value for video buffers
Since 13cb41f666 PIPE_BIND_SHARED was used to allocate driver internal
video buffers. These buffers are never shared, but the intent was to
get non-suballocated buffers and SHARED was used as an indirect flag.

This commit switches to PIPE_BIND_CUSTOM which isn't used anywhere else,
and is now translated as "no suballocation".

The main benefit here is that this allows these buffers to set
use_reusable_pool to true reducing the CPU overhead a lot.

For instance, running the following command on my system:

   ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi \
       -i tears_of_steel_1080p.mov -an -c:v h264_vaapi output.mp4

takes 35 sec with this commit vs 45 sec without.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21416>
2023-02-22 18:30:28 +00:00
Chia-I Wu
635d62ba99 mesa: use mesa_log from output_if_debug
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>
2023-02-22 17:55:40 +00:00
Chia-I Wu
f18f43338e mesa: add missing newlines for _mesa_debug/_mesa_log callers
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>
2023-02-22 17:55:40 +00:00
Chia-I Wu
40e45eaef0 util/log: add logger_windbg
Because output_if_debug has it.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>
2023-02-22 17:55:40 +00:00
Chia-I Wu
8f0a7e848f util/log: add support for MESA_LOG_FILE
It allows logger_file to log to any file.

v2: check "geteuid() == getuid()"

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>
2023-02-22 17:55:40 +00:00
Chia-I Wu
7d8d64426b util/log: add logger_syslog
This is useful when the app is a daemon.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>
2023-02-22 17:55:40 +00:00
Chia-I Wu
bbd19527c1 util/log: improve logger_android
Avoid __android_log_vprint which can truncate messages.  Also add
MESA_LOG=wait to lower the chance of logger_android dropping messages.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>
2023-02-22 17:55:40 +00:00
Chia-I Wu
7a18a1712a util/log: improve logger_file newline handling
Add logger_vasnprintf that will be used by other loggers.  For
logger_file, it improves newline handling for

  mesa_logd("%s", "hello\n");

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>
2023-02-22 17:55:40 +00:00
Chia-I Wu
63864d4dfc util/log: allow multiple loggers
It still logs to logcat on Android and stderr otherwise by default.
MESA_LOG is introduced to override the loggers.

v2: add va_copy

Reviewed-by: Emma Anholt <emma@anholt.net> (v1)
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>
2023-02-22 17:55:40 +00:00
Chia-I Wu
337d58f6fc util/log: refactor mesa_log
Add logger_file and logger_android.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21454>
2023-02-22 17:55:40 +00:00
Alejandro Piñeiro
dd3b67b974 v3dv: handle ASPECT_MEMORY_PLANE aspect flags when getting plane number
As we support VK_EXT_image_drm_format_modifier, we could receive
VK_IMAGE_ASPECT_MEMORY_PLANE_0/1/2_BIT_EXT flags.

Fixes several tests like this:
dEQP-VK.drm_format_modifiers.create_explicit_modifier.*

when using CTS 1.3.5.0

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21463>
2023-02-22 16:27:43 +00:00
Sebastian Wick
f4ce19063c loader: do not check the mesa DRI_Mesa version if it was not found
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
Fixes: 1026d29344 ("dri: Introduce internal Mesa DRI driver loader extension.")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21429>
2023-02-22 15:07:24 +00:00
Karol Herbst
6e666c6303 nir: Skip samplers and textures in lower_explicit_io
We have specialized lowering passes dealing with most of that already:
1. gl_nir_lower_samplers_as_deref
2. nir_lower_samplers
3. nir_lower_cl_images

If we need more than that, those passes can deal with following deref
chains as well.

We _might_ need to improve nir_lower_cl_images a bit for more complex
kernels, but CL also doesn't allow indirect images, so we are always able
to optimize the entire deref chain away.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20161>
2023-02-22 14:20:21 +00:00
Karol Herbst
186a22712f rusticl: allocate printf buffer as staging
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20161>
2023-02-22 14:20:21 +00:00
Karol Herbst
3abbeed74f rusticl: no compute only
This might be a good optimization, but we should figure first what drivers
should be able to disable and what not first.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20161>
2023-02-22 14:20:21 +00:00
Karol Herbst
ced9d5d635 rusticl/device: limit CL_DEVICE_MAX_CONSTANT_ARGS
At the moment we implement constant memory as normal global memory, but
we still should limit to the actual constant buffer cap once we properly
use UBOs for that.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20161>
2023-02-22 14:20:21 +00:00
Karol Herbst
bbea8761c2 rusticl/device: fix some device limits
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20161>
2023-02-22 14:20:21 +00:00
Karol Herbst
188c0d7c8f llvmpipe/ci: increase deqp-runner timeout
Some of the OpenCL tests are flaky, because they just take that long.
Builtins can generated really complex code and if we are unlucky they can
timeout.

Proper support for functions would also solve the issue, probably, but for
now increase the deqp-runner timeout so it's less of an annoyence.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20161>
2023-02-22 14:20:21 +00:00
Samuel Pitoiset
7f2775bc8a radv/ci: cleanup CI lists for dEQP-VK.memory.* tests that timeout
These tests usually take more than 30s to complete, so exclude them
completely instead. This should also make runs slightly faster.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21464>
2023-02-22 13:25:13 +00:00
Eric Engestrom
2809bb8499 broadcom/ci: re-enable egl on wayland
Swap them, as suggested by @enunes, to avoid a ton of timeouts in
wayland if the x11 tests ran first.

Needs to be investigated, but at least like this we can get the CI
coverage back.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21453>
2023-02-22 12:59:04 +00:00
Eric Engestrom
67b2f48645 broadcom/ci: add two known failures
The first one in a Pass on both the rpi and the simulator, while the second
one is skipped as NotSupported on both. No idea why it's failing on the
CI, but at least it's consistently failing...

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21453>
2023-02-22 12:59:04 +00:00
Eric Engestrom
50361c71f4 broadcom/ci: skip buffer_age.no_preserve and swap_buffers_with_damage on wayland
They hang the runner, but they all pass fine on my rpi.
Will need investigating, but for now skip them.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21453>
2023-02-22 12:59:04 +00:00
Eric Engestrom
d01fded429 broadcom/ci: drop create_pixmap_surface from the fails; it passes now
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21453>
2023-02-22 12:59:04 +00:00
Eric Engestrom
ccc61357d5 broadcom/ci: add x11- prefix to x11 EGL tests
Makes things more obvious now that we're enabling wayland as well.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21453>
2023-02-22 12:59:04 +00:00
Erik Faye-Lund
176add76ad zink: get rid of needless dependency
We haven't needed this header since 7f56fd9655 ("zink: it's kopperin'
time"), so let's get rid of it and the dependency that comes with it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21441>
2023-02-22 12:23:39 +00:00
Erik Faye-Lund
e02cdb397e zink: prefer vulkan_core.h over vulkan.h
There's just two places where we need any of the WSI specific vulkan
includes, the rest of Zink should do just fine with vulkan_core.h. So
let's include the win32-specific header explicitly in those two places,
and reduce the need for WSI specifics inside zink itself. Kopper
handles the rest of the WSI integration.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21441>
2023-02-22 12:23:39 +00:00
Konstantin Seurer
6242fe3923 anv: Use vk_acceleration_structure
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21047>
2023-02-22 11:58:57 +00:00
Konstantin Seurer
4d2a7ea146 radv: Use vk_acceleration_structure
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21047>
2023-02-22 11:58:57 +00:00
Konstantin Seurer
eb33a1adb0 vulkan: Add vk_acceleration_structure
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21047>
2023-02-22 11:58:57 +00:00
Sui Jingfeng
1ba3e83958 meson: add basic support for loongarch
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21182>
2023-02-22 09:09:43 +00:00
Samuel Pitoiset
1583b150d6 radv: set VS_OUT_MISC_SIDE_BUS_ENA for clip distances on GFX10.3+
On GFX10.3, all auxiliary position exports are optimized, so set it
for clip/cull distances. Both RadeonSI and llpc set it too.

Suggested by Marek.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21439>
2023-02-22 07:17:33 +00:00
Mike Blumenkrantz
50a65e2e2b driconf: add zink glthread disable for a game
ref #8333

fixes #8328

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21424>
2023-02-22 03:22:50 +00:00
Mike Blumenkrantz
e375fb0c5c zink: make ZINK_DESCRIPTOR_MODE=db the default
this has been getting beat up a lot lately by radv ci (and me),
so it should be ready to turn on by default for even more testing
in advance of the 23.1 release

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21398>
2023-02-22 02:58:19 +00:00
Mike Blumenkrantz
685bd95de9 zink: move db input attachment size check to screen init
it'd be weird to crash later on after allowing db mode to init

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21398>
2023-02-22 02:58:19 +00:00
Danylo Piliaiev
e6f5480180 ir3: Add cat7 sleep instruction
Has short and long variants, long seem to be ~20 times longer.
The exact difference between it and a bunch of nops is unknown.

The emission of this instruction were not observed in the wild.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14419>
2023-02-21 19:59:14 +00:00
Danylo Piliaiev
121e4ca87d ir3: Add cat5/cat7 cache related instructions
- tcinv - Likely Texture Cache Invalidate (unverified)
- icinv - Mostly sure that it is Instruction Cache Invalidate
- dccln - Data Cache Clean
- dcinv - Data Cache Invalidate
- dcflu - Data Cache Flush

The emission of these instructions were not observed in the wild.

TODO: find out the difference between .shr and .all modes of
      dccln, dcinv, dcflu.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14419>
2023-02-21 19:59:14 +00:00
Sviatoslav Peleshko
42dba8ebc5 driconf/anv: Apply limit_trig_input_range WA to Rise of the Tomb Raider
During its Ambient Occlusion calculations the game ends up calculating
sin/cos of some pretty big values, for which HW produces completely bogus
results (e.g. cos(3929491.25) ~= -0.011, while correct would be ~0.923).

Limit the arguments to the reasonable (-2*Pi; 2*Pi) range with the
limit_trig_input_range WA.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8292
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21396>
2023-02-21 19:23:28 +00:00
Mike Blumenkrantz
b43d32b77d kopper: fix loop iterating for msaa texture creation
the pipe_resource template values need to always be initialized or
else texture creation fails and rendering is broken

fixes #8331

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21450>
2023-02-21 18:57:52 +00:00
Charmaine Lee
1b9b060f0e svga: use upload buffer if texture has pending changes
When establishing a texture transfer map, if there is any pending changes on the
texture, instead of trying direct map with DONTBLOCK first, just
use the upload buffer path.

Fixes piglit tests gen-teximages, arb_copy_images-formats

Cc: mesa-stable

Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21393>
2023-02-21 09:48:23 -08:00
Charmaine Lee
3a359385cb svga: fix compatible formats for shareable surfaces
Add typeless format to the compatible format lists for shareable surfaces.

Fixes webgl benchmark crash in eglCreateImage running from firefox on Fedora 37.

Cc: mesa-stable

Reviewed-by: Martin Krastev <krastevm@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21393>
2023-02-21 09:48:23 -08:00
Charmaine Lee
75b7296fc3 svga: fix resource_get_handle from resource created without SHARED bind flag
When an EGLImage is created from a 2D texture and used for texture sharing,
the texture surface might not have been created with the SHARED bind flag.
To allow these surfaces for sharing, this patch sets the USAGE SHARED bit
for surfaces that can be potentially used for sharing even when the SHARED
bind flag is not originally set. Instead of unconditionally enabling the
SHARED bind flag for all surfaces and unnecessarily bypass the surface cache
optimization, this patch only enables the USAGE SHARED bit for surfaces
that also have the RENDER TARGET bind flag.
When the surface handle is inquired and if the surface is currently
marked as cachable, we will need to unset the cachable bit so
the surface handle will not be recycled again.

This patch fixes an assertion in svga_resource_get_handle() when the
EGL_MESA_image_dma_buf_export extension is used in webgl benchamrk running
from firefox in Fedora 37.

Cc: mesa-stable

Reviewed-by: Martin Krastev <krastevm@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21393>
2023-02-21 09:48:23 -08:00
Roland Scheidegger
427ac51c10 llvmpipe: only use accurate_a0 hack if there are no textures bound
This hack caused problems with some dx9 tests before (due to mipgen
test using nearest filter sampling with tex coords exactly between two
texels hence being extremely sensitive to arithmetic inaccuracies),
and we can no longer distinguish this by using pixel_offset to not get
it enabled. But to pass other tests we don't really need the hack when
there's texture sampling involved anyway.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21407>
2023-02-21 17:15:34 +00:00
Eric Engestrom
9390766b83 broadcom/ci: use weston's xwayland instead of starting X as well
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21449>
2023-02-21 16:50:54 +00:00
Eric Engestrom
5425064c53 broadcom/ci: group x11 and wayland variant of the same test failing
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21449>
2023-02-21 16:50:54 +00:00
Konstantin Seurer
af19762935 radv/rt: Skip instances after loading the entire node
This avoids waiting for instance_data which can improve performance:

vk_ray_tracing_ao_KHR_app: 0.2% (The TLAS has 2 instances)
Quake II RTX: 1%
Control: 1%

We also have to shuffle around some code to avoid increasing VGPR usage.
That leaves us with the following stats:

Quake II RTX:
Totals from 7 (14.29% of 49) affected shaders:
CodeSize: 165612 -> 165716 (+0.06%)
Instrs: 31446 -> 31460 (+0.04%)
Latency: 596709 -> 554292 (-7.11%)
InvThroughput: 121998 -> 113327 (-7.11%)
VClause: 596 -> 587 (-1.51%)
Copies: 4664 -> 4646 (-0.39%)
PreVGPRs: 620 -> 639 (+3.06%)

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21421>
2023-02-21 15:51:14 +00:00
Rhys Perry
ab3184c0a2 aco: don't apply modifiers through DPP to unsupported instructions
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/21201>
2023-02-21 14:59:38 +00:00
Georg Lehmann
3bd5b583f9 aco: combine a ^ ~b and ~(a ^ b) to v_xnor_b32
Foz-DB Navi21:
Totals from 13 (0.01% of 134913) affected shaders:
CodeSize: 225432 -> 225180 (-0.11%)
Instrs: 41973 -> 41908 (-0.15%)
Latency: 297464 -> 297326 (-0.05%)
InvThroughput: 82536 -> 82467 (-0.08%)
Copies: 2452 -> 2440 (-0.49%)

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21410>
2023-02-21 13:35:31 +00:00
Illia Abernikhin
dea36fce6a util: Extend vk_enum_to_str with bitmasks
vk_enum_to_str only generates literals for enums with type: @type="enum",
but many enums have type: @type="bitmask" and were not taken into account here.

Main changes:
Empty enums are now always skipped
For bitmasks skipped *MAX_ENUM value

Signed-off-by: Illia Abernikhin <illia.abernikhin@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8173
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21146>
2023-02-21 13:59:19 +02:00
Marcin Ślusarz
e29a964d02 intel/compiler/mesh: follow the type of offset variable
This allows copy propagation to kick in, decreasing the overall
number of generated instructions.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21098>
2023-02-21 11:10:24 +00:00
Marcin Ślusarz
15afb8dcc6 intel/compiler/mesh: apply URB payload mask once per program
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21098>
2023-02-21 11:10:23 +00:00
Daniel Schürmann
93a47bab04 nir: simplify nir_block_cf_tree_{next|prev}
Removes some case distinction by first checking if this is
the first/last block of a cf_node.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>
2023-02-21 10:41:11 +00:00
Daniel Schürmann
2e394b5cc1 nir/lower_continue_targets: only repair SSA when necessary
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>
2023-02-21 10:41:11 +00:00
Daniel Schürmann
7fba5abfd7 nir/lower_continue_constructs: special-case Continue Constructs with zero or one predecessors
If a loop has only a single continue, the control flow is already
converged and we can inline the continue construct.
If a loop has no continue statement at all, the Continue Construct
is unreachable and can simply be deleted.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>
2023-02-21 10:41:11 +00:00
Daniel Schürmann
f42eb71df9 spirv: use Loop Continue Construct to emit SPIR-V loops and lower after parsing
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>
2023-02-21 10:41:11 +00:00
Daniel Schürmann
c20751d61d nir: add lowering for Loop Continue Constructs
This pass lowers Loop Continue Constructs to the previous solution
by inserting it at the beginning of the loop:

loop {
   if (i != 0) {
      continue construct
   }
   loop body
}

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>
2023-02-21 10:41:11 +00:00
Daniel Schürmann
312510448f nir: create nir_push_continue() and related helpers
nir_control_flow.h:
  void nir_loop_add_continue_construct(nir_loop *loop);
  void nir_loop_remove_continue_construct(nir_loop *loop);

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>
2023-02-21 10:41:11 +00:00
Daniel Schürmann
2bb369dd8d nir: add assertions that loops don't have a Continue Construct
Hoping that I didn't miss any, this *should* add assertions
to all functions and passes which explicitly handle 'nir_loop'.

Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>
2023-02-21 10:41:11 +00:00
Daniel Schürmann
d4b97bf3fa nir: add Continue Construct to nir_loop
The added continue_list corresponds to the SPIR-V
Continue Construct and serves as a converged control-flow
construct and is executed after each continue statement
and before the next iteration of the loop body.

Also adds validation rules for loops with Continue Construct

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13962>
2023-02-21 10:41:11 +00:00
Caio Oliveira
e0c6ad1ce5 glsl: Account for unsized arrays in NIR linker
Follow the same approach as the pre-NIR linker.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5891
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21401>
2023-02-21 09:08:18 +00:00
Gert Wollny
10f8240caf zink/kopper: Add extra swapchain images for Venus
Together with the previous patch that corrects the number of
swapchain images on Xwayland this gives Zink/Venus a spead
boost in a number of work loads and close the gap or even
surpass VirGL when the benchmark is not GPU bound.
Some numbers:

 zink (Virtio-GPU Venus (Host: RADV RENOIR)) / VirGL

 Benchmark                   VirGL    baseline  Zink/Venus +1
                                                and Xwayland +1
    ==================================================================
    OpenArena (FPS)            63.8     60.1     148.5
    Unigine Sancuary (FPS)    129.1    121.4     164.7
    Unigine Tropics (FPS)     107.2     85.7     114.3
    Unigine Heaven (FPS)       48.5     48.0      51.5
    Unigine Valley (FPS)       48.0     45.6      47.4
    Xonotic (FPS)              90.5     59.4      89.2
    GpuTest/Volcano (Points)   2960     2966      3013

  zink (Virtio-GPU Venus (Host: Intel Xe TGL GT2)) / VirGL

 Benchmark                   VirGL    baseline  Zink/Venus +1
                                                and Xwayland +1
    ===========================================================
    OpenArena (FPS)          95.1       59.8        78.9
    Unigine Sancuary (FPS)   85.5       76.6        81.8
    Unigine Tropics (FPS)    66.0       59.8        62.7
    Unigine Heaven (FPS)     28.8       28.7        28.0
    Unigine Valley (FPS)     29.0       28.0        27.0
    Xonotic (FPS)            64.2       49.4        51.1
    GpuTest/Volcano (Points) 2855       2718        2747

v2: Fix limiting minImageCount (Mike)

Signed-off-by: Gert Wollny <gert.wollny@collabora.co.uk>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21136>
2023-02-21 08:43:30 +00:00
Gert Wollny
04d654a5d0 vulkan/wsi: Take Xwayland into account for x11_min_image_count
For wayland we report a minimum of four swapchain images, so for
Xwayland we should report the same.

v2: Fix typo (Eric)
v3: Make that four images on Xwayland (Daniel)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21136>
2023-02-21 08:43:30 +00:00
Alyssa Rosenzweig
23ec0d6bb2 asahi: Make shader-db work again
We need a nontrivial blend state otherwise the whole frag shader is optimized
out.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21432>
2023-02-21 08:24:58 +00:00
Alyssa Rosenzweig
029c686c6d asahi: Implement color masks with masked stores
Blend states can require masking colour. Currently, this is handled by
nir_lower_blend, which lowers masks to a read-modify-write operation as required
on Mali hardware. However, our "tilebuffer store" instruction supports a write
mask, allowing us to write only a subset of channels to the tilebuffer. It's
more efficient to use that than to emit pointless tilebuffer loads.

Note that even without tilebuffer loads, non-opaque masks don't work with opaque
pass types.  Here, we handle this with a translucent pass type, which gets HSR
to do the right thing and is consistent with the pass type used previously.
However, it's a bit heavy handed -- Apple manages to use an opaque pass type
with masking but with some unknown HSR fields twiddled. IMO reverse-engineering
those details shouldn't block this because this gets us closer to optimal (just
not all the way there) and is strictly better than what we had before.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21431>
2023-02-21 08:10:15 +00:00
Alyssa Rosenzweig
3084e6e689 agx: Add agx_internal_format_supports_mask helper
Not all formats can be masked, add a query to check which can be.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21431>
2023-02-21 08:10:15 +00:00
Alyssa Rosenzweig
5e031867fe agx: Handle ssa_undef as zero
Masked stores may result in undefs after optimization. Rather than call
lower_undef_to_zero late (but get no benefit), we may as well handle ourselves
to prepare for proper undef support down the line.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21431>
2023-02-21 08:10:15 +00:00
Alyssa Rosenzweig
eab4d6a96f agx: Add and use agx_nir_ssa_index helper
Common subexpression that we'll repeat once more in the next patch.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21431>
2023-02-21 08:10:15 +00:00
Samuel Pitoiset
ad459054ed radv: enable SQTT tracing on GFX11
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20338>
2023-02-21 07:28:49 +00:00
Samuel Pitoiset
dfa9b5d624 radv: disable SPM counters with RGP on GFX11
They are likely different and perfcounters aren't defined on GFX11 yet.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20338>
2023-02-21 07:28:49 +00:00
Samuel Pitoiset
5fe48baad6 radv: implement a workaround for SQTT on GFX11
Found in AMDVLK, see the comment below for an explanation.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20338>
2023-02-21 07:28:49 +00:00
Samuel Pitoiset
826ae89ba6 radv: make sure to wait for the trace buffer also on GFX11
Otherwise, we might get incomplete data.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20338>
2023-02-21 07:28:49 +00:00
Samuel Pitoiset
c2bc4aff54 radv: only enable SQTT for SE0 on GFX11
For weird reasons, the hardware doesn't return any data for other SEs.
RadeonSI is also affected by the same issue, enable only SE0 for now.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20338>
2023-02-21 07:28:49 +00:00
Samuel Pitoiset
ad4ad2ba84 radv: configure SQ_THREAD_TRACE_CTRL.REG_AT_HWM on GFX11
AMDVLK sets this to 2 when the always stall mode is enabled, which is
the default in RADV.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20338>
2023-02-21 07:28:49 +00:00
Jan Beich
8bc78e8eb9 util/u_process: implement util_get_command_line for BSDs
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21052>
2023-02-20 21:26:49 +00:00
Pierre-Eric Pelloux-Prayer
923758a5c2 winsys/amdgpu: use amdgpu_device_get_fd
If radv is initialized before radeonsi, doing:

   aws->fd = fd;

is incorrect because the device was initialized using the fd
passed by radv.

libdrm has a helper to query the fd used to create the device,
so use it.

We also need to init the kms_handles table in this case
because we're going to share BOs between radeonsi's fd and
the device fd.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3424
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20983>
2023-02-20 20:38:17 +00:00
Amber
919c5568bf freedreno: check for conditional rendering in launch_grid
fixes: KHR-GL45.compute_shader.conditional-dispatching

Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21428>
2023-02-20 19:03:25 +00:00
Alyssa Rosenzweig
e93a221024 agx: Handle group_memory_barrier
A combination of control_barrier + memory_barrier but it's always seen with
those. This would be safer with scoped barriers...

Fixes dEQP-GLES31.functional.synchronization.inter_invocation.ssbo

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>
2023-02-20 18:50:40 +00:00
Alyssa Rosenzweig
e9cec96633 agx: Implement b2b32
Shows up with store_shared.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>
2023-02-20 18:50:40 +00:00
Alyssa Rosenzweig
955797bb00 agx: Pack local atomics
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>
2023-02-20 18:50:39 +00:00
Alyssa Rosenzweig
14f546726e agx: Lower shared memory offsets to 16-bit
Per the hardware requirement. This simplifies instruction selection (it avoids
the need to constant fold u2u16 in the backend).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>
2023-02-20 18:50:39 +00:00
Alyssa Rosenzweig
a21f6f8cb0 agx: Translate load/store_shared
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>
2023-02-20 18:50:39 +00:00
Alyssa Rosenzweig
f8b9dfbbad agx: Translate NIR atomics
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>
2023-02-20 18:50:39 +00:00
Alyssa Rosenzweig
2a021b1818 agx: Pack local load/store instructions
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>
2023-02-20 18:50:39 +00:00
Alyssa Rosenzweig
96904f83b4 agx: Pack global atomics
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>
2023-02-20 18:50:39 +00:00
Alyssa Rosenzweig
eea3674f36 agx: Disallow immediate bases to device_load
Lina pointed this out in review.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>
2023-02-20 18:50:39 +00:00
Alyssa Rosenzweig
6b0ef2b462 agx: Model local loads/stores
Aka shared memory or threadgroup memory.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>
2023-02-20 18:50:39 +00:00
Alyssa Rosenzweig
0d07d27173 agx: Model atomic instructions
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21326>
2023-02-20 18:50:39 +00:00
José Roberto de Souza
ec7584130f iris: Export num_fences()
This function will be needed by i915 and Xe backends.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21389>
2023-02-20 18:29:47 +00:00
José Roberto de Souza
780dd291c5 iris: Export update_batch_syncobjs()
This function will be needed by i915 and Xe backends.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21389>
2023-02-20 18:29:47 +00:00
José Roberto de Souza
102e180d0f iris: Export batch debug functions
Those function will be called by different backends, so exporting it.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21389>
2023-02-20 18:29:47 +00:00
Alyssa Rosenzweig
9e67d3f237 asahi: Advertise ARB_texture_barrier
We already implement it.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21264>
2023-02-20 17:27:21 +00:00
Alyssa Rosenzweig
5f8a59ac89 asahi: Advertise ARB_derivative_control
Our native fddx instruction is already fine, so it's fine to use it for both
fddx_coarse and fddx_fine. We handle both of those cases already so the
extension is trivial.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21264>
2023-02-20 17:27:21 +00:00
Alyssa Rosenzweig
c6c61d052e docs/features: Sync Asahi with reality
A few features were either missed in the original patch or have since been
added, update features.txt to light up more green on the mesa matrix.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21264>
2023-02-20 17:27:21 +00:00
Alyssa Rosenzweig
cf96edff1c agx: Implement gathers (nir_texop_tg4)
Passes dEQP-GLES31.functional.texture.gather.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21264>
2023-02-20 17:27:21 +00:00
Alyssa Rosenzweig
978d3fefa8 agx: Model and pack gathers
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21264>
2023-02-20 17:27:21 +00:00
Alyssa Rosenzweig
8dc861dbb5 agx: Lower offsets in NIR
Rather than the backend. This way we can handle non-constant offsets as well as
constants with a single code path (with the constant offset code subsumed as a
special case via NIR's constant folding). This nets us dynamic offset support.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21264>
2023-02-20 17:27:21 +00:00
David Heidelberg
a5dfee1c22 ci: revert download of git cache to the wget
At this point of CI there is not curl available.

Fixes: 796686af1b ("ci: migrate from wget to curl")

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21414>
2023-02-20 13:48:32 +00:00
Simon Perretta
44f40ff941 pvr: Use descriptor/set/table offsets from driver
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Co-Authored-By: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Acked-by Frank Binns <frank.binns@imgtec.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21331>
2023-02-20 13:34:03 +00:00
Simon Perretta
e64288a0ba pvr: Split pvr_private.h
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by Frank Binns <frank.binns@imgtec.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21331>
2023-02-20 13:34:03 +00:00
Simon Perretta
5694755fa0 pvr: Load descriptors from memory
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by Frank Binns <frank.binns@imgtec.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21331>
2023-02-20 13:34:03 +00:00
Simon Perretta
3355749105 pvr: Support loading immediate values
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by Frank Binns <frank.binns@imgtec.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21331>
2023-02-20 13:34:03 +00:00
Simon Perretta
e0e58e9659 pvr: Additional register subarray support
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by Frank Binns <frank.binns@imgtec.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21331>
2023-02-20 13:34:03 +00:00
Simon Perretta
888e06b8cc pvr: Add bitwise instruction support
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by Frank Binns <frank.binns@imgtec.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21331>
2023-02-20 13:34:02 +00:00
Simon Perretta
93fa2f6265 pvr: Add memory load support
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by Frank Binns <frank.binns@imgtec.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21331>
2023-02-20 13:34:02 +00:00
Simon Perretta
81f86a559c pvr: Add ADD64 support
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by Frank Binns <frank.binns@imgtec.comr>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21331>
2023-02-20 13:34:02 +00:00
Karmjit Mahil
7386342a19 pvr: Add PVR_SELECT() helper macro
For pvr_setup_descriptor_mappings_new() there will be quite a few
variables of which the value depend on the stage so rather than
having all that selection in the `switch` at the beginning of the
function the helper macro provides a compact selection in the
desired scope.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21331>
2023-02-20 13:34:02 +00:00
Karmjit Mahil
ce67f5ac94 pvr: Write descriptor set addrs table dev addr into shareds
Previously UBOs and various buffers, as well as the native
descriptor sets were DMAed into the shared registers. This added
complexity in allocating the registers and various other places.
We also ended up being in situations were we wouldn't know the size
of a buffer by the time the shaders were being compiled. It would
be possible to determine the size by inspecting the shader but
that would introduce more complexity in the compiler.
To get things working sooner, avoid extra complexity for
now, a different approach was devised.

The driver will write the addresses of the currently bound
descriptor sets into a device buffer. The device buffer is referred
to as the descriptor set addrs table. The dev addr of the table is
written into a shared register. To access the buffers the shader
will first get the address of the descriptor set from the in memory
table. Then get the primary descriptor from the descriptor set. And
finally access the in memory buffer with the address it read from
the descriptor. Essentially there's three level of indirection and
all the buffers are in memory. The shader will know what offset the
primary descriptor is located based on the descriptor set layout.
The descriptor set address could have been written into the shareds
directly but that would require extra handling on the compiler side
so opted to just write the table address instead.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21331>
2023-02-20 13:34:02 +00:00
Karmjit Mahil
d67ed3eb24 pvr: Change last_DMA to last_dma
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21331>
2023-02-20 13:34:02 +00:00
Karmjit Mahil
5405277b38 pvr: Put old descriptor set approach behind a hardcoding check
This commit sets up the infrastructure to introduce the new
descriptor set approach while keeping the old paths so the
hard coded apps are still operational. The old paths will be
removed once the compiler can compiler shaders for those apps
and the driver-compiler interface is fully flushed out.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21331>
2023-02-20 13:34:02 +00:00
Karmjit Mahil
b7f8a120bf pvr: Store enum pvr_stage_allocation instead of VkShaderStageFlags
This commit changes the pipeline layout, desc. set layout,
and desc. set layout binding to keep track of shader stage usage
with a mask of enum pvr_stage_allocation instead of
VkShaderStageFlags.

This commit also makes renames the relevant fields to
'shader_stage_mask' to make the naming uniform across stucts.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21331>
2023-02-20 13:34:02 +00:00
Samuel Pitoiset
15f1478eb9 radv/ci: move CI lists for external GPUs in separate folder
A bunch of CI lists are maintained by ourselves with GPUs outside of
Mesa CI. Move them to a separate folder to avoid confusion.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21417>
2023-02-20 13:05:50 +00:00
Samuel Pitoiset
f334704078 radv/ci: disable vkcts-kabini-valve
It's no longer reachable.

Suggested-by: Martin Roukala <martin.roukala@mupuf.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21417>
2023-02-20 13:05:50 +00:00
Alyssa Rosenzweig
dee4784e53 asahi: Fix rendering into mipmapped framebuffers
batch->key.width will be minified, but then the PBE::level field will
incorrectly minify again.

Fixes dEQP-GLES31.functional.shaders.framebuffer_fetch.basic.framebuffer_texture_level

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21400>
2023-02-20 11:47:56 +00:00
Alyssa Rosenzweig
0e0825013d agx: Do more work in agx_preprocess_nir
agx_preprocess_nir runs once per shader, whereas agx_optimize_nir runs once per
variant. That means we want to do as much work as possible in agx_preprocess_nir
to make shader variants as cheap as possible to compiler. So, move our standard
suite of lowering and optimizing to the preprocess loop, leaving just a single
(easy) trip through the optimizer for simple variant processing.

Plus, we can remove variables when preprocessing, since we no longer use
variables anywhere. We remove them to reduce the RAM and disk cache footprint of
shader variants.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21104>
2023-02-20 11:34:58 +00:00
Alyssa Rosenzweig
5b92bd99db agx: Don't treat clip distances specially
We've been using the clip lowering, but it's been broken upstream because of
this artefact from the (non-lowered implementation) sneaking in from downstream.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21104>
2023-02-20 11:34:58 +00:00
Asahi Lina
99a6afd1a6 asahi: Only apply FS lowerings to fragment shaders
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21104>
2023-02-20 11:34:58 +00:00
Alyssa Rosenzweig
2adea481f1 asahi: Move agx_preprocess_nir to CSO create
Now we preprocess shaders once at link time, rather than every time we spawn a
variant. This should reduce variant pain.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21104>
2023-02-20 11:34:58 +00:00
Alyssa Rosenzweig
4495f85b08 asahi: Lower clip distances late
This pass works either early or late, so run it late. It creates some
nir_variables as a side effect, which is weird, but it doesn't matter because
the AGX backend doesn't look at variables and the metadata and lowered I/O
intrinsics are all correct.

This is the last step to moving I/O lowering (and hence shader preprocessing) to
CSO create time.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21104>
2023-02-20 11:34:58 +00:00
Eric Engestrom
59c64d90e2 docs/release-calendar: drop the last 22.2.x, it won't happen
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21415>
2023-02-20 11:28:30 +00:00
Samuel Pitoiset
04c45b91a4 zink/ci: set RADV_PERFTEST=gpl for RADV jobs
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21329>
2023-02-20 11:05:26 +00:00
Samuel Pitoiset
6ec392ab4f zink/ci: skip KHR-GL46.texture_swizzle.functional with RADV
They usually timeout.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21329>
2023-02-20 11:05:26 +00:00
Samuel Pitoiset
cd1f1990a7 ci: uprev vkd3d-proton
This adds test coverage for VK_EXT_image_sliced_view_of_3d.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21384>
2023-02-20 09:17:25 +00:00
Iago Toral Quiroga
1c028a4d5b v3d: support r{g,gba}16f formats for vertex buffers
These are supported, and in fact we are exposing them through
Vulkan. Makes SuperTuxKart significantly faster in GL, I've
observed an FPS increase from ~100% to ~500% depending on the
track.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21361>
2023-02-20 07:45:58 +00:00
Yusuf Khan
689a0c4d4e gallium: create query_memory_info implementation for sw drivers
For ATI_meminfo or NVX_gpu_memory_info on llvmpipe and softpipe.

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21373>
2023-02-20 04:26:28 +00:00
Kenneth Graunke
96ba0344db intel: Use common helpers for TCS passthrough shaders
Rob added these new helpers a while back, which freedreno and radeonsi
both share.  We should use them too.  The new helpers use variables and
system value intrinsics, so we can drop the explicit binding table
creation and just use the normal paths.

Because we have to rewrite the system value uploading anyway, we drop
the scrambling of the default tessellation levels on upload, and instead
let the compiler go ahead and remap components like any normal shader.
In theory, this results in more shuffling in the shader.  In practice,
we already do MOVs for message setup.  In the passthrough shaders I
looked at, this resulted in no extra instructions on Icelake (SIMD8
SINGLE_PATCH) and Tigerlake (8_PATCH).  On Haswell, one shader grew by
a single instruction for a pittance of cycles in a stage that isn't a
performance bottleneck anyway.  Avoiding remapping wasn't so much of an
optimization as just the way that I originally wrote it.  Not worth it.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20809>
2023-02-20 03:54:24 +00:00
Timothy Arceri
3a9edfc494 glsl: isolate object macro replacments
Here we use a leading space to isolate them from
the code they will be inserted into. For example:

    #define VALUE -1.0
    int a = -VALUE;

Should be evaluated to int a = - -1.0; not int a = --1.0;

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7932

Cc: mesa-stable
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21352>
2023-02-20 01:50:05 +00:00
Timothy Arceri
6e29dce291 glsl: add _token_list_prepend() helper to the parser
This will be used in the following patch.

Cc: mesa-stable
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21352>
2023-02-20 01:50:05 +00:00
Timur Kristóf
2c40215ab9 aco/optimizer: Change v_cmp with subgroup invocation to constant.
When a shader has a comparison with the subgroup invocation id,
we can use a constant instead, saving a VALU instruction.
When the constant can't be represented as a 64-bit literal,
use the s_bfm_b64 instruction to generate it instead, which
is still a win.

Fossil DB stats on GFX11:
Totals from 300 (0.22% of 134913) affected shaders:
CodeSize: 2223052 -> 2214336 (-0.39%); split: -0.43%, +0.04%
Instrs: 430216 -> 429882 (-0.08%); split: -0.14%, +0.06%
Latency: 5881180 -> 5878181 (-0.05%); split: -0.05%, +0.00%
InvThroughput: 731846 -> 729293 (-0.35%)
Copies: 31662 -> 31847 (+0.58%); split: -0.03%, +0.61%
Branches: 8241 -> 8100 (-1.71%)
PreVGPRs: 15788 -> 15786 (-0.01%)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20843>
2023-02-18 21:16:58 +01:00
Marek Olšák
616d595d18 glthread: don't restore non-VBO vertex arrays after all draws
glthread takes care of all uploads, so it's OK to leave uploaded VBOs
bound. The only thing that will be wrong is the bound vertex buffer
returned by glGet, but the only case when that would be wrong is when
an app that doesn't use VBOs queries the current VBO. That never happens.

However, this adds code to unbind all internal VBOs for the case when
glthread is abruptly disabled (e.g. for GL_DEBUG_OUTPUT_SYNCHRONOUS).

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
201038a80d glthread: don't free glthread for GL_DEBUG_OUTPUT_SYNCHRONOUS, only disable it
and enable it when GL_DEBUG_OUTPUT_SYNCHRONOUS is disabled.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
068670a79a glthread: remove unnecessary debug code
_mesa_glthread_destroy won't be called for GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB,
so the "reason" parameter will be useless.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
cabc08a184 glthread: convert (Multi)DrawIndirect into direct if user buffers are present
so that user buffers are uploaded without syncing.

Now glthread fully handles non-VBO uploads, so that we can disable user
buffer codepaths in st/mesa.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
72b336dbdc glthread: add API to allow passing DrawID from glthread to mesa
This will be needed for lowering DrawIndirect in glthread, which is
needed if non-VBO vertex arrays are present.

This only adds the drawid parameter in glthread's draw_arrays and
draw_elements functions, and implements where needed.

New GL API functions are added because we want to use separate
DISPATCH_CMD_* enums for draws with DrawID, so that we don't increase
the memory footprint of draws in glthread batches if drawid == 0.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
aabca21c7e glthread: handle non-VBO uploads for glMultiModeDraw{Arrays,Elements}IBM
This was unimplemented, and this implementation matches exactly what we do
in main/draw.c.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
8510814528 glthread: don't execute Draw and BufferSubData calls if the context is lost
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
faf476ea4f glthread: inline draw functions that have only one use
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
21ab24acd0 glthread: remove goto statements and add unlikely() into draw functions
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
3b897719e6 glthread: add ctx->GLThread.draw_always_async to simplify draw checking
This just precomputes 3 terms of the condition to draw asynchronously.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
15aaef4d36 glthread: reorder draw code a little
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
50d791ca73 glthread: add a vertex upload path that unrolls indices for glDrawElements
u_vbuf does this too. This is the last big missing piece to stop using
u_vbuf.

If the vertex range to upload is much larger than the draw vertex count and
if all attribs are not in VBOs, convert glDrawElements to glBegin/End.

This is a path that makes the Cogs game go from 1 FPS to ~197 FPS. There is
no change in FPS because u_vbuf does this, but it will be disabled.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
28724de0d7 glthread: track vertex formats for all attributes
We'll need this for a special vertex upload fallback.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
e97d0b318b glthread: don't bind/unbind uploaded indexbuf, pass it to glMultiDraw directly
MultiDrawElementsUserBuf is changed to mean the same thing as
glMultiDrawElementsBaseVertex, but "gl_buffer_object *index_buffer" is
passed via a parameter instead of using the bound GL_ELEMENT_ARRAY_BUFFER.

This skips binding and unbinding the index buffer around every draw
where glthread uploads indices.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
a078374b10 glthread: don't bind/unbind uploaded indexbuf, pass it to glDraw directly
DrawElementsUserBuf is changed to mean the same thing as
glDrawElementsInstancedBaseVertexBaseInstance, but "gl_buffer_object *
index_buffer" is passed via a parameter instead of using the bound
GL_ELEMENT_ARRAY_BUFFER.

This skips binding and unbinding the index buffer around every draw
where glthread uploads indices.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
5c0c0dc5cd glthread: move some draw call parameters closer to their use
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
c2806a836b glthread: don't pass index bounds to the driver for async calls
They are never used with vertex uploads in glthread.
For example, glDrawRangeElements is converted to glDrawElements.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
38efb766d3 glthread: don't execute glDraw code if we're inside glBegin/End
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
07ef2652fe glthread: change glMultiDrawElements to execute draw_count < 0 asynchronously
also clean up the conditions.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
7aff69bcdd glthread: rewrite glMultiDrawArrays to never fail to upload vertices
The main goal is to never fail to upload non-VBO vertex arrays.
When glthread synchronized, it didn't upload vertices, expecting st/mesa
to do that. This keeps the required sync, and then upload vertices
in glthread.

Also, reorder the code and remove goto statements. This is pretty much
a rewrite.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
2023-02-18 09:31:41 -05:00
Marek Olšák
e6231a1320 Revert "ci/zink: Disable Amnesia trace until the linked issue gets fixed."
This reverts commit 2e807a028a.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21039>
2023-02-18 13:40:56 +00:00
Marek Olšák
efb531fcb5 glthread: ignore non-VBO vertex arrays with NULL data pointers
This can happen when an attrib is enabled, but the shader doesn't use it,
so it's ignored by mesa/state_tracker, and should be ignored here as well.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8138

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21039>
2023-02-18 13:40:56 +00:00
Marek Olšák
3ed141e9d8 glthread: add a heuristic to stop locking global mutexes with multiple contexts
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4516
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8035

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21039>
2023-02-18 13:40:56 +00:00
Marek Olšák
78c61140f1 glthread: upload non-BO indices in the core profile to fix GStreamer
Only apply the core profile checking to non-VBO vertices.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7948

Tested-by: Michel Dänzer <mdaenzer@redhat.com>
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21039>
2023-02-18 13:40:56 +00:00
Marek Olšák
2e0cb30bd5 glthread: initialize indices[i] for no-op MultiDrawElements
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21039>
2023-02-18 13:40:56 +00:00
Marek Olšák
e2ad086f48 mesa: ignore indices[i] if count[i] == 0 for MultiDrawElements
Cc: mesa-stable

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21039>
2023-02-18 13:40:56 +00:00
Marek Olšák
55682e958b glthread: track the current element array buffer in the Core profile too
This is a prerequisite for:
    "glthread: upload non-BO indices in the core profile to fix GStreamer"

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21039>
2023-02-18 13:40:56 +00:00
Emma Anholt
37b544e410 hasvk: Fix gfx8/9 VB range > 32bits workaround detection.
Since the dirty range started out as 0..0, you would have 0..VBend as the
new dirty range on the first draw, and if your VB was >32b then you'd
flush every time you used it.  Instead, if there's no existing dirty range
then just set it to our new VB's range.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21370>
2023-02-18 07:25:47 +00:00
Emma Anholt
4cd7976208 anv: Fix gfx8/9 VB range > 32bits workaround detection.
Since the dirty range started out as 0..0, you would have 0..VBend as the
new dirty range on the first draw, and if your VB was >32b then you'd
flush every time you used it.  Instead, if there's no existing dirty range
then just set it to our new VB's range.

Perf results with zink+anv on my CFL:

sauerbraten:       +24.8182% +/- 0.602077% (n=5)
portal-2-v2.trace: +4.64289% +/- 0.285285% (n=5)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21370>
2023-02-18 07:25:47 +00:00
Mike Blumenkrantz
4b5b5bb73c zink: enable renderpass optimizing on lavapipe
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21340>
2023-02-18 03:05:17 +00:00
Brian Paul
5f3f415770 llvmpipe: do additional checks in lp_state_fs_analysis.c for linear shaders
Check if the FS output color comes from an FS input.  If so, don't tag
the shader as linear.  See code comments for more details.

During testing I added extra counters to check the number of times
linear shaders were used to be sure we're not accidentally disallowing
too many shaders.  Things looked good with our in-house mksReplay test
suite.

This fixes some OpenGL CTS test failures with llvmpipe.

Signed-off-by: Brian Paul <brianp@vmware.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7489
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21340>
2023-02-18 03:05:17 +00:00
Eric Engestrom
3b853964c6 broadcom/ci: use deqp-runner to run piglit tests
This is what other jobs are standardizing to.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21297>
2023-02-18 02:33:59 +00:00
Eric Engestrom
9b58bb9d22 broadcom/ci: fold .vc4-rpi3-piglit:armhf into its only user
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21297>
2023-02-18 02:33:59 +00:00
Eric Engestrom
2eb8716be8 broadcom/ci: refactor a bit
Just moving things around, no functional change.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21297>
2023-02-18 02:33:59 +00:00
Eric Engestrom
84e5d50b89 meson: improve formatting of options file
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21321>
2023-02-18 01:48:16 +00:00
Eric Engestrom
1851c0e868 ci: stop watching for changes in removed script
Removed in a79e6457d8 ("meson: use builtin support for reading
version from a file").

Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21321>
2023-02-18 01:48:16 +00:00
X512
e60f379545 EGL: implement Haiku driver over Gallium
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21079>
2023-02-18 00:44:43 +00:00
X512
d55f66b483 haiku: fix build
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21079>
2023-02-18 00:44:43 +00:00
X512
da73bcac37 hgl: remove
Use EGL and glvnd instead on Haiku platform.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21079>
2023-02-18 00:44:43 +00:00
Eric Engestrom
adbe8b6c17 mesa: optimize out _mesa_is_desktop_gl*() and _mesa_is_gles*() calls when not built
This will in turn optimize out anything that's gated on those.

Suggested-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2023-02-17 23:53:30 +00:00
Eric Engestrom
b20a614e82 mesa: make more use of the new _mesa_is_gles2() helper
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2023-02-17 23:53:30 +00:00
Eric Engestrom
7a7c1e6519 mesa: make more use of the new _mesa_is_gles1() helper
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2023-02-17 23:53:30 +00:00
Eric Engestrom
6651f9808c mesa: add & use new _mesa_is_gles1() & _mesa_is_gles2() helpers
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2023-02-17 23:53:30 +00:00
Eric Engestrom
be391402ec mesa: make more use of the existing _mesa_is_gles* helpers
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2023-02-17 23:53:30 +00:00
Eric Engestrom
a5fa548a34 mesa: make use of the new _mesa_is_desktop_gl_core() helper
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2023-02-17 23:53:30 +00:00
Eric Engestrom
ae66411f26 mesa: make use of the new _mesa_is_desktop_gl_compat() helper
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2023-02-17 23:53:30 +00:00
Eric Engestrom
e8e17641c1 mesa: add _mesa_is_desktop_gl_compat() and _mesa_is_desktop_gl_core() helpers
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2023-02-17 23:53:30 +00:00
Eric Engestrom
8a4c18afff meson: allow building GLES without GL
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2023-02-17 23:53:30 +00:00
Eric Engestrom
da25d0b8e4 meson/windows: only build libgl-gdi for desktop gl
Suggested-by: Jesse Natalie <jenatali@microsoft.com>
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2023-02-17 23:53:30 +00:00
Eric Engestrom
8955340839 meson: make GLX require OpenGL
This isn't strictly true, but making that work isn't worth the effort;
see https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343#note_1774683

Suggested-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
2023-02-17 23:53:30 +00:00
Alyssa Rosenzweig
50b82ca818 nir/lower_blend,agx,panfrost: Use lowered I/O
This is one step towards lowering I/O during shader preprocess rather than at
variant create time, which helps mitigate shader variant jank. It's also a lot
simpler.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> [v1]
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20836>
2023-02-17 23:09:19 +00:00
Alyssa Rosenzweig
acfda67b4f nir/lower_blend: Don't handle gl_FragColor
In OpenGL, FRAG_RESULT_COLOR implicitly broadcasts to every render target. Our
existing lower_blend code (somewhat arbitrarily) aliases to the the first render
target's format and blend settings. That said, I don't think that works if
different render targets have different settings -- or blend with their
different destinations -- though I don't have relevant spec text right now.

The actual reason this works is that all users of this pass either call
nir_lower_fragcolor first (panfrost, asahi) or don't have FRAG_RESULT_COLOR as
part of their API (panvk, soon agxv). Unless/until we actually have a use case
for nir_lower_blend with gl_FragColor, assert that gl_FragColor is lowered first
so we don't need to worry about this imaginary case.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20836>
2023-02-17 23:09:19 +00:00
Alyssa Rosenzweig
b3f229c510 nir/lower_blend: Don't touch store->dest
Stores don't have destinations, and if they did, it would be invalid to change
their ssa_def's num_components without also changing the SSA def. Remove the
nonsensical (but harmless) assignment.

This fixes 25249e8be2 ("nir/lower_blend: Expand or shrink output variables as
needed"), but as the bug is harmless in practice, it does not need to be
backported.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20836>
2023-02-17 23:09:19 +00:00
Alyssa Rosenzweig
63f30802eb pan/lower_framebuffer: Operate on lowered I/O
This turns the early pass into a late pass, which is important because it
depends on the shader key and therefore should be called by the driver instead
of the compiler preprocessing. It's also simpler this way.

The shader key work is waiting for review in another merge request. In the mean
time, this patch will let us run blend lowering early for blend shaders on
Midgard.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20836>
2023-02-17 23:09:19 +00:00
Alyssa Rosenzweig
1b6607fa13 nir: Augment raw_output_pan with IO_SEMANTICS+BASE
This is a form of lowered I/O, it needs I/O semantics so we can know the
location to store to instead of passing via a sideband.

Over in !20906, we will use the BASE to lower blend shader with multisampling in
NIR instead of passing the number of samples and framebuffer format along a
sideband to the Midgard compiler. That's not needed for this series (this patch
was cherry-picked to avoid regressions in the lower_blend changes) but it's good
to model the full form of the I/O lowered intrinsic here.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20836>
2023-02-17 23:09:19 +00:00
Ian Romanick
862b5b7d01 nir/loop_analyze: Simplify some logic in compute_induction_information
This part now looks more like it did before 0b9639c35d.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>
2023-02-17 22:12:05 +00:00
Ian Romanick
9461cc4424 nir/loop_analyze: Track induction variables with uniform initializer
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>
2023-02-17 22:12:05 +00:00
Ian Romanick
4edf1cdd3d nir/loop_analyze: Eliminate nir_basic_induction_var
No longer used. All of the information that was previously track here is
tracked directly in nir_loop_variable... and, technically speaking, has
been tracked there ever since 0b9639c35d.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>
2023-02-17 22:12:05 +00:00
Ian Romanick
e444ed9210 nir/loop_analyze: Use nir_loop_variable::init_src instead of nir_basic_induction_var::def_outside_loop
These track the same information in a slightly different way. Since
nir_loop_variable::init_src is visible outside this module, it cannot
be eliminated.

As an intentional side effect, induction variables with constant
initializers will now have their nir_loop_induction_variable::init_src
field point to the load_const source. Previously this pointer would be
NULL.

v2: Update unit tests and commit message. Remove the now unused ind_var
variable in find_trip_count.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>
2023-02-17 22:12:05 +00:00
Ian Romanick
72e763650c nir/loop_analyze: Use nir_loop_variable::update_src instead of nir_basic_induction_var::alu
These track the same information in a slightly different way. Since
nir_loop_variable::update_src is visible outside this module, it cannot
be eliminated.

This leads to some nice simplification in find_trip_count. Previously
this code only had access to the ALU instruction that performs the
increment. It had to "search" the parameters to determine which (if any)
was the constant. With this change, this code has access to the
nir_alu_src of the ALU instruction that performs the increment. It no
longer needs to search the parameters for the constant. It's either the
supplied nir_alu_src or nothing.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>
2023-02-17 22:12:05 +00:00
Ian Romanick
1bc43c0778 nir/loop_analyze: Track induction variables with uniform increments
As an intentional side effect, induction variables with constant
increments will now have their nir_loop_induction_variable::update_src
field point to the load_const source. Previously this pointer would be
NULL.

v2: Update unit tests and commit message.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>
2023-02-17 22:12:05 +00:00
Ian Romanick
c26d356dd5 nir/tests: Add tests for nir_loop_info::induction_vars tracking
Later commits in this MR will change the way some data is track, and
these tests will verify this behavior change.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>
2023-02-17 22:12:05 +00:00
Ian Romanick
168e54f7e3 nir/tests: Add tests for "inverted" loops
A couple basic tests for loops with the exit condition after the
increment. In compiler literature, the optimization that moves the exit
condition from the top to the bottom is called "loop inversion."

v2: Pass parameters to loop_builder_invert using a struct. Add a comment
describing the loop being constructed to loop_builder_invert. Both
suggested by Caio.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>
2023-02-17 22:12:05 +00:00
Ian Romanick
ffe0db099c nir/tests: Refactor creation of loops for loop_analyze test cases
Inspired heavily by the work by Yevhenii Kolesnikov in the original
versions of !3445.

v2: Pass parameters to loop_builder using a struct. Add a comment
describing the loop being constructed to loop_builder. Both suggested by
Caio.

v3: mscv C++ designated initializer lolz.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>
2023-02-17 22:12:05 +00:00
Ian Romanick
7384ea7978 nir/tests: Don't unconditionally log shaders from this one CF test
All of the other tests only log the shader when validation fails, so
having that shader scroll by in the output is very distracting.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21289>
2023-02-17 22:12:05 +00:00
Eric Engestrom
11a4791894 docs: add 23.1 branchpoint & rc dates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21322>
2023-02-17 22:06:13 +00:00
Lionel Landwerlin
3b037ac073 anv: fix vma heap memory leak
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: a5f9e59ce3 ("anv: Use vma_heap for descriptor pool host allocation")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21385>
2023-02-17 21:37:34 +00:00
Eric Engestrom
b772de9c78 ci: bump tags of deqp images
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21392>
2023-02-17 20:17:08 +00:00
Eric Engestrom
61c2ae3d09 ci: fix grouping of image tags
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21392>
2023-02-17 20:17:08 +00:00
Eric Engestrom
560ccdf05a ci: remove no-op sed
This is a duplicate from the first patch applied above.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21392>
2023-02-17 20:17:08 +00:00
Eric Engestrom
37a7f03ad8 ci: simplify adding & removing deqp patches
Instead of everyone having to copy the curl command from somewhere else
when a new deqp version needs new patches; now all they need to do is
paste the commit hash in the array.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21392>
2023-02-17 20:17:08 +00:00
Ryan Neph
525b8c582f venus: temporarily redirect VkDrmFormatModifierPropertiesListEXT to "2" variant
Temporarily remove driver-side uses of
VkDrmFormatModifierPropertiesListEXT so the encode/decode procedures can
be fixed asynchronously in a follow-up.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21367>
2023-02-17 19:55:15 +00:00
Alyssa Rosenzweig
e9bcfcf19c panfrost: Fix prim restart XML on Valhall
Harmless in practice (so no need to backport) but still very wrong. Noticed
looking at traces of Dolphin trying to debug acute misrendering.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20780>
2023-02-17 19:13:33 +00:00
Chia-I Wu
4459668b6e radv: add a size check in radv_create_buffer for Android
This is to make dEQP-VK.api.buffer.basic.size_max_uint64 pass on
android.

The test creates a buffer of size UINT64_MAX and makes sure the memory
requirement for the buffer is sane.  It fails because our memory
requirement is "align64(UINT64_MAX, 16)" which is 0 after overflow.

The test checks maintenance4's maxBufferSize and is skipped normally.
But the extension can be disabled on an android build.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21346>
2023-02-17 18:14:34 +00:00
Timur Kristóf
e13074d763 radv: Call nir_lower_array_deref_of_vec in radv_lower_io_to_scalar_early.
This fixes an issue when a vector component of an arrayed output has a deref.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8197
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21028>
2023-02-17 17:47:47 +00:00
Konstantin Seurer
c76060c253 radv: Advertise ray query support with LLVM
What could go wrong?

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21268>
2023-02-17 17:04:47 +00:00
Konstantin Seurer
3966fbdc51 radv: Pre-compile BVH build shaders if there is a cache
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21268>
2023-02-17 17:04:47 +00:00
Konstantin Seurer
40f246e3e9 radv: Force ACO for BVH build shaders
They hang with LLVM.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21268>
2023-02-17 17:04:47 +00:00
Konstantin Seurer
2ef5acedc2 radv: Make accel struct meta state initialization thread safe
Fixes: 0d5570b ("radv: Always compile accel structure shaders on demand.")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21268>
2023-02-17 17:04:47 +00:00
Konstantin Seurer
0f709510f4 ac/llvm: Implement bvh64_intersect_ray_amd
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21268>
2023-02-17 17:04:47 +00:00
Mike Blumenkrantz
a6d3d65c3c zink: handle semi-matching i/o for separate shaders
while separate shaders requires i/o blocks to match between stages,
there are two tricky cases:
* sparse location specification
* variables are required to match in type by location

the first item means user locations must increment if a slot is not used

the second item means that e.g., a mat3x2 can match three vec2 variables
in matching slots

fix both of these cases now

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21383>
2023-02-17 16:02:46 +00:00
Alyssa Rosenzweig
fc30fe5bc5 panfrost: Disable CRC by default
Known unsound code.

So far I'm not convinced transaction elimination is doing us much good. Even in
synthetic glmark style benchmarks this seems to be a few % hit at most. Given
that transaction elimination is unsound by design, and that panfrost's
implementation is buggy in several places and getting it right (up to the
unsoundness of the hardware feature itself) would take actual engineering
effort, and the priority is making glamor work... disabling is the obvious
choice here.

For now, we leave the code but gate it behind a env var
flag (PAN_MESA_DEBUG=crc) rather than defaulting to enabled unless
PAN_MESA_DEBUG=nocrc is set. This way, we can still experiment with it if we
need that data ("what performance could we gain if we had this feature,
unsoundness be damned?"). That said, I'm not really ok with having unsoundness
on my devices, y'know? Back of the napkin math suggests that it's not unlikely
that somebody has hit a transaction elimination collision in the wild with the
DDK.

Boils down to values.

Closes: #8113
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21258>
2023-02-17 14:36:01 +00:00
Lionel Landwerlin
18bf85468c anv: track vram only BOs to print things out on ENOMEM execbuf
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/21380>
2023-02-17 13:45:00 +00:00
Lionel Landwerlin
0aa44b107a anv: move debug submit to helper and call it on execbuf failure
Helps telling when you've run out of local memory.

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/21380>
2023-02-17 13:45:00 +00:00
Samuel Pitoiset
c8495dbee3 radv: stop using a PS epilog when the FS doesn't write any color outputs
This is a small optimization for fragment shaders that only write
depth/stencil/sample mask without any color outputs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21341>
2023-02-17 13:19:54 +00:00
Samuel Pitoiset
78c0fae08c radv: only skip emitting the pipeline blend state if the FS uses an epilog
The blend state is emitted from the command buffer when the FS uses
an epilog (either compiled from a lib with GPL or compiled on-demand).

This shouldn't change anything but it will allow to disable using a
PS epilog when the fragment shader doesn't write any color outputs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21341>
2023-02-17 13:19:54 +00:00
Karmjit Mahil
5a5a131127 pvr: Handle VK_QUERY_RESULT_WAIT_BIT.
Not handling device loss currently. That needs to be done
throughout the code base so out of scope for this.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20091>
2023-02-17 13:06:51 +00:00
Tapani Pälli
d53613dbd7 anv: Wa_14016407139, add required pc when SBA programmed
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21374>
2023-02-17 12:44:00 +00:00
Lionel Landwerlin
14266d3c2d intel/perf: also add the oa timestamp shift on MTL
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 90c86fe63e ("intel: add MTL performance metrics")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21378>
2023-02-17 12:10:05 +00:00
Samuel Pitoiset
6d73841d34 radv/amdgpu: only set a new pstate if the current one is different
AMDGPU pstate is per context but if there is multiple AMDGPU contexts
in flight, the kernel can return -EBUSY.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21222>
2023-02-17 11:36:06 +00:00
Samuel Pitoiset
663877e894 Revert "radv: acquire pstate on-demand when capturing with RGP"
This change is wrong for two reasons:
- it hangs most of the time maybe, because changing PSTATE when the
  application is running is broken somehow
- it increases the time between triggering and generating the capture
  considerably, because there is a delay for changing PSTATE

This restores previous logic where PSTATE is set to profile_peak at
logical device creation. Though, it also re-introduces an issue with
multiple logical devices (kernel returns -EBUSY) but this will be
fixed in the next commit.

This fixes GPU hangs when trying to record RGP captures on my NAVI21.
Note that profile_peak is only required for some RDNA2 chips (including
VanGogh).

Cc: mesa-stable
This reverts commit 923a864d94.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21222>
2023-02-17 11:36:06 +00:00
Erico Nunes
c426e5677f lima: don't use resource_from_handle while creating scanout
resource_from_handle implementations create an additional reference to
the scanout resource, which caused lima to leak those resources after
commit ad4d7ca833.

Do as the other drivers do and import the bo directly while creating
the scanount resource.

Cc: 22.3 mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8198
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21330>
2023-02-17 10:36:46 +00:00
Karmjit Mahil
5277e45849 pvr: Add support to copy descriptors on vkUpdateDescriptorSets()
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21332>
2023-02-17 10:10:11 +00:00
Karmjit Mahil
30b7263419 pvr: Move descriptor write into pvr_write_descriptor_set()
Moving descriptor write functionality from
pvr_UpdateDescriptorSets() into pvr_write_descriptor_set().

This is in preparation for adding descriptor copy support.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21332>
2023-02-17 10:10:11 +00:00
Boyuan Zhang
c660cef599 virgl: add more formats to conv table
Adding UYVY, YUYV, P010 to formats_conv_table.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21250>
2023-02-17 09:23:27 +00:00
Gert Wollny
20584e04e3 r600/sfn: Fix Cayman trans from string and add test for copy prop
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
4152e38924 r600/sfn: Fix alu trans op flag setup
Fixes: commit 2df023a1f1
   r600/sfn: pre-evaluate allowed dest mask in Alu instructions

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
f07a2715c6 r600/sfn: Fix handling of fetch through texture clause
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
a99c08e181 r600: Don't start new CF for every fetch through tex clause
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
c44a9c8765 r600/sfn: Forward setting the block ID and index
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
08ed216a11 r600/sfn: address use in group only if instr can be added
Otherwise the group will signal an address use that may not
be relevant.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
560731279f r600/sfn: rename texture coordinate offset for clarity
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
869e4de6af r600/sfn: Stop try scheduling in t-slot with empty related v-slot
This requires adding a nop in the relates v-slot, and the readport
valiation seems to be broken for this case, so drop this for now.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
b406cfd922 r600/sfn: Don't copy propagate indirect loads to more than one dest
Propagating the indirect load to more instructions would result
in more address load instructions. This would (a) remove the advantage
of eliminating one move, and (b) introduce more latency, because between
address load and use two cycles must pass.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
d1f419b365 r600/sfn: Silence warnings about unused parameters
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
c527293924 r600/sfn: Fix a typo
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
b1df8b0393 r600/sfn: drop useless instr use count
This is handled with the dest registers

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
ac6b95d40b r600/sfn: Work around dependency issue when splitting op to group
The instruction that is split may still be referenced as extra
dependency in other instructions, so add a handle to the instruction
that it can be set to be scheduled.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Gert Wollny
8b5d41cacb r600/sfn: Use range_base for atomics and images
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
2023-02-17 08:30:17 +00:00
Tapani Pälli
ee7953ab97 mesa/st: support compute shader decoding of ASTC
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19886>
2023-02-17 07:57:12 +00:00
Tapani Pälli
977bc760fa mesa: add astc decoder shader template (glsl es version)
This shader originates from Granite 3D engine and has been adapted
to be used with Open GL and some GLSL ES specifics.

GLSL ES adaptation:

- remove Vulkan specifics: EXT_samplerless_texture_functions usage,
  specialization constants, push constant usage
- inline bitextract.h
- always DECODE_8BIT and hardcode error color (for now)
- port to GLSL ES, required some type changes, explicit type
  conversions and setting up precisions for types

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19886>
2023-02-17 07:57:12 +00:00
Tapani Pälli
179adf9d59 mesa/st: initialize resources for ASTC decoding
Generates required resources for ASTC texture decoding pass.

Partition table resources will be cached in to hash during runtime
as one is required for each block size.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19886>
2023-02-17 07:57:12 +00:00
Tapani Pälli
ad51f5bd13 mesa/st: add astc decoder lookup tables
Commit introduces ASTC decoding lookup tables from Granite 3D engine.

These lookup tables will be used during transcoding by a compute
shader in later commits when decoding ASTC textures.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19886>
2023-02-17 07:57:12 +00:00
Samuel Pitoiset
685f08f91d radv: add support for rectangularLines
dEQP-VK.*rectangular_line* pass on NAVI21.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21287>
2023-02-17 07:38:10 +00:00
Samuel Pitoiset
3368c0e6f2 radv: reduce maximum line width to 8.0
Using 8191.875 seems to big for the hardware to correctly render wide
rectangular lines. This can also be reproduced with AMDVLK by forcing
rectangularLines = True, and fixed by reducing the maximum size as well.

Other drivers seem to expose that value.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21287>
2023-02-17 07:38:10 +00:00
Mike Blumenkrantz
65469eeca5 zink: more accurately handle i/o for separate shaders
this can be simplified since i/o is required to match exactly between
stages, meaning that assigning in increasing order should always be correct

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21336>
2023-02-17 04:30:04 +00:00
Mike Blumenkrantz
e8d7f6a32c zink: delete some now-broken ntv dref sampling code
depth splatting should be handled now by the match_tex_dests() pass

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21336>
2023-02-17 04:30:04 +00:00
Faith Ekstrand
d87ab12893 vulkan: Update the XML and headers to 1.3.241
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:35 +00:00
Faith Ekstrand
8297d18952 vulkan/device-select-layer: Include vulkan.h
In the upcoming header update, vk_layer.h starts including vulkan_core.h
instead of vulkan.h.  This will break this layer as it needs a couple of
window-system extension #defines.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
d6248b8133 vulkan/layers: Use PUBLIC instead of VK_LAYER_EXPORT
VK_LAYER_EXPORT is going away in the next Vulkan header update.  We
already have a PUBLIC macro in util/macros.h which does the same thing.
Unlike VK_LAYER_EXPORT, it should work in Windows too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
f24f753c8a vulkan: Properly filter structs in vk_physical_device_features
This uses get_all_required to filter structs and also filters struct
members based on API.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
5021344fa6 vulkan: Move the features generator to vulkan/util
This makes it easier to start depending on vk_extensions.py

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
68cb42e52b vulkan: Filter out provisional extensions
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
ef3e75d7f3 Vulkan: Properly filter structs in vk_cmd_queue_gen
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
a9c4423ed3 vulkan: Properly filter by api in enum_to_str
This switches us to using get_all_required() for figuring out which
enum types we care about and then carefully filtering every value as
needed.  We also add a number field to Extension so we keep all the
extension XML parsing in one place.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
4059c78633 vulkan: Properly filter entrypoints
We now use get_all_required() to get all required commands and use that
to filter instead of doing it manually.  Also, we can pull entrypoint
extension etc. information from the requirements struct.  Finally, we
also have to filter the actual commands themselves as well as arguments
per-API because there may be multiple versions or variants depending on
the API being used.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
6910d1337a vulkan: Add a get_all_required() helper
This searches for the names of everything of a particular type: command,
enum, etc. and returns a Requirements struct with any core version and
extensions that require it.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
edfef5d915 vulkan: Parse the platform in Extensions.from_xml()
This makes handling guards on entrypoints a bit easier.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
ab5ab6ef9e vulkan: Improve extension parsing
This adds an Extension.from_xml() helper for doing the parsing so we can
re-use it in other code.  We also improve filtering of extensions.  The
Vulkan XML schema is changing to make the supported attribute a comma-
separated list.  This is to allow for vulkansc to also exist in the XML
schema.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
3b686f3a2f vulkan: Remove unused fields from Extension and ApiVersion
These are a left-over from when these classes were used by ANV to define
extension enables in python.  They haven't been used since we added
extension table structs and move extension enables to C.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
a47c903e51 Revert "vk/util: keep track of extension requirements"
This reverts commit ca98e4446b.  The way
extension requirements are specified is about to change significantly.
Since this is so new, it's easier to just revert for now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Faith Ekstrand
15e332073c Revert "vk/runtime: turn vk.xml extension requirements into asserts"
This reverts commit 6ac830ccb1.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21225>
2023-02-17 03:42:34 +00:00
Timothy Arceri
aa4b1d314e glsl: copy prop vars before scalarizing alus
This generally gives us better results and doing it here in nir will
also allow us to remove more glsl optimisation calls that do a similiar
thing for us.

(Updated shader-db results by idr.)

Tiger Lake, Ice Lake, and Skylake had similar results. (Ice Lake shown)
total instructions in shared programs: 20246333 -> 20240715 (-0.03%)
instructions in affected programs: 235253 -> 229635 (-2.39%)
helped: 425 / HURT: 114

total cycles in shared programs: 891730115 -> 891631113 (-0.01%)
cycles in affected programs: 37347925 -> 37248923 (-0.27%)
helped: 952 / HURT: 692

total spills in shared programs: 7072 -> 6716 (-5.03%)
spills in affected programs: 505 -> 149 (-70.50%)
helped: 7 / HURT: 0

total fills in shared programs: 9897 -> 8511 (-14.00%)
fills in affected programs: 1674 -> 288 (-82.80%)
helped: 7 / HURT: 0

total sends in shared programs: 1053685 -> 1053411 (-0.03%)
sends in affected programs: 2821 -> 2547 (-9.71%)
helped: 30
HURT: 2

LOST:   13
GAINED: 13

Broadwell and Haswell had similar results. (Broadwell shown)
total instructions in shared programs: 18149157 -> 18147271 (-0.01%)
instructions in affected programs: 204630 -> 202744 (-0.92%)
helped: 294 / HURT: 121

total cycles in shared programs: 939488196 -> 939508444 (<.01%)
cycles in affected programs: 36394777 -> 36415025 (0.06%)
helped: 718 / HURT: 620

total sends in shared programs: 1005426 -> 1005152 (-0.03%)
sends in affected programs: 2821 -> 2547 (-9.71%)
helped: 30 / HURT: 2

LOST:   2
GAINED: 2

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19715>
2023-02-17 03:16:31 +00:00
Italo Nicola
e787ddf298 panfrost: fix tiny sample_positions BO memory leak
Fixes a 4KB memory leak that happens once per-device creation.

Cc: mesa-stable
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Chris Healy healych@amazon.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21372>
2023-02-17 01:45:53 +00:00
Faith Ekstrand
f8aa83f0c8 intel/nir: Use nir_lower_mem_access_bit_sizes()
This drops the Intel-specific pass in favor of the new generic one.

No shader-db changes on Skylake or DG2.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21232>
2023-02-17 00:55:54 +00:00
Faith Ekstrand
2e2d7803c7 nir: Add a load/store bit size lowering pass
This is based on brw_nir_lower_mem_access_bit_sizes() but ended up being
substantially different.  While the core concepts are all the same, the
brw_* version made a lot of Intel-specific assumptions.  The new version
takes a callback which takes a number of bytes of data and an alignment
pair and returns a bit size and number of components to load/store.

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21232>
2023-02-17 00:55:54 +00:00
Timothy Arceri
34e11963fa ci: enable dEQP-VK.ubo.random.all_shared_buffer.48
The previous commits fix the slow compile time, allowing us to
enable this test.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5152

Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20381>
2023-02-16 23:31:59 +00:00
Timothy Arceri
cb58d75224 nir/nir_opt_copy_prop_vars: don't call memset when cloning
This makes the pass significantly faster cutting execution time
by around 30% in the cts test
dEQP-GLES31.functional.ubo.random.all_per_block_buffers.20

This 30% improvement is in addition to all the improvements from
the proceeding patches.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20381>
2023-02-16 23:31:59 +00:00
Timothy Arceri
d1a41d9c64 nir/nir_opt_copy_prop_vars: reorder clone calls
This helps with the reuse of dynamic arrays.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20381>
2023-02-16 23:31:59 +00:00
Timothy Arceri
2a2d85e254 nir/nir_opt_copy_prop_vars: reuse dynamic arrays
As per the previous commit if we don't reuse these dynamic arrays
we end up needlessly thrashing the memory handling functions.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20381>
2023-02-16 23:31:59 +00:00
Timothy Arceri
ffe0f3fda1 nir/nir_opt_copy_prop_vars: reuse hash tables
Due to how this pass works we can end up thrashing memory if we
do not reuse these hash tables rather than reusing them.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20381>
2023-02-16 23:31:59 +00:00
Timothy Arceri
731e9fd535 nir/nir_opt_copy_prop_vars: avoid comparison explosion
Previously the pass was comparing every deref to every load/store
causing the pass to slow down more the larger the shader is.

Here we use a hash table so we can simple store everything needed
for comparision of a var separately.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20381>
2023-02-16 23:31:59 +00:00
Timothy Arceri
8f6f5730f6 nir/nir_opt_copy_prop_vars: remove extra loop
The fix in 947f7b452a introduced an extra loop over the copies
array to find the correct entry in the case it had been moved.

The problem is these loops can be iterated over millions of times
so lets simply update the entry pointer in the case we change its
location in the array.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20381>
2023-02-16 23:31:59 +00:00
Faith Ekstrand
4e09d37f3b nir/from_ssa: Move the loop bounds check in resolve_parallel_copy
We loop, effectively, over two stacks: ready and to_do and finish only
when both are empty.  In the case where ready is empty, we pull one off
of to_do, add a copy to a temporary, and push it onto the ready stack.
Previously, we assumed that we would never get to the temporary copy
case if to_do has exactly one entry because that would imply that there
was only one copy left which means there can't possibly be a cycle to
break.  This was true until c7fc44f9eb ("nir/from_ssa: Respect and
populate divergence information") which changed things such that
temporary copies sometimes get added in the case where a convergent
value is copied both to convergent and divergent destinations.

This patch adjusts our loop iteration to always attempt to clear the
ready stack before checking if there's anything left on the to_do stack.
I also added an assert to make the exit condition more clear.

Fixes: c7fc44f9eb ("nir/from_ssa: Respect and populate divergence information")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8037
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21315>
2023-02-16 20:23:42 +00:00
Faith Ekstrand
5afba073c6 nir/from_ssa: Only re-locate values that are destinations
There is an optimization in the parallel copy algorithm where, after a
copy has been performed, we can treat the destination as the new source
for future copies of the same source.  In particular, consider the
following parallel copy: A -> B, C -> A, A -> C.  In this case, after we
have done the A -> B copy, we can make note that the value in A is now
in B and emit the sequence: A -> B, C -> A, B -> C.  This allows us to
resolve the swap cycle between A anc C without allocating a temporary
register because we know B is also a copy of A.

When one of the registers involved is convergent and the other is
divergent, this optimization is problematic because, while convergent to
divergent copies are fine, we can't re-use the divergent copy in later
copies if any of those copies are to a convergent variable.  We could,
but it would require a read_first_invocation which would get messy.  In
In c7fc44f9eb ("nir/from_ssa: Respect and populate divergence
information"), we attempted to deal with this by limiting the rename
optimization to the case where the divergence matched.

The problem is that we did the re-name part whenever the divergence
matched but only marked it as ready if the thing being copied was a
destination.  (We actually left two instances of loc[a] = b, one which
always happened and one which only happened if we also wanted to flag
the source as being ready to use as a destination.)  While this
technically doesn't cause any problems, it may result in more inter-mov
dependencies which hurts instruction scheduling.  For example, if we had
the parallel copy A -> B, A -> C, A -> D, we now end up emitting the
sequence A -> B, B -> C, C -> D which has many more data hazards between
instructions caused by the constant shuffling.

This commit restores the original logic in which we only perform the
rename optimization if the rename would free up a register we will later
use as a destination.  This isn't entirely optimal as it still doesn't
prove that there is a cycle involved first, but it should lead to a
reduction in unnecessary dependencies.

No shader-db changes on SKL or DG2

Fixes: c7fc44f9eb ("nir/from_ssa: Respect and populate divergence information")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21315>
2023-02-16 20:23:42 +00:00
Rob Clark
9673502b3b freedreno/drm: Optimize stateobj re-emit
For long-lived stateobjs, it is common to re-emit to the same submit
multiple times.  By giving each submit a unique sequence # we can detect
this case and skip the extra append_bo().

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
6747d30155 freedreno: Add seqno helper
It is a pretty common pattern to allocate a non-zero sequence # for
lightweight checking if an object is the same, changed, for use in cache
keys, etc.  (And also pretty common to forget to handle the rollover
zero case.)  Add a helper for this.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
8f2b22ba66 freedreno: Drop batch lock
Now that we are not tracking cross-context batch dependencies, there is
no scenario where one context could trigger flushing another context's
batch.  So we can drop the batch lock intended to protect against this.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
9a6de00e98 freedreno/batch: Stop tracking cross-context deps
The app is expected to provide suitable cross-context synchronization
(fences, etc), so don't try to do it's job for them.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
a4b949fe61 freedreno: Avoid taking screen lock
Avoid taking screen unlock for batch unref.  Instead just split the
destroy fxn into locked and unlocked variants.  That way we only end
up taking the screen lock on final unref but avoid it in the common
case.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
35fc1595b3 freedreno/a6xx: Pre-compute PROG related LRZ state
PROG state mostly just disables various LRZ related flags, which can
be handled as a simple mask.  The exception is ztest mode, which is
either overriden by PROG state, or we use the all 1's value (which
isn't valid from hw standpoint) to signal that it needs to be computed
at draw time, which fortunately fits in with the bitmask approach.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
c938101bb5 freedreno: Move FD_MESA_DEBUG cases out of draw_vbo
If the debug options are enabled, just plug in a debug version of
draw_vbo with the additional checks.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
8942f4b734 freedreno: Move blend out of dirty-rsc tracking
This was not doing any actual resource tracking, just updating
gmem_reason.  And furthermore, a6xx+ doesn't care about the bits
it was setting.  So move this to per-gen backend for the gens that
need it, and avoid setting FD_DIRTY_RESOURCE when FD_DIRTY_BLEND
is set.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
67d4bc7be4 freedreno/a6xx: Remove tex-state refcnting
Now that we use a flag to trigger the tex state invalidation coming from
other contexts, we can drop the refcnt'ing.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
cfd4721ee0 freedreno/drm: Make rb refcnt non-atomic
Now that the one special case where multiple threads could race to
ref/unref, we can go back to using non-atomic refcnts.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
f91bcd2455 freedreno/a6xx: Do tex-state invalidates in same ctx
If a resource invalidate is triggered by a different ctx (potentially on
a different thread) simply flag that the tex state needs invalidation,
but defer handling it to the ctx that owns the tex state.

This will let us remove atomic refcnt'ing on the tex state, and more
importantly atomic refcnt'ing on the fd_ringbuffer (as this was the one
special case where rb's could be accessed from multiple threads).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
e7993d68e2 freedreno/a6xx: Multi-draw support
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
cc31997f1b freedreno/a6xx: Split out flush_streamout() helper
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
911d67bdad freedreno/a6xx: Drop unused return
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
c4e2e821a2 freedreno: Push num_draws down to backend
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Rob Clark
6bfee9e669 freedreno: Account for multi-draw in num_draws
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
2023-02-16 19:57:13 +00:00
Daniel Schürmann
f6251b21f9 radv/rt: don't hash maxPipelineRayRecursionDepth
The stack size has no effect on the generated shader anymore.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21159>
2023-02-16 19:37:25 +00:00
Daniel Schürmann
8e718c5b63 radv/rt: use dynamic_callable_stack_base also for static stack_sizes
This patch also removes rt_pipeline->dynamic_stack_size and replaces
it by checking for rt_pipeline->stack_size == -1u.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21159>
2023-02-16 19:37:25 +00:00
Daniel Schürmann
2649a1f272 radv/rt: introduce and set rt_pipeline->stack_size
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21159>
2023-02-16 19:37:25 +00:00
Daniel Schürmann
b338d59047 radv: unconditionally enable scratch for RT shaders
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21159>
2023-02-16 19:37:25 +00:00
Daniel Schürmann
aa362b4b6f radv: rename shader_info->cs.uses_sbt -> shader_info->cs.is_rt_shader
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21159>
2023-02-16 19:37:25 +00:00
Konstantin Seurer
72d9604db0 radv: Clean up dynamic RT stack allocation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21159>
2023-02-16 19:37:25 +00:00
Sidney Just
fc84c63e17 zink: Add missing features to the profile file
Fixes: 2ea481b2f0 ("Zink: add Zink profiles file")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20920>
2023-02-16 19:11:57 +00:00
Sidney Just
60e0322092 zink: add check for samplerMirrorClampToEdge Vulkan 1.2 feature
This adds a check to advertise PIPE_CAP_TEXTURE_MIRROR_CLAMP_TO_EDGE when either the extension is present or the Vulkan 1.2 feature is enabled.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20920>
2023-02-16 19:11:57 +00:00
Emma Anholt
ed62eec58b hasvk: Fix SPIR-V warning about TF unsupported on gen7.
It's supported now.

Fixes: d82826ad44 ("anv: Implement VK_EXT_transform_feedback on Gen7")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21228>
2023-02-16 18:11:44 +00:00
Emma Anholt
98455470ea hasvk: Silence conformance warning in CI.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21228>
2023-02-16 18:11:44 +00:00
Emma Anholt
570acf5655 ci: Add a manual full and 1/10th hasvk CTS runs.
These are manual since they're on a runner in my basement that sometimes
can go down, but it'll be nice to have this for throwing the rare hasvk MR
at.

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21228>
2023-02-16 18:11:44 +00:00
Danylo Piliaiev
be976e0aa6 ci/tu: Add 1/200 pass to test for stale reg usage
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21226>
2023-02-16 17:43:10 +00:00
Danylo Piliaiev
86f82d4224 docs/freedreno: Add info about stale reg stomper dbg option
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21226>
2023-02-16 17:43:10 +00:00
Danylo Piliaiev
a66d9c815d turnip: Add debug option to find usage of stale reg values
MESA_VK_ABORT_ON_DEVICE_LOSS=1 \
TU_DEBUG_STALE_REGS_RANGE=0x00000c00,0x0000be01 \
TU_DEBUG_STALE_REGS_FLAGS=cmdbuf,renderpass \
./app

To pinpoint the reg causing a failure reducing regs range could be
used for bisection. Some failures may be caused by multi-reg combination,
in such case set 'inverse' flag which would change the meaning of reg
range to "do not stomp these regs".

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21226>
2023-02-16 17:43:10 +00:00
Timur Kristóf
084d10a702 aco: Remove MTBUF zero operand.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21363>
2023-02-16 17:16:34 +00:00
Timur Kristóf
afdacf4dcc aco: Don't set scalar offset on buffer load instructions when it's zero.
This helps generate slightly more optimal instructions.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21363>
2023-02-16 17:16:34 +00:00
José Roberto de Souza
e050a00b9f intel/common: Move i915 files to i915 folder
Following the organization done in intel/dev and intel/vulkan.

Probably due to some rebase issue we had a duplicated copyright header
in intel_gem_i915.h that is being removed in here too.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21256>
2023-02-16 16:24:36 +00:00
Mike Blumenkrantz
41286f100e vl/dri3: avoid deadlocking when polling deleted windows for events
upcoming xserver releases will emit PresentConfigureNotify with this
flag set when a window is destroyed, ensuring drivers
don't poll infinitely and deadlock

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21339>
2023-02-16 15:55:47 +00:00
Mike Blumenkrantz
819cbf329a vulkan/wsi: avoid deadlocking dri3 when polling deleted windows for events
upcoming xserver releases will emit PresentConfigureNotify with this
flag set when a window is destroyed, ensuring drivers
don't poll infinitely and deadlock

fixes #6685

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21339>
2023-02-16 15:55:47 +00:00
Mike Blumenkrantz
91de576a7f dri3: avoid deadlocking when polling deleted windows for events
upcoming xserver releases will emit PresentConfigureNotify with this
flag set when a window is destroyed, ensuring drivers
don't poll infinitely and deadlock

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/116

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21339>
2023-02-16 15:55:47 +00:00
Timur Kristóf
4621ffdec1 aco: Get rid of redundant load_vmem_mubuf function.
Call emit_load directly from visit_load_buffer instead.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21358>
2023-02-16 15:29:37 +00:00
Timur Kristóf
74f1b77046 radv: Move VS input lowering to new file: radv_nir_lower_vs_inputs.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21358>
2023-02-16 15:29:37 +00:00
Timur Kristóf
450e173de0 ac/llvm: Change ac_build_tbuffer_load to take format and channel type.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21358>
2023-02-16 15:29:37 +00:00
Timur Kristóf
0ae778ca59 ac/llvm: Fix ac_build_buffer_load to work with more than 4 channels.
LLVM is unable to select instructions for num_channels > 4, so we
workaround that by manually splitting larger buffer loads.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21358>
2023-02-16 15:29:37 +00:00
Timur Kristóf
a2755fc203 ac/llvm: Fix buffer_load_amd with larger than 32-bit channel sizes.
LLVM is unable to select instructions for larger than 32-bit channel types.
Workaround by using i32 and casting to the correct type later.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21358>
2023-02-16 15:29:37 +00:00
Timur Kristóf
b5b0ded4c1 ac/llvm: Remove "structurized" argument and instead check vindex.
Change ac_build_buffer_load_common and ac_build_tbuffer_load so
the use structurized load when the vindex argument is not NULL.
Adjust callers to match the new behaviour.

This fixes the load_buffer_amd intrinsic with index source.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21358>
2023-02-16 15:29:37 +00:00
Timur Kristóf
881c52ba19 ac: Port ACO's get_fetch_format to ac_get_safe_fetch_size.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21358>
2023-02-16 15:29:36 +00:00
Timur Kristóf
2e9f5aadd0 nir: Clarify comment above load_buffer_amd.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21358>
2023-02-16 15:29:36 +00:00
Tapani Pälli
f815daa285 mesa/st: refactor st_destroy_texcompress_compute condition
What happened is that we did not call init but still called dtor, this
makes us do some unnecessary work.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21309>
2023-02-16 15:00:13 +00:00
Iago Toral Quiroga
93952916c6 v3dv: fix stencil view aspect selection of depth/stencil image
Instead of fixing the swizzle to X001, we should compose this
swizzle with the image view's own swizzle.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21354>
2023-02-16 14:47:39 +00:00
Guilherme Gallo
eba566c854 ci/lava: Fix LAVA logs issues for Collabora jobs
Since the Collabora LAVA update related to the downtime from
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21119, the
LAVA logs from Collabora continued to use the hack for older versions
which digested some control characters, such as carriage returns acting
as newlines, which made it necessary to recover from split lines to make
Gitlab sections work in job logs as expected.

Collabora's LAVA instance now gives a more raw log output. It is
necessary to pay attention to newlines at the end of each log message,
which may cause double newlines when printed with Python built-in
`print` function. I decided to remove the repeating `\n` from the
received log messages to make them transparent to LogFollower users.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8242

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21325>
2023-02-16 13:08:41 +00:00
Guilherme Gallo
c85f3fbbb7 ci/lava: Add LavaFarm class to find LAVA farm from runner tag
LavaFarm is a class created to handle the different types of LAVA farms
and their tags in Mesa CI. Since specific jobs may require different
types of LAVA farms to run on, it is essential to determine which farm
the runner is running on to configure the job correctly.

LavaFarm provides an easy-to-use interface for checking the runner tag
and returning the corresponding LAVA farm, making it simple for Mesa CI
to configure jobs appropriately. By adding tests for LavaFarm, the team
can ensure that this class is functioning as expected, allowing for the
smooth execution of Mesa CI jobs on the correct LAVA farm.

The tests ensure that get_lava_farm returns the correct LavaFarm value
when given invalid or valid tags and that it returns LavaFarm.UNKNOWN
when no tag is provided. The tests use Hypothesis strategies to generate
various labels and farms for testing.

Example of use:
```
from lava.utils.lava_farm import LavaFarm, get_lava_farm

lava_farm = get_lava_farm()
if lava_farm == LavaFarm.DUMMY:
    # Configure the job for the DUMMY farm
    ...
elif lava_farm == LavaFarm.COLLABORA:
    # Configure the job for the COLLABORA farm
    ...
elif lava_farm == LavaFarm.KERNELCI:
    # Configure the job for the KERNELCI farm
    ...
else:
    # Handle the case where the LAVA farm is unknown
    ...
```

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21325>
2023-02-16 13:08:41 +00:00
Guilherme Gallo
ca110658b7 ci/lava: Move LAVA dependencies to pip
Use requirements.txt and requirements-test.txt to organize better Python
dependencies related to LAVA.

Now LAVA tooling can use recent and fixed library versions.
And test-related libs will not trigger container rebuilding anymore.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21325>
2023-02-16 13:08:41 +00:00
Konstantin Seurer
cf9e1b953c radv: Hash VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_* flags
Found by inspection.

Fixes: 687a82d ("radv/rt: Handle no-null shader flags")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21320>
2023-02-16 11:42:25 +00:00
Michel Dänzer
3e9c131482 frontend/dri: Initialize callbacks in dri_swrast_kms_init_screen
This was missed in the commit below.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8232
Fixes: 7d5b1cd02c ("frontend/dri: move callbacks from the VTable into dri_screen, dri_drawable")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21333>
2023-02-16 10:21:44 +00:00
GH Cao
f023548d2f gallium: Add MCJIT target triplet for Windows ARM64
MCJIT on Windows requires a special LLVM target triplet with ELF object
format, add one for Windows ARM64.

Tested locally on real hardware.

Signed-off-by: GH Cao <driver1998.ms@outlook.com>
Acked-by: Roland Scheidegger <sroland@vmware.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20675>
2023-02-16 09:04:40 +00:00
driver1998
982757082e gallium: Use DETECT_OS_WINDOWS instead of 'WIN32'
Signed-off-by: GH Cao <driver1998.ms@outlook.com>
Acked-by: Roland Scheidegger <sroland@vmware.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20675>
2023-02-16 09:04:40 +00:00
Tapani Pälli
0d1c759f4e radv: revert Metro Exodus workaround which was moved to common code
This reverts commit 4397c166c0.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21281>
2023-02-16 07:35:20 +00:00
Tapani Pälli
effee24951 spirv: add workaround for Metro Exodus in spirv_to_nir
This is commit 4397c166c0 for spirv_to_nir, otherwise we hit
the same assert with anv driver.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21281>
2023-02-16 07:35:20 +00:00
Alyssa Rosenzweig
888492ecd3 asahi: Vectorize background colour load
No point to scalarizing this, the background can handle the vector load fine
since bfa7ec0aa0 ("agx: Don't scalarize preambles in NIR").

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21327>
2023-02-16 06:36:49 +00:00
Pierre-Eric Pelloux-Prayer
affa8a9fb2 amd/surface: fix base_mip_width of subsampled formats
base_mip_width is used in si_compute_copy_image when the
SI_IMAGE_ACCESS_BLOCK_FORMAT_AS_UINT flag is used.

   width = tex->surface.u.gfx9.base_mip_width;

This will be incorrect if we don't adjust it. For instance,
with a 260x256 image, surf_pitch and base_mip_width are
320 before surf_pitch is updated to be 192.

Both need to match, or computing the width from base_mip_width
leads to incorrect result.

Cc: mesa-stable

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21253>
2023-02-16 00:25:17 -05:00
Chia-I Wu
28d0ddead0 turnip: avoid FMT6_Z24_UNORM_S8_UINT_AS_R8G8B8A8 for event blits
We don't need it for event blits.  It also does not support fast clears
which makes it slower.

For event blits, blob has

  VK_FORMAT_D16_UNORM           -> FMT6_16_UNORM
  VK_FORMAT_X8_D24_UNORM_PACK32 -> FMT6_Z24_UNORM_S8_UINT
  VK_FORMAT_D32_SFLOAT          -> FMT6_32_FLOAT
  VK_FORMAT_S8_UINT             -> FMT6_8_UINT
  VK_FORMAT_D24_UNORM_S8_UINT   -> FMT6_Z24_UNORM_S8_UINT
  VK_FORMAT_D32_SFLOAT_S8_UINT  -> FMT6_32_FLOAT + FMT6_8_UINT

and always sets RB_BLIT_INFO:DEPTH.  It is unclear what
RB_BLIT_INFO:DEPTH is for but we set it anyway.

Improves "glmark2 -b refract" on angle by 15-20% on a618/a635.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8218
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21116>
2023-02-16 01:35:50 +00:00
Ryan Neph
dc1fab8b8c venus: update venus-protocol headers to partially fix WA1
Begin encoding/decoding
VkDrmFormatModifierPropertiesList2EXT::drmFormatModifierCount to fix a
workaround (WA1) in the venus-protocol.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21323>
2023-02-16 01:15:27 +00:00
Lionel Landwerlin
95d44a0773 hasvk: fix KHR_shader_float_controls reporting
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 13f68bcce1 ("hasvk: Tell spirv_to_nir float controls are always supported")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21349>
2023-02-15 23:55:39 +00:00
José Roberto de Souza
f331bab884 anv: Move execute_simple_batch() and queue_exec_locked() to kmd backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21255>
2023-02-15 23:30:58 +00:00
José Roberto de Souza
0c8d8ae13c anv: Add gem_mmap to kmd backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21255>
2023-02-15 23:30:58 +00:00
José Roberto de Souza
32a8250b46 anv: Add gem_close to kmd backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21255>
2023-02-15 23:30:58 +00:00
Asahi Lina
b39947ee0c asahi: Drop agx_device.memctx
No longer used.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21348>
2023-02-15 22:16:51 +00:00
Asahi Lina
6ad64387dd asahi: Do not use memctx for pools / meta cache
ralloc is not thread-safe, so we can't use dev->memctx for allocating
context-specific things without locking. On top of that, we always
need to explicitly clean up pools anyway since we need to unref the BOs,
so there is no point to using a memctx.

And since pools need to be explicitly cleaned up, the meta cache code
needs explicit cleanup, so add that and drop memctx from there too.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21348>
2023-02-15 22:16:51 +00:00
Asahi Lina
9daaa9e44e asahi: Fix shader key cloning overreads
We call agx_get_shader_variant through with casted inner shader key
types, so it has to make sure to only copy as much of the union as is
actually valid.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21348>
2023-02-15 22:16:51 +00:00
Chia-I Wu
bac6062d10 turnip: fix a null descriptor set dereference
Fixed
dEQP-VK.pipeline.pipeline_library.graphics_library.misc.other.null_descriptor_set_in_monolithic_pipeline.

Fixes: cb3872f2cd ("tu: Implement VK_EXT_descriptor_buffer")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21328>
2023-02-15 20:36:30 +00:00
Chia-I Wu
bce8e7f2ae turnip: fix a major leak with GPL LTO
This allows dEQP-VK.pipeline.pipeline_library.* to run to finish.

Fixes: e9f5de11d4 ("tu: Initial implementation of VK_EXT_graphics_pipeline_library")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21328>
2023-02-15 20:36:30 +00:00
Danylo Piliaiev
c7f18e4183 tu: Don't expose KHR_present_id,KHR_present_wait without KHR_swapchain
VK_KHR_present_id and VK_KHR_present_wait depend on VK_KHR_swapchain
being present, which is not present at least on Android/KGSL.

Fixes:
src/vulkan/util/vk_extensions.h:450: void assert_device_extensions_requirements(
 const struct vk_device_extension_table *, const struct vk_instance_extension_table *):
 assertion "!device_ext->KHR_present_id || device_ext->KHR_swapchain" failed

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21345>
2023-02-15 20:21:17 +00:00
Constantine Shablya
09501fe5a7 anv,hasvk: flush what UNIFORM_READ flushes on SHADER_READ
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8287
Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21310>
2023-02-15 19:53:41 +00:00
Emma Anholt
6de8b9a65b egl/kopper: Pass ancillary invalidate flush flags down to gallium.
We can just add the flags to the kopper interface, since it's private to
Mesa.  This gets us depth/stencil invalidation on swapbuffers, which is
critical for tiler performance.

glmark2-es2 -b texture (windowed) goes from 1650 to 1930 fps on
zink+turnip with ZINK_DEBUG=rp.

Part of #7321 (we're still a little behind freedreno's 2180 fps)

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21317>
2023-02-15 19:17:07 +00:00
Emma Anholt
53780b7a3a egl/kopper: Use the kopper private interface for swapBuffers.
I'm going to be introducing an extra flag to indicate EGL vs GLX behavior
in the private interface.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21317>
2023-02-15 19:17:07 +00:00
Emma Anholt
3e1b40be54 egl: Add a note explaining the swapBuffers badness in dri2_x11_copy_buffers().
I tried to drop the swapBuffers path, but it turns out it's being taken by
softpipe/llvmpipe, and the tests are passing.  The piglit egl-copy-buffers
test even passes on zink, but you end up with a bad display because of an
un-preserved back buffer.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21317>
2023-02-15 19:17:07 +00:00
Emma Anholt
a6b850e335 egl/kopper: Add assert for no kopper in dri2_copy_region.
This shouldn't be doing a swapBuffers, that's not what this function is
supposed to do.  But also, we shouldn't be doing this from zink, which the
swap was introduced for, because we don't implement the extension.  Cleans
up some strangeness from 3c4be122cc ("egl: implement more hooks for
swrast")

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21317>
2023-02-15 19:17:07 +00:00
Erik Faye-Lund
24a32b2cab Revert "meson: Fix Asahi build on macOS"
This reverts commit 4ca4a05627.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Asahi Lina <lina@asahilina.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21185>
2023-02-15 18:35:14 +00:00
Erik Faye-Lund
29ffc79410 meson: don't pass vk wsi args where they don't belong
Only code that cares about Vulkan WSI should get the corresponding
arguments passed. Otherwise, the Vulkan headers might end up including
other headers that we don't have the correct dependencies passed for.
So let's give those a dedicated variable, and only pass that where it's
actually needed.

Fixes: b39958a3a1 ("anv,nir: Move the ANV YCbCr lowering pass to common code")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8193
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21185>
2023-02-15 18:35:14 +00:00
Erik Faye-Lund
7ea85871fe vulkan: prefer vulkan_core.h over vulkan.h
If we include vulkan.h, we risk including the WSI bits as well, which we
don't need here. Only trouble can follow from including these where
they're not needed.

So let's include vulkan_core.h in these places instead.

Fixes: b39958a3a1 ("anv,nir: Move the ANV YCbCr lowering pass to common code")
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21185>
2023-02-15 18:35:14 +00:00
Mike Blumenkrantz
f5bde99cbd gallium: plumb resolve attachments through from frontends -> pipe_framebuffer_state
some drivers may find this useful

Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18695>
2023-02-15 18:06:16 +00:00
Samuel Pitoiset
073cced868 radv/ci: add missing expected failures with RADV_PERFTEST=gpl on GFX1100
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21334>
2023-02-15 17:29:10 +00:00
Constantine Shablya
bd848ac92d hasvk: use Vulkan runtime's robust buffer access
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21338>
2023-02-15 16:46:59 +00:00
Constantine Shablya
5053527806 anv: use Vulkan runtime's robust buffer access
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21338>
2023-02-15 16:46:59 +00:00
David Rosca
9873ccb071 frontends/va: Map VAEncCodedBufferType buffer as PIPE_MAP_READ
VAEncCodedBufferType is used for reading back encoded data.
Mapping it for read instead of write speeds up reading
the data on CPU.

On radeonsi this will result in VRAM copy to staging buffer
in cached GTT, making the CPU read much faster.

Signed-off-by: David Rosca <nowrep@gmail.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20376>
2023-02-15 14:26:31 +00:00
Kai Wasserbäch
e832d6a1bb fix: clover/llvm: replace llvm::None with std::nullopt for LLVM 17+
llvm::None was deprecated and builds started failing with

  error: ‘None’ is not a member of ‘llvm’

Instead of using the temporarily available include in ADT which would
add a deprecation warning to the build, directly replace llvm::None with
the recommended std::nullopt

This change takes only effect with LLVM 17 or newer.

Reference: d4f38ef288/llvm/include/llvm/ADT/None.h
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21125>
2023-02-15 12:00:06 +00:00
Danylo Piliaiev
b7ab83d59f ir3: Consider dst type in ubo_vec4 to ldc lowering
The dst type could be either 16b or 32b.

Fixes validation failure in dEQP-VK.subgroups.* tests which deal with
16b types.

 validation fail: (type_size(instr->cat6.type) <= 16) == !!((instr->dsts[0])->flags & IR3_REG_HALF)
   -> for instruction: MESA: info: 0023:0000:000:        ldc.offset0.base0 hssa_23 (wrmask=0x3), ssa_1, ssa_22

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21316>
2023-02-15 09:49:39 +00:00
Karmjit Mahil
e089166776 pvr: Add support for VK_ATTACHMENT_LOAD_OP_LOAD.
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21280>
2023-02-15 09:29:21 +00:00
Karmjit Mahil
c75c58e54c pvr: Upload spm load programs to device.
The programs are currently unused but will be needed for the spm
background object load op.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21279>
2023-02-15 09:16:03 +00:00
Karmjit Mahil
d6408e08df pvr: Add SPM load usc empty programs
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21279>
2023-02-15 09:16:03 +00:00
Nanley Chery
5d24682aae iris: Drop iris_cache_flush_for_render
Before dropping this function, handle the two callers of this function:

* The call in iris_blorp.c is redundant. The required cache flushes are
  already handled by the callers of blorp functions. Delete this.

* The call in iris_resolve.c is still providing a benefit because it
  calls iris_emit_buffer_barrier_for internally. Inline the needed
  barrier.

Cc: 23.0 <mesa-stable>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21303>
2023-02-15 05:49:23 +00:00
Nanley Chery
7c367bef0d iris: Flush caches for aux-mode changes more often
Memory accesses can get corrupted when there's a disagreement between:
* the aux-mode of existing cache lines for a surface and
* the aux-usage in that surface's RENDER_SURFACE_STATE object

We have already prevented hardware from seeing this conflict for
rendering operations, but due to how the L3 is shared among multiple
clients in gfx12 (e.g., sampler engine, render engine, etc.), we need to
expand the scope of the existing solution. Now, before any access of a
compressible resource, we make sure to flush the prior aux-mode from the
caches.

The majority of changes here refactor things for use in a new function,
flush_previous_aux_mode. The remaining change calls that function from
within iris_resource_prepare_access.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6558
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7625
Cc: 23.0 <mesa-stable>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21303>
2023-02-15 05:49:23 +00:00
Nanley Chery
ad9c0b7a84 iris: Update comment in iris_cache_flush_for_render
Update the comment to reflect the fact that iris no longer switches
between CCS_E and CCS_D.

Cc: 23.0 <mesa-stable>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21303>
2023-02-15 05:49:23 +00:00
Yonggang Luo
9e934ee068 meson: Combine duplicated c_args and cpp_args
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19185>
2023-02-15 03:42:02 +00:00
Yonggang Luo
2626946490 meson: Split c_cpp_args from pre_args
pre_args should not include compiler options

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19185>
2023-02-15 03:42:02 +00:00
Eric Engestrom
4ff295e1d8 meson: drop TODO: opengl, it's done
Suggested-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19600>
2023-02-15 02:53:54 +00:00
Eric Engestrom
1fa68d91c6 meson: only build glsl when needed
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19600>
2023-02-15 02:53:54 +00:00
Eric Engestrom
e0adef2652 meson: only build libglsl_util when needed
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19600>
2023-02-15 02:53:54 +00:00
Eric Engestrom
0404918f61 meson: only build the loader when needed
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19600>
2023-02-15 02:53:54 +00:00
Eric Engestrom
ef564f9391 meson: only build mapi when needed
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19600>
2023-02-15 02:53:54 +00:00
Eric Engestrom
de90690aba meson: move float64_glsl_file one meson.build up
anv uses it.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19600>
2023-02-15 02:53:54 +00:00
Mike Blumenkrantz
0337acad15 lavapipe: enable linear filtering for depth formats
this seems to work according to cts

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20859>
2023-02-15 01:49:30 +00:00
Mark Janes
4b97e349cd intel: Implement Wa_16011448509
"Use 3DSTATE_CONST command for individual shaders instead of
3DSTATE_CONST_ALL COMMAND"

On gen 12.0 platforms, 3DSTATE_CONSTANT_ALL command is not processed
correctly in certain cases.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21301>
2023-02-15 01:10:42 +00:00
Mike Blumenkrantz
f0e1512673 zink: block LINEAR filtered blits for zs formats
this is illegal, and the u_blitter path has to be taken to guarantee
enough accuracy that the strictest piglit tests pass

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21314>
2023-02-14 23:52:34 +00:00
Mike Blumenkrantz
120a506e70 Revert "zink: always use NEAREST for zs blits"
This reverts commit 067545eb9a.

this is good enough for CI but not enough for anholt's piglit tests

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21314>
2023-02-14 23:52:34 +00:00
Eric Engestrom
6ac830ccb1 vk/runtime: turn vk.xml extension requirements into asserts
More specifically, turn
  <extension name="VK_KHR_foo" requires="VK_KHR_bar">
into
  assert(!ext->KHR_foo || ext->KHR_bar);

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21261>
2023-02-14 23:28:29 +00:00
Eric Engestrom
a654a303f8 vk/runtime: keep track of supported instance extensions
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21261>
2023-02-14 23:28:29 +00:00
Eric Engestrom
ca98e4446b vk/util: keep track of extension requirements
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21261>
2023-02-14 23:28:29 +00:00
Jesse Natalie
87e83ce58e dzn: Enable KHR_storage_buffer_storage_class
It's required for VK1.1 and Mesa's SPIR-V parser handles it for us.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21261>
2023-02-14 23:28:29 +00:00
Lionel Landwerlin
9ac192d79d intel/fs: bound subgroup invocation read to dispatch size
This is to avoid out of bound register accesses (potentially leading
to hangs) when the dispatch size is smaller than when is reported in
the NIR subgroup_size.

v2: Implement bounding with a mask (since workgroup sizes are powers of 2) (Faith)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 530de844ef ("intel,anv,iris,crocus: Drop subgroup size from the shader key")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21282>
2023-02-14 21:29:42 +00:00
Mike Blumenkrantz
0d445cfb7e zink: enable renderpass optimizations by default for selected drivers
CI has been running this for months on turnip, so let's give it some
broader testing

also add a ZINK_DEBUG=norp for testing

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21296>
2023-02-14 20:06:16 +00:00
Georg Lehmann
4fbcd046ce aco: Don't use vcmpx with DPP.
V_CMPX+DPP returns 0 with reads from disabled lanes, unlike V_CMP+DPP (RDNA3 ISA doc, 7.7)

Fixes: baab6f18c9 ("aco: Optimize branching sequence during SSA elimination.")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20537>
2023-02-14 19:15:17 +00:00
Faith Ekstrand
41b0407d5c nir/from_ssa: Use more helpers in resolve_parallel_copies
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21299>
2023-02-14 17:54:12 +00:00
Kenneth Graunke
3e09a636db nir: Fix typos in the from-SSA pass comments
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21299>
2023-02-14 17:54:12 +00:00
Kenneth Graunke
b1ebd9978c nir: Fix merge_set_dump() to compile again
This #if 0'd debug code has been broken since -Werror=vla was added.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21299>
2023-02-14 17:54:11 +00:00
Kenneth Graunke
8343d7fd2a nir: Print divergence information for registers as well as SSA defs
This patch causes us to print "con" and "div" for registers as well as
SSA defs.  We print it on both register declarations, and destinations.
The latter isn't strictly necessary, but it is handy to be able to see
e.g. a convergent value being assigned to a divergent register without
having to constantly refer back to definitions that might be much
earlier in the program.  I originally printed it for sources as well,
but that got to be a bit wordy, so I dropped that.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21299>
2023-02-14 17:54:11 +00:00
Erik Faye-Lund
139dd4e772 meson: remove unused USE_FOO_ASM defines
The usage of these defines was removed, so let's remove the definitions
as well.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21212>
2023-02-14 17:22:14 +00:00
Rohan Garg
d64000dbb3 anv/blorp: use existing function to convert the op to a string
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21283>
2023-02-14 16:55:21 +00:00
Rohan Garg
80790f50db isl: fix some documentation
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21283>
2023-02-14 16:55:21 +00:00
Rohan Garg
4e61191065 anv: reuse the VK_IMAGE_ASPECT_PLANES_BITS_ANV macro
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21283>
2023-02-14 16:55:21 +00:00
Rohan Garg
5bb217a07a anv: drop unused headers
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21283>
2023-02-14 16:55:21 +00:00
Georg Lehmann
281a505ef0 aco: new 16bit VOP3 opcodes can use opsel
No Foz-DB changes on gfx11.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20705>
2023-02-14 16:14:55 +00:00
Corentin Noël
e8091a6593 ci/venus: Skip tests risking out of memory issues
These two dEQP tests:
 * dEQP-VK.api.object_management.max_concurrent.graphics_pipeline
 * dEQP-VK.api.object_management.max_concurrent.compute_pipeline

Require a lot of memory and might kill crosvm or the renderer server because of EOM
issues. Skip them for now.

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21306>
2023-02-14 15:56:20 +00:00
Samuel Pitoiset
fa66c8954e radv: ignore registering pipeline libaries with SQTT
They aren't executable pipelines and they might not contain all
shader stages.

This fixes a crash when generating RGP captures with GPL.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21235>
2023-02-14 15:03:45 +00:00
Erik Faye-Lund
b68f13bc90 zink: remove incorrect trailing comma
A trailing comma in a list is not valid JSON. Let's drop it.

Fixes: f7b2dbb2bd ("zink: relax bresenhamLines requirement for non-strictLine drivers")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21211>
2023-02-14 14:44:03 +00:00
Erik Faye-Lund
445d104dd9 zink: correct companies in requirements
These contributors don't work for Zink itself, but various companies
who's working on Zink. Add the correct ones.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21211>
2023-02-14 14:44:03 +00:00
Michel Dänzer
aaa407e3bd ci: Enable the hasvk Vulkan driver in the fedora-release job
To match the Fedora packaging.

While at it, sort the Vulkan drivers alphabetically.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21236>
2023-02-14 12:59:44 +00:00
Michel Dänzer
0511e6cf64 ci: Enable i915 Gallium driver in fedora-release job
To match the Fedora packaging.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21236>
2023-02-14 12:59:44 +00:00
Michel Dänzer
e4b7e68130 ci: Re-enable intel-clc in fedora-release job
Fedora 36 has new enough llvm-spirv-translator.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21236>
2023-02-14 12:59:44 +00:00
Michel Dänzer
1589d004f1 ci: Update Fedora image to 36
Fedora 34 is EOL.

With Fedora 37, ccache hangs in a futex syscall in CI for some reason,
so let's go with 36 for now.

v2:
* No need to add -Wno-error=stringop-overflow anymore.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21236>
2023-02-14 12:59:44 +00:00
Michel Dänzer
2a626f999a clover: Reserve vector memory in make_text_section
This isn't strictly required, but it works around
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100366 , and it might
avoid a memory reallocation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21236>
2023-02-14 12:59:44 +00:00
Michel Dänzer
53ce756eeb anv/grl: Use union for reinterpreting integer as float
Fixes strict aliasing violations flagged by GCC 12:

../src/intel/vulkan/grl/include/GRLOCLCompatibility.h: In function ‘float as_float(uint32_t)’:
../src/intel/vulkan/grl/include/GRLOCLCompatibility.h:182:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  182 |     return *reinterpret_cast<float*>(&i);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/intel/vulkan/grl/include/GRLOCLCompatibility.h: In function ‘float3 as_float3(int3)’:
../src/intel/vulkan/grl/include/GRLOCLCompatibility.h:187:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  187 |     return *reinterpret_cast<float3*>(&i3);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/intel/vulkan/grl/include/GRLOCLCompatibility.h:187:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../src/intel/vulkan/grl/include/GRLOCLCompatibility.h: In function ‘float4 as_float4(int4)’:
../src/intel/vulkan/grl/include/GRLOCLCompatibility.h:192:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  192 |     return *reinterpret_cast<float4*>(&i4);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/intel/vulkan/grl/include/GRLOCLCompatibility.h:192:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

Fixes: 5f948503e4 ("anv: Import GRL")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21236>
2023-02-14 12:59:44 +00:00
Mike Blumenkrantz
a10529080b zink: set ZINK_DESCRIPTORS=db for radv jobs
there's no testing for this in ci, and radv has a unique heap/memory
setup which catches allocation regressions

Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20968>
2023-02-14 12:14:49 +00:00
Marcin Ślusarz
75e5d458a0 anv: enable task redistribution
Disabling is no longer needed after "intel/compiler/mesh: use
slice id of task urb handles in mesh shaders".

This reverts commit 4eaecd7965.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7141

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21007>
2023-02-14 09:36:53 +00:00
Marcin Ślusarz
dd9bf86725 intel/compiler/mesh: use slice id of task urb handles in mesh shaders
When mesh shader is spawned on a different slice than the originating
task shader, then input task urb handle can come from a different
slice, so masking this information off will load data from the current
slice, instead of the one where real data are.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21007>
2023-02-14 09:36:53 +00:00
Lionel Landwerlin
9ddd296cd3 anv: implement VK_EXT_vertex_input_dynamic_state
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21026>
2023-02-14 09:05:35 +00:00
Lionel Landwerlin
95e3278285 anv: move 3DSTATE_VERTEX_ELEMENT emission to dynamic path
Prep work for VK_EXT_vertex_input_dynamic_state

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21026>
2023-02-14 09:05:35 +00:00
Lionel Landwerlin
46ecd56191 anv: remove copied information from runtime graphics state
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21026>
2023-02-14 09:05:35 +00:00
Marcin Ślusarz
b1bb44cf65 anv: fix how unset gl_Viewport & gl_Layer are handled in mesh case
See also: c6f69eea6a ("anv/pipeline: Properly handle unset gl_Layer and gl_ViewportIndex")

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17620>
2023-02-14 08:24:51 +00:00
Marcin Ślusarz
9d3e3c15f3 intel/compiler: replace gl_Layer & gl_ViewportIndex by 0 in fs if ms doesn't write it
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17620>
2023-02-14 08:24:51 +00:00
Samuel Pitoiset
5d41d8258a radv: disable DCC for mipmaps on GFX11
It seems broken but can't really figure out why and DCC levels aren't
interleaved on GFX11. Skipping DCC initialization for levels seems to
also fix it but seems safer to disable completely, as a hotfix.

Fixes DCC issues with Hi-Fi Rush, Sonic Frontiers, Hogwarts Legacy
and probably more.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8230
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21186>
2023-02-14 07:15:57 +00:00
Emma Anholt
6cbc90df48 ci/etnaviv: Update deqp xfails for gc2000.
More of a mixed bag here than gc7000, but at least the status is stable
in the last 3 nightly runs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21294>
2023-02-14 06:33:12 +00:00
Emma Anholt
fe9a00af34 ci/etnaviv: Drop stale xfails from gc7000.
These have passed in 3/3 of the last nightly runs.  Congrats, etnaviv!

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21294>
2023-02-14 06:33:11 +00:00
Emma Anholt
29ffdd72a1 ci/radv: Add a skip for navi21-llvm for a test that consistently timeouts.
I had seen this in my last round of work, but forgot to git add the skips
file.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21294>
2023-02-14 06:33:11 +00:00
Mike Blumenkrantz
56108b411f zink: verify compressed format layer count when creating surfaces
this is illegal for some cases, and mesa/st is equipped to handle
per-layer copying here

fixes #8283

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21292>
2023-02-14 01:50:14 +00:00
Mike Blumenkrantz
64708f9316 zink: don't handle mutable init on surface creation with tc enabled
using the cmdbuf during this call is illegal and causes desync, thus
the initialization has to be deferred until the surface is bound

fixes #7579

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21292>
2023-02-14 01:50:14 +00:00
Mike Blumenkrantz
44ce7ee6c1 zink: const-ify a surface param
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21292>
2023-02-14 01:50:14 +00:00
Mike Blumenkrantz
d05b7ef641 zink: break out pipe_surface init for new surface creation
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21292>
2023-02-14 01:50:14 +00:00
Mike Blumenkrantz
b288e5d0ce zink: account for null surface when trying to retain clears on fb bind
not currently possible but will be soon

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21292>
2023-02-14 01:50:14 +00:00
Mike Blumenkrantz
f770263ab6 zink: only try for a fb rebind if fb binds exist in rebind_image()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21292>
2023-02-14 01:50:14 +00:00
Mike Blumenkrantz
f11e9e3aa1 zink: fix indentation of rebind_image()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21292>
2023-02-14 01:50:14 +00:00
Dave Airlie
6d3c79fa4c crocus: switch gen4/5 tiling flags to follow suggestions.
Fixes: 6043f66dd3 ("crocus: disable Y tiling for render targets properly.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21300>
2023-02-14 01:31:46 +00:00
Eric Engestrom
723569d71e broadcom/ci: mark test as flaky
It passed once here: https://gitlab.freedesktop.org/gdevi/mesa/-/jobs/36317041

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21295>
2023-02-14 00:52:35 +00:00
Emma Anholt
5c246e21b7 Revert "freedreno/a5xx: Fix clip_mask"
This reverts commit 2dfebf3487.

It causes GPU hangs in piglit tests like
spec@glsl-1.20@execution@clipping@vs-clip-vertex-enables, for reasons I'm
totally unclear on.  The commit was not necessary, because the frontend
lowering already handles disabled clip planes by storing 0.0 to the
corresponding clipdist array element in that shader variant.  Add a note
to that effect.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21298>
2023-02-14 00:16:50 +00:00
Emma Anholt
509c1f9fea ci/freedreno: Update manual-run xfails for a530.
While I'm having a hard time stabilizing most of the test list on this HW
due to the clip-enable GPU hangs leaking into random other tests, these
have been consistent in the last 4 runs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21298>
2023-02-14 00:16:50 +00:00
Giancarlo Devich
11bec22647 d3d12: Don't clear d3d12_shader_key
The shader key structure is quite large and memsetting it to zero to be
able to create or often simply find an existing shader is responsible
for a large portion of CPU usage during benchmarks.

This change is more surgical about what, when, and how things get
cleared.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21247>
2023-02-13 22:57:03 +00:00
Giancarlo Devich
f9a827d61e nir: Check sampler_binding is valid when lowering tex shadow
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21247>
2023-02-13 22:57:03 +00:00
Giancarlo Devich
b2e5484171 d3d12: Add unions to encompass shader key stage vars, use in hashing
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21247>
2023-02-13 22:57:03 +00:00
Giancarlo Devich
806f100ad2 d3d12: Use varying comparison function for TESS stage key compare
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21247>
2023-02-13 22:57:03 +00:00
Alan Coopersmith
289eb50abf util/disk_cache: Handle OS'es without d_type in struct dirent
Needed to build on Solaris

Fixes: f58e6fee74 ("util/disk_cache: delete more cache items in one go when full")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21110>
2023-02-13 22:18:23 +00:00
Mike Blumenkrantz
067545eb9a zink: always use NEAREST for zs blits
LINEAR is illegal, and swapping filtering at this point still
seems to be conformant given questionable GL spec requirements for
LINEAR zs filtering

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21203>
2023-02-13 21:00:34 +00:00
Konstantin Seurer
77f59950fd radv/rra: Hide deferred accel struct data destruction behind an env var
Keeping around copies of the BVHs in CPU memory can cause issues with
Applications creating a large amount of acceleration structures (Control).
This commit adds back the old path of copying acceleration structures
while still keeping the deferred, possibly more accurate path around.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20700>
2023-02-13 20:39:30 +00:00
Konstantin Seurer
5093ea6d41 radv/rra: Find copy memory index when initializing the trace state
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20700>
2023-02-13 20:39:30 +00:00
Lionel Landwerlin
eb5d7056e0 anv/hasvk: handle a SAMPLED_READ/STORAGE_READ access flags
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21277>
2023-02-13 20:11:40 +00:00
SoroushIMG
96849363eb zink: free resource objects' views array during destruction
since the array is not ralloc managed, it has be explicitly freed.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21285>
2023-02-13 19:00:06 +00:00
SoroushIMG
da5137ef61 zink: stop creating pipeline library cache for non-optimal_key drivers
currently the nin-optimal codepath doesn't use this at all and this just
leaks memory due to not handling non-tcs generated shaders.

Fixes: 487ac6dbd6 ("zink: implement cross-program pipeline library sharing")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21285>
2023-02-13 19:00:06 +00:00
SoroushIMG
b3ed037ca8 zink: allocate program shader caches from the program's mem ctx
these will now be freed when the program itself is freed.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21285>
2023-02-13 19:00:06 +00:00
SoroushIMG
6af3a12e70 zink: fix compute shader leaks
Compute program owns the nir and zink shaders now and must free them
too when destroyed.

Fixes: 4cb4bb555e ("zink: create compute programs from compute shaders directly")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21285>
2023-02-13 19:00:06 +00:00
Michel Zou
742c77078c ci/mingw: drop useless -Wno-error flags
Will prevent merging incorrect code like in #8260

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21244>
2023-02-13 18:00:34 +00:00
Chia-I Wu
4e03cfa3c6 radv: fix a hang with binning on CHIP_RENOIR
Using (6, 16) for (context_states_per_bin, persistent_states_per_bin)
causes gpu hang in RDR2 benchmark on CHIP_RENOIR.  Follow radeonsi and
use (3, 8) instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21254>
2023-02-13 17:23:53 +00:00
osy
1c72424770 virgl: enable timer queries only if host supports it
Timer queries is tied to GL_ARB_timer_query/GL_EXT_disjoint_timer_query
support on the host. We have a flag that detects this so lets use it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20380>
2023-02-13 16:07:12 +00:00
Alyssa Rosenzweig
f2740ac69c pan/decode: Add support for decoding CSF
Add support to pandecode for Mali architecture v10, featuring the new command
stream frontend (CSF). This replaces the "job chain" with a new Command
Execution Unit (CEU) that runs a domain-specific assembly language. That
requires us to refactor pandecode substantially, splitting out JM-only code from
shared JM/CSF common code, and adding new CSF-only decode routines to
disassemble and interpret CSF command streams and pretty-printing the
data structures hit.

This is of course impossible to do properly, since the CEU is pretty easily
Turing-complete and hence subject to the halting problem. But we implement some
simple heuristics to follow jumps that are just good enough for the simple
command streams emitting by both the DDK and Panfrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20837>
2023-02-13 15:24:10 +00:00
Alyssa Rosenzweig
102d4292d5 panfrost: Fix some fields in v10.xml
Correct some errors from the file's initial check in, as we're about to add
corresponding pandecode changes for the file.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20837>
2023-02-13 15:24:10 +00:00
Alyssa Rosenzweig
39774503b3 asahi: Implement indirect draws
Passes dEQP-GLES31.functional.draw_indirect.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21273>
2023-02-13 09:51:42 -05:00
Alyssa Rosenzweig
ad3375478c asahi: Refactor index buffer upload for indirect
We need to avoid the reference to draws->count when indirect draws are used, as
it is not available CPU side.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21273>
2023-02-13 09:51:42 -05:00
Alyssa Rosenzweig
e4731ec335 asahi: Remove default=true on index list values
These will cause issues with indirect draws.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21273>
2023-02-13 09:51:42 -05:00
Alyssa Rosenzweig
7968c474b8 panvk: Disable SNORM rendering
Driver isn't ready for this yet. 7f98a9ba2b ("panfrost: Implement
GL_EXT_render_snorm on Bifrost+") caused piles of tests to go from NotSupported
-> Fail, so let's functionally revert that.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21257>
2023-02-13 14:04:52 +00:00
Alyssa Rosenzweig
6142d50375 panvk: Fix varying linking
Since 2316b80d77 ("panfrost: Don't use nir_variable to link varyings"), we can
only get correct type information from the fragment shader inputs (not the
vertex shader output). Fixes piles of CTS regressions.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21257>
2023-02-13 14:04:52 +00:00
Alyssa Rosenzweig
1ba20868c4 panvk: Take lock when tracing
We're not supposed to call the GENX(pandecode_jc) routines (e.g.
pandecode_jc_v7), since it's an internal interface that expects the caller to
take a lock first. Instead we're supposed to call the non-GenXML pandecode_jc
entrypoint which does the locking properly. Fixes assertion failures when
tracing with recent pandecode:

deqp-vk: ../src/util/simple_mtx.h:142: simple_mtx_assert_locked: Assertion `mtx->val' failed.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21257>
2023-02-13 14:04:52 +00:00
Karol Herbst
13a4c49cb1 rusticl/program: enable spirv
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19008>
2023-02-13 12:45:07 +00:00
Karol Herbst
2a0b58434d rusticl/kernel: fix clGetKernelInfo CL_KERNEL_ATTRIBUTES for non source programs
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19008>
2023-02-13 12:45:07 +00:00
Marcin Ślusarz
771f7c1d91 anv: bump ANV_MAX_QUEUE_FAMILIES
Now it's possible to overflow anv_physical_device.queue.families
and anv_device.decoder.

CID: 1520852

Fixes: 056b0cb87f ("anv: add video engine support in various places")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21278>
2023-02-13 12:19:45 +00:00
Yusuf Khan
a157133380 nvc0/nv50: support and enable EXT_memory_object*
Passes the ext_external_objects-memory-object-api-errors piglit:

./bin/ext_external_objects-memory-object-api-errors
Mesa: User error: GL_INVALID_VALUE in glTexStorageMem1DEXT(memory=0)
PIGLIT: {"subtest": {"1D texture" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTexStorageMem2DEXT(memory=0)
PIGLIT: {"subtest": {"2D texture" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTexStorageMem3DEXT(memory=0)
PIGLIT: {"subtest": {"3D texture" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTextureStorageMem1DEXT(memory=0)
PIGLIT: {"subtest": {"1D texture direct state access" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTexureStorageMem2DEXT(memory=0)
PIGLIT: {"subtest": {"2D texture direct state access" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTextureStorageMem3DEXT(memory=0)
PIGLIT: {"subtest": {"3D texture direct state access" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTexStorageMem2DMultisampleEXT(memory=0)
PIGLIT: {"subtest": {"2D texture ms" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTexStorageMem3DMultisampleEXT(memory=0)
PIGLIT: {"subtest": {"3D texture ms" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTextureStorageMem2DMultisampleEXT(memory=0)
PIGLIT: {"subtest": {"2D texture ms direct state access" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTextureStorageMem3DMultisampleEXT(memory=0)
PIGLIT: {"subtest": {"3D texture ms direct state access" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glBufferStorageMemEXT(memory == 0)
PIGLIT: {"subtest": {"buffer storage" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glNamedBufferStorageMemEXT(memory == 0)
PIGLIT: {"subtest": {"buffer storage direct state access" : "pass"}}
Mesa: User error: GL_INVALID_ENUM in glGetUnsignedBytevEXT(pname=0xffffffff)
PIGLIT: {"subtest": {"unsigned-byte-v-bad-enum" : "pass"}}
Mesa: User error: GL_INVALID_ENUM in glGetUnsignedBytei_vEXT(pname=0xffffffff)
PIGLIT: {"subtest": {"unsigned-byte-i-v-bad-enum" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glGetUnsignedBytei_vEXT(pname=GL_DEVICE_UUID_EXT)
PIGLIT: {"subtest": {"unsigned-byte-i-v-bad-value" : "pass"}}

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19405>
2023-02-13 12:03:13 +00:00
Alyssa Rosenzweig
8e1eee8b5e asahi: Add XML for VDM memory barriers
We'll use these in our implementation of transform feedback.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21272>
2023-02-13 11:45:03 +00:00
Alyssa Rosenzweig
8e0e68510f asahi: Add XML for indirect draws
Nice and simple.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21272>
2023-02-13 11:45:03 +00:00
Alyssa Rosenzweig
c3b8928b84 asahi: Add XML for indirect dispatch
This splits up the CDM commands into their subparts, after which
indirect dispatch is straightforward.

Also fix the pipeline bits.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21272>
2023-02-13 11:45:03 +00:00
Alyssa Rosenzweig
3da4838591 asahi: Submit batches that don't touch RTs
If there is any draw, we should submit in case there are active queries,
fragment shader side effects, etc. Together with previous commit fixes
no_attachment framebuffers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21267>
2023-02-13 11:28:07 +00:00
Alyssa Rosenzweig
2c2f189fe7 agx: Write sample mask even with no colour output
Needed for discard to work properly, which has visible side effects with
occlusion queries. Fixes no_attachment framebuffers together with the next
commit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21267>
2023-02-13 11:28:07 +00:00
Alyssa Rosenzweig
e785ae6125 agx: Implement load_helper_invocation
Passes dEQP-GLES31.functional.shaders.helper_invocation.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21265>
2023-02-13 11:12:05 +00:00
Alyssa Rosenzweig
6214c9921a agx: Remove bogus gl_Position assertion
It is reasonable not to write gl_Position in a transform feedback program.

Fixes rendering of the apitrace of Domekeeper in #7798.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21266>
2023-02-13 10:48:13 +00:00
Alyssa Rosenzweig
eeae9b93de agx: Fix AGX_MAX_CF_BINDINGS
Potentially could be larger with aliasing of component offsets, though that
would be silly.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21266>
2023-02-13 10:48:13 +00:00
Alyssa Rosenzweig
fbe8878dcb agx: Respect component in frag load_input
Fixes fails in dEQP-GLES31.functional.separate_shader.random.*.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21266>
2023-02-13 10:48:13 +00:00
Alyssa Rosenzweig
a5d478d17c agx: Remove unused AGX_MAX_VARYINGS
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21266>
2023-02-13 10:48:13 +00:00
Mike Blumenkrantz
b73fe8d52e zink: also replace hash_entry::key when replacing separable program
this otherwise still points to the separable program's shader array
and will access freed memory

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
b5029a90df zink: calloc separable program zink_gfx_library_key struct
this matches other zink_gfx_library_key allocations

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
4cda98c827 zink: implement a scaling descriptor buffer size
previously descriptor buffers were sized to allow for 25,000 descriptors

this is a great number.

but in some scenarios it's overkill, and it's theoretically possible that
it might be underkill in others (citation needed), so add some handling
for both cases to save small amounts of vram on average and not crash
in the distant future when hypercomputers try running drawoverhead

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
453701256d zink: store base descriptor size on the screen
useful to have this around for reuse

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
651f322091 zink: ensure db is bound before separate shader update
seems unlikely but who knows

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
bec6087699 zink: move db_bound to batch descriptor data
this is where descriptor stuff goes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
f57f28a348 zink: move zink_batch_state::db_bound reset to zink_batch_descriptor_reset()
descriptor code goes in descriptor file

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
5b31659650 zink: rename a struct member for clarity
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
27dec4a262 zink: add an io assignment pass for separate shaders
usually this is handled by zink_compiler_assign_io() for full pipelines,
where locations are compacted and variables are eliminated, but separate
shaders still need to have "correct" locations set, which can be achieved
by relying on 'location' instead of the (failed) attempt by the frontend
to set 'driver_location' with nir_assign_io_var_locations()

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
13c6ad0038 zink: use a single descriptor buffer for all non-bindless types
the descriptor count (buffer size) calculated for buffers was based
on drawoverhead throughput, which is the fastest descriptors can be changed
at the cpu level. these cases demonstrate the maximum speed that ANY
descriptor can be changed, which means that changing multiple types in
a given cmdbuf will, at best, be the same throughput

thus, instead of allocating a separate buffer for each type, only a single
buffer needs to be allocated, and all descriptors can be bound to this buffer

this should reduce descriptor vram usage by ~80%

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
facb1b7884 zink: rework separate shader descriptor iterating
using the shader struct members is a bit more natural here and
avoids some confusion when one of the stages has no descriptors

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
e6a55bfc16 zink: flag gfx programs as removed-from-cache by default
this fixes some desync where async programs are destroyed before being
added to the cache

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
f70b1732da zink: assert that the found program matches the expected one in shader_free
avoid bugs

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
66f2a1c526 zink: don't fetch/update pipeline cache for separate shader programs
this is illegal

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
ffd91ee7a8 zink: fix descriptor pool free iterating
these arrays are sparsely allocated, and using pop() on them will
fail to access some elements

Fixes: cf7c17a7af ("zink: rework descriptor pool overflow")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
16c019142b zink: sync LTO compiles for GPL pipelines on shader free
this avoids invalid access

affects:
KHR-Single-GL46.arrays_of_arrays_gl.InteractionStorageBuffers2

Fixes: 41ffb15de5 ("zink: implement async gfx precompile")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Mike Blumenkrantz
e8b8279b61 zink: allocate all batch command buffers in one call
just simpler

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
2023-02-13 10:27:16 +00:00
Lionel Landwerlin
295dd6f515 intel/dev: add a default urb value for intel_stub_gpu on dg2
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/21249>
2023-02-13 09:38:06 +00:00
Samuel Pitoiset
214d6d05ed radv simplify compiling graphics shaders with a mask of active NIR stages
Instead of recomputing the same bitfield everywhere.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21237>
2023-02-13 09:15:37 +00:00
Samuel Pitoiset
8dd0b98786 radv: only initialize shader arguments for the active stages
Other stages don't need to be initialized.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21237>
2023-02-13 09:15:37 +00:00
Samuel Pitoiset
d05a02018b radv: use last_vgt_api_stage for determining the last stage with XFB
It's shorter and cleaner.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21237>
2023-02-13 09:15:37 +00:00
Mike Blumenkrantz
36d8443e5f zink: add a local is_compute var for set_shader_images
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
2023-02-13 08:42:36 +00:00
Mike Blumenkrantz
cff6e6e13b zink: pull out image descriptor updating in set_shader_images
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
2023-02-13 08:42:36 +00:00
Mike Blumenkrantz
1c1f075627 zink: rework set_shader_images() hook
this makes the code more methodical, readable, and correct, fixing a
number of issues along the way:
* inaccurate write_bind_count incrementing
* inaccurate barrier_access write unsetting
* inefficient partial rebinds
* leaking texel buffers

also add some comments to make this clearer

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
2023-02-13 08:42:36 +00:00
Mike Blumenkrantz
128192bffb zink: unref image buffer descriptors on unbind
Fixes: 7ab5c5d36d ("zink: use EXT_descriptor_buffer with ZINK_DESCRIPTORS=db")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
2023-02-13 08:42:36 +00:00
Mike Blumenkrantz
e5666fe7cc zink: remove stale comment
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
2023-02-13 08:42:36 +00:00
Mike Blumenkrantz
ee53b07c0a zink: unset gfx shader read when unbinding shader images
this otherwise will never be unset

Fixes: 50e764fa50 ("zink: track gfx/compute descriptor barrier info")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
2023-02-13 08:42:36 +00:00
Mike Blumenkrantz
892eae9af0 zink: rename some variables in zink_set_shader_images()
this is more consistent with set_sampler_views

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
2023-02-13 08:42:36 +00:00
Samuel Pitoiset
9f8c563e10 radv: fix importing retained NIR shaders when a lib uses the RETAIN bit
Fixes couple of GPL regressions with VKCTS, I thought this was test
bugs but it's valid behaviour as long as the libary uses
VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21245>
2023-02-13 08:17:05 +00:00
Alyssa Rosenzweig
edf78810a7 radv: Use common Get*OpaqueCaptureDescriptorDataEXT
Now stubbed by the Vulkan runtime for you, deduplicate.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by; Samuel Pitoiset <samuel.pitoiset@gmail.com>

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21230>
2023-02-13 07:43:11 +00:00
Alyssa Rosenzweig
2854dca898 tu,vulkan: Add common Get*OpaqueCaptureDescriptorDataEXT
In both tu and radv, these are all trivial. Move the trivial implementation from
tu to common code to deduplicate the boilerplate.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by; Samuel Pitoiset <samuel.pitoiset@gmail.com>

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21230>
2023-02-13 07:43:11 +00:00
Tapani Pälli
235e5806b3 iris: handle error in iris_resource_from_handle
In similar manner as fdab8fef7a we might fail creating resource,
let application handle the error. Application may have given wrong
input pitch when importing dmabuf.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8248
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21233>
2023-02-13 07:59:14 +02:00
Kai Wasserbäch
efcb63938c fix(FTBFS): clover: fix LLVM #include of Triple.h, moved to TargetParser
Upstream moved Triple.h from ADT to TargetParser in LLVM 17.

Reference: 62c7f035b4
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21262>
2023-02-12 18:36:07 +00:00
Kai Wasserbäch
7956b80bf8 fix(FTBFS): gallivm: fix LLVM #include of Triple.h, moved to TargetParser
Upstream moved Triple.h from ADT to TargetParser in LLVM 17.

Reference: 62c7f035b4
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21262>
2023-02-12 18:36:07 +00:00
Eric Engestrom
1e73fd4aa8 u_pipe_screen_lookup_or_create: avoid re-querying the fd to have a consistent hash key
In every current driver, the fd we get back from the screen is the fd we
gave to screen_create() three lines above (or a dup() thereof, which we
consider to be the same since we look inside it for the file description
instead).

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
2023-02-12 17:11:17 +00:00
Eric Engestrom
cd152ec930 asahi: use u_pipe_screen_lookup_or_create() to keep track of and reuse screens
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
2023-02-12 17:11:17 +00:00
Eric Engestrom
8193efec83 panfrost: use u_pipe_screen_lookup_or_create() to keep track of and reuse screens
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
2023-02-12 17:11:17 +00:00
Eric Engestrom
7b3ee9335f vc4: use u_pipe_screen_lookup_or_create() to keep track of and reuse screens
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
2023-02-12 17:11:16 +00:00
Eric Engestrom
769b511054 v3d: use u_pipe_screen_lookup_or_create() to keep track of and reuse screens
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
2023-02-12 17:11:16 +00:00
Eric Engestrom
759496cc45 lima: replace custom code with u_pipe_screen_lookup_or_create()
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
2023-02-12 17:11:16 +00:00
Eric Engestrom
e17c3af593 freedreno: replace custom code with u_pipe_screen_lookup_or_create()
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
2023-02-12 17:11:16 +00:00
Eric Engestrom
013f05872c gallium: move etnaviv screen_lookup_or_create function to common code
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
2023-02-12 17:11:16 +00:00
Eric Engestrom
1dea6aea20 etnaviv: use simple_mtx to avoid breaking windows in the next commit
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
2023-02-12 17:11:16 +00:00
Eric Engestrom
a72035f9c5 util: avoid calling kcmp on Android
On some combinations of Android version and kernel version, calling kcmp
results in seccomp killing the process.

As there doesn't seem to be a way to query for that in advance, skip
this check altogether on Android.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
2023-02-12 17:11:16 +00:00
Eric Engestrom
0d6c240fcc gallium/u_screen.h: add missing stdint.h include
For uint64_t.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
2023-02-12 17:11:16 +00:00
Hans-Kristian Arntzen
e40ed0f88b radv: Implement VK_ACCESS_2_DESCRIPTOR_BUFFER_READ_BIT_EXT.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Fixes: 46e0c77 ("radv: implement VK_EXT_descriptor_buffer")
Co-authored-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21271>
2023-02-12 15:45:52 +00:00
Hans-Kristian Arntzen
7efabfbbe4 radv: Fix missing VK_ACCESS_2_SHADER_SAMPLED_READ_BIT.
Cannot be used for SSBO, so ignore SCACHE invalidation.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Fixes: 8df17163c7 ("radv: implement vkCmdWaitEvents2KHR")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21271>
2023-02-12 15:45:52 +00:00
Hans-Kristian Arntzen
97aa8d9547 radv: Fix invalid 64-bit shift.
For sync2 bits, overflow can happen.
Use BITFIELD64_BIT to align with ANV.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Fixes: 8df17163c7 ("radv: implement vkCmdWaitEvents2KHR")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21271>
2023-02-12 15:45:52 +00:00
Michel Dänzer
49a6bdde8e glsl/standalone: Do not pass memory allocated with ralloc_size to free
Pointed out by GCC:

In function ‘load_text_file’,
    inlined from ‘standalone_compile_shader’ at ../src/compiler/glsl/standalone.cpp:491:38,
    inlined from ‘main’ at ../src/compiler/glsl/main.cpp:98:45:
../src/compiler/glsl/standalone.cpp:358:17: error: ‘free’ called on pointer ‘block_195’ with nonzero offset 48 [-Werror=free-nonheap-object]
  358 |             free(text);
      |                 ^
In function ‘ralloc_size’,
    inlined from ‘load_text_file’ at ../src/compiler/glsl/standalone.cpp:352:31,
    inlined from ‘standalone_compile_shader’ at ../src/compiler/glsl/standalone.cpp:491:38,
    inlined from ‘main’ at ../src/compiler/glsl/main.cpp:98:45:
../src/util/ralloc.c:117:18: note: returned from ‘malloc’
  117 |    void *block = malloc(align64(size + sizeof(ralloc_header),
      |                  ^

Fixes: a9696e79fb ("main: Close memory leak of shader string from load_text_file.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21215>
2023-02-12 15:13:04 +00:00
Michel Dänzer
bf67f32d4b glsl/standalone: Fix up _mesa_reference_shader_program_data signature
Drop the unused ctx parameter, to match the main Mesa code.

Fixes ODR violation flagged by -Wodr with LTO enabled:

../src/mesa/main/shaderobj.h:74:1: error: ‘_mesa_reference_shader_program_data’ violates the C++ One Definition Rule [-Werror=odr]
   74 | _mesa_reference_shader_program_data(struct gl_shader_program_data **ptr,
      | ^
../src/compiler/glsl/standalone_scaffolding.cpp:76:1: note: type mismatch in parameter 1
   76 | _mesa_reference_shader_program_data(struct gl_context *ctx,
      | ^
../src/compiler/glsl/standalone_scaffolding.cpp:76:1: note: ‘_mesa_reference_shader_program_data’ was previously declared here
../src/compiler/glsl/standalone_scaffolding.cpp:76:1: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used

Fixes: 717a720e9c ("mesa: drop unused context parameter to shader program data reference.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21215>
2023-02-12 15:13:04 +00:00
Rob Clark
c0bc0ecf9e freedreno: Avoid screen lock when no rsc tracking needed
In case there is no dirty state that requires resource tracking we
can skip taking the screen lock.  Indirect draw and index buffer are
a special case, but we can inexpensively check if they are already
referenced by the batch.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21202>
2023-02-11 16:36:38 +00:00
Rob Clark
b70ea03302 freedreno: Add FD_DIRTY_QUERY
Replace update_active_queries, which was really just a dirty-bit in
disguise.  This also lets us associate it with FD_DIRTY_RESOURCE so
we can skip the associated resource tracking when it isn't dirty.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21202>
2023-02-11 16:36:37 +00:00
Rob Clark
3a98822cc7 freedreno: Remove impossible NULL check
All gens implement query support now.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21202>
2023-02-11 16:36:37 +00:00
Rob Clark
918caaad59 freedreno: Move num_vertices calc to backend
Only used by a2xx and a3xx backends, so move it there.

Also make it more clear that fd6_emit::draw is only used in the
driver-params case.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21202>
2023-02-11 16:36:37 +00:00
Rob Clark
b15aaea1d5 freedreno/a6xx: Move num_driver_params to program state
No need to re-calculate this at draw time.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21202>
2023-02-11 16:36:37 +00:00
Bas Nieuwenhuizen
0a17c3afc5 nir: Apply a maximum stack depth to avoid stack overflows.
A stackless (or at least using allocated memory for stack) version
might be nice but for now this works around some games compiling
large shaders and hitting stack overflows.

CC: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21231>
2023-02-11 15:01:42 +01:00
Jesse Natalie
7ead717393 dzn: Enable 16bit types when supported
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
d7f9e2db59 dzn: Get options4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
08fc7315c5 dzn: Delete unused extensions table
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
cc906c0eed dzn: Enable get_surface_capabilities2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
a7d4309234 spirv2dxil: Support 16bit types
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
536ab16bc1 spirv2dxil: Move shader model into runtime conf struct
We'll want to use it to control the shape of the nir that we generate

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
4c527f4fc0 spirv2dxil: Lower unaligned loads and stores
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
9e2683c6f0 spirv2dxil: Set min UBO/SSBO alignments
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
58e7acb0e2 microsoft/compiler: Support lowering SSBO accesses to 16bit vectors
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
0f56fc09d9 microsoft/compiler: Support raw buffer load/store intrinsics with 16bit alignment
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
196dc72838 microsoft/compiler: Handle 48-bit stores to SSBO/shared
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
c994c8b3fd microsoft/compiler: Pass an alignment to constant buffer load lowering
This means we can stop doing conditionals and shifts if we know the
alignment of a load for a small amount of data.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
7fcb60be37 microsoft/compiler: Simplify bitpacking for load/store lowering with nir_extract_bits
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
7830901751 microsoft/compiler: Pass deref modes to unaligned pass and handle push const
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
facd2e4fdb microsoft/compiler: Move unaligned load/store pass from CL
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
f50843fcdb microsoft/compiler: Handle undef-rounding f2f16 as rtz
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
8782a0b8df microsoft/compiler: Ensure native_low_precision is set for 16-bit bitcasts/stores
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
4d76d46c13 microsoft/compiler: Handle frcp for float16/float64
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
ed13c2261c microsoft/compiler: Handle struct consts in DXIL module dumper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
25ee07373c nir_lower_fp16_casts: Allow opting out of lowering certain rounding modes
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
c0c2b60f1d nir: Add alignment to load_push_constant
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21029>
2023-02-11 06:12:23 +00:00
Jesse Natalie
42267588d7 ci/windows: Update LLVM to 15
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21168>
2023-02-11 05:24:08 +00:00
Jesse Natalie
e9ab33c9a1 microsoft/clc: Set features that are used by CL tests
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21168>
2023-02-11 05:24:08 +00:00
Jesse Natalie
b27d8ee2e9 clc: Include opencl-c-base.h with LLVM 15 (using builtins)
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21168>
2023-02-11 05:24:08 +00:00
Jonathan Marek
dda35e616b turnip: fix use of align() instead of util_align_npot() with tile_align_w
tile_align_w isn't always a power of two.

Fixes: aae679e221

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21251>
2023-02-11 04:56:52 +00:00
Karol Herbst
cb611b207d rusticl/icd: Make it work in case Rustc shuffles struct around
Nothing guarentees fields are in order or anything like that. So do proper offset math

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21242>
2023-02-11 04:13:57 +00:00
Karol Herbst
f6c5cd33b0 rusticl/util: extract offset_of macro
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21242>
2023-02-11 04:13:57 +00:00
Faith Ekstrand
af9212dd82 nir/deref: Preserve alignments in opt_remove_cast_cast()
This also removes the loop so opt_remove_cast_cast() will only optimize
cast(cast(x)) and not cast(cast(cast(x))).  However, since nir_opt_deref
walks instructions top-down, there will almost never be a tripple cast
because the parent cast will have opt_remove_cast_cast() run on it.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21252>
2023-02-10 23:08:19 +00:00
Sviatoslav Peleshko
9b2ddd2c5e anv: Handle VkAccelerationStructureBuildRangeInfoKHR::transformOffset
Previously it was not actually handled. This meant that all geometries
with the same transform buffer were using the same (first) transformation
matrix.

Fixes: f3ddfd81 ("anv: Build BVHs on the GPU with GRL")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7575
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21227>
2023-02-10 21:27:14 +00:00
Marcin Ślusarz
465c241266 intel/compiler/mesh: use U888X packed index format
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20910>
2023-02-10 21:03:33 +00:00
Danylo Piliaiev
2d20564a6a turnip: Disable draw states after dyn renderpass in all cases
Draw states were not disabled after a dynamic renderpass which
spans several command buffers, the next renderpass if started in
the same command buffer wouldn't emit the full draw state,
since TU_CMD_DIRTY_DRAW_STATE was not set by previous renderpass.

The issue could be observed when corrupting all regs at cmdbuf start in:
 dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed7_geometry

Fixes: cb0f414b2a
("tu: Add support for suspending and resuming renderpasses")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21148>
2023-02-10 20:29:40 +00:00
Danylo Piliaiev
855fa78866 turnip: Ensure that there is no renderpass rotation in binning
It appears that A6XX_GRAS_SC_CNTL::rotation applies to the binning,
so we should ensure there is no unexpected rotations and apply with
A6XX_GRAS_SC_CNTL during the binning pass.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21148>
2023-02-10 20:29:40 +00:00
Danylo Piliaiev
43ea1f2dfb freedreno: Document A6XX_GRAS_SC_CNTL::rotation field
Likely used for VK_QCOM_render_pass_transform.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21148>
2023-02-10 20:29:40 +00:00
Danylo Piliaiev
388e4ea733 tu: Prevent using stale value of GRAS_SC_CNTL in sysmem clear
cc: mesa-stable

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21148>
2023-02-10 20:29:40 +00:00
Danylo Piliaiev
981f1d88a1 tu: Prevent using stale value of RB_UNKNOWN_88D0 on BLIT
Fixes: def56b531c
("tu: Support GMEM with layered rendering and multiview")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21148>
2023-02-10 20:29:40 +00:00
Amber
99fb770c45 freedreno: use blendcoherent to set FLUSH_PER_OVERLAP
FLUSH_PER_OVERLAP is only necessary for gmem if coherent blending is
enabled.

Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21161>
2023-02-10 20:01:43 +00:00
Amber
527a74cb5d gallium: make BlendCoherent usable from gallium drivers
Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21161>
2023-02-10 20:01:43 +00:00
Amber
40bdd2bbf7 freedreno: use A6XX_GRAS_SC_CNTL_SINGLE_PRIM_MODE with fb readback
fixes:
dEQP-GLES31.functional.blend_equation_advanced.msaa.*

Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21161>
2023-02-10 20:01:43 +00:00
Mike Blumenkrantz
cd446b87e1 zink: add newlines to some debug printfs
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21239>
2023-02-10 19:42:53 +00:00
Väinö Mäkelä
13f68bcce1 hasvk: Tell spirv_to_nir float controls are always supported
This gets rid of the "Unsupported SPIR-V capability" warnings when
compiling shaders using float controls on gfx7.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20232>
2023-02-10 16:34:01 +00:00
Väinö Mäkelä
6f932276c3 hasvk: Don't claim shaderDenormPreserveFloat32 on gfx7
From the Haswell PRM Vol. 7, "IEEE Floating Point Mode":
     "Single precision (F, Float) denorms are flushed to sign-preserved
      zero on input and output of any floating-point mathematical
      operation."

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20232>
2023-02-10 16:34:01 +00:00
Väinö Mäkelä
56667002fd intel/vec4: Don't optimize multiply by 1.0 away
The SPIR-V compiler's implementation of tanh generates a multiply by 1.0
to flush denorms to zero.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20232>
2023-02-10 16:34:01 +00:00
Väinö Mäkelä
dcad4a2cd1 intel/vec4: Set the rounding mode
The rounding mode only needs to be set once, because 16-bit floats or
preserving denorms aren't supported for the platforms where vec4 is
used.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20232>
2023-02-10 16:34:00 +00:00
Eric Engestrom
5a2326f9b2 panfrost: drop no-longer-needed libglsl
Fixes: 551c2aadd4 ("pan/bi: Remove standalone compiler")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21240>
2023-02-10 14:09:37 +00:00
Samuel Pitoiset
bd30f3619d radv: implement graphics shaders relocation for a RGP workaround
RGP requires shaders to be uploaded consecutively inside the same
buffer object. Otherwise, either it makes the driver generating
huge traces (ie. in GiB) or it fails to load traces at all. Hopefully,
this will be improved soon when AMDGPU drivers will have GPL support.

To workaround this, the driver relocates graphics shaders in the same
buffer object when a pipeline is created. Then at draw time, it
overwrites SPI_SHADER_PGM_xxx registers to make sure SQTT can match
between emitted and exported shaders. It's a bit suboptimal because
graphics shaders are uploaded twice but it's the best solution I found.

This will allow to implement GPL caching without breaking capturing
shaders with RGP.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21078>
2023-02-10 13:42:14 +00:00
Samuel Pitoiset
69bd1c0c40 radv: restore uploading shaders individually instead of consecutively
The shaders were uploaded consecutively to fit a RGP constraint but
this was more like a workaround. This upload path doesn't work well for
graphics pipeline library and it was the main blocker for GPL caching.

This commit breaks capturing shaders with RGP if the offset between
shaders is too big. Next commit should fix it by using shaders reloc.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21078>
2023-02-10 13:42:14 +00:00
Georg Lehmann
533d0008c7 aco: remove stale TODOs about v_interp opsel
These are already handled correctly according to the ISA docs.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21096>
2023-02-10 12:01:56 +00:00
Philipp Zabel
f29f656530 vulkan/wsi/wayland: fix acquire_next_image to report timeouts properly
The Vulkan Specification states about possible return values from
vkAcquireNextImageKHR:

 * VK_NOT_READY is returned if timeout is zero and no image was
   available.
 * VK_TIMEOUT is returned if timeout is greater than zero and less than
   UINT64_MAX, and no image beae available within the time allowed.

That is, if info->timeout is larger than zero, the function must return
VK_TIMEOUT instead of VK_NOT_READY if no image became available before
the timeout elapsed.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21190>
2023-02-10 11:32:54 +00:00
Samuel Pitoiset
75ccf7c003 radv/ci: bump the number of runners to 3 for vkcts-navi21-valve
RADV_PERFTEST=gpl increased execution time, so let's try with a 3d
runner.

dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
seems reliably fixed now for some reasons.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21214>
2023-02-10 11:06:54 +01:00
Samuel Pitoiset
6533709d10 radv/ci: set RADV_PERFTEST=GPL for all VKCTS jobs
The Vulkan CTS version in Mesa CI is so old that a bunch of tests
are broken, but it's expected.

This runs +283939 tests and the overall VKCTS execution time increased
from ~23 minutes to ~26 minutes (+~13%) on my Threadripper 1950X.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21214>
2023-02-10 11:06:54 +01:00
Pavel Ondračka
94eff7ccd8 nir: shrink phi nodes in nir_opt_shrink_vectors
While this change helps with few shaders, the main benefit is
that it allows to unroll loops comming from nine+ttn on vec4
backends. D3D9 REP ... ENDREP type loops are unrolled now already,
LOOP ... ENDLOOP need some nine changes that will come later.

r300 RV530 shader-db:
total instructions in shared programs: 132481 -> 132344 (-0.10%)
instructions in affected programs: 3532 -> 3395 (-3.88%)
helped: 13
HURT: 0

total temps in shared programs: 16961 -> 16957 (-0.02%)
temps in affected programs: 88 -> 84 (-4.55%)
helped: 4
HURT: 0

Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Partial fix for: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8102
Partial fix for: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7222

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21038>
2023-02-10 09:06:25 +00:00
Samuel Pitoiset
2a008018c1 docs: stop reporting RADV_PERFTEST=gpl as experimental/suboptimal
The graphics pipeline library implementation in RADV has been
improved considerably lately.

There is still a bit of work for caching individual libraries
and optimized (LTO) pipelines but I think overall it seems good
enough to stop reporting it as experimental and suboptimal.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21213>
2023-02-10 07:59:12 +00:00
Yonggang Luo
09061e2fe9 vulkan: Use static_assert for check HWVULKAN_DISPATCH_MAGIC == ICD_LOADER_MAGIC
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21210>
2023-02-10 07:21:31 +00:00
Chia-I Wu
af7bcc0cdc freedreno: avoid conditional ib in fd6_emit_tile
CP_REG_TEST (or any command that reads registers) is slow on a618
(gen1).  Since SQE can early return, we don't necessarily need
emit_conditional_ib in fd6_emit_tile.

We still CP_REG_TEST twice for load and store when there is no clear.
Not sure if we can simply drop emit_conditional_ib instead?

glmark2 score goes from 943 to 1067.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21208>
2023-02-10 06:31:47 +00:00
Patrick Lerda
b2c340c106 mesa/st: fix possible crash related to arb invalid memory access
This invalid memory access is a consequence of wrong assumptions,
for instance:
"prog->sh.data is NULL if it's ARB_fragment_program"

This issue is triggered with piglit/fp-formats -auto -fbo:
==9747==ERROR: AddressSanitizer: heap-use-after-free on address 0x007f7c812d90 at pc 0x007f833c09f8 bp 0x007fd7eca750 sp 0x007fd7eca768
READ of size 4 at 0x007f7c812d90 thread T0
    #0 0x7f833c09f4 in st_get_sampler_views ../src/mesa/state_tracker/st_atom_texture.c:109
    #1 0x7f833c0b48 in update_textures ../src/mesa/state_tracker/st_atom_texture.c:266
    #2 0x7f82b2d120 in st_validate_state ../src/mesa/state_tracker/st_util.h:128
    #3 0x7f82b2d120 in prepare_draw ../src/mesa/state_tracker/st_draw.c:88
    #4 0x7f82b2de64 in st_draw_gallium ../src/mesa/state_tracker/st_draw.c:141
    #5 0x7f83105940 in _mesa_draw_arrays ../src/mesa/main/draw.c:1202
    #6 0x7f8d5fa5cc in piglit_draw_rect_from_arrays piglit/tests/util/piglit-util-gl.c:711
    #7 0x7f8d5fac34 in piglit_draw_rect_custom piglit/tests/util/piglit-util-gl.c:833
    #8 0x4019e0 in piglit_display piglit/tests/shaders/fp-formats.c:67
    #9 0x7f8d643fc4 in run_test piglit/tests/util/piglit-framework-gl/piglit_fbo_framework.c:52
    #10 0x401624 in main piglit/tests/shaders/fp-formats.c:39

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21175>
2023-02-10 04:45:29 +00:00
Chia-I Wu
620baf9c42 freedreno/registers: document more bits of CP_REG_TEST
On gen3+, there are 32 predicate bits instead of 1.

I set out to see why CP_REG_TEST (and others commands that read
registers) is slower on gen1 but could not find anything.  Since the
blob seems to use multiple predicate bits, let's keep them documented.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21206>
2023-02-10 04:12:08 +00:00
Chia-I Wu
0278462575 turnip: skip unnecessary CP_REG_TEST for cond load/store
When no attachment allows conditional load/store, skip the unnecessary
CP_REG_TEST.

This is done to avoid a performance trap on a618 (gen1).  CP_REG_TEST or
any command that reads a register is slow on a618.

glmark2 score goes from 830 to 1001.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8162
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21206>
2023-02-10 04:12:08 +00:00
Chia-I Wu
37f6714fe7 turnip: add a comment to tu_render_pass_cond_config
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21206>
2023-02-10 04:12:08 +00:00
Mike Blumenkrantz
487ac6dbd6 zink: implement cross-program pipeline library sharing
some games/apps (e.g., DOOM2016) compile+link shaders in one context
and then use them in another, expecting that the compiled shaders
will be reused. vulkan has pipeline (library) objects, which are not
specific to shaders but are in theory representing the shaders being used

thus, pipeline (library) objects need to be reusable for any case where
a shader can be reused

to handle this:
* extract pipeline library cache to a refcounted object
* store these objects on the screen
* make them owned by shaders

separable programs are slightly different since they'll use their own
fastpath, thus making their library caches owned by the programs to avoid
polluting the optimized caches

fixes #8264

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21223>
2023-02-10 03:53:46 +00:00
Mike Blumenkrantz
b282761839 zink: break out zink_gfx_program::libs into refcounted object
no functional changes yet, and these are still 1:1 with their programs

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21223>
2023-02-10 03:53:46 +00:00
Mike Blumenkrantz
6482cf12ca zink: store gfx_hash on zink_gfx_program
this avoids needing to reference ctx->gfx_hash in threads or recalc the hash

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21223>
2023-02-10 03:53:46 +00:00
Ian Romanick
18fc4daaf6 nir/inline_uniforms: Add inot condition support
From the 96c19d23c9 commit message:

    Ever since 4246c2869c and 7d85dc4f35 loop unrolling can no
    longer depend on inot being eliminated from the loop
    terminator condition so we need to be able to handle it.

Support these conditions here too.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21179>
2023-02-10 03:18:23 +00:00
Ian Romanick
682e83f012 nir/inline_uniforms: Make add_inlinable_uniforms public
This is step 5 in an attempt to unify a bunch of nir_inline_uniforms.c
and lvp_inline_uniforms.c code.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21179>
2023-02-10 03:18:23 +00:00
Ian Romanick
cdd23b1efa nir/inline_uniforms: Make src_only_uses_uniforms public, change name
While making the function public, rename it to
nir_collect_src_uniforms. The old name makes it sound like it's just a
query that doesn't have side effects. That is, however, not the case.

This is step 4 in an attempt to unify a bunch of nir_inline_uniforms.c
and lvp_inline_uniforms.c code.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21179>
2023-02-10 03:18:23 +00:00
Ian Romanick
edb89b71c5 nir/inline_uniforms: Allow possibility of uni_offsets and num_offsets being NULL
This is step 3 in an attempt to unify a bunch of nir_inline_uniforms.c
and lvp_inline_uniforms.c code.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21179>
2023-02-10 03:18:23 +00:00
Ian Romanick
0c0fb216dd nir/inline_uniforms: Allow possibility of more than one UBO
Only caller in this file still only passes 1.

This is step 2 in an attempt to unify a bunch of nir_inline_uniforms.c
and lvp_inline_uniforms.c code.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21179>
2023-02-10 03:18:23 +00:00
Ian Romanick
23b4266f9e nir/inline_uniforms: Pass max_num_bo and max_offset around as parameters
max_num_bo is currently limited to 1. That will change in the next
commit.

This is step 1 in an attempt to unify a bunch of nir_inline_uniforms.c
and lvp_inline_uniforms.c code.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21179>
2023-02-10 03:18:23 +00:00
Ian Romanick
1d5033823e nir/inline_uniforms: Change num_offsets type to uint8_t
This is step 0 in an attempt to unify a bunch of nir_inline_uniforms.c
and lvp_inline_uniforms.c code.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21179>
2023-02-10 03:18:23 +00:00
Emma Anholt
6b6f757e23 ci/crocus: Update HSW expectations.
2 good-looking trace updates, one new crash.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21205>
2023-02-10 02:53:09 +00:00
Emma Anholt
b01c3553f7 ci/radv: Update navi21 llvm xfails.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21205>
2023-02-10 02:53:09 +00:00
Emma Anholt
9adfe49563 ci/nouveau: Disable the gm20b jobs entirely.
The old (broken, hw failure) board isn't really hooked up right now, and
I'm waiting on buying some remaining bits to set up the 10 boards sitting
in the box here.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21205>
2023-02-10 02:53:09 +00:00
Emma Anholt
ba73aaa0da ci/freedreno: Update a3xx piglit_shader xfails.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21205>
2023-02-10 02:53:09 +00:00
Emma Anholt
e182970692 ci/freedreno: Add an xfail for a618 VK full run.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21205>
2023-02-10 02:53:09 +00:00
Emma Anholt
a8a6be1641 ci/freedreno: Update a530 manual-run xfails.
A lot of this looks like fractional run test list updates.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21205>
2023-02-10 02:53:09 +00:00
Emma Anholt
e267d72979 ci/freedreno: Disable the a306_piglit_gl job.
It's broken with recurring hangchecks.  Someone would need to restabilize
it, but turn it off for anyone to find until someone (me? :( ) cares.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21205>
2023-02-10 02:53:09 +00:00
Emma Anholt
238fcd30ed ci/zink: Update TGL full-run xfails.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21205>
2023-02-10 02:53:09 +00:00
Emma Anholt
1a862c74bc ci: Disable systems in my farm that haven't recovered.
We lost power in a storm, and these ones didn't come back afterwards.  I
suspect I need a new PSU.  And maybe some surge protection for the future.
:(

I've left the CI code in place for some day when I hopefully swap out the
power supplies.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21205>
2023-02-10 02:53:09 +00:00
Nanley Chery
2e13456bca mesa/st: Measure compressed fallback unmap paths
Add code to help find performance issues. The logging is disabled by
default.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19827>
2023-02-10 01:40:47 +00:00
Nanley Chery
fdabf886be mesa/st: Enable compute-based transcoding to DXT5
By enabling this path, we get a 56% decrease in upload time on a texture
upload microbenchmark. This was measured on an Ice Lake with an iris
driver that tries to use the compressed format fallback path.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19827>
2023-02-10 01:40:47 +00:00
Nanley Chery
6d57614fd0 mesa/st: Add st_texture_image_resource_level
Returns the level of the gl_texture_image with respect to the resource
it's allocated within. Example: returns 0 for non-finalized texture.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19827>
2023-02-10 01:40:47 +00:00
Nanley Chery
637ff22413 mesa/st: Add st_compute_transcode_astc_to_dxt5
Add a function to upload ASTC data, transcoding it to BC3/DXT5 in the
process.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19827>
2023-02-10 01:40:47 +00:00
Nanley Chery
1f8f1a0d9b mesa/st: Add and use create_bc1_endpoint_ssbo
Create and cache the SSBO used by the BC1 compute shader program.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19827>
2023-02-10 01:40:47 +00:00
Nanley Chery
bab950a4ac mesa/st: Add get_compute_program
Add a function to create and cache the compute programs that will be
used to transcode ASTC to DXT5.

Note that the error paths in st_create_context_priv may actually lead to
segfaults if hit. I've been able to work around them by 1) moving them
further down and 2) returning early from st_glFlush if st->pipe is NULL.
I don't know if that's the right solution however.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19827>
2023-02-10 01:40:47 +00:00
Nanley Chery
c4a6176d19 mesa: Create _mesa_CreateShaderProgramv_impl
Factor out the implementation of _mesa_CreateShaderProgramv so that we
can make programs that will encode DXT5.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19827>
2023-02-10 01:40:47 +00:00
Nanley Chery
cb296db853 glsl: Modify the #includes in the DXT5 shaders
1. Drop the commented out includes. Shader caching is disabled if those
   are found.

2. Replace the active includes with "%s". Later on, we'll construct the
   final strings with vasprintf. One downside to doing this is that the
   glsl file extensions are no longer true. These files are now
   templates.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19827>
2023-02-10 01:40:47 +00:00
Nanley Chery
96cb3ba424 glsl: Add compute shaders to encode DXT5/BC3
These compute shaders are from the MIT-licensed GPU compressor, Betsy.
I have included copyright headers, inlined the __sharedOnlyBarrier macro
definition from the "UavCrossPlatform_piece_all.glsl" header when
applicable, and made the following changes to support GLES:

   * Conditionally disable the const keyword in the BC3 shaders
   * Make the params uniform in the BC4 shader uint2
   * Avoid implicit data type conversions in the BC3 shaders
   * Use constructors for array initialization in the BC1 shader
   * Add precision qualifiers to the BC3 shaders
   * Output to an rgba16ui image for the BC1 and BC4 shaders
   * Set the version of the BC3 shaders to 310 es

Ref: https://github.com/darksylinc/betsy/tree/cc723dcae9
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19827>
2023-02-10 01:40:47 +00:00
Nanley Chery
0a5a54b81a docs: Document the implicit barriers around blits
We're going to use resource_copy_region to copy from a resource that has
been written to with imageStore. Make it clear that this is safe.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19827>
2023-02-10 01:40:47 +00:00
Dave Airlie
6043f66dd3 crocus: disable Y tiling for render targets properly.
The old code would disallow linear targets as well which would confuse
things with reimporting dma-bufs.

Fixes: 32728dc66e ("crocus: introduce main resource configuration helper.")
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21209>
2023-02-10 01:25:42 +00:00
Tapani Pälli
db6c374919 iris: disable preemption for 3DPRIMITIVE during streamout
This is required by Wa_16013994831.

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19947>
2023-02-09 21:40:10 +02:00
Lionel Landwerlin
ebc4893947 intel/fs: fix mesh indirect movs
The size in src[2] is in byte and needs to cover any possible data
accessed in src[0] by the indirection. That way the register
allocation is aware of what cannot be spilled for the instruction to
execute on valid data.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 70ace2bbcd ("intel/compiler: Implement Task Output and Mesh Input")
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21188>
2023-02-09 15:35:55 +00:00
Mike Blumenkrantz
dc91f2c71b zink: set PIPE_CAP_SURFACE_REINTERPRET_BLOCKS
this fixes perf for CompressedTexSubImage and makes DOOM2016 run at full speed

ref #8223

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21218>
2023-02-09 09:54:27 -05:00
Mike Blumenkrantz
e3b746e3a3 zink: use GPL to handle (simple) separate shader objects
apps/games using separate shader objects end up passing the separable
shaders to the link_shader hook individually, which is still not ideal for
zink's usage since the more optimal path is to have all the shaders and create
a RAST+FS GPL stage that can run all the inter-stage io handlers

it IS technically possible to handle this for simple VS+FS pipelines using
GPL, however, but it's kinda gross. such shaders now use descriptor buffer
to create their own pipelines/layouts/descriptors async, and then a "separable"
variant of the gfx program can be created by fast-linking these together

the "separable" gfx program can't handle shader variants, but it can do basic
pipeline caching for PSO state changes, which makes it flexible enough to sorta
kinda maybe handle the most basic cases of separate shader objects

descriptor buffer is used because having to create and manage a separate architecture
for sets/pools/templates is too nightmarish even for me

this is, at best, a partial solution, but it's the best the vulkan api can
currently do

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21197>
2023-02-09 13:57:50 +00:00
Mike Blumenkrantz
60b26a6b1f zink: enable combining intermediate gpl libs from combine function
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21197>
2023-02-09 13:57:50 +00:00
Mike Blumenkrantz
ab69cba807 zink: move gpl input/output funcs to zink_pipeline.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21197>
2023-02-09 13:57:50 +00:00
Mike Blumenkrantz
4f8a548af1 zink: allow multiple gpl libraries in zink_create_gfx_pipeline_combined()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21197>
2023-02-09 13:57:50 +00:00
Mike Blumenkrantz
7efec7fb61 zink: add gpl flags for libraries based on shaders passed
no change to current operations

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21197>
2023-02-09 13:57:50 +00:00
Mike Blumenkrantz
983f30f8ba zink: split out gfx pipeline library creation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21197>
2023-02-09 13:57:50 +00:00
Mike Blumenkrantz
5ae973c7d3 zink: add flags param to zink_pipeline_layout_create()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21197>
2023-02-09 13:57:50 +00:00
Mike Blumenkrantz
bdb97b3f20 zink: split out VkShaderModule creation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21197>
2023-02-09 13:57:50 +00:00
Mike Blumenkrantz
36595e94c7 zink: avoid the descriptor set multiplier for bindless buffers
the bindless descriptor buffer is already correctly sized, so it needs
to avoid the huge set multiplier or it'll explode all available vram

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21216>
2023-02-09 08:08:22 -05:00
Mike Blumenkrantz
f14571e393 zink: flag bindless_init before calling zink_batch_bind_db() in init
this otherwise fails to bind the bindless buffer

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21216>
2023-02-09 07:49:22 -05:00
Samuel Pitoiset
1fdf6e140d docs: add missing RADV_PERFTEST=video_decode
Fixes: 9477f117f4 ("radv/video: add initial frameworking.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21158>
2023-02-09 12:05:26 +00:00
Tatsuyuki Ishi
9fdc145ad6 radv: Assert the hardware support rbplus when emitting rbplus state.
If someone forget to check for rbplus before setting dirty bits, it's going
to cause really mysterious bugs.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21189>
2023-02-09 08:32:20 +00:00
Tatsuyuki Ishi
a36efe3e19 radv: Fix missing rbplus_allowed check for dynamic PS epilogs.
This created really mysterious bugs on gfx10.

Fixes flickering in a bunch of DXVK games, most visibly Overwatch 2.

Fixes: eb07a11b8f ("radv: add support for compiling PS epilogs on-demand")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8258
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21189>
2023-02-09 08:32:20 +00:00
Samuel Pitoiset
46aee750c6 radv: stop skipping the cache for monolithic graphics pipelines with GPL
Only libraries and optimized (LTO) pipelines are still unsupported,
but there is no reason to skip the cache for monolithic pipelines.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21198>
2023-02-09 08:11:45 +00:00
Samuel Pitoiset
26896616c1 radv: stop skipping the cache for compute/raytracing pipelines with GPL
This was a hard solution somewhat.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21198>
2023-02-09 08:11:45 +00:00
Samuel Pitoiset
53cea404f7 radv: simplify creating a FS epilog from a library
It's now compiled in radv_graphics_pipeline_compile().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21140>
2023-02-09 07:48:03 +00:00
Samuel Pitoiset
06d17fccfb radv: make sure to disable MRT compaction when compiling a PS epilog with GPL
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21140>
2023-02-09 07:48:03 +00:00
Samuel Pitoiset
16e4dd3e37 radv: fix disabling MRT compaction for on-demand PS epilogs
Some dynamic states require to compile PS epilogs on-demand. In this
case, MRT compaction should be disabled because we don't know the CB
state when compiling the fragment shader.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21140>
2023-02-09 07:48:03 +00:00
Samuel Pitoiset
ea5c893289 radv: regroup PS epilog info when generating the graphics pipeline key
No logical change.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21140>
2023-02-09 07:48:03 +00:00
Samuel Pitoiset
84d006ef11 radv: simplify determining when the fragment shader needs an epilog
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21140>
2023-02-09 07:48:03 +00:00
Samuel Pitoiset
b41c6c3a50 radv: cleanup graphics pipeline library flags uses
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21140>
2023-02-09 07:48:03 +00:00
Samuel Pitoiset
7976316f3e radv: fix skipping graphics pipeline compilation when the FS is NULL
Fixes: 3eb97b9d33 ("radv: skip compilation when possible with GPL fast-linking")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21192>
2023-02-09 07:27:53 +00:00
Tapani Pälli
88cadf1454 intel/blorp: disable REP16 for gfx12+ with R10G10B10_FLOAT_A2
Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21137>
2023-02-09 06:34:43 +00:00
Yonggang Luo
948f4e4d07 util: Fixes error: no previous prototype for 'mesa_cache_db_entry_remove'
Fixes: c92c99481f ("util/mesa-db: Support removal of cache entries")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21191>
2023-02-09 04:05:39 +00:00
Emma Anholt
a2fbd2fbd0 zink: Add tracing of blit operations.
I found this useful in lining up some perfetto traces between zink+anv and
iris, and understanding what was going on in them.  Also it's a demo of
being able to insert annotations for work in the command stream, which I
suspect we'll want more of.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20657>
2023-02-09 03:27:34 +00:00
Emma Anholt
4dc6390445 u_trace: Add an interface for checking trace enablement outside a context.
For zink, we want to know if we should pass command stream markers down to
the underlying driver, but we don't have our own trace context we're
recording trace events with.  We definitely want those markers if the
underlying driver is going to be doing perfetto tracing, or is requesting
marker tracing.  So, create an interface for querying those flags before
they get copied down to an actual u_trace_context.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20657>
2023-02-09 03:27:34 +00:00
José Roberto de Souza
fb6e65c72c hasvk: Remove remaining bits of anv_i915_query()
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20948>
2023-02-09 02:57:32 +00:00
José Roberto de Souza
5ecb8966b2 anv: Remove remaining bits of anv_i915_query()
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20948>
2023-02-09 02:57:32 +00:00
José Roberto de Souza
c8626a20bb anv: Start to move anv_gem_stubs.c to kmd backend
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20948>
2023-02-09 02:57:32 +00:00
José Roberto de Souza
de79cf0512 anv: Add basic KMD backend infrastructure
Functions that are in hot paths will have a different treatment to
support i915 and Xe KMD.

Each KMD will have an anv_kmd_backend that will have the hot path
functions set, this way we can avoid branch prediction misses.

Other functions will gradually be moved to anv_kmd_backend.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20948>
2023-02-09 02:57:32 +00:00
José Roberto de Souza
eaeda2107e anv: Use DRM_IOCTL_I915_GEM_CREATE_EXT in all supported kernels
As we continue to refactor the code base to support Xe KMD here I'm
dropping anv_gem_create() and unifying all graphics memory allocation
calls to anv_gem_create_regions().

anv_gem_create_regions() will call DRM_IOCTL_I915_GEM_CREATE_EXT
for integrated platforms too only leaving DRM_IOCTL_I915_GEM_CREATE
calls to kernel versions that do not support
DRM_IOCTL_I915_GEM_CREATE_EXT.
This can be detected by devinfo->mem.use_class_instance as
DRM_I915_QUERY_MEMORY_REGIONS uAPI landed in the same kernel version
as DRM_IOCTL_I915_GEM_CREATE_EXT.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20948>
2023-02-09 02:57:32 +00:00
José Roberto de Souza
099b9e5058 anv: Convert drm_i915_gem_memory_class_instance to intel_memory_class_instance
Also using pointers to intel_device_info struct instead of replicate
the same information.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20948>
2023-02-09 02:57:32 +00:00
José Roberto de Souza
9fc224631c intel: Add intel_memory_class_instance
This is a KMD independent struct to hold memory class and instance
values.

drm_i915_gem_memory_class_instance usage will be gradually replaced.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20948>
2023-02-09 02:57:32 +00:00
Emma Anholt
cc0b749890 ci/freedreno: Don't forget to report flakes on a618, too.
I just noticed that our flake reports are only coming from cheza, which is
a bummer because almost all the VK coverage is on a618 unless you're
kicking off a full run.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21092>
2023-02-09 02:13:39 +00:00
Amber
20d4c592c9 freedreno: make sure depth/stencil layouts are always tiled
Small depth/stencil textures were using linear tiling, but depth/stencil
attachments cannot use linear tiling for sysmem rendering.

Fixes:
 KHR-GL45.geometry_shader.layered_framebuffer.stencil_support
 KHR-GL45.geometry_shader.layered_framebuffer.depth_support

Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21046>
2023-02-08 22:55:52 +00:00
Eric Engestrom
885c315d10 docs: update calendar for 22.3.5
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21207>
2023-02-08 22:26:56 +00:00
Eric Engestrom
a0e1707b65 docs: add release notes for 22.3.5
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21207>
2023-02-08 22:26:56 +00:00
SoroushIMG
f7b2dbb2bd zink: relax bresenhamLines requirement for non-strictLine drivers
non-strictLine Vulkan drivers use either parallelogram or bresenham
rasterization for default line modes.
This method of rasterisation produces close enough results that it
in practice is GL/GLES spec compliant (at least cts wise).
Don't emit a feature missing warning for this case.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20985>
2023-02-08 22:00:43 +00:00
Rhys Perry
b4383821e7 aco: don't modify exec in p_interp_gfx11
The RDNA3 ISA docs say that lds_param_load write the entire quad
regardless of exec, so this isn't needed.

fossil-db (gfx1100):
Totals from 5291 (3.93% of 134574) affected shaders:
Instrs: 4891396 -> 4789628 (-2.08%)
CodeSize: 25519032 -> 25111960 (-1.60%)
Latency: 36122982 -> 36074300 (-0.13%); split: -0.14%, +0.00%
InvThroughput: 4162436 -> 4161424 (-0.02%); split: -0.02%, +0.00%
Copies: 263862 -> 263838 (-0.01%)
PreSGPRs: 225012 -> 224179 (-0.37%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21171>
2023-02-08 19:35:54 +00:00
Georg Lehmann
6e4598f7b9 aco: support omod/imod for v_fmac_f16
Only matters for post-RA DPP16.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21174>
2023-02-08 18:52:28 +00:00
Georg Lehmann
2deda5c0be aco: don't list imod/omod support v_fmaak_f32/v_fmamk_f32
We can never use them anyway because these opcodes don't support VOP3/DPP16/SDWA

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21174>
2023-02-08 18:52:28 +00:00
Georg Lehmann
4c9ac73064 aco: allow output modifiers for ldexp_f16
It also supports imod for the first operand, but we cannot express that at
moment.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21174>
2023-02-08 18:52:28 +00:00
Georg Lehmann
b63aa2bb8e aco: don't allow output modifiers for v_cvt_pkrtz_f16_f32
Cc: mesa-stable
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21174>
2023-02-08 18:52:28 +00:00
Rob Clark
dc93033234 freedreno: Indent fixes
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21195>
2023-02-08 18:27:55 +00:00
Rob Clark
e9eee8781a freedreno/a2xx: Move pack_rgba()
It is only used in fd2_draw.c

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21195>
2023-02-08 18:27:55 +00:00
Rob Clark
e7f88c41c4 freedreno: Quiet unused variable warnings
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21195>
2023-02-08 18:27:55 +00:00
Rob Clark
eaf272aa93 ir3: Quiet unused variable warning
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21195>
2023-02-08 18:27:55 +00:00
Sil Vilerino
727afda21f d3d12: Video Encode - Fix ID3D12CommandAllocator leak
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21196>
2023-02-08 18:00:41 +00:00
Sil Vilerino
997b91fead d3d12: Video processing - Fix out of bounds array access
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21196>
2023-02-08 18:00:41 +00:00
Rob Clark
2c8c151591 freedreno/drm/virtio: Limit guest handles passed to virtgpu
We only need to have virtgpu in the loop for shared buffers when
implicit sync is in play.  The rest of the time we can rely on userspace
fence waits.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21143>
2023-02-08 17:36:23 +00:00
Rob Clark
53ba7d8867 freedreno/drm: Move sa_cpu_prep() to core
Now that we can do a blocking wait on an fd_fence (which the suballoc
heap already depended on) we can just move the fence wait into core
leaving the backend cpu_prep() implementation only needing to care
about implicit sync on shared buffers.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21143>
2023-02-08 17:36:23 +00:00
Rob Clark
dec49ec50a freedreno/a6xx: Move CS state to PROG state group
It is pretty easy to just cache the stateobj with the hwcso (since
unlike 3d, there is only a single shader state) and re-emit it by
pointer when it changes, now that the CS state doesn't depend on the
grid info.

This also moves immed consts into the PROG state, so they are only
updated when the PROG state is dirty.  And splits user consts and
driver param consts, so they are only re-emit when needed.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21127>
2023-02-08 16:59:40 +00:00
Matt Coster
7ea98091c1 pvr: Add firmware stream support for transfer submit
Move transfer jobs over to the new firmware stream interface. This had already
been done for render and compute jobs in 947e183ff5 ("pvr: Implement new
firmware stream interface").

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21163>
2023-02-08 16:33:35 +00:00
Sarah Walker
5a2618c73c pvr: Update FWIF transfer queue register structures
This matches changes made in FW 1.17.OS@6293467.

Signed-off-by: Sarah Walker <sarah.walker@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21163>
2023-02-08 16:33:35 +00:00
Michel Dänzer
0dd89dacf2 mesa/st: Handle all 10 bpc types in st_choose_format
Only GL_UNSIGNED_INT_2_10_10_10_REV was handled, add
GL_UNSIGNED_INT_10_10_10_2 & GL_UNSIGNED_INT_10_10_10_2_OES.

This makes sure that if the Gallium driver doesn't support the exact
corresponding format, another 10 bpc format is tried before an 8 bpc one
as a fallback.

Fixes the mutter test cogl-test-offscreen-texture-formats with iris.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21021>
2023-02-08 16:06:38 +00:00
Michel Dänzer
98526b7d48 mesa/st: Fix GL_EXT_texture_type_2_10_10_10_REV name in comment
Suggested by Adam Jackson in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21021#note_1747761

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21021>
2023-02-08 16:06:37 +00:00
Lionel Landwerlin
6390953fa5 anv: put the video extension behind a variable
As initialized acked.

The WSI code is currently trying to blit on the video queue.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 633efa7af7 ("anv: enable video decode extensions.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21194>
2023-02-08 15:38:27 +00:00
Simon Perretta
81af999a75 pvr: Clarify unreachable text
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20430>
2023-02-08 15:15:17 +00:00
Simon Perretta
c13bed8bef pvr: Add block printing support during validation
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20430>
2023-02-08 15:15:17 +00:00
Simon Perretta
1bd84f4753 pvr: Validate instruction repeat and src/dst sizes
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20430>
2023-02-08 15:15:17 +00:00
Simon Perretta
8ac16c97cf pvr: Adjust instruction repeat offset
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20430>
2023-02-08 15:15:17 +00:00
Simon Perretta
d431adaecd pvr: Keep NIR SSA defs instead of registers
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20430>
2023-02-08 15:15:17 +00:00
Simon Perretta
d47d0ea101 pvr: Drop the ENUM_PACKED macro
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20430>
2023-02-08 15:15:17 +00:00
Simon Perretta
52bcb0e292 pvr: Commonise some instruction member defs
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20430>
2023-02-08 15:15:17 +00:00
Simon Perretta
e74aaa347b pvr: Support dual-destination ALU instructions
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20430>
2023-02-08 15:15:17 +00:00
Simon Perretta
6187f1fd8c pvr: Add support for optional instruction params
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20430>
2023-02-08 15:15:17 +00:00
Simon Perretta
d187418f63 pvr: Add new Rogue compiler framework
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20430>
2023-02-08 15:15:17 +00:00
Georg Lehmann
5038a049f1 aco: add mov/cndmask opcodes to does_fp_op_flush_denorms
For completeness sake also add v_mov_b32, even if we don't use imod for it
because it's only supported since gfx10.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21170>
2023-02-08 13:07:46 +00:00
Georg Lehmann
c8adf16278 aco: fix imod/omod for gfx11 VOP3 opcodes
Fixes: d8d99c3c4f ("aco: add GFX11 opcode numbers")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21170>
2023-02-08 13:07:46 +00:00
Mike Blumenkrantz
8f5a63ebfe util/vbuf: fix multidraw unrolling
* drawid needs to be incremented at end of loop
* rescope draw structs to initialize at top of loop

fix #8191

Fixes: 6b07893b31 ("util/vbuf: handle multidraws")

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21139>
2023-02-08 12:41:32 +00:00
Tatsuyuki Ishi
c6ebd2de71 radv: Fix noop FS not getting constructed for GPL pipelines.
The condition was inverted, causing compilation to be actually skipped when
a noop FS is used and straight emitting the pipeline from the default
initialized struct.

Fixes: 3eb97b9d33 ("radv: skip compilation when possible with GPL fast-linking")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21166>
2023-02-08 10:52:54 +00:00
Daniel Schürmann
e5600d5257 radv: CSE ray_launch_{size|id}
Stats for Q2RTX
Totals from 7 (0.01% of 134913) affected shaders: (GFX10.3)

VGPRs: 736 -> 704 (-4.35%)
CodeSize: 204424 -> 204400 (-0.01%); split: -0.03%, +0.02%
MaxWaves: 67 -> 69 (+2.99%)
Instrs: 37540 -> 37549 (+0.02%); split: -0.02%, +0.04%
Latency: 973556 -> 973267 (-0.03%)
InvThroughput: 209068 -> 200902 (-3.91%)
VClause: 920 -> 921 (+0.11%); split: -0.11%, +0.22%
SClause: 1045 -> 1043 (-0.19%)
Copies: 4853 -> 4865 (+0.25%); split: -0.08%, +0.33%
Branches: 1571 -> 1578 (+0.45%)
PreSGPRs: 421 -> 407 (-3.33%)
PreVGPRs: 638 -> 632 (-0.94%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21156>
2023-02-08 10:10:27 +00:00
Timur Kristóf
8ebb34ee57 radv: Refactor radv_emit_ngg_culling_state so it's based on dirty flags.
This significantly lowers the CPU overhead of this function.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20980>
2023-02-08 09:28:20 +00:00
Timur Kristóf
22947ef0cc radv: Remove NGG culling skip from command buffer.
This code used to runtime-disable NGG culling for small draw calls.
However, this had too much CPU overhead, let's remove it.
It will be solved by the shaders instead.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20980>
2023-02-08 09:28:19 +00:00
Timur Kristóf
88a4e17018 radv: Use shader code to skip NGG culling in small workgroups.
Extend RADV lowering of the load_cull_any_enabled_amd intrinsic to
take into account the number of primitives in the current workgroup.

Workgroups that have less than 16 triangles are considered "small"
and will disable shader culling. Note that LLPC does the same,
but it checks the number of vertices not primitives.

The primary intention of this change is to eliminate the need to
check the draw size in radv_cmd_buffer, but this is actually
beneficial to larger draw calls too, specifically this may improve
the performance of the last workgroup of larger draws too.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20980>
2023-02-08 09:28:19 +00:00
Timur Kristóf
def53a085c radv: Move checking primitive topology to radv_get_ngg_culling_settings.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20980>
2023-02-08 09:28:19 +00:00
Timur Kristóf
8457dfec47 radv: Don't change LDS_SIZE for NGG culling shaders.
There was no measurable perf benefit from this optimization,
and it made the code messy and difficult to refactor.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20980>
2023-02-08 09:28:19 +00:00
Sidney Just
ab87b19088 loader: Add missing brace to fix compile
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Fixes: 1a0ec8e8d3 ("loader,glx,egl,vl,d3d: loader_get_user_preferred_fd() function to return original_fd")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21115>
2023-02-08 08:49:57 +00:00
Dave Airlie
53283bc26d anv/video: fix video memory bindings.
A break snuck in here.

Fixes: 98c58a16ef ("anv: add initial video decode support for h264.")
Acked-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21184>
2023-02-08 06:42:09 +00:00
Chia-I Wu
d6fb4d8d7d freedreno/registers: correct WFM bit in CP_REG_TEST
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21151>
2023-02-08 06:17:12 +00:00
Yiwei Zhang
dda85cf94b venus: move exp features init back to use ring submit
Since largeRing has been enforced, there's no need to do renderer
submission to fill the exp features. So we move it back after ring has
been initialized. Meanwhile, vn_renderer_submit_simple_sync is
intentionally left there to be re-used soon for server ping purpose.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21153>
2023-02-08 05:34:13 +00:00
Yiwei Zhang
830c7a9f1a venus: render server enforces blob_id_0
Render server enforcement has guaranteed blob_id_0. Meanwhile, blob_id_0
has deprecated largeRing feature.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21153>
2023-02-08 05:34:13 +00:00
Yiwei Zhang
0938c1f7e2 venus: fix tracing init to include instance creation
The issue was hidden so far because:
- wsi_device_init does the perfetto tracing init
- Android atrace does lazy tracing init

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21153>
2023-02-08 05:34:13 +00:00
Yiwei Zhang
91b0ae93b2 venus: fix formating
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21153>
2023-02-08 05:34:13 +00:00
Patrick Lerda
66313732a7 mesa/program: fix memory leak triggered by parser errors
This change requires the %destructor directive which is supported
by bison or yacc, yacc needs to be compiled with the back-tracking
functionality.

This issue could be checked with the following piglit programs:
glsl-invalid-asm-01, glsl-invalid-asm-02 or vp-bad-program

Direct leak of 5 byte(s) in 1 object(s) allocated from:
    #0 0x7f8dc89050 in __interceptor_strdup (/usr/lib64/libasan.so.6+0x59050)
    #1 0x7f83791cbc in handle_ident ../src/mesa/program/program_lexer.l:129
    #2 0x7f83791cbc in _mesa_program_lexer_lex ../src/mesa/program/program_lexer.l:312
    #3 0x7f8377e8d8 in yylex ../src/mesa/program/program_parse.y:289
    #4 0x7f8377e8d8 in yyparse src/mesa/program/program_parse.tab.c:2124
    #5 0x7f83788c14 in _mesa_parse_arb_program ../src/mesa/program/program_parse.y:2584
    #6 0x7f8377371c in _mesa_parse_arb_fragment_program ../src/mesa/program/arbprogparse.c:82
    #7 0x7f8372d42c in set_program_string ../src/mesa/main/arbprogram.c:402

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21150>
2023-02-08 04:58:33 +00:00
Juston Li
3061ec366e venus: add SHADER_DEVICE_ADDRESS_BIT to buffer cache
VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT is being set by zink.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21177>
2023-02-08 04:14:42 +00:00
Chia-I Wu
4054b08f39 turnip: reorder tu6_format_*
This is cosmetic.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21117>
2023-02-08 03:26:05 +00:00
Chia-I Wu
6a76bd8d4c turnip: handle ubwc in blit_base_format
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21117>
2023-02-08 03:26:05 +00:00
Chia-I Wu
3c4eea2aab turnip: add blit_format_color and blit_base_format
Similar to blit_format_texture but for blit dst.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21117>
2023-02-08 03:26:05 +00:00
Chia-I Wu
75f601279b turnip: add blit_format_texture
The use of FMT6_8_8_8_8_UNORM for z24s8/z24x8 is for blit src.  Make
that clear by moving the logic from fd6_texture_format to the newly
added blit_format_texture.  Add a comment on why this is simpler than in
fdl6_view_init.

This should have no functional change in practice.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21117>
2023-02-08 03:26:04 +00:00
Chia-I Wu
659b2e56bd turnip: let tu6_format_vtx* take pipe format
For consistency with other tu6_format_* functions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21117>
2023-02-08 03:26:04 +00:00
Chia-I Wu
41bf169a93 turnip: make tu6_format_*_supported static
They have no external user.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21117>
2023-02-08 03:26:04 +00:00
Chia-I Wu
f710911f2f turnip: remove tu_native_format::tile_mode
It is dead code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21117>
2023-02-08 03:26:04 +00:00
Chia-I Wu
de45fc8d80 turnip: move a comment about FMT6_Z24_UNORM_S8_UINT_AS_R8G8B8A8
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21117>
2023-02-08 03:26:04 +00:00
Chia-I Wu
273a01f43e turnip: add a comment to tu_format_for_aspect
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21117>
2023-02-08 03:26:04 +00:00
Dave Airlie
633efa7af7 anv: enable video decode extensions.
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20782>
2023-02-08 02:56:28 +00:00
Dave Airlie
76e8d015d8 anv/query: add query status report
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20782>
2023-02-08 02:56:28 +00:00
Dave Airlie
98c58a16ef anv: add initial video decode support for h264.
This just adds the files with the programming info, it doesn't
enable the extensions etc

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20782>
2023-02-08 02:56:28 +00:00
Dave Airlie
41caf3665c anv/image: allocate some memory for mv storage after video images.
these images need motion vector storage allocated with them

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20782>
2023-02-08 02:56:28 +00:00
Dave Airlie
bff627142d intel/genxml: add missing power well control bits
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20782>
2023-02-08 02:56:28 +00:00
Dave Airlie
cfc62802f8 intel/genxml: align some of the fields with the media driver
These values are taking from runtime interrogation of the media driver.

It would be nice to know if they are correct, but they work.

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20782>
2023-02-08 02:56:28 +00:00
Dave Airlie
3b110efccb anv/format: handle video extensions structs by ignoring them
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20782>
2023-02-08 02:56:28 +00:00
Dave Airlie
9361481780 anv: add video format features for the one supported video output format
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20782>
2023-02-08 02:56:28 +00:00
Dave Airlie
61618b0569 anv: set Y/4 tiling for video decode images
The video decode hw only works with Y/4 tiled images.

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20782>
2023-02-08 02:56:28 +00:00
Dave Airlie
056b0cb87f anv: add video engine support in various places
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20782>
2023-02-08 02:56:28 +00:00
Mike Blumenkrantz
faaf6f95cc zink: use screen indexing for bindless descriptor set in template bind
Fixes: 8636717270 ("zink: add a "compact" descriptor mode")

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:37 +00:00
Mike Blumenkrantz
7bd5122430 zink: use screen indexing for bindless descriptor set in db bind
Fixes: 99ba529fee ("zink: implement descriptor buffer handling of bindless texture")

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:37 +00:00
Mike Blumenkrantz
4cf54e2ed2 zink: fix gpl lib hashing
this was including the generated tcs bits, which was likely to be wrong
and thus break optimal key hashing, requiring more pipelines

it also wasn't setting the optimal key value correctly during precompile,
which meant the wrong hash value was used and the precompiled libs were never
actually accessible

cc: mesa-stable

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:37 +00:00
Mike Blumenkrantz
bbae237258 zink: set zs feedback loop bit from driver workaround on ctx create
this may otherwise not be set until the cache has been broken

Fixes: 56fb258064 ("zink: replace mixed_zs with zs feedback loops")

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:37 +00:00
Mike Blumenkrantz
0cb326cc74 zink: set gfx feedback loop bit in pipeline state for driver workaround
this needs to be set on context create or it may never get set

Fixes: 645f2da3fa ("zink: always set VK_PIPELINE_CREATE_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT sometimes")

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:37 +00:00
Mike Blumenkrantz
3ca3a26f9c zink: don't set blend_id with full_ds3
this no longer needs to be part of the pso hash

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
d584f320b8 zink: add VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT for gpl libs
required by spec

Fixes: 7ab5c5d36d ("zink: use EXT_descriptor_buffer with ZINK_DESCRIPTORS=db")

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
7c021cc5f0 zink: add a define for testing that an optimal key is the default
tcs values here are ignored since they only matter for generated tcs

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
1f08a6dcdb zink: add a define for the "default" optimal key
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
9e0e6708ed zink: ralloc zink_shader structs
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
77d8cd9c07 zink: make last_vertex_stage the first bit in zink_vs_key_base
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
94d9d832f6 zink: delete zink_screen::framebuffer_cache
no longer used

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
115e0446dc zink: pass screen to descriptor_util_pool_key_get()
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
be8b7980e6 zink: store last pipeline directly for zink_gfx_program::last_pipeline
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
45ece56b75 zink: remove duplicated gpl output blend initializations
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
fa69db6e68 zink: move gpl usability checks to static inline for reuse
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
958c4d82d6 zink: const-ify a bunch of shader key inlines
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
5bba2eb13b zink: take screen param in init_db_template_entry()
ctx is no longer used

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
e132af9192 zink: move bindless_layout to screen and init on creation
this is more consistent with the actual usage

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
2023-02-08 02:35:36 +00:00
Mike Blumenkrantz
b9181c3218 zink: set PIPE_CAP_VALIDATE_ALL_DIRTY_STATES
failing to set this yields patterns like

* bind fs
* bind samplerviews
* draw
* bind fs2
* ~~unbind samplerviews~~ (eliminated)
* draw

the eliminated unbinding of samplerviews between draws also eliminates a descriptor update,
triggering various artifacts in certain corner cases (like DOOM2016 shadows)

it's possible to manage the updating during shader binding, but the detection is a bit more
complex, and the cpu overhead from maintaining the current codepath with an
extra pipe_context::set_sampler_views (et al) isn't high enough to warrant further investigation
at this time

fixes #8252

Fixes: 153af03b94 ("gallium: Add cap to request state validation for all dirty state")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21176>
2023-02-08 02:17:28 +00:00
Yiwei Zhang
dba8bb08ac venus: disable non AHB external memory bits on Android
We are allowed to enable them in theory. However, the non-AHB external
memory support in Venus is very broken at this moment.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21155>
2023-02-08 02:01:17 +00:00
Juston Li
5c7e60362c venus: enable timeline semaphore feedback
At vkQueueSubmit time, for each batch with timeline semaphores to
signal, append cmd_buffers with feedback cmds to update the counter
value in its respective feedback slot.

Since multiple signals on the same semaphore could be pending at the
same time across batches/vkQueueSubmits, src slots and commands are
allocated on demand. These src slots can be reused after they've been
signaled (if the current semaphore counter is greater/equal than the
src value) and are cleaned up on vkDestroySemaphore.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20500>
2023-02-08 00:09:18 +00:00
Juston Li
067cda659a venus: add timeline semaphore feedback cmds
Unlike fence feedback, commands to update timeline semaphore feedback
slots can't be fully pre-recorded because of the counter value input
for signaling timeline semaphores. To avoid fully recording commands
during vkQueueSubmit, pre-record commands that write a counter value
from a feedback "src" slot to the feedback "dst" slot. Then at
vkQueueSubmit, parse the signal semaphores and write the signal counter
value in the feedback src slot and append the command that writes from
that feedback src slot offset to the command buffer associated with the
signal semaphore.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20500>
2023-02-08 00:09:18 +00:00
Juston Li
56c6e4862a venus: add NO_TIMELINE_SEM_FEEDBACK perf option
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20500>
2023-02-08 00:09:18 +00:00
Juston Li
493a3b5cda venus: refactor batch submission fixup
Refactor into the following stages:
 - prepare: Does an initial pass setting vn_queue_submission fields
   and fixing up semaphores.
 - alloc_storage: based on fields (including counts) from prepare,
   calculate and allocate the amount of temporary storage needed.
 - setup_batches: perform any modifications on the submission
   batches using the allocated temporary storage.
 - cleanup: free any temporary storage used.

Currently, only fence feedback needs alloc_storage and setup_batches
to append fence feedback to the submission but this slow will also
be utilized by upcoming timeline semaphore feedback.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20500>
2023-02-08 00:09:18 +00:00
Juston Li
aaee0ad6bb venus: refactor semaphore helper functions
Change to inline functions using conditional operators

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20500>
2023-02-08 00:09:18 +00:00
Thong Thai
1fe5ffd60e gallium/auxiliary/vl: add crop to compute shader
Add a parameter for cropping, seperate from the translate
parameter, to the progressive compute shader.

Fixes: 4c46e4a5da ("gallium/auxiliary/vl: fix scale and translate parameters")
Fixes: 56eac722bd ("gallium/auxiliary/vl: compute shaders for progressive yuv")
Signed-off-by: Thong Thai <thong.thai@amd.com>
Tested-by: Veerabadhran Gopalakrishnan <veerabadhran.gopalakrishnan@amd.com>
Tested-by: Suresh Guttula <suresh.guttula@amd.com>
Acked-by: Veerabadhran Gopalakrishnan <veerabadhran.gopalakrishnan@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21165>
2023-02-07 23:19:32 +00:00
Francisco Jerez
f0b6348ad0 intel/eu/gfx8-9: Fix execution with all channels disabled due to HW bug #220160235.
This hardware bug is the result of a control flow optimization present
in Gfx8-9 meant to prevent the ELSE instruction from disabling all
channels and update the control flow stack only to have them
re-enabled at the ENDIF instruction executed immediately after it.
Instead, on Gfx8-9 an ELSE instruction that would normally have ended
up with all channels disabled would pop off the last element of the
stack and jump directly to JIP+1 instead of to the ENDIF at JIP,
skipping over the ENDIF instruction.  In simple cases this would work
okay (though it's actual performance benefit is questionable), but in
cases where a branch instruction within the IF block (e.g. BREAK or
CONTINUE) caused all active channels to jump outside the IF
conditional, the optimization would break the JIP chain of "join"
instructions by skipping the ENDIF, causing the block of instructions
immediately after the ENDIF to execute with all channels disabled
until execution reaches the reconvergence point.

This issue was observed on SKL in the
dEQP-VK.reconvergence.subgroup_uniform_control_flow_elect.compute.nesting4.0.38
test in combination with some Vulkan binding model changes Lionel is
working on.  In such cases the execution with all channels disabled
was leading to corruption of an indirect message descriptor, causing a
hang.

Unfortunately the hardware bug doesn't provide a recommended
workaround.  In order to fix the problem we point the JIP of an ELSE
instruction to the instruction immediately before the ENDIF -- However
that's not expected to work due to the restriction that JIP and UIP
must be equal if and only if BranchCtrl is disabled -- So this patch
also enables BranchCtrl, which is intended to support join
instructions within the "ELSE" block, which in turn disables the
optimization described above, which in turn causes us to execute the
instruction immediately *before* the ENDIF with all channels disabled
-- So in order to avoid further fallout from executing code with all
channels disabled we need to insert a NOP before ENDIF instructions
that have a matching ELSE instruction.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20921>
2023-02-07 21:37:12 +00:00
Ian Romanick
65db990b39 lavapipe: Only check NULL pointers in one place in src_only_uses_uniforms
It took me a minute to figure out why the last uni_offsets NULL check
didn't also need to check num_offsets. I think this makes the code
slightly easier to understand.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21144>
2023-02-07 11:15:16 -08:00
Ian Romanick
a7696a4d98 lavapipe: Fix bad array index scale factor in lvp_inline_uniforms pass
A few lines earlier uni_offsets is accessed with ubo scaled by
PIPE_MAX_CONSTANT_BUFFERS:

   if (uni_offsets[ubo * PIPE_MAX_CONSTANT_BUFFERS + i] == offset)

Found by inspection.

Looking at the before and after NIR code for
dEQP-VK.graphicsfuzz.cov-int-initialize-from-multiple-large-arrays,
using the correct indexing appears to enable the pass to inline an
additional uniform. My guess is that when a uniform is used more than
once, the first loop wouldn't find the offset recored in the table
because it was recorded at the wrong location.

Fixes: d23a9380dd ("lavapipe: implement extreme uniform inlining")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21144>
2023-02-07 11:15:16 -08:00
Boyuan Zhang
6d37f7f5ac virgl/video: disable decoder fence
Revert part of the commit 8187b35f to disable decoder fence for now
since it is causing regression for transcoding tests.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21145>
2023-02-07 18:37:23 +00:00
SoroushIMG
782f1e9e01 zink: fix pointcoord y inversion
Point sprite coordinates in general need to be inverted,
not just the texcoords converted to point sprite.

Move point coord y inversion out to its own pass.
Fixes GTF-GL46.gtf21.GL2FixedTests.point_sprites.point_sprites
with FBO dEQP surface.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21050>
2023-02-07 18:07:19 +00:00
Eric Engestrom
6ace3d6cf0 ci/android: add missing line terminator at the end of the file
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21157>
2023-02-07 16:28:35 +00:00
Eric Engestrom
61eba80974 ci/android: move virgl-specific so lib name to virgl-defined variables
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21157>
2023-02-07 16:28:35 +00:00
Eric Engestrom
720812f353 ci/android: move virgl-specific deqp suite to virgl-defined variables
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21157>
2023-02-07 16:28:35 +00:00
Eric Engestrom
b9cdcd2cbe ci/android: move virgl-specific fails/flakes/skips lists to virgl-defined variables
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21157>
2023-02-07 16:28:35 +00:00
Eric Engestrom
515ea48523 ci/android: move virgl-specific gpu_mode to virgl-defined variables
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21157>
2023-02-07 16:28:35 +00:00
Eric Engestrom
eb0f85dd8c ci/android: move common config to common job
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21157>
2023-02-07 16:28:35 +00:00
José Roberto de Souza
eb9ab4efeb intel/genxml/gen125: Tune 3DSTATE_WM Walker direction
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21105>
2023-02-07 07:34:44 -08:00
José Roberto de Souza
bea93f7058 intel/genxml/gen125: Add walker configuration fields to 3DSTATE_WM
Setting default expected values as default in the xml.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21105>
2023-02-07 07:34:35 -08:00
Rhys Perry
fad1f716dd aco: fix out-of-bounds access when moving s_mem(real)time across SMEM
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8224
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21138>
2023-02-07 14:50:43 +00:00
Mike Blumenkrantz
7d8e2db9f9 lavapipe: disable VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT for int formats
this is unsupported and undefined by the spec

cc: mesa-stable

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21099>
2023-02-07 14:23:01 +00:00
Iago Toral Quiroga
fec15a225f v3dv: ensure we apply binning syncs to secondary command buffers
Currently, we postpone binning syncs until we record draw calls
and can validate if any of them require accessing protected
resources in the binning stage, however, if the draw calls are
recorded in a secondary command buffer and the barriers have
been recorded in the primary command buffer, we won't apply the
binning sync in the secondary when we record the draw calls
and so we must apply it when we execute the secondary in the
primary.

Fixes flakyness in:
dEQP-VK.api.command_buffers.record_many_draws_secondary_2

cc: mesa-stable

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21162>
2023-02-07 14:07:19 +01:00
Iago Toral Quiroga
c2601f0690 v3dv: ensure at least V3D_CL_MAX_INSTR_SIZE bytes in last CL instruction
The CLE parser in the sim will read this many bytes for each instruction
in a CL, so we should ensure we have at least that many bytes available
in the BO when reading the last instruction, otherwise we can trigger
a GMP violation. It is not clear whether this behavior applies to real
hardware too.

cc: mesa-stable

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21162>
2023-02-07 14:06:57 +01:00
Frank Binns
079247e046 pvr: remove start/stop transfer flags
These are ignored by the pvrsrvkm KMD and don't exist in the new KMD.

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Luigi santivetti <luigi.santivetti@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21132>
2023-02-07 10:34:05 +00:00
pal1000
4347072443 meson: Ignore unused variables when assertions are disabled
Fixes: 46b099e3
("meson: Ignore unused variables in release builds")

46b099e3 has some issues:
- it doesn't enable unused variables warning on release builds
with assertions enabled;
- it doesn't disable unused variables warning on debug builds
with assertions disabled;
- it doesn't disable unused variables warning when building
with MSVC and assertions are disabled regardless of buildtype,
see #8147. 3/4 regressions reported there have this limitation
alone as root cause.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21154>
2023-02-07 08:44:14 +00:00
Qiang Yu
4888dd7391 radv: use amd common force_vrs option
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21010>
2023-02-07 08:09:39 +00:00
Qiang Yu
1e3198c766 radv: move radv_consider_force_vrs above radv_fill_shader_info
It will be used by radv_fill_shader_info, no function change.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21010>
2023-02-07 08:09:39 +00:00
Lionel Landwerlin
bee8e47048 anv: use malloc for host only descriptor sets
On integrated products this makes almost no difference but on discrete
it's pretty important.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Tested-by: Chuansheng Liu <chuansheng.liu@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21131>
2023-02-07 07:28:32 +00:00
Dave Airlie
3e2c768aa8 radv/vcn: enable dynamic dpb tier 2 for h264/h265 on navi21+
navi21 can do separate image support, using tier 2 DPB messages.

This enables support for doing that in the vulkan video driver.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20388>
2023-02-07 12:48:28 +10:00
Dave Airlie
6c3c242361 radv/video: add h265 decode UVD support
Add support for h265 decode on older UVD GPUs

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20388>
2023-02-07 12:48:26 +10:00
Dave Airlie
db62c38091 radv: add vcn h265 decode.
This adds support for HEVC decode in VCN

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20388>
2023-02-07 12:48:24 +10:00
Dave Airlie
8a29291dbe radv/video: add h264 support for uvd
This adds support for the older UVD h264 decoder.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20388>
2023-02-07 12:48:22 +10:00
Dave Airlie
1693c03a39 radv/video: add initial h264 decoder for VCN
This adds support for H264 decode on VCN hardware.

It uses the full DPB method, and relies on the application
to allocate an arrayed texture for the DPB to be stored into.

RADV_PERFTEST=video_decode is required to enable this.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20388>
2023-02-07 12:47:53 +10:00
Dave Airlie
9477f117f4 radv/video: add initial frameworking.
This just adds the basic commands and objects, and hooks up some
of the queues and extensions.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20388>
2023-02-07 12:47:50 +10:00
Dave Airlie
3253340916 radv: add video decoder register setup.
This just assigns the correct registers depending on the gpu family.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20388>
2023-02-07 12:47:48 +10:00
Dave Airlie
85eead4198 radv: adding video decode queue support
This adds the video queue interactions to radv and builds
on the winsys code previously added.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20388>
2023-02-07 12:47:46 +10:00
Dave Airlie
30b6e9797d ac: add name to codec info struct
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20388>
2023-02-07 12:47:43 +10:00
Dave Airlie
ee7837aae2 radv: add new upload alloc aligned api
The video buffers need to have objects aligned at certain ranges,
this enhances the uploader to allow an alignment to be specified.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20388>
2023-02-07 12:47:39 +10:00
Dave Airlie
855ad612e1 radv: remove the status query mark it unsupported.
The current firmware can't support the status query requirements.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20388>
2023-02-07 12:47:25 +10:00
Rob Clark
284547af55 freedreno+ir3: Move storage_16bit to compiler options
This isn't a thing in gl.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21152>
2023-02-07 01:26:45 +00:00
Kenneth Graunke
79caf8a44b anv: Make a batch decoder for each queue family
The decoder context needs to know what engine it's associated with.
Nowadays, we have render, compute, blitter, even video engines being
used from the same driver.  Rather than trying to have a single decoder
and thwacking the engine field back and forth between calls, we make
one per queue family, and stash a pointer in anv_queue for easy access.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21149>
2023-02-06 23:21:55 +00:00
Alejandro Piñeiro
1a1fa2393e v3d/v3dv: use shader_info->var_copies_lowered
Instead of passing allow_copies as a parameter for v3d_optimize_nir
(so manually doing that tracking).

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19338>
2023-02-06 22:11:34 +00:00
Alejandro Piñeiro
ba0bc7182d anv: use shader_info->var_copies_lowered
Instead of passing allow_copies as a parameter for brw_nir_optimize
(so manually doing that tracking).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19338>
2023-02-06 22:11:34 +00:00
Alejandro Piñeiro
a12a71e6c0 radv: use shader_info->var_copies_lowered
Instead of passing allow_copies as a parameter for radv_optimize_nir
(so manually doing that tracking).

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19338>
2023-02-06 22:11:34 +00:00
Alejandro Piñeiro
3685528c1e nir: track if var copies lowering was called
In general we should only call it once, and then we should avoid to
call any lowering that introduce back copies. So far we were tracking
that manually out of the nir shader on several places.

Ideally we would like to add a nir_validate rule, but right now there
are some exceptions to this rule. For example right now the Intel
compiler calls nir_lower_io_to_temporaries as part of linking
tess_ctrl/mesh/task sahders.

One option would be to allow drivers to reset the value, but for now
let's not add that validation rule.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19338>
2023-02-06 22:11:34 +00:00
Yuxuan Shui
27a89a0903 loader: unregister special event in loader_dri3_drawable_fini
This was inadvertently removed in 98a6cfd395 and causes continuous
memory leaks as events are being received after the context has been
unbound.

Fixes: 3170b63314 ("loader: Add infrastructure for tracking active CRTC resources")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8238
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21128>
2023-02-06 20:45:32 +00:00
Pavel Ondračka
f56f277ba0 r300: set register file to none if swizzles are constant only
In constant folding when converting multiply by zero to mov.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21141>
2023-02-06 20:31:56 +00:00
Kai Wasserbäch
1d5d07e565 fix: gallivm: limit usage of LLVMContextSetOpaquePointers() to LLVM 15
LLVMContextSetOpaquePointers() was a temporary workaround offered to
allow transitioning to opaque pointers. Mesa is ready for this now with
recent versions of LLVM (16+). Therefore we limit the workaround of
using LLVMContextSetOpaquePointers() to LLVM 15 now, that this C
interface was removed in LLVM 17.

Reference: 1270879376
Suggested-by: Dave Airlie <airlied@redhat.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8183
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21124>
2023-02-06 19:50:35 +00:00
Konstantin Seurer
569517d7ad radv: Use common ycbcr conversion lowering
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20731>
2023-02-06 18:36:29 +00:00
Konstantin Seurer
9104dafb6f vulkan,nir: Refactor ycbcr conversion state into a struct
This will be useful for RADV since it hashes the state.

v3dv changes:
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20731>
2023-02-06 18:36:29 +00:00
Konstantin Seurer
dae893cb96 radv: Remove radv_indirect_unaligned_dispatch
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21071>
2023-02-06 17:50:53 +00:00
Konstantin Seurer
b9d7306edc radv: Use an ordered dispatch for BVH encoding
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21071>
2023-02-06 17:50:53 +00:00
Konstantin Seurer
22a028ea99 radv: Implement ordered compute dispatches
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21071>
2023-02-06 17:50:53 +00:00
Konstantin Seurer
77b0a4c025 radv: Make radv_compute_dispatch non-static
To avoid adding yet another radv_*_dispatch helper.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21071>
2023-02-06 17:50:53 +00:00
Guilherme Gallo
26754f658e Revert "ci: disable Collabora's LAVA lab for maintance"
This reverts commit 60d7e15a7e.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20903>
2023-02-06 17:22:11 +00:00
Guilherme Gallo
95b5cc3a53 radeonsi/ci: Skip slow traces on raven
Two traces timed out during Collabora's LAVA farm re-enablement.
Possibly, some commit made them slower during farm downtime.

- https://gitlab.freedesktop.org/mesa/mesa/-/jobs/35934124

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20903>
2023-02-06 17:22:11 +00:00
Guilherme Gallo
53cc509288 radeonsi/ci: Update stoney test expectations
Some jobs failed during the re-enablement of Collabora's LAVA farm.

The trace job radeonsi-stoney-traces:amd64 produced some traces with
almost unnoticeable lighting spread difference, so I updated all the
traces.

Now the test spec@ext_texture_lod_bias@lodbias is failing after running
a couple of times.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20903>
2023-02-06 17:22:11 +00:00
Jonathan Gray
f15f08c3de intel/dev: Add another EHL pci id
described as "32 Execution Unit (EU) Super SKU" in:
Intel Atom x6000E Series, and Intel Pentium and Celeron N and
J Series Processors for IoT Applications
Datasheet, Volume 1
Document Number: 636112-1.6

Reviewed-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/21129>
2023-02-06 16:48:39 +00:00
Jonathan Gray
a23e04b673 intel/dev: remove invalid EHL pci id
removed in linux
0e8e272f1368 ("drm/i915/ehl: Remove invalid PCI ID")

Reviewed-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/21129>
2023-02-06 16:48:39 +00:00
Mike Blumenkrantz
89cf0a3bdc zink: fix max acquired image count
according to spec, the maximum number of acquired images can be calculated with

swapchain_size - VkSurfaceCapabilitiesKHR::minImageCount + 1

the previous calculation was both wrong and occurring in the wrong place,
so this corrects both issues

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21095>
2023-02-06 16:35:48 +00:00
SoroushIMG
22e91af1a7 zink: clear null image surfaces to 0
GL Spec says that imageLoad from incomplete images must return 0.
This is not really spec compliant as for proper behavior nullDescriptor
and robustImageAccess2 is needed.
A workaround for lack of either of these requires a shader variant.
Clearing the null surface and hoping the app doesn't write to the image
is closer to spec, while avoiding a shader recompile.

KHR-GL46.shader_image_load_store.incomplete_textures tests this.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21135>
2023-02-06 15:55:57 +00:00
Samuel Pitoiset
2fe3cef367 radv: do not insert fast-linked libraries to the shaders cache
Similar to fast-linked pipelines that aren't added to the cache.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21133>
2023-02-06 15:01:30 +00:00
SoroushIMG
104040b5c7 zink: fix leak when rebinding same image surface
simple way to reproduce this is to run these 4 together:
KHR-GL46.gpu_shader5.images_array_indexing
KHR-GL46.shader_image_load_store.advanced-allMips
KHR-GL46.shader_image_load_store.advanced-sso-simple
KHR-GL46.shader_image_load_store.incomplete_textures

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21134>
2023-02-06 14:47:47 +00:00
SoroushIMG
4c647c9e25 zink: only save frag const buffers when used by blit
fixes upload manager constant buffer leak.
zink only needs to save the const buffer for stencil fallback blits.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21134>
2023-02-06 14:47:47 +00:00
Rhys Perry
c68f9ed020 radv/llvm: use the ring_offsets shader arg
Besides being nicer, this also fixes load_sample_positions_amd with LLVM.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19202>
2023-02-06 14:25:16 +00:00
Rhys Perry
be6f30a0db ac/llvm: let ring_offsets be accessed like a normal arg
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19202>
2023-02-06 14:25:16 +00:00
Rhys Perry
24618721d3 ac: move ring_offsets to ac_shader_args
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19202>
2023-02-06 14:25:15 +00:00
Rhys Perry
10a5035c83 radv: set state.vbo_misaligned_mask_invalid in radv_bind_vs_input_state
Found by inspection. Something probably hangs because of this, but I don't
know what.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: c199a5160a ("radv: bind the VS input state for prologs created with GPL")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20913>
2023-02-06 14:05:13 +00:00
Luigi Santivetti
21f0fc65b2 pvr: add padding bytes when allocating buffer memory
We need to pad VkBuffers to ensure we don't read beyond a page boundary.

An alternative to this approach would be to allocate an additional virtual
page when binding memory to the buffer, and to map this to the first
physical address, so both the first and last virtual page point to the same
physical location. This would be less expensive in terms of memory usage,
but more complex and invasive, hence the simpler approach has been taken
for now.

Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21101>
2023-02-06 11:18:38 +00:00
Karmjit Mahil
4e75e1bfec pvr: Set SPMSCRATCHBUFFER flag.
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21102>
2023-02-06 10:47:38 +00:00
Karmjit Mahil
ad8c0878b4 pvr: Update comment about ZS and MSAA buffers for pvrsrvkm submission.
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21102>
2023-02-06 10:47:38 +00:00
Karmjit Mahil
3457f8083a pvr: Acquire scratch buffer on framebuffer creation.
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21102>
2023-02-06 10:47:38 +00:00
Karmjit Mahil
ad9c61c292 pvr: Add SPM scratch buffer infrastructure.
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21102>
2023-02-06 10:47:38 +00:00
Lionel Landwerlin
e37f458207 intel/ds: track end of pipe bits
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:18 +00:00
Lionel Landwerlin
a242500eb4 anv: rename a few internal functions to highlight gfx use
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:18 +00:00
Lionel Landwerlin
6a23b18730 anv: rename RT pipeline function helper
Making it clear this is intended for RT pipelines only.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:18 +00:00
Lionel Landwerlin
fd7debc8bb intel/fs: make alpha_to_coverage a tristate
That way in some cases we can do this dynamically.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:18 +00:00
Jason Ekstrand
f3969e2413 intel/fs: Rework dynamic coarse handling
Use 2 flags for PI & RT messages.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:18 +00:00
Jason Ekstrand
964b878986 intel/fs: Break out yet another FB write helper
This new helper, do_emit_fb_writes() does the actual walk over all the
render targets to emit each of the different FB writes.  We want this in
a helper because we're about to go a bit crazy with coarse.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:18 +00:00
Jason Ekstrand
9c658b1fc8 intel/fs/validate: Assert SEND [extended] descriptors are uniform
This is required by code-gen since it generates a 1-wide OR and it'll
blow up if the register width > 1.  It's also way better than the "your
register is the wrong size" assert you get from the more generic
validation check.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:18 +00:00
Jason Ekstrand
949b42c4dc intel/compiler: Convert wm_prog_key::multisample_fbo to a tri-state
This allows us to communicate to the back-end that we don't actually
know if the framebuffer is multisampled or not.  No drivers set anything
but ALWAYS/NEVER and we still have a few ALWAYS/NEVER assumptions but
those should be asserted.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:18 +00:00
Jason Ekstrand
5644011f06 intel/compiler: Convert wm_prog_key::persample_interp to a tri-state
This allows for the possibility that we may not know at compile time if
sample shading is enabled through the API.  While we're here, also
document exactly what this bit means so we don't confuse ourselves.

v2: Fixup coarse pixel values (Lionel)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:18 +00:00
Jason Ekstrand
d8dfd153c5 intel/fs: Make per-sample and coarse dispatch tri-state
Whenever one of them is BRW_SOMETIMES, we depend on dynamic flag pushed
in as a push constant.  In this case, we have to often have to do the
calculation both ways and SEL the result.  It's a bit more code but
decouples MSAA from the shader key.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:18 +00:00
Jason Ekstrand
43ca7f4178 intel/compiler: Convert brw_wm_aa_enable to brw_sometimes
There are other cases where we want a tri-state logic like this.  May as
well have one enum for all the cases.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:17 +00:00
Jason Ekstrand
5d1c538449 intel/fs: Return early in a couple builtin setup helpers
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:17 +00:00
Jason Ekstrand
714a291673 intel/compiler: Use SHADER_OPCODE_SEND for PI messages
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:17 +00:00
Jason Ekstrand
9c62e0c77d nir: Remove nir_lower_io_force_sample_interpolation
It's no longer used.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:17 +00:00
Jason Ekstrand
d25e5310bc intel/nir: Lower barycentrics to per-sample in a dedicated pass
This is more similar to what we do for single-sample and it should be
more clear going forward once our lowering gets more complex.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:17 +00:00
Jason Ekstrand
991d546102 intel/compiler: Document wm_prog_key::persample_interp
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21094>
2023-02-06 09:12:17 +00:00
Marek Olšák
71a6b53192 amd: don't hardcode real VGPR allocation granularity on gfx10.3 and gfx11
That's how it really works.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20967>
2023-02-05 23:23:58 -05:00
Marek Olšák
e673bb4ae4 amd,util: fix how lod bias is converted to fixed-point
according to internal docs

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20967>
2023-02-05 23:23:45 -05:00
Marek Olšák
fb5d31c3dd amd/surface: clean up is_dcc_supported_by_L2
no functional change, though this removes "<=" for navi10, which was
never true in the "<" case

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20967>
2023-02-05 23:23:45 -05:00
Marek Olšák
70d228188a radeonsi: clean up si_set_mutable_tex_desc_fields
- sink code into existing branches
- remove unnecessary clearing of fields
- no functional change

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20967>
2023-02-05 23:23:45 -05:00
Marek Olšák
4f246f27b1 amd: define new SET_*_REG_PAIRS packets
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20967>
2023-02-05 23:23:45 -05:00
Marek Olšák
97f30fc65f radeonsi/gfx11: don't add alpha to mrt0 format for A2C if exporting via mrtz
If alpha-to-coverage is exported via mrtz, don't upgrade the mrt0 format
to one with an alpha channel.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20967>
2023-02-05 23:23:45 -05:00
Marek Olšák
0f81224e70 radeonsi/gfx11: don't add mrt0 export for alpha-to-coverage if mrtz is present
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20967>
2023-02-05 23:23:45 -05:00
Alyssa Rosenzweig
6b97f396e6 nir/lower_clip: Only emit 1 discard
If we have multiple clip planes, rather than emit multiple discards we can just
OR together the discard criteria. Then a nir_opt_algebraic rule kicks in to
optimize out the flt/.../flt/ior/.../ior into fmin/.../fmin/flt, generating
much less code at the end.

Written while debugging an unrelated issue with the clip lowering.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21103>
2023-02-06 02:50:20 +00:00
Mike Blumenkrantz
b481e3ae57 zink: conditionally enable PIPE_CAP_NULL_TEXTURES
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21072>
2023-02-05 13:32:02 +00:00
Mike Blumenkrantz
8b000ebbb5 radeonsi: set PIPE_CAP_NULL_TEXTURES
fixes #8163

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21072>
2023-02-05 13:32:02 +00:00
Mike Blumenkrantz
2127287d4d gallium: add PIPE_CAP_NULL_TEXTURES
this allows drivers to indicate that they support sampling from null
textures instead of using fallback textures

for now, this is only used for depth-based fallback textures

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21072>
2023-02-05 13:32:02 +00:00
Konstantin Seurer
7f98fcae52 radv: Scalarize global IO with LLVM enabled
Fixes the "atomic store operand must have integer, pointer, or floating point type!" error with RADV_DEBUG=llvm,checkir.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20840>
2023-02-05 12:40:25 +00:00
Konstantin Seurer
10ac51a52b ac/llvm: Fix validation error with global io
Fixes: afd645f057 ("ac/llvm: remove LLVMBuildGEP usages")
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20521>
2023-02-05 12:16:05 +00:00
Konstantin Seurer
55175cd13c radv/llvm: Use the shader names as module name
This makes it easier to identify which (if any) shaders fail validation.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20521>
2023-02-05 12:16:05 +00:00
Konstantin Seurer
877e150ec8 radv/rq: Use 16 stack entries if there is only one ray query
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21120>
2023-02-05 11:51:42 +00:00
Asahi Lina
4ca4a05627 meson: Fix Asahi build on macOS
!19950 introduced a dependency between NIR and Vulkan headers, and the
Vulkan headers try to include X11 headers we cannot find on macOS.

Disable this (we have no plans for Vulkan on the macOS testing platform
anyway).

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21059>
2023-02-05 09:15:48 +00:00
Alyssa Rosenzweig
bfa7ec0aa0 agx: Don't scalarize preambles in NIR
Scalarizing preambles in NIR isn't really necessary, we can do it more
efficiently in the backend. This makes the final NIR a lot less annoying to
read; the backend IR was already nice to read thanks to all the scalarized moves
being copypropped. Plus, this is a lot simpler.

No shader-db changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21122>
2023-02-05 08:53:29 +00:00
Alyssa Rosenzweig
7edd42cbc0 agx: Lower uniform sources with a dedicated pass
Move the decision of "can I copyprop this uniform?" from copyprop to a
standalone lowering pass. This is more straightforward and will enable the next
patch. This has the side effect of sinking load_preamble instructions, for a
nice reduction in register pressure. Instruction count increase is from
rematerializing some moves, which should be more than balanced out by the
reduced register pressure.

total instructions in shared programs: 1523285 -> 1523317 (<.01%)
instructions in affected programs: 1148 -> 1180 (2.79%)
helped: 0
HURT: 13
HURT stats (abs)   min: 1.0 max: 4.0 x̄: 2.46 x̃: 2
HURT stats (rel)   min: 0.69% max: 7.69% x̄: 3.65% x̃: 2.61%
95% mean confidence interval for instructions value: 1.78 3.14
95% mean confidence interval for instructions %-change: 2.16% 5.15%
Instructions are HURT.

total bytes in shared programs: 10444532 -> 10444724 (<.01%)
bytes in affected programs: 7386 -> 7578 (2.60%)
helped: 0
HURT: 13
HURT stats (abs)   min: 6.0 max: 24.0 x̄: 14.77 x̃: 12
HURT stats (rel)   min: 0.63% max: 7.14% x̄: 3.40% x̃: 2.48%
95% mean confidence interval for bytes value: 10.68 18.85
95% mean confidence interval for bytes %-change: 2.02% 4.78%
Bytes are HURT.

total halfregs in shared programs: 419444 -> 416434 (-0.72%)
halfregs in affected programs: 27080 -> 24070 (-11.12%)
helped: 634
HURT: 0
helped stats (abs) min: 1.0 max: 30.0 x̄: 4.75 x̃: 2
helped stats (rel) min: 2.90% max: 54.55% x̄: 13.13% x̃: 8.51%
95% mean confidence interval for halfregs value: -5.08 -4.41
95% mean confidence interval for halfregs %-change: -14.03% -12.23%
Halfregs are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21122>
2023-02-05 08:53:29 +00:00
Alyssa Rosenzweig
e44a53f5dc agx: Run DCE twice
Needed to combine fsat with vectors due to nir_lower_blend changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21122>
2023-02-05 08:53:29 +00:00
Alyssa Rosenzweig
cd8b5427c7 agx: Allow uniform sources on phis
The parallel copy lowering has been able to handle uniform sources since 98f0ebf264 ("agx:
Pass agx_index to agx_copy"), and uniform sources work fine with phis. It's not
super common but there's no need to restrict them. This is a small instruction
count win and will greatly simplify the lowering later in this series.

total instructions in shared programs: 1523806 -> 1523285 (-0.03%)
instructions in affected programs: 17088 -> 16567 (-3.05%)
helped: 38
HURT: 1
helped stats (abs) min: 1.0 max: 44.0 x̄: 13.95 x̃: 7
helped stats (rel) min: 0.42% max: 18.64% x̄: 4.73% x̃: 1.26%
HURT stats (abs)   min: 9.0 max: 9.0 x̄: 9.00 x̃: 9
HURT stats (rel)   min: 8.57% max: 8.57% x̄: 8.57% x̃: 8.57%
95% mean confidence interval for instructions value: -17.95 -8.77
95% mean confidence interval for instructions %-change: -6.35% -2.43%
Instructions are helped.

total bytes in shared programs: 10447658 -> 10444532 (-0.03%)
bytes in affected programs: 118850 -> 115724 (-2.63%)
helped: 38
HURT: 1
helped stats (abs) min: 6.0 max: 264.0 x̄: 83.68 x̃: 45
helped stats (rel) min: 0.36% max: 16.51% x̄: 4.14% x̃: 1.09%
HURT stats (abs)   min: 54.0 max: 54.0 x̄: 54.00 x̃: 54
HURT stats (rel)   min: 7.30% max: 7.30% x̄: 7.30% x̃: 7.30%
95% mean confidence interval for bytes value: -107.68 -52.62
95% mean confidence interval for bytes %-change: -5.55% -2.13%
Bytes are helped.

total halfregs in shared programs: 419446 -> 419444 (<.01%)
halfregs in affected programs: 29 -> 27 (-6.90%)
helped: 1
HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21122>
2023-02-05 08:53:29 +00:00
Luc Ma
abe6d750e5 xlib: fix glXDestroyContext in Gallium frontends
when glx is built with -Dglx=xlib, the mishandle in
glXDestroyContext causes glmark2 to exit unexpectedly.

Error: Glmark2 needs OpenGL(ES) version >= 2.0 to run (but version string is: '(null)')!
Error: Failed to add vertex shader from file None:
Error:   Failed to create the new program
[build] <default>: Set up failed

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3985

Signed-off-by: Luc Ma <luc@sietium.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21067>
2023-02-04 22:25:09 +00:00
SoroushIMG
8f928a95e1 zink: fix cap check for arb sparse texture2
arb_sparse_texture2 also enables multisampled sparse textures.
bring back the check for msaa support.

fixes #8229

Fixes: 4f8ba2b9aa ("zink: fix sparse residency query and minLOD feature checks")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21121>
2023-02-04 18:05:48 +00:00
Alyssa Rosenzweig
93db6094a1 nir/print: Pretty-print color0/1_interp
These are an enum. Furthermore, their 0 state is INTERP_MODE_NONE which we
shouldn't bother printing at all.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21091>
2023-02-04 17:26:30 +00:00
Alyssa Rosenzweig
b235be1fd4 nir/print: Pretty-print I/O semantic locations
Instead of printing the raw location number, which is pretty hard to interpret,
let's print the name of the location. Example output:

   vec4 16 ssa_2 = intrinsic load_interpolated_input (ssa_0, ssa_1) (base=0,
   component=0, dest_type=float16 /*144*/, io location=VARYING_SLOT_VAR0 slots=1
   mediump /*8388768*/)

One of the "regressions" from moving to purely lowered I/O with all variables
removed is a lack of debuggability, since otherwise these location strings don't
show up anywhere in the printed shader! By contrast this should make the lowered
I/O nice to read like the early I/O.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21091>
2023-02-04 17:26:30 +00:00
Alyssa Rosenzweig
435e7f5e6d nir/print: Extract get_location_str
Locations show up in two places: variables and lowered I/O semantics. We want to
reuse the logic in both places, so extract it out. The extracted logic is IMO
easier to read, too.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21091>
2023-02-04 17:26:30 +00:00
Alyssa Rosenzweig
f857795e83 agx: Implement barriers
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
251f6fb224 agx: Implement compute ID intrinsics
These NIR intrinsics map to vectors of special registers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
da91a78ab7 asahi: Identify more compute-related XML
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
57e0dbe55b asahi: Implement load_ssbo_address/get_ssbo_size
More uniforms that get pushed.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
78c9344a4d asahi: Add compute batches
Add a specialized agx_batch for compute commands (queued to the CDM instead of
the VDM for graphics). This uses a sentinel value for the width.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
f54739396c asahi: Bump PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS
Seems arbitrary.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
580ed13779 asahi: Stub out MSAA for dEQP
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
5e7babfa1b asahi: Advertise seamless cube maps
These are already wired up.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
32cbcbcb50 asahi: Fake more caps for dEQP-GLES31
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
f4b553d55a asahi: Add hooks for SSBO and images
Copy paste from Panfrost. This should be close to what we need for Asahi, and
this lets us run dEQP-GLES31 without crashing immediately.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
c1a6465644 asahi: Don't leak shader NIR
create_shader_state passes ownership of the NIR to the driver, so we need to
free it when we destroy the shader CSO later. Use ralloc to manage this in a
uniform way between graphics and compute. Strategy from Panfrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
227d4f6d75 asahi: Add compute kernel scaffolding
This adds the basic scaffolding for compute kernels. There's a bit of churn to
make sure we don't need to hang onto the kernel NIR, since it's never used for
anything else except looking up the shader stage.

The compute kernels aren't actually wired up here, but they do get compiled.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Alyssa Rosenzweig
60121e3a42 asahi: Fix delete_vs_state implementation
The generic free won't delete the shader variants, leaking them all!

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21062>
2023-02-04 17:10:15 +00:00
Hampus Linander
b73b5cc71a agx: Optimize lower_resinfo for cube maps
We can avoid reading both width and height when the texture is a cube map, and
we do so more simply by relying on CSE+DCE (Alyssa).

Closes: #7541
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20628>
2023-02-04 11:13:37 -05:00
Hampus Linander
9ab1c0d83b agx: Use AGX extr for tex lowering
Replaces a number of bit operations by a single extr instruction,
optimizing the extraction of the width from the packed value.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20628>
2023-02-04 11:13:37 -05:00
Hampus Linander
f3d6524a2d agx: Add extr instruction to AGX backend
Encoding is similar to bfeil, in particular the immidiate has the
same encoding as BFI_MASK hence its reuse.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20628>
2023-02-04 11:13:37 -05:00
Hampus Linander
4ffc7c3ff4 nir: Add extr_agx opcode
The AGX extr instruction extracts a bitfield from two 32bit registers.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20628>
2023-02-04 11:13:24 -05:00
Alyssa Rosenzweig
e765ec21ec asahi: Implement custom border colours
Implement custom border colours, as required by OpenGL's CLAMP_TO_BORDER and
Vulkan with customBorderColor. This uses an extended sampler descriptor, which
has space for the custom border values. The trouble is that the border must be
packed into an internal interchange format that depends on the original format
in a complex way. That said, we're not solving NP-complete problems here, and it
passes the tests (dEQP-GLES31.functional.texture.border_clamp.* and piglit
texwrap).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20570>
2023-02-04 10:37:02 -05:00
Alyssa Rosenzweig
507ca71f3e agx/decode: Handle extended samplers
These include a border colour field.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20570>
2023-02-04 10:32:38 -05:00
Alyssa Rosenzweig
afce5be659 agx/decode: Add a data parameter to stateful
So we can handle extended samplers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20570>
2023-02-04 10:32:38 -05:00
Alyssa Rosenzweig
10eaa4a2ec asahi: Add XML for custom border colours
These use extended sampler descriptors.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20570>
2023-02-04 10:32:24 -05:00
Timur Kristóf
3a819bd22e ac/nir/ngg: Include culled primitives in query.
Vulkan spec 18.8. Primitives Generated Queries:

When a generated primitive query for a vertex stream is active,
the primitives-generated count is incremented every time a
primitive emitted to that stream reaches the transform feedback
stage, whether or not transform feedback is active.

We can see the order of stages in chapter 27 Fixed-Function
Vertex Post-Processing, which shows that the transform feedback
stage is before rasterization (and therefore culling).

Conclusion is that culled primitives should be included
in the primitives generated query.

This commit makes sure to emit the primitives generated query
code before culling and uses the input primitive count passed
to the current wave instead of the exec mask after culling.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21037>
2023-02-04 11:53:07 +01:00
Alyssa Rosenzweig
221311e1e9 agx: Handle constant-offset in address matching
Match iadd(x, #y). The format shift will get constant-folded away and, if y
is sufficiently small, the constant will be inlined by the AGX backend
optimizer. This gets rid of piles of 64-bit arithmetic from lowering UBOs. It
probably doesn't matter for perf since that's happening in preamble shaders but
it *is* noisy.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21108>
2023-02-04 08:41:37 +00:00
Alyssa Rosenzweig
c3f7abaaef agx: Fix storing to varying arrays
The offset is in vec4s, not words (unlike the component). This doesn't matter
right now since we get everything lowered (offset -> 0) but it will come up if
we implement clip distances natively (instead of lowering in FS).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21097>
2023-02-04 08:28:43 +00:00
Alyssa Rosenzweig
897c47aa1c docs/asahi: Document clip distance varyings
These implement gl_ClipDistance in hardware, avoiding the fragment shader
lowering. Unfortunately, they can't be disabled on a per-plane basis and they
can't be interpolated, so using them for OpenGL would still require a bunch of
extra lowering steps. Still, we should document the hardware and the caveats.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21097>
2023-02-04 08:28:43 +00:00
Alyssa Rosenzweig
13b25a6114 asahi: Don't use 16-bit inputs to 32-bit st_tile
The hardware doesn't extend in this case, we need to extend for it. This
fixes 32-bit render target formats with lower_mediump_io.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21082>
2023-02-04 08:14:32 +00:00
Alyssa Rosenzweig
6b0322d441 agx: Keep varyings forwarded to texture as fp32
This works around bugs in a LOT of applications, since fp16 texture coordinates
are almost never appropriate even though it's a valid implementation of the GLES
spec. It also doesn't seem to matter for perf.

Code from the Bifrost compiler which implements the same workaround for slightly
different reasons.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21082>
2023-02-04 08:14:32 +00:00
Alyssa Rosenzweig
5678fbe010 asahi: Merge fragment control XML
Same struct specified twice and merged in the hw.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21081>
2023-02-04 07:58:42 +00:00
Alyssa Rosenzweig
50e61e251b asahi: Remove redundant tri merge disable bit
Cargoculted from Metal.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21081>
2023-02-04 07:58:42 +00:00
Alyssa Rosenzweig
6ee38e2635 asahi: DRY dirty tracking conditions
Ella did this in agxv and it made a lot more sense than the copypasta I did.
Should get copypropped to similar code.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21081>
2023-02-04 07:58:42 +00:00
Alyssa Rosenzweig
98b2657b9e asahi: Implement nontrivial rasterizer discard
For vertex shaders with side effects, as seen with transform feedback.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21081>
2023-02-04 07:58:42 +00:00
Alyssa Rosenzweig
64ae63c41f asahi: Prefer blit-based texture transfer
This speeds up glReadPixels. Instead of reading from the write-combined
framebuffer and converting colours on the CPU, this blits on the GPU to a
writeback staging resource with the colour conversion for free, and memcpies
from the writeback staging resource on the CPU.

In general, due to textures being write combined and tiled/compressed by default
by staging resources being linear writeback, blit-based texture transfer should
win out (you were going to blit anyway), particularly when format conversion is
involved

33% reduction in wall clock time for grim at 4K. No change in deqp-gles2
runtime.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21063>
2023-02-04 07:45:12 +00:00
Alyssa Rosenzweig
0a5c3764c7 asahi: Make STAGING resources linear
As intended by the flag.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21063>
2023-02-04 07:45:12 +00:00
Alyssa Rosenzweig
e7b97899ac asahi: Use writeback when it looks beneficial
When playing the My Little Pony theme song at 1080p on T8103, with mpv's GPU
compositing but software decoding, CPU usage drops from 200% to 50% due to
proper caching of the staging resource.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21063>
2023-02-04 07:45:12 +00:00
Asahi Lina
a88aa3e835 asahi: Refuse to transfer out-of-bounds mip levels
Fixes ail asserts on a pile of dEQP3 tests.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21063>
2023-02-04 07:45:12 +00:00
Alyssa Rosenzweig
3706da1d1a agx: Support uniform registers as LODs
This will avoid regressing moves when we lower sampler LOD bias. Corresponding
disassembler change: https://github.com/dougallj/applegpu/pull/22

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20833>
2023-02-04 07:33:08 +00:00
Alyssa Rosenzweig
231561d53a asahi: Correct alignment for USC Uniform packets
We only need 4 byte alignment, not 8 bytes. This isn't a big difference in
practice, but it probably reduces padding in some cases. More importantly, it
corrects our XML to match what the hardware actually does, which is great.
(There is exactly enough room for a 40-bit address with 4 byte alignment.)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21118>
2023-02-04 07:19:29 +00:00
Alyssa Rosenzweig
e4cb64c0e2 asahi/nir_lower_sysvals: Split large ranges
It is our responsibility to ensure uniform ranges don't exceed 64 uniforms.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21118>
2023-02-04 07:19:29 +00:00
Alyssa Rosenzweig
b0f1964771 asahi: Strengthen agx_usc_uniform contract
Check the size explicitly, instead of just implicitly in the GenXML pack: it is
the responsibility of the caller to split up larger uploads. While this is
nominally more complicated, agx_usc_uniform is called in the draw hot path
whereas the actual splitting decision can usually be done at compile-time.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21118>
2023-02-04 07:19:29 +00:00
Alyssa Rosenzweig
ea38709345 asahi: Fix encoding of uniform size
Only 6-bits, with zero=64 like a groups() encoding.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Suggested-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21118>
2023-02-04 07:19:29 +00:00
Alyssa Rosenzweig
79a7c6e3bd asahi: Set layout->mipmapped_z for 3D textures
There's a corner case where 3D textures have extra padding compared to 2D
arrays. We need to communicate that to ail.

Fixes
dEQP-GLES3.functional.texture.specification.texstorage3d.size.3d_32x16x64_4_levels.
That test now uses the same layout as Metal.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21114>
2023-02-04 07:04:49 +00:00
Alyssa Rosenzweig
9b2dc92228 ail: Test 63x63 cube map
This has a subtle interaction with page-aligned layers. Written while debugging
dEQP-GLES3.functional.texture.filtering.cube.combinations.nearest_nearest_repeat_clamp

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21114>
2023-02-04 07:04:49 +00:00
Alyssa Rosenzweig
294351ff77 ail: Test mipmapped_z behaviour
The mipmapped_z = true case is checked against Metal, the false case is smoke
testing the old behaviour (which is still used for 2D arrays).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21114>
2023-02-04 07:04:49 +00:00
Alyssa Rosenzweig
c2bf66ab87 ail: Add layout->mipmapped_z input
For 3D images, the full miptree depends on the depth of the image, in contrast
to 2D arrays. We need to account for this to calculate the correct layer
strides.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21114>
2023-02-04 07:04:49 +00:00
Sergi Blanch Torne
60d7e15a7e ci: disable Collabora's LAVA lab for maintance
This is to inform you of some planned downtime in the LAVA lab as follows:

    Start: 2023-02-04 06:00 GMT
    End: 2023-02-06 12:00 GMT

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21119>
2023-02-04 00:21:05 -03:00
Ian Romanick
ea413e826b nir: Eliminate nir_op_f2b
Builds on the work of !15121.  This gets to delete even more code
because many drivers shared a lot of code for i2b and f2b.

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

v2: Rebase on 1a35acd8d9.

v3: Update a comment in nir_opcodes_c.py. Suggested by Konstantin.

v4: Another rebase. Remove f2b stuff from Midgard.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20509>
2023-02-03 22:39:57 +00:00
Ian Romanick
024122c069 nir/builder: Handle f2b conversions specially in nir_type_convert
No shader-db or fossil-db changes on any Intel platform.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20509>
2023-02-03 22:39:57 +00:00
Ian Romanick
b265020b82 nir/builder: Eliminate nir_f2b helper (and use of nir_f2b32 helper)
There were only two users. Replace each with nir_fneu instead.

This is now a squash of what was two separate commits.
nir_lower_pstipple_block is called after nir_lower_bool_to_int32, so
nir_fneu32 has to be used here or there will be regresssions in stipple
tests on llvmpipe.

v2: Rebase on !20869.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Suggested-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20509>
2023-02-03 22:39:57 +00:00
Mike Blumenkrantz
7b0d000342 zink: add back VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT for bindless
this was accidentally lost in refactor

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21100>
2023-02-03 21:59:07 +00:00
Mike Blumenkrantz
e67bdf47d4 zink: handle missing line rasterization modes with ds3
it's annoying to validate this at runtime since it has to happen during draw,
but storing the "usable" ds3 mode separately from the pipeline state should
be a reasonable enough compromise for perf here...hopefully

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21100>
2023-02-03 21:59:07 +00:00
Mike Blumenkrantz
813bb9e442 zink: cache and reuse dummy inputattachment for fbfetch
apparently an actual null descriptor is illegal here, and it's wasted cpu
anyway, so just cache the dummy surface on init and use that data when
fbfetch isn't active but the layout requires it

Fixes: 7ab5c5d36d ("zink: use EXT_descriptor_buffer with ZINK_DESCRIPTORS=db")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21100>
2023-02-03 21:59:07 +00:00
Mike Blumenkrantz
abf63b7c68 zink: fix more cases of heap/memtype suballocator mismatch
suballocation must happen based on the memtype, so also add some asserts to
ensure the slab bos are always what the caller expects

Fixes: f6d3a5755f ("zink: zink_heap isn't 1-to-1 with memoryTypeIndex")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21100>
2023-02-03 21:59:07 +00:00
Mike Blumenkrantz
e1e4ddcf10 zink: free descriptor buffer maps on batch state destroy
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21100>
2023-02-03 21:59:07 +00:00
SoroushIMG
4f8ba2b9aa zink: fix sparse residency query and minLOD feature checks
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21013>
2023-02-03 20:05:23 +00:00
Yiwei Zhang
86c6484fba venus: lazily query and cache gralloc front rendering usage
When skiavk is the default system ui renderer, venus icd gets preloaded
into Zygote. However, Zygote access to render node is normally denied by
selinux except for legacy bootanimation purpose. This change fixes venus
icd loading to avoid invoking cros gralloc driver loading by moving the
perform op outside, so that we still get the memory footprint win.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21107>
2023-02-03 19:33:18 +00:00
Emma Anholt
de5b67ef2c ci/llvmpipe: Drop skip of InteractionFunctionCalls2.
This one is down to <5 seconds here these days.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21084>
2023-02-03 19:01:59 +00:00
Emma Anholt
2eb07304e3 ci/swrast: Drop skips for tests whose perf had been fixed.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21084>
2023-02-03 19:01:59 +00:00
Emma Anholt
907b0a01b7 gallivm: Do the same codegen improvement for constant-index array loads.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21084>
2023-02-03 19:01:59 +00:00
Emma Anholt
cf47154300 gallivm: Fix codegen performance for constant-index register array stores.
Instead of generating num_components*simdwidth scattered stores, if
there's no indirect then we can just look up the pointer to the
base_offset and do a simd store there.

dEQP-VK.subgroups.ballot_broadcast.compute.subgroupbroadcast_i64vec4 goes
from 30s to ~2s.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21084>
2023-02-03 19:01:59 +00:00
Emma Anholt
833a74351c gallivm: Fix the type of array nir_registers.
This now matches how they get dereffed by get_soa_array_offsets() -- each
array element has num_components vecs inside of it, rather than each
components has an array in it.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21084>
2023-02-03 19:01:59 +00:00
Emma Anholt
a5d360550e gallivm: Enable GALLIVM_DEBUG (mostly) on non-DEBUG builds.
This is what let me do the performance work in my recent gallivm MRs.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21086>
2023-02-03 18:21:49 +00:00
Emma Anholt
947c60fa2f llvmpipe: Enable LP_DEBUG on normal builds.
I don't typically include DEBUG because it sometimes has expensive debug
code, but these options are not that.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21086>
2023-02-03 18:21:49 +00:00
Dylan Baker
fd9b50aa1c meson: combine checks for linker --gc-sections support
We first do an incomplete check for whether the linker supports
--gc-sections, then potentially add C and C++ arguments assuming that it
works, then later do a complete check to see if it actually works and
use --gc-sections. This means we can end up putting functions and data
in separate sections when we can't gc them.

Combine the checks, do less work, and be more accurate.

fixes: f51ce21e4e
       ("meson: Drop adding -Wl,--gc-sections to project c/cpp arguments.")

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21083>
2023-02-03 17:48:58 +00:00
Alyssa Rosenzweig
7f98a9ba2b panfrost: Implement GL_EXT_render_snorm on Bifrost+
It turns out it's really easy.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20684>
2023-02-03 17:21:34 +00:00
Emma Anholt
b6bd904019 ci/lvp: Drop the subgroupbroadcast skips.
These have the same runtime as the others in the group, and with these
optimizations they no longer time out.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21001>
2023-02-03 08:51:42 -08:00
Emma Anholt
70be21e7c6 gallivm: Use first active invocation in some image/ssbo accesses.
These should be looking at that rather than blindly using invocation 0
(which may be junk when in control flow).

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21001>
2023-02-03 08:51:40 -08:00
Emma Anholt
8c2493d041 gallivm: Use cttz instead of a loop for first_active_invocation().
This should be way faster to compile by not spamming so many loops at
LLVM, and faster to execute if LLVM didn't figure out what that loop
meant.

It looks vector reduce ops aren't really a thing, just a convenience in
the IR.  We should be able to do better by counting zeroes in the
exec_mask != 0 result.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21001>
2023-02-03 08:51:37 -08:00
Emma Anholt
c11fa55f6d gallivm: Return 0 first_active_invocation when we know that up front.
46 -> 30 seconds on
dEQP-VK.subgroups.ballot_broadcast.compute.subgroupbroadcast_i16vec4 by
not spamming LLVM with so many loops.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21001>
2023-02-03 08:51:35 -08:00
Emma Anholt
dc7c518abe gallivm: Refactor out a shared "get the first active invocation" loop.
Dynamic texture indices had a similar "find an active channel" loop,
though it happened to use the last active channel rather than the first.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21001>
2023-02-03 08:51:32 -08:00
Emma Anholt
0b0246706e gallivm: Optimize emit_read_invocation's first-invocation loop.
We don't need to deref invoc inside -- invoc is uniform in active
channels, so we can find our first active invocation in the loop, and then
dereference invocation once outside.

50 -> 46 seconds on
dEQP-VK.subgroups.ballot_broadcast.compute.subgroupbroadcast_i16vec4

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21001>
2023-02-03 08:51:12 -08:00
Alyssa Rosenzweig
d73f72120a asahi: Lower texcoords late
This uses the new pass to lower tex coordinates late, which gets us one step
closer to preprocessing NIR at CSO create time instead of variant create time.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21065>
2023-02-03 15:03:06 +00:00
Alyssa Rosenzweig
6908a0dece asahi: Run nir_lower_fragcolor during preprocessing
This pass needs to run early (because it depends on early I/O), but it doesn't
actually need the shader key. Why not? If we overestimate the number of render
targets, extra store_output intrinsics will be generated, but they will be
deleted by AGX tilebuffer lowering later.

Note we'll probably want something smarter than this for fragment epilogues in
the future to avoid piles of unnecessary moves.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21065>
2023-02-03 15:03:06 +00:00
Alyssa Rosenzweig
071ac59960 nir: Add a late texcoord replacement pass
Add a second NIR pass for lowering point/texture coordinate replacement (i.e.
point sprites). Why a second one? The current pass works on derefs/variables,
which is good for drivers that don't lower I/O at all (like Zink, where the pass
originates). However, it is problematic for hardware drivers: the inputs to this
pass depend on the shader key, so we want to run the pass as late as possible to
minimize the cost of building/compiling the associated shader variants. In
particular, we need to be able to lower point sprites after lowering I/O if we
would like to lower I/O when preprocessing NIR.

The logic for early lowering and late lowering is considerably different (the
late lowering is a lot simpler), so I've split this out into a second pass
rather than trying to weld them together into one.

This pass will be used on Asahi, which currently uses the early pass. It may be
useful for other drivers as well. (Actually, it's been shipping on Asahi for a
little while now, just hasn't been sent upstream yet.)

Tested with Neverball.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Asahi Lina <lina@asahilina.net>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21065>
2023-02-03 15:03:06 +00:00
Konstantin Seurer
4397c166c0 radv: Work around shader_call_data variables in raygen shaders
Closes: #5326
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20930>
2023-02-03 14:25:19 +00:00
David Heidelberg
002707ff09 ci/lavapipe: use dxvk for the traces
Since the job is manual, this stayed overlooked.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20875>
2023-02-03 13:48:51 +00:00
David Heidelberg
3bc1bf7eea ci: uprev piglit (etag md5 checksumming support)
Support for FDO etag http header.

Includes line-smooth-stipple test improvements.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20875>
2023-02-03 13:48:51 +00:00
Qiang Yu
ed419f46aa aco: remove early_rast wait insert
It's done in nir position export.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
2023-02-03 12:27:44 +00:00
Qiang Yu
f6b194b648 nir,ac/llvm,aco,radv,radeonsi: remove nir_export_vertex_amd
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
2023-02-03 12:27:44 +00:00
Qiang Yu
f44872c7b6 nir,ac/llvm,aco: remove nir_export_primitive_amd
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
2023-02-03 12:27:44 +00:00
Qiang Yu
aea109e25d ac/nir/ngg,radv: ms use ac_nir_export_(primitive|position|parameter)
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
2023-02-03 12:27:44 +00:00
Qiang Yu
80d928c20e ac/nir/ngg: gs use ac_nir_export_(position|parameter)
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
2023-02-03 12:27:44 +00:00
Qiang Yu
bae5a3157f ac/nir/ngg: prepare gather_vs_outputs to be used by gs
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
2023-02-03 12:27:44 +00:00
Qiang Yu
80506be31b ac/nir/ngg,radv,radeonsi: nogs use ac_nir_export_(position|parameter)
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
2023-02-03 12:27:44 +00:00
Qiang Yu
f084e9bbe8 ac/nir/ngg: change clipdist_neg_mask_var type to uint32
ACO does not support 8bit ALU ops.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
2023-02-03 12:27:44 +00:00
Qiang Yu
d798214c7b ac/nir/ngg: fix clip dist culling mask uninitialized
Fixes: f75452918b ("ac/nir/ngg: support clipdist culling")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
2023-02-03 12:27:44 +00:00
Qiang Yu
7c41cdb81f ac/nir,radv,radeonsi: gs copy shader use ac_nir_export_(position|parameter)
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
2023-02-03 12:27:44 +00:00
Qiang Yu
7308637bb4 ac/nir,radv,radeonsi: legacy vs use ac_nir_export_(position|parameter)
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
2023-02-03 12:27:44 +00:00
Qiang Yu
df8c93a9f3 radeonsi: set nr_pos_exports outside of llvm translation
This can save an abi interface when we share position export
code with RADV.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
2023-02-03 12:27:43 +00:00
Qiang Yu
048d4de5e5 radeonsi: remove the extra handling for VS/TES primitive id
We have moved si_nir_assign_param_offsets before output lowering
pass, so there won't be primitive id store output when VS/TES here.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
2023-02-03 12:27:43 +00:00
Qiang Yu
59135678cf radeonsi: update outputs written nir info
We may remove some outputs when si_nir_kill_outputs and
ac_nir_optimize_outputs, so update the outputs written
info for output lower pass to skip manipulating these
outputs.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
2023-02-03 12:27:43 +00:00
Qiang Yu
dcccd94faf radeonsi: clamp vertex color in legacy gs instead of gs copy shader
gs copy shader is going to emit nir_export_amd directly so this vertex
color clamp pass which apply to nir_store_output will not work.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
2023-02-03 12:27:43 +00:00
Qiang Yu
601ad9e0a9 amd,radeonsi: implement nir_load_force_vrs_rates_amd in driver abi
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
2023-02-03 12:27:43 +00:00
Qiang Yu
58988c3239 ac/nir: add force_vrs to ac_nir_export_position
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
2023-02-03 12:27:43 +00:00
Qiang Yu
daa12b1ab1 ac/nir: add ac_nir_export_parameter
For last VGT stage to export parameter outputs.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
2023-02-03 12:27:43 +00:00
Qiang Yu
f823581dd4 ac/nir: add ac_nir_export_position
Used by last VGT stage to export position related outputs.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
2023-02-03 12:27:43 +00:00
Qiang Yu
e9268b2c06 ac/nir: gs and nogs use ac_nir_export_primitive
Mesh shader primitive export is left unchanged because it needs
extra changes for per primitive output export when export
primitive.

Mesh shader will use second channel of primitive export.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
2023-02-03 12:27:43 +00:00
Qiang Yu
8331842258 aco: implement nir_export_amd
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
2023-02-03 12:27:43 +00:00
Qiang Yu
5fe4dd3d68 ac/llvm: implement nir_export_amd
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
2023-02-03 12:27:43 +00:00
Qiang Yu
5f24d58549 nir: add nir_export_amd intrinsic
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
2023-02-03 12:27:43 +00:00
Timur Kristóf
9af3a31744 ac/nir/cull: Alway remove zero-area triangles in face culling.
The face culling algorithm should have been disabled for
conservative overestimation because it already
(mistakenly) removed some close-to-zero area triangles.

Now that the driver disables it in that case,
let's always remove zero-area triangles.
This only costs +2 SALU instructions.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20987>
2023-02-03 09:39:54 +00:00
Timur Kristóf
3508597aa1 radv: Disable NGG culling when conservative overestimation is used.
Even when small primitive culling is disabled, the face culling algorithm
in ac_nir_cull can delete tiny triangles when their area is almost zero.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20987>
2023-02-03 09:39:54 +00:00
Constantine Shablya
9b3b7e5091 anv: handle ATTACHMENT_OPTIMAL layout
Closes: #8216
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21066>
2023-02-03 09:17:03 +00:00
Yonggang Luo
b1a33789b8 util: Implement util_iround with lrintf unconditionally
Because the place that called util_iround are always ensured
that INT_MIN <= f <= INT_MAX

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19978>
2023-02-03 04:00:17 +00:00
Mike Blumenkrantz
e82369d06b zink: enable bindless texture with ZINK_DESCRIPTORS=db
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21085>
2023-02-03 02:12:33 +00:00
Mike Blumenkrantz
99ba529fee zink: implement descriptor buffer handling of bindless texture
pretty straightforward, just lazily allocating the context-based db
and then writing updates to it on-demand

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21085>
2023-02-03 02:12:33 +00:00
Mike Blumenkrantz
6b49dec675 zink: add a flag to indicate whether a descriptor buffer is bound
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21085>
2023-02-03 02:12:33 +00:00
Mike Blumenkrantz
f81a4e904c zink: break out descriptor binding into separate function
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21085>
2023-02-03 02:12:33 +00:00
Mike Blumenkrantz
362b8792e7 zink: set VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT on compute pipelines
same as gfx

Fixes: 7ab5c5d36d ("zink: use EXT_descriptor_buffer with ZINK_DESCRIPTORS=db")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21085>
2023-02-03 02:12:33 +00:00
Mike Blumenkrantz
e471b4360d zink: skip updating descriptor buffer sets that aren't active
this is a no-op and illegal

Fixes: 7ab5c5d36d ("zink: use EXT_descriptor_buffer with ZINK_DESCRIPTORS=db")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21085>
2023-02-03 02:12:33 +00:00
Mike Blumenkrantz
933f1dc50b zink: fix bindless struct member comments
this was a bit confusing having the overall substruct comment which
was occasionally wrong

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21085>
2023-02-03 02:12:33 +00:00
Mike Blumenkrantz
f382922f08 zink: make bindless buffer_infos a union
prep for descriptor buffer handling

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21085>
2023-02-03 02:12:33 +00:00
Mike Blumenkrantz
dc60d373c9 zink: enable PIPE_CAP_ALLOW_GLTHREAD_BUFFER_SUBDATA_OPT
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21073>
2023-02-03 01:52:56 +00:00
Marek Olšák
b8f6758bae amd/ci: update sanctuary trace sha1
I guess it's because RB+ blending is now more precise.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
3ba1b18c90 radeonsi: set sampler COMPAT_MODE in the corresponding branch
no functional change

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
60a3f0667f radeonsi: call ac_init_llvm_once before any util_queue initialization
The winsys uses util_queue, which calls atexit, so do it before the winsys
is created.

Cc: stable

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
da7dfbe3b8 amd/llvm: fix LLVM 15 & 16 crashes in SelectionDAG.cpp
Cc: stable

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
0c0b978938 radeonsi: set NEVER as the depth compare func if depth compare is disabled
Fixes: 0c6e56c391 - mesa: (more) correctly handle incomplete depth textures

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
35a18134a3 amd/registers: remove confusing definitions from gfx10-rsrc.json
this will never be used and shouldn't have been added

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
1d8d223f08 amd: document OOB behavior on gfx11
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
76472c850b amd: fix typo in shadowed uconfig registers on gfx11
It used an invalid offset, which hung.

Fixes: f24f8665db - ac: implement register shadowing for gfx11

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
35fa57dfae amd: sort and re-indent packet definitions
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
8d9e18974f amd: update late_alloc_wave64 for gfx11
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
76e3437c1e amd: update the cache size for gfx1103_r1
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
2cdb6be86c amd: change pbb_max_alloc_count for gfx11
based on PAL

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
bfc37e7c63 amd: unify and tune the attribute ring size for gfx11
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
e25f08baf2 radeonsi: never set INTERPOLATE_COMP_Z
based on PAL

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:02 +00:00
Marek Olšák
d087b3ec3c radeonsi: determine alpha_to_coverage robustly in si_update_framebuffer_blend_rasterizer
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
f2923168ba radeonsi: merge si_ps_key_update_framebuffer_blend & .._update_blend_rasterizer
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
a29218b557 radeonsi/gfx11: always set MSAA_NUM_SAMPLES=0 for DCC_DECOMPRESS
hw requirement

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
8532cb8e7e radeonsi: deduplicate VS/TES/GS update code
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
711c4bddb2 radeonsi/gfx11: use new packet EVENT_WRITE_ZPASS
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
4664b22f65 radeonsi/gfx11: move the PIXEL_PIPE_STAT_CONTROL event into the GFX preambles
Both the normal and shadowing preamable should do this.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
383269238d radeonsi/gfx11: fix blend->cb_target_mask dependency for shader keys
Shader keys only use cb_target_enabled_4bit. This may cause shaders to be
updated less often, but otherwise no change in behavior.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>š
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
d5ff270e0b radeonsi/gfx11: adjust ACCUM_* fields for tessellation
based on PAL

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
0b4b309fc6 radeonsi/gfx11: add a comment why we use PRIM_GRP_SIZE <= 252
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
d21850f753 radeonsi/gfx11: remove the INST_PREF_SIZE workaround
The hw does the right thing automatically. (i.e. enables or disables
the feature)

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
f6c30af00c radeonsi: implement RB+ depth-only rendering for better perf
The explanation is in the last change of this commit.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
2fc03e479b amd: improve RB+ blending precision
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
a9e9c4650d amd: update shadowed register tables for gfx11
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
b6f6465264 amd: update SX_BLEND_OPT_EPSILON.MRT0_EPSILON enum definitions
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
47f598a183 amd: fix tile_swizzle on gfx11 - should be shifted by 10 bits, not 8
This reverts the radv_adjust_tile_swizzle change to unify the code.

Fixes: 529eb739fc - radeonsi/gfx11: add CB deltas

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
84d59cdb59 amd: split GFX1103 into GFX1103_R1 and GFX1103_R2
Fixes: caa09f66ae - amd: add chip identification for gfx1100-1103

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
66d11391f7 radeonsi/gfx11: unset SAMPLE_MASK_TRACKER_WATERMARK to fix hangs
Same as PAL.

Fixes: 529eb739fc - radeonsi/gfx11: add CB deltas

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
8556b3db71 radeonsi: fix RB+ blending with sRGB formats
The epsilon for 8bpc is for the linear colorspace. There is no epsilon
for sRGB.

Fixes: 17021efc74 - radeonsi: adjust RB+ blend optimization settings

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
dacb111607 radeonsi/ci: add gfx1100 results
There are also a lot of flakes.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Marek Olšák
6445d2eca9 radeonsi/ci: update gfx10.3 results
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
2023-02-03 00:18:01 +00:00
Emma Anholt
fd28452631 turnip: Make the tiling-impossible case have an impossible tile layout.
This helped me catch inappropriate tiling work being done in this case.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21004>
2023-02-02 14:56:15 -08:00
Emma Anholt
3c3bd12af7 tu: Only emit the conditional gmem subpass resolves when gmem is possible.
No sense emitting this work when the subpass deps or attachment size
prevents gmem.  Noticed when I had uninit values in the tiling layout.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21004>
2023-02-02 14:56:15 -08:00
Emma Anholt
aae679e221 turnip: Optimize tile sizes to reduce the number of bins.
We were aiming for very square tiles, but it's actually better for us to
reduce the number of different bins so you take fewer trips through the
geometry and keep the caches hotter.  Example changes to aztec ruins on
angle:

    3x3 tiles of 352x352 to 4x2 tiles of 256x512
    4x5 tiles of 256x224 to 5x4 tiles of 224x256
    17x11 tiles of 160x128 to 14x11 tiles of 192x128
    12x7 tiles of 224x224 to 7x11 tiles of 384x128
    12x8 tiles of 224x192 to 7x11 tiles of 384x128
    11x6 tiles of 256x256 to 12x5 tiles of 224x288
    11x7 tiles of 256x224 to 7x9 tiles of 384x160
    8x4 tiles of 352x352 to 6x5 tiles of 448x288

and minecraft:

    3x3 tiles of 352x352 to 4x2 tiles of 256x512
    12x6 tiles of 256x256 to 3x23 tiles of 1024x64
    12x7 tiles of 256x224 to 8x9 tiles of 384x160

FPS changes:
VK aztec ruins normal: 1.12478% +/- 0.213393% (n=67)
ANGLE manhattan_31:    +1.42813% +/- 0.893332% (n=7).
ANGLE minecraft:       no change (n=21)
ANGLE google_maps:     +6.80618% +/- 2.40857% (n=4)
ANGLE trex_200:        no change (n=11)
ANGLE pubg:            no change (n=21)

Fixes: #8160
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21004>
2023-02-02 14:56:13 -08:00
Emma Anholt
e27f84c56e tu: Mark tiling impossible if we couldn't lay out gmem in the first place.
We were leaving the field undefined, which tripped me up later.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21004>
2023-02-02 14:55:59 -08:00
Sagar Ghuge
0ec3522163 nir: Handle other variants of image_samples properly while lowering
while lowering image_samples to one, we need to take
nir_intrinsic_image_deref_samples and
nir_intrinsic_bindless_image_samples intrinsic into account.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8211

Fixes: ab4c2990ed ("intel/compiler: use lower_image_samples_to_one")
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21053>
2023-02-02 21:40:45 +00:00
Juston Li
6f4b375c94 anv: check initial cmd_buffer is chainable
Submitting a batch with the first command buffer with the simultaneous
bit set followed by a command buffer without the bit set gets past the
check and triggers this assert attempting to chain them:
../src/intel/vulkan/anv_batch_chain.c:1147: anv_cmd_buffer_chain_command_buffers: Assertion `num_cmd_buffers == 1' failed.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21056>
2023-02-02 21:17:33 +00:00
Jesse Natalie
9c5df90ae5 wsi/win32: We don't need a window DC for DXGI
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21049>
2023-02-02 19:48:00 +00:00
Jesse Natalie
192e7e0cef wsi/win32: Don't require buffer blits for software drivers
Lavapipe can directly render to a linear CPU image and then BitBlit
straight from there.

Fixes: 2f462105 ("vulkan/wsi: Hook-up DXGI swapchains and DComp")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8085
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21049>
2023-02-02 19:48:00 +00:00
Erik Faye-Lund
c8994256a6 anv, hasvk: remove stale TODO-files
This file hasn't really been updated since 2016, apart from a single
search-replace two years ago.

That's an eternity in ANV-land, so let's just remove these.

While we're at it, also remove the duplicate in hasvk.

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21044>
2023-02-02 19:25:15 +00:00
Lucas Stach
175732bb51 etnaviv: fix double scanout import of multiplanar resources
etna_resource_from_handle() is called for each plane of a multiplanar
resource, so there is no point in looping over all planes to do the
renderonly scanout import. In fact that will cause us to lose track
of the scanout imports from later planes when the earlier planes are
redoing the import, overwriting the pointer to the allocated
renderonly_scanout struct.

Drop the loop and just do the import for the current plane.

Fixes: 826f95778a ("etnaviv: always try to create KMS side handles for imported resources")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20993>
2023-02-02 19:08:29 +00:00
Emma Anholt
8839baee57 ci: Drop the itoral-gl-terrain demo from traces.
There's an app bug in the CSM rendering that causes undefined results.

Fixes: #8212
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21055>
2023-02-02 18:42:45 +00:00
Georg Lehmann
3c25edfdb7 aco: Improve wave64 cycle estimates.
Reviewed-By: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20507>
2023-02-02 17:59:23 +01:00
Mike Blumenkrantz
5a40190f04 Revert "zink: fix zink_mem_type_idx_from_bits()"
This reverts commit f7796997964bb462bcbfa6b9faca5dcf04b64e1b.

I was doing too much F2F and not enough thinking with this one

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21076>
2023-02-02 16:27:38 +00:00
Rose Hudson
0d4e375a58 asahi: wire up shader disk cache support
Note: I (Alyssa) have squashed in some minor changes squashed in pre merge. The
rest is Rose's work :-)

Closes: #8091
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20835>
2023-02-02 16:12:33 +00:00
Samuel Pitoiset
3ad9a6e7c2 radv: simplify an assertion after considering RADV_FORCE_VRS
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21068>
2023-02-02 15:06:07 +00:00
Samuel Pitoiset
3eb97b9d33 radv: skip compilation when possible with GPL fast-linking
When all shader stages have already been imported it's possible to
skip radv_graphics_pipeline_compile() entirely. This makes GPL
fast-linking VERY fast.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21068>
2023-02-02 15:06:07 +00:00
Samuel Pitoiset
6b513a9c6a radv: determine the last VGT API stage earlier
It can be computed right after the active stages are known. While we
are at it, simplify the code.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21068>
2023-02-02 15:06:07 +00:00
Samuel Pitoiset
031bbdfbe6 radv: stop using the graphics pipeline key after compilation
Only the blend state was relying on the graphics pipeline key. This
will allow us to skip generating it when there is no compilation at
all (for fast-linking with GPL).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21068>
2023-02-02 15:06:07 +00:00
Samuel Pitoiset
aebe65e88a radv: return a boolean value in radv_pipeline_needs_dynamic_ps_epilog()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21068>
2023-02-02 15:06:07 +00:00
Samuel Pitoiset
6ddf1fd9ad radv: pass the lib flags for generating the pipeline key
No functional change.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21068>
2023-02-02 15:06:07 +00:00
Eric Engestrom
04fefec70f v3dv: mark dEQP-VK.api.command_buffers.record_many_draws_secondary_2 as flaky
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21070>
2023-02-02 14:44:05 +00:00
Samuel Pitoiset
863bc08136 radv: remove one unused variable in radv_graphics_lib_pipeline_init()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21042>
2023-02-02 14:01:12 +00:00
Samuel Pitoiset
c9e032be7f radv: allow to create a noop FS in a library with GPL
Otherwise, a noop FS will be always compiled during linking if not
provided by the application and that is too slow for fast-linking.

This should be improved to use a global noop FS but it's really tricky
because NIR linking doesn't do anything when the next stage is unknown,
and hence doesn't remove unused varyings.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21042>
2023-02-02 14:01:12 +00:00
Mike Blumenkrantz
68e914a4ca zink: rework descriptor buffer templating to use offsets
compute programs can be reused across contexts, which means storing any
pointers directly like this is going to lead to desync and crash

instead, make this like regular descriptor templates and calculate the offset
from the current context to ensure that everything works as it should

fixes #8201

Fixes: 7ab5c5d36d ("zink: use EXT_descriptor_buffer with ZINK_DESCRIPTORS=db")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21020>
2023-02-02 12:59:15 +00:00
Asahi Lina
ed6edc07e4 asahi: Split off macOS support into its own file
All the ifdef __APPLE__ is getting really silly. Let's split off the
macOS UAPI abstraction into its own file, so we can have parallel
implementations.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21058>
2023-02-02 11:45:52 +00:00
Asahi Lina
2e51ccac82 asahi: Split off common BO code into its own file
In preparation for splitting off the macOS backend implementation into
its own file, pull out the shared BO code from agx_device.c into
agx_bo.c.

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21058>
2023-02-02 11:45:52 +00:00
Alyssa Rosenzweig
ea285aea8d asahi: Use non-UAPI specific BO create flags
So we're not tied to the macOS or Linux UAPIs and are not translating awkwardly
from one to the other when creating BOs. They're not quite equivalent -- macOS
doesn't include writeback information in this flag field, and Linux doesn't have
a executable flag. (Maybe we should add one, though? Then we can enforce W^X.)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21058>
2023-02-02 11:45:52 +00:00
Martin Roukala (né Peres)
9e2365708b zink/ci: allow running manual jobs again on RADV
Fixes: f6c06ef2f6 ("ci: Add manual rules variations to disable.")
Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21036>
2023-02-02 12:18:33 +02:00
Martin Roukala (né Peres)
0c54f261ea ci/core-manual-rules: enclose the whole condition in quotes
Quoting a condition is apparently an effective way of working around
YAML parsing weirdness. However, the quotes need to surround the whole
expression, not just parts of it.

Fixes: f6c06ef2f6 ("ci: Add manual rules variations to disable.")
Suggested-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21036>
2023-02-02 12:18:33 +02:00
Alyssa Rosenzweig
5e14792200 agx: Centralize texture lowering
Lowering buffer textures will interact with multiple of our existing lowerings,
and it's convenient to have it all in one place. This also keeps the pass
ordering dependencies centralized.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21060>
2023-02-02 06:39:42 +00:00
Erico Nunes
7258f6bafd Revert "CI: Lima farm is offline"
This reverts commit 0733aafa22.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Acked-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21035>
2023-02-02 06:10:28 +00:00
Mike Blumenkrantz
d23b3a1394 zink: fix zink_mem_type_idx_from_bits()
at some point this used to work, but it no longer does what it's supposed
to do, which is return a memtype from a heap+flags

Fixes: d702a503ad ("zink: support multiple heaps per memory type")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21025>
2023-02-02 05:04:17 +00:00
Mike Blumenkrantz
ff5a761232 zink: only set VkPipelineColorBlendStateCreateInfo::attachmentCount without full ds3
this should be ignored by drivers/layers, but it isn't, and the crashing is immense

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21025>
2023-02-02 05:04:17 +00:00
Mike Blumenkrantz
fd0562693d lavapipe: try harder to reuse pipeline layouts during merge
the original code was quite conservative and always created a new layout,
but many times this is unnecessary, and the original layout can just be refcounted
since it doesn't need to be merged

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21051>
2023-02-02 04:49:42 +00:00
Mike Blumenkrantz
a1a859328b lavapipe: delete lvp_pipeline::mem_ctx
this is no longer used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21051>
2023-02-02 04:49:42 +00:00
Mike Blumenkrantz
59af3b4ad4 lavapipe: delete unused pipelines immediately
deferring these can cause memory ballooning and oom

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21051>
2023-02-02 04:49:42 +00:00
Mike Blumenkrantz
408606af02 lavapipe: create gfx gallium csos at pipeline bind
this should minimize pipeline creation time and make fast-linking "fast"

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21051>
2023-02-02 04:49:42 +00:00
Mike Blumenkrantz
6f0303ba76 lavapipe: break out (and slightly refactor) gallium shader cso creation
there's also now a(n unused) flag to indicate that the csos have been created

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21051>
2023-02-02 04:49:42 +00:00
Mike Blumenkrantz
4031098b85 lavapipe: refcount nir shaders instead of cloning
this is just about ownership, not modification, so refcounting saves time

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21051>
2023-02-02 04:49:42 +00:00
Mike Blumenkrantz
3770eaab73 lavapipe: add refcounting for shader nir
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21051>
2023-02-02 04:49:42 +00:00
Mike Blumenkrantz
453f49ce6d lavapipe: move noop fs creation to device
this avoids creating a separate noop fs for every pipeline

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21051>
2023-02-02 04:49:42 +00:00
Chia-I Wu
dc7f6c5324 freedreno: support UBWC scanout
On sway+xwayland, both explicit and implicit modifiers are advertised.
While dri3proto says nothing about it, zwp_linux_dmabuf_v1 says

  A compositor that sends valid modifiers and DRM_FORMAT_MOD_INVALID for
  a given format supports both explicit modifiers and implicit
  modifiers.

"glmark2 -b build:model=bunny --fullscreen" goes from 468 to 598fps on
a618 @ 2160x1440.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20892>
2023-02-02 04:33:25 +00:00
Chia-I Wu
1cf28bd049 freedreno: add has_implicit_modifier helper
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20892>
2023-02-02 04:33:25 +00:00
Timur Kristóf
1244506c15 nir/opt_algebraic: Add optimization for ieq/ine and right-shift.
Fossil DB stats on GFX11:
Totals from 1343 (1.00% of 134913) affected shaders:
SpillSGPRs: 7145 -> 7137 (-0.11%)
CodeSize: 20737744 -> 20739148 (+0.01%); split: -0.02%, +0.03%
Instrs: 4010443 -> 4008449 (-0.05%); split: -0.05%, +0.00%
Latency: 50021520 -> 50021105 (-0.00%); split: -0.00%, +0.00%
InvThroughput: 6354371 -> 6354112 (-0.00%); split: -0.00%, +0.00%
VClause: 63035 -> 63038 (+0.00%); split: -0.01%, +0.01%
SClause: 121162 -> 121166 (+0.00%)
Copies: 251354 -> 251058 (-0.12%); split: -0.18%, +0.06%
PreSGPRs: 137283 -> 137299 (+0.01%)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20936>
2023-02-02 03:08:19 +00:00
Kenneth Graunke
873dfb673b anv: Perform load_constant address math in 32-bit rather than 64-bit
We lower NIR's load_constant to load_global_constant, which uses A64
bindless messages.  As such, we do the following math to produce the
address for each load:

   base_lo@32 <- BRW_SHADER_RELOC_CONST_DATA_ADDR_LOW
   base_hi@32 <- BRW_SHADER_RELOC_CONST_DATA_ADDR_HIGH
   base@64 <- pack_64_2x32_split(base_lo, base_hi)
   addr@64 <- iadd(base@64, u2u64(offset@32))

On platforms that emulate 64-bit math, we have to emit additional code
for the 64-bit iadd to handle the possibility of a carry happening and
affecting the top bits.

However, NIR constant data is always uploaded adjacent to the shader
assembly, in the same buffer.  These buffers are required to live in a
4GB region of memory starting at Instruction State Base Address.  We
always place the base address at a 4GB address.  So the constant data
always lives in a buffer entirely contained within a 4GB region, which
means any offsets from the start of the buffer cannot possibly affect
the high bits.

So instead, we can simply do a 32-bit addition between the low bits of
the base and the offset, then pack that with the unchanged high bits.

On anv, INSTRUCTION_STATE_POOL_MIN_ADDRESS is 8GB, so the high bits are
always 0x2.  We don't even need to patch that portion of the address and
can just use an immediate value.  We do still need to pack, however.

fossil-db on Icelake indicates the following for affected shaders:

   Instrs: 10830023 -> 10750080 (-0.74%)
   Cycles: 1048521282 -> 1046770379 (-0.17%); split: -0.33%, +0.16%
   Subgroup size: 103104 -> 103112 (+0.01%)
   Send messages: 570886 -> 570760 (-0.02%)
   Loop count: 14428 -> 14429 (+0.01%)
   Spill count: 14246 -> 14244 (-0.01%); split: -0.06%, +0.04%
   Fill count: 22802 -> 22794 (-0.04%); split: -0.04%, +0.01%
   Scratch Memory Size: 654336 -> 662528 (+1.25%)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20999>
2023-02-02 02:45:04 +00:00
Kenneth Graunke
a0e7e7ff41 iris: Perform load_constant address math in 32-bit rather than 64-bit
We lower NIR's load_constant to load_global_constant, which uses A64
bindless messages.  As such, we do the following math to produce the
address for each load:

   base_lo@32 <- BRW_SHADER_RELOC_CONST_DATA_ADDR_LOW
   base_hi@32 <- BRW_SHADER_RELOC_CONST_DATA_ADDR_HIGH
   base@64 <- pack_64_2x32_split(base_lo, base_hi)
   addr@64 <- iadd(base@64, u2u64(offset@32))

On platforms that emulate 64-bit math, we have to emit additional code
for the 64-bit iadd to handle the possibility of a carry happening and
affecting the top bits.

However, NIR constant data is always uploaded adjacent to the shader
assembly, in the same buffer.  These buffers are required to live in a
4GB region of memory starting at Instruction State Base Address.  We
always place the base address at a 4GB address.  So the constant data
always lives in a buffer entirely contained within a 4GB region, which
means any offsets from the start of the buffer cannot possibly affect
the high bits.

So instead, we can simply do a 32-bit addition between the low bits of
the base and the offset, then pack that with the unchanged high bits.

On iris, IRIS_MEMZONE_SHADER is at [0, 4GB) so the high bits are always
zero.  We don't even need to patch that portion of the address and can
simply use u2u64 to promote the 32-bit add result to a 64-bit value
where the top bits are 0.

shader-db on Icelake indicates that this:
- Helps instructions: -1.13% in 135 affected programs
- Helps spills/fills: -4.08% / -4.18% in 4 affected programs
- Gains us 1 SIMD16 compute shader instead of SIMD8

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20999>
2023-02-02 02:45:04 +00:00
Timur Kristóf
95d06343c6 radv: Don't place CS in VRAM when bandwidth is too low.
People who use RADV on eGPU have reported poor performance by default.
They also noted that the "nosam" option helps.

This commit disables placing CS objects in VRAM when the bandwidth is
below that of PCIe 3.0 x8. Note that eGPUs are typically PCIe 3.0 x4.

Contributes-to: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7340
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20842>
2023-02-02 02:13:10 +00:00
Timur Kristóf
ef668f3714 ac/gpu_info: Add has_pcie_bandwidth_info.
This is so that we can tell whether the current kernel
has the PCIe bandwidth info available or not.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20842>
2023-02-02 02:13:10 +00:00
Jesse Natalie
d7730fcf22 vulkan/wsi/win32: Support tearing (immediate) and VSync (FIFO) present modes
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20945>
2023-02-02 01:30:28 +00:00
Jesse Natalie
747604b17c vulkan/wsi: Add a wsi_device param to get_present_modes
The Win32 WSI will want to query capabilities of the device to
determine what's available.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20945>
2023-02-02 01:30:28 +00:00
Sagar Ghuge
0c083d29a5 intel/fs: Always stall between the fences on Gen11+
Be conservative in Gfx11+ and always stall in a fence.  Since there are
two different fences, and shader might want to synchronize between them.

This change also brings back the original code block for the stall
between the fence and comment from the commit
b390ff3517.

v2: (Caio)
 - Re-arrange code block.
 - Adjust comment.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6958

Fixes: f7262462 ("intel/fs: Rework fence handling in brw_fs_nir.cpp")
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Tested-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20996>
2023-02-02 00:21:21 +00:00
Emma Anholt
51ea81c0a1 ci: Fix perf job condition.
We were supposed to be checking that the job had "performance" in the
name, not that the user (which we already checked is marge) has
"performance" in their name.

Fixes: f6c06ef2f6 ("ci: Add manual rules variations to disable irrelevant driver jobs.")
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21002>
2023-02-01 23:53:26 +00:00
Emma Anholt
5d1c693893 ci: Fix perf jobs blocking Marge pipelines.
They got accidentally disabled entirely, so they didn't block merge, but
once they re-enable then they'll block us again.  The problem was that I
moved allow_failure to a .performance-rules section, but we only ever
inherit the rules from that location, not the rest of yml.

This is basically a revert of 67547a04b6 ("ci: Move the performance
jobs' allow_failure:true to the gl rules."), though I still keep the
allow_failure in a more common location with comments, since perf jobs are
a huge trap.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21002>
2023-02-01 23:53:26 +00:00
Samuel Pitoiset
aa68b98b87 radv: remove radv_pipeline_stage::spirv::sha1
This is no longer used.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21048>
2023-02-01 23:25:52 +00:00
Samuel Pitoiset
853f8eb930 radv: remove redundant zero initialization of pipeline layout
It's already zeroed in radv_pipeline_layout_init().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21048>
2023-02-01 23:25:52 +00:00
Samuel Pitoiset
1f67782eb2 radv: optimize radv_pipeline_layout_add_set() slightly
That value is already computed when a descriptor set layout is created.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21048>
2023-02-01 23:25:52 +00:00
Yiwei Zhang
a73a5915fb venus: log upon device creation
Log the deviceName and driverInfo gated behind VN_DEBUG=log_ctx_info

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21030>
2023-02-01 22:04:41 +00:00
Pavel Ondračka
7e6acfd587 nir: mark progress when removing trailing unused load_const channels
When the unused channels were at the end and so no reswizzling was
needed, we wouldn't correctly mark the progress.

Fixes: 3305c960
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21014>
2023-02-01 20:33:31 +00:00
Pavel Ondračka
fe56dd9c42 nir: mark progress when removing trailing unused alu channels
When the unused channels were at the end and so no reswizzling was
needed, we wouldn't correctly mark the progress.

Fixes: cb7f2012
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21014>
2023-02-01 20:33:31 +00:00
Pavel Ondračka
ef800da3f7 nir: nir opt_shrink_vectors whitespace fix
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21014>
2023-02-01 20:33:31 +00:00
Amber
ab4c2990ed intel/compiler: use lower_image_samples_to_one
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewer-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20813>
2023-02-01 19:52:49 +00:00
Amber
e8bfb71660 ir3: use lower_image_samples_to_one
This is necessary to properly support ARB_shader_texture_image_samples
fixes crash in KHR-GL45.shader_texture_image_samples_tests.image_functional_test

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Reviewer-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20813>
2023-02-01 19:52:49 +00:00
Amber
c384690ab7 nir: support lowering nir_intrinsic_image_samples to a constant load
This can be used by multiple drivers that do not support ms images

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Reviewer-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20813>
2023-02-01 19:52:49 +00:00
Konstantin Seurer
a568a5492f radv: Fix creating accel structs with unbound buffers
If the buffer hasn't been bound to memory yet, we will dereference a
NULL pointer in radv_CreateAccelerationStructureKHR.

cc: mesa-stable

Closes: #8199
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21019>
2023-02-01 19:31:43 +00:00
Sil Vilerino
37652da616 d3d12: Honor suggested driver profile/level for H264/HEVC encode
Fixes some H264 <-> HEVC transcode cases where the wrong level/profile was assigned to the output bitstream

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21043>
2023-02-01 19:17:21 +00:00
Rhys Perry
bfd4ac4581 aco: limit VALUPartialForwardingHazard search
Complicated CFG and lots of SALU can cause this to take an extremely long
time to finish.

Fixes
dEQP-VK.graphicsfuzz.cov-value-tracking-selection-dag-negation-clamp-loop
and Monster Hunter Rise demo compile times.

fossil-db (gfx1100):
Totals from 57 (0.04% of 134574) affected shaders:
Instrs: 170919 -> 171165 (+0.14%)
CodeSize: 860144 -> 861128 (+0.11%)
Latency: 961466 -> 961505 (+0.00%)
InvThroughput: 127598 -> 127608 (+0.01%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8153
Fixes: 5806f0246f ("aco/gfx11: workaround VALUPartialForwardingHazard")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20941>
2023-02-01 18:52:40 +00:00
José Roberto de Souza
8092bc2158 intel/ds: Fix crash when allocating more intel_ds_queues than u_vector was initialized
u_vector_add() don't keep the returned pointers valid.
After the initial size allocated in u_vector_init() is reached it will
allocate a bigger buffer and copy data from older buffer to the new
one and free the old buffer, making all the previous pointers returned
by u_vector_add() invalid and crashing the application when trying to
access it.

This is reproduced when running
dEQP-VK.synchronization.signal_order.timeline_semaphore.* in DG2 SKUs
that has 4 CCS engines, INTEL_COMPUTE_CLASS=1 is set and of course
perfetto build is enabled.

To fix this issue here I'm moving the storage/allocation of
struct intel_ds_queue to struct anv_queue/iris_batch and using
struct list_head to maintain a chain of intel_ds_queue of the
intel_ds_device.
This allows us to append or remove queues dynamically in future if
necessary.

Fixes: e760c5b37b ("anv: add perfetto source")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20977>
2023-02-01 18:31:29 +00:00
Faith Ekstrand
1b3c746eec hasvk: Let spirv_to_nir() set UBO/SSBO base cast alignments
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21027>
2023-02-01 17:54:40 +00:00
Faith Ekstrand
85d44b0f97 anv: Let spirv_to_nir() set UBO/SSBO base cast alignments
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21027>
2023-02-01 17:54:40 +00:00
Faith Ekstrand
f78e4cec32 vtn: Set alignment on initial UBO/SSBO casts
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21027>
2023-02-01 17:54:40 +00:00
Rob Clark
e29001d0e7 freedreno/a6xx: Remove excess CS flushing
Also requires fixing where we emit barriers, and flushing pending
barriers at the end of the batch.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Rob Clark
9b22bdc956 freedreno/a6xx: Also FLUSH_CACHE on image barrier
For the same reason we need to on an UPDATE_BUFFER barrier.  Fixes
KHR-GLES31.core.compute_shader.pipeline-post-fs once the hard-coded
cache-flush is removed from launch_grid path.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Rob Clark
23e65c6084 freedreno/a6xx: Make shader state independent of grid info
Eventually we want to move this into a state group, so we can pre-bake
the cmdstream and re-emit it via CP_SET_DRAW_STATE when it is dirty.
But in order to do that it needs to not depend on grid info.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Rob Clark
1faf7133d4 freedreno: Don't open-code setting dirty CS state
There is actually no issue with setting FD_DIRTY_PROG, since all state
is marked dirty when we switch from compute to 3d.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Rob Clark
5a37cd8569 freedreno/a6xx: Don't double-write SP_CS_OBJ_START
Also SP_CS_INSTRLEN.  This is already done in fd6_emit_shader().

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Rob Clark
a063caa46a freedreno: Skip flush_resource with explicit sync
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Rob Clark
2503e22717 freedreno: nondraw-batch
Allow multiple compute grids to be combined into a single non-draw
batch.  This will allow us to optimize state emit and remove excess
flushing between compute jobs.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Rob Clark
0e3f2646dd freedreno/a6xx: Add CS instrlen workaround
Based on !19023.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Rob Clark
bfd7d9e22e freedreno/a6xx: Add missing CS_BINDLESS mapping
Fixes: e51975142c ("freedreno/a6xx: Add bindless state"
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Rob Clark
13fe9c3e63 freedreno/ir3: Scalarize load_ssbo
The benefits of turning it into isam (which needs to be scalar as the
SSBO is sampled as a single component R32 texture) outweigh the benefits
of vectorizing.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Rob Clark
951d963565 freedreno/a6xx: LRZ for MSAA
We don't need to fall off the LRZ path when we fall back to clearing
depth with a u_blitter draw, since u_blitter uses zsa state to achieve
the depth/stencil clear and this is entirely compabile with LRZ.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Rob Clark
5eb85ef756 freedreno/decode: Increase size of offsets table
The offsets table stores offsets of a buffer (such as cmdstream) that
we've already dumped.  The suballoc pool results in more suballocated
cmdstream allocated from a single backing buffer, meaning that we need
to increase the size of this table.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
2023-02-01 17:28:41 +00:00
Georg Lehmann
2b264455b5 aco: use s_pack_ll_b32_b16 for constant copies
Totals from 2 (0.00% of 134913) affected shaders:
CodeSize: 28636 -> 28628 (-0.03%)

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20970>
2023-02-01 17:07:25 +00:00
Georg Lehmann
9ee9b0859b aco: use s_bfm_64 for constant copies
Foz-DB Navi21:
Totals from 1025 (0.76% of 134913) affected shaders:
CodeSize: 1436752 -> 1432412 (-0.30%)

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20970>
2023-02-01 17:07:25 +00:00
Rhys Perry
bbc5247bf7 aco/spill: always end spill vgpr after control flow
To fix a hypothetical issue:

v0 = start_linear_vgpr
if (...) {

} else {
   use_linear_vgpr(v0)
}
v0 = phi

We need a p_end_linear_vgpr to ensure that the phi does not use the same
VGPR as the linear VGPR.

This is also much simpler.

fossil-db (gfx1100):
Totals from 1195 (0.89% of 134574) affected shaders:
Instrs: 4123856 -> 4123826 (-0.00%); split: -0.00%, +0.00%
CodeSize: 21461256 -> 21461100 (-0.00%); split: -0.00%, +0.00%
Latency: 62816001 -> 62812999 (-0.00%); split: -0.00%, +0.00%
InvThroughput: 9339049 -> 9338564 (-0.01%); split: -0.01%, +0.00%
Copies: 304028 -> 304005 (-0.01%); split: -0.02%, +0.01%
PreVGPRs: 115761 -> 115762 (+0.00%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20621>
2023-02-01 15:45:22 +00:00
Rhys Perry
850d945baf aco/tests: add setup_reduce_temp.divergent_if_phi
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20621>
2023-02-01 15:45:22 +00:00
Rhys Perry
44fdd2ebcb aco: end reduce tmp after control flow, when used within control flow
In the case of:

v0 = start_linear_vgpr
if (...) {

} else {
   use_linear_vgpr(v0)
}
v0 = phi

We need a p_end_linear_vgpr to ensure that the phi does not use the same
VGPR as the linear VGPR.

fossil-db (gfx1100):
Totals from 3763 (2.80% of 134574) affected shaders:
MaxWaves: 90296 -> 90164 (-0.15%)
Instrs: 6857726 -> 6856608 (-0.02%); split: -0.03%, +0.01%
CodeSize: 35382188 -> 35377688 (-0.01%); split: -0.02%, +0.01%
VGPRs: 234864 -> 235692 (+0.35%); split: -0.01%, +0.36%
Latency: 47471923 -> 47474965 (+0.01%); split: -0.03%, +0.04%
InvThroughput: 5640320 -> 5639736 (-0.01%); split: -0.04%, +0.03%
VClause: 93098 -> 93107 (+0.01%); split: -0.01%, +0.02%
SClause: 214137 -> 214130 (-0.00%); split: -0.00%, +0.00%
Copies: 369895 -> 369305 (-0.16%); split: -0.31%, +0.15%
Branches: 164996 -> 164504 (-0.30%); split: -0.30%, +0.00%
PreVGPRs: 210655 -> 211438 (+0.37%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20621>
2023-02-01 15:45:22 +00:00
Marek Olšák
e2d63c9a62 ac/gpu_info: add PCIe info
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20790>
2023-02-01 14:58:57 +00:00
Marek Olšák
e267b86d80 amd: update amdgpu_drm.h
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20790>
2023-02-01 14:58:57 +00:00
Samuel Pitoiset
cd6712e3a8 radv: pass pCreateInfo to radv_graphics_pipeline_compile()
This removes some duplicated code.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20990>
2023-02-01 14:20:47 +00:00
Samuel Pitoiset
6f17ce08fc radv: pass radv_compute_pipeline to radv_compute_pipeline_compile()
Similar to graphics.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20990>
2023-02-01 14:20:47 +00:00
Samuel Pitoiset
b4deb3aa32 radv: move retained shaders info to radv_graphics_pipeline
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20990>
2023-02-01 14:20:47 +00:00
Samuel Pitoiset
b982f8bbe4 radv: pass radv_graphics_pipeline to radv_graphics_pipeline_compile()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20990>
2023-02-01 14:20:47 +00:00
Samuel Pitoiset
d1b36b01a2 radv: add helpers for capturing shaders and statistics
Instead of duplicating the logic everywhere.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20990>
2023-02-01 14:20:47 +00:00
Samuel Pitoiset
e1bc8b0b21 radv: simplify pipeline_has_ngg during graphics shaders compilation
The is_ngg field is copied during shader info linking for GS, so
after radv_shader_fill_info() is performed, it's possible to use it.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20990>
2023-02-01 14:20:47 +00:00
Samuel Pitoiset
08e496c29d radv: remove useless check about CS in radv_lower_io()
This function is now called only for graphics pipeline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20990>
2023-02-01 14:20:47 +00:00
Lionel Landwerlin
6eb75dc74c anv: expose EXT_load_store_op_none
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21018>
2023-02-01 12:53:29 +00:00
Val Packett
9b0c688f51 mailmap: Remap name and email for Val Packett
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21032>
2023-02-01 11:30:12 +00:00
Tapani Pälli
6bdc29e2e6 intel: enable existing workaround for ICL platform
Patch changes comment to refer to the lineage 14014097488, this
workaround applies for ICL as well.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20952>
2023-02-01 11:09:19 +00:00
Konstantin Seurer
7e072cfba2 radv: Improve the BVH size estimation
The previous estimation was from before we had proper LBVH and PLOC.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20988>
2023-02-01 10:34:36 +00:00
Mike Blumenkrantz
03c2bdda60 zink: use VK_EXT_multisampled_render_to_single_sampled for EXT_multisample_render_to_texture
this extension was added for the purpose of emulating the GL ext,
and using it is reasonably straightforward

the only (somewhat) invasive part is modifying the renderpass/dynamic hashes
to have samplecounts in the key, but this is also not too much work

now only fbfetch requires real renderpasses, and everything else is dynamic

fixes #7559

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20883>
2023-02-01 10:08:57 +00:00
Mike Blumenkrantz
7888460257 zink: shrink zink_render_pass_state::msaa_expand_mask
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20883>
2023-02-01 10:08:57 +00:00
Mike Blumenkrantz
dc0a251e4e zink: hook up VK_EXT_multisampled_render_to_single_sampled
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20883>
2023-02-01 10:08:57 +00:00
Eric Engestrom
6291d4d339 meson: turn android-libbacktrace into a feature option
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20915>
2023-02-01 06:33:52 +00:00
Rob Clark
10992256dd freedreno/gmem: Fix for partial z/s fast-clear
If we have a combined depth+stencil buffer, but fast-clear just one of
the two channels, we need to mark the other as needing restore.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20998>
2023-02-01 05:19:38 +00:00
Illia Polishchuk
6962bf4e57 nir: Add sha1 hash for nir shaders converted from spir-v
The sha1 hash inside nir structure
makes it easier to find bad shader in games.

For example INTEL_DEBUG=fs will show not zero
source_sha1 field for shaders with vulkan applications

Signed-off-by: Illia Polishchuk <illia.a.polishchuk@globallogic.com>

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21012>
2023-02-01 04:19:04 +00:00
Nicolas Dufresne
dc2119bf3f util/format: Fix wrong colors when importing YUYV and UYVY
This changes the swizzling so that importation of YUYV dmabuf without
dedicated blitter HW can work.

v2: fix the other format too, update test results

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20815>
2023-02-01 03:24:23 +00:00
Dmitry Osipenko
4fe2247be5 util/disk_cache: Switch to multipart mesa-db cache
Replace single file mesa-db cache with multipart mesa-db cache.
Each part of the multipart cache essentially is a single file
mesa-db cache, aka database shard. Multipart cache brings much
more optimized cache eviction times in comparison to a single file
cache.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20256>
2023-02-01 02:47:30 +00:00
Dmitry Osipenko
fd9f7b748e util/mesa-db: Introduce multipart mesa-db cache
Whenever a single file mesa-db cache hits max size limit, a half of cache
is evicted and the cache file is defragmented. The downside of this eviction
strategy is that it causes high disk IO usage during eviction if mesa-db
cache file size is large.

In order to mitigate this downside, we will split mesa-db into multiple
part such that only one part will be evicted at a time. Each part will be
an individual single file mesa-db cache, like a DB shard. The new multipart
mesa-db cache will merge the parts into a single virtual cache.

This patch introduces two new environment variables:

1. MESA_DISK_CACHE_DATABASE_NUM_PARTS:
Controls number of mesa-db cache file parts. By default 50 parts will be
created. The old pre-multipart mesa-db cache files will be auto-removed
if they exist, i.e. Mesa will switch to the new DB version automatically.

2. MESA_DISK_CACHE_DATABASE_EVICTION_SCORE_2X_PERIOD:
Controls the eviction score doubling time period. The evicted DB part
selection is based on cache entries size weighted by 'last_access_time' of
the entries. By default the cache eviction score is doubled for each month
of cache entry age, i.e. for two equally sized entries where one entry is
older by one month than the other, the older entry will have x2 eviction
score than the other entry. Database part with a highest total eviction
score is selected for eviction.

This patch brings x40 performance improvement of cache eviction time using
multipart cache vs a single file cache due to a smaller eviction portions
and more optimized eviction algorithm.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20256>
2023-02-01 02:47:30 +00:00
Dmitry Osipenko
4964b98967 util/cache_test: Remove dummy cache entry added by cache_exists()
The cache_exists() function adds a dummy cache entry that may affect cache
eviction testing results. Remove this entry.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20256>
2023-02-01 02:47:30 +00:00
Dmitry Osipenko
c92c99481f util/mesa-db: Support removal of cache entries
Add support for removal of cache entries to mesa-db cache. This allows
to have a more predictable unit tests by removing dummy entries that
are added to cache when test-cache is created by unit-testing framework.

Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20256>
2023-02-01 02:47:30 +00:00
Dmitry Osipenko
f68db0da4c util/mesa-db: Don't account header size
In order to ease writing mesa-db eviction unit tests, stop accounting
mesa-db cache file header size during checking whether cache file reached
the size limit. This change ensures that older unit tests will keep working
whenever cache header version/size will change.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20256>
2023-02-01 02:47:30 +00:00
Dmitry Osipenko
51869405bc util/cache_test: Unset env vars left after Cache.List test
The environment variables are persistent and must be explicitly unset by
each cache test, otherwise next test will fail. Add the missing unsets to
the Cache.List test.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20256>
2023-02-01 02:47:30 +00:00
Lina Versace
a429d06878 mailmap: Lina is Chad's new name
If you can longer find chadversary or chadv on the interwebs, then
search for linyaa or versalinyaa.

Egg-crAcked-By: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Egg-Cracked-By: Faith Ekstrand <faith@gfxstrand.net>
Egg-Cracked-By: Lyude Paul <lyude@redhat.com>
Egg-Cracked-By: Wann
Egg-Cracked-By: Zach Lesher
Egg-Cracked-By: 初音ミク
Acked-by: Daniel Stone <daniels@collabora.com>
2023-01-31 18:12:42 -08:00
Lionel Landwerlin
13de23ea07 intel: add missing PS restriction on BDW+
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20949>
2023-02-01 00:28:53 +00:00
Lionel Landwerlin
75159304b0 docs: list anv in EXT_extended_dynamic_state3 support
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21017>
2023-01-31 22:34:07 +00:00
Ryan Neph
65adf0c0af util/xmlconfig: add MESA_DRICONF_EXECUTABLE_OVERRIDE
Allow the loading process to affect driconf option matching without
changing the behavior throughout mesa common code or leaking the name of
the loading process to logs, artifact storage, or in sub-thread naming,
as can be the case with the broader MESA_PROCESS_NAME override.

This new MESA_DRICONF_EXECUTABLE_OVERRIDE takes higher precedence over
MESA_PROCESS_NAME in the case where both are set.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20779>
2023-01-31 22:02:58 +00:00
Ryan Neph
887ca5e1b2 util/u_process: remove util_get_process_name_may_override()
Also deprecate GALLIUM_PROCESSS_NAME in favor of MESA_PROCESS_NAME,
while maintaining existing functionality for use cases relying on
GALLIUM_PROCESSS_NAME.

GALLIUM_PROCESSS_NAME takes higher precedence over MESA_PROCESS_NAME in
the case where both are set.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20779>
2023-01-31 22:02:58 +00:00
Ryan Neph
c8fe878717 util/u_process: add MESA_PROCESS_NAME override to util_get_process_name()
Allow processes to set a custom process name before loading drivers.

Especially useful for virtualized workloads hidden behind a
generically-named host renderer process (e.g. Venus render_server) to
retain game-specific driconf option matching.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20779>
2023-01-31 22:02:58 +00:00
Ryan Neph
a2b296c75b ci: fix directory existence racing in parallel test execution
meson tests sharing a binary (and deviating in their env/args) will
produce temporary logs to the same directory, which is assumed to exist
only for the duration of a single test. This is problematic when running
tests in parallel, as one test may remove the directory before the
other(s) finish, causing a test flake.

This appends the each test's pid to the output directory to enforce
uniqueness and avoid the race.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20779>
2023-01-31 22:02:58 +00:00
Samuel Pitoiset
064141266f radv: skip shaders cache for fast-linked pipelines with GPL
Shader binaries that are imported during linking should already be in
the cache (not yet implemented though) and computing the per pipeline
cache hash is really expensive.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21009>
2023-01-31 20:27:50 +00:00
Thong Thai
2fe3ac2f88 radeonsi/vcn: use encoder/decoder caps reported by kernel
Rely on the kernel for video encoder/decode capabilities where possible,
since there might be special cases for some devices. Otherwise, fallback
to the older logic for older kernels.

v2: Made the macro lines shorter and added a comment to explain (David)
v3: Undo deleting some logic (Ruijing)

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20969>
2023-01-31 18:56:18 +00:00
Marcin Ślusarz
af9e2b8bf1 intel/compiler/mesh: remove dead code path supporting >4 dword writes
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20858>
2023-01-31 18:28:21 +00:00
Marcin Ślusarz
be82ed28f0 intel/compiler/mesh: support longer write messages
Allowing longer writes reduces the number of send messages needed
to support unaligned 4-component writes.

Note: nothing currently generates 8-component writes, so this change
makes "second_mask" code path in emit_urb_direct_writes and
emit_urb_indirect_writes_mod dead.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20858>
2023-01-31 18:28:21 +00:00
Alyssa Rosenzweig
0f087b56d0 agx: Bump preamble_storage_size to 512
nir_opt_preamble is now aware of the internal uniforms we insert, so it can use
the whole uniform file available to it. This lets us push more (all?) uniform
loads in Dolphin ubershaders to the preamble.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20562>
2023-01-31 17:02:34 +00:00
Alyssa Rosenzweig
02fe57b7e9 agx: Lower system values in NIR in the driver
To comply with The Ekstrand Rule.

AGX has a large number of "uniform registers" available. These may be loaded
with arbitrary ranges of GPU memory by the driver, or they can be written by the
preamble shader. Currently, the compiler runs nir_opt_preamble on the first half
of the uniform file, and then translates NIR sysvals to moves from the second
half of the uniform file, passing back a uniform->sysval map for the GL driver
to respect. This has (at least) two issues:

* Since nir_opt_preamble runs before gathering sysvals, it has to assume the
  maximum number of sysvals are pushed, which can prevent it from moving some
  computation to the preamble due to running out of partitioned uniform registers.
  This is a problem for Dolphin's ubershaders, though it's unclear how much it
  matters for Dolphin perf.

* This violates The Ekstrand Rule and apparently will be a problem for our
  Vulkan driver. I'm just a compiler+GL girl, so I wouldn't know.

To fix this, we invert the order of operations. At the end of this series, we
instead lower NIR system values to NIR load_preamble instructions in the GL
driver. The compiler just translates directly to uniform registers reads. The
Vulkan driver will need its own version of this code, but maybe it can do
something clever and descriptor set aware.

This means that there will already be some load_preamble instructions when
nir_opt_preamble runs, so I've made minor changes to nir_opt_preamble to handle
that gracefully. This is a bit lazy... The alternative is to introduce a
`load_uniform_agx` intrinsic which `load_preamble` gets lowered to trivially.
But that's another pass over the IR (and due to AGX's shader variant hell I'm
sensitive to backend compile time) and it would be more complicated than what's
implemented here.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Ella Stanforth <ella@iglunix.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20562>
2023-01-31 17:02:34 +00:00
Alyssa Rosenzweig
b0b5a71c74 nir/opt_preamble: Consider load_preamble as movable
It's kosher to get load_preamble intrinsics ahead of time if the driver is
pushing sysvals. Handle them like load_uniform.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by-(with-sparkles): Asahi Lina <lina@asahilina.net>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20562>
2023-01-31 17:02:34 +00:00
Alyssa Rosenzweig
05d3238692 nir/opt_preamble: Treat *size as an input
Some backends may wish to reserve early uniforms for internal system values, and
use the remaining space for preamble storage. In this case, it's convenient to
teach nir_opt_preamble about a reserved offset. It's logical to treat the output
*size instead of an in/out variable that nir_opt_preamble adds to. This requires
a slight change to the consumers to zero the input.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by-(with-sparkles): Asahi Lina <lina@asahilina.net>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20562>
2023-01-31 17:02:34 +00:00
Mike Blumenkrantz
d745e3b0ab zink: always unref old images when adding new binds
at some point this was correct, but refactoring has since occurred,
and this ends up leaking storage image objects

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20867>
2023-01-31 16:31:46 +00:00
Mike Blumenkrantz
dd733034aa zink: stop leaking push descriptor templates
templates[ZINK_DESCRIPTOR_TYPE_UNIFORMS] needs to be deleted, which
requires a larger iterator

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20867>
2023-01-31 16:31:46 +00:00
Mike Blumenkrantz
01d2e7afce zink: don't add dmabuf export type if dmabuf isn't supported
avoid trying to create dmabuf-exportable resources too

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20791>
2023-01-31 15:57:13 +00:00
Samuel Pitoiset
e07232acbb radv: fix GPL fast-linking with libs that have retained NIR shaders
Zink creates all libaries with CREATE_RETAIN_LINK_TIME_OPTIMIZATION,
then it first creates unoptimized pipelines and it enqueues optimized
pipelines in the background with CREATE_LINK_TIME_OPTIMIZATION.

If a pipeline is linked without CREATE_LINK_TIME_OPTIMIZATION, the
driver should import binaries instead of retained NIR shaders. This
was broken because RADV wasn't compiling binaries at all in presence
of CREATE_RETAIN_LINK_TIME_OPTIMIZATIONS. Now, it always compiles
binaries in libraries but can also retain NIR if requested.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8150
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21008>
2023-01-31 15:24:50 +00:00
Marcin Ślusarz
3131c2fc7a intel/compiler/mesh: optimize indirect writes
Our hardware requires that we write to URB using full vec4s at aligned
addresses. It gives us an ability to mask-off dwords within vec4 we don't
want to write, but we have to know their positions at compile time.

Let's assume that:
- V represents one dword we want to write
- ? is an unitinitialized value
- "|" is a vec4 boundary.

When we want to write 2-dword value at offset 0 we generate 1 write message:
| V1 V2 ? ? |
with mask:
| 1  1  0 0 |

When we want to write 4-dword value at offset 2 we generate 2 write messages:
| ? ? V1 V2 | V3 V4 ? ? |
with mask:
| 0 0 1  1  | 1  1  0 0 |

However if we don't know the offset within vec4 at *compile time* we
currently generate 4 write messages:
| V1 V1 V1 V1 |
| 0  0  1  0  |

| V2 V2 V2 V2 |
| 0  0  0  1  |

| V3 V3 V3 V3 |
| 1  0  0  0  |

| V4 V4 V4 V4 |
| 0  1  0  0  |

where masks are determined at *run time*.

This is quite wasteful and slow.

However, if we could determine the offset modulo 4 statically at compile time,
we could generate only 1 or 2 write messages (1 if modulo is 0) instead of 4.

This is what this patch does: it analyzes the addressing expression for
modulo 4 value and if it can determine it at compile time, we generate
1 or 2 writes, and if it can't we fallback to the old 4 writes method.

In mesh shader, the value of offset modulo 4 should be known for all outputs,
with an exception of primitive indices.

The modulo value should be known because of MUE layout restrictions, which
require that user per-primitive and per-vertex data start at address aligned
to 8 dwords and we should statically always know the offset from this base.

There can be some cases where the offset from the base is more dynamic
(e.g. indirect array access inside a per-vertex value), so we always do
the analysis.

Primitive indices are an exception, because they form vec3s (for triangles),
which means that the offset will not be easy to analyse.

When U888X index format lands, primitive indices will use only one dword
per triangle, which means that we'll always write them using one message.

Task shaders don't have any predetermined structure of output memory, so
always do the analysis.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20050>
2023-01-31 13:50:08 +00:00
Marcin Ślusarz
2255375c4d nir: add nir_mod_analysis & its tests
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20050>
2023-01-31 13:50:08 +00:00
Samuel Pitoiset
56158bd0c0 radv: adjust ACCUM tessellation fields on GFX11+
Based on RadeonSI/PAL.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20982>
2023-01-31 11:43:10 +00:00
Samuel Pitoiset
c8a575eb30 radv: fix RB+ for SRGB formats
This should be set for linear colorspace only.

Ported from RadeonSI.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20982>
2023-01-31 11:43:10 +00:00
Samuel Pitoiset
47852b9ff4 radv: stop setting INTERPOLATE_COMP_Z
Based on RadeonSI/PAL.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20982>
2023-01-31 11:43:10 +00:00
Hyunjun Ko
c489b3eadb vulkan/runtime: match the spec when taking pipeline subsets.
Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21006>
2023-01-31 11:21:22 +00:00
Simon Ser
6e359c2189 egl: fix fd_display_gpu on surfaceless and device platforms
The original commit missed these.

Signed-off-by: Simon Ser <contact@emersion.fr>
Fixes: 31013f3ce7 ("egl: remove is_different_gpu variable from struct dri2_egl_display")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8194

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20992>
2023-01-31 10:41:32 +00:00
David Rosca
09977d687d frontents/va: Use PIPE_USAGE_STAGING for coded buffer
Coded buffer will only be read on CPU, setting
PIPE_USAGE_STAGING instead of PIPE_USAGE_STREAM
makes the CPU reads much faster.

On 6700XT this reduces the CPU copy by around
3ms to 0.3 ms on average while under high GPU
load - real-time game streaming.

Signed-off-by: David Rosca <nowrep@gmail.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20989>
2023-01-31 10:22:05 +00:00
Samuel Pitoiset
2f93398047 radv: only initialize non-zero values for the default dynamic state
This avoids a big memcpy and cut the function time by 2x.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20960>
2023-01-31 09:01:48 +00:00
Samuel Pitoiset
912a19e630 radv: regroup dynamic states initialization
It should be possible to initialize these inside libraries at some
point.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20960>
2023-01-31 09:01:48 +00:00
Samuel Pitoiset
c08082e861 radv: ignore all CB dynamic states when there is no color attachments
This simplifies radv_init_dynamic_state() slightly.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20960>
2023-01-31 09:01:48 +00:00
Emma Anholt
5eade8fb9b ci: Run our manual jobs during the nightly scheduled run.
We have a common pain point with fractional CTS coverage, where the test
list changes on a CTS uprev or board load rebalancing, so you get a
different subset of tests run.  The dev updates the list of xfails (a
pain), but also we end up with xfails left behind that aren't tested any
more and don't reflect reality.

For some drivers (tu, freedreno, zink-anv) we have manual jobs available
for curious devs to look at the current state of the CTS, but without
anyone having to keep the full xfails updated during uprevs, you don't
necessarily know what to do with the results you get on your MR.

So, let's introduce nightly testing for the tests that aren't guaranteed
green by Marge.  With that, Someone (possibly me? sigh) can review the
nightly results and push up updates for full-run xfails so everyone can be
on the same page other than a day or so of delay.  We also have some hope
for automated tooling to do this thanks to what Collabora has been working
on for automated CI uprev MR generation.

Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20950>
2023-01-31 01:55:22 +00:00
Emma Anholt
610efb0866 ci/zink: Move the zink-anv-tgl manual full run to custom manual deps.
Follow-up to !17445, since this run had been added while that MR was
outstanding.  Now it shouldn't show up in unrelated pipelines.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20950>
2023-01-31 01:55:22 +00:00
Emma Anholt
2e807a028a ci/zink: Disable Amnesia trace until the linked issue gets fixed.
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Martin Roukala <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20950>
2023-01-31 01:55:22 +00:00
Bas Nieuwenhuizen
b0a9772cc6 radv: Shift left the tile swizzle more on GFX11.
ac/surface puts the raw pip_bank_xor there, which needs the extra
shift for the actual tile_swizzle.

(I think long term we should refactor this in ac/surface but for
 now lets fix like radeonsi to avoid race conditions.)

CC: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20979>
2023-01-31 01:25:24 +00:00
Bas Nieuwenhuizen
d321bc1323 radv: Set FDCC_CONTROL SAMPLE_MASK_TRACKER_WATERMARK
Might cause hangs according to comments. Syncs with radeonsi/PAL.

Fixes: e210ffb4d0 ("radv: update framebuffer registers on GFX11")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20979>
2023-01-31 01:25:24 +00:00
Faith Ekstrand
03d1141e51 mailmap: Remap e-mail addresses for Faith Ekstrand
Acked-by: Lina Versace <lina@kiwitree.net>
Acked-by: Daniel Stone <daniels@collabora.com>
Lovingly-reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21000>
2023-01-31 01:17:07 +00:00
Alejandro Piñeiro
2901066980 broadcom/compiler: fix indentation at v3d_nir_lower_image_load_store
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20972>
2023-01-30 21:57:45 +00:00
Jesse Natalie
237e12c2df dzn, driconf: Add a driconf entry for NMS to claim wide line support
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20959>
2023-01-30 21:17:25 +00:00
Sagar Ghuge
df0054e523 iris: Stop marking context unconditionally as guilty
With this change, we would fetch the reset status and if the context
status is banned or in unknown state, we would just start with the fresh
context.

Also, use the fetched reset status to communicate back to the gallium
frontend.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7802

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20928>
2023-01-30 20:48:09 +00:00
Jesse Natalie
0733aafa22 CI: Lima farm is offline
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20995>
2023-01-30 12:05:12 -08:00
Neha Bhende
3b5da9714f docs: Add GL 4.3 support info in mesa docs
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20964>
2023-01-30 18:57:17 +00:00
Boyuan Zhang
4eadb333a8 radeonsi/vcn: validate fence handle before using it
Check if picture fence handle pointer is valid before using.

Fixes: 843bdd22 ('radeonsi/vcn: check fence before destroying dpb')

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20986>
2023-01-30 17:50:52 +00:00
Jesse Natalie
0b9972953c wsi/win32: Use app-provided timeout instead of arbitrary hardcoded value
Prevents returning spurious timeouts when the app wanted to wait
infinitely. Fixes 3DMark Wild Lands which would otherwise attempt
to render/present a buffer it didn't successfully acquire.

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20963>
2023-01-30 17:27:47 +00:00
Jesse Natalie
202480a9ca wsi/win32: Always use non-SRGB formats for DXGI
The actual buffer is always created as non-SRGB, and then SRGB views
can be used to render into it. Fixes a crash trying to launch
3DMark Wild Lands

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20963>
2023-01-30 17:27:47 +00:00
Rob Clark
a192923f99 freedreno/drm: Restart import on zombie race
If we hit the race condition of looking up an already imported BO that
is in the process of being destroyed, the handle will be GEM_CLOSE'd,
meaning that the handle that we just got from the kernel is probably not
valid.  So in this case we should retry.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20961>
2023-01-30 15:48:41 +00:00
Rob Clark
bb438c8dc7 freedreno/drm/virtio: Flush before CREATE_BLOB
The RESOURCE_CREATE_BLOB ioctl can carry a ccmd payload, similarly to
EXECBUF.  But we need to preserve the order of buffered execbuf cmds
which haven't been flushed to the guest kernel yet, rather than let the
CREATE_BLOB payload jump to the head of the queue.  Otherwise, for ex,
the host could see the guest requesting an iova that has not yet been
(from it's perspective) released.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20961>
2023-01-30 15:48:41 +00:00
Samuel Pitoiset
df8243dadf radv: rename radv_create_shaders() to radv_graphics_pipeline_compile()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20943>
2023-01-30 09:37:52 +00:00
Samuel Pitoiset
21f53b9c48 radv: split radv_create_shaders() between graphics and compute shaders
This introduces radv_compute_pipeline_compile() which is used for
compute and ray tracing pipelines. I think it's better than having a
single function for compiling everything, and that will allow us to do
more cleanups.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20943>
2023-01-30 09:37:52 +00:00
Samuel Pitoiset
87e055a700 radv: pass the number of stages to radv_hash_shaders()
This will help for splitting radv_create_shaders().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20943>
2023-01-30 09:37:52 +00:00
Samuel Pitoiset
fc93e0453c radv: simplify VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED
The Vulkan spec says:
    "VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT specifies
     that pipeline creation will fail if a compile is required for
     creation of a valid VkPipeline object; VK_PIPELINE_COMPILE_REQUIRED
     will be returned by pipeline creation, and the VkPipeline will be
     set to VK_NULL_HANDLE."

Given the implementation is expected to set the pipeline to
VK_NULL_HANDLE, it's unecessary to handle pipeline feedback.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20943>
2023-01-30 09:37:52 +00:00
Karol Herbst
4b841cfec8 rusticl: fix build error with valgrind being enabled
This bumps the meson requierement to 1.0 because it requires
https://github.com/mesonbuild/meson/pull/11024

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7688
Fixes: 20c90fed5a ("rusticl: added")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19778>
2023-01-30 03:41:39 +01:00
Alyssa Rosenzweig
4a675f93b9 asahi: Omit extra call to clock_gettime
It's cheap but it isn't free.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20973>
2023-01-29 16:26:48 +00:00
Ian Romanick
2f467fb154 gallium/draw: Enable polygon stipple NIR helpers to generate bool1 or bool32 Booleans
It appears that only softpipe, llvmpipe, and d3d12 hit any of this
code. If some NIR-to-TGSI driver that doesn't have native integers
(e.g., i915 or r300) wants to use this path in the future, it should be
easy to add float32 support.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20869>
2023-01-28 20:42:32 -08:00
Ian Romanick
d3a95f0f71 gallium/draw: Enable aapoint NIR helpers to generate bool1, bool32, or float32 Booleans
Fixes arb_point_parameters-point-attenuation on G33. The crash in
point-line-no-cull is fixed, but the test still fails.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20869>
2023-01-28 20:42:13 -08:00
Amber
17b610771d ir3: support texture and sampler index with offsets
"If this texture instruction has a nir_tex_src_texture_offset source,
then the texture index is given by texture_index + texture_offset."

This fixes the failures for:
spec@arb_arrays_of_arrays@execution@sampler@fs-nested-struct-arrays-nonconst-nested-array
spec@arb_gl_spirv@execution@uniform@sampler2d-nonconst-nested-array

Signed-off-by: Amber Amber <amber@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20954>
2023-01-28 18:00:31 +00:00
Lucas Stach
196882a147 etnaviv: drm: fix check if BO is on a deferred destroy list
list_is_linked() isn't the right function to use in order to check if
the BO is on a cache bucket or the zombie list, as this checks if the
next pointer of the list isn't NULL. This is always the case with the
BO list item as it's always initialized, so the next pointer points to
the list head itself when the BO isn't on any list.

Use list_is_empty() to check if the BO is actually linked into one
of the deferred destroy lists.

Fixes: 1b1f8592c0 ("etnaviv: drm: properly handle reviving BOs via a lookup")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20940>
2023-01-28 13:48:30 +00:00
Lucas Stach
c59369005b etnaviv: free pm queries dynarray on screen destroy
CC: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20940>
2023-01-28 13:48:30 +00:00
Lucas Stach
3156b15f70 etnaviv: drm: fix BO array leaks
Free the both arrays tracking BOs when the etna_cmd_stream is destroyed.

CC: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20940>
2023-01-28 13:48:30 +00:00
Lionel Landwerlin
0d7f8aa249 anv: fix null descriptors
When writing descriptor with a null buffer/image we expect that
writing 0 will point to the null surface. For that to work the null
surface has to be in the bindless surface heap.

This fixes some new failures in dEQP-VK.robustness.* tests once
rewritten from the NV_ray_tracing to KHR_ray_tracing extension.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4ceaed7839 ("anv: split internal surface states from descriptors")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7762
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20953>
2023-01-27 21:38:32 +00:00
Chia-I Wu
d7ef1331b5 turnip: make debug_flags a global variable
Add tu_env as a global variable and add tu_env_init to initialize it.
Add TU_DEBUG macro to check debug flags.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20946>
2023-01-27 21:23:18 +00:00
Chia-I Wu
511c42ef4e turnip: replace TU_DEBUG_DONT_CARE_AS_LOAD by a bool
Instead of using TU_DEBUG=dontcare_as_load, it can still be overriden
using vk_dont_care_as_load=true.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20946>
2023-01-27 21:23:18 +00:00
Jesse Natalie
c0122b81a4 dzn: Consider linked shaders when computing DXIL hash
Fixes 3DMark Wild Lands. Otherwise, we'd end up loading a DXIL shader
that had invalid linkage with another shader in the pipeline. We can
only load a DXIL shader if it's being linked against the same before
and after as a previous compilation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20962>
2023-01-27 20:56:01 +00:00
Karmjit Mahil
134c49072a pvr: Process wait event sub command.
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20862>
2023-01-27 19:41:08 +00:00
Karmjit Mahil
6d7a076daa pvr: Process set and reset event sub commands.
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20862>
2023-01-27 19:41:08 +00:00
Mike Blumenkrantz
ac339d9797 zink: set VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT when using DB
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20912>
2023-01-27 19:23:29 +00:00
Mike Blumenkrantz
6f7b752fdd zink: disable bindless texture ext with descriptor buffer
it's illegal to mix-and-match DB and non-DB descriptor usage, so disable
this until I finish the implementation

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20912>
2023-01-27 19:23:29 +00:00
Mike Blumenkrantz
cc9fa060ee zink: always set RESOURCE usage for descriptor buffers
all types of descriptors may use buffer-type descriptors, even samplers

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20912>
2023-01-27 19:23:29 +00:00
Mike Blumenkrantz
59989d0462 zink: assert that buffer descriptor usage is populated before bind
this is illegal

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20912>
2023-01-27 19:23:29 +00:00
Mike Blumenkrantz
3c562cfc06 zink: set vkusage/vkflags for buffer resource objects
this needs to be populated for other places in the driver that need it

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20912>
2023-01-27 19:23:29 +00:00
Mike Blumenkrantz
c545300f30 zink: add VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT for buffers if ext is enabled
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20912>
2023-01-27 19:23:29 +00:00
Mike Blumenkrantz
ccde3e02ba zink: fix heap/memory type selection
the memory type index still needs to be used for suballocation over the
heap since that's the actual type of allocation being used

Fixes: f6d3a5755f ("zink: zink_heap isn't 1-to-1 with memoryTypeIndex")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20912>
2023-01-27 19:23:28 +00:00
Mike Blumenkrantz
07809c4527 Revert "zink: allow direct memory mapping for any COHERENT+CACHED buffer"
This reverts commit a3552048c7.

on some drivers this catches qbos, which then hits the below assert.
needs more investigation

Fixes: a3552048c7 ("zink: allow direct memory mapping for any COHERENT+CACHED buffer")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20912>
2023-01-27 19:23:28 +00:00
Paulo Zanoni
38a087c4ce anv: there's no need to set exec_obj offsets twice
The anv_execbuf_add_bo() function already sets the offsets for the
exec_objects. Since we're always using softpin and never using
relocations all these objects should have non-changing offsets, all
set during anv_bo creation and never changed. Not only we should not
change these offsets, we definitely don't change them between
anv_execbuf_add_bo() and this loop we're removing.

Previously, we'd have the offset set as -1 for BOs that had never been
submitted when we were not using softpin.

Notice that with games we can have several hundreds of BOs in this
array.

This loop was added by:
  c5f7e1f5b4 ("anv: Delete relocation support from batch submission")

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20885>
2023-01-27 18:53:11 +00:00
Tatsuyuki Ishi
5de60fbc3e radv: Loop over shader stages in flush_indirect_descriptor_sets.
Reduces boilerplate.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20935>
2023-01-27 18:31:58 +00:00
Tatsuyuki Ishi
0b2fad0426 radv: Fix emitting tess indirect descriptors twice.
This fixes a copy-paste error found by manual inspection.

TES may be merged into GS with certain HW stage mappings, which lead to
duplicate set-register commands to be emitted with the old code.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20935>
2023-01-27 18:31:58 +00:00
Matt Coster
9c5e47e66d pvr: Split render job submission for multi-layer framebuffers
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20932>
2023-01-27 18:17:52 +00:00
Matt Coster
8cc474cd87 pvr: Rename global_queue_job_count to global_cmd_buffer_submit_count
This makes the name more accurate, since submits which require multiple
job submissions behind the scenes do not additionally increment this
counter.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20932>
2023-01-27 18:17:52 +00:00
Matt Coster
187a95e617 pvr: Add pvr_csb_bake()
This is a simple helper for minimizing the storage requirements of
control streams. It discards all information required only while
building the control stream and returns just the status and the list of
BOs backing the control stream. The first BO in the list is the start
of the control stream.

Especially for small, deterministically sized control streams, there's
no sense in lugging around an entire builder structure once it's built.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20932>
2023-01-27 18:17:52 +00:00
Rhys Perry
695cf75266 aco: set has_color_exports with GPL
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 192486b7aa ("aco/gfx11: export mrtz in discard early exit for non-color shaders")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20937>
2023-01-27 16:51:56 +00:00
Samuel Pitoiset
1a93cd1556 radv: add a layer for fixing rendering issues with RAGE2
This game seems to incorrectly set the render area and since we switched
to full dynamic rendering, the framebuffer dimensions is no longer used.

Forcing the render area to be the framebuffer dimensions restore the
previous logic and it fixes rendering issues.

Fixes: c7d0d328d5 ("radv: Set the window scissor to the render area, not framebuffer")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20900>
2023-01-27 15:28:45 +00:00
Turo Lamminen
b2df787058 radv: Optimize emitting prefetches
Check the need for emitting prefetch before calling si_emit_cache_flush
to mask a possible cache miss delay and always inline radv_emit_prefetch_L2.
Either change alone is not significant but together they increase
drawcall throughput by 8% on i5-2500.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20877>
2023-01-27 15:05:03 +00:00
Turo Lamminen
bd78c8bbfa radv: Avoid redundant fetch of radv_device
0.6% gain in drawcall throughput on i5-2500.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20877>
2023-01-27 15:05:03 +00:00
Turo Lamminen
b5de1ee1f7 radv: Clean up variables in si_get_ia_multi_vgt_param
8% gain in drawcall throughput on i5-2500. This can significantly change
how compiler allocates registers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20877>
2023-01-27 15:05:03 +00:00
Turo Lamminen
4b8dfaae89 radv: Change radeon_cmdbuf counters to uint64_t to make alias analysis optimize radeon_emit better
1% gain in drawcall throughput on i5-2500. Depends quite heavily on
compiler and CPU.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20877>
2023-01-27 15:05:03 +00:00
Martin Roukala (né Peres)
d7f429ccc1 ci/debian/x86_test-vk: drop an outdated dependency
This was used by the tracing jobs, which we are not running on Mesa
anymore.

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20956>
2023-01-27 14:46:33 +02:00
Jose Fonseca
3ab1a06a15 trace: Don't use italic escape code.
It's not widely supported, and often emulated with invert highlight,
which is very distracting.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20934>
2023-01-27 12:05:17 +00:00
Jose Fonseca
77092ca8f4 llvmpipe: Honor zero sample_mask when multisample is disabled.
The JIT generated FS shader has logic to obey sample mask when:
multisample is enabled, or multisample is disabled but FS writes sample
mask and pipe_rasterizer_state::no_ms_sample_mask_out.

However it did not handle the case where multisample was disabled, FS
did not write sample_mask, and sample mask was zero.  Instead it relied
upon the setup to discard the primitives, but that went away with commit
da5840f3.

We could restore the discard on zero mask behavior, but we would again
blurring the semantics of rasterization discard.  Instead this change
adds logic to primitive setup to cull the primitives when sample mask is
zero.

Fixes: da5840f3 ("llvmpipe: Faithfully honour pipe_rasterizer_state::rasterizer_discard flag")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20934>
2023-01-27 12:05:17 +00:00
Erik Faye-Lund
b6a344f4ba meson: do not reconstruct ICD paths
Meson will already construct these paths for us, so let's reuse them
instead of throwing away the result and recontstructing them.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20907>
2023-01-27 11:35:50 +00:00
Erik Faye-Lund
fd72369b65 freedreno/meson: simplify script-path logic
When passing this to files(), there's no point in prepending
current_source_dir. Let's simplify this a bit.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20907>
2023-01-27 11:35:50 +00:00
Erik Faye-Lund
f00c9e85e5 meson: use files() instead of joining paths
The Meson docs points out that it's better to use the files() function
when referring to files in the source tree than manually constructing
paths like this. Let's follow that advice, and get some neat cleanups.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20907>
2023-01-27 11:35:50 +00:00
Erik Faye-Lund
d54c8a47c6 meson: avoid using deprecated build_root() method
The meson.build_root() method has been deprecated, so let's switch to
meson.project_build_root(), which usually means the same thing. The case
where it doesn't do the same thing is if Mesa is a subproject to some
other project, but in that case I believe we want the build root of Mesa,
not of the parent project anyway.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20907>
2023-01-27 11:35:50 +00:00
Frank Binns
b2d5a653f4 pvr: small cleanups
- remove unused PVR_IDF_WDF_IN_REGISTER_CONST_COUNT define
- remove unneeded pvr_compute_ctx forward declaration
- add render context section header to match compute and transfer

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20931>
2023-01-27 11:22:44 +00:00
Marcin Ślusarz
432e263284 intel/compiler: fine-grained control of dispatch widths
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> [v2]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20854>
2023-01-27 11:00:41 +00:00
Erik Faye-Lund
59625a68ff meson: remove deprecated dri-drivers option
This was deprecated in cdde031ac2 ("classic/i965: Remove driver"),
which is almost two years ago, and many major releases ago. Nobody
should be using this any more. Let's remove it.

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20905>
2023-01-27 10:29:26 +00:00
Erik Faye-Lund
47d19196c1 meson: remove deprecated osmesa-bits option
We've released several new major versions since this was deprecated in
202cab3d30 ("meson: deprecate specifying osmesa-bits"), so it's
probably about time to remove it.

Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20905>
2023-01-27 10:29:26 +00:00
Erik Faye-Lund
713371c723 meson: remove dupliace add_devenv call
Looks like a bad merge-conflict resolution.

Fixes: 7bed7d9475 ("meson: use sections in summary()")
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Thomas Andersen <phomes@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20908>
2023-01-27 09:34:00 +00:00
Lepton Wu
47ed5836cc egl/dri2: Use primary device in EGL device platform for kms_swrast
For KMS only devices, there is no render node available. Also remove
unused _eglGetDRMDeviceRenderNode function.

Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20592>
2023-01-27 08:55:58 +00:00
Corentin Noël
74967249d2 ci: uprev virglrenderer
This change contains a memory unmap fix and makes the render server mandatory.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20938>
2023-01-27 07:56:06 +00:00
Kenneth Graunke
41d5f0ee09 egl: Rewrite eglGetMscRateANGLE to avoid probes and handle multi-monitor
RRGetScreenInfo re-probes connector status, which may result in an EDID
transfer for every output, which according to Adam Jackson can be on the
order of 100ms for a single EDID block.  So our previous implementation
of this eglGetMscRateANGLE was blocking for excessive periods of time
instead of being a quick query of the refresh rate like users expect.

This changes our eglGetMscRateANGLE implementation from using
RRGetScreenInfo to RRGetScreenResourcesCurrent and RRGetCrtcInfo.
This obtains the same monitor info without re-probing connectors.

Fixes a severe performance regression in Chromium WebGL performance.

While we're re-implementing the extension, we also implement proper
multi-monitor support: if there are multiple active CRTCs, we determine
which contains the largest portion of the surface, as specified in the
EGL_ANGLE_sync_control_rate extension.

We also now report fractional refresh rates correctly rather than
rounding to the nearest Hz.

Fixes: 4752655649 ("egl/x11: implement ANGLE_sync_control_rate")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6996
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7038
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20665>
2023-01-27 04:35:08 +00:00
Kenneth Graunke
3170b63314 loader: Add infrastructure for tracking active CRTC resources
This provides a cached view of the current screen resources, with the
coordinates and refresh rate for every active CRTC.  It's currently only
implemented for X11/XCB.

Fixes: 4752655649 ("egl/x11: implement ANGLE_sync_control_rate")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20665>
2023-01-27 04:35:08 +00:00
Mike Blumenkrantz
87a9018ff9 zink: reorder commands more aggressively
by starting resources in the unordered state in a given batch, they
gain more opportunities to be promoted to the barrier cmdbuf and avoid
breaking renderpasses

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20890>
2023-01-27 02:42:56 +00:00
Jesse Natalie
1a29f3dfdb CI/windows: Apply CI_FDO_CONCURRENT to piglit too
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20924>
2023-01-27 01:49:19 +00:00
Jesse Natalie
1c5a64296d CI/windows: Don't limit deqp-runner to 4 jobs
If FDO_CI_CONCURRENT is set, use that, otherwise let deqp-runner
choose concurrency based on system CPU cores.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20924>
2023-01-27 01:49:19 +00:00
Marek Olšák
2ae08c3e8f ac/llvm: remove llvm:: now that we use "using namespace llvm"
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20297>
2023-01-26 19:33:55 -05:00
Marek Olšák
a273f64f80 ac/llvm: run the IPSCCP pass
AMDVLK runs it and it seems useful.

https://en.wikipedia.org/wiki/Sparse_conditional_constant_propagation

58380 shaders in 35438 tests
Totals:
SGPRS: 2709080 -> 2709224 (0.01 %)
VGPRS: 1592972 -> 1592808 (-0.01 %)
Spilled SGPRs: 2420 -> 2420 (0.00 %)
Spilled VGPRs: 1077 -> 1077 (0.00 %)
Private memory VGPRs: 253 -> 253 (0.00 %)
Scratch size: 1232 -> 1232 (0.00 %) dwords per thread
Code Size: 61382088 -> 61356504 (-0.04 %) bytes
Max Waves: 849293 -> 849308 (0.00 %)
Outputs: 127090 -> 127090 (0.00 %)
Patch Outputs: 579 -> 579 (0.00 %)

Totals from affected shaders:
SGPRS: 5400 -> 5544 (2.67 %)
VGPRS: 6200 -> 6036 (-2.65 %)
Spilled SGPRs: 0 -> 0 (0.00 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 975824 -> 950240 (-2.62 %) bytes
Max Waves: 1214 -> 1229 (1.24 %)
Outputs: 232 -> 232 (0.00 %)
Patch Outputs: 0 -> 0 (0.00 %)

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20297>
2023-01-26 19:33:43 -05:00
Marek Olšák
d05c3811cd ac/llvm: run the LLVM sinking pass because LLVM will stop running it
shader-db was run with the sinking pass disabled in LLVM.

58380 shaders in 35438 tests
Totals:
SGPRS: 2730768 -> 2730768 (0.00 %)
VGPRS: 1592932 -> 1592928 (-0.00 %)
Spilled SGPRs: 2687 -> 2687 (0.00 %)
Spilled VGPRs: 551 -> 551 (0.00 %)
Private memory VGPRs: 253 -> 253 (0.00 %)
Scratch size: 700 -> 700 (0.00 %) dwords per thread
Code Size: 61238872 -> 61238868 (-0.00 %) bytes
Max Waves: 849209 -> 849209 (0.00 %)
Outputs: 127090 -> 127090 (0.00 %)
Patch Outputs: 579 -> 579 (0.00 %)

Totals from affected shaders:
SGPRS: 440 -> 440 (0.00 %)
VGPRS: 396 -> 392 (-1.01 %)
Spilled SGPRs: 0 -> 0 (0.00 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 49880 -> 49876 (-0.01 %) bytes
Max Waves: 105 -> 105 (0.00 %)
Outputs: 14 -> 14 (0.00 %)
Patch Outputs: 0 -> 0 (0.00 %)

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20297>
2023-01-26 19:33:17 -05:00
Brian Paul
fbd32a04da anv: add a third memory type for LLC configuration
Commit 582bf4d9 turned on write-combining for most (all?) memory
allocations.  This caused a fairly large performance drop in some of
our VMware tests (application traces, such as Windows Metro Paint).

This patch adds a third memory type configuration: DEVICE_LOCAL,
HOST_VISIBLE, HOST_COHERENT.  This is uncached.  Then, in
anv_AllocateMemory() we only use write-combining for this uncached
type.  This memory type is found in the Intel Windows Vulkan driver.
And according to
https://asawicki.info/news_1740_vulkan_memory_types_on_pc_and_how_to_use_them
uncached memory correlates to write-combined memory.

This fixes our performance regression (and actually produced the
fastest ever results for our test suite).

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20770>
2023-01-26 22:45:49 +00:00
Rob Clark
15e19d04f0 freedreno/drm: Synchronize handle close and lookup
Handle lookup (for example PRIME_FD_TO_HANDLE) must be synchronized with
GEM_CLOSE, otherwise re-import can race with bo_del path, resulting in
the handle of the newly (re)imported BO getting closed.  Now that the
finalize step has been decoupled, fixing this is mostly just deleting
code.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20918>
2023-01-26 22:21:47 +00:00
Rob Clark
444db624df freedreno/drm: Split out bo->finalize()
The complexity around batching up handle closing is simply to allow the
virtgpu to back up ccmd's to the host (because virtio/virtgpu is pretty
inefficient when it comes to lots of small msgs to the host, and it is
common that when we are deleting BOs, we delete a lot of them at the
same time.  But that will make the locking fix in the next commit
impossible (without nested locks).  So let's flip this around and do the
step that virtgpu wants to batch up first, before we get into closing
GEM handles, etc.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20918>
2023-01-26 22:21:47 +00:00
Rob Clark
5a46e884ea freedreno/drm: Remove bo_del_or_recycle()
In prep for the next patch, where locking is swapped around to cover the
whole bo_del() path, decouple handling of the recycle-to-BO-cache path.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20918>
2023-01-26 22:21:47 +00:00
Rob Clark
160137ccae freedreno/drm: Detect zombie BOs
When importing from a GEM name or dmabuf fd, we can race with the final
unref of the same BO, in which case we can get a hit in the handle
table for an fd_bo that another thread is about to free().  Detect and
handle this case.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20918>
2023-01-26 22:21:47 +00:00
Rob Clark
547f50c244 freedreno/drm: Add some ref/unref debugging
Helpful to catch common refcnt issues, like resurrecting a zombie
object.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20918>
2023-01-26 22:21:47 +00:00
Emma Anholt
870beb2159 freedreno: Don't sync timestamps while perfetto isn't running.
This may help with the regression in trace perf testing since enabling
perfetto on the test drivers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20916>
2023-01-26 20:46:39 +00:00
Jesse Natalie
2010b91547 dzn: Report as a software device for non-Windows
Fixes: 5f1b8b3e6c ("dzn: Use DXGI swapchains")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20939>
2023-01-26 19:00:31 +00:00
Jesse Natalie
cdd1588d55 dzn: Don't recursively lock the physical device enum mutex
Fixes: cfa260cd27 ("dzn: Use common physical device list/enumeration helpers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20939>
2023-01-26 19:00:31 +00:00
Jesse Natalie
40a2b50599 dzn: Fix Windows WSI
This was a merge conflict from the Win32 WSI DXGI swapchain changes.
I missed moving a new line of code that was added when rearranging
things for using the common helpers.

Fixes: cfa260cd ("dzn: Use common physical device list/enumeration helpers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20944>
2023-01-26 18:03:50 +00:00
Eric Engestrom
633f2428f4 docs: update calendar for 22.3.4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20942>
2023-01-26 17:37:59 +00:00
Eric Engestrom
c8a32d21cf docs/relnotes: add sha256sum for 22.3.4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20942>
2023-01-26 17:37:55 +00:00
Eric Engestrom
cf58992a36 docs: add release notes for 22.3.4
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20942>
2023-01-26 17:37:44 +00:00
Konrad Dybcio
50dee85b68 freedreno/registers: Add RBBM_GPR0_CNTL for non-GMU operation
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20925>
2023-01-26 15:45:50 +00:00
Rob Clark
f9bcf19e52 freedreno/a6xx: Add a few kernel regs/etc
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20925>
2023-01-26 15:45:50 +00:00
Gert Wollny
4767ebeffc virgl: remove unused virgl_encoder_inline_write
The only user was removed with

be8eeb3b59
  virgl: remove unused virgl_transfer_inline_write

so drop this code too.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18543>
2023-01-26 15:26:40 +00:00
Amber
228d812a0c ir3, isaspec: add raw instruction to assembler/disassembler.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20789>
2023-01-26 14:26:11 +00:00
Ruijing Dong
f2a4ea5300 frontends/va: revert commit 0b02db30
revert commit 0b02db30 as it is not a
proper way to fix av1 decoding 10bit issue.

this is corresponding to the fix in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20870

Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20911>
2023-01-26 14:11:10 +00:00
Corentin Noël
dd3730f8bd kopper: Do not free the given screen in initScreen implementation
The given screen is already freed by the caller in case a NULL-pointer is
returned by the implementation.

Cc: mesa-stable
Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20933>
2023-01-26 13:36:32 +00:00
Juston Li
4c03d4735e util/tests/cache_test: Skip Cache.List if not supported
FOZ_DB_UTIL_DYNAMIC_LIST depends on inotify support

Fixes: 3b69b67545 ("util/fossilize_db: add runtime RO foz db loading via FOZ_DBS_DYNAMIC_LIST")

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20865>
2023-01-26 13:06:27 +00:00
Juston Li
f18702250f util/fossilize_db: add ifdef for inotify header
FOZ_DB_UTIL_DYNAMIC_LIST is defined if the inotify header was
detected.

Fixes: 3b69b67545 ("util/fossilize_db: add runtime RO foz db loading via FOZ_DBS_DYNAMIC_LIST")

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20865>
2023-01-26 13:06:27 +00:00
Timur Kristóf
65a917cb6e nir: Add algebraic optimization for VKD3D-Proton fp32->fp16 conversion.
VKD3D-Proton DXBC f32 to f16 conversion implements a float conversion using PackHalf2x16.
Because the spec does not specify a rounding mode, it emits a sequence to ensure
D3D-like behaviour for infinity.

When we know the current backend has pack_half_2x16_rtz_split,
we can eliminate the extra sequence.

Fossil DB stats on GFX11:
Totals from 835 (0.62% of 134913) affected shaders:
VGPRs: 49368 -> 49224 (-0.29%)
CodeSize: 5341956 -> 5124564 (-4.07%)
Instrs: 1024062 -> 987041 (-3.62%)
Latency: 6530956 -> 6465120 (-1.01%); split: -1.01%, +0.00%
InvThroughput: 908189 -> 870253 (-4.18%)
VClause: 18704 -> 18702 (-0.01%); split: -0.02%, +0.01%
SClause: 33406 -> 33284 (-0.37%); split: -0.38%, +0.01%
Copies: 67440 -> 65992 (-2.15%); split: -2.15%, +0.00%
Branches: 18498 -> 18465 (-0.18%)
PreSGPRs: 38409 -> 38331 (-0.20%)
PreVGPRs: 44089 -> 43834 (-0.58%)

Note, some fossils are from before this pattern was added to VKD3D-Proton,
so the above may not reflect real-world impact.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15838>
2023-01-26 12:24:24 +00:00
Timur Kristóf
7985933a6d nir: Lower pack_half_2x16_split to RTZ if available.
Constant folding always uses RTNE for pack_half_2x16_split, but some
backends implement it with RTZ.

Lowering to RTZ when available ensures that the behaviour will be
consistent between constant folding and the backend.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15838>
2023-01-26 12:24:24 +00:00
Timur Kristóf
c644461b71 radv, aco, ac: Implement pack_half_2x16_rtz_split.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15838>
2023-01-26 12:24:24 +00:00
Timur Kristóf
12652cc549 nir: Add pack_half_2x16_rtz_split opcode.
Same as pack_half_2x16_rtz_split, but always uses RTZ mode.
Note that pack_half_2x16 rounding mode is unspecified.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15838>
2023-01-26 12:24:24 +00:00
Lionel Landwerlin
13cca48920 intel/fs: drop FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD_GFX7
We can lower FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD into other more
generic sends and drop this internal opcode.

The idea behind this change is to allow bindless surfaces to be used
for UBO pulls and why it's interesting to be able to reuse
setup_surface_descriptors(). But that will come in a later change.

No shader-db changes on TGL & DG2.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20416>
2023-01-26 11:26:53 +00:00
Erico Nunes
5bc91550d1 lima/ci: Add more piglit unsupported tests to skip
It is not an exhaustive list but it helps by reducing the bulk of
"Failed to create waffle_context for OpenGL [34].x" errors in the logs
by thousands of occurrences and those are probably not going to be
needed.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20909>
2023-01-26 10:48:47 +00:00
Jose Fonseca
9f51340b99 llvmpipe: Ensure floating point SSE state is reset regardless of the write mask.
The code emitted by lp_build_fpstate_set to reset the FP state could be
jumped over when the write mask was zero, leading to denormals not being
flushed to zero.

Spotted by Roland Scheidegger.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20901>
2023-01-26 08:55:21 +00:00
Samuel Pitoiset
b97fee432c radv: fix ignoring graphics shader stages that don't need to be imported
If a shader stage is already imported from a library it should be
properly ignored.

Fixes recent CTS dEQP-VK.pipeline.fast_linked_library.misc.unused_shader_stages*.

Fixes: c8765c5244 ("radv: ignore shader stages that don't need to be imported with GPL")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20899>
2023-01-26 08:34:36 +00:00
Samuel Pitoiset
6bec915919 radv: fix creating libraries with PS epilog and all CB states as dynamic
It's legal to create a library with FRAGMENT_OUTPUT_INTERFACE and with
all CB states as dynamic, in this case the PS epilog should be dynamic.

This fixes a bunch of regressions while running Zink/RADV CTS with
RADV_PERFTEST=gpl.

Zink is the final boss.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20882>
2023-01-26 08:14:39 +00:00
Iago Toral Quiroga
a3ed7f3ff2 v3dv: add a cl_advance_and_end helper
For the common case where we're emitting packet we don't need to
update the cl_out pointer and then store the result in cl->next,
we can directly update cl->next.

This shows a small improvement in vkoverhead's scores for basic
draw tests.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20897>
2023-01-26 06:21:33 +00:00
Jesse Natalie
a08d6d8b59 dzn: Support Vulkan 1.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20919>
2023-01-26 03:16:50 +00:00
Jesse Natalie
9d89b7e4a8 dzn: Ensure we don't mix DSV+simultaneous-access
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20919>
2023-01-26 03:16:50 +00:00
Jesse Natalie
4daeac01c5 dzn: Enhanced barriers fixes/workarounds
Fix: Acquire/release should have one valid access/sync and one set
to none.

Workaround: D3D doesn't like simultaneous access resources leaving
COMMON layout, nor does it like setting UAV/RTV access bits for the
COMMON layout.
Use UNDEFINED -> UNDEFINED layout transitions, where the access bits
just aren't validated.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20919>
2023-01-26 03:16:50 +00:00
Jesse Natalie
c413c3dffc dzn: Always do clears with copies on non-graphics queues
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20919>
2023-01-26 03:16:50 +00:00
Jesse Natalie
948ff5b8e2 dzn: Support float control
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20919>
2023-01-26 03:16:50 +00:00
Jesse Natalie
f391c2db62 dzn: Cache GPUVA for buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20919>
2023-01-26 03:16:50 +00:00
Jesse Natalie
34f372c47c dzn: Handle separate stencil usage
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20919>
2023-01-26 03:16:50 +00:00
Jesse Natalie
789acc2ffb dzn: Fix dynamic rendering clear load op for non-multiview
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20919>
2023-01-26 03:16:50 +00:00
Jesse Natalie
e88070b1da microsoft/compiler: Support float controls
Float controls are emitted as function attributes on the entrypoint.
These function attributes are not the standard build-in LLVM kind, but
are strings, which the DXIL backend didn't know how to emit. So, this
change adds string attribute support and uses it for fp32 ftz/preserve.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20919>
2023-01-26 03:16:50 +00:00
Timur Kristóf
9fc5d8d211 aco: Remove dynamic VS input loads.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20733>
2023-01-26 02:43:11 +00:00
Timur Kristóf
15b689604e radv: Lower dynamic VS inputs in NIR.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20733>
2023-01-26 02:43:11 +00:00
Timur Kristóf
81620fc7b0 aco: Enable constant exec mask based optimization on compute shaders.
We know for sure exec is initially -1 when the shader always has full subgroups.

Fossil DB stats on GFX11:
Totals from 3884 (2.88% of 134913) affected shaders:
SpillSGPRs: 1673 -> 1697 (+1.43%); split: -1.67%, +3.11%
SpillVGPRs: 2316 -> 2310 (-0.26%); split: -0.65%, +0.39%
CodeSize: 19584436 -> 19567156 (-0.09%); split: -0.13%, +0.04%
Scratch: 217088 -> 216832 (-0.12%)
Instrs: 3784596 -> 3780303 (-0.11%); split: -0.15%, +0.03%
Latency: 39971204 -> 39794967 (-0.44%); split: -0.47%, +0.03%
InvThroughput: 7885552 -> 7801247 (-1.07%); split: -1.14%, +0.07%
VClause: 74654 -> 74611 (-0.06%); split: -0.07%, +0.01%
SClause: 103139 -> 103043 (-0.09%); split: -0.13%, +0.04%
Copies: 279864 -> 281995 (+0.76%); split: -0.72%, +1.48%
Branches: 92082 -> 92084 (+0.00%); split: -0.03%, +0.03%
PreSGPRs: 155637 -> 149491 (-3.95%)

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/20670>
2023-01-26 01:59:26 +00:00
Timur Kristóf
39448c8e9c radv, aco: Add uses_full_subgroups to compute shader info.
Allow the compiler to assume that the shader always has full subgroups,
meaning that the initial EXEC mask is -1 in all waves (all lanes enabled).
This assumption is incorrect for ray tracing and internal (meta) shaders
because they can use unaligned dispatch.

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/20670>
2023-01-26 01:59:26 +00:00
Timur Kristóf
22b350fa27 radv: Get rid of app_shaders_internal.
This will make sure the internal field is set to true for internal
shaders which are initialized outside of radv_device_init_meta.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20670>
2023-01-26 01:59:26 +00:00
Friedrich Vock
9419b4ee45 vulkan/rmv: Remove delta parameter from dump helpers
It was unused.

Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20820>
2023-01-26 01:17:26 +00:00
Friedrich Vock
5eb00a195e vulkan/rmv: Use the timestamp divisor instead of a hardcoded value
Acked-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20820>
2023-01-26 01:17:26 +00:00
Friedrich Vock
e07729e8de radv/rmv: Correct timestamp shifting
The shifting was off-by-one compared to how it is done in the kernel. Also, excess_length needs to be casted to uint64_t to prevent zeroing everything except the 5 LSBs.

Fixes: abf3bcd6 ("radv: Add RMV resource tracking")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20820>
2023-01-26 01:17:26 +00:00
Friedrich Vock
292d7b95fc radv/rmv: Log bo destruction before freeing it
Fixes: abf3bcd6 ("radv: Add RMV resource tracking")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20820>
2023-01-26 01:17:26 +00:00
Friedrich Vock
2d5d247203 radv/rmv: Avoid more CPU unmap deadlocks
Fixes: 8d0e6c02 ("radv: Add RMV tracing utilities")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20820>
2023-01-26 01:17:26 +00:00
Friedrich Vock
2dec10c297 radv/rmv: Also check the other pid field
Sometimes it seems like this field contains the correct pid instead.

Fixes: 8d0e6c02 ("radv: Add RMV tracing utilities")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20820>
2023-01-26 01:17:26 +00:00
Emma Anholt
f6c06ef2f6 ci: Add manual rules variations to disable irrelevant driver jobs.
If you're only affecting one or a couple of drivers, it would be nice if
your pipeline buttons on the web UI weren't full of manual run buttons for
all the other drivers.

This is a bunch of duplicated lines, but less than it could have been now
that we have !references.

In some of these cases (i915g, nouveau, etnaviv), we have no non-manual
jobs for those drivers, so I could have just rewritten the original
"driver-rules" to "driver-manual-rules".  I decided to keep things
consistent between drivers, though, because this is all esoteric enough to
readers already without making different drivers' rules look different.

Fixes: #4891
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17445>
2023-01-26 00:48:19 +00:00
Emma Anholt
67547a04b6 ci: Move the performance jobs' allow_failure:true to the gl rules.
This helps clarify what's going on with these magic manual jobs.

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17445>
2023-01-26 00:48:19 +00:00
Lionel Landwerlin
e27d217fb1 vulkan/wsi/wayland: improve same gpu detection
Some compositor like KWin do not return the render node.

v2: Make sure we test if only drm_info.hasPrimary is true (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: db42ed1e04 ("vulkan/wsi/wl: correctly find whether the compositor uses the same GPU")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8139
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20914>
2023-01-26 00:22:10 +00:00
Adam Stylinski
56e758d9e9 mesa: fix out of bounds stack access on big endian
The texture format code relies on a python-generated atlas of structs
that describe a lookup table for texture swizzling. Many of these
texture formats contain the index "6" used for this lookup. The 6th
index just so happens to represent a "don't care" value, however the
out of bounds read is still best to be avoided. The address sanitizer
finds this issue pretty immediately but it only shows up on big endian
because the textures don't need this on little.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20846>
2023-01-25 23:27:10 +00:00
Sidney Just
6c80f7c555 zink: Fix non debug builds failing to compile on
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20917>
2023-01-25 22:58:07 +00:00
Francisco Jerez
7b5e933629 intel/fs: Fix src and dst types of LOAD_PAYLOAD ACP entries during copy propagation.
The ACP entries created by copy propagation to track the implied
copies of LOAD_PAYLOAD instructions don't model the behavior of
LOAD_PAYLOAD correctly, since (as of 41868bb682) header
moves are implicitly retyped to UD and the destination of non-header
copies implicitly uses the same type as the corresponding source, even
though the ACP entries created for such copies could incorrectly
represent a type conversion, which can lead to mis-optimization of the
program.

According to Marcin, this fixes the func.mesh.ext.workgroup_id.task.q0
crucible test.

Fixes: 41868bb682 ("i965/fs: Rework the fs_visitor LOAD_PAYLOAD instruction")
Reported-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Tested-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18980>
2023-01-25 22:22:12 +00:00
Chad Versace
51b8abe0ba docs: Lower Python requirement to 3.6
Issue 7716 bumped the Python requirement from 3.6 to 3.7 for two
reasons. They are now non-issues.

  - Usage of f-strings. But f-strings are a 3.6 feature.
  - Usage of `from __future__ import annotations`. But the previous
    commit removes that usage.

See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7716
See: 5cf862fbb9 ("docs: update Python requirement to 3.7")
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20237>
2023-01-25 21:21:17 +00:00
Chad Versace
bca22a6578 util/glsl2spirv: Fix build with Python 3.6
ChromeOS still uses Python 3.6, but the glsl2spirv script uses module
'__future__.annotations', introduced in Python 3.7. Fix the build by
removing module, but otherwise preserve the type annotations.

Fixes: 949c3b55db ("util/glsl2spirv: add type annotations")
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20237>
2023-01-25 21:21:17 +00:00
Mike Blumenkrantz
e5e64e5c51 zink: validation ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20891>
2023-01-25 15:04:54 -05:00
Mike Blumenkrantz
23d3783f58 zink: force GENERAL layout for all fb attachments with image binds
this is incredibly stupid, but KHR-GL46.texture_view.coherency does all
kinds of rasterization discard draws with fb attachments bound as images,
and there's no other sane way to catch it dynamically

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20891>
2023-01-25 15:04:12 -05:00
Mike Blumenkrantz
1b52e85ead zink: update sampler layout when detecting feedback loop for first time
ensure synchronization between descriptor layout and layout used here

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20891>
2023-01-25 15:04:12 -05:00
Mike Blumenkrantz
d791e9a77d zink: return false for implicit feedback loop check with image binds
this can only be GENERAL layout so it's not a feedback loop ever

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20891>
2023-01-25 15:04:12 -05:00
Mike Blumenkrantz
bdaded5a18 zink: don't skip repeated handling feedback loops
these can persist across multiple draws, so return true if it's still
a feedback loop

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20891>
2023-01-25 15:04:12 -05:00
Mike Blumenkrantz
fda5f83ced zink: move barrier jit to zink_context.c
this gives access to all the good descriptor functions and enshrinkens
the c++ file size

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20891>
2023-01-25 15:04:12 -05:00
Mike Blumenkrantz
06a125942b zink: fix VK_DYNAMIC_STATE_LINE_WIDTH usage
add a special tracker here to set the state only when necessary

Fixes: 659c39fafb ("zink: rework primitive rasterization type logic")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20886>
2023-01-25 19:46:56 +00:00
Samuel Pitoiset
a5bff81f47 radv/winsys: prefix all error messages with RADV
RadeonSI prints the exact same message and it can be confusing.
All other error messages in the winsys are prefixed now.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20904>
2023-01-25 18:47:52 +00:00
Mike Blumenkrantz
d5846bd1e5 radv: Move constant flushing check out to callers.
Approximately 10% improvement in CPU overhead score on 3900X.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20655>
2023-01-25 18:27:20 +00:00
José Roberto de Souza
5ccc2049fa intel/ds: Nuke intel_ds_queue::queue_id
queue_id is not used anywhere.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20888>
2023-01-25 17:43:57 +00:00
José Roberto de Souza
f2fdd14907 hasvk: Nuke anv_queue:index_in_family
This value is also stored in vk_queue, so we can nuke from anv_queue.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20888>
2023-01-25 17:43:57 +00:00
José Roberto de Souza
013e849a2c anv: Nuke anv_queue:index_in_family
This value is also stored in vk_queue, so we can nuke from anv_queue.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20888>
2023-01-25 17:43:57 +00:00
José Roberto de Souza
80dd6ed074 intel: Add kmd_type parameter to necessary intel_gem.h functions
Here adding kmd_type parameter to
intel_gem_read_render_timestamp(), intel_gem_can_render_on_fd() and
intel_gem_supports_protected_context().
Those 3 functions will have Xe implementations, the other functions
in intel_gem.h will not be called by Xe code paths so not adding
kernel_driver_type to it.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20773>
2023-01-25 09:17:15 -08:00
José Roberto de Souza
162695f0b8 intel: Add intel_kmd_type parameter to intel_engine_get_info()
This will be needed to execute proper function to fetch engines from
kernel mode driver.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20773>
2023-01-25 09:16:55 -08:00
José Roberto de Souza
2c42641994 intel/dev: Detect what is the kernel mode driver loaded
Intel GPUs will have a new kernel mode driver, support for some
platforms will overlap so we will need to detect in runtime what is
the kernel mode driver loaded for each device.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20773>
2023-01-25 09:16:55 -08:00
Philip Langdale
0504a3b079 radeonsi: correctly declare YUV420_10 RT Format support for AV1
This appears to have been an oversight. AV1 Main profile requires
support for both 8bit and 10bit, and so we should always declare
support for the YUV420_10 RT Format. This support then cascades
into supporting the appropriate surface formats and meets expectations
of vaapi clients (especially ffmpeg based) on how to detect support
for these formats.

Note that the commit [0b02db3007] was also made with the intention of
fixing this problem, but it does so in a non-idiomatic way. With that
change, there is still no declared YUV420_10 RT Format, and instead
the P010 surface format is reported under the YUV420 RT Format. This
is not going to work with all vaapi clients. I recommend that this
commit be reverted.

Signed-off-by: Philip Langdale <philipl@overt.org>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20870>
2023-01-25 16:15:25 +00:00
Konstantin Seurer
3eb646efd0 radv: Merge the leaf and internal converter
We have everything we need in the internal one already so we can just
encode leaf nodes there. Since this functionality isn't split anymore,
the shader was renamed to "encode".

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20768>
2023-01-25 15:54:03 +00:00
Rhys Perry
883f18f761 radv: skip creation of null TLAS for null winsys
This won't work because there are no memory types.

Fixes fossilize replay with NULL winsys.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Fixes: 31ca19589f ("radv: Create a null TLAS as meta state")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20878>
2023-01-25 14:16:54 +00:00
Martin Roukala (né Peres)
345d41155f ci/b2c: uprev to b2c v0.9.9
No functional change expected, just a minor reduction in size compared
to the previous version and updated components.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20806>
2023-01-25 12:37:57 +00:00
Helen Koike
7b51a583ed ci/android: add android to the ci
Add android to the ci, so we can test mesa on it.

Add debian/x86_test-android and test-android jobs.
One build the container to run tests, and the other execute the tests.

Android is executed on top of cuttlefish VM with virgl.
Mesa libs are replaced on the cuttlefish image, and deqp and deqp-runner
are used to execute tests.

Co-developed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:26 -03:00
Helen Koike
068dc91317 ci: export artifacts from debian-android
export mesa build from this job, so it can be picked up by an android
testing job.

Co-developed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Helen Koike
3cb7a8537b ci: debian-android compile virgl
compile virgl so we can test android on a vm.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Helen Koike
e42ef902de ci: compile deqp-runner for android
To allow testing mesa on android, we need deqp-runner compiled for it,
so we can add android on the ci.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Helen Koike
54a46c594e ci: compile deqp for android
To allow testing mesa on android, we need deqp compiled for it, so we
can add android on the ci.

Add patch that redirect logs to stdout instead of logcat.
Compile deqp to allow running it directly from command line instead of
Android activity.

Co-developed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Tomeu Vizoso
d024af8d00 ci: Use NDK 25b to build for the Android ABI level 33
25b is the currently supported NDK, as per the below:

https://github.com/android/ndk/wiki

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Helen Koike
d66cfe6a3e ci/android: move sdk version and ndk to a job variable
make it easier to update sdk version and ndk without the need to make
changes all over the code.

Suggested-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Tomeu Vizoso
bdcbf7dcf8 ci: Build for Android with libbacktrace=false
This is needed for using this build inside Android systems with VNDK
enabled, as in recent versions of it libbacktrace isn't available to
libraries in /vendor.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Tomeu Vizoso
a5c96cb705 android: Cleanup unneeded headers from the sync stub
These were probably copy pasted from the previous unified stub.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Tomeu Vizoso
b1bd6aa21a android: Make libbacktrace optional again
For the same reason why we used to have USE_LIBBACKTRACE with the old
Android makefiles, allow to build Mesa without linking to it.

In recent VNDK versions, libbacktrace isn't available.

When building without linking libbacktrace, for some reason some symbols
related to C++ exception handling are exposed. Allow them in the symbols
check script.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Helen Koike
0e286d0dbc android: allow system = 'android' on cross file
Allow building with system = 'android' on the cross file.
This avoids creating symlinks for the libs.

Suggested-by: Roman Stratiienko <r.stratiienko@gmail.com>
Suggested-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Helen Koike
87e6703b67 ci: move patches to patches directory
Group all patches in a directory.
Improve organization to organize the current and future patches.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Helen Koike
388b49d150 ci/debian-android: move pkgconfig paths to the cross file
Move pkgconfig paths out of the job script into the cross file.
Use pkg_config_libdir on the cross file instead.
Which makes more sense and cleaner code.

Suggested-by: David Heidelberg <david.heidelberg@collabora.com>
Suggested-by: Roman Stratiienko <r.stratiienko@gmail.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Sergi Blanch Torné <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20019>
2023-01-25 08:58:25 -03:00
Italo Nicola
6c446377ff panfrost: fix off-by-one when exporting format modifiers
`count` should not be incremented before the check, because it causes
the modifiers array to be filled starting from position 1 instead of 0.

This bug causes one less format modifier to be available than would
otherwise be expected, which could then lead to a dmabuf query failing
in situations where a supported modifier wouldn't be advertised.

It also causes garbage data to be advertised as a modifier in position 0
of the array, although this is not very likely to cause issues.

Fixes: 2a1217513 ("panfrost: Implement panfrost_query_dmabuf_modifiers")
Cc: mesa-stable
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20879>
2023-01-25 09:24:50 +00:00
Samuel Pitoiset
7b76d46e38 radv: fix RADV_DEBUG=hang with multiple cmdbuffer per submission
With RADV_DEBUG=hang, there is only one cmdbuffer per submission and
this has been broken recently.

This fixes a segfault when generating GPU hang reports.

Fixes: 76deaa1b1a ("radv: Refactor command buffer handling in radv_queue_submit_normal.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20860>
2023-01-25 09:05:11 +00:00
Bas Nieuwenhuizen
75ae391375 radv: Reduce descriptor pool allocation for alignment.
Since we can now rely on this due to the stricter layout code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20847>
2023-01-25 08:45:50 +00:00
Bas Nieuwenhuizen
6a16d3b312 radv: Strictly limit alignment needed within a descriptor set.
By doing two passes we limit the number of times we need to have a gap
after a 16-byte descriptor to align for an image descriptor.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20847>
2023-01-25 08:45:50 +00:00
Pierre-Eric Pelloux-Prayer
f73cdda983 radeonsi/gfx11: fix ge_cntl programming
gfx11 renamed PRIM_GRP_SIZE to VERTS_PER_SUBGRP but another change was
was missed.

Update our code based on PAL's UniversalCmdBuffer::CalcGeCntl function
(especially useVgtOnchipCntlForTess being false for gfx11).

Fixes: 25a66477d0 ("radeonsi/gfx11: register changes")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20728>
2023-01-25 08:09:13 +00:00
Pierre-Eric Pelloux-Prayer
014a0bf0b6 radeonsi/gfx11: clamp PRIM_GRP_SIZE
Legal range of values is [1, 256].

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20728>
2023-01-25 08:09:13 +00:00
Pierre-Eric Pelloux-Prayer
f2ef663d08 winsys/amdgpu: use DMA_BUF_SET_NAME_B if available
Give a name to dma-buf. This name appears in /sys/kernel/debug/dma_buf/bufinfo
and could be useful to debug dma-buf:

Dma-buf Objects:
size    	flags   	mode    	count   	exp_name	ino     	name
00606208	00000002	00080007	00000003	drm	00192014	2321705-glxgears

The name is only added to non-shared buffer, to avoid overwriting
an existing name when exporting an imported buffer (otherwise all
dma-buf will pretend to be created by XWayland).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20728>
2023-01-25 08:09:13 +00:00
Pierre-Eric Pelloux-Prayer
3ed75027b7 drm-uapi/dma-buf.h: use __u32/__u64 types
Otherwise we might get build errors: https://gitlab.freedesktop.org/mesa/mesa/-/jobs/34886940

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20728>
2023-01-25 08:09:13 +00:00
Kenneth Graunke
bd8e8d204d iris: Add missing untyped data port flush on PIPELINE_SELECT
This is needed when switching away from GPGPU mode.  See the previous
commit for anv.  This is not likely to make a practical difference for
iris because it never switches back and forth between modes like anv.

Fixes: 172e0b0ebf ("iris: Update PIPELINE_CONTROL flush when switching pipeline mode in TGL+")
Reviewed-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/20774>
2023-01-25 07:08:55 +00:00
Kenneth Graunke
a8108f1d44 anv: Add missing untyped data port flush on PIPELINE_SELECT
See the comments in emit_apply_pipe_flushes().  Flushing HDC is not
sufficient in GPGPU mode, and we need to set the untyped data port flush
bit as well.

Fixes many dEQP-VK failures with INTEL_COMPUTE_CLASS=1 on Alchemist.

Fixes: 1067ec90a5 ("anv: Update PIPELINE_CONTROL flush when switching pipeline mode in TGL+")
Reviewed-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/20774>
2023-01-25 07:08:55 +00:00
Yogesh Mohan Marimuthu
bc07b1a0bf radeonsi: remove some shadow reg optimization for bf1 game
This patch removes below shadow reg optimization. This is done for
Vega64 battlefield 1 crash when shadow regs enabled.

  + reset only dirty states with buffers in si_pm4_reset_emitted()
  + various draw states in si_begin_new_gfx_cs()

v2: remove first_cs parameter from si_pm4_reset_emitted() (Marek Olšák)

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18301>
2023-01-25 04:53:34 +00:00
Yogesh Mohan Marimuthu
44f25792d5 radv: allow NULL initial_preamble_cs in radv_amdgpu_winsys_cs_submit_sysmem()
In case of mcbp, shadowed_regs is initialized early in radv_queue_init()
function by submitting the command buffer. The command buffer is submitted in
radv_init_shadowed_regs_buffer_state() function. When RADV_DEBUG=noibs is used
radv_amdgpu_winsys_cs_submit_sysmem() function is used to submit command buffer.
radv_amdgpu_winsys_cs_submit_sysmem() crashes here because initial_preamble_cs
is NULL. This patch fixes the radv_amdgpu_winsys_cs_submit_sysmem() function
to support NULL initial_preamble_cs.

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18301>
2023-01-25 04:53:34 +00:00
Yogesh Mohan Marimuthu
c6702e1530 radv: fence complete struct is 4 qw size
also libdrm function amdgpu_cs_chunk_fence_info_to_data() has qw multiplier
and hence need not do it in radv_amdgpu_cs_submit().

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18301>
2023-01-25 04:53:34 +00:00
Yogesh Mohan Marimuthu
b11f49f069 radv: INDEX_TYPE and NUM_INSTANCES PKT3 are not shadowed
INDEX_TYPE and NUM_INSTANCES PKT3 should be always written
if shadowing is enabled since they are not shadowed.

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18301>
2023-01-25 04:53:34 +00:00
Yogesh Mohan Marimuthu
2258090c73 radv: set preemp flag and pre_ena bit for shadowregs
Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18301>
2023-01-25 04:53:34 +00:00
Yogesh Mohan Marimuthu
97b9b2cf40 radv: add support for register shadowing
Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18301>
2023-01-25 04:53:34 +00:00
Yogesh Mohan Marimuthu
db61db7f67 radv: add shadowregs variable to RADV_DEBUG environment variable
Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18301>
2023-01-25 04:53:34 +00:00
Yogesh Mohan Marimuthu
5f0fcc05c2 ac,radeonsi: move shadow regs create ib preamble function to amd common
The si_create_shadowing_ib_preamble() function can be reused from radv also.
Hence it is moved.

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18301>
2023-01-25 04:53:34 +00:00
Emma Anholt
ab5dd2467f ci/freedreno: Mark max-texture-size as a flake.
It's been a popular spurious fail in merges in the last week.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20894>
2023-01-25 01:06:00 +00:00
Jakub Kulík
677a3053ff mesa: Fix format transform on big endian platforms
Reviewed-by: Emma Anholt <emma@anholt.net>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6001
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19051>
2023-01-24 23:30:33 +00:00
Emma Anholt
5d5cc7525d ci/zink: Update radv xfails for the recent shadow fixes.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>
2023-01-24 20:56:13 +00:00
Emma Anholt
656f62a801 ci/zink: Update TGL full-run xfails.
arb_shader_texture_lod-texgradcube was a fail incorrectly removed in the
sahdow changes.  line-smooth-* is new piglit coverage.

Haven't pinpointed when the rest were fixed.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>
2023-01-24 20:56:13 +00:00
Emma Anholt
512f1c160a ci/zink: Add coverage using the vulkan validation layer on lvp.
Let's make sure we aren't introducing new validation failures as
development proceeds.  Basically, we record the current set of known
validation failures from the CTS, and for any validation failure we have
the layer log it and abort.

I had started encoding xfails from piglit, but it turns out that piglit
and the validation layer fight about the teardown process, producing
use-after-frees.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>
2023-01-24 20:56:13 +00:00
Emma Anholt
4286633eec zink: Re-emit the SpvBuiltInSampleMask access chain each load.
Otherwise, the access chain you emitted last time may not dominate the
current use.

Fixes the following validation failure in
dEQP-GLES31.functional.shaders.sample_variables.sample_mask_in.bits_unique_per_sample.multisample_texture_2:

  UNASSIGNED-CoreValidation-Shader-InconsistentSpirv(ERROR / SPEC):
  msgNum: 7060244 - Validation Error: [
  UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object 0: handle =
  0x55cf3cea2c60, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6bbb14 |
  SPIR-V module not valid: ID '67[%67]' defined in block '23[%23]' does
  not dominate its use in block '31[%31]'

Fixes: 8899f6a198 ("zink: fix gl_SampleMaskIn spirv generation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>
2023-01-24 20:56:13 +00:00
Emma Anholt
1e4deb3b89 zink: Fix up mismatches of memory model vs addressing model.
MemoryModelVulkan was left out for CSes using it.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>
2023-01-24 20:56:13 +00:00
Emma Anholt
adf81044d4 zink: Fix validation failure for maxLod < minLod.
GL lets you set a silly state, so do something plausible instead of
undefined.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>
2023-01-24 20:56:13 +00:00
Emma Anholt
2a33d509ca zink: Add missing Flat decorations on some inputs.
Fixes validation failures:

Test case 'dEQP-GLES31.functional.android_extension_pack.shaders.es32.extension_directive.oes_sample_variables'..
MESA: error: Validation Error: [
UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object 0: handle =
0x563a1838b790, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6bbb14 |
SPIR-V module not valid: [VUID-StandaloneSpirv-Flat-04744] Fragment
OpEntryPoint operand 31 with Input interfaces with integer or float type
must have a Flat decoration for Entry Point id 4.
%gl_SampleId = OpVariable %_ptr_Input_uint Input

Test case 'KHR-GL46.shader_ballot_tests.ShaderBallotAvailability'..
MESA: error: Validation Error: [ UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object 0: handle = 0x5558e12f17e0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6bbb14 | SPIR-V module not valid: [VUID-StandaloneSpirv-Flat-04744] Fragment OpEntryPoint operand 28 with Input interfaces with integer or float type must have a Flat decoration for Entry Point id 4.
  %gl_SubgroupLocalInvocationId = OpVariable %_ptr_Input_uint Input

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>
2023-01-24 20:56:13 +00:00
Emma Anholt
7b6a5e3e24 zink: Fatal error if requesting validation and we fail to load the layer.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>
2023-01-24 20:56:12 +00:00
Jesse Natalie
81b5f6a3fd dzn: Use core feature matching logic instead of rolling our own
This will print nice messages on unsupported features

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>
2023-01-24 11:00:05 -08:00
Jesse Natalie
db083070f0 dzn: Implement subgroup size control extension
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>
2023-01-24 11:00:05 -08:00
Jesse Natalie
a041cd48f4 dzn: Support more subgroup/quad ops
See the comment around supported shader stages - to avoid
introducing CTS failures, vertex/geometry support for
subgroups are turned off since they cannot support quads.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>
2023-01-24 11:00:05 -08:00
Jesse Natalie
9d26aa99d5 spirv2dxil: Support subgroup SPIR-V caps
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>
2023-01-24 11:00:05 -08:00
Jesse Natalie
a8329595fa spirv2dxil: Lower some wave op properties
DXIL has no concept of subgroup mask ops, relative
shuffle ops, and everything is scalar.

Most wave broadcast ops support i1 overloads, except
for quad swap operations. Go figure. Use lower_bit_size
to promote those to i32 instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>
2023-01-24 11:00:05 -08:00
Jesse Natalie
f58d763363 microsoft/compiler: Support emitting the SM6.6 wave size tag
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>
2023-01-24 11:00:05 -08:00
Jesse Natalie
2c5d96bb58 microsoft/compiler: Implement more wave/quad ops
This handles ballot, vote, shuffle, broadcast, and quads

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>
2023-01-24 11:00:05 -08:00
Jesse Natalie
a318c101bb microsoft/compiler: Handle i1 overloads
Some wave ops can have bool/i1 overloads

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>
2023-01-24 11:00:05 -08:00
Jesse Natalie
e1b6e0748f microsoft/compiler: Handle i2i1 and u2u1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>
2023-01-24 11:00:05 -08:00
Jesse Natalie
1ef9ba9166 microsoft/compiler: Don't emit threadgroup barriers for graphics shaders
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20801>
2023-01-24 11:00:04 -08:00
Pedro J. Estébanez
e07e9a08cb spirv_to_dxil: Unify spirv_to_nir_options
Beyond the pure refactoring, this fixes spirv2dxil, which was using outdated values.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20884>
2023-01-24 18:07:18 +00:00
Jesse Natalie
12a471afac dzn: Enable Vulkan 1.1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
3f0bbb19de dzn: Fix independent blend check
Memcmp returns 0 on equal, so !memcmp means equal.

Fixes: c92729c3 ("dzn: Enable independent blending")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
602a54a083 dzn: Don't expose variable pointers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
ad7157c1e8 dzn: A single sampler descriptor set needs to support 1024 samplers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
884d870929 dzn: Descriptor limits are based on binding tier, not heap tier
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
9f13a4a10a dzn: Usage MULTISAMPLE_LOAD support instead of RT/DS support for MSAA
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
29a0bcdd84 dzn: Support EXTENDED_USAGE bit
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
c0d8838c30 dzn: Usage image view usage instead of image usage
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
1041e0d281 dzn: Use SHADER_LOAD to indicate SAMPLED_IMAGE support
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
cfc05566ab dzn: Move patched vertex buffer capability check up a level
Some of these patched formats are also needed as (trivial) image
formats, so we can't just report vertex buffer as the only supported
operation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
ceb287a509 dzn: When rendering to 3D, don't treat layers as subresources for barriers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
232c598e79 dzn: Set dynamic rendering caps
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
c8b9f70fca dzn: Respect suspending/resuming flags to omit clears/resolves
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
cfa260cd27 dzn: Use common physical device list/enumeration helpers
Implements EnumeratePhysicalDeviceGroups for us for free

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
0bae7a307c dzn: Support vkCmdDispatchBase
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
296ad630db spirv2dxil: Support dispatches with base group indices
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
6bb765f3d1 microsoft/compiler: Lower device index to zero
Maybe we'll support actual device groups at some point, but today
is not that day.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Jesse Natalie
725948c6c9 microsoft/compiler: Fix atomic image umax
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>
2023-01-24 17:22:25 +00:00
Mike Blumenkrantz
97740401dc zink: fix implicit feedback loop detection
the code here was all expecting the VkPipelineStageFlags bitfield expansions,
but u_foreach_bit() gives the actual bit, so implicit feedback loops were never
actually being detected

instead, convert back to the bitfield at the top of the loop so the value works
as expected

Fixes: 9ba0657903 ("zink: make implicit feedback loop application stricter")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20863>
2023-01-24 16:48:48 +00:00
Samuel Pitoiset
49b7f0842e radv: print depth image size with RADV_DEBUG=img
This turned out to be useful when investigating a GPU hang.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20872>
2023-01-24 15:42:44 +00:00
Lionel Landwerlin
5b79745b04 intel/common: add a INTEL_DECODE variable to parameter decoder at runtime
Sometimes you want to diff 2 runs with INTEL_DEBUG=bat, but a tiny
allocation change can mess quite badly with offsets printed in the
decoding, making it hard to look at the diff with meld.

Fortunately our decoder can avoid printing offsets. We just need a
variable to specify that.

We still use the defaults specified by the driver but you can turn
things on/off with :

INTEL_DECODE=+color,-offsets,-floats INTEL_DEBUG=bat ./my_app

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20874>
2023-01-24 15:15:17 +00:00
Lionel Landwerlin
31931754bc intel/decoder: print out compute push constants
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20874>
2023-01-24 15:15:17 +00:00
Marcin Ślusarz
536a2acfc2 intel/compiler/mesh: handle const data in task & mesh programs
Started showing up when nir_opt_large_constants call was moved in 88756cee8d.
Fixes dEQP-VK.mesh_shader.ext.smoke.monolithic.fullscreen_gradient*

Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
Fixes: 88756cee8d ("intel/compiler: Run nir_opt_large_constants before scalarizing consts")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20876>
2023-01-24 14:47:21 +00:00
Marcin Ślusarz
9bb18a4f9e intel/compiler: fix generation of vec8/vec16 alu instruction
I stumbled on this when I inserted some suboptimal lowering code after all
optimizations. Adding certain subset of optimizations after my lowering code
actually avoided this bug, so I think it's not possible to hit this on upstream.

Let's fix this for the next person generating suboptimal code...

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20857>
2023-01-24 13:15:58 +00:00
Yogesh Mohan Marimuthu
19b0bafe35 loader,glx,egl: remove is_different_gpu variable from loader
v2: fd number is different (Pierre-Eric)
v1: remove is_different_gpu (Pierre-Eric)

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohan Marimuthu
648cbd47a7 glx: remove is_different_gpu variable from struct dri_screen
v2: fd number is different (Pierre-Eric)
v1: remove is_different_gpu (Pierre-Eric)

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohan Marimuthu
31013f3ce7 egl: remove is_different_gpu variable from struct dri2_egl_display
v2: fd number is different (Pierre-Eric)
v1: remove is_different_gpu (Pierre-Eric)

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohan Marimuthu
1a0ec8e8d3 loader,glx,egl,vl,d3d: loader_get_user_preferred_fd() function to return original_fd
v1: return original_fd in loader_get_user_preferred_fd() (Pierre-Eric)
v2: fix *original_id crash for android, haiku... (Pierre-Eric)
    remove extra comment (Pierre-Eric)
v2: also return render fd in case of original_fd passed is NULL (Pierre-Eric)

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohan Marimuthu
1c5b61eefb loader,glx: add render_gpu tag psc->driScreen and psc->fd
v1: add render_gpu_tag (Pierre-Eric)

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohan Marimuthu
c712419c1a egl: add render_gpu tag to dri2_dpy->fd and dri2_dpy->dri_screen variable
v1: add render_gpu_tag (Pierre-Eric)

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohanmarimuthu
967b9ad084 egl/wayland: for prime, allocate linear_copy from display GPU VRAM
Allocates VRAM in display GPU in case of prime. Then the dma_buf is imported
into prime GPU.

v4: add image tag to __DRIimage (Marek Olšák)
v3: move display fd opening to separate commit (Pierre-Eric)
    image_format_to_fourcc() non-static to seperate commit (Pierre-Eric)
v2: close query fds after linear_copy buffer import (Marek Olšák)
    use image_format_to_fourcc() from loader_dri3_helper.c (Marek Olšák)

Signed-off-by: Yogesh Mohanmarimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohanmarimuthu
42a46f2c5f loader: make image_format_to_fourcc() non-static
the image_format_to_fourcc() function will be used from
egl/wayland hence make it non-static. Also move the function
into loader_dri_helper.c from loader_dri3_helper.c since
loader_dri3_helper library depends on xcb which will make
egl wayland depend on xcb indirectly.

v2: add loader tag to extern image_format_to_fourcc() (Marek Olšák)

V3: move image_format_to_fourcc to loader_dri_helper.c
Signed-off-by: Yogesh Mohanmarimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohanmarimuthu
57b22f99a9 egl/wayland: keep display fd open for prime
Keep the display fd open for creating DRI screen on display gpu in
case of prime.

Signed-off-by: Yogesh Mohanmarimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohanmarimuthu
94946251d0 loader,glx,egl/x11: init dri_screen_display_gpu in struct loader_dri3_drawable
Initialize dri_screendisplay_gpu variable in struct laoder_dri3_drawable.
Also make dri_screen_display_gpu variable as input parameter to function
loader_dri3_drawable_init() since dri_screen variable is initialized this way.
This also helps to avoid duplicate initializing dri_screen_display_gpu
in glx and egl code.

Signed-off-by: Yogesh Mohanmarimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohanmarimuthu
5519dd0bd1 egl: create DRI screen for display GPU in case of prime
The created DRI screen can be used to allocate VRAM memory from
display GPU in case of prime.

v2: remove extra whitespace (Marek Olšák)

Signed-off-by: Yogesh Mohanmarimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohanmarimuthu
b8da022da4 egl,egl/x11: keep display fd open for prime
Keep the display fd open for creating DRI screen on display gpu in
case of prime. Also close the fd opened in dri2_display_destroy()

Signed-off-by: Yogesh Mohanmarimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>
2023-01-24 12:51:35 +00:00
Yogesh Mohanmarimuthu
4e6e30215d egl: add fd_display_gpu to struct dri2_egl_display
fd opened on display gpu is saved in fd_display_gpu. It is later used
to create dri screen on display gpu.

Signed-off-by: Yogesh Mohanmarimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>
2023-01-24 12:51:35 +00:00
Tapani Pälli
0813c1a6fa intel/genxml: set unused 3DSTATE_PS_EXTRA field as mbz
Wa_14015360517 mentions situations where HW produces invalid
occlusion query results when "Pixel Shader Does not write to RT"
bit is set.

"When Pixel Shader Kills Pixel is set, SW must perform a dummy render
 target write from the shader and not set this bit, so that Occlusion
 Query is correct."

Another situation is when writing to UAV or to NULL render target.
Patch sets field as 'must be zero' to discourage possible use of it.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20849>
2023-01-24 10:28:15 +00:00
Tapani Pälli
205d40b8db mesa: move component bits queries as GL ES only
These enums have been removed/deprecated long time ago from desktop
GL. Here we remove them from modern GL while still allow for compat
contexts (~old apps). This change matches proprietary drivers and makes
our behaviour same within CTS with some tests.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20719>
2023-01-24 10:04:28 +00:00
Iago Toral Quiroga
a81063d2ca v3dv: ensure we allocate at least the requested space for a CL
While we are already ensuring we allocate at least 8192 bytes should
this not be the first allocation and our allocations are typically just
a few bytes, multilayered framebuffers with large numbers of layers may
require more space than that in a single allocation.

Fixes: 3325950648 ('v3dv: increase BO allocation size when growing CLs')
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20871>
2023-01-24 09:49:14 +00:00
Mike Blumenkrantz
0c6e56c391 mesa: (more) correctly handle incomplete depth textures
according to GL spec, incomplete shadow samplers should return 0

this is technically possible for drivers to do using a RGBA texture in
the sense that somehow it's been working, but it's broken at the gallium-level
for what drivers should be expecting to see in such circumstances given
that such scenarios have been binding a RGBA texture to use with shadow samplers

instead, we can give drivers a fallback Z32 texture to avoid format/sampler
mismatches and complying with expected behavior

see also KHR-GL46.incomplete_texture_access.sampler for driver-specific testing

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20817>
2023-01-24 09:13:48 +00:00
Mike Blumenkrantz
818cc30852 mesa: populate gl_program::ShadowSamplers mask from shader data
this data is already processed, it just isn't being propagated for whatever reason

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20817>
2023-01-24 09:13:48 +00:00
Mike Blumenkrantz
64140a73c1 mesa: remove dead parameter doc for _mesa_new_texture_object()
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20817>
2023-01-24 09:13:48 +00:00
Mike Blumenkrantz
ef3205ae57 zink: pass depth swizzle data block to shader compile
with everything now hooked up, this should fix all related test failures

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20598>
2023-01-24 08:30:09 +00:00
Mike Blumenkrantz
336d7630fd zink: remove old depth swizzle workaround
this is already handled in match_tex_dests(), so it does nothing here

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20598>
2023-01-24 08:30:09 +00:00
Mike Blumenkrantz
b6518f3ba5 zink: create another samplerview for shadow textures
when doing legacy depth texture mode sampling, it's necessary to keep
another view that has the right (R in component 0) swizzle so that depth
values can actually be returned in cases where it would otherwise be
a constant value due to swizzling

this also allows zink_sampler_view::shadow_needs_shader_swizzle to be removed

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20598>
2023-01-24 08:30:09 +00:00
Mike Blumenkrantz
c46fb43473 zink: plug in the program/module parts of shadow texture mode emulation
this is clunky because of how big the swizzle data block is,
but the gist of it is the data block is stored onto the shader module key
after all the other data, and then it gets manually hashed/compared in
relevant cases

it's gross, but so is this functionality

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20598>
2023-01-24 08:30:09 +00:00
Mike Blumenkrantz
ef233d43f4 zink: block pipeline fast-pathing for any programs using depth texture modes
the data for this is too big to compress into a shader key, so these pipelines
will always consume more cpu

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20598>
2023-01-24 08:30:09 +00:00
Mike Blumenkrantz
1b2bf99f05 zink: rework depth sampler splatting in shaders
this enables passing a zink_fs_shadow_key to the compiler to manually
apply a swizzle other than R/R/R/R to depth texture results

currently no data is passed, so the previous splatting behavior is preserved

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20598>
2023-01-24 08:30:09 +00:00
Mike Blumenkrantz
5193f4f712 zink: add a fs shader key member to indicate depth texturing mode
this does nothing now besides track the data

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20598>
2023-01-24 08:30:09 +00:00
Mike Blumenkrantz
f62ccaacb8 zink: track depth swizzle on samplerviews
this will provide info for shader rewrites

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20598>
2023-01-24 08:30:09 +00:00
Mike Blumenkrantz
c20c79f584 zink: add an extra_data param to zink_shader_compile
this is extra shader key data that can be used in various ways per stage
and is too large to fit into the shader key

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20598>
2023-01-24 08:30:09 +00:00
Mike Blumenkrantz
e9e4c6266e zink: break out tex dest rewriting into separate function
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20598>
2023-01-24 08:30:09 +00:00
Mike Blumenkrantz
368197923b zink: flag old-style shadow tex mask for fragment shaders
this will be useful for handling depth texturing modes

only 32 are tracked now for performance reasons

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20598>
2023-01-24 08:30:09 +00:00
Samuel Pitoiset
bf3c14b8a5 radv/winsys: fix incorrect PCIID for GFX11 in the null winsys
Fixes: bbad550f3d ("radv/winsys: fill real info for CHIP_GFX1100")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20850>
2023-01-24 08:00:57 +00:00
Lionel Landwerlin
a50d2fdb46 intel/fs: avoid cmod optimization on instruction with different write_mask
I've been running into failures with tests like :

dEQP-VK.robustness.robustness2.bind.notemplate.rgba32i.unroll.nonvolatile.uniform_buffer_dynamic.no_fmt_qual.len_4.samples_1.1d.frag

With the load_global_const_block_intel NIR intrinsic, you can load a
vec8/vec16 with a predicate. The predicate is correctly uniformized to
feed into the SEND instruction's flag register.

The problem is that a series of optimization first remove the
find_live_channel and then changes the broadcast into a simple MOV
instruction, on the assumption that the first channel is always active
if there is not control flow. This is correct.

But after that the cmod optimzation will remove this instruction :

   mov.nz.f0.0(16) null:D, vgrf16+0.0<0>:D NoMask

because it seems to be equivalent to :

   cmp.g.f0.0(16) vgrf16:D, vgrf12:D, 63d

In this case vgrf16 is the predicate to the load block SEND
instruction. Since the execution mask is different between both, some
of the channels of the SEND instruction end up not being loaded or
loaded with the wrong predication and we end up with incorrect UBO
data.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20852>
2023-01-24 07:35:42 +00:00
Emma Anholt
159edf710e ci/piglit: Exclude swapbuffers front-readback tests with PIGLIT_PLATFORM=gbm.
These are expected to fail by the design of gbm.  Don't make each driver
track them.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20798>
2023-01-24 00:13:03 +00:00
Emma Anholt
849af68dbd ci/piglit: Add some common piglit skips for Mesa CI's testing of glx.
Since our X servers don't have a compositor, and we run tests in parallel,
various swap and frontbuffer tests won't ever be stable.  Rather than
having every driver have to track those flakes, make a general X11 skips
list as a known issue of our CI rather than pointing fingers at drivers.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20798>
2023-01-24 00:13:02 +00:00
Emma Anholt
ac5b1df2b9 ci: Move PIGLIT_PLATFORM settings out of the .tomls.
I'm going to add some automatic platform-based skips lists shortly (like
all-skips but more targeted), and this avoids needing to add them to each
.toml.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20798>
2023-01-24 00:13:02 +00:00
Emma Anholt
83c2b26acf ci/freedreno: Switch the piglit job to using a deqp-runner suite.
This is one of the few remaining piglit-runner.sh users.

I think the notable change here is that we no longer set
EGL_PLATFORM=surfaceless like the piglit-runner.sh script did.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20798>
2023-01-24 00:13:02 +00:00
Emma Anholt
ccfacab100 ci/zink: Clear issue #7781 flakes.
These tests all had valgrind UAF complaints that got fixed with the MR
closing that bug.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20798>
2023-01-24 00:13:02 +00:00
Emma Anholt
8189fd30ed ci/zink: Drop glx-swap-copy xfails.
These now skip, since there are no preserved configs any more.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20798>
2023-01-24 00:13:02 +00:00
Emma Anholt
d01f83841a ci/zink: Drop xfail for copy-sub-buffer.
This is a skip these days, since the ext isn't supported in the kopper
world.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20798>
2023-01-24 00:13:02 +00:00
Emma Anholt
68135c12ed ci: Drop windowoverlap xfails, since it's always skipped.
e31d08d307 made it a skip, so no need to
track these any more.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20798>
2023-01-24 00:13:02 +00:00
Emma Anholt
a0d7ccccc0 ci/virgl: Disable iris traces for now while it's unstable.
4 spurious fails today it looks like with the same
"[drm:virtio_gpu_get_capsets] *ERROR* timed out waiting for cap set 0"
signature.  It had started by at least Jan 20.

https://gitlab.freedesktop.org/mesa/mesa/-/jobs/35240569#L2929 (today)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20868>
2023-01-23 23:56:07 +00:00
Mike Blumenkrantz
c26306f7d9 radv: stop using radv_pipeline_has_stage() in BindPipeline
this incurs a small amount of unnecessary cpu overhead as compared to just
checking bitflags

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20615>
2023-01-23 21:04:53 +00:00
Paulo Zanoni
5039acfd9d hasvk: check the return value of anv_execbuf_add_bo_bitset()
This is the Hasvk version of Anv's:
  3d37950fd9 ("anv: check the return value of anv_execbuf_add_bo_bitset()")

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20800>
2023-01-23 20:43:36 +00:00
Paulo Zanoni
80196aaa5b hasvk: don't leave undefined values in exec->syncobj_values
This is the Hasvk version of Anv's:
  ad6a036a68 ("anv: don't leave undefined values in exec->syncobj_values")

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20800>
2023-01-23 20:43:36 +00:00
Sergi Blanch Torne
cce1f1ea70 ci: Uprev kernel to 6.1.7
Once prepared the archive in gfx-ci/linux for kernel 6.1 pointing to 6.1.7 and
with the patches for mesa, update the link. Also, enable some kconfigs needed
for the Adreno and USB.

One job in AMD required an expectation file to be updated with one test. Also,
an mt8192 device tree has been included in the arm64 trees for lava build.

Co-developed-by: Daniel Stone <daniels@collabora.com>
Co-developed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Co-developed-by: Helen Koike <helen.koike@collabora.com>
Co-developed-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20855>
2023-01-23 19:13:13 +00:00
Juston Li
1709590439 util/fossilize_db: fix macOS inotify build error
require <sys/inotify.h> for fossilize_db

Fixes: 3b69b67545 ("util/fossilize_db: add runtime RO foz db loading via FOZ_DBS_DYNAMIC_LIST")

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20755>
2023-01-23 18:31:48 +00:00
Boyuan Zhang
357340953a radeonsi/vcn: check fence before destroying decoder
Add a fence_wait before destroying decoder to make sure destory message has
been processed by firmware.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Sajeesh Sidharthan <sajeesh.sidharthan@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20805>
2023-01-23 17:46:54 +00:00
Boyuan Zhang
843bdd2262 radeonsi/vcn: check fence before destroying dpb
Add a fence_wait before destroying dpb buffer in dpg_unref_list to make sure
previous decode job has been done. (for DPB_DYNAMIC_TIER_2)

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Sajeesh Sidharthan <sajeesh.sidharthan@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20805>
2023-01-23 17:46:54 +00:00
Georg Lehmann
e527f686ca Revert "aco: Combine v_cvt_u32_f32 with insert to v_cvt_pk_u8_f32."
This reverts commit 6d02054047.

v_cvt_pk_u8_f32 returns 0xff instead of v_cvt_u32_f32 & 0xff if the input is
larger than 255.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8128

Cc: mesa-stable
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20829>
2023-01-23 16:22:55 +00:00
SoroushIMG
c007a6e727 zink: update gl43 profile to allow imageRobustAccess
Now that zink can use imageRobustAccess and handle txf with invalid LODs,
update the profile to require either VK_EXT_image_robustness or VK_EXT_robustness2.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20808>
2023-01-23 15:16:01 +00:00
SoroushIMG
f855e2fff6 zink: lower LOD-invalid txf when imageRobustAccess2 is missing
GL robust buffer access applies to texelFetch with out of bounds LODs.
imageRobustAccess2 guarantees this, but imageRobustAccess does not.
Therefore, the txf robustness lowering pass from earlier is used
to provide this guarantee and support ARB/KHR robust_buffer_access_behavior.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20808>
2023-01-23 15:16:01 +00:00
SoroushIMG
90d5e449ae zink: add robust_access field to shader key
Since shaders can be shared even between robust and non-robust
contexts, the robustness state needs to be tracked.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20808>
2023-01-23 15:16:01 +00:00
SoroushIMG
37d00c1a8e zink: add VK_EXT_image_robustness
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20808>
2023-01-23 15:16:01 +00:00
SoroushIMG
6f15646945 zink: add zink_cs_key
Also, add shader key handling to compute programs.
This will be used later on for the rb_image workaround.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20808>
2023-01-23 15:16:01 +00:00
SoroushIMG
c448c7c2e2 zink: add pass checking for lod overflow in txf
Will be used later to workaround missing robustImageAccess2 along
with robustImageAccess.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20808>
2023-01-23 15:16:01 +00:00
Mike Blumenkrantz
474ed4b877 zink: use actual swapchain object for surface comparison
the outer swapchain object is persistent, which means checking it
will never yield an update after the first check

fixes #8122

Fixes: b2739c9f00 ("zink: set surface->dt when updating swapchain"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20814>
2023-01-23 14:51:39 +00:00
Rhys Perry
26e4621fa2 aco/tests: update assembler tests for latest LLVM 16
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20747>
2023-01-23 12:30:28 +00:00
Rhys Perry
b0fa106dc6 aco/tests: fix assembler.gfx11.vop12c_v128 with LLVM 15
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8089
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20747>
2023-01-23 12:30:28 +00:00
Erik Faye-Lund
9f4f131f2e radeonsi: respect smoothing_enabled
When this was last changed, the smoothing_enabled flag seems to have
been forgotten about, breaking line-smoothing (and probably also polygon
smoothing).

Fixes: 4147add280 ("radeonsi: update db_eqaa even if msaa is disabled")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20810>
2023-01-23 08:41:04 +00:00
Iago Toral Quiroga
3325950648 v3dv: increase BO allocation size when growing CLs
This can significantly reduce the number of allocations required
to record large command buffers with thousands of draw calls and
it improves significantly vkoverhead's results.

fps_avg helped:   serious_sam_trace01_1280x720.gfxr:                17.96 -> 18.50 (3.01%)
fps_avg helped:   vehicle-game-2.gfxr:                              9.09 -> 9.33 (2.67%)
fps_avg helped:   ue4_shooter_game_high_quality.gfxr:               17.40 -> 17.66 (1.48%)
fps_avg helped:   ue4_shooter_game_low_quality.gfxr:                25.25 -> 25.61 (1.44%)
fps_avg helped:   ue4_sun_temple.gfxr:                              24.93 -> 25.15 (0.86%)
fps_avg helped:   vkQuake_capture_frames_1_through_1200.gfxr:       52.54 -> 52.95 (0.78%)
fps_avg helped:   rbdoom-3-bfg_capture.gfxr:                        13.87 -> 13.96 (0.69%)
fps_avg helped:   sponza_demo02_800x600.gfxr:                       19.59 -> 19.63 (0.21%)

fps_avg HURT:   ue4_shooter_game_shooting_high_quality.gfxr:      19.14 -> 18.95 (-0.98%)
fps_avg HURT:   sponza_demo01_800x600.gfxr:                       20.03 -> 20 (-0.09%)
fps_avg HURT:   quake3e_capture_frames_1_through_1800.gfxr:       57.34 -> 57.34 (-0.01%)
fps_avg HURT:   serious_sam_trace02_1280x720.gfxr:                38.27 -> 38.27 (-0.01%)

total fps_min in shared programs: 311.74 -> 313.91 (0.69%)
fps_min in affected programs: 311.74 -> 313.91 (0.69%)
helped: 10
HURT: 2

total fps_max in shared programs: 319.54 -> 320.24 (0.22%)
fps_max in affected programs: 319.54 -> 320.24 (0.22%)
helped: 6
HURT: 6

total fps_avg in shared programs: 315.41 -> 317.36 (0.62%)
fps_avg in affected programs: 315.41 -> 317.36 (0.62%)
helped: 8
HURT: 4

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20787>
2023-01-23 07:14:33 +00:00
Iago Toral Quiroga
01c6eeeba5 v3dv: drop unused field from v3dv_cmd_buffer
Not needed since we moved to the common sync framework.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20787>
2023-01-23 07:14:33 +00:00
Jonathan Gray
0594b3c143 egl/dri2: avoid undefined unlocks
unlocks were incorrectly added to paths using dri2_egl_display() as
well as those using dri2_egl_display_lock()

pthread_mutex_unlock() when unlocked is documented by posix as
being undefined behaviour.  On OpenBSD pthread_mutex_unlock() will call
abort(3) if this happens.

Fixes: f1efe037df ("egl/dri2: Add display lock")
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20712>
2023-01-23 00:20:46 +00:00
David Heidelberg
e82cf650e9 ci: bump Mold to the 1.10.0
mold 1.9.0 was up to 10% slower than 1.8.0 on some multicore machines. We fixed the performance regression and made it even faster than 1.8.0.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20819>
2023-01-22 23:25:24 +00:00
David Heidelberg
4c1544b38a ci: Sir trace has small invisible change in rendering
Unrelated to MR itself.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20819>
2023-01-22 23:25:24 +00:00
Mike Blumenkrantz
5bbeb8f507 radv: add an early out in radv_cmd_buffer_flush_dynamic_state()
no point checking all the states if they're known to be unset

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20653>
2023-01-22 13:27:23 +01:00
Thomas H.P. Andersen
a8caf451cb v3dv: use common code for descriptor update template
Use the common code and structs for this. Depends on !14780

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18625>
2023-01-22 11:20:29 +00:00
Adam Stylinski
9ca5a81a6e glx: fix a macro being invoked with the wrong parameter name
Strangely, this was somehow compiling with GCC but my futile efforts to
build mesa with msan caused me to find clang refusing to compile because
of this. Unknown how many bugs this could fix or how GCC did manage to
find "config" in scope but it's fairly obvious that this is the correct
parameter that should be used.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20830>
2023-01-22 04:22:08 +00:00
Konstantin Seurer
d59683ab89 radv: Enable extended SAH for shallow BVHs
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20656>
2023-01-21 20:26:41 +00:00
Konstantin Seurer
da87c2883d radv: Wrap internal build type inside a build_config struct
This will be useful for finer control over build configurations.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20656>
2023-01-21 20:26:41 +00:00
Konstantin Seurer
c53eb2f3d4 radv: Add a shader variant for PLOC with extended SAH
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20656>
2023-01-21 20:26:41 +00:00
Konstantin Seurer
b1755c0b21 radv/bvh: Add a define for extended SAH
This will be used to only chose depth aware SAH when we know that it's
more optimal and doesn't increase build overhead too much.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20656>
2023-01-21 20:26:41 +00:00
Konstantin Seurer
13a8a4071a radv/bvh/meson: Add the option to set defines
This is useful for compiling different variants of the same shader.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20656>
2023-01-21 20:26:41 +00:00
Eric Engestrom
e4ccd74cbc ci: be explicit about the meson setup subcommand
The old way of doing things is deprecated.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20827>
2023-01-21 14:44:33 +00:00
Gert Wollny
4f50eba5a5 r600/sfn: Fix splitting of multislot alu ops
The old source must not incorporate the start slot as lookup
index.

Fixes: commit 573448f93c
  r600/sfn: prepare alu split for use of variable length dot

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8120

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20826>
2023-01-21 11:28:09 +01:00
Gert Wollny
ac30c40211 r600/sfn: Fix opcode and result dest slot mask for variable size dot
Fixes: commit 2df023a1f1
    r600/sfn: pre-evaluate allowed dest mask in Alu instructions

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8120

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20826>
2023-01-21 11:27:57 +01:00
Marek Olšák
797b839111 glthread: disallow glthread if buffer uploads are unsupported
to remove fail paths that defeat the purpose of glthread.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
aca09e4f71 glthread: do vertex uploads if an index buffer is present for MultiDrawElements
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
7921396c7b glthread: remove the vbo_upload_ratio_too_large fallback for glMultiDrawElements
This would be possible to implement, but we don't know of any app where
it would help.

Now glthread fully handles all non-VBO uploads except glDrawIndirect.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
98a0e8c908 glthread: make marshal functions for glBegin/End attribs non-static
for a future commit

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
e9abed5315 glthread: pack and name the type of glthread_vao::Attrib
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
02f1968696 mesa: move gl_vertex_format_user definition into glthread.h
glthread.h needs it and it can't include mtypes.h because mtypes.h
includes it.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
c00db0dbc8 glthread: do vertex uploads if an index buffer is present for glDrawElements
glthread didn't implement uploading non-VBO vertices if indices were
in a buffer. This implements that.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
ed7d3b33b0 glthread: change multi_draw_elements_async() to never fail due to large size
Some callers (not visible here) silently ignore the return value. Remove
the return value and handle the failure in multi_draw_elements_async.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
fc93c69701 glthread: execute glMultiDrawArrays(draw_count < 0) asynchronously
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
68a926a15b glthread: set GL_OUT_OF_MEMORY if we fail to upload vertices
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
e39b90311c glthread: set GL_OUT_OF_MEMORY if we fail to upload indices
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
777166cc66 glthread: handle GL_*_ARRAY in glEnable/Disable
Surprisingly, the GL compatibility profile allows these in both
glEnableClientState and glEnable.

Fixes: 0b1dd18591 - glthread: track which vertex array attribs are enabled

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
a4d813ba54 glapi: autogenerate function parameters with no space between * and variable
print "int *v" instead of "int * v".

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
721526227c mesa: allow GL_UNSIGNED_INT64_ARB as vertex format for ARB_bindless_texture
This wasn't implemented, but the spec requires it.

Fixes: 1fe7b1f972 - mesa: implement ARB_bindless_texture

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
4f6e785876 util: fix util_is_vbo_upload_ratio_too_large
It was wrong. For example, if the draw vertex count was 10 and the upload
vertex count was 150, u_vbuf wouldn't unroll the draw and would instead
memcpy 150 vertices. This fixes that case.

Fixes: 068a3bf0d7 - util: move and adjust the vertex upload heuristic equation from u_vbuf

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
2023-01-20 21:34:09 -05:00
Marek Olšák
4d4995b32b glthread: fix an upload buffer leak
Fixes: befbd54864 - glthread: don't use atomics for refcounting to decrease overhead on AMD Zen

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20804>
2023-01-21 01:38:27 +00:00
Lionel Landwerlin
6f02f9d108 anv: fix preemption enable emission in gpu_memcpy
This has to be before the MI_BATCH_BUFFER_END otherwise it has no
effect.

This also was messing around with you batch length alignment.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b9aa66d5d0 ("anv: disable preemption for 3DPRIMITIVE during streamout")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20802>
2023-01-20 22:35:41 +02:00
Mike Blumenkrantz
b3fd72fd09 radv: remove redundant type sizing
this is already 8 bits

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20751>
2023-01-20 19:43:43 +00:00
Mike Blumenkrantz
46e2cc5d4c radv: add some graphics pipeline hints to optimize pipeline bind
this is a costly function, and we want to avoid loading random struct data
as much as possible

these struct members aren't accessed anywhere else in the function, so eliminating
access avoids some cpu overhead

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20751>
2023-01-20 19:43:43 +00:00
Mike Blumenkrantz
8fc5d93060 radv: simplify depth aspect check in radv_handle_image_transition()
this info is already available, so reduce cpu overhead

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20751>
2023-01-20 19:43:43 +00:00
Mike Blumenkrantz
f9ff2d9d07 radv: reorder dynamic state checks during bind
this avoids potential out-of-order reads from a struct that spans
18 CPU cachelines

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20751>
2023-01-20 19:43:43 +00:00
Mike Blumenkrantz
83c290ff84 radv: repack radv_graphics_pipeline struct
this reduces the number of cachelines used by the struct and allows for
improved memory access

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20751>
2023-01-20 19:43:43 +00:00
Jesse Natalie
bfd891fe66 dzn: Support basic subgroups
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20777>
2023-01-20 18:50:57 +00:00
Jesse Natalie
33f59578fa spirv2dxil: Support basic subgroups
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20777>
2023-01-20 18:50:57 +00:00
Jesse Natalie
8872d5d1dc spirv2dxil: Use 32-bit shared offsets
nir_build_deref_var assumes that you're going to do so, and
there's no reason to use 64-bit types for Vulkan compute.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20777>
2023-01-20 18:50:57 +00:00
Jesse Natalie
2f8a8b5949 microsoft/compiler: Add lowering passes for basic subgroup vars
DXIL doesn't have a "subgroup ID" or "num subgroups" construct,
so add lowering to construct them. Subgroup ID is done using
once-per-subgroup atomics on a workgroup-shared variable, and
then broadcasting that (using read_first_invocation) to the other
threads. Num subgroups is just a division with the workgroup size.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20777>
2023-01-20 18:50:57 +00:00
Jesse Natalie
a422df4b61 microsoft/compiler: Implement a few basic wave/subgroup intrinsics
These are the ones that map perfectly between SPIR-V and DXIL that
are in the "basic" extension group (except for read-lane-first,
but we'll use with some lowering shortly).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20777>
2023-01-20 18:50:57 +00:00
Jesse Natalie
142faf894b microsoft/compiler: Add an overload param to unary function helpers
Subgroup ops aren't i32, they use none.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20777>
2023-01-20 18:50:57 +00:00
Mike Blumenkrantz
5d44318566 zink: don't use ds3 blend states without color attachments
this is illegal and causes validation errors

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20799>
2023-01-20 18:33:07 +00:00
Mike Blumenkrantz
b4d18f2ad1 zink: delete need_blend_constants
this is an artifact of very old code before the dynamic state was set
for all graphics pipelines

now the checks only cause blend constants to not be updated, which triggers
bugs and validation failures

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20799>
2023-01-20 18:33:07 +00:00
José Roberto de Souza
c1d99283e6 intel/dev: Split hwconfig i915 specific code
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20437>
2023-01-20 17:26:08 +00:00
José Roberto de Souza
b3b769894e intel/dev: Move i915 code to i915/intel_device_info.c
No behavior changes here.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20437>
2023-01-20 17:26:08 +00:00
José Roberto de Souza
1332702cf4 intel/dev: Export functions that will be used by different kernel drivers
No behavior changes here.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20437>
2023-01-20 17:26:08 +00:00
Samuel Pitoiset
473732dfd1 radv: remove an old FIXME about a possible bug with TC-compat HTILE
I added this FIXME 2 years ago because it was unclear if it was
broken or not. Since, CTS coverage improved and the number of tests
with depth/stencil on the compute queue increased a lot. vkd3d-proton
also widely uses depth/stencil with GENERAL on GFX10+ and likely with
async compute as well. No issues so far.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4048
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20785>
2023-01-20 17:07:26 +00:00
Rob Clark
1c82981bbe freedreno: Add driconf to disable conservative LRZ
The problematic sequence of draws is pretty rare.  But there are a small
handful of games which do not exhibit the problematic sequence and for
which invalidating LRZ on draws with blend plus depthwrite enabled hurts
performance slightly.  This driconf option enables opting in to the
previous behavior.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20708>
2023-01-20 16:18:03 +00:00
Rob Clark
b392d57042 util/xmlconfig: Use os_get_option()
Enable the property_get() fallback on android.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20708>
2023-01-20 16:18:03 +00:00
Rob Clark
720c842c50 turnip: Invalidate LRZ on blend+depthwrite
See the previous commit for details.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20708>
2023-01-20 16:18:03 +00:00
Rob Clark
899f2218fe turnip: Rename lrz force_disable_mask
Prep to use it to communicate more than just force-disable cases.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20708>
2023-01-20 16:18:03 +00:00
Rob Clark
0e1bdd0057 freedreno/a6xx: Invalidate LRZ on blend+depthwrite
Writing depth with blend enabled means we need to invalidate LRZ,
because the written depth value could mean that a later draw with
depth enabled (where we would otherwise write LRZ) could have
fragments which don't pass the depth test due to this draw.  For
example, consider this sequence of draws, with depth mode GREATER:

  draw A:
    z=0.1, fragments pass
  draw B:
    z=0.4, fragments pass
    blend enabled (LRZ write disabled)
    depth write enabled
  draw C:
    z=0.2, fragments don't pass
    blend disabled
    depth write enabled

Normally looking at the state in draw C, we'd assume we could
enable LRZ write.  But this would cause early-z/lrz to discard
fragments from draw A which should be visible due to draw B.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8065
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20708>
2023-01-20 16:18:03 +00:00
Rob Clark
c1b1b3e6ab freedreno/a6xx: Add LRZ perf warn for ztest direction changes
Add a perf warning when LRZ invalidate happens due to depth test
direction reversal.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20708>
2023-01-20 16:18:03 +00:00
Rob Clark
65e5b8e413 gallium/util: Add util_writes_depth() helper
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20708>
2023-01-20 16:18:03 +00:00
Rose Hudson
e8a60633da radeonsi: report 0 block size for Polaris HEVC encoding
makes encoded videos resemble the input again :)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7992
Fixes: c4482a3c1a ("radeonsi/vcn: enable multi-slice encoding")
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20714>
2023-01-20 15:07:31 +00:00
Timur Kristóf
08f6d14b85 radv: Make NGG query emission a dirty flag.
Don't emit the NGG query user SGPR if its state doesn't change.
Based on original work by Mike Blumenkrantz.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18819>
2023-01-20 14:31:45 +00:00
Tapani Pälli
247c06d419 iris: add restrictions for 3DSTATE_RASTER::AntiAliasingEnable
Field must be disabled if any render targets have integer
format, additionally for Gfx12+ field must be disabled when
num multisamples > 1 or forced multisample count > 1.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7892
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20671>
2023-01-20 12:50:04 +00:00
Tapani Pälli
58dd9d5134 hasvk: add restrictions for 3DSTATE_RASTER::AntiAliasingEnable
Field must be disabled if any render targets have integer format.

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20671>
2023-01-20 12:50:04 +00:00
Tapani Pälli
9b37ef40f8 anv: add restrictions for 3DSTATE_RASTER::AntiAliasingEnable
Field must be disabled if any render targets have integer
format, additionally for Gfx12+ field must be disabled when
num multisamples > 1 or forced multisample count > 1.

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20671>
2023-01-20 12:50:04 +00:00
Samuel Pitoiset
f42521f6c3 radv: advertise extendedDynamicState3ColorBlendEquation
This enables full ds3 support with Zink!

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20281>
2023-01-20 11:55:07 +00:00
Samuel Pitoiset
de1e2b65db radv: fix detecting that blend is enabled when all CB states are dynamic
It's allowed to be NULL.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20281>
2023-01-20 11:55:07 +00:00
Samuel Pitoiset
4041be0f6f radv: enable compiling PS epilogs on-demand for dynamic color blend equations
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20281>
2023-01-20 11:55:07 +00:00
Samuel Pitoiset
daa2aeaa0c radv: add support for dynamic blend equation
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20281>
2023-01-20 11:55:06 +00:00
Samuel Pitoiset
11382a6711 radv: add a new helper for normalizing blend factors
It will be also used when compiling PS epilogs on-demand.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20281>
2023-01-20 11:55:06 +00:00
Samuel Pitoiset
39dcac4f79 radv: move some color blend helpers to radv_private.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20281>
2023-01-20 11:55:06 +00:00
Martin Roukala (né Peres)
f7dd9e5806 zink/ci: add spec@!opengl 1.1@line-smooth-stipple to the fails list
Fixes: a8d2b288ee ("ci/piglit: 2023-01-19 uprev")
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20807>
2023-01-20 11:29:03 +00:00
Rohan Garg
ec6ad8c7dc iris: Don't flush the render cache for a compute batch
Make sure we comply with BSpec and ensure that certain flush flags
are not set for compute batches

Signed-off-by: Rohan Garg's avatarRohan Garg <rohan.garg@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15664>
2023-01-20 11:09:24 +00:00
Danylo Piliaiev
926f626b95 tu/kgsl: do not use kgsl_command_object::offset
offset field in kgsl_command_object is NOT used by KGSL, so
we should offset directly to iova.

Fixes weird hangs on KGSL. E.g. fixes the hang in:
 dEQP-VK.memory.pipeline_barrier.transfer_dst_storage_texel_buffer.1024

cc: mesa-stable

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20795>
2023-01-20 10:50:20 +00:00
Iván Briano
58ababdee6 anv: uncompressed views of compressed 3d images are now valid
There was a VUID-VkImageViewCreateInfo-image-04739 in the Vulkan 1.3
spec that said:

    If image was created with the
    VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag and format is a
    non-compressed format, viewType must not be VK_IMAGE_VIEW_TYPE_3D

That VUID has since been removed, and when a view of a 3D image is
created, with put the depth into the array_len, so it won't be always 1.

Reviewed-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20803>
2023-01-20 08:41:59 +00:00
Tatsuyuki Ishi
1617dac6c3 radv: Fix depth-only-with-discard when epilogs are used.
For a depth-only-with-discard pipeline, spi_shader_col_format needs to be
fixed up to a single channel export, or otherwise discard will not work.

Since col_format can change depending on the dynamic state, precompute the
need for this workaround on pipeline creation and apply it when emitting
prolog states.

Fixes: eb07a11b8f ("radv: add support for compiling PS epilogs on-demand")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20704>
2023-01-20 08:17:50 +00:00
Thomas H.P. Andersen
7bed7d9475 meson: use sections in summary()
Makes the list easier to read

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12161>
2023-01-20 04:22:40 +00:00
Thomas H.P. Andersen
6c0dc0b2a7 meson: use summary()
Make use of mesons summary() to create and align the configuration
summary.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12161>
2023-01-20 04:22:39 +00:00
Jesse Natalie
e8c8a94c2e dzn: Rework meta blit VS
Some D3D12 drivers, like my PC's AMD driver, don't like using a
dynamic index to load from a constant buffer that's bound via
root constants. Instead, just go ahead and load the full set of
vertex data and just bcsel which one to use.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20778>
2023-01-20 00:35:59 +00:00
Jesse Natalie
8de0c23ac9 dzn: Delete an unnecessary assert
As far as I can tell, having multiple levels in the view for a
color target just means to target the first one.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20778>
2023-01-20 00:35:59 +00:00
Jesse Natalie
c92729c3ce dzn: Enable independent blending
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20778>
2023-01-20 00:35:59 +00:00
David Heidelberg
613feb39c4 ci: bump ci-fairy with session support (robust downloads)
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20788>
2023-01-19 23:46:44 +00:00
David Heidelberg
a8d2b288ee ci/piglit: 2023-01-19 uprev
Emergency uprev to get robustness against http 50x errors for traces.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20788>
2023-01-19 23:46:44 +00:00
David Heidelberg
796686af1b ci: migrate from wget to curl
Better error handling is more reliable.

Options:
 -L, follow location
 --retry, number of retries
 --retry-all-errors, does not fail on ALL errors, that's why there is -f
 -f, fail fast with no output at all on server errors
 --retry-delay, make curl sleep this amount of time before each retry

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20788>
2023-01-19 23:46:44 +00:00
David Heidelberg
1abd3a3051 ci/piglit: explicitely define we want GLX tests
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20788>
2023-01-19 23:46:44 +00:00
Dylan Baker
bab3e2fbd9 meson: use the same workaround for setting 'lib' on windows
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20752>
2023-01-19 23:06:07 +00:00
Dylan Baker
7aca37fc28 meson: use [] instead of 'lib for !windows name_prefix
This is a poorly documented value that uses the default value, but
doesn't emit a warning. In the future Meson will fix this.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20752>
2023-01-19 23:06:07 +00:00
Dylan Baker
a79e6457d8 meson: use builtin support for reading version from a file
In meson 0.57 support was added for reading a version from a file to
meson natively, so we don't need this workaround anymore.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20752>
2023-01-19 23:06:07 +00:00
Dylan Baker
c31629ee78 meson: remove version checks for < 0.59
Which is now required, so these are useless

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20752>
2023-01-19 23:06:07 +00:00
Jesse Natalie
8c0531cf91 dzn: Enable multiview
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Jesse Natalie
ebf2604562 dzn: Implement multiview queries
This is a weird way to do queries, but in multiview, each query
takes up N slots, where N is the number of views. D3D doesn't do
it that way, and only has one result, which fortunately is a valid
way to do Vulkan queries. We just need to take care to zero out
the other view results, and make sure they get "signaled" when
the cmdbuf is submitted.

Note that it is invalid in D3D to use ResolveQueryData on query
slots that have never actually been begun/ended, so we zero out
the data by copying zeroes into the buffer. This probably could
be optimized but oh well.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Jesse Natalie
4586b308d8 dzn: Handle draws and clears for multiview rendering
For draws, when we're emulating multiview, we need to loop them
and set up the right sysval. For clears, we always need to loop.
When not emulating, we also need to set up the right view instance
mask.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Jesse Natalie
6fca32cb38 dzn: Handle multiview pipeline creation
This handles both native and emulated pipeline creation

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Jesse Natalie
ea9d092655 dzn: Put nir compilation options in a struct
The function signatures are getting unwieldly...

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Jesse Natalie
3299ab04cb spirv2dxil: Claim multiview support
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Jesse Natalie
95a90b359a spirv2dxil: Implement lowering for multiview
D3D's view instancing is an optional feature, and even when it's
supported, it only goes up to 4 views, where Vulkan requires a
minimum of 6 supported views. So, we need to have a path for handling
the cases where we can't use the native feature.

In this mode, pass the view ID as a runtime var. The caller is then
responsible for looping the draw calls and filling out the constant
buffer value correctly for each draw. When we get to the last pre-rast
stage, we'll additionally want to write out gl_Layer to select the
right RTV array slice. Lastly, for the fragment shader, if there's
any input attachments, those get loaded using the RTV slice instead
of the view ID. RTV slice input into the PS is done with a signature
entry (which must be output from the previous stage) rather than a
system value.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Jesse Natalie
2d56b3214d spirv2dxil: Pass runtime conf struct to lower_shader_system_values
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Jesse Natalie
58488b9d85 microsoft/compiler: Support view instancing
This adds support for D3D12-native view instancing to the compiler.
Essentially, it's just the ability to load SV_ViewID (dx.op.viewID),
set the right capability, and fill out some more PSV data. Note that
the PSV data is currently garbage. Ideally, we'd fill out a proper
input -> output and viewID -> output dependency table, but AFAIK
this is only used to enforce D3D API validation, and drivers ignore
it, so it's less critical to get it right.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Jesse Natalie
4a440889a8 microsoft/compiler: Delete stale TODO comment
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Jesse Natalie
e0024a844c microsoft/compiler: Subpass textures are supposed to be arrays
When doing multiview subpass rendering, they get loaded with the
view/layer index.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Jesse Natalie
8924fe9fc3 microsoft/compiler: Delete incorrect implementation for load_layer_id
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20650>
2023-01-19 21:14:50 +00:00
Mike Blumenkrantz
a6f932639a zink: simplify some dynarray concat descriptor code
TIL this exists

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20681>
2023-01-19 20:26:44 +00:00
Mike Blumenkrantz
1329fec352 zink: consolidate semaphore creation where possible
all cacheable semaphores should now be using the cache

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20681>
2023-01-19 20:26:44 +00:00
Mike Blumenkrantz
7399b2241f zink: move semaphore caching to zink_reset_batch_state()
this makes semaphores available for reuse more rapidly

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20681>
2023-01-19 20:26:44 +00:00
Mike Blumenkrantz
b8252784cf zink: add a binary semaphore cache
after being waited upon, a binary semaphore can be reused, which saves
tons of present-related ioctls when fps is high

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20681>
2023-01-19 20:26:44 +00:00
Mike Blumenkrantz
283de45fd6 zink: add a util function for creating semaphores
annoying to keep copy/pasting this around

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20681>
2023-01-19 20:26:44 +00:00
Mike Blumenkrantz
020db79340 zink: preserve present resources during async presentation
ensure that these have a lifetime great enough to be presented

fixes #7781

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20793>
2023-01-19 20:00:14 +00:00
Eric Engestrom
482e215a67 ci/bare-metal: add more timestamps to help debugging issues
Acked-by: Emma Anholt <emma@anholt.net>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20792>
2023-01-19 19:05:35 +00:00
Mike Blumenkrantz
7f0e213a57 zink: NV_compute_shader_derivatives
nothing complicated here

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12120>
2023-01-19 18:00:22 +00:00
Julia Tatz
c71287e70c zink: correct sparse bo mem_type_idx placement
VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x01 has been incidently the
correct memory type index, but isn't guaranteed to be, which is why it
hasn't caused issues yet

Fixes: f9515d93 ("zink: allocate/place memory using memoryTypeIndex directly")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20264>
2023-01-19 17:20:00 +00:00
Julia Tatz
e20e8f2243 zink: trival renames heap_idx -> memoryTypeIndex
Trival renames to correctly identify vulkan memory type indices aren't
the same as zink heaps

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20264>
2023-01-19 17:20:00 +00:00
Julia Tatz
f6d3a5755f zink: zink_heap isn't 1-to-1 with memoryTypeIndex
Clarify the relationship between zink heaps and vulkan memory type
indices, and resolve the issues from mixing the two up.

Closes: #7588, #7813
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20264>
2023-01-19 17:20:00 +00:00
Dylan Baker
75276deebc meson: Use feature option methods for xmlconfig
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
37463bedec meson: use a feature option for shared-llvm
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
c52c2ed0f8 meson: use a feature option for egl
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
afa97e7468 meson: use a feature option for zstd
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
e3f60ea4a8 meson: use a feature option for xlib-lease
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
ce490a20e7 meson: use a feature option for power8
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
2653fe11c9 meson: use a feature option for lmsensors
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
202344e9a0 meson: use a feature option for libunwind
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
3f10a89180 meson: use a feature option for valgrind
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
d00c6e0fd7 meson: use a feature option for llvm
Still not as awesome as it should be, but an improvement over what we had
before.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
c40e1bb1d0 meson: use a feature option for gbm
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
6b334a8416 meson: use a feature option for gles2
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
ca615a4f16 meson: use a feature option for gles1
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
80eb78d7a4 meson: use a feature option for shared-glapi
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
98bd7cdb8c meson: use a feature option for shader_cache
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
b200d547dc meson: use a feature option for gallium-xa
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
6f66b89ac3 meson: use a feature option for gallium-va
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
eac76e433d meson: use a feature option for gallium-vdpau
Which we can use with the require method, and use the feature itself
as the require argument to dependency call. All of this results in less
code

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
8dcc1f8311 meson: use a feature option for dri3
This removes the deprecated 'true' and 'false' options, and uses a meson
feature, requiring significantly less code.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
643af2cf83 meson: drop meson < 0.54 workaround
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
3c5e969144 meson: replace uses of ExternalProgram.path with .full_path
The former is deprecated

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
92235e0c48 meson: replace has_exe_wrapper with can_run_host_binaries
The former is a deprecated alias for the latter, which more accurately
describes what the function does.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Dylan Baker
45632b3297 meson: bump minimum required version to meson 0.59
This gives us some utility methods for feature options, allowing even
simpler code. We can replace something like:
```meson
_opt = get_option('opt')
if _opt.auto()
  opt = host_machine.system() != 'windows'
else
  opt = opt.enabled()
endif
```
with
```meson
opt = get_option('opt') \
    .disable_auto_if(host_machine.system() != 'windows') \
    .allowed()
```

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20409>
2023-01-19 16:29:03 +00:00
Mike Blumenkrantz
6ff334e54a zink: handle modifier nplanes queries correctly for planar formats
this just returns the number of planes in the base format as a default, which
matches the behavior of other drivers

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20753>
2023-01-19 16:01:14 +00:00
Mike Blumenkrantz
072e29a22e zink: store drm format as internal_format for imported resources
internal_format is the "real" format of a resource, and the "real" format
of imported resources is the external-facing format, not the pipe format

this ensures the correct format is available for internal ops, such as nplanes queries

Fixes: 2e2775c11b ("zink: fix PIPE_RESOURCE_PARAM_NPLANES with format modifier")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20753>
2023-01-19 16:01:14 +00:00
Samuel Pitoiset
700bc2dae0 radv: rename ac_surf_nbc_view::max_mip to num_levels
For readability.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20761>
2023-01-19 12:46:07 +00:00
Samuel Pitoiset
8d191b2cfb radv: fix creating BC image views when the base layer is > 0
When the base array layer of the image view is > 0, addrlib computes
the offset (in HwlComputeSubResourceOffsetForSwizzlePattern) which is
then added to the base VA in RADV. But if the driver doesn't reset
the base array layer, the hw will compute incorrect addressing
(ie. base array will be added twice). This also matches AMDVLK.

This fixes a VM fault followed by a GPU hang on RDNA2 when trying
to join a multiplayer game with medium settings in Halo Infinite.

Fixes: 98ba1e0d81 ("radv: Fix mipmap views on GFX10+")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20761>
2023-01-19 12:46:07 +00:00
Samuel Pitoiset
18aaa373b7 radv: fix buffer to image copies with BC views on the graphics queue
The color surface descriptor needs to be adjusted, otherwise addressing
is wrong.

Fixes tests performed on the graphics queue from
dEQP-VK.api.copy_and_blit.*.image_to_buffer.2d_images.mip_copies_*.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7900
Fixes: 98ba1e0d81 ("radv: Fix mipmap views on GFX10+")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20761>
2023-01-19 12:46:07 +00:00
Samuel Pitoiset
aff5fe3f94 radv: fix setting MAX_MIP for BC views
MAX_MIP should always be the number of levels minus one from the hw
perspective.

This doesn't fix anything known.

Fixes: 98ba1e0d81 ("radv: Fix mipmap views on GFX10+")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20761>
2023-01-19 12:46:07 +00:00
Eric Engestrom
34e6530518 mesa/st: drop unused param
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20772>
2023-01-19 10:10:45 +00:00
Pierre-Eric Pelloux-Prayer
ddc721e15c glthread: fix glArrayElement handling
This must be marshalled synchronously or the attrib pointers' content
might change by the time we use them.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8068
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20748>
2023-01-19 09:42:34 +00:00
Pierre-Eric Pelloux-Prayer
0f5c8c3dc3 vbo: lower VBO_SAVE_BUFFER_SIZE to avoid large VRAM usage
The ideal case for performance is to have a single buffer for
all display list. The caveat is that large buffers are less
likely to be freed because they're refcounted: it only takes
1 user (diplay list) to keep it in VRAM.

This lowers VRAM usage when replaying the trace attached
of the trace attached to !6140 from 5.5 GB to about 1.8 GB.

Viewperf snx performance isn't affected.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6140
Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20748>
2023-01-19 09:42:34 +00:00
Pierre-Eric Pelloux-Prayer
491f6b138e vbo: remove bogus assert
grow_vertex_storage may call wrap_filled_vertex, which will
trigger the assert incorrectly because the new size will be
smaller than 'new_size' but it's correct because
'vertex_store->used' has been reset to 0.

Fixes: a08baaff97 ("vbo/dlist: fix indentation in vbo_save_api.c")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20748>
2023-01-19 09:42:34 +00:00
Lionel Landwerlin
ff34e96701 nir/lower_io: fix bounds checking for 64bit_bounded_global
If the offset is negative like it's the case in

dEQP-VK.robustness.robustness2.bind.notemplate.r32i.unroll.volatile.storage_buffer_dynamic.readwrite.no_fmt_qual.len_256.samples_1.1d.comp

we end up passing the bounds checking condition because it's using
signed integers.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Suggested-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Cc: mesa-stable
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20762>
2023-01-19 09:16:40 +00:00
Kenneth Graunke
7092c1218a intel/compiler: Use more symbolic source names in components_read()
Rather than hardcoding source 1, source 2, etc.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20604>
2023-01-19 08:42:22 +00:00
Kenneth Graunke
16b66ab659 intel/compiler: Drop dest checking in atomic code
NIR atomic operation intrinsics all have destinations.  This is just
copy and pasted from other generic intrinsic handling where that may
or may not be the case.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20604>
2023-01-19 08:42:22 +00:00
Kenneth Graunke
780f3e2e6b intel/compiler: Delete all the A64 atomic variants for type sizes
These are handled identically in almost all cases.  There is one place
in the legacy surface lowering that was obtaining the bitsize from the
opcode, but the LSC-based lowering uses (type_sz(inst->dst.type) * 8)
for that and works just fine.  If we just do that in the legacy lowering
too, then we don't need this plethora of opcodes.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20604>
2023-01-19 08:42:22 +00:00
Kenneth Graunke
03ddde1230 intel/compiler: Combine nir_emit_{ssbo,shared}_atomic into one helper
These are basically identical save for:
- shared has surface hardcoded to SLM rather than an SSBO index
- shared has to handle adding the 'base' const_index (SSBO have none)
- the NIR source index for data is shifted by one

It's not worth copy and pasting the entire function for this.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20604>
2023-01-19 08:42:22 +00:00
Kenneth Graunke
b84939c678 intel/compiler: Delete fs_visitor::nir_emit_{ssbo,shared}_atomic_float()
These are now basically identical to their non-float counterparts.  The
only thing that differed was the opcode checking to determine which
operands existed.  Now that we have a unified opcode enum and a helper
for the number of data operands, we can just use that.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20604>
2023-01-19 08:42:22 +00:00
Kenneth Graunke
f7b29d7924 intel/compiler: Drop redundant 32-bit expansion for shared float atomics
We already expanded data to 32-bit a few lines earlier, so this is just
redundantly doing it a second time.

Fixes: 43169dbbe5 ("intel/compiler: Support 16 bit float ops")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20604>
2023-01-19 08:42:22 +00:00
Kenneth Graunke
02129eee3a intel/compiler: Eliminate SHADER_OPCODE_UNTYPED_ATOMIC_FLOAT
The only reason for the separate opcode was because of the overlapping
BRW_AOP_* enums, making it impossible to tell whether a particular AOP
was the integer or float operation.  Now that we use the lsc_opcode
enums, we can just have the legacy lowering inspect the opcode and
select the right descriptor.  No need for a separate opcode.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20604>
2023-01-19 08:42:22 +00:00
Kenneth Graunke
284f0c9a57 intel/compiler: Add an lsc_op_num_data_values() helper
There are a number of places that need to know how many operands an LSC
atomic takes (0 for inc/dec, 1 for most things, 2 for cmpxchg).  We can
add a helper for that and eliminate some code (with more to come).

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20604>
2023-01-19 08:42:22 +00:00
Kenneth Graunke
90a2137cd5 intel/compiler: Use LSC opcode enum rather than legacy BRW_AOPs
This gets our logical atomic messages using the lsc_opcode enum rather
than the legacy BRW_AOP_* defines.  We have to translate one way or
another, and using the modern set makes sense going forward.

One advantage is that the lsc_opcode encoding has opcodes for both
integer and floating point atomics in the same enum, whereas the legacy
encoding used overlapping values (BRW_AOP_AND == 1 == BRW_AOP_FMAX),
which made it impossible to handle both sensibly in common code.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20604>
2023-01-19 08:42:22 +00:00
Kenneth Graunke
8d2dc52a14 intel/compiler: Move atomic op translation into emit_*_atomic()
There's no need to pass both the intrinsic and an opcode computed from
that same intrinsic.  Just do it in the functions themselves.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20604>
2023-01-19 08:42:22 +00:00
Lionel Landwerlin
5ff3d4a8a2 anv: fix generated indirect draw shader stats checks
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Tested-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20776>
2023-01-19 07:36:19 +00:00
Tapani Pälli
4fd9bf6e7f intel/hasvk: remove some stale comments, wa was removed
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20783>
2023-01-19 06:37:20 +00:00
Francisco Jerez
f40e17059a intel/fs/gfx12+: Drop redundant handling of SHADER_OPCODE_BROADCAST in exec pipe inference.
Commit c80c0ed943 introduced handling of
SHADER_OPCODE_BROADCAST into inferred_exec_pipe(), but it was already
being handled, drop the redundant handling.  Shouldn't lead to any
functional changes.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20543>
2023-01-19 06:14:03 +00:00
Francisco Jerez
b867d1b851 intel/eu/gfx12+: Implement decoding of 64-bit immediates.
C.f. a12533f2ce.  The corresponding
change for the decoding path was never implemented so the disassembler
was printing incorrect immediate values.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20543>
2023-01-19 06:14:03 +00:00
Francisco Jerez
f80f29dc4b intel/disasm/gfx12+: Fix print out of non-existing condmod field with 64-bit immediate.
The conditional mode field doesn't exist for instructions with a
64-bit immediate, so this would currently print garbage.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20543>
2023-01-19 06:14:03 +00:00
Francisco Jerez
f3352745ad intel/disasm/gfx12+: Use helper instead of hardcoded bit access for 64-bit immediates.
So we don't have to duplicate code to handle differences in the
encoding of 64-bit immediates across platforms.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20543>
2023-01-19 06:14:03 +00:00
Francisco Jerez
4a2e7306dd intel/fs/gfx12: Ensure that prior reads have executed before barrier with acquire semantics.
This avoids a violation of the Vulkan memory model that was leading to
intermittent failures of at least 8k test-cases of the Vulkan CTS
(within the group dEQP-VK.memory_model.*) on TGL and DG2 platforms.
In theory the issue may be reproducible on earlier platforms like IVB
and ICL, but the SYNC.ALLWR instruction is not available on those
platforms so a different (likely costlier) fix will be needed.

The issue occurs within the sequence we emit for a NIR memory barrier
with acquire semantics requiring the synchronization of multiple
caches, e.g. in pseudocode for a barrier involving the TGM and UGM
caches on DG2:

 x <- load.ugm // Atomic read sequenced-before the barrier
 y <- fence.ugm
 z <- fence.tgm
 wait(y, z)
 w <- load.tgm // Read sequenced-after the barrier

In the example we must provide the guarantee that the memory load for
x is completed before the one for w, however this ordering can be
reversed with the intervention of a concurrent thread, since the UGM
fence will block on the prior UGM load and potentially take a long
time, while the TGM fence may complete and invalidate the TGM cache
immediately, so a concurrent thread could pollute the TGM cache with
stale contents for the w location *before* the UGM load has completed,
leading to an inversion of the expected memory ordering.

v2: Apply the workaround regardless of whether the NIR barrier
    intrinsic specifies multiple storage classes or a single one,
    since an acquire barrier is required to order subsequent requests
    relative to previous atomic requests of unknown storage class not
    necessarily specified by the memory scope information of the
    intrinsic.

Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20690>
2023-01-18 21:34:33 -08:00
Alyssa Rosenzweig
e664082d35 nir/lower_blend: No-op nir_color_mask if no mask
In this usual case, do a quick check to avoid generating 5 useless instructions
(mov/vec4 instructions). They'll get copypropped but that creates more work for
the optimizer and nir/lower_blend runs in a hot variant path on both Asahi and
Panfrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20016>
2023-01-19 04:09:17 +00:00
Alyssa Rosenzweig
1fc25c8c79 nir/lower_blend: Handle undefs in stores
nir/lower_blend asserts:

   assert(nir_intrinsic_write_mask(store) ==
          nir_component_mask(store->num_components));

For the special blend shaders used in Panfrost, this holds. But for arbitrary
shaders coming out of GLSL-to-NIR (as used with Asahi), this does not hold. In
particular, after nir_opt_undef runs, undefined components can be trimmed.
Concretely, if we have the shader:

    gl_FragColor.xyz = foo;

Then this becomes in NIR

   gl_FragColor = vec4(foo.xyz, undef);

and then opt_undef will give the store_deref a wrmask of xyz but 4 components.
Then lower_blend asserts out.

Found in a gfxbench shader on asahi.

Closes: #6982
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20016>
2023-01-19 04:09:17 +00:00
Alyssa Rosenzweig
8b83210ab3 nir/lower_blend: Don't do logic ops on pure float
Per the spec.

Fixes arb_color_buffer_float-render on both Panfrost and Asahi (before/after
reproduced on Mali-T860 and AGX G13 respectively). Without that patch, that test
fails the assertion:

arb_color_buffer_float-render: ../src/compiler/nir/nir_lower_blend.c:259: nir_blend_logicop: Assertion `util_format_is_pure_integer(format)' failed.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20016>
2023-01-19 04:09:17 +00:00
Alyssa Rosenzweig
dbd0615e7a nir/lower_blend: Avoid useless iand with logic ops
The upper bits start correctly, there's no need to clear them as long as we keep
them zero'ed by using ixor with a valid bit mask instead of inot.

Makes the code generated for logic op slightly less ridiculous. I'm joking. It's
still ridiculous but I'm not in the mood to fix up the Midgard compiler and it's
just a little ALU for a feature almost nothing uses.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20016>
2023-01-19 04:09:17 +00:00
Alyssa Rosenzweig
ee127f03e4 nir/lower_blend: Fix SNORM logic ops
We need to sign extend. Incidentally this means the iand above is useless for
SNORM.

Fixes arb_color_buffer_float-render with GL_RGBA8_SNORM.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20016>
2023-01-19 04:09:17 +00:00
Alyssa Rosenzweig
f9839e7e1b nir/lower_blend: Clamp blend factors
Particularly constant colours, but also (more obscurely) SNORM.

Fixes arb_color_buffer_float-render with SNORM framebuffers. Issue affects both
Asahi and Panfrost (the latter after we start advertising EXT_render_snorm).

v2: Check the blend factor to avoid unnecessary clamps. This avoids regressing
blend shader code quality on Panfrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com> [v1]
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20016>
2023-01-19 04:09:17 +00:00
Alyssa Rosenzweig
fca457790e nir/lower_blend: Fix alpha=1 for RGBX format
In this case we have 4 components but the value of the fourth component
is undefined. Apply the fixup we already have.

Fixes
dEQP-GLES3.functional.draw_buffers_indexed.random.max_implementation_draw_buffers.0
on Asahi. That test blend with DST_ALPHA with its RGB565 attachment,
which is fine if RGB565 is preserved, but Asahi is demoting that
format to RGBX8 which means -- after lowering the tilebuffer access --
we blend with an ssa_undef.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20016>
2023-01-19 04:09:17 +00:00
Caleb Cornett
97061dd7ee d3d12: Add support for Xbox GDK.
The big items in this patch:
- New screen file, to support the Xbox "windowing" system
- Lots of small macros/changes to support the Xbox D3D12 API without messing with the Win32 path too much
- A few changes to avoid requiring COM interfaces (the big one was QueryInterface which is unsupported)

Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
Co-authored-by: David Jacewicz <david.jacewicz@protonmail.com>
Co-authored-by: tieuchanlong <tieuchanlong@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19022>
2023-01-19 03:25:55 +00:00
Caleb Cornett
882a78b8ad wgl: Add support for Xbox GDK.
This patch is comprised of three main changes:
- Add a "shim" for GDI, since Xbox doesn't expose this library
- New framebuffer file, to support the Xbox "windowing" system
- Implement a custom WndProc hook for Xbox, since SetWindowsHookEx isn't supported either

Other than that, it's similar to the previous Xbox commits which mostly disable Win32-specific logic.

Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
Co-authored-by: David Jacewicz <david.jacewicz@protonmail.com>
Co-authored-by: tieuchanlong <tieuchanlong@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19022>
2023-01-19 03:25:55 +00:00
Caleb Cornett
75415e58e3 dxil_validator: Add support for Xbox GDK.
In addition to the DLL names being different, we don't have to do the versioning work since we don't have to fuss with known bad versions (for example).

Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
Co-authored-by: David Jacewicz <david.jacewicz@protonmail.com>
Co-authored-by: tieuchanlong <tieuchanlong@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19022>
2023-01-19 03:25:55 +00:00
Caleb Cornett
7588164717 util: Add #ifdefs for Xbox GDK support.
For the most part this just disables debug/console code, with the minor exception of u_memstream_open.

Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
Co-authored-by: David Jacewicz <david.jacewicz@protonmail.com>
Co-authored-by: tieuchanlong <tieuchanlong@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19022>
2023-01-19 03:25:55 +00:00
Caleb Cornett
d575fe8881 futex: Change INT_MAX to INT32_MAX.
Some platforms (i.e. Xbox) don't have INT_MAX, so use the stdint constant instead.

Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
Co-authored-by: David Jacewicz <david.jacewicz@protonmail.com>
Co-authored-by: tieuchanlong <tieuchanlong@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19022>
2023-01-19 03:25:55 +00:00
Paulo Zanoni
f9477770d8 anv: use vk_realloc for the anv_execbuf arrays
Three reasons for that:

0. The operation we're doing here is actually a reallocation.

1. The newer code is, IMHO, easier to read.

2. Realloc has this property where sometimes, when possible, it will
   expand your array without moving it somewhere else, so it doesn't
   need to copy the memory contents, returning the original pointer
   back to you. I did some analysis and while that case is not common,
   it does happen sometimes in real world applications (I could see it
   happening in Shootergame and Aztec Ruins, but not Dota 2), so we're
   able to save a few CPU cycles.

v2: Rebase.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20703>
2023-01-19 02:21:09 +00:00
Paulo Zanoni
6d4fc0e5bf anv: rename anv_execbuf->array_length to bo_array_length
Because this is counting the array length of the things related to the
BOs, just like syncobj_array_length is counting the array length of
the things related to syncobjs.

v2: Rebase.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20703>
2023-01-19 02:21:09 +00:00
Paulo Zanoni
e642cafdae anv: run buf_finish() if add_bo() fails during execute_simple_batch()
This is the only code path where we don't run anv_execbuf_finish() in
case anv_execbuf_add_bo() fails. While there is not a bug in the
current tree, I recently made an (uncommitted) modification that
started leaking memory and made me realize the lack of cleanup here.
If we had anv_execbuf_finish() being called upon error like we're
going to have after this patch my modification wouldn't have caused
the memory leak.

I think it's much safer and future-proof if we're able to operate
under the assumption that whatever is allocated and set to anv_execbuf
will be dealt with upon failure of anything else related to it, so
functions that fail should only be required to free pointers not yet
assigned to anv_execbuf.

The dEQP-VK 'alloc_callback_fail' tests should exercise this code
path. The one I was specifically using here is:
  dEQP-VK.api.object_management.alloc_callback_fail.device_group

v2: Rebase.

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20703>
2023-01-19 02:21:09 +00:00
Paulo Zanoni
3d37950fd9 anv: check the return value of anv_execbuf_add_bo_bitset()
Because anv_execbuf_add_bo_bitset() calls anv_execbuf_add_bo(), which
can fail if its memory allocations fail.

I have seen dEQP tests exercising memory allocation failures during
anv_execbuf_add_bo(), but I don't think the path coming from
add_bo_biset() was specifically exercised. Anyway, add the error check
just in case.

v2: Rebase.

Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20703>
2023-01-19 02:21:09 +00:00
Paulo Zanoni
ad6a036a68 anv: don't leave undefined values in exec->syncobj_values
In anv_execbuf_add_syncobj(), we try to not create or use
exec->syncobj_values if we don't need to. But when we figure we're
going to need it (i.e., when timeline_value is not zero), then we
create exec->syncobj_values with vk_zalloc, which means every previous
value is set to zero, as it should be. This is all correct.

The problem starts when we add a 16th element. In this case we double
exec->syncobj_array_length and realloc the buffer by using vk_alloc
and copying the old array to the new one. After that, we write the
timeline_value to the array only if it's not zero, and that's the
problem: since we just used vkalloc and memcpy, we don't have any
guarantees that the new array will be zero after the 16th element, and
if timeline_value is zero we write nothing to that position.

Once we start using exec->syncobj_values we have to commit to using
it, so the "if (timeline_value)" check near the end of the function
has to be changed to "if (exec->syncobj_values)", so we actually set
elements after the 16th to zero when they need to be zero.  Another
approach to fix this would be to memset the new elements once we
double syncobj_array_length.

In practice, I couldn't find any application or deqp test that used
more than 3 elements in exec->syncobj_array_length, and we need more
than 16 elements in order to be able to reproduce the bug, so I'm not
aware of any real-world bug that goes away with this patch. This issue
was found while reading code.

If we craft a little Vulkan program that submits a ton of timeline and
binary semaphores on vkQueueSubmit, then waits for them, we get the
following error without this patch:

MESA: error: ../../src/intel/vulkan/anv_batch_chain.c:1910: execbuf2 failed: Invalid argument (VK_ERROR_DEVICE_LOST)

v2: Rebase.

Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20703>
2023-01-19 02:21:09 +00:00
Thomas H.P. Andersen
fd3e8047d2 docs/panvk: VK_KHR_descriptor_update_template
Implemented in !14780

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18642>
2023-01-19 02:15:22 +00:00
Maíra Canal
86c9bdcd9a v3dv: remove unused clamp_to_transparent_black_border property
Commit e07c5467 ("v3dv/format: use XYZ1 swizzle for three-component formats")
removes the only code that handled the clamp_to_transparent_black_border
variable. Therefore, the variable can be deleted, as it is not currently
being used.

Fixes: e07c5467 ("v3dv/format: use XYZ1 swizzle for three-component formats")
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20746>
2023-01-19 02:02:16 +00:00
Emma Anholt
11669c96bc Revert "nouveau/ci: temporary disable gk20a-gles"
This reverts commit 8a1a3a31da.  The farm
should be back up, and I swear nginx startup is fixed for real this time.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20775>
2023-01-19 01:16:49 +00:00
David Heidelberg
f410a6d011 ci/intel: fully utilize asus-cx9400-volteer
We have 15 machines:
 * 12 for anv-tgl-vk
 * 1 for intel-tgl-skqp
 * 2 for zink-anv-tgl and zink-anv-tgl-traces

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20754>
2023-01-19 00:44:09 +00:00
David Heidelberg
fb876f64f1 ci/anv: add multiple fails uncovered by change of sharding
Another fail discovered by changing number of parallel jobs.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8109

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20754>
2023-01-19 00:44:09 +00:00
Joshua Peisach
257bb11332 gallum/asahi: fix memory leak in agx_resource_from_handle
Missing FREE(rsc)


Apply 1 suggestion(s) to 1 file(s)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20760>
2023-01-19 00:30:04 +00:00
Lionel Landwerlin
b82d9b1a3d nir/divergence: add missing RT intrinsinc handling
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20763>
2023-01-18 22:32:43 +00:00
Alyssa Rosenzweig
7e68cf91d7 mesa: Set info.separate_shader for ARB programs
ARB programs are logically separate, and Mesa will happily mix and match them.
We need to alert backends of this fact, by setting nir->info.separate_shader.
Otherwise, backends may link shaders invalidly.

Fixes fp-abs-01 on Bifrost. (We don't use separate_shader for anything on
Valhall, so the issue doesn't appear there.)

Compare 151aa19c21 ("ttn: Set nir->info.separate_shader"), which fixed a
similar issue with TGSI.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20688>
2023-01-18 21:06:03 +00:00
Emma Anholt
696069bc0d ci: Add some new folks to the restricted-traces access list.
They should now get pre-merge gated on the restricted traces passing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20771>
2023-01-18 20:34:17 +00:00
Pavel Ondračka
9db7c1a509 r300: remove backend negative addressing emulation
This is now handled in ntt.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20672>
2023-01-18 20:02:37 +00:00
Pavel Ondračka
7bec63c024 r300: set ubo_vec4_max ntt option properly
Besides making sure we don't overflow our reg index, this also prevents
constant folding resulting in negative relative offset in nir_opt_offsets.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20672>
2023-01-18 20:02:37 +00:00
Pavel Ondračka
cd18d541de ntt: pass ubo_vec4_max nir_opt_offsets flag through ntt options
This will be used by the r300 driver in the next commit.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20672>
2023-01-18 20:02:37 +00:00
Isaac Bosompem
4c0a54fc36 tool/pps: Fix 32-bit build issue with format string
Fixes a 32-bit build issue with Perfetto enabled.
Move the printf format specifier to use PRIx64 which
will be consistent regardless of the build type.

Signed-Off By: Isaac Bosompem <mrisaacb@google.com>

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20732>
2023-01-18 19:27:41 +00:00
Caleb Cornett
a32d6071e1 d3d12: Lower minimum supported Shader Model to 6.0
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20769>
2023-01-18 18:06:37 +00:00
Patrick Lerda
5e3ca1f97f lima: fix memory leak related to u_transfer_helper_create()
Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7fb6224340 in calloc (/usr/lib64/libasan.so.6.0.0+0xa4340)
    #1 0x7facfdd5a0 in u_transfer_helper_create ../src/gallium/auxiliary/util/u_transfer_helper.c:580
    #2 0x7facf2e09c in lima_resource_screen_init ../src/gallium/drivers/lima/lima_resource.c:935
    #3 0x7facf23af4 in lima_screen_create ../src/gallium/drivers/lima/lima_screen.c:746
    #4 0x7fac83ed30 in kmsro_drm_screen_create ../src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c:124

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20764>
2023-01-18 17:50:40 +00:00
Luigi Santivetti
926ba335fd pvr: add support for tile buffer output clear
Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20742>
2023-01-18 15:10:21 +00:00
Luigi Santivetti
96784f6cc1 pvr: fix uses_tile_buffers in clear color attachment
Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20742>
2023-01-18 15:10:21 +00:00
Pierre-Eric Pelloux-Prayer
027dd2c246 radeonsi/sqtt: implement offset workaround for gfx11
Based on PAL and Samuel's code from !20338.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20529>
2023-01-18 13:36:50 +00:00
Pierre-Eric Pelloux-Prayer
215babd3ca radeonsi/sqtt: update registers for gfx11
Based on registers delta and PAL.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20529>
2023-01-18 13:36:50 +00:00
Pierre-Eric Pelloux-Prayer
a3dc8b870d radeonsi/sqtt: disable SE1+ on GFX11
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20529>
2023-01-18 13:36:50 +00:00
Pierre-Eric Pelloux-Prayer
2e3dc3838e radeonsi/sqtt: don't read results for disabled SEs
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20529>
2023-01-18 13:36:50 +00:00
Samuel Pitoiset
f10f2c9bbb ac: add TC_OP_ATOMIC_SUB_32
This will be used by SQTT to implement a workaround on GFX11

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20529>
2023-01-18 13:36:50 +00:00
Alejandro Piñeiro
50bb7745ca v3dv: enable shaderStorageImageReadWithoutFormat
Note that as we are enabling the feature, we need to set the
VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHR for any format
that supports STORAGE_IMAGE_BIT, from spec:

   "An implementation that supports
   VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT for any format from the given
   list of formats and supports shaderStorageImageReadWithoutFormat
   must support VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT
   for that same format if Vulkan 1.3 or the
   VK_KHR_format_feature_flags2 extension is supported."

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20744>
2023-01-18 13:09:57 +00:00
Alejandro Piñeiro
b56be4c37e broadcom/compiler: treat PIPE_FORMAT_NONE as 32-bit formats for output type
Needed to support Vulkan feature shaderStorageImageReadWithoutFormat.

With that enabled we could receive a NONE format on a load image. For
those we treat them as 32-bit formats, that would mean that the
lowering would not need to do any format-specific unpacking.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20744>
2023-01-18 13:09:57 +00:00
Alejandro Piñeiro
41a081380a broadcom/compiler: v3d_nir_lower_txf_ms doesn't need v3d_compile
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20744>
2023-01-18 13:09:57 +00:00
Kenneth Graunke
a6c6a4ad04 intel/blorp: Lower base_workgroup_id to zero
We don't use a base workgroup ID for BLOCS.  It needs to be lowered, or
else we'll assert fail when compiling the compute shader.

(Note for stable: this patch doesn't fix a bug in 4abdecce22
specifically, but rather is a missing patch that needed to go along with
the rest of MR 20068, on whichever branches it exists on.)

Fixes: 4abdecce22 ("iris: Lower load_base_workgroup_id to zero")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20750>
2023-01-18 12:21:03 +00:00
Amber
a6ac4cbae8 freedreno: add support for markers.
Signed-off-by: amber@igalia.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20727>
2023-01-18 10:53:36 +00:00
Amber
ab9dd18b68 util/u_trace: pass utrace context to marker functions.
This is needed later by freedreno in order to get
more device information in trace functions.

Signed-off-by: amber@igalia.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20727>
2023-01-18 10:53:36 +00:00
Konstantin Seurer
c7fc30421c radv: Advertise rt pipelines for Control (DX12)
The game has been working on radv since basically forever.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20729>
2023-01-18 09:58:24 +00:00
Erik Faye-Lund
0429f11dfb zink: remove depth_clip_control_missing workaround
The ANV bug this was meant to represent has been long fixed, and the
workaround has just been a proxy for EXT_depth_clip_control for a while
now.

Let's simplify things a bit, by removing this flag.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20740>
2023-01-18 09:31:06 +00:00
Erik Faye-Lund
c12fed1804 zink: fix depth-clip disable cap
We use EXT_depth_clip_enable for this, not EXT_depth_clip_control, which
is what depth_clip_control_missing is a proxy for.

Fixes: 721f33cd0f ("zink: fix return for PIPE_CAP_DEPTH_CLIP_DISABLE")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20740>
2023-01-18 09:31:06 +00:00
Erik Faye-Lund
09a87d2171 zink: whitespace fixup
This just cleans up some indentation, no functional changes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20745>
2023-01-18 09:11:54 +00:00
Samuel Pitoiset
84241b1f75 ac/nir: clear unused components before storing XFB outputs to LDS
Shader variables don't always exactly match intrinsics and they might
contain unused slots.

Fixes a bunch of regressions with RADV_PERFTEST=ngg_streamout on RDNA2,
and also fixes RDNA3 NGG streamout.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8099
Fixes: cd22bf90e7 ("ac/nir/ngg: refine nogs outputs handling")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20735>
2023-01-18 07:38:44 +00:00
Mike Blumenkrantz
e39bf3e6aa zink: skip implicit feedback loop layout changes if feedback loop not present
if a resource is bound as both a framebuffer attachment and a sampler but
isn't actually used as a sampler, it's just a framebuffer attachment, and it
should retain its layout as a framebuffer attachment without any barriers

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20674>
2023-01-18 07:20:58 +00:00
Mike Blumenkrantz
9ba0657903 zink: make implicit feedback loop application stricter
in many cases, a texture may be bound as both a framebuffer attachment
and a samplerview without the latter actually being used by a shader

this avoids unnecessary feedback loop tagging, which should improve
perf and avoid spurious warning messages on drivers that don't support
the feedback loop ext

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20674>
2023-01-18 07:20:58 +00:00
Mike Blumenkrantz
230a554719 zink: outdent code in add_implicit_color_feedback_loop()
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20674>
2023-01-18 07:20:58 +00:00
Mike Blumenkrantz
487e5cc781 zink: set textures_used in analyze_io
this is otherwise not usable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20674>
2023-01-18 07:20:58 +00:00
Mike Blumenkrantz
9a9c17cd49 zink: break out implicit feedback loop detection into separate function
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20674>
2023-01-18 07:20:58 +00:00
Rob Clark
6f91a5ab07 freedreno: Restore GL_VENDOR string
We cannot change this, as it has already been communicated to app
partners.  Also this breaks chrome's GPU quirk matching (which in some
cases is non-gpu-related, but when all you have is a hammer, everything
looks like a nail).

Fixes: 9c1fbc076a ("Return 'Mesa' for GL_VENDOR for community drivers")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20757>
2023-01-18 07:00:48 +00:00
Dave Airlie
589d4ff0cb vulkan/format: add a 10-bit video format
This adds support to the generic vulkan format code for
VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16
which is used for 10-bit H265.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
(Updated version acked by Lynne on irc)

v2: disable these for freedreno

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20389>
2023-01-18 06:36:27 +00:00
Dave Airlie
41dbeca4c2 vulkan/video: add common h264/h265 parameter set management code.
The video session and video session parameters objects can have a common
base class the drivers can inherit from if needed.

This creates code to parse the h264/h265 parameter sets into common
structs.

v2: add h265 VPS, add a macro for FIND/ADD generations, changes the API
to make generation easier.

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20389>
2023-01-18 06:36:27 +00:00
Rob Clark
0c30e0fa00 freedreno/a6xx: Expose SSBO/image for all shader stages
Now that we've removed the limitation of a single bindful IBO state, we
can expose IBO support on all shader stages.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
a93d3f1498 freedreno/a6xx: Move tex state building
Now that it is only called from fd6_texture, move it there where it more
rightly belongs.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
a16c99a9a5 freedreno/a6xx: Move compute to tex state group
This lets compute shaders hit the shader state cache as well, and
unifies 3d and cs state emit allowing for more code sharing.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
b17ad0657f freedreno/a6xx: Remove tex fb_read state
Now that fb_read is using a bindless descriptor slot, we can remove the
dependency of the TEX state on the PROG state.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
f6b6400254 freedreno/a6xx: Removing munging of tex state for IBO
Now that we use bindless descriptors for SSBO/image, lowering to isam
means we can use the existing descriptor.  Avoiding the need to smash in
extra bindful sampler state.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
549a8d206a freedreno/a6xx: Remove bindfull IBO state
Now that it is unused.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
ce1e73f441 freedreno/a6xx: Switch over to bindless IBO
This allows support for SSBOs/images in all shader stages.  And also,
unlike the bindful IBO state, does not introduce a dependency on the
program state.  With bindless descriptors, SSBO and image fetch lowered
to isam can re-use the same descriptor.  This will let us remove the
TEX state dependency on PROG state (in a following cleanup commit).

Note, this does not yet switch the pipe caps to reflect that we can
support SSBOs/images in other shader stages.. because ir3 still tells us
nibo>0 even though we are using bindless and that triggers an assert in
the build_ibo() path.  Probably we want ir3 to be more clever.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
e51975142c freedreno/a6xx: Add bindless state
This will be used when we switch over to lowering image/SSBO to
bindless.

Note that it also starts using CP_SET_DRAW_STATE in the compute path.
Subsequent cleanup will switch texture and eventually other state over
as well (which will make more sense when we get more clever than
emitting all state for every compute grid, but for now simplifies
re-using the same code between 3d and compute).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
101700b150 freedreno/a6xx: Pre-bake IBO descriptor sets
Pre-bake IBO descriptor sets at the time that images/SSBOs are bound,
and re-use the pre-baked descriptors at draw time when we emit state.

This starts putting in place the state tracking we'll use when switching
over to bindless IBO state, without yet changing the shaders (lowering
to bindless) or changing the actual state emitted (other than switching
to use the storage descriptor for image reads via isam, like tu does).

Note that this even pre-bakes the iova into the descriptor, rather than
relying on OUT_RELOC() to do the bo tracking, so we need to manually
attach the bo to the ring.  But we already require FD_BO_NO_HARDPIN for
a6xx.  This makes the state emit a straight memcpy, and will simplify
things when it comes to generating the bindless descriptor set (which
due to the desc_size field in the low bits of the BINDLESS_BASE regs
would be awkward to construct as a ring rather than a bo).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
a45d111c18 freedreno/ir3: Add descriptor set lowering
Add support to lower IBO (image/SSBO) and fb-read to use bindless
descriptors.  This will be used by a6xx to avoid having to merge image
and SSBO state into a single compact IBO descriptor, and also simplify
enabling image and SSBO support for additional shader stages (since each
stage can use it's own descriptor set).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
066ff5c759 freedreno: Track image/SSBO usage for all stages
Once a6xx enables image/SSBO for all shader stages, we have to care
about more than just frag shader in the 3d path.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
165de87f8e freedreno/ir3: Let driver specify fb-read descriptor
Let the driver control where the shader should look for fb-read
descriptor.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Rob Clark
4982adb4cf freedreno/ir3: Stop copying options
Just copy the entire ir3_compiler_options into ir3_compiler, to make it
easier to add new options.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20687>
2023-01-18 06:10:10 +00:00
Qiang Yu
db2497f205 radeonsi: update nir xfb info after medium io lowering
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19489>
2023-01-18 05:30:14 +00:00
Qiang Yu
49cfbe1fed nir/xfb_info: nir_gather_xfb_info_from_intrinsics update nir xfb_info
Use this function to update nir_shader->xfb_info.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19489>
2023-01-18 05:30:14 +00:00
Qiang Yu
b6c172f26c gallium/aux: remove nir_helpers
Not used by anyone.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19489>
2023-01-18 05:30:14 +00:00
Qiang Yu
1590817977 radeonsi: move gfx10_ngg_export_vertex to si_shader_llvm.c
It's now also used by non-ngg pipeline and older GPUs.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19489>
2023-01-18 05:30:14 +00:00
Qiang Yu
1475339543 radeonsi: replace llvm legacy gs code with nir lowering
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19489>
2023-01-18 05:30:14 +00:00
Qiang Yu
6219374c4e radeonsi: remove llvm gs copy shader generate
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19489>
2023-01-18 05:30:14 +00:00
Qiang Yu
e007c7fa6f radeonsi: replace llvm gs copy shader generation with nir
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19489>
2023-01-18 05:30:14 +00:00
Qiang Yu
246630ac98 radeonsi: build legacy gs output info when shader compile
To be used by both legacy gs lowering and gs copy shader
generation.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19489>
2023-01-18 05:30:14 +00:00
Qiang Yu
2b0566f672 radeonsi: add nir implementation of gs copy shader generation
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19489>
2023-01-18 05:30:14 +00:00
Qiang Yu
89aa75f81c radeonsi: use ac_nir_lower_legacy_vs to replace si_llvm_vs_build_end
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19489>
2023-01-18 05:30:13 +00:00
Qiang Yu
acde71c015 radeonsi: use nir_print_xfb_info to replace si_dump_streamout
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19489>
2023-01-18 05:30:13 +00:00
Qiang Yu
def3f700bc radeonsi: lower nir streamout intrinsics in abi
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19489>
2023-01-18 05:30:13 +00:00
Qiang Yu
743fbc4bb0 radeonsi: implement nir_load_ring_gs2vs_offset_amd
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19489>
2023-01-18 05:30:13 +00:00
Qiang Yu
16cf743f2d radeonsi: implement nir_load_ring_gsvs_amd
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19489>
2023-01-18 05:30:13 +00:00
Emma Anholt
8aff228127 ci: Enable building the testing drivers with perfetto.
We've talked about being able to capture perfetto traces from CI jobs for
a while, and this would be a step toward that.  Mostly it's that we
occasionally break the perfetto build, so let's make sure we don't do
that.

Acked-by: Rob Clark <robdclark@chromium.org>
Acked-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20660>
2023-01-18 05:04:46 +00:00
Emma Anholt
64455dc32b freedreno/pps: Fix a signed/unsigned complaint.
../src/freedreno/ds/fd_pps_driver.cc:656:44: error: comparison of integer expressions of different signedness: '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and 'const unsigned int' [-Werror=sign-compare]
  656 |             assert(d->assigned_counters[i] < g->num_counters);
cc1plus: all warnings being treated as errors

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20660>
2023-01-18 05:04:46 +00:00
Emma Anholt
302858c48c ci/freedreno: Add glx-swap-event-async as a flake.
It's only happened a few times in the last year (used to be more popular),
but it just took out a merge.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20660>
2023-01-18 05:04:46 +00:00
Emma Anholt
327f736627 freedreno: Skip CPU/GPU timestamp sync when not supported.
Fixes immediate segfaults in perfetto-enabled builds on pre-a6xx.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20660>
2023-01-18 05:04:46 +00:00
Emma Anholt
79bbfb3168 ci/zink: Add more blit conversion xfails for a618.
Popular cases in this group recently:

      1 dEQP-GLES3.functional.fbo.blit.conversion.r16ui_to_r16ui
      1 dEQP-GLES3.functional.fbo.blit.conversion.r16ui_to_rgb10_a2ui
      1 dEQP-GLES3.functional.fbo.blit.conversion.rgb5_a1_to_rgb5_a1
      3 dEQP-GLES3.functional.fbo.blit.conversion.rgba4_to_r32f
      4 dEQP-GLES3.functional.fbo.blit.conversion.rgb565_to_rgba8
      5 dEQP-GLES3.functional.fbo.blit.conversion.rgba4_to_rg16f

There's pretty clearly something common with blitting from 16-bit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20759>
2023-01-18 04:43:59 +00:00
Emma Anholt
c4c94e8aed ci/iris: Generalize the 8888_pbuffer EGL known flakes and share with GLK.
It seems to be this whole group of tests, on both boards that run EGL
tests by default (aml-y is manual-only).  Make them a regex until someone
comes up with a fix.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20759>
2023-01-18 04:43:59 +00:00
Emma Anholt
6dc90009a5 ci/iris: Add known flakes for skqp.
We've had a lot more jobs run since I landed the CI, and these seem to be
the common flakes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20759>
2023-01-18 04:43:59 +00:00
Emma Anholt
c34b539e17 ci/llvmpipe: Drop dEQP-EGL.functional.sharing.*.link.7 flakes.
These appear to have been resolved by !20458 -- went from typically
multiple per day to none since then.  The link.19 fails to seem to still
happen, though.

Closes: #7759
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20759>
2023-01-18 04:43:59 +00:00
Jason Ekstrand
d292cb82b8 gallium,util: Pull u_indices and u_primconvert back into gallium
This was moved in !13741 but doing so created a link-time dependency
between util and gallium which causes problems for Vulkan drivers.
Meanwhile, having mesa/main depend on gallium is fine now that we don't
have any classic drivers.  It's a bit circular but should be harmless.

Fixes: 97ba2f2fd4 ("move util/indices to core util")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8098
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20734>
2023-01-18 03:53:30 +00:00
Ikshwaku Chauhan
fe3b467eb9 radeonsi: Fix distortion for yuv422 format for GFX10.
For yuv422 format camera show blur output for GFX10.

Signed-off-by: Ikshwaku Chauhan <ikshwaku.chauhan@amd.com>
Reviewed-by: Marek Olšák marek.olsak@amd.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20610>
2023-01-18 01:44:15 +00:00
Corentin Noël
5348704820 ci/venus: Remove failure now passing
It has been fixed either in the CTS or in llvmpipe itself but this now passes when running
in CI.

We haven't seen it in CI yet as we are only running a subset of the Vulkan CTS.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20743>
2023-01-17 23:56:45 +00:00
Mike Blumenkrantz
dc8c9d2056 zink: prune old swapchains on present
pruning old swapchains is challenging because there's no way to definitively
know when to destroy them without VK_EXT_swapchain_maintenance1 which isn't
supported yet

initially, I handled it by only pruning on shutdown and whenever a new swapchain
was created since those are both safe points, but this leads to scenarios where
a dead swapchain can exist for the entire lifetime of an application
if the swapinterval is changed

to avoid such ballooning, check whether the current swapchain has ever presented
on each present queue and then prune based on this

fixes #7529

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20588>
2023-01-17 23:21:58 +00:00
Emma Anholt
6b0db6bf8b dri2: Fix exposing robustness with swkms.
In the original change I noticed that missing robustness on swkms seemed
to be an oversight, since it was enabled on sw-non-kms, so I exposed the
ext based on the underlying pipe query.  However it turns out that there
is a dri_screen flag for allowing robust contexts that exists to do error
checking for GLX, which was under an !swkms check.  So we would expose the
ext, but then throw an error if you tried to create one.

Fixes: e6285ea55f ("egl: Replace the robustness DRI2 ext check with a pipe cap query.")
Closes: #8066
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20679>
2023-01-17 21:19:18 +00:00
Jesse Natalie
ca8c8f2fc1 dzn: Remove cmdbuf query 'wait' list
From the Vulkan spec, the WAIT flag on vkCmdCopyQueryPoolResults only
serves to increase the first synchronization scope to include query end
commands, but either way, the synchronization scope only includes
commands that occur earlier in submission order. In other words, we
don't need to enforce queue ordering, a pipeline barrier is all that's
needed.

Fixes deadlocks in the timestamp.misc_tests.two_cmd_buffers_primary test.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20617>
2023-01-17 20:17:42 +00:00
Jesse Natalie
261102bd9c dzn: Fix format support checks for storage/uniform texel buffers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20617>
2023-01-17 20:17:42 +00:00
Jesse Natalie
0069ac9e6e dzn: Disable depth when the rasterizer is disabled due to no position output
D3D considers the rasterizer enabled if there's a pixel shader *or* if
depth is enabled, since you can do depth-only rendering. After parsing
shaders, if we find that there was supposed to be a pixel shader, but
we removed it because there was no output position, disable depth too.

Also, store this info in the cache, since we might not even load the
nir shaders if we'd seen this pipeline before.

Fixes dEQP-VK.synchronization.internally_synchronized_objects.pipeline_cache_graphics

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20617>
2023-01-17 20:17:42 +00:00
Jesse Natalie
682605a99b dzn: Add a zeroed zsa state when depth or raster is disabled
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20617>
2023-01-17 20:17:42 +00:00
Jesse Natalie
25d460a818 dzn: Always align cached pipeline header size to input element align
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20617>
2023-01-17 20:17:42 +00:00
Jesse Natalie
4565490b71 dzn: Support unnormalized coordinate samplers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20617>
2023-01-17 20:17:42 +00:00
Jesse Natalie
552ab9c2f7 dzn: Support root signature 1.2
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20617>
2023-01-17 20:17:42 +00:00
Jesse Natalie
1e0adac84a dzn: Define a symbol that was present in older D3D headers
D3D12_BARRIER_SYNC_INPUT_ASSEMBLER was renamed to D3D12_BARRIER_SYNC_INDEX_INPUT,
so conditionally define the old name based on the version of the headers that are
being used.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20617>
2023-01-17 20:17:42 +00:00
EmperorPenguin18
3eb33ec9e9 v3d: expose more drm formats with SAND128 modifier
Adds four more PIPE_FORMATs that expose BROADCOM_SAND128. This allows mpv
to do hardware decoding on the Raspberry Pi 4.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7944
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20510>
2023-01-17 19:57:28 +00:00
Rob Clark
aac66fe039 freedreno/a6xx: Rework barrier handling
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20575>
2023-01-17 19:32:13 +00:00
Rob Clark
63e889516d freedreno: Don't re-install a flushed batch
The compute path does this save/restore dance with the current batch, so
various things called to emit state can assume ctx->batch is the current
thing.  But during resource tracking, which could have flushed what was
previously the current batch.  Fixes a problem that surfaces in the next
patch when we stop just flushing batches for all the barriers.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20575>
2023-01-17 19:32:13 +00:00
Rob Clark
aa9b62cad3 freedreno/a6xx: Workaround for no pos/psize
The hw seems unhappy if there are zero outputs from the last geometry
stage.  So add a dummy varying as a workaround.  Turnip got a similar
workaround in commit d6d75fcd91 ("tu: Fix hangs for DS with no output")

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20575>
2023-01-17 19:32:13 +00:00
Rob Clark
e41d19a711 freedreno: Fix tracking of enabled SSBOs
Clearing all of the modified bits an relying on OR'ing the needed bits
back in the loop below doesn't quite work out, Because of early continue
if the SSBO has not changed.

Fixes: 0ed053f03d ("freedreno: simplify fd_set_shader_buffers(..)")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20575>
2023-01-17 19:32:13 +00:00
Rob Clark
ca2011d11c freedreno/drm: Remove assert
We can hit this scenario if there is a GPU hang before the userspace
fence writeback happens.  Since we have asserts enabled in CI, just
remove this assert.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20575>
2023-01-17 19:32:13 +00:00
Gert Wollny
adee0e7e53 r600/sfn: Do a bit of cleanup with the secondary read port validation
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20739>
2023-01-17 19:19:01 +00:00
Gert Wollny
ca5bbff558 r600/sfn: Fix readport check
We have to take multi-slot instructions into account, and we don't fail
when there are still possible bank swizzle values to be checked.

For clarity also rename the bank swizzle iterator iterator.

Fixes: 79ca456b48
   r600/sfn: rewrite NIR backend

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20739>
2023-01-17 19:19:01 +00:00
Rhys Perry
42d51ef2bb radv/gfx11: expose shaderBufferFloat32AtomicAdd
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19810>
2023-01-17 17:39:15 +00:00
Rhys Perry
7dd16791ca radv: load ssbo_atomic_fadd descriptor
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19810>
2023-01-17 17:39:15 +00:00
Rhys Perry
068c84f275 aco: add support for fp32 addition atomics
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19810>
2023-01-17 17:39:15 +00:00
Rhys Perry
ea1ac3901a ac/llvm: add support for fp32 addition atomics
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19810>
2023-01-17 17:39:15 +00:00
José Roberto de Souza
e879b28994 anv: Move anv_device_check_status() code to i915/anv_device.c
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Rohan Garg <rohan.garg@intel.com>
Acked-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20428>
2023-01-17 17:10:18 +00:00
José Roberto de Souza
94af444490 anv: Split i915 code from anv_batch_chain.c
There is no change in behavior here.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Rohan Garg <rohan.garg@intel.com>
Acked-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20428>
2023-01-17 17:10:18 +00:00
José Roberto de Souza
94ca73b356 anv: Export anv_exec_batch_debug() and chain_command_buffers()
This functions will be used by i915 and Xe KMD.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Rohan Garg <rohan.garg@intel.com>
Acked-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20428>
2023-01-17 17:10:18 +00:00
José Roberto de Souza
80c89c4606 anv: Start to move i915 specific code from anv_device to i915/anv_device
More code re-organization to separate i915_drm.h specific code from
the rest.

No behavior changes here.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Rohan Garg <rohan.garg@intel.com>
Acked-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20428>
2023-01-17 17:10:18 +00:00
Gert Wollny
8084b412ca virgl: drop the separable flag for cases that can't be handled
The host can't assign more than 32 locations explicitly, and we
exhaust this already when we handle patches and generics. So
drop the separable flag in cases when we have other IO that
uses generated names that will have to be matched by name.

v2: skip tests for VS input and FS outputs

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20738>
2023-01-17 16:58:52 +00:00
Rob Clark
aa7c83786d freedreno/ci: Add an a618 flake
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20749>
2023-01-17 16:33:29 +00:00
Rob Clark
a7a46556ec Revert "freedreno/ci: Switch a630 jobs over to manual"
This reverts commit 0cc3701338.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20749>
2023-01-17 16:33:29 +00:00
Rob Clark
23e6d0ce79 Revert "freedreno/ci: Switch also performance a630 job to manual"
This reverts commit 3be7a28b24.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20749>
2023-01-17 16:33:29 +00:00
Lionel Landwerlin
f9115b6d51 intel: use a shared UUID with other drivers
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20408>
2023-01-17 17:36:07 +02:00
Tapani Pälli
53de48f1c4 intel/compiler: add cpp_std=c++17 when building tests
Otherwise build fails:

"../src/intel/compiler/brw_private.h:40:4: note:
 ‘std::variant’ is only available from C++17 onwards"

Fixes: 6c194ddd18 ("intel/compiler: Prepare SIMD selection helpers to handle different prog_datas")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20725>
2023-01-17 13:58:03 +00:00
Gert Wollny
d59e5aa08f virgl: Request setting the atomic offset in the range_base
With that NTT can encode the array base of atomic arrays separately
so that the host driver can address the arrays correctly.

Fixes GL-CTS: KHR-Single-GL43.arrays_of_arrays_gl.AtomicUsage

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19980>
2023-01-17 13:19:04 +00:00
Gert Wollny
994cf0e995 virgl: lower image variable offsets into the intrinsic range_base value
With that we get the correct base offset when accessing image arrays.
This is required if there a various images with different access
specifiers, because only with the correct base offset the host driver is
able to pick the right array.

Fixes GL-CTS: KHR-GL43.shading_language_420pack.binding_image_array

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19980>
2023-01-17 13:19:04 +00:00
Gert Wollny
7380656a8c ntt: Make use of the range_base offset when translating atomics in NTT
v2: Unconditionally add teh range base, it is properly initialized.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19980>
2023-01-17 13:19:04 +00:00
Gert Wollny
36f19058ae ntt: handle the image intrinsic range_base when translating to TGSI
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19980>
2023-01-17 13:19:04 +00:00
Gert Wollny
2e05cfa179 nir: Add range_base to atomic_counter and an option to use it
Some drivers may encode constant offsets in the instruction, so
make it possible for the drivers to request lowering the atomic
uniform offset into the range_base variable of the intrinsic.

v2: drop patch to use build-in array offset evaluation, it makes
    problems with zink, and update the code accordingly
v3: always initialize range base

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19980>
2023-01-17 13:19:04 +00:00
Gert Wollny
c4cde91c1b nir: Add possibility to store image var offset in range_base
Add the intrinsic range_base value to the image intrinsics and add
the option to store the image array offset into range_base instead
of adding it to the image array index if the driver requests it.

v2: Always initialize range_base

v3: fix for bindless intrinsics

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19980>
2023-01-17 13:19:04 +00:00
Jesse Natalie
2f4c7b5ccf dzn: Use typeless format for creation of depth-only or stencil-only D24S8
When querying capabilities or creating views using a scoped aspect
mask, we want to return the format for the correct single-channel
format, but when actually creating the resource (aspect mask 0),
we want to use the typeless format, since the single-channel formats
don't report multisampling support.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
9f928adf81 dzn: Set MultisampleEnable to enable MSAA lines
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
ca20577622 dzn: Storage buffer sizes need to be 4-byte-aligned
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
b948a5db4f dzn: Support int border colors
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
10282bbd96 dzn: Use R24G8_TYPELESS for 24/8 depth resources
This is the same that was already being done for R32G8X24, not sure
why it was missed for R24G8.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
a3005ecb56 dzn: When changing root signature, dirty descriptors too
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
14f0c85874 dzn: Support alpha blend factor
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
aa3fc8753d dzn: Get options13
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
22eb9b1c12 spirv2dxil: Replace not-provided inputs with zero instead of undef
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
61c391781e spirv2dxil: Allow killing position as an undef varying
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
3ddf41cb7d spirv2dxil: When removing unused inputs, make sure they're actually inputs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
00b9c10cf7 spirv2dxil: For removing unused vars, consider the whole I/O var size
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
85f44304d8 microsoft/compiler: Set num_components to 4 when updating pos write instructions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
5d8e89f92f microsoft/compiler: Use nir info.fs.uses_sample_shading to force sample-rate
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
cbc481f39f microsoft/compiler: Re-work the logic for adding SV_SampleIndex to force sample-rate
Only add SV_SampleIndex if there exists a sample-rate var that has either flat
interpolation or centroid (and therefore can't force sample rate implicitly),
unless there is also a sample-rate var that doesn't have those properties.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
b151ed4b95 microsoft/compiler: Always emit float types in the I/O signature for structs
There's VK tests that have mismatching interpolation specifiers between FS
and the previous stage. For structs, that resulted in different types, which
breaks DXIL validation.

We could link the shaders and have that overwrite the interpolation field from
the previous shader, but we could also just not care and always use float.
I don't see any regressions from that.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
c1a3d6b9a9 microsoft/compiler: Remove arrays when testing for structs in I/O
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
c86bd4bfbc microsoft/compiler: Implement texture sample count query
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Jesse Natalie
47481e8151 microsoft/compiler: Lower pack_[u/s]norm_2x16
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20614>
2023-01-17 12:47:16 +00:00
Simon Fels
4a0aeae371 virgl/vtest: allow socket being specified by env variable
Signed-off-by: Simon Fels <simon.fels@canonical.com>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20736>
2023-01-17 12:02:38 +00:00
Simon Fels
501309ef32 venus: allow vtest socket being specified by env variable
Signed-off-by: Simon Fels <simon.fels@canonical.com>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20736>
2023-01-17 12:02:38 +00:00
Illia Polishchuk
530a62ce73 hasvk: Add extra memory types for hasvk driver instead of a single one
Replicates a fix from Anv.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Illia Polishchuk <illia.a.polishchuk@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7360
Tested-by: Matti Hämäläinen <ccr@tnsp.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20720>
2023-01-17 10:48:20 +00:00
Illia Polishchuk
8491b1fd5e ANV: Add extra memory types for ANV driver instead of a single one
Some game engines can't handle single type well
And Intel on Windows uses 3 types so it's better to add extra one here

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7360
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Illia Polishchuk <illia.a.polishchuk@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20693>
2023-01-17 07:41:52 +00:00
Dave Airlie
83a1d56faa ci: bump vk cts to 1.3.3.1 + and a crash fix.
With the video changes some crashes were introduced in CTS,
apply the fix.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20629>
2023-01-17 04:23:08 +00:00
Thong Thai
bb003d406e gallium/auxiliary/vl: clean-up progressive shader
Add the progressive shader to the vl_compositor_cs_cleanup_shaders
function.

Signed-off-by: Thong Thai <thong.thai@amd.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8086
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8088
Tested-by: Mark Herbert <mark.herbert42@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20730>
2023-01-16 22:48:26 +00:00
Alyssa Rosenzweig
f02354d3e2 pan/mdg: Remove MSGS debug
These should all be unreachable and what's left is dead-code.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19350>
2023-01-16 22:20:43 +00:00
Alyssa Rosenzweig
23968aeeb5 pan/mdg: Scalarize LUT instructions in NIR
Simpler. Small shaderdb regressions from using IR registers instead of
SSA, but that's probably what we needed for correctness (given that SSA
is violated otherwise) hence the Cc.

total instructions in shared programs: 1520220 -> 1518127 (-0.14%)
instructions in affected programs: 167437 -> 165344 (-1.25%)
helped: 662
HURT: 206
helped stats (abs) min: 1.0 max: 46.0 x̄: 3.65 x̃: 2
helped stats (rel) min: 0.18% max: 22.22% x̄: 2.43% x̃: 1.71%
HURT stats (abs)   min: 1.0 max: 7.0 x̄: 1.56 x̃: 1
HURT stats (rel)   min: 0.17% max: 8.33% x̄: 2.66% x̃: 2.33%
95% mean confidence interval for instructions value: -2.65 -2.18
95% mean confidence interval for instructions %-change: -1.45% -0.99%
Instructions are helped.

total bundles in shared programs: 649844 -> 649345 (-0.08%)
bundles in affected programs: 59278 -> 58779 (-0.84%)
helped: 577
HURT: 249
helped stats (abs) min: 1.0 max: 39.0 x̄: 1.56 x̃: 1
helped stats (rel) min: 0.26% max: 30.00% x̄: 3.13% x̃: 2.19%
HURT stats (abs)   min: 1.0 max: 12.0 x̄: 1.61 x̃: 1
HURT stats (rel)   min: 0.58% max: 25.00% x̄: 5.25% x̃: 4.00%
95% mean confidence interval for bundles value: -0.78 -0.43
95% mean confidence interval for bundles %-change: -0.98% -0.23%
Bundles are helped.

total quadwords in shared programs: 1136767 -> 1134956 (-0.16%)
quadwords in affected programs: 141780 -> 139969 (-1.28%)
helped: 744
HURT: 311
helped stats (abs) min: 1.0 max: 9.0 x̄: 3.13 x̃: 2
helped stats (rel) min: 0.14% max: 26.67% x̄: 2.77% x̃: 2.13%
HURT stats (abs)   min: 1.0 max: 8.0 x̄: 1.68 x̃: 1
HURT stats (rel)   min: 0.35% max: 10.00% x̄: 3.17% x̃: 1.69%
95% mean confidence interval for quadwords value: -1.89 -1.54
95% mean confidence interval for quadwords %-change: -1.27% -0.77%
Quadwords are helped.

total registers in shared programs: 90461 -> 90273 (-0.21%)
registers in affected programs: 2833 -> 2645 (-6.64%)
helped: 250
HURT: 82
helped stats (abs) min: 1.0 max: 2.0 x̄: 1.08 x̃: 1
helped stats (rel) min: 6.67% max: 33.33% x̄: 14.06% x̃: 12.50%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 6.67% max: 50.00% x̄: 13.90% x̃: 12.50%
95% mean confidence interval for registers value: -0.67 -0.47
95% mean confidence interval for registers %-change: -8.62% -5.69%
Registers are helped.

total threads in shared programs: 55685 -> 55686 (<.01%)
threads in affected programs: 76 -> 77 (1.32%)
helped: 20
HURT: 17
helped stats (abs) min: 1.0 max: 2.0 x̄: 1.30 x̃: 1
helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00%
HURT stats (abs)   min: 1.0 max: 2.0 x̄: 1.47 x̃: 1
HURT stats (rel)   min: 50.00% max: 50.00% x̄: 50.00% x̃: 50.00%
95% mean confidence interval for threads value: -0.47 0.52
95% mean confidence interval for threads %-change: 5.81% 56.35%
Inconclusive result (value mean confidence interval includes 0).

total spills in shared programs: 1387 -> 1379 (-0.58%)
spills in affected programs: 283 -> 275 (-2.83%)
helped: 5
HURT: 1

total fills in shared programs: 5256 -> 5176 (-1.52%)
fills in affected programs: 557 -> 477 (-14.36%)
helped: 5
HURT: 1

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19350>
2023-01-16 22:20:43 +00:00
Alyssa Rosenzweig
10759d1708 pan/mdg: Use special NIR ops for trig scaling
Otherwise the lowering is fundamentally unsound due to incorrect constant
folding, even though it worked by chance with the old pass ordering. We're about
to change slightly the way we handle fsin/fcos, which was enough to trigger this
unsoundness.

shader-db results are mostly a toss-up.

total instructions in shared programs: 1520675 -> 1520220 (-0.03%)
instructions in affected programs: 96841 -> 96386 (-0.47%)
helped: 397
HURT: 3
helped stats (abs) min: 1.0 max: 4.0 x̄: 1.15 x̃: 1
helped stats (rel) min: 0.22% max: 6.25% x̄: 1.15% x̃: 0.40%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 0.58% max: 2.08% x̄: 1.08% x̃: 0.58%
95% mean confidence interval for instructions value: -1.19 -1.08
95% mean confidence interval for instructions %-change: -1.26% -1.01%
Instructions are helped.

total bundles in shared programs: 650088 -> 649844 (-0.04%)
bundles in affected programs: 31132 -> 30888 (-0.78%)
helped: 229
HURT: 23
helped stats (abs) min: 1.0 max: 4.0 x̄: 1.21 x̃: 1
helped stats (rel) min: 0.49% max: 7.14% x̄: 1.28% x̃: 0.71%
HURT stats (abs)   min: 1.0 max: 3.0 x̄: 1.48 x̃: 1
HURT stats (rel)   min: 0.83% max: 8.33% x̄: 2.38% x̃: 1.85%
95% mean confidence interval for bundles value: -1.08 -0.86
95% mean confidence interval for bundles %-change: -1.15% -0.74%
Bundles are helped.

total quadwords in shared programs: 1137388 -> 1136767 (-0.05%)
quadwords in affected programs: 71826 -> 71205 (-0.86%)
helped: 367
HURT: 17
helped stats (abs) min: 1.0 max: 8.0 x̄: 1.80 x̃: 1
helped stats (rel) min: 0.31% max: 17.24% x̄: 2.27% x̃: 0.96%
HURT stats (abs)   min: 1.0 max: 6.0 x̄: 2.29 x̃: 2
HURT stats (rel)   min: 0.44% max: 11.11% x̄: 2.18% x̃: 1.47%
95% mean confidence interval for quadwords value: -1.76 -1.47
95% mean confidence interval for quadwords %-change: -2.36% -1.78%
Quadwords are helped.

total registers in shared programs: 90483 -> 90461 (-0.02%)
registers in affected programs: 890 -> 868 (-2.47%)
helped: 67
HURT: 44
helped stats (abs) min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
helped stats (rel) min: 8.33% max: 25.00% x̄: 10.52% x̃: 9.09%
HURT stats (abs)   min: 1.0 max: 2.0 x̄: 1.02 x̃: 1
HURT stats (rel)   min: 9.09% max: 50.00% x̄: 31.15% x̃: 33.33%
95% mean confidence interval for registers value: -0.39 -0.01
95% mean confidence interval for registers %-change: 1.75% 10.25%
Inconclusive result (value mean confidence interval and %-change mean confidence interval disagree).

total threads in shared programs: 55694 -> 55685 (-0.02%)
threads in affected programs: 21 -> 12 (-42.86%)
helped: 1
HURT: 5
helped stats (abs) min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00%
HURT stats (abs)   min: 2.0 max: 2.0 x̄: 2.00 x̃: 2
HURT stats (rel)   min: 50.00% max: 50.00% x̄: 50.00% x̃: 50.00%
95% mean confidence interval for threads value: -2.79 -0.21
95% mean confidence interval for threads %-change: -89.26% 39.26%
Inconclusive result (%-change mean confidence interval includes 0).

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19350>
2023-01-16 22:20:43 +00:00
Alyssa Rosenzweig
c3839bd540 nir: Optimize vendored sin/cos the same way
As we've done for the AMD one, to prevent any codegen regression from switching
the Midgard lowering.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19350>
2023-01-16 22:20:43 +00:00
Alyssa Rosenzweig
a49ba0f1ae nir: Add Midgard-specific fsin/fcos ops
NIR has a fsin instruction that takes an argument in radians. Midgard instead
has an fsinpi argument that takes an argument in multiples of pi. So, we had a
NIR pass that would change fsin(x) to fsin(x / pi) and then map fsin to fsinpi
in the backend.

But that's invalid! In NIR, the opcode fsin is well-defined. fsin(x) means
something very different than fsin(x / pi). They won't usually be equal. The
transform fsin(x) -> fsin(x / pi) is fundamentally unsound.

It did work before, by accident. Most NIR passes don't care about the semantics
of ALU instructions.  fsin(x) and fsin(x / pi) are both well-defined but
fundamentally different NIR shaders. So while rewriting is wrong -- the NIR we
get out is not equivalent to the NIR we put in, and the Midgard ops we generate
are not equivalent to the NIR -- but if we don't run any passes that care about
the definition of fsin the two wrongs will cancel out to make a right.

However, some NIR passes do care about the definitions of ALU instructions,
instead of treating them as named black boxes. In particular, constant folding
(nir_opt_constant_fold) evaluates ALU instructions when their inputs are
constants, according to the definition in nir_opcodes.py. So our little charade
will only work if we don't call nir_opt_constant_fold, or if all the fsin
instructions have non-constant inputs. At the beginning of this series, that is
the case. With the later scalarization change, that's no longer the case, and
the unsoundness translates to real failing tests rather than a quibble of NIR's
semantics.

To mitigate, we define a new NIR opcode with the semantics we want and translate
fsin(x) = fsin_mdg(x / pi), where that equivalence does hold mathematically. So
the new translation is sound and doesn't rely on lucky pass ordering.

This matches the approach already used for AMD and AGX, which have fsin_amd and
fsin_agx opcodes respectively.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19350>
2023-01-16 22:20:43 +00:00
Pavel Ondračka
e86c7ac9f4 r300: remove backend input range transformation for sin and cos
We already do this in NIR since a04aa4bc08
and 3f97306b95 so there is no effect
for the mesa state tracker now that it can not emit TGSI any more.
This leaves only nine when RADEON_DEBUG=use_tgsi is set. D3D9 however
requires that sin and cos inputs already have the proper range.

This is super important when the nine shader uses relative adressing
and therefore needs all 256 constants we have. If we add our extra
constants for the fixup, we get over the limit and fail compilation.

v2: vertex shaders only

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18933>
2023-01-16 19:57:13 +00:00
Pavel Ondračka
d8f59b14d0 r300: skip sin/cos input range transformation for nine and ntt
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18933>
2023-01-16 19:57:13 +00:00
Pavel Ondračka
0b21d3ae6c r300: update rv515 ci failures list
This fix missed in 421bf657bf where it was
updated only for R480.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20666>
2023-01-16 19:46:05 +00:00
Timur Kristóf
faba30a8f3 aco/optimizer: Optimize p_extract + v_mul_u32_u24 to v_mad_u32_u16.
This should perform the same but removes SDWA from the address
calculations in NGG culling shaders for example.

This is done because SDWA is no longer available on GFX11.

Fossil DB stats on GFX1100:
Totals from 36 (0.03% of 134913) affected shaders:
CodeSize: 300968 -> 300884 (-0.03%); split: -0.04%, +0.01%
Instrs: 60955 -> 60863 (-0.15%); split: -0.15%, +0.00%
Latency: 426809 -> 426819 (+0.00%); split: -0.06%, +0.06%
InvThroughput: 39076 -> 39025 (-0.13%); split: -0.14%, +0.01%
VClause: 1440 -> 1443 (+0.21%)
Copies: 5714 -> 5725 (+0.19%)

Fossil DB stats on GFX1100 with NGG culling enabled:
Totals from 60953 (45.18% of 134913) affected shaders:
VGPRs: 2273172 -> 2273160 (-0.00%)
CodeSize: 186401864 -> 186403036 (+0.00%); split: -0.00%, +0.00%
Instrs: 37038048 -> 36977353 (-0.16%); split: -0.16%, +0.00%
Latency: 146466770 -> 146350172 (-0.08%); split: -0.08%, +0.00%
InvThroughput: 15342790 -> 15228585 (-0.74%); split: -0.74%, +0.00%
VClause: 669662 -> 669665 (+0.00%)
Copies: 2972380 -> 2972482 (+0.00%); split: -0.01%, +0.01%

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17924>
2023-01-16 19:27:39 +00:00
Timur Kristóf
171d76ded1 aco/optimizer: Add missing v_lshlrev condition to can_apply_extract.
This was already handled by apply_extract but missing from
can_apply_extract, therefore may not be properly applied everywhere.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17924>
2023-01-16 19:27:39 +00:00
Adam Jackson
04ac0ec148 wsi/x11: Support depth 16 visuals
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7846
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20673>
2023-01-16 18:01:08 +00:00
Adam Jackson
37a8b2d12e wsi/x11: Infer the default surface format from the root window's visual
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20673>
2023-01-16 18:01:08 +00:00
Adam Jackson
4a7ffd9162 wsi/x11: Make get_sorted_vk_formats handle varying channel widths
Depths 24 and 30 happen to have uniform bpc but 16 does not. Pull the
real channel width out of the format description instead. This is still
a bit ignorant of channel order though.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20673>
2023-01-16 18:01:08 +00:00
Rhys Perry
aa6b2ec46a ac/nir: use store_buffer_amd's base index
This allows ACO to combine the addition into the store without checking
for wraparound.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20296>
2023-01-16 17:25:51 +00:00
Rhys Perry
39c214769b aco: restore semantic_can_reorder for GS output stores
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20296>
2023-01-16 17:25:51 +00:00
Rhys Perry
18d3e4fecd radv,aco: use ac_nir_lower_legacy_gs
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20296>
2023-01-16 17:25:51 +00:00
Rhys Perry
c7cedaaee2 radv: implement GS load_ring_gsvs_amd/load_ring_gs2vs_offset_amd
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20296>
2023-01-16 17:25:51 +00:00
Alyssa Rosenzweig
dfd6157d6c panfrost: Document render_condition_check contract
This was implicit before, leading to the bug fixed in the previous commit.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20689>
2023-01-16 17:11:19 +00:00
Alyssa Rosenzweig
02f9cddb61 panfrost: Fix clears with conditional rendering
batch can be invalidated by the render condition check.

Fixes nv_conditional_render-clear.

Fixes: 638b22354e ("panfrost: Clear with a quad to avoid flushing")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20689>
2023-01-16 17:11:19 +00:00
Alyssa Rosenzweig
7c7c38b126 panfrost: Remove unused debug parameter
We removed this path.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20707>
2023-01-16 16:57:47 +00:00
Alyssa Rosenzweig
ea03d0652d panfrost: Remove PAN_MESA_DEBUG=deqp
Now unused.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20707>
2023-01-16 16:57:46 +00:00
Alyssa Rosenzweig
46051049a6 panfrost: Stop testing CAP_INT16
This doesn't look like it'll be fixed any time soon. No point running dEQP with
different flags than production, IMO.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20707>
2023-01-16 16:57:46 +00:00
Lucas Stach
c966b06736 etnaviv: don't drop TS capability on GPUs with MMUv2
Currently etnaviv disables TS on all MC1.0 GPUs, since the TS unit
doesn't properly take into account the linear window offset with
MC1.0, creating address aliases on MMUv1 that aren't properly dealt
with.

MMUv2 however doesn't have a linear window, so we can safely enable
TS on those GPUs.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20552>
2023-01-16 16:43:03 +00:00
Juston Li
3b69b67545 util/fossilize_db: add runtime RO foz db loading via FOZ_DBS_DYNAMIC_LIST
Add a new environment varible
MESA_DISK_CACHE_READ_ONLY_FOZ_DBS_DYNAMICE_LIST that specifies a text
file containing a list of RO fossilize caches to load. The list file
is modifiable at runtime to allow for loading RO caches after
initialization unlike MESA_DISK_CACHE_READ_ONLY_FOZ_DBS.

The implementation spawns an updater thread that uses inotify to monitor
the list file for modifications, attempting to load new foz dbs added to
the list. Removing files from the list will not evict a loaded cache.

MESA_DISK_CACHE_READ_ONLY_FOZ_DBS_DYNAMIC_LIST takes an absolute path.
The file must exist at initialization for updating to occur.

File names of foz dbs in the list file are new-line separated and take
relative paths to the default cache directory like
MESA_DISK_CACHE_READ_ONLY_FOZ_DBS.

The maximum number of RO foz dbs is kept to 8 and is shared between
MESA_DISK_CACHE_READ_ONLY_FOZ_DBS_DYNAMIC_LIST and
MESA_DISK_CACHE_READ_ONLY_FOZ_DBS.

The intended use case for this feature is to allow prebuilt caches
to be downloaded and loaded asynchronously during app runtime.
Prebuilt caches be large (several GB) and depending on network
conditions would otherwise present extended wait time for caches
to be availible before app launch.
This will be used in Chrome OS.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19328>
2023-01-16 16:15:45 +00:00
Juston Li
eea2033b3e utils/fossilize_db: refactor out loading RO foz dbs
Move loading of RO foz dbs into its own load_ro_foz_dbs() function

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19328>
2023-01-16 16:15:45 +00:00
Juston Li
483ee5d6ba util/fossilize_db: don't destroy foz on RO load fail
When loading multiple RO foz dbs, if a db fails to load, continue trying
to load other RO foz dbs instead of destroying the foz cache.

Preserve destroying the foz cache and not preceding to load RO caches
if the RW cache fails to load.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19328>
2023-01-16 16:15:45 +00:00
Juston Li
4c19426fd6 docs/envvars: add missing mesa disk cache envvars
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19328>
2023-01-16 16:15:45 +00:00
Alyssa Rosenzweig
41d99c10d1 panfrost: Fix logic ops on Bifrost
opaque should not be set when logicops are enabled, that needs blending
even on Bifrost. Fixes is for when I believe the bug became possible to hit.
The logical error is older.

Fixes Piglit logicop tests again.

Fixes: d849d9779a ("panfrost: Avoid blend shader when not blending")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20685>
2023-01-16 16:02:23 +00:00
Alyssa Rosenzweig
fe4dc59e99 panfrost: Enable NV_primitive_restart on Valhall
Unlike literally every other mesa/st emulation, for some inexplicable reason we
need to pretend to support the CAP and then set a different EMULATE cap instead
of the emulation keying off the lack of support for the CAP. Set the CAPs
accordingly so we get NV_primitive_restart (with emulation of non-fixed
indices).

This gets Mesa to advertise GL 3.1 on Mali-G57 as intended.

Fixes: 30c14f54cf ("panfrost: Disable PIPE_CAP_PRIMITIVE_RESTART on v9")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20702>
2023-01-16 15:46:16 +00:00
Alyssa Rosenzweig
2f97883276 pan/bi: Add a unit test for fsat(reg.yx)
This would have caught the issue from the previous commit. Split out to make
backporting the previous change less onerous.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20683>
2023-01-16 15:29:38 +00:00
Alyssa Rosenzweig
ed46c617b0 pan/bi: Fix incorrect compilation of fsat(reg.yx)
Future changes to nir_lower_blend cause fsat(reg.yx) instructions to be
generated, which correspond to "FCLAMP.v2f16 x.h10" pseudoinstructions. These
get their swizzles lowered, but we forgot to clear the swizzle out, so we end up
with extra swap (cancelling out the intended swizzle).

Fix the lowering logic.

Fixes: ac636f5adb ("pan/bi: Use FCLAMP pseudo op for clamp prop")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20683>
2023-01-16 15:29:38 +00:00
Eric Engestrom
c672b593b9 bin/ci: add gitlab_gql.py.cache to the .gitignore
On my machine, the filecache doesn't have the extra `.db` suffix, just `.cache`.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20722>
2023-01-16 15:27:38 +00:00
Friedrich Vock
684eee0748 radv/bvh: Prevent NANs when computing node cost
Otherwise the degenerate geometry workaround never triggers, leading to bad performance.

Fixes: 6f45c98b ("radv/bvh: Adjust sah cost based on depth")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20723>
2023-01-16 14:49:54 +00:00
Alejandro Piñeiro
4c7caa6211 v3dv: skip two ycbcr tests
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Ella Stanforth
18319a236c v3dv: add support for multi-planar formats, enable YCbCr
Original patches wrote by Ella Stanforth.

Alejandro Piñeiro main changes (skipping the small fixes/typos):
  * Reduced the list of supported formats to
    VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM and
    VK_FORMAT_G8_B8R8_2PLANE_420_UNORM, that are the two only
    mandatory by the spec.
  * Fix format features exposed with YCbCr:
    * Disallow some features not supported with YCbCr (like blitting)
    * Disallow storage image support. Not clear if really useful. Even
      if there are CTS tests, there is an ongoing discussion about the
      possibility to remove them.
    * Expose VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT, that is
      mandatory for the formats supported.
    * Not expose VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT. Some
      CTS tests are failing right now, and it is not mandatory. Likely
      to be revisit later.
    * We are keeping VK_FORMAT_FEATURE_2_DISJOINT_BIT and
      VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT. Even if they
      are optional, it is working with the two formats that we are
      exposing. Likely that will need to be refined if we start to
      expose more formats.
  * create_image_view: don't use hardcoded 0x70, but instead doing an
    explicit bit or of VK_IMAGE_ASPECT_PLANE_0/1/2_BIT
  * image_format_plane_features: keep how supported aspects and
    separate stencil check is done. Even if the change introduced was
    correct (not sure about that though), that change is unrelated to
    this work
  * write_image_descriptor: add additional checks for descriptor type,
    to compute properly the offset.
  * Cosmetic changes (don't use // for comments, capital letters, etc)
  * Main changes coming from the review:
     * Not use image aliases. All the info is already on the image
       planes, and some points of the code were confusing as it was
       using always a hardcoded plane 0.
     * Squashed the two original main patches. YCbCr conversion was
       leaking on the multi-planar support, as some support needed
       info coming from the ycbcr structs.
     * Not expose the extension on Android, and explicitly assert that
       we expect plane_count to be 1 always.
  * For a full list of review changes  see MR#19950

Signed-off-by: Ella Stanforth <estanforth@igalia.com>
Signed-off-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Alejandro Piñeiro
2ef614a2d8 v3dv/image: use 64-byte alingment for linear images if needed
When used for transfer, the image could be used eventually as a
Texture Base Address, that needs to be 64-byte aligned.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Alejandro Piñeiro
aa31d38bcf v3dv: pass alignment to v3dv_buffer_init
Although for any buffer created by the user, or any API that can be
called by the user (like GetDeviceBufferMemoryRequirements) the
alignment is V3D_NON_COHERENT_ATOM_SIZE, there are internal uses of a
buffer that could require a fine-grained alignment (like when used as
a alias for a image, that has different alignment requirements).

Note that an alternative would have created a
v3dv_buffer_init_with_alignment (or similar name), but this option
seemed easier.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Alejandro Piñeiro
77f4885ccb v3dv/pipeline: rename lower_tex_src_to_offset to lower_tex_src
Less confusing this way.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Alejandro Piñeiro
98e6effadd v3dv/format: remove unused v3dv_get_tex_return_size
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Iago Toral Quiroga
36ec3d6fe3 v3dv: add paths to handle partial copies of linear images
v2:
   * Removed unneeded copy_image_linear_buffer
   * Add tiling/image-type check on copy_image_blit

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Jason Ekstrand
b39958a3a1 anv,nir: Move the ANV YCbCr lowering pass to common code
Nir changes:
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>

Anv changes:

Acked-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Jason Ekstrand
f02a11e4e4 nir: Add copyright and include guards to nir_vulkan.h
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Jason Ekstrand
2ac771973d anv: Use the YCbCr format info from common code
We still maintain our own table of formats but all of the conversion and
sampling info we pull from common code.

Acked-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Jason Ekstrand
30a91d333d anv: Use the common vk_ycbcr_conversion object
Acked-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Jason Ekstrand
1cc342f5e1 vulkan: Add a common vk_ycbcr_conversion struct
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Jason Ekstrand
5eaf8218de vulkan/formats: Add YCbCr format information
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Jason Ekstrand
04e7ebea5d util/format: YUYV and UYVY have 4 8-bit channels
They're all packed and weird but this is more accurate than saying they
have a single x32 blob of data.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Jason Ekstrand
18feb32df0 anv/android: Use VkFormat for externalFormat
Using a pointer to an internal data structure works but it's a bit
sketchy.  Since every anv_format maps to a VkFormat, we may as well
just use the VkFormat.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Jason Ekstrand
9fc046a87d anv: Refactor Android externalFormat handling in CreateYcbcrConversion
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19950>
2023-01-16 14:10:21 +00:00
Lionel Landwerlin
4121aa43c4 Revert "ci: build hasvk if we're building anv"
This reverts commit b4d3d11e43.

We're seeing problems on the builders running the hasvk tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20726>
2023-01-16 13:39:37 +00:00
Alejandro Piñeiro
b27e42dcb5 vulkan/wsi: check if image info was already freed
We set the different data being freed to NULL after freeing it, and
checks for NULL before freeing it.

This fixes several double free crash with v3dv, when running OOM wsi
tests, like for example:
dEQP-VK.wsi.xlib.swapchain.simulate_oom.composite_alpha

Although note that only one person got those on a new fresh install of
the Raspbian OS, so this problem was rare.

Fixes: 5b13d74583 ("vulkan/wsi/drm: Break create_native_image in pieces")
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20695>
2023-01-16 13:01:52 +00:00
Matt Coster
6b8dab7de2 pvr: Add support for geometry-only render jobs
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20545>
2023-01-16 12:48:37 +00:00
Matt Coster
85155e389e pvr: Extract setup of winsys job submit flags into separate functions
Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20545>
2023-01-16 12:48:37 +00:00
Iago Toral Quiroga
9bf525b4bd broadcom/compiler: produce better code for f2f16 with RTZ rounding
Suggested by Georg Lehmann, this generates far less code and should
be more correct.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8090
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20721>
2023-01-16 12:03:24 +01:00
Pierre-Eric Pelloux-Prayer
a48642400b ac: don't call ac_query_pci_bus_info from ac_query_gpu_info
Instead let each driver call it.

radeonsi ignores the error because it doesn't require correct
pci-bus info to work properly.

radv keeps the existing behavior and fails if the pci-bus infos
is missing.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20645>
2023-01-16 10:27:15 +01:00
Pierre-Eric Pelloux-Prayer
6f533c4ee2 ac: add ac_query_pci_bus_info helper
No functional changes.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20645>
2023-01-16 10:27:15 +01:00
Pierre-Eric Pelloux-Prayer
91b0cc3fe3 ac/info: move pci bus info in a struct
And add a validity flag because there's no way to
tell if they're valid, unless for the caller of
drmGetDevice2.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20645>
2023-01-16 10:27:15 +01:00
Pierre-Eric Pelloux-Prayer
7893369c2e radeonsi: simplify dpbb settings
Use only 2 sets of parameters and add some debug variables
to ease tweaking them when testing.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20645>
2023-01-16 09:41:30 +01:00
David Heidelberg
3be7a28b24 freedreno/ci: Switch also performance a630 job to manual
Fixes: 0cc3701338 ("freedreno/ci: Switch a630 jobs over to manual")

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20716>
2023-01-16 00:53:38 +00:00
David Heidelberg
0886df2491 ci/zink: Penumbra is now fixed.
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20718>
2023-01-16 00:30:21 +00:00
Vinson Lee
6986332c80 radv: Fix memory leak.
Fix defect reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable page going out of scope leaks the storage it points to.

Fixes: 8d0e6c02c7 ("radv: Add RMV tracing utilities")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20711>
2023-01-15 23:55:40 +00:00
Friedrich Vock
eab2c39951 radv/rt: Divide by the correct workgroup size
Improves build performance by around 25%.

Fixes: 9369b407 ("radv: Use PLOC for BVH building")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20717>
2023-01-15 23:33:33 +00:00
Gert Wollny
0ca325cc10 glsl/nir: only set uses_sample_shading when the output is a fbfetch
Constructs like

  out vec4 fs_out;
  ....
  fs_out = vec4(...);
  if (fs_out.w < alpha_test_value)
     discard;

lead to initial nir that reads from fs_out, even though we don't actually
do a framebuffer fetch, and later nir passes will eliminate that direct
read from the output variable. As given in the commit message of 1124bee4
we are actually only interested in the framebuffer fetch, so set the
property only when an output is used for fbfetch reads.

v2: Iterate over all variables (Jason)

Fixes: commit 1124bee4ba
  glsl/nir: Set sample_shading if a FS output ever shows up as an rvalue

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20694>
2023-01-15 22:04:15 +00:00
Konstantin Seurer
03105138f1 radv/rt: Get rid of accel struct null checks
Quake II RTX ray queries:

Totals from 7 (14.29% of 49) affected shaders:
CodeSize: 167220 -> 165560 (-0.99%)
Instrs: 31674 -> 31454 (-0.69%)
Latency: 385145 -> 596737 (+54.94%)
InvThroughput: 78837 -> 122005 (+54.76%)
Copies: 4740 -> 4667 (-1.54%); split: -1.60%, +0.06%
Branches: 1565 -> 1493 (-4.60%)
PreSGPRs: 488 -> 501 (+2.66%); split: -0.41%, +3.07%
PreVGPRs: 617 -> 620 (+0.49%)

Performance stays the same.

Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20539>
2023-01-15 21:30:21 +00:00
Konstantin Seurer
33166ba50b radv: Use the null accel struct instead of emitting 0
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20539>
2023-01-15 21:30:21 +00:00
Konstantin Seurer
31ca19589f radv: Create a null TLAS as meta state
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20539>
2023-01-15 21:30:21 +00:00
Konstantin Seurer
6d06964f8a radv: Add a helper for finding memory indices
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20539>
2023-01-15 21:30:21 +00:00
Konstantin Seurer
2d738803b5 vulkan: Track the nullDescriptor feature
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20539>
2023-01-15 21:30:21 +00:00
Rob Clark
274e1d5a39 freedreno/ci: Add a618 egl/skqp/piglit jobs
Clone the existing a630 jobs and expectations.  This should give us a6xx
coverage to make up for the offline a630 runners.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20715>
2023-01-15 10:17:37 -08:00
Rob Clark
23e9fe5d53 freedreno/ci: Cleanup a618 yaml
De-duplicate GPU_VERSION/VK_DRIVER and add different jobs that can be
extended for limozeen vs kingoftown runners in order to de-duplicate the
DEVICE_TYPE/DTB/RUNNER_TAG variables.  This should simplify moving jobs
between runners to load-balance.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20715>
2023-01-15 10:17:37 -08:00
Rob Clark
0cc3701338 freedreno/ci: Switch a630 jobs over to manual
The a630 runners are not responding atm, so switch the jobs to manual
for the time being.

Note the other fd-farm runners are responding fine, which is why I
didn't take the entire farm offline.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20715>
2023-01-15 10:17:08 -08:00
Christian Gmeiner
4fb2463a37 etnaviv: nir: use lower_fround_even
The generated asm is not as good as the one from the binary blob but
does its job.

Passes: dEQP-GLES3.functional.shaders.operator.common_functions.round*.*

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20709>
2023-01-15 11:19:05 +01:00
Alyssa Rosenzweig
5fdfd8044d panfrost: Don't use AFBC of sRGB luminance-alpha
This isn't allowed for the same reason that AFBC of regular luminance-alpha
isn't allowed (and will raise DATA_INVALID_FAULTs). Reorder the checks to
ensure these formats are checked.

Fixes Piglit texwrap GL_EXT_texture_sRGB-s3tc.

Fixes: 476be5cb27 ("panfrost: Don't use texture format swizzles on v7")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20686>
2023-01-14 20:00:37 +00:00
Mike Blumenkrantz
48a0478126 zink: add renderdoc handling
renderdoc won't work with zink in frontends that aren't dri,
so ZINK_RENDERDOC should be used to specify start:end frames
to ensure that the vulkan command stream is captured

this is not a renderdoc issue: there are no frame boundaries in rusticl
or gallium-nine, so there is no possible way that renderdoc could
determine when/how to split frames

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20651>
2023-01-14 18:15:48 +00:00
Juston Li
7e52bd7b18 venus: vn_queue: align vulkan object variable naming
Per Yiwei:
"For vn_QueueSubmit and other exposed Vulkan entry points, we keep the
original Vulkan variable namings. If within the same function you need
to use struct vn_queue *queue, then we prefix a _ to the args in the
exposed entry points, so it becomes VkQueue _queue.

For all other places:

VkObject obj_handle
struct vn_object *obj

The obj in this file can be queue, fence, sem, event, cmd, dev, etc."

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>
2023-01-14 00:51:56 +00:00
Juston Li
32660a41ea venus: refactor QueueSubmit/QueueSubmit2
Refactor the QueueSubmit functions to share a common function differing
in the vkQueueSubmit/vkQueueSubmit2 call with differences with
VkSubmitInfo/VkSubmitInfo2 handled in the
vn_queue_submission_prepare_submit().

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>
2023-01-14 00:51:56 +00:00
Juston Li
6863092d95 venus: append fence feedback batch
Instead of calling an additional QueueSubmit for fence feedback, append
a SubmitInfo batch for fence feedback. This does require copying the
submitted batches to a larger buffer with an additional slot for the
fence feedback batch.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>
2023-01-14 00:51:56 +00:00
Juston Li
2889a0478b venus: drop VkQueueBindSparse
Sparse binding is already disabled with fence feedback enabled by
default due to the difficulty getting both to work.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>
2023-01-14 00:51:56 +00:00
Juston Li
3b107962a2 venus: remove filtering external semaphores for QueueSubmit
We now require VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT for
external semaphores.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>
2023-01-14 00:51:56 +00:00
Juston Li
f6ffb5ac36 venus: require exportable/importable bit for ext semaphores sync fd
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>
2023-01-14 00:51:56 +00:00
Juston Li
31e7471be2 venus: require exportable bit for ext fence sync fd
Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>
2023-01-14 00:51:55 +00:00
Juston Li
75e369335f venus: require importable external semaphores for WSI
Semaphore sync fd import required for WSI to skip scrubbing
the wsi/external wait semaphores.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>
2023-01-14 00:51:55 +00:00
Juston Li
f09cc33dfb venus: refactor VK_KHR_synchronization2 ext sync fd requirements
In preparation for adding additional dependency requirements for
external sync fd support.

Move vn_physical_device_init_external_* so external sync fd support can
be retrieved earlier. Then move sync2 disabling to
vn_physical_device_get_passthrough_extensions and 1.3 downgrading
to vn_physical_device_init_properties.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>
2023-01-14 00:51:55 +00:00
Juston Li
72371af332 venus: refactor out vn_feedback_event_cmd_record2
Refactor out vn_feedback_event_cmd_record2 into a shared functon
that downgrades pipeline barrier commands for non synchronization2
commands.

Signed-off-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20088>
2023-01-14 00:51:55 +00:00
Vincent Davis Jr
842ca28465 gbm/backend: fix gbm compile without dri
Commit introduces a fix that allows for gbm to be built with an empty
backend. There are situation especially in a Yocto/OE cross compilation
environment where you want to build with an empty backend. The particular
situation is as such:

The mesa-gl recipe is the preferred provider for virtual/libgbm, virtual/libgl,
virtual/mesa, etc... But the x11 DISTRO_FEATURE in't included this leads to build
errors such as:

| /../../../ld: src/gbm/libgbm.so.1.0.0.p/main_backend.c.o: in function `find_backend':
| backend.c:(.text.find_backend+0xa4): undefined reference to `gbm_dri_backend'
| /../../../ld: src/gbm/libgbm.so.1.0.0.p/main_backend.c.o:(.data.rel.ro.builtin_backends+0x4):
                undefined reference to `gbm_dri_backend'
| collect2: error: ld returned 1 exit status

Issue should be replicable by setting -Ddri3=disabled and -Dgbm=enabled

Add fix to bypasses compilation issue by excluding gbm dri backend. If
HAVE_DRI || HAVE_DRIX not specified.

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Vincent Davis Jr <vince@underview.tech>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20447>
2023-01-13 22:29:29 +00:00
Jesse Natalie
f1faf30a5f dzn: Fix clear bind flag logic
This is the patch I had meant to merge

Fixes: 8b79e6fb ("dzn: No need to add another bind flag for clears if one is already present")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20361>
2023-01-13 21:55:41 +00:00
Jesse Natalie
5949521508 dzn/ci: Add image test group, which is all passing now
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20361>
2023-01-13 21:55:41 +00:00
Jesse Natalie
889f03fc24 dzn/ci: Remove flakes/fails that don't hit anymore
The fails weren't causing pipeline failures because the tests just
aren't run, thanks to the dEQP fraction.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20361>
2023-01-13 21:55:41 +00:00
Jesse Natalie
9f9a58eb95 ci/windows: Download updated WARP 1.0.4 package
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20361>
2023-01-13 21:55:41 +00:00
Adam Jackson
a5a19903ab mesa: Trivially advertise NV_generate_mipmap_sRGB
... if you have EXT_framebuffer_sRGB. The extension just relaxes an
error check that we're already not performing, and sRGB rendering
implies sRGB texture support, and mipmap generation would need it to be
a valid render format. So advertise it if EXT_framebuffer_sRGB works.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19476>
2023-01-13 20:53:16 +00:00
Adam Jackson
2aad8dbfa5 mesa: Fix extension table formatting
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19476>
2023-01-13 20:53:16 +00:00
Jason Ekstrand
d3feccfa6f radv: Use the new NIR builder tex helpers for meta
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19480>
2023-01-13 20:25:01 +00:00
Jason Ekstrand
433fe592ac nir/builder: Add some texture helpers
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19480>
2023-01-13 20:25:01 +00:00
Jason Ekstrand
30f3fec380 nir: Add more opcodes to nir_tex_instr_is_query()
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19480>
2023-01-13 20:25:01 +00:00
Adam Jackson
7d8b90a470 glx: Harmonize glXCreateGLXPixmap with glXCreatePixmap
This was open-coding some things, and not perfectly. Likewise for the
destroy path.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20549>
2023-01-13 19:59:26 +00:00
Adam Jackson
2cc3763d04 glx: Fix drawable type inference in visual/fbconfig setup
This was just all kinds of wrong. Note that the comment implying "this
is a workaround for old XQuartz" is on the "not apple" side of the
ifdef. Anyway. xserver didn't start sending GLX_DRAWABLE_TYPE in the
fbconfig until:

    commit 8cde0af3c57f0375ba8ba77af9fdf74b79d9496d
    Author: Kristian Høgsberg <krh@redhat.com>
    Date:   Wed Apr 2 19:06:40 2008 -0400

        Send the GLX_EXT_texture_from_pixmap attributes to the client.

So we can remove this default from the fbconfig path. But we preserve it
for the GLXGetVisualConfigs path, because that is specified not to send
GLX_DRAWABLE_TYPE.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20549>
2023-01-13 19:59:26 +00:00
Adam Jackson
86c9a31d99 glx: Inline a few single-use constant strings into their user
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20549>
2023-01-13 19:59:26 +00:00
Adam Jackson
07292d6e76 glx: Move 1.2 GLXPixmap code into glx_pbuffer.c
We're going to rename this file to something like glx_drawable.c
eventually, but for right now let's just get all the create/destroy calls
in the same place.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20549>
2023-01-13 19:59:26 +00:00
Adam Jackson
cf90a2b28f glx: Check for initial "glX" first in glXGetProcAddress
This makes us match eglGetProcAddress, otherwise you scan the entire GLX
function table on every glXGetProcAddress.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20549>
2023-01-13 19:59:26 +00:00
Adam Jackson
f8d3c222db glx: Reflow MakeContextCurrent a little
First, move a few early-out checks up since they don't need to take the
GLX lock. Second, move garbage collecting deleted contexts up to
immediately after they are unbound. This fixes a memory leak, albeit a
difficult one to hit, in the case where you switch away from a deleted
context but switching to the new one errors out. In that case we would
leak the deleted context, since it's been unbound from all threads and
there's no longer an XID for it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20549>
2023-01-13 19:59:26 +00:00
Adam Jackson
cf9debb639 glx: Clean up some funny business from context bind/unbind
We always fully unbind the old context before binding the new one, so
there's no point in passing both contexts to both the unbind and then
the bind.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20549>
2023-01-13 19:59:26 +00:00
Adam Jackson
f0eed00010 glx: Remove support for glXGetDriverConfig for old drivers
gallium implements __DRI_CONFIG_OPTIONS version 2.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20549>
2023-01-13 19:59:26 +00:00
Adam Jackson
f53ec64d68 glx: Remove a can't-happen NULL check
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20549>
2023-01-13 19:59:26 +00:00
Adam Jackson
9de2776e01 glx: Remove glx_context::screen
We're already keeping a back pointer to the glx_screen which already
tracks this, it's not important enough to keep the screen number in two
places.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20549>
2023-01-13 19:59:26 +00:00
Adam Jackson
81f77f999b glx/dri3: Simplify protocol version tracking
This is really just a single elaborate capability check, so stash a
boolean in the display state for it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20549>
2023-01-13 19:59:26 +00:00
Alyssa Rosenzweig
862bf420a9 asahi: Handle sampler->compare_mode
Instead of smashing unconditionally to 1. Not sure if this fixes anything but it
gets rid of an unknown at least. Possibly slightly faster.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20561>
2023-01-13 19:43:14 +00:00
Bas Nieuwenhuizen
edca10e9c9 aco: Pass correct number of coords to Vega 1D LOD instruction.
If we pass a physical 2D texture descriptor we should also pass 2
coords. Otherwise it just uses the random content in the second
register which ends up funny sometimes.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20696>
2023-01-13 16:55:06 +01:00
t0b3
267dd1f4d5 nir/nir_opt_move: fix ALWAYS_INLINE compiler error
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Closes: #6825
Fixes: f1d20ec6 ("nir/nir_opt_move: handle non-SSA defs ")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17439>
2023-01-13 14:23:35 +00:00
Samuel Pitoiset
5b3fb44ecc radv: fix re-emitting RB+ when the non-compacted color format changes
If the previously emitted graphics pipeline uses the value A for
col_format_non_compacted and the new bound graphics pipeline uses B.

At bind time, radv_cmd_state::col_format_non_compacted will be set to
B and the rbplus flag will be dirtied. But if there is no draws and a
new graphics pipeline is bound with the same value as A, the next
draw will emit the rbplus state with B instead of A.

This can be basically triggered with meta operations after drawing
because the driver saves/restores the bound pipeline.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8073
Fixes: 11469f7553 ("radv: copy the non-compacted color format at pipeline bind time")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20692>
2023-01-13 13:57:40 +00:00
Samuel Pitoiset
ebec42d799 radv: fix hashing pipeline keys if RADV_PERFTEST=ngg_streamout is used
On GFX10-10.3, RADV_PERFTEST=ngg_streamout can be used to replace the
legacy path but it should be in the pipeline key. Otherwise, it's
possible to load legacy shaders from the cache instead of NGG.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20668>
2023-01-13 13:10:12 +00:00
Martin Roukala (né Peres)
aab08fc250 zink/ci: relocate radv testing from radv's gitlab-ci.yml
Zink testing should happen in the layered-backends stage, not the AMD
one.

Suggested-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20677>
2023-01-13 12:20:08 +00:00
Martin Roukala (né Peres)
89a85a8daa zink/ci: add a fail to the VG flake list
It seems to have happened only once so far, but let's be proactive as
an unexpected pass is fatal.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20677>
2023-01-13 12:20:08 +00:00
Martin Roukala (né Peres)
0907fb46ee zink/ci/radv: remove a test from the fails list
It seems `spec@ext_texture_array@fbo-depth-array stencil-draw` got
fixed last week, so let's update the expectations.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20677>
2023-01-13 12:20:08 +00:00
Martin Roukala (né Peres)
d7c1ba0bce ci/piglit: compress results.csv before uploading it to GitLab
The results.csv file of a full piglit run is about 6 MB.

Given how seldomly this file is being used, and the fact that it cannot
be viewed directly in gitlab's artifact page anyway.

Let's compress the file using zstd, and enjoy a ~90% reduction in size
at the cost of probably less than 500ms of compression time on a slow
device, and 55ms on the CI machines in the valve farm.

Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20669>
2023-01-13 11:27:57 +00:00
Martin Roukala (né Peres)
d110299d77 ci/deqp-runner: compress results.csv before uploading it to GitLab
The results.csv file can get ridiculously big for a vkcts run (up to
135MB). Given how seldomly this file is being used, and the fact that
it cannot be viewed directly in gitlab's artifact page anyway.

Let's compress the file using zstd, and enjoy a ~95% reduction in size
at the cost of probably less than 1 second of compression time on even
the slowest of the devices in CI (which would use sharing), and about
150ms on the CI machines in the Valve farm.

Suggested-by: Daniel Stone <daniels@collabora.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20669>
2023-01-13 11:27:57 +00:00
Sergi Blanch Torne
f19f119bae Revert "ci: Collabora's LAVA lab for maintance"
Farm up again

This reverts commit 900ccec7e8fa809ef0a9154db4d0ecec3fe26e9c.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20633>
2023-01-13 09:30:18 +00:00
Sergi Blanch Torne
9a4bd32790 ci: disable Collabora's LAVA lab for maintance
This is to inform you of some planned downtime in the LAVA lab as follows:

    Start: 2023-01-13 08:00 GMT
    End: 2023-01-13 12:00 GMT

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20632>
2023-01-13 08:12:37 +00:00
Samuel Pitoiset
2a5d7f4926 radv: fix missing implementation of creating images from swapchains
These pNext structs are part of VK_KHR_swapchain which is core Vulkan
1.1 but they were missing. Loosely based on ANV.

Passed WSI CTS.

Cc: 22.3 mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7797
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20641>
2023-01-13 07:42:33 +00:00
Lionel Landwerlin
2969850d88 intel/utrace: document tracepoints
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16655>
2023-01-13 01:22:15 +00:00
Lionel Landwerlin
2702159268 intel/ds: remove unused trace point
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16655>
2023-01-13 01:22:15 +00:00
Lionel Landwerlin
4dd3e755ea intel/ds: add INTEL_GPU_TRACEPOINT envvar to toggle tracepoints
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16655>
2023-01-13 01:22:15 +00:00
Lionel Landwerlin
28b15fa9e7 anv: add support for command buffer tagging in traces
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16655>
2023-01-13 01:22:15 +00:00
Lionel Landwerlin
662e05c9fb vulkan/debug_utils: copy debug util labels
The copied structures currently can point to freed memory.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16655>
2023-01-13 01:22:15 +00:00
Lionel Landwerlin
a34fcaf326 util/u_trace: add support for variable length trace points
Use case being :

struct tp {
   ...
   char string[0];
};

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16655>
2023-01-13 01:22:15 +00:00
Lionel Landwerlin
f1ab070d7f intel/ds: move event_id access to perfetto lambda
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16655>
2023-01-13 01:22:15 +00:00
Lionel Landwerlin
f0160ee2ab intel/ds: track secondary cmdbuffers in perfetto
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16655>
2023-01-13 01:22:15 +00:00
Lionel Landwerlin
9a16effeac anv: record secondaries' traces into primaries
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16655>
2023-01-13 01:22:15 +00:00
Lionel Landwerlin
1082c8ad11 pps: print out message when we get the first counters
Mostly for debug purposes, show the first visible counter timestamp.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16655>
2023-01-13 01:22:15 +00:00
Alyssa Rosenzweig
61c7e1bf48 agx: Peephole select after opt_preamble
Reduces control flow in Dolphin uber shaders, which saves us a few cycles.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20597>
2023-01-13 00:43:04 +00:00
Alyssa Rosenzweig
f4b3201244 nir/peephole_select: Allow load_preamble
load_preamble is intended to be almost free (costing at most a move), and it
does not have special bounds checking requirement, so it's ok to select with it.
With this, drivers that use nir_opt_preamble together with a late call to
peephole_select can optimize sequences like:

   if (x) {
      <uniform-on-uniform calculation>
   } else {
      <different uniform-on-uniform calculation>
   }

to simply

   bcsel(x, <uniform register 0>, <uniform register 1>)

rather than emitting needless control flow / branching over some moves.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20597>
2023-01-13 00:43:04 +00:00
Mike Blumenkrantz
f3d046af6a zink: simplify get_slot_components() for xfb emission
multiplying by the array size is always wrong for this case, and not
doing so allows for some simplification and better inlining, though
the output results are identical

the one corner case is clip/cull distance, which need special handling
since they're arrays with vec semantics

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20678>
2023-01-12 23:43:40 +00:00
Pavel Ondračka
3fcdd9e4a7 nir/lower_bool: ntt: Generate a good opcode for bcsel
This is heavily copy-pasted from a patch of Ian Romanick, including the
commit message.

Previously, this pass always generated fcsel for bcsel.  This was the
only place that generate fcsel, so various drivers assumed (and needed!)
that src0 was a Boolean with 0.0 or 1.0 as the only values.

Specifically, many DX9 / GL_ARB_vertex_program platforms lack a CMP
instruction in vertex shaders.  In those cases, they would use LRP to
implement fcsel.  The bummer is that many plaforms have a real fcsel
instruction, and those platforms would benefit from other places
generating that opcode.

Instead of leaving assumptions in drivers about the sources of an opcode
that they can't really support, allow them to control the way the
lowering pass translates bcsel.  Two flags are used to control this:

- If the driver sets has_fused_comp_and_csel in nir_options, fcsel_gt
  will be used.  Since the Boolean value is 0.0 or 1.0, this is
  equivalent to fcsel.

- If the parameter has_fcsel_ne is set, fcsel will be used.  This is the
  old path.

- Otherwise, the lowering pass assumes we're on a crufty, old DX9 vertex
  program, and it emits flrp.

With this, the assumptions about src0 of fcsel in NTT can be removed.
If a platform can't handle fcsel, it should ensure that the lowering
pass won't generate it.

No change in shader-db.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20162>
2023-01-12 23:01:05 +00:00
Ian Romanick
36e842839f i915: Enable generation of fcsel_gt and fcsel_ge opcodes
DX9 PS 1.x / GL_ARB_fragment_program shaders that have been converted to
GLSL are littered with patterns like

    ps_r1.x = ((ps_t0.y >= 0.0) ? ps_r1.x : ps_c1.y);

This is because CMP is a fundamental opcode in those earlier shading
languages.  i915 supports this opcode natively, but there's no way to
get it directly into the backend.  Instead, NIR and NTT generate some
combination of fcsel and sge and hope for the best.

i915
total instructions in shared programs: 49032 -> 48897 (-0.28%)
instructions in affected programs: 4173 -> 4038 (-3.24%)
helped: 39
HURT: 0

total temps in shared programs: 2795 -> 2790 (-0.18%)
temps in affected programs: 22 -> 17 (-22.73%)
helped: 5
HURT: 0

total const in shared programs: 4976 -> 4967 (-0.18%)
const in affected programs: 203 -> 194 (-4.43%)
helped: 9
HURT: 0

GAINED: shaders/trine/fp-13.shader_test FS

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20162>
2023-01-12 23:01:05 +00:00
Ian Romanick
cb1ab133ea r300: Enable generation of fcsel_gt and fcsel_ge opcodes
RV530:
total instructions in shared programs: 135032 -> 134833 (-0.15%)
instructions in affected programs: 15654 -> 15455 (-1.27%)
helped: 133
HURT: 13

total temps in shared programs: 17051 -> 17045 (-0.04%)
temps in affected programs: 202 -> 196 (-2.97%)
helped: 11
HURT: 5

RV370:
total instructions in shared programs: 84439 -> 84378 (-0.07%)
instructions in affected programs: 2519 -> 2458 (-2.42%)
helped: 49
HURT: 7

total temps in shared programs: 12399 -> 12380 (-0.15%)
temps in affected programs: 322 -> 303 (-5.90%)
helped: 20
HURT: 10

GAINED: shaders/godot3.4/22-69.shader_test FS

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20162>
2023-01-12 23:01:05 +00:00
Ian Romanick
70b25d9fe8 nir/lower_int_to_float: Add support for i32csel opcodes
These lower naturally to the corresponding fcsel opcodes.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20162>
2023-01-12 23:01:05 +00:00
Ian Romanick
451df66ea0 ntt: Add support for fcsel_gt and fcsel_ge opcodes
These match the TGSI CMP opcode very nicely.  Every driver that uses NTT
for its fragment shader path should be able to enable these opcodes now.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20162>
2023-01-12 23:01:05 +00:00
Dylan Baker
fd927737f5 docs: reset new_features.txt
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20680>
2023-01-12 22:45:38 +00:00
Dylan Baker
45de63b3fd VERSION: bump to 23.1.0-devel for further development
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20680>
2023-01-12 22:45:38 +00:00
2724 changed files with 349921 additions and 91598 deletions

View File

@@ -1,3 +1,16 @@
workflow:
rules:
- if: $GITLAB_USER_LOGIN == "marge-bot" && $CI_COMMIT_BRANCH == null
variables:
MESA_CI_PERFORMANCE_ENABLED: 1
- if: $GITLAB_USER_LOGIN == "marge-bot" && $CI_COMMIT_BRANCH
variables:
LAVA_JOB_PRIORITY: 40
- if: $GITLAB_USER_LOGIN != "marge-bot"
variables:
LAVA_JOB_PRIORITY: 50
- when: always
variables:
FDO_UPSTREAM_REPO: mesa/mesa
MESA_TEMPLATES_COMMIT: &ci-templates-commit d5aa3941aa03c2f716595116354fb81eb8012acb
@@ -20,7 +33,7 @@ variables:
FD_FARM: "online"
COLLABORA_FARM: "online"
MICROSOFT_FARM: "online"
LIMA_FARM: "online"
LIMA_FARM: "offline"
IGALIA_FARM: "online"
ANHOLT_FARM: "online"
VALVE_FARM: "online"
@@ -28,10 +41,13 @@ variables:
default:
before_script:
- echo -e "\e[0Ksection_start:$(date +%s):unset_env_vars_section[collapsed=true]\r\e[0KUnsetting vulnerable environment variables"
- echo -n "${CI_JOB_JWT}" > "${CI_JOB_JWT_FILE}"
- unset CI_JOB_JWT
- echo -e "\e[0Ksection_end:$(date +%s):unset_env_vars_section\r\e[0K"
- >
export SCRIPTS_DIR=$(mktemp -d) &&
curl -L -s --retry 4 -f --retry-all-errors --retry-delay 60 -O --output-dir "${SCRIPTS_DIR}" "${CI_PROJECT_URL}/-/raw/${CI_COMMIT_SHA}/.gitlab-ci/setup-test-env.sh" &&
chmod +x ${SCRIPTS_DIR}/setup-test-env.sh &&
. ${SCRIPTS_DIR}/setup-test-env.sh &&
echo -n "${CI_JOB_JWT}" > "${CI_JOB_JWT_FILE}" &&
unset CI_JOB_JWT # Unsetting vulnerable env variables
after_script:
- >
@@ -41,15 +57,14 @@ default:
export CI_JOB_JWT="$(<${CI_JOB_JWT_FILE})" &&
rm "${CI_JOB_JWT_FILE}"
# Retry build or test jobs up to twice when the gitlab-runner itself fails somehow.
# Retry when job fails. Failed jobs can be found in the Mesa CI Daily Reports:
# https://gitlab.freedesktop.org/mesa/mesa/-/issues/?sort=created_date&state=opened&label_name%5B%5D=CI%20daily
retry:
max: 2
when:
- runner_system_failure
max: 1
include:
- project: 'freedesktop/ci-templates'
ref: ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2
ref: 16bc29078de5e0a067ff84a1a199a3760d3b3811
file:
- '/templates/ci-fairy.yml'
- project: 'freedesktop/ci-templates'
@@ -64,6 +79,7 @@ include:
- local: '.gitlab-ci/build/gitlab-ci.yml'
- local: '.gitlab-ci/test/gitlab-ci.yml'
- local: '.gitlab-ci/test-source-dep.yml'
- local: 'docs/gitlab-ci.yml'
- local: 'src/amd/ci/gitlab-ci.yml'
- local: 'src/broadcom/ci/gitlab-ci.yml'
- local: 'src/etnaviv/ci/gitlab-ci.yml'
@@ -106,15 +122,6 @@ stages:
# --------------------------------
.rules-anchors:
rules:
# Pipeline for forked project branch
- if: &is-forked-branch '$CI_COMMIT_BRANCH && $CI_PROJECT_NAMESPACE != "mesa"'
when: manual
# Forked project branch / pre-merge pipeline not for Marge bot
- if: &is-forked-branch-or-pre-merge-not-for-marge '$CI_PROJECT_NAMESPACE != "mesa" || ($GITLAB_USER_LOGIN != "marge-bot" && $CI_PIPELINE_SOURCE == "merge_request_event")'
when: manual
# Pipeline runs for the main branch of the upstream Mesa project
- if: &is-mesa-main '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $CI_COMMIT_BRANCH'
when: always
# Post-merge pipeline
- if: &is-post-merge '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_BRANCH'
when: on_success
@@ -129,82 +136,15 @@ stages:
when: on_success
.docs-base:
variables:
BUILDER: html
extends:
- .fdo.ci-fairy
- .build-rules
artifacts:
expose_as: 'Documentation preview'
paths:
- public/
script:
- apk --no-cache add graphviz doxygen
- pip3 install sphinx===5.1.1 breathe===4.34.0 mako===1.2.3 sphinx_rtd_theme===1.0.0
- docs/doxygen-wrapper.py --out-dir=docs/doxygen_xml
- sphinx-build -W -b $BUILDER docs public
pages:
extends: .docs-base
stage: deploy
needs: []
rules:
- !reference [.no_scheduled_pipelines-rules, rules]
- if: *is-mesa-main
changes: &docs-or-ci
- docs/**/*
- .gitlab-ci.yml
when: always
# Other cases default to never
test-docs:
extends: .docs-base
# Cancel job if a newer commit is pushed to the same branch
interruptible: true
stage: deploy
needs: []
rules:
- !reference [.no_scheduled_pipelines-rules, rules]
- if: *is-forked-branch
changes: *docs-or-ci
when: manual
# Other cases default to never
test-docs-mr:
extends:
- test-docs
needs:
- sanity
rules:
- if: *is-pre-merge
changes: *docs-or-ci
when: on_success
# Other cases default to never
lincheck-docs:
extends: .docs-base
# Cancel job if a newer commit is pushed to the same branch
interruptible: true
stage: deploy
needs: []
rules:
- !reference [.scheduled_pipeline-rules, rules]
allow_failure: true
variables:
BUILDER: linkcheck
# When to automatically run the CI for build jobs
.build-rules:
rules:
- !reference [.no_scheduled_pipelines-rules, rules]
# If any files affecting the pipeline are changed, build/test jobs run
# automatically once all dependency jobs have passed
- changes: &all_paths
- VERSION
- bin/git_sha1_gen.py
- bin/install_megadrivers.py
- bin/meson_get_version.py
- bin/symbols-check.py
# GitLab CI
- .gitlab-ci.yml
@@ -234,7 +174,6 @@ lincheck-docs:
.container-rules:
rules:
- !reference [.no_scheduled_pipelines-rules, rules]
# Run pipeline by default in the main project if any CI pipeline
# configuration files were changed, to ensure docker images are up to date
- if: *is-post-merge
@@ -299,18 +238,3 @@ sanity:
when: on_failure
reports:
junit: check-*.xml
# Rules for tests that should not block merging, but should be available to
# optionally run with the "play" button in the UI in pre-merge non-marge
# pipelines. This should appear in "extends:" after any includes of
# test-source-dep.yml rules, so that these rules replace those.
.test-manual-mr:
rules:
- !reference [.no_scheduled_pipelines-rules, rules]
- if: *is-forked-branch-or-pre-merge-not-for-marge
changes:
*all_paths
when: manual
variables:
JOB_TIMEOUT: 80

View File

@@ -15,3 +15,20 @@ glx@glx_arb_sync_control@timing.*
# This test is not built with waffle, while we do build tests with waffle
spec@!opengl 1.1@windowoverlap
# These tests all read from the front buffer after a swap. Given that we
# run piglit tests in parallel in Mesa CI, and don't have a compositor
# running, the frontbuffer reads may end up with undefined results from
# windows overlapping us.
#
# Piglit does mark these tests as not to be run in parallel, but deqp-runner
# doesn't respect that. We need to extend deqp-runner to allow some tests to be
# marked as single-threaded and run after the rayon loop if we want to support
# them.
#
# Note that "glx-" tests don't appear in x11-skips.txt because they can be
# run even if PIGLIT_PLATFORM=gbm (for example)
glx@glx-copy-sub-buffer.*
# Reads the front buffer but it doesn't have to.
# https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/755
glx-swap-copy

View File

@@ -80,8 +80,9 @@ mkdir -p /nfs/results
rm -rf /tftp/*
if echo "$BM_KERNEL" | grep -q http; then
apt install -y wget
wget $BM_KERNEL -O /tftp/vmlinuz
apt-get install -y curl
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
$BM_KERNEL -o /tftp/vmlinuz
else
cp $BM_KERNEL /tftp/vmlinuz
fi

View File

@@ -1,5 +1,7 @@
#!/bin/bash
. "$SCRIPTS_DIR"/setup-test-env.sh
BM=$CI_PROJECT_DIR/install/bare-metal
CI_COMMON=$CI_PROJECT_DIR/install/common
@@ -100,10 +102,12 @@ fi
# moving that container to the runner. So, if BM_KERNEL+BM_DTB are URLs,
# fetch them instead of looking in the container.
if echo "$BM_KERNEL $BM_DTB" | grep -q http; then
apt install -y wget
apt-get install -y curl
wget $BM_KERNEL -O kernel
wget $BM_DTB -O dtb
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"$BM_KERNEL" -o kernel
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"$BM_DTB" -o dtb
cat kernel dtb > Image.gz-dtb
rm kernel

View File

@@ -1,5 +1,7 @@
#!/bin/bash
. "$SCRIPTS_DIR"/setup-test-env.sh
# Boot script for devices attached to a PoE switch, using NFS for the root
# filesystem.
@@ -71,6 +73,8 @@ fi
set -ex
date +'%F %T'
# Clear out any previous run's artifacts.
rm -rf results/
mkdir -p results
@@ -79,13 +83,18 @@ mkdir -p results
# state, since it's volume-mounted on the host.
rsync -a --delete $BM_ROOTFS/ /nfs/
date +'%F %T'
# If BM_BOOTFS is an URL, download it
if echo $BM_BOOTFS | grep -q http; then
apt install -y wget
wget ${FDO_HTTP_CACHE_URI:-}$BM_BOOTFS -O /tmp/bootfs.tar
apt-get install -y curl
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"${FDO_HTTP_CACHE_URI:-}$BM_BOOTFS" -o /tmp/bootfs.tar
BM_BOOTFS=/tmp/bootfs.tar
fi
date +'%F %T'
# If BM_BOOTFS is a file, assume it is a tarball and uncompress it
if [ -f $BM_BOOTFS ]; then
mkdir -p /tmp/bootfs
@@ -93,14 +102,20 @@ if [ -f $BM_BOOTFS ]; then
BM_BOOTFS=/tmp/bootfs
fi
date +'%F %T'
# Install kernel modules (it could be either in /lib/modules or
# /usr/lib/modules, but we want to install in the latter)
[ -d $BM_BOOTFS/usr/lib/modules ] && rsync -a $BM_BOOTFS/usr/lib/modules/ /nfs/usr/lib/modules/
[ -d $BM_BOOTFS/lib/modules ] && rsync -a $BM_BOOTFS/lib/modules/ /nfs/lib/modules/
date +'%F %T'
# Install kernel image + bootloader files
rsync -aL --delete $BM_BOOTFS/boot/ /tftp/
date +'%F %T'
# Set up the pxelinux config for Jetson Nano
mkdir -p /tftp/pxelinux.cfg
cat <<EOF >/tftp/pxelinux.cfg/default-arm-tegra210-p3450-0000
@@ -132,6 +147,8 @@ EOF
mkdir -p /nfs/results
. $BM/rootfs-setup.sh /nfs
date +'%F %T'
echo "$BM_CMDLINE" > /tftp/cmdline.txt
# Add some required options in config.txt
@@ -155,8 +172,12 @@ while [ $((ATTEMPTS--)) -gt 0 ]; do
done
set -e
date +'%F %T'
# Bring artifacts back from the NFS dir to the build dir where gitlab-runner
# will look for them.
cp -Rp /nfs/results/. results/
date +'%F %T'
exit $ret

View File

@@ -8,12 +8,17 @@ mkdir -p $rootfs_dst/results
cp $BM/bm-init.sh $rootfs_dst/init
cp $CI_COMMON/init*.sh $rootfs_dst/
date +'%F %T'
# Make JWT token available as file in the bare-metal storage to enable access
# to MinIO
cp "${CI_JOB_JWT_FILE}" "${rootfs_dst}${CI_JOB_JWT_FILE}"
date +'%F %T'
cp $CI_COMMON/capture-devcoredump.sh $rootfs_dst/
cp $CI_COMMON/intel-gpu-freq.sh $rootfs_dst/
cp "$SCRIPTS_DIR/setup-test-env.sh" "$rootfs_dst/"
set +x
@@ -28,3 +33,5 @@ set -x
# Add the Mesa drivers we built, and make a consistent symlink to them.
mkdir -p $rootfs_dst/$CI_PROJECT_DIR
rsync -aH --delete $CI_PROJECT_DIR/install/ $rootfs_dst/$CI_PROJECT_DIR/install/
date +'%F %T'

View File

@@ -0,0 +1,3 @@
#!/bin/sh
_COMPILER=clang++
. compiler-wrapper.sh

View File

@@ -0,0 +1,3 @@
#!/bin/sh
_COMPILER=clang
. compiler-wrapper.sh

View File

@@ -0,0 +1,3 @@
#!/bin/sh
_COMPILER=g++
. compiler-wrapper.sh

View File

@@ -0,0 +1,3 @@
#!/bin/sh
_COMPILER=gcc
. compiler-wrapper.sh

View File

@@ -0,0 +1,21 @@
#!/bin/sh -e
if command -V ccache >/dev/null 2>/dev/null; then
CCACHE=ccache
else
CCACHE=
fi
if [ "$(ps -p $(ps -p $PPID -o ppid --no-headers) -o comm --no-headers)" != ninja ]; then
# Not invoked by ninja (e.g. for a meson feature check)
exec $CCACHE $_COMPILER "$@"
fi
if [ "$(eval printf "'%s'" "\"\${$(($#-1))}\"")" = "-c" ]; then
# Not invoked for linking
exec $CCACHE $_COMPILER "$@"
fi
# Compiler invoked by ninja for linking. Add -Werror to turn compiler warnings into errors
# with LTO. (meson's werror should arguably do this, but meanwhile we need to)
exec $CCACHE $_COMPILER "$@" -Werror

View File

@@ -10,6 +10,7 @@
- _build/meson-logs/*.txt
- _build/meson-logs/strace
- shader-db
- artifacts
# Just Linux
.build-linux:
@@ -21,15 +22,16 @@
# Use ccache transparently, and print stats before/after
before_script:
- !reference [default, before_script]
- export PATH="/usr/lib/ccache:$PATH"
- export CCACHE_BASEDIR="$PWD"
- echo -e "\e[0Ksection_start:$(date +%s):ccache_before[collapsed=true]\r\e[0Kccache stats before build"
- ccache --show-stats
- echo -e "\e[0Ksection_end:$(date +%s):ccache_before\r\e[0K"
- |
export PATH="/usr/lib/ccache:$PATH"
export CCACHE_BASEDIR="$PWD"
if test -x /usr/bin/ccache; then
section_start ccache_before "ccache stats before build"
ccache --show-stats
section_end ccache_before
fi
after_script:
- echo -e "\e[0Ksection_start:$(date +%s):ccache_after[collapsed=true]\r\e[0Kccache stats after build"
- ccache --show-stats
- echo -e "\e[0Ksection_end:$(date +%s):ccache_after\r\e[0K"
- if test -x /usr/bin/ccache; then ccache --show-stats | grep "cache hit rate"; fi
- !reference [default, after_script]
.build-windows:
@@ -73,7 +75,7 @@ debian-testing:
-D glx=dri
-D gbm=enabled
-D egl=enabled
-D platforms=x11
-D platforms=x11,wayland
GALLIUM_ST: >
-D dri3=enabled
-D gallium-va=enabled
@@ -82,7 +84,8 @@ debian-testing:
BUILDTYPE: "debugoptimized"
EXTRA_OPTION: >
-D spirv-to-dxil=true
-D valgrind=false
-D valgrind=disabled
-D perfetto=true
MINIO_ARTIFACT_NAME: mesa-amd64
LLVM_VERSION: "13"
script:
@@ -100,7 +103,7 @@ debian-testing-asan:
-Wno-error=stringop-truncation
EXTRA_OPTION: >
-D b_sanitize=address
-D valgrind=false
-D valgrind=disabled
-D tools=dlclose-skip
MINIO_ARTIFACT_NAME: ""
ARTIFACTS_DEBUG_SYMBOLS: 1
@@ -121,7 +124,7 @@ debian-testing-msan:
MESON_TEST_ARGS: "--suite glcpp --suite gallium --suite format"
# Freedreno dropped because freedreno tools fail at msan.
GALLIUM_DRIVERS: "iris,nouveau,kmsro,r300,r600,swrast,svga,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,radeonsi,tegra,d3d12,crocus"
VULKAN_DRIVERS: intel,intel_hasvk,amd,broadcom,virtio-experimental
VULKAN_DRIVERS: intel,amd,broadcom,virtio-experimental
.debian-cl-testing:
extends:
@@ -137,12 +140,13 @@ debian-testing-msan:
GALLIUM_DRIVERS: "swrast"
BUILDTYPE: "debugoptimized"
EXTRA_OPTION: >
-D valgrind=false
-D valgrind=disabled
script:
- .gitlab-ci/meson/build.sh
- .gitlab-ci/prepare-artifacts.sh
debian-clover-testing:
# TODO: remove together with Clover
.debian-clover-testing:
extends:
- .debian-cl-testing
variables:
@@ -185,12 +189,17 @@ debian-build-testing:
-D tools=drm-shim,etnaviv,freedreno,glsl,intel,intel-ui,nir,nouveau,lima,panfrost,asahi
-D b_lto=true
LLVM_VERSION: 13
script:
- .gitlab-ci/lava/lava-pytest.sh
- .gitlab-ci/run-shellcheck.sh
- .gitlab-ci/run-yamllint.sh
- .gitlab-ci/meson/build.sh
- .gitlab-ci/run-shader-db.sh
script: |
section_start lava-pytest "lava-pytest"
.gitlab-ci/lava/lava-pytest.sh
section_switch shellcheck "shellcheck"
.gitlab-ci/run-shellcheck.sh
section_switch yamllint "yamllint"
.gitlab-ci/run-yamllint.sh
section_switch meson "meson"
.gitlab-ci/meson/build.sh
section_switch shader-db "shader-db"
.gitlab-ci/run-shader-db.sh
# Test a release build with -Werror so new warnings don't sneak in.
debian-release:
@@ -216,15 +225,17 @@ debian-release:
-D llvm=enabled
GALLIUM_DRIVERS: "i915,iris,nouveau,kmsro,freedreno,r300,svga,swrast,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,d3d12,crocus"
VULKAN_DRIVERS: "amd,imagination-experimental,microsoft-experimental"
BUILDTYPE: "release"
EXTRA_OPTION: >
-D spirv-to-dxil=true
-D osmesa=true
-D tools=all
-D intel-clc=enabled
-D imagination-srv=true
BUILDTYPE: "release"
MINIO_ARTIFACT_NAME: "mesa-amd64-${BUILDTYPE}"
script:
- .gitlab-ci/meson/build.sh
- 'if [ -n "$MESA_CI_PERFORMANCE_ENABLED" ]; then .gitlab-ci/prepare-artifacts.sh; fi'
alpine-build-testing:
extends:
@@ -270,8 +281,13 @@ fedora-release:
- .use-fedora/x86_build
variables:
BUILDTYPE: "release"
C_ARGS: >
C_LINK_ARGS: >
-Wno-error=array-bounds
-Wno-error=stringop-overflow
-Wno-error=stringop-overread
CPP_LINK_ARGS: >
-Wno-error=array-bounds
-Wno-error=stringop-overflow
-Wno-error=stringop-overread
DRI_LOADERS: >
-D glx=dri
@@ -279,15 +295,15 @@ fedora-release:
-D egl=enabled
-D glvnd=true
-D platforms=x11,wayland
# intel-clc disabled, we need llvm-spirv-translator 13.0+, Fedora 34 only packages 12.0.
EXTRA_OPTION: >
-D b_lto=true
-D osmesa=true
-D selinux=true
-D tools=drm-shim,etnaviv,freedreno,glsl,intel,nir,nouveau,lima,panfrost,imagination
-D vulkan-layers=device-select,overlay
-D intel-clc=disabled
-D intel-clc=enabled
-D imagination-srv=true
GALLIUM_DRIVERS: "crocus,etnaviv,freedreno,iris,kmsro,lima,nouveau,panfrost,r300,r600,radeonsi,svga,swrast,tegra,v3d,vc4,virgl,zink"
GALLIUM_DRIVERS: "crocus,etnaviv,freedreno,i915,iris,kmsro,lima,nouveau,panfrost,r300,r600,radeonsi,svga,swrast,tegra,v3d,vc4,virgl,zink"
GALLIUM_ST: >
-D dri3=enabled
-D gallium-extra-hud=true
@@ -305,7 +321,7 @@ fedora-release:
-D shared-llvm=enabled
LLVM_VERSION: ""
UNWIND: "disabled"
VULKAN_DRIVERS: "amd,broadcom,freedreno,intel,intel_hasvk,imagination-experimental"
VULKAN_DRIVERS: "amd,broadcom,freedreno,imagination-experimental,intel,intel_hasvk"
script:
- .gitlab-ci/meson/build.sh
@@ -313,6 +329,7 @@ debian-android:
extends:
- .meson-cross
- .use-debian/android_build
- .ci-deqp-artifacts
variables:
UNWIND: "disabled"
C_ARGS: >
@@ -320,8 +337,13 @@ debian-android:
-Wno-error=constant-conversion
-Wno-error=enum-conversion
-Wno-error=initializer-overrides
-Wno-error=missing-braces
-Wno-error=sometimes-uninitialized
-Wno-error=implicit-const-int-float-conversion
CPP_ARGS: >
-Wno-error=c99-designator
-Wno-error=unused-variable
-Wno-error=unused-but-set-variable
-Wno-error=self-assign
DRI_LOADERS: >
-D glx=disabled
-D gbm=disabled
@@ -330,8 +352,9 @@ debian-android:
EXTRA_OPTION: >
-D android-stub=true
-D llvm=disabled
-D platform-sdk-version=29
-D valgrind=false
-D platform-sdk-version=33
-D valgrind=disabled
-D android-libbacktrace=disabled
GALLIUM_ST: >
-D dri3=disabled
-D gallium-vdpau=disabled
@@ -343,14 +366,17 @@ debian-android:
-D gallium-rusticl=false
LLVM_VERSION: ""
PKG_CONFIG_LIBDIR: "/disable/non/android/system/pc/files"
ARTIFACTS_DEBUG_SYMBOLS: 1
MINIO_ARTIFACT_NAME: mesa-x86_64-android
script:
- PKG_CONFIG_PATH=/usr/local/lib/aarch64-linux-android/pkgconfig/:/android-ndk-r21d/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/pkgconfig/ CROSS=aarch64-linux-android GALLIUM_DRIVERS=etnaviv,freedreno,lima,panfrost,vc4,v3d VULKAN_DRIVERS=freedreno,broadcom,virtio-experimental .gitlab-ci/meson/build.sh
- CROSS=aarch64-linux-android GALLIUM_DRIVERS=etnaviv,freedreno,lima,panfrost,vc4,v3d VULKAN_DRIVERS=freedreno,broadcom,virtio-experimental .gitlab-ci/meson/build.sh
# x86_64 build:
# Can't do Intel because gen_decoder.c currently requires libexpat, which
# is not a dependency that AOSP wants to accept. Can't do Radeon Gallium
# drivers because they requires LLVM, which we don't have an Android build
# of.
- PKG_CONFIG_PATH=/usr/local/lib/x86_64-linux-android/pkgconfig/:/android-ndk-r21d/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/pkgconfig/ CROSS=x86_64-linux-android GALLIUM_DRIVERS=iris VULKAN_DRIVERS=amd,intel,intel_hasvk .gitlab-ci/meson/build.sh
- CROSS=x86_64-linux-android GALLIUM_DRIVERS=iris,virgl VULKAN_DRIVERS=amd,intel .gitlab-ci/meson/build.sh
- .gitlab-ci/prepare-artifacts.sh
.meson-cross:
extends:
@@ -393,7 +419,7 @@ debian-armhf:
CROSS: armhf
EXTRA_OPTION: >
-D llvm=disabled
-D valgrind=false
-D valgrind=disabled
MINIO_ARTIFACT_NAME: mesa-armhf
# The strip command segfaults, failing to strip the binary and leaving
# tempfiles in our artifacts.
@@ -410,8 +436,9 @@ debian-arm64:
VULKAN_DRIVERS: "freedreno,broadcom,panfrost,imagination-experimental"
EXTRA_OPTION: >
-D llvm=disabled
-D valgrind=false
-D valgrind=disabled
-D imagination-srv=true
-D perfetto=true
MINIO_ARTIFACT_NAME: mesa-arm64
script:
- .gitlab-ci/meson/build.sh
@@ -424,7 +451,7 @@ debian-arm64-asan:
EXTRA_OPTION: >
-D llvm=disabled
-D b_sanitize=address
-D valgrind=false
-D valgrind=disabled
-D tools=dlclose-skip
ARTIFACTS_DEBUG_SYMBOLS: 1
MINIO_ARTIFACT_NAME: mesa-arm64-asan
@@ -441,6 +468,18 @@ debian-arm64-build-test:
script:
- .gitlab-ci/meson/build.sh
debian-arm64-release:
extends:
- debian-arm64
variables:
BUILDTYPE: release
MINIO_ARTIFACT_NAME: mesa-arm64-${BUILDTYPE}
C_ARGS: >
-Wno-error=stringop-truncation
script:
- .gitlab-ci/meson/build.sh
- 'if [ -n "$MESA_CI_PERFORMANCE_ENABLED" ]; then .gitlab-ci/prepare-artifacts.sh; fi'
debian-clang:
extends: .meson-build
variables:
@@ -481,7 +520,7 @@ debian-clang:
-D shared-llvm=enabled
-D opencl-spirv=true
GALLIUM_DRIVERS: "iris,nouveau,kmsro,r300,r600,freedreno,swrast,svga,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,radeonsi,tegra,d3d12,crocus,i915,asahi"
VULKAN_DRIVERS: intel,intel_hasvk,amd,freedreno,broadcom,virtio-experimental,swrast,panfrost,imagination-experimental,microsoft-experimental
VULKAN_DRIVERS: intel,amd,freedreno,broadcom,virtio-experimental,swrast,panfrost,imagination-experimental,microsoft-experimental
EXTRA_OPTION:
-D spirv-to-dxil=true
-D osmesa=true
@@ -525,9 +564,10 @@ windows-vs2019:
-D egl=disabled
-D gbm=disabled
EXTRA_OPTION: >
-D valgrind=false
-D valgrind=disabled
debian-clover:
# TODO: remove with Clover
.debian-clover:
extends: .debian-cl
variables:
GALLIUM_DRIVERS: "r600,radeonsi,swrast"
@@ -579,7 +619,7 @@ debian-vulkan:
-D c_args=-fno-sanitize-recover=all
-D cpp_args=-fno-sanitize-recover=all
UBSAN_OPTIONS: "print_stacktrace=1"
VULKAN_DRIVERS: intel,intel_hasvk,amd,freedreno,broadcom,virtio-experimental,imagination-experimental,microsoft-experimental
VULKAN_DRIVERS: intel,amd,freedreno,broadcom,virtio-experimental,imagination-experimental,microsoft-experimental
EXTRA_OPTION: >
-D vulkan-layers=device-select,overlay
-D build-aco-tests=true
@@ -592,7 +632,7 @@ debian-i386:
- .use-debian/i386_build
variables:
CROSS: i386
VULKAN_DRIVERS: intel,intel_hasvk,amd,swrast,virtio-experimental
VULKAN_DRIVERS: intel,amd,swrast,virtio-experimental
GALLIUM_DRIVERS: "iris,nouveau,r300,r600,radeonsi,swrast,virgl,zink,crocus"
LLVM_VERSION: 13
EXTRA_OPTION: >
@@ -621,26 +661,21 @@ debian-ppc64el:
GALLIUM_DRIVERS: "nouveau,radeonsi,swrast,virgl,zink"
VULKAN_DRIVERS: "amd,swrast"
debian-mingw32-x86_64:
# Disabled as it hangs with winedbg on shared runners
.debian-mingw32-x86_64:
extends: .meson-build_mingw
stage: build-misc
variables:
UNWIND: "disabled"
C_ARGS: >
-Wno-error=format
-Wno-error=format-extra-args
-Wno-error=deprecated-declarations
-Wno-error=unused-but-set-variable
CPP_ARGS: >
-Wno-error=format
-Wno-error=unused-function
-Wno-error=unused-variable
-Wno-error=unused-but-set-variable
-Wno-error=unused-value
-Wno-error=switch
-Wno-error=parentheses
-Wno-error=missing-prototypes
-Wno-error=sign-compare
-Wno-error=narrowing
-Wno-error=overflow
CPP_ARGS: $C_ARGS
GALLIUM_DRIVERS: "swrast,d3d12,zink"
VULKAN_DRIVERS: "swrast,amd,microsoft-experimental"
GALLIUM_ST: >
@@ -650,7 +685,7 @@ debian-mingw32-x86_64:
-D microsoft-clc=enabled
-D static-libclc=all
-D llvm=enabled
-D gallium-va=true
-D gallium-va=enabled
-D video-codecs=h264dec,h264enc,h265dec,h265enc,vc1dec
EXTRA_OPTION: >
-D min-windows-version=7

View File

@@ -10,6 +10,7 @@ for var in \
CI_COMMIT_TITLE \
CI_JOB_ID \
CI_JOB_JWT_FILE \
CI_JOB_STARTED_AT \
CI_JOB_NAME \
CI_JOB_URL \
CI_MERGE_REQUEST_SOURCE_BRANCH_NAME \
@@ -27,6 +28,7 @@ for var in \
CI_SERVER_URL \
CROSVM_GALLIUM_DRIVER \
CROSVM_GPU_ARGS \
CURRENT_SECTION \
DEQP_BIN_DIR \
DEQP_CONFIG \
DEQP_EXPECTED_RENDERER \
@@ -115,6 +117,8 @@ for var in \
VK_DRIVER \
VK_ICD_FILENAMES \
VKD3D_PROTON_RESULTS \
ZINK_DESCRIPTORS \
LVP_POISON_MEMORY \
; do
if [ -n "${!var+x}" ]; then
echo "export $var=${!var@Q}"

View File

@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Make sure to kill itself and all the children process from this script on
# exiting, since any console output may interfere with LAVA signals handling,
@@ -36,7 +36,10 @@ BACKGROUND_PIDS=
# Second-stage init, used to set up devices and our job environment before
# running tests.
. /set-job-env-vars.sh
for path in '/set-job-env-vars.sh' './set-job-env-vars.sh'; do
[ -f "$path" ] && source "$path"
done
. "$SCRIPTS_DIR"/setup-test-env.sh
set -ex
@@ -73,7 +76,8 @@ if [ "$HWCI_KVM" = "true" ]; then
modprobe ${KVM_KERNEL_MODULE}
mkdir -p /lava-files
wget -S --progress=dot:giga -O /lava-files/${KERNEL_IMAGE_NAME} \
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-o "/lava-files/${KERNEL_IMAGE_NAME}" \
"${KERNEL_IMAGE_BASE_URL}/${KERNEL_IMAGE_NAME}"
fi
@@ -143,23 +147,27 @@ if [ -n "$HWCI_START_XORG" ]; then
fi
if [ -n "$HWCI_START_WESTON" ]; then
export XDG_RUNTIME_DIR=/run/user
mkdir -p $XDG_RUNTIME_DIR
WESTON_X11_SOCK="/tmp/.X11-unix/X0"
if [ -n "$HWCI_START_XORG" ]; then
echo "Please consider dropping HWCI_START_XORG and instead using Weston XWayland for testing."
WESTON_X11_SOCK="/tmp/.X11-unix/X1"
fi
export WAYLAND_DISPLAY=wayland-0
# Xwayland to be used when HWCI_START_XORG is not set
# Display server is Weston Xwayland when HWCI_START_XORG is not set or Xorg when it's
export DISPLAY=:0
mkdir -p /tmp/.X11-unix
env \
VK_ICD_FILENAMES=/install/share/vulkan/icd.d/${VK_DRIVER}_icd.`uname -m`.json \
weston -Bheadless-backend.so --use-gl -Swayland-0 --xwayland &
export WAYLAND_DISPLAY=wayland-0
sleep 1
VK_ICD_FILENAMES="/install/share/vulkan/icd.d/${VK_DRIVER}_icd.$(uname -m).json" \
weston -Bheadless-backend.so --use-gl -Swayland-0 --xwayland --idle-time=0 &
BACKGROUND_PIDS="$! $BACKGROUND_PIDS"
while [ ! -S "$WESTON_X11_SOCK" ]; do sleep 1; done
fi
RESULT=fail
set +e
sh -c "$HWCI_TEST_SCRIPT"
bash -c ". $SCRIPTS_DIR/setup-test-env.sh && $HWCI_TEST_SCRIPT"
EXIT_CODE=$?
set -e
@@ -181,7 +189,7 @@ fi
# We still need to echo the hwci: mesa message, as some scripts rely on it, such
# as the python ones inside the bare-metal folder
[ ${EXIT_CODE} -eq 0 ] && RESULT=pass
[ ${EXIT_CODE} -eq 0 ] && RESULT=pass || RESULT=fail
set +x
echo "hwci: mesa: $RESULT"

View File

@@ -0,0 +1,174 @@
From bf8ada0d15f94824ee1643d4e17a66dffdbaf2e5 Mon Sep 17 00:00:00 2001
From: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Date: Fri, 26 Aug 2022 18:24:27 +0200
Subject: [PATCH 1/2] Allow running on Android from the command line
For testing the Android EGL platform without having to go via the
Android activity manager, build deqp-egl.
Tests that render to native windows are unsupported, as command line
programs cannot create windows on Android.
$ cmake -S . -B build/ -DDEQP_TARGET=android -DDEQP_TARGET_TOOLCHAIN=ndk-modern -DCMAKE_C_FLAGS=-Werror -DCMAKE_CXX_FLAGS=-Werror -DANDROID_NDK_PATH=./android-ndk-r21d -DANDROID_ABI=x86_64 -DDE_ANDROID_API=28 -DGLCTS_GTF_TARGET=gles32 -G Ninja
$ ninja -C build modules/egl/deqp-egl
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
---
CMakeLists.txt | 36 ++-----------------
.../android/tcuAndroidNativeActivity.cpp | 36 ++++++++++---------
.../platform/android/tcuAndroidPlatform.cpp | 12 ++++++-
3 files changed, 33 insertions(+), 51 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1ff2bb9..8c76abb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -249,7 +249,7 @@ include_directories(
external/vulkancts/framework/vulkan/generated/vulkan
)
-if (DE_OS_IS_ANDROID OR DE_OS_IS_IOS)
+if (DE_OS_IS_IOS)
# On Android deqp modules are compiled as libraries and linked into final .so
set(DEQP_MODULE_LIBRARIES )
set(DEQP_MODULE_ENTRY_POINTS )
@@ -293,7 +293,7 @@ macro (add_deqp_module MODULE_NAME SRCS LIBS EXECLIBS ENTRY)
set(DEQP_MODULE_LIBRARIES ${DEQP_MODULE_LIBRARIES} PARENT_SCOPE)
set(DEQP_MODULE_ENTRY_POINTS ${DEQP_MODULE_ENTRY_POINTS} PARENT_SCOPE)
- if (NOT DE_OS_IS_ANDROID AND NOT DE_OS_IS_IOS)
+ if (NOT DE_OS_IS_IOS)
# Executable target
add_executable(${MODULE_NAME} ${PROJECT_SOURCE_DIR}/framework/platform/tcuMain.cpp ${ENTRY})
target_link_libraries(${MODULE_NAME} PUBLIC "${EXECLIBS}" "${MODULE_NAME}${MODULE_LIB_TARGET_POSTFIX}")
@@ -367,37 +367,7 @@ add_subdirectory(external/vulkancts/vkscpc)
add_subdirectory(external/openglcts)
# Single-binary targets
-if (DE_OS_IS_ANDROID)
- include_directories(executor)
- include_directories(${PROJECT_BINARY_DIR}/external/vulkancts/framework/vulkan)
-
- set(DEQP_SRCS
- framework/platform/android/tcuAndroidMain.cpp
- framework/platform/android/tcuAndroidJNI.cpp
- framework/platform/android/tcuAndroidPlatformCapabilityQueryJNI.cpp
- framework/platform/android/tcuTestLogParserJNI.cpp
- ${DEQP_MODULE_ENTRY_POINTS}
- )
-
- set(DEQP_LIBS
- tcutil-platform
- xecore
- ${DEQP_MODULE_LIBRARIES}
- )
-
- add_library(deqp SHARED ${DEQP_SRCS})
- target_link_libraries(deqp ${DEQP_LIBS})
-
- # Separate out the debug information because it's enormous
- add_custom_command(TARGET deqp POST_BUILD
- COMMAND ${CMAKE_STRIP} --only-keep-debug -o $<TARGET_FILE:deqp>.debug $<TARGET_FILE:deqp>
- COMMAND ${CMAKE_STRIP} -g $<TARGET_FILE:deqp>)
-
- # Needed by OpenGL CTS that defines its own activity but depends on
- # common Android support code.
- target_include_directories(deqp PRIVATE framework/platform/android)
-
-elseif (DE_OS_IS_IOS)
+if (DE_OS_IS_IOS)
# Code sign identity
set(DEQP_IOS_CODE_SIGN_IDENTITY "drawElements" CACHE STRING "Code sign identity for iOS build")
diff --git a/framework/platform/android/tcuAndroidNativeActivity.cpp b/framework/platform/android/tcuAndroidNativeActivity.cpp
index 6f8cd8f..b83e30f 100644
--- a/framework/platform/android/tcuAndroidNativeActivity.cpp
+++ b/framework/platform/android/tcuAndroidNativeActivity.cpp
@@ -116,23 +116,25 @@ namespace Android
NativeActivity::NativeActivity (ANativeActivity* activity)
: m_activity(activity)
{
- activity->instance = (void*)this;
- activity->callbacks->onStart = onStartCallback;
- activity->callbacks->onResume = onResumeCallback;
- activity->callbacks->onSaveInstanceState = onSaveInstanceStateCallback;
- activity->callbacks->onPause = onPauseCallback;
- activity->callbacks->onStop = onStopCallback;
- activity->callbacks->onDestroy = onDestroyCallback;
- activity->callbacks->onWindowFocusChanged = onWindowFocusChangedCallback;
- activity->callbacks->onNativeWindowCreated = onNativeWindowCreatedCallback;
- activity->callbacks->onNativeWindowResized = onNativeWindowResizedCallback;
- activity->callbacks->onNativeWindowRedrawNeeded = onNativeWindowRedrawNeededCallback;
- activity->callbacks->onNativeWindowDestroyed = onNativeWindowDestroyedCallback;
- activity->callbacks->onInputQueueCreated = onInputQueueCreatedCallback;
- activity->callbacks->onInputQueueDestroyed = onInputQueueDestroyedCallback;
- activity->callbacks->onContentRectChanged = onContentRectChangedCallback;
- activity->callbacks->onConfigurationChanged = onConfigurationChangedCallback;
- activity->callbacks->onLowMemory = onLowMemoryCallback;
+ if (activity) {
+ activity->instance = (void*)this;
+ activity->callbacks->onStart = onStartCallback;
+ activity->callbacks->onResume = onResumeCallback;
+ activity->callbacks->onSaveInstanceState = onSaveInstanceStateCallback;
+ activity->callbacks->onPause = onPauseCallback;
+ activity->callbacks->onStop = onStopCallback;
+ activity->callbacks->onDestroy = onDestroyCallback;
+ activity->callbacks->onWindowFocusChanged = onWindowFocusChangedCallback;
+ activity->callbacks->onNativeWindowCreated = onNativeWindowCreatedCallback;
+ activity->callbacks->onNativeWindowResized = onNativeWindowResizedCallback;
+ activity->callbacks->onNativeWindowRedrawNeeded = onNativeWindowRedrawNeededCallback;
+ activity->callbacks->onNativeWindowDestroyed = onNativeWindowDestroyedCallback;
+ activity->callbacks->onInputQueueCreated = onInputQueueCreatedCallback;
+ activity->callbacks->onInputQueueDestroyed = onInputQueueDestroyedCallback;
+ activity->callbacks->onContentRectChanged = onContentRectChangedCallback;
+ activity->callbacks->onConfigurationChanged = onConfigurationChangedCallback;
+ activity->callbacks->onLowMemory = onLowMemoryCallback;
+ }
}
NativeActivity::~NativeActivity (void)
diff --git a/framework/platform/android/tcuAndroidPlatform.cpp b/framework/platform/android/tcuAndroidPlatform.cpp
index 69ab384..d7288f6 100644
--- a/framework/platform/android/tcuAndroidPlatform.cpp
+++ b/framework/platform/android/tcuAndroidPlatform.cpp
@@ -22,6 +22,7 @@
*//*--------------------------------------------------------------------*/
#include "tcuAndroidPlatform.hpp"
+#include "tcuAndroidNativeActivity.hpp"
#include "tcuAndroidUtil.hpp"
#include "gluRenderContext.hpp"
#include "egluNativeDisplay.hpp"
@@ -170,7 +171,7 @@ eglu::NativeWindow* NativeWindowFactory::createWindow (const eglu::WindowParams&
Window* window = m_windowRegistry.tryAcquireWindow();
if (!window)
- throw ResourceError("Native window is not available", DE_NULL, __FILE__, __LINE__);
+ throw NotSupportedError("Native window is not available", DE_NULL, __FILE__, __LINE__);
return new NativeWindow(window, params.width, params.height, format);
}
@@ -286,6 +287,9 @@ static size_t getTotalSystemMemory (ANativeActivity* activity)
try
{
+ if (!activity)
+ throw tcu::InternalError("No activity (running from command line?");
+
const size_t totalMemory = getTotalAndroidSystemMemory(activity);
print("Device has %.2f MiB of system memory\n", static_cast<double>(totalMemory) / static_cast<double>(MiB));
return totalMemory;
@@ -382,3 +386,9 @@ bool Platform::hasDisplay (vk::wsi::Type wsiType) const
} // Android
} // tcu
+
+tcu::Platform* createPlatform (void)
+{
+ tcu::Android::NativeActivity activity(NULL);
+ return new tcu::Android::Platform(activity);
+}
--
2.39.1

View File

@@ -0,0 +1,161 @@
From 6d99990e93869e361035b7c06c05183041dec8b4 Mon Sep 17 00:00:00 2001
From: Ricardo Garcia <rgarcia@igalia.com>
Date: Mon, 20 Feb 2023 13:57:53 +0100
Subject: [PATCH] Fix build for the surfaceless and null-WS target platforms
Both platforms should not be considered for building Vulkan Video, which
is only available in the normal Linux and Win32 targets, and their
createLibrary platform methods do not take a library type argument.
No test results should be affected by these changes.
Components: Framework
VK-GL-CTS issue: 4295
Change-Id: I4de5b42685899099a9cfcf7da64fe299fef61ffc
---
external/vulkancts/framework/vulkan/vkPlatform.hpp | 2 +-
.../vulkancts/modules/vulkan/api/vktApiVersionCheck.cpp | 2 +-
external/vulkancts/modules/vulkan/video/CMakeLists.txt | 2 +-
.../modules/vulkan/video/vktVideoSessionNvUtils.cpp | 2 +-
external/vulkancts/modules/vulkan/vktTestPackage.cpp | 2 +-
external/vulkancts/vkscpc/vkscpc.cpp | 2 +-
external/vulkancts/vkscserver/vksServices.cpp | 2 +-
framework/delibs/debase/deDefs.h | 6 ++++++
framework/platform/CMakeLists.txt | 1 +
targets/nullws/nullws.cmake | 1 +
10 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/external/vulkancts/framework/vulkan/vkPlatform.hpp b/external/vulkancts/framework/vulkan/vkPlatform.hpp
index bec39d326..7574166b9 100644
--- a/external/vulkancts/framework/vulkan/vkPlatform.hpp
+++ b/external/vulkancts/framework/vulkan/vkPlatform.hpp
@@ -399,7 +399,7 @@ public:
Platform (void) {}
~Platform (void) {}
-#if (DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX)
+#ifdef DE_PLATFORM_USE_LIBRARY_TYPE
virtual Library* createLibrary (LibraryType libraryType = LIBRARY_TYPE_VULKAN, const char* libraryPath = DE_NULL) const = 0;
#else
virtual Library* createLibrary (const char* libraryPath = DE_NULL) const = 0;
diff --git a/external/vulkancts/modules/vulkan/api/vktApiVersionCheck.cpp b/external/vulkancts/modules/vulkan/api/vktApiVersionCheck.cpp
index 5f6d884f4..af6bf6938 100644
--- a/external/vulkancts/modules/vulkan/api/vktApiVersionCheck.cpp
+++ b/external/vulkancts/modules/vulkan/api/vktApiVersionCheck.cpp
@@ -133,7 +133,7 @@ public:
tcu::TestLog& log = m_context.getTestContext().getLog();
const deUint32 apiVersion = m_context.getUsedApiVersion();
const vk::Platform& platform = m_context.getTestContext().getPlatform().getVulkanPlatform();
-#if (DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX)
+#ifdef DE_PLATFORM_USE_LIBRARY_TYPE
de::MovePtr<vk::Library> vkLibrary = de::MovePtr<vk::Library>(platform.createLibrary(vk::Platform::LibraryType::LIBRARY_TYPE_VULKAN, m_context.getTestContext().getCommandLine().getVkLibraryPath()));
#else
de::MovePtr<vk::Library> vkLibrary = de::MovePtr<vk::Library>(platform.createLibrary(m_context.getTestContext().getCommandLine().getVkLibraryPath()));
diff --git a/external/vulkancts/modules/vulkan/video/CMakeLists.txt b/external/vulkancts/modules/vulkan/video/CMakeLists.txt
index 464adb1e2..f9a2044e7 100644
--- a/external/vulkancts/modules/vulkan/video/CMakeLists.txt
+++ b/external/vulkancts/modules/vulkan/video/CMakeLists.txt
@@ -1,5 +1,5 @@
include_directories(..)
-if (DE_OS_IS_WIN32 OR DE_OS_IS_UNIX)
+if ((DE_OS_IS_WIN32 OR DE_OS_IS_UNIX) AND NOT DEQP_USE_SURFACELESS AND NOT DEQP_USE_NULLWS)
include_directories(${FFMPEG_INCLUDE_PATH})
add_compile_definitions(DE_BUILD_VIDEO)
endif()
diff --git a/external/vulkancts/modules/vulkan/video/vktVideoSessionNvUtils.cpp b/external/vulkancts/modules/vulkan/video/vktVideoSessionNvUtils.cpp
index 00491930c..9323278be 100644
--- a/external/vulkancts/modules/vulkan/video/vktVideoSessionNvUtils.cpp
+++ b/external/vulkancts/modules/vulkan/video/vktVideoSessionNvUtils.cpp
@@ -148,7 +148,7 @@ private:
};
NvFunctions::NvFunctions (const vk::Platform& platform)
-#ifdef DE_BUILD_VIDEO
+#ifdef DE_PLATFORM_USE_LIBRARY_TYPE
: m_library (de::MovePtr<vk::Library>(platform.createLibrary(vk::Platform::LIBRARY_TYPE_VULKAN_VIDEO_DECODE_PARSER, DE_NULL)))
#else
: m_library (de::MovePtr<vk::Library>(platform.createLibrary()))
diff --git a/external/vulkancts/modules/vulkan/vktTestPackage.cpp b/external/vulkancts/modules/vulkan/vktTestPackage.cpp
index 959a9d368..cac454c71 100644
--- a/external/vulkancts/modules/vulkan/vktTestPackage.cpp
+++ b/external/vulkancts/modules/vulkan/vktTestPackage.cpp
@@ -204,7 +204,7 @@ static void restoreStandardOutput () { qpRedirectOut(openWrite, open
static MovePtr<vk::Library> createLibrary (tcu::TestContext& testCtx)
{
-#if (DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX)
+#ifdef DE_PLATFORM_USE_LIBRARY_TYPE
return MovePtr<vk::Library>(testCtx.getPlatform().getVulkanPlatform().createLibrary(vk::Platform::LIBRARY_TYPE_VULKAN, testCtx.getCommandLine().getVkLibraryPath()));
#else
return MovePtr<vk::Library>(testCtx.getPlatform().getVulkanPlatform().createLibrary(testCtx.getCommandLine().getVkLibraryPath()));
diff --git a/external/vulkancts/vkscpc/vkscpc.cpp b/external/vulkancts/vkscpc/vkscpc.cpp
index 55b5665c8..91725633a 100644
--- a/external/vulkancts/vkscpc/vkscpc.cpp
+++ b/external/vulkancts/vkscpc/vkscpc.cpp
@@ -288,7 +288,7 @@ int main (int argc, char** argv)
tcu::DirArchive archive {""};
tcu::TestLog log { cmdLine.getOption<opt::LogFile>().c_str() }; log.supressLogging(true);
de::SharedPtr<tcu::Platform> platform {createPlatform()};
-#if (DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX)
+#ifdef DE_PLATFORM_USE_LIBRARY_TYPE
de::SharedPtr<vk::Library> library {platform->getVulkanPlatform().createLibrary(vk::Platform::LIBRARY_TYPE_VULKAN, DE_NULL)};
#else
de::SharedPtr<vk::Library> library {platform->getVulkanPlatform().createLibrary(DE_NULL)};
diff --git a/external/vulkancts/vkscserver/vksServices.cpp b/external/vulkancts/vkscserver/vksServices.cpp
index 461c7a349..fe1160edc 100644
--- a/external/vulkancts/vkscserver/vksServices.cpp
+++ b/external/vulkancts/vkscserver/vksServices.cpp
@@ -163,7 +163,7 @@ VkscServer* createServerVKSC(const std::string& logFile)
tcu::DirArchive archive {""};
tcu::TestLog log { logFile.c_str() }; log.supressLogging(true);
tcu::Platform* platform {createPlatform()};
-#if (DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX)
+#ifdef DE_PLATFORM_USE_LIBRARY_TYPE
vk::Library* library {platform->getVulkanPlatform().createLibrary(vk::Platform::LIBRARY_TYPE_VULKAN, DE_NULL)};
#else
vk::Library* library {platform->getVulkanPlatform().createLibrary(DE_NULL)};
diff --git a/framework/delibs/debase/deDefs.h b/framework/delibs/debase/deDefs.h
index 39cd65d0b..2885fe5c5 100644
--- a/framework/delibs/debase/deDefs.h
+++ b/framework/delibs/debase/deDefs.h
@@ -101,6 +101,12 @@
# error Unknown operating system.
#endif
+#if ((DE_OS == DE_OS_WIN32) || (DE_OS == DE_OS_UNIX)) && !defined(DEQP_SURFACELESS) && !defined(NULLWS)
+# define DE_PLATFORM_USE_LIBRARY_TYPE 1
+#else
+# undef DE_PLATFORM_USE_LIBRARY_TYPE
+#endif
+
/* CPUs */
#define DE_CPU_VANILLA 0
#define DE_CPU_X86 1
diff --git a/framework/platform/CMakeLists.txt b/framework/platform/CMakeLists.txt
index 00c53e3c9..b2a1d57b6 100644
--- a/framework/platform/CMakeLists.txt
+++ b/framework/platform/CMakeLists.txt
@@ -113,6 +113,7 @@ if (NOT DEFINED TCUTIL_PLATFORM_SRCS)
endif()
elseif (DE_OS_IS_UNIX AND DEQP_USE_SURFACELESS)
+ add_definitions(-DDEQP_SURFACELESS=1)
set(TCUTIL_PLATFORM_SRCS
surfaceless/tcuSurfacelessPlatform.hpp
surfaceless/tcuSurfacelessPlatform.cpp
diff --git a/targets/nullws/nullws.cmake b/targets/nullws/nullws.cmake
index 81a7f9ea2..5f6f9b773 100644
--- a/targets/nullws/nullws.cmake
+++ b/targets/nullws/nullws.cmake
@@ -1,6 +1,7 @@
message("*** Using nullws target")
set(DEQP_TARGET_NAME "nullws")
+set(DEQP_USE_NULLWS ON)
add_definitions(-DNULLWS)
find_library(GLES2_LIBRARY NAMES libGLESv2 GLESv2)
--
2.39.1

View File

@@ -0,0 +1,27 @@
From c2d5252f4a8be94720235feb9e358ecb0a2e8e11 Mon Sep 17 00:00:00 2001
From: Helen Koike <helen.koike@collabora.com>
Date: Tue, 27 Sep 2022 12:35:22 -0300
Subject: [PATCH 2/2] Android prints to stdout instead of logcat
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
---
framework/qphelper/qpDebugOut.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/framework/qphelper/qpDebugOut.c b/framework/qphelper/qpDebugOut.c
index 6579e9f..c200c6f 100644
--- a/framework/qphelper/qpDebugOut.c
+++ b/framework/qphelper/qpDebugOut.c
@@ -98,7 +98,7 @@ void qpDiev (const char* format, va_list args)
}
/* print() implementation. */
-#if (DE_OS == DE_OS_ANDROID)
+#if (0)
#include <android/log.h>
--
2.39.1

View File

@@ -17,15 +17,17 @@ EPHEMERAL="
make
openssl-dev
unzip
wget
xz
zstd-dev
"
apk add \
bash \
bison \
ccache \
clang-dev \
coreutils \
curl \
flex \
gcc \
g++ \

View File

@@ -46,6 +46,7 @@ CONFIG_OF=y
CONFIG_QCOM_COMMAND_DB=y
CONFIG_QCOM_RPMHPD=y
CONFIG_QCOM_RPMPD=y
CONFIG_QCOM_OCMEM=y
CONFIG_SDM_GPUCC_845=y
CONFIG_SDM_VIDEOCC_845=y
CONFIG_SDM_DISPCC_845=y
@@ -82,6 +83,8 @@ CONFIG_PHY_QCOM_USB_HS=y
CONFIG_USB_RTL8152=y
# db820c ethernet
CONFIG_ATL1C=y
# Chromebooks ethernet
CONFIG_USB_ONBOARD_HUB=y
CONFIG_ARCH_ALPINE=n
CONFIG_ARCH_BCM2835=n

View File

@@ -7,13 +7,14 @@ set -o xtrace
# network transfer, disk usage, and runtime on test jobs)
# shellcheck disable=SC2154 # arch is assigned in previous scripts
if wget -q --method=HEAD "${ARTIFACTS_PREFIX}/${FDO_UPSTREAM_REPO}/${ARTIFACTS_SUFFIX}/${arch}/done"; then
if curl -X HEAD -s "${ARTIFACTS_PREFIX}/${FDO_UPSTREAM_REPO}/${ARTIFACTS_SUFFIX}/${arch}/done"; then
ARTIFACTS_URL="${ARTIFACTS_PREFIX}/${FDO_UPSTREAM_REPO}/${ARTIFACTS_SUFFIX}/${arch}"
else
ARTIFACTS_URL="${ARTIFACTS_PREFIX}/${CI_PROJECT_PATH}/${ARTIFACTS_SUFFIX}/${arch}"
fi
wget "${ARTIFACTS_URL}"/lava-rootfs.tar.zst -O rootfs.tar.zst
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"${ARTIFACTS_URL}"/lava-rootfs.tar.zst -o rootfs.tar.zst
mkdir -p /rootfs-"$arch"
tar -C /rootfs-"$arch" '--exclude=./dev/*' --zstd -xf rootfs.tar.zst
rm rootfs.tar.zst
@@ -22,9 +23,12 @@ if [[ $arch == "arm64" ]]; then
mkdir -p /baremetal-files
pushd /baremetal-files
wget "${ARTIFACTS_URL}"/Image
wget "${ARTIFACTS_URL}"/Image.gz
wget "${ARTIFACTS_URL}"/cheza-kernel
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "${ARTIFACTS_URL}"/Image
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "${ARTIFACTS_URL}"/Image.gz
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "${ARTIFACTS_URL}"/cheza-kernel
DEVICE_TREES=""
DEVICE_TREES="$DEVICE_TREES apq8016-sbc.dtb"
@@ -33,7 +37,8 @@ if [[ $arch == "arm64" ]]; then
DEVICE_TREES="$DEVICE_TREES imx8mq-nitrogen.dtb"
for DTB in $DEVICE_TREES; do
wget "${ARTIFACTS_URL}/$DTB"
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "${ARTIFACTS_URL}/$DTB"
done
popd
@@ -41,14 +46,16 @@ elif [[ $arch == "armhf" ]]; then
mkdir -p /baremetal-files
pushd /baremetal-files
wget "${ARTIFACTS_URL}"/zImage
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "${ARTIFACTS_URL}"/zImage
DEVICE_TREES=""
DEVICE_TREES="$DEVICE_TREES imx6q-cubox-i.dtb"
DEVICE_TREES="$DEVICE_TREES tegra124-jetson-tk1.dtb"
for DTB in $DEVICE_TREES; do
wget "${ARTIFACTS_URL}/$DTB"
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "${ARTIFACTS_URL}/$DTB"
done
popd

View File

@@ -6,26 +6,26 @@ set -ex
git config --global user.email "mesa@example.com"
git config --global user.name "Mesa CI"
CROSVM_VERSION=504899212d626ecf42b1c459e5592891dde5bf91
CROSVM_VERSION=00af43e1b565e1ae0047ba84b970da5e089e4f48
git clone --single-branch -b main --no-checkout https://chromium.googlesource.com/crosvm/crosvm /platform/crosvm
pushd /platform/crosvm
git checkout "$CROSVM_VERSION"
git submodule update --init
VIRGLRENDERER_VERSION=3f2685355f71201f22b98c19aa778b43732c8435
VIRGLRENDERER_VERSION=fc2ad36998f8af8ea3cc68fb9c747dfec9cb4635
rm -rf third_party/virglrenderer
git clone --single-branch -b master --no-checkout https://gitlab.freedesktop.org/virgl/virglrenderer.git third_party/virglrenderer
pushd third_party/virglrenderer
git checkout "$VIRGLRENDERER_VERSION"
meson build/ -Drender-server=true -Drender-server-worker=process -Dvenus-experimental=true $EXTRA_MESON_ARGS
meson build/ -Drender-server-worker=process -Dvenus-experimental=true $EXTRA_MESON_ARGS
ninja -C build install
popd
RUSTFLAGS='-L native=/usr/local/lib' cargo install \
bindgen \
bindgen-cli \
-j ${FDO_CI_CONCURRENT:-4} \
--root /usr/local \
--version 0.60.1 \
--version 0.63.0 \
$EXTRA_CARGO_ARGS
RUSTFLAGS='-L native=/usr/local/lib' cargo install \

View File

@@ -19,10 +19,35 @@ else
DEQP_RUNNER_CARGO_ARGS="--version 0.16.0 ${EXTRA_CARGO_ARGS} -- deqp-runner"
fi
cargo install --locked \
-j ${FDO_CI_CONCURRENT:-4} \
--root /usr/local \
${DEQP_RUNNER_CARGO_ARGS}
if [ -z "$ANDROID_NDK_HOME" ]; then
cargo install --locked \
-j ${FDO_CI_CONCURRENT:-4} \
--root /usr/local \
${DEQP_RUNNER_CARGO_ARGS}
else
mkdir -p /deqp-runner
pushd /deqp-runner
git clone --branch v0.16.1 --depth 1 https://gitlab.freedesktop.org/anholt/deqp-runner.git deqp-runner-git
pushd deqp-runner-git
cargo install --locked \
-j ${FDO_CI_CONCURRENT:-4} \
--root /usr/local --version 2.10.0 \
cargo-ndk
rustup target add x86_64-linux-android
RUSTFLAGS='-C target-feature=+crt-static' cargo ndk --target x86_64-linux-android build
mv target/x86_64-linux-android/debug/deqp-runner /deqp-runner
cargo uninstall --locked \
--root /usr/local \
cargo-ndk
popd
rm -rf deqp-runner-git
popd
fi
# remove unused test runners to shrink images for the Mesa CI build (not kernel,
# which chooses its own deqp branch)

View File

@@ -7,17 +7,25 @@ git config --global user.email "mesa@example.com"
git config --global user.name "Mesa CI"
git clone \
https://github.com/KhronosGroup/VK-GL-CTS.git \
-b vulkan-cts-1.3.3.0 \
-b vulkan-cts-1.3.5.0 \
--depth 1 \
/VK-GL-CTS
pushd /VK-GL-CTS
# Apply a patch to update zlib link to an available version.
# vulkan-cts-1.3.3.0 uses zlib 1.2.12 which was removed from zlib server due to
# a CVE. See https://zlib.net/
# FIXME: Remove this patch when uprev to 1.3.4.0+
wget -O- https://github.com/KhronosGroup/VK-GL-CTS/commit/6bb2e7d64261bedb503947b1b251b1eeeb49be73.patch |
git am -
cts_commits_to_backport=()
for commit in "${cts_commits_to_backport[@]}"
do
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"https://github.com/KhronosGroup/VK-GL-CTS/commit/$commit.patch" | git am -
done
# Fix surfaceless build.
git am < $OLDPWD/.gitlab-ci/container/0001-Fix-build-for-the-surfaceless-and-null-WS-target-pla.patch
# Android specific patches.
git am < $OLDPWD/.gitlab-ci/container/0001-Allow-running-on-Android-from-the-command-line.patch
git am < $OLDPWD/.gitlab-ci/container/0002-Android-prints-to-stdout-instead-of-logcat.patch
# --insecure is due to SSL cert failures hitting sourceforge for zlib and
# libpng (sigh). The archives get their checksums checked anyway, and git
@@ -31,21 +39,24 @@ cp doc/testlog-stylesheet/testlog.{css,xsl} /deqp
popd
pushd /deqp
# When including EGL/X11 testing, do that build first and save off its
# deqp-egl binary.
cmake -S /VK-GL-CTS -B . -G Ninja \
-DDEQP_TARGET=x11_egl_glx \
-DCMAKE_BUILD_TYPE=Release \
$EXTRA_CMAKE_ARGS
ninja modules/egl/deqp-egl
cp /deqp/modules/egl/deqp-egl /deqp/modules/egl/deqp-egl-x11
cmake -S /VK-GL-CTS -B . -G Ninja \
-DDEQP_TARGET=wayland \
-DCMAKE_BUILD_TYPE=Release \
$EXTRA_CMAKE_ARGS
ninja modules/egl/deqp-egl
cp /deqp/modules/egl/deqp-egl /deqp/modules/egl/deqp-egl-wayland
if [ "${DEQP_TARGET}" != 'android' ]; then
# When including EGL/X11 testing, do that build first and save off its
# deqp-egl binary.
cmake -S /VK-GL-CTS -B . -G Ninja \
-DDEQP_TARGET=x11_egl_glx \
-DCMAKE_BUILD_TYPE=Release \
$EXTRA_CMAKE_ARGS
ninja modules/egl/deqp-egl
cp /deqp/modules/egl/deqp-egl /deqp/modules/egl/deqp-egl-x11
cmake -S /VK-GL-CTS -B . -G Ninja \
-DDEQP_TARGET=wayland \
-DCMAKE_BUILD_TYPE=Release \
$EXTRA_CMAKE_ARGS
ninja modules/egl/deqp-egl
cp /deqp/modules/egl/deqp-egl /deqp/modules/egl/deqp-egl-wayland
fi
cmake -S /VK-GL-CTS -B . -G Ninja \
-DDEQP_TARGET=${DEQP_TARGET:-x11_glx} \
@@ -53,7 +64,9 @@ cmake -S /VK-GL-CTS -B . -G Ninja \
$EXTRA_CMAKE_ARGS
ninja
mv /deqp/modules/egl/deqp-egl-x11 /deqp/modules/egl/deqp-egl
if [ "${DEQP_TARGET}" != 'android' ]; then
mv /deqp/modules/egl/deqp-egl-x11 /deqp/modules/egl/deqp-egl
fi
# Copy out the mustpass lists we want.
mkdir /deqp/mustpass
@@ -62,28 +75,30 @@ for mustpass in $(< /VK-GL-CTS/external/vulkancts/mustpass/main/vk-default.txt)
>> /deqp/mustpass/vk-master.txt
done
cp \
/deqp/external/openglcts/modules/gl_cts/data/mustpass/gles/aosp_mustpass/3.2.6.x/*.txt \
/deqp/mustpass/.
cp \
/deqp/external/openglcts/modules/gl_cts/data/mustpass/egl/aosp_mustpass/3.2.6.x/egl-master.txt \
/deqp/mustpass/.
cp \
/deqp/external/openglcts/modules/gl_cts/data/mustpass/gles/khronos_mustpass/3.2.6.x/*-master.txt \
/deqp/mustpass/.
cp \
/deqp/external/openglcts/modules/gl_cts/data/mustpass/gl/khronos_mustpass/4.6.1.x/*-master.txt \
/deqp/mustpass/.
cp \
/deqp/external/openglcts/modules/gl_cts/data/mustpass/gl/khronos_mustpass_single/4.6.1.x/*-single.txt \
/deqp/mustpass/.
if [ "${DEQP_TARGET}" != 'android' ]; then
cp \
/deqp/external/openglcts/modules/gl_cts/data/mustpass/gles/aosp_mustpass/3.2.6.x/*.txt \
/deqp/mustpass/.
cp \
/deqp/external/openglcts/modules/gl_cts/data/mustpass/egl/aosp_mustpass/3.2.6.x/egl-master.txt \
/deqp/mustpass/.
cp \
/deqp/external/openglcts/modules/gl_cts/data/mustpass/gles/khronos_mustpass/3.2.6.x/*-master.txt \
/deqp/mustpass/.
cp \
/deqp/external/openglcts/modules/gl_cts/data/mustpass/gl/khronos_mustpass/4.6.1.x/*-master.txt \
/deqp/mustpass/.
cp \
/deqp/external/openglcts/modules/gl_cts/data/mustpass/gl/khronos_mustpass_single/4.6.1.x/*-single.txt \
/deqp/mustpass/.
# Save *some* executor utils, but otherwise strip things down
# to reduct deqp build size:
mkdir /deqp/executor.save
cp /deqp/executor/testlog-to-* /deqp/executor.save
rm -rf /deqp/executor
mv /deqp/executor.save /deqp/executor
# Save *some* executor utils, but otherwise strip things down
# to reduct deqp build size:
mkdir /deqp/executor.save
cp /deqp/executor/testlog-to-* /deqp/executor.save
rm -rf /deqp/executor
mv /deqp/executor.save /deqp/executor
fi
# Remove other mustpass files, since we saved off the ones we wanted to conventient locations above.
rm -rf /deqp/external/openglcts/modules/gl_cts/data/mustpass

View File

@@ -4,7 +4,8 @@
set -ex
mkdir -p kernel
wget -qO- ${KERNEL_URL} | tar -xj --strip-components=1 -C kernel
curl -L -s --retry 4 -f --retry-all-errors --retry-delay 60 ${KERNEL_URL} \
| tar -xj --strip-components=1 -C kernel
pushd kernel
# The kernel doesn't like the gold linker (or the old lld in our debians).

View File

@@ -5,7 +5,8 @@ set -ex
export LIBDRM_VERSION=libdrm-2.4.110
wget https://dri.freedesktop.org/libdrm/"$LIBDRM_VERSION".tar.xz
curl -L -O --retry 4 -f --retry-all-errors --retry-delay 60 \
https://dri.freedesktop.org/libdrm/"$LIBDRM_VERSION".tar.xz
tar -xvf "$LIBDRM_VERSION".tar.xz && rm "$LIBDRM_VERSION".tar.xz
cd "$LIBDRM_VERSION"
meson build -D vc4=false -D freedreno=false -D etnaviv=false $EXTRA_MESON_ARGS

View File

@@ -2,11 +2,14 @@
set -ex
wget https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v13.0.0.tar.gz
tar -xvf v13.0.0.tar.gz && rm v13.0.0.tar.gz
VER="13.0.0"
mkdir SPIRV-LLVM-Translator-13.0.0/build
pushd SPIRV-LLVM-Translator-13.0.0/build
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${VER}.tar.gz"
tar -xvf "v${VER}.tar.gz" && rm "v${VER}.tar.gz"
mkdir "SPIRV-LLVM-Translator-${VER}/build"
pushd "SPIRV-LLVM-Translator-${VER}/build"
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
ninja
ninja install
@@ -15,5 +18,5 @@ ninja llvm-spirv
cp tools/llvm-spirv/llvm-spirv /usr/bin/
popd
du -sh SPIRV-LLVM-Translator-13.0.0
rm -rf SPIRV-LLVM-Translator-13.0.0
du -sh "SPIRV-LLVM-Translator-${VER}"
rm -rf "SPIRV-LLVM-Translator-${VER}"

View File

@@ -2,7 +2,7 @@
set -ex
MOLD_VERSION="1.9.0"
MOLD_VERSION="1.10.0"
git clone -b v"$MOLD_VERSION" --single-branch --depth 1 https://github.com/rui314/mold.git
pushd mold

View File

@@ -3,9 +3,11 @@
set -ex
REV="355ad6bcb2cb3d9e030b7c6eef2b076b0dfb4d63"
git clone https://gitlab.freedesktop.org/mesa/piglit.git --single-branch --no-checkout /piglit
pushd /piglit
git checkout 1cd716180cfb6ef0c1fc54702460ef49e5115791
git checkout "$REV"
patch -p1 <$OLDPWD/.gitlab-ci/piglit/disable-vs_in.diff
cmake -S . -B . -G Ninja -DCMAKE_BUILD_TYPE=Release $PIGLIT_OPTS $EXTRA_CMAKE_ARGS
ninja $PIGLIT_BUILD_TARGETS

View File

@@ -20,10 +20,11 @@ RUST_VERSION=1.59.0-2022-02-24
# For rust in Mesa, we use rustup to install. This lets us pick an arbitrary
# version of the compiler, rather than whatever the container's Debian comes
# with.
wget https://sh.rustup.rs -O - | sh -s -- \
--default-toolchain $RUST_VERSION \
--profile minimal \
-y
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
--proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \
--default-toolchain $RUST_VERSION \
--profile minimal \
-y
rustup component add rustfmt

View File

@@ -49,7 +49,7 @@ download_skia_source() {
set -ex
SCRIPT_DIR=$(realpath "$(dirname "$0")")
SKQP_PATCH_DIR="${SCRIPT_DIR}"
SKQP_PATCH_DIR="${SCRIPT_DIR}/patches"
BASE_ARGS_GN_FILE="${SCRIPT_DIR}/build-skqp_base.gn"
SKQP_ARCH=${SKQP_ARCH:-x64}

View File

@@ -2,7 +2,7 @@
set -ex
VKD3D_PROTON_COMMIT="804751ee1cb108a2ec59e182ce0c052bafef268e"
VKD3D_PROTON_COMMIT="507cb3195bae32395c69763afec2b1ac078d509a"
VKD3D_PROTON_DST_DIR="/vkd3d-proton-tests"
VKD3D_PROTON_SRC_DIR="/vkd3d-proton-src"

View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -ex
VALIDATION_TAG="v1.3.238"
git clone -b "$VALIDATION_TAG" --single-branch --depth 1 https://github.com/KhronosGroup/Vulkan-ValidationLayers.git
pushd Vulkan-ValidationLayers
mkdir build
pushd build
python3 ../scripts/update_deps.py --dir ../external --arch x64 --config debug
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTS=OFF -DBUILD_WERROR=OFF -C ../external/helper.cmake ..
ninja install
popd
rm -rf Vulkan-ValidationLayers

View File

@@ -7,4 +7,6 @@ fi
# Clean up any build cache for rust.
rm -rf /.cargo
ccache --show-stats
if test -x /usr/bin/ccache; then
ccache --show-stats
fi

View File

@@ -1,24 +1,28 @@
#!/bin/sh
if test -f /etc/debian_version; then
CCACHE_PATH=/usr/lib/ccache
elif test -f /etc/alpine-release; then
CCACHE_PATH=/usr/lib/ccache/bin
else
CCACHE_PATH=/usr/lib64/ccache
if test -x /usr/bin/ccache; then
if test -f /etc/debian_version; then
CCACHE_PATH=/usr/lib/ccache
elif test -f /etc/alpine-release; then
CCACHE_PATH=/usr/lib/ccache/bin
else
CCACHE_PATH=/usr/lib64/ccache
fi
# Common setup among container builds before we get to building code.
export CCACHE_COMPILERCHECK=content
export CCACHE_COMPRESS=true
export CCACHE_DIR=/cache/$CI_PROJECT_NAME/ccache
export PATH=$CCACHE_PATH:$PATH
# CMake ignores $PATH, so we have to force CC/GCC to the ccache versions.
export CC="${CCACHE_PATH}/gcc"
export CXX="${CCACHE_PATH}/g++"
ccache --show-stats
fi
# Common setup among container builds before we get to building code.
export CCACHE_COMPILERCHECK=content
export CCACHE_COMPRESS=true
export CCACHE_DIR=/cache/$CI_PROJECT_NAME/ccache
export PATH=$CCACHE_PATH:$PATH
# CMake ignores $PATH, so we have to force CC/GCC to the ccache versions.
export CC="${CCACHE_PATH}/gcc"
export CXX="${CCACHE_PATH}/g++"
# When not using the mold linker (e.g. unsupported architecture), force
# linkers to gold, since it's so much faster for building. We can't use
# lld because we're on old debian and it's buggy. ming fails meson builds
@@ -27,8 +31,6 @@ find /usr/bin -name \*-ld -o -name ld | \
grep -v mingw | \
xargs -n 1 -I '{}' ln -sf '{}.gold' '{}'
ccache --show-stats
# Make a wrapper script for ninja to always include the -j flags
{
echo '#!/bin/sh -x'

View File

@@ -5,9 +5,10 @@ arch=$2
cpu_family=$3
cpu=$4
cross_file="/cross_file-$arch.txt"
sdk_version=$5
# armv7 has the toolchain split between two names.
arch2=${5:-$2}
arch2=${6:-$2}
# Note that we disable C++ exceptions, because Mesa doesn't use exceptions,
# and allowing it in code generation means we get unwind symbols that break
@@ -15,21 +16,22 @@ arch2=${5:-$2}
cat > "$cross_file" <<EOF
[binaries]
ar = '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/$arch-ar'
c = ['ccache', '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/${arch2}29-clang', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables']
cpp = ['ccache', '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/${arch2}29-clang++', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables']
ar = '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar'
c = ['ccache', '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/${arch2}${sdk_version}-clang', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables']
cpp = ['ccache', '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/${arch2}${sdk_version}-clang++', '-fno-exceptions', '-fno-unwind-tables', '-fno-asynchronous-unwind-tables', '-static-libstdc++']
c_ld = 'lld'
cpp_ld = 'lld'
strip = '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/$arch-strip'
strip = '$ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip'
pkgconfig = ['/usr/bin/pkg-config']
[host_machine]
system = 'linux'
system = 'android'
cpu_family = '$cpu_family'
cpu = '$cpu'
endian = 'little'
[properties]
needs_exe_wrapper = true
pkg_config_libdir = '/usr/local/lib/${arch2}/pkgconfig/:/${ndk}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/${arch2}/pkgconfig/'
EOF

View File

@@ -10,6 +10,7 @@ pc="$2"
cflags="$3"
libs="$4"
version="$5"
sdk_version="$6"
sysroot=$ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot
@@ -24,7 +25,7 @@ for arch in \
cat >$pcdir/$pc <<EOF
prefix=$sysroot
exec_prefix=$sysroot
libdir=$sysroot/usr/lib/$arch/29
libdir=$sysroot/usr/lib/$arch/$sdk_version
sharedlibdir=$sysroot/usr/lib/$arch
includedir=$sysroot/usr/include
@@ -33,7 +34,7 @@ Description: zlib compression library
Version: $version
Requires:
Libs: -L$sysroot/usr/lib/$arch/29 $libs
Libs: -L$sysroot/usr/lib/$arch/$sdk_version $libs
Cflags: -I$sysroot/usr/include $cflags
EOF
done

View File

@@ -15,7 +15,7 @@ if [ $DEBIAN_ARCH = arm64 ]; then
"
elif [ $DEBIAN_ARCH = amd64 ]; then
# Add llvm 13 to the build image
apt-get -y install --no-install-recommends wget gnupg2 software-properties-common
apt-get -y install --no-install-recommends curl gnupg2 software-properties-common
apt-key add /llvm-snapshot.gpg.key
add-apt-repository "deb https://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-13 main"
# Debian bullseye has older wine 5.0, we want >= 7.0 for traces.
@@ -61,6 +61,7 @@ apt-get -y install --no-install-recommends \
$EXTRA_LOCAL_PACKAGES \
bash \
ca-certificates \
curl \
firmware-realtek \
initramfs-tools \
jq \
@@ -103,7 +104,6 @@ apt-get -y install --no-install-recommends \
strace \
waffle-utils \
weston \
wget \
xinit \
xserver-xorg-core \
xwayland \

View File

@@ -15,6 +15,7 @@ apt-get update
apt-get install -y --no-remove \
$STABLE_EPHEMERAL \
curl \
crossbuild-essential-$arch \
libelf-dev:$arch \
libexpat1-dev:$arch \
@@ -36,8 +37,7 @@ apt-get install -y --no-remove \
libxrandr-dev:$arch \
libxshmfence-dev:$arch \
libxxf86vm-dev:$arch \
libwayland-dev:$arch \
wget
libwayland-dev:$arch
if [[ $arch != "armhf" ]]; then
# See the list of available architectures in https://apt.llvm.org/bullseye/dists/llvm-toolchain-bullseye-13/main/
@@ -47,6 +47,11 @@ if [[ $arch != "armhf" ]]; then
LLVM=11
fi
# We don't need clang-format for the crossbuilds, but the installed amd64
# package will conflict with libclang. Uninstall clang-format (and its
# problematic dependency) to fix.
apt-get remove -y clang-format-13 libclang-cpp13
# llvm-*-tools:$arch conflicts with python3:amd64. Install dependencies only
# with apt-get, then force-install llvm-*-{dev,tools}:$arch with dpkg to get
# around this.

View File

@@ -12,27 +12,29 @@ EPHEMERAL="\
apt-get install -y --no-remove $EPHEMERAL
# Fetch the NDK and extract just the toolchain we want.
ndk=android-ndk-r21d
wget -O $ndk.zip https://dl.google.com/android/repository/$ndk-linux-x86_64.zip
ndk=$ANDROID_NDK
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-o $ndk.zip https://dl.google.com/android/repository/$ndk-linux.zip
unzip -d / $ndk.zip "$ndk/toolchains/llvm/*"
rm $ndk.zip
# Since it was packed as a zip file, symlinks/hardlinks got turned into
# duplicate files. Turn them into hardlinks to save on container space.
rdfind -makehardlinks true -makeresultsfile false /android-ndk-r21d/
rdfind -makehardlinks true -makeresultsfile false /${ndk}/
# Drop some large tools we won't use in this build.
find /android-ndk-r21d/ -type f | grep -E -i "clang-check|clang-tidy|lldb" | xargs rm -f
find /${ndk}/ -type f | grep -E -i "clang-check|clang-tidy|lldb" | xargs rm -f
sh .gitlab-ci/container/create-android-ndk-pc.sh /$ndk zlib.pc "" "-lz" "1.2.3"
sh .gitlab-ci/container/create-android-ndk-pc.sh /$ndk zlib.pc "" "-lz" "1.2.3" $ANDROID_SDK_VERSION
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk x86_64-linux-android x86_64 x86_64
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk i686-linux-android x86 x86
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk aarch64-linux-android arm armv8
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk arm-linux-androideabi arm armv7hl armv7a-linux-androideabi
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk x86_64-linux-android x86_64 x86_64 $ANDROID_SDK_VERSION
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk i686-linux-android x86 x86 $ANDROID_SDK_VERSION
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk aarch64-linux-android aarch64 armv8 $ANDROID_SDK_VERSION
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk arm-linux-androideabi arm armv7hl $ANDROID_SDK_VERSION armv7a-linux-androideabi
# Not using build-libdrm.sh because we don't want its cleanup after building
# each arch. Fetch and extract now.
export LIBDRM_VERSION=libdrm-2.4.110
wget https://dri.freedesktop.org/libdrm/$LIBDRM_VERSION.tar.xz
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O https://dri.freedesktop.org/libdrm/$LIBDRM_VERSION.tar.xz
tar -xf $LIBDRM_VERSION.tar.xz && rm $LIBDRM_VERSION.tar.xz
for arch in \
@@ -61,7 +63,8 @@ done
rm -rf $LIBDRM_VERSION
export LIBELF_VERSION=libelf-0.8.13
wget https://fossies.org/linux/misc/old/$LIBELF_VERSION.tar.gz
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O https://fossies.org/linux/misc/old/$LIBELF_VERSION.tar.gz
# Not 100% sure who runs the mirror above so be extra careful
if ! echo "4136d7b4c04df68b686570afa26988ac ${LIBELF_VERSION}.tar.gz" | md5sum -c -; then
@@ -87,11 +90,11 @@ for arch in \
ccarch=armv7a-linux-androideabi
fi
export CC=/android-ndk-r21d/toolchains/llvm/prebuilt/linux-x86_64/bin/${arch}-ar
export CC=/android-ndk-r21d/toolchains/llvm/prebuilt/linux-x86_64/bin/${ccarch}29-clang
export CXX=/android-ndk-r21d/toolchains/llvm/prebuilt/linux-x86_64/bin/${ccarch}29-clang++
export LD=/android-ndk-r21d/toolchains/llvm/prebuilt/linux-x86_64/bin/${arch}-ld
export RANLIB=/android-ndk-r21d/toolchains/llvm/prebuilt/linux-x86_64/bin/${arch}-ranlib
export CC=/${ndk}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar
export CC=/${ndk}/toolchains/llvm/prebuilt/linux-x86_64/bin/${ccarch}${ANDROID_SDK_VERSION}-clang
export CXX=/${ndk}/toolchains/llvm/prebuilt/linux-x86_64/bin/${ccarch}${ANDROID_SDK_VERSION}-clang++
export LD=/${ndk}/toolchains/llvm/prebuilt/linux-x86_64/bin/${arch}-ld
export RANLIB=/${ndk}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib
# The configure script doesn't know about android, but doesn't really use the host anyway it
# seems

View File

@@ -24,6 +24,7 @@ apt-get -y install \
bison \
ccache \
cmake \
curl \
debootstrap \
fastboot \
flex \
@@ -60,7 +61,6 @@ apt-get -y install \
python3-requests \
python3-setuptools \
u-boot-tools \
wget \
xz-utils \
zlib1g-dev \
zstd

View File

@@ -11,6 +11,7 @@ apt-get update
apt-get install -y --no-remove \
cpio \
curl \
fastboot \
netcat \
procps \
@@ -19,19 +20,20 @@ apt-get install -y --no-remove \
python3-serial \
rsync \
snmp \
wget \
zstd
# setup SNMPv2 SMI MIB
wget https://raw.githubusercontent.com/net-snmp/net-snmp/master/mibs/SNMPv2-SMI.txt \
-O /usr/share/snmp/mibs/SNMPv2-SMI.txt
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
https://raw.githubusercontent.com/net-snmp/net-snmp/master/mibs/SNMPv2-SMI.txt \
-o /usr/share/snmp/mibs/SNMPv2-SMI.txt
. .gitlab-ci/container/baremetal_build.sh
if [[ "$arch" == "arm64" ]]; then
# This firmware file from Debian bullseye causes hangs
wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/qcom/a530_pfp.fw?id=d5f9eea5a251d43412b07f5295d03e97b89ac4a5 \
-O /rootfs-arm64/lib/firmware/qcom/a530_pfp.fw
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/qcom/a530_pfp.fw?id=d5f9eea5a251d43412b07f5295d03e97b89ac4a5" \
-o /rootfs-arm64/lib/firmware/qcom/a530_pfp.fw
fi
mkdir -p /baremetal-files/jetson-nano/boot/

View File

@@ -27,6 +27,8 @@ apt-get install -y --no-remove \
$STABLE_EPHEMERAL \
bison \
ccache \
curl \
clang-format-13 \
dpkg-cross \
findutils \
flex \
@@ -67,7 +69,6 @@ apt-get install -y --no-remove \
python3-requests \
qemu-user \
valgrind \
wget \
x11proto-dri2-dev \
x11proto-gl-dev \
x11proto-randr-dev \
@@ -78,8 +79,8 @@ apt-get install -y --no-remove \
# Needed for ci-fairy, this revision is able to upload files to MinIO
pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates@ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2
# We need at least 0.61.4 for proper Rust; 0.62 for modern meson env2mfile
pip3 install meson==0.63.3
# We need at least 1.0.0 for proper Rust; 0.62 for modern meson env2mfile
pip3 install meson==1.0.0
. .gitlab-ci/container/build-rust.sh

View File

@@ -17,7 +17,8 @@ mingw-w64-x86_64-zstd-1.5.2-2-any.pkg.tar.zst
for i in $MINGW_PACKET_LIST
do
wget -q https://mirror.msys2.org/mingw/mingw64/$i
curl -L -s --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "https://mirror.msys2.org/mingw/mingw64/$i"
tar xf $i --strip-components=1 -C /usr/x86_64-w64-mingw32/
done
popd

View File

@@ -14,7 +14,6 @@ STABLE_EPHEMERAL=" \
bzip2 \
libtool \
libssl-dev \
python3-pip \
"
apt-get update
@@ -43,8 +42,8 @@ apt-get install -y --no-remove \
llvm-13-dev \
llvm-11-dev \
ocl-icd-opencl-dev \
python3-freezegun \
python3-pytest \
python3-pip \
python3-venv \
procps \
spirv-tools \
shellcheck \
@@ -63,7 +62,8 @@ export XORGMACROS_VERSION=util-macros-1.19.0
. .gitlab-ci/container/build-mold.sh
wget $XORG_RELEASES/util/$XORGMACROS_VERSION.tar.bz2
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 -O \
$XORG_RELEASES/util/$XORGMACROS_VERSION.tar.bz2
tar -xvf $XORGMACROS_VERSION.tar.bz2 && rm $XORGMACROS_VERSION.tar.bz2
cd $XORGMACROS_VERSION; ./configure; make install; cd ..
rm -rf $XORGMACROS_VERSION
@@ -92,7 +92,7 @@ ninja install
popd
rm -rf DirectX-Headers
pip3 install lavacli==1.5.2
python3 -m pip install -r .gitlab-ci/lava/requirements.txt
# install bindgen
RUSTFLAGS='-L native=/usr/local/lib' cargo install \

View File

@@ -0,0 +1,99 @@
#!/usr/bin/env bash
# The relative paths in this file only become valid at runtime.
# shellcheck disable=SC1091
# shellcheck disable=SC2086 # we want word splitting
set -e
set -o xtrace
export DEBIAN_FRONTEND=noninteractive
# Ephemeral packages (installed for this script and removed again at the end)
STABLE_EPHEMERAL=" \
ccache \
unzip \
dpkg-dev \
build-essential:native \
config-package-dev \
debhelper-compat \
cmake \
ninja-build \
"
apt-get install -y --no-remove --no-install-recommends \
$STABLE_EPHEMERAL \
iproute2
############### Building ...
. .gitlab-ci/container/container_pre_build.sh
############### Downloading NDK for native builds for the guest ...
# Fetch the NDK and extract just the toolchain we want.
ndk=$ANDROID_NDK
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-o $ndk.zip https://dl.google.com/android/repository/$ndk-linux.zip
unzip -d / $ndk.zip
rm $ndk.zip
############### Build dEQP runner
export ANDROID_NDK_HOME=/$ndk
. .gitlab-ci/container/build-rust.sh
. .gitlab-ci/container/build-deqp-runner.sh
rm -rf /root/.cargo
rm -rf /root/.rustup
############### Build dEQP GL
DEQP_TARGET="android" \
EXTRA_CMAKE_ARGS="-DDEQP_TARGET_TOOLCHAIN=ndk-modern -DANDROID_NDK_PATH=/$ndk -DANDROID_ABI=x86_64 -DDE_ANDROID_API=28" \
. .gitlab-ci/container/build-deqp.sh
############### Downloading Cuttlefish resources ...
CUTTLEFISH_VERSION=9082637 # Chosen from https://ci.android.com/builds/branches/aosp-master/grid?
mkdir /cuttlefish
pushd /cuttlefish
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-o aosp_cf_x86_64_phone-img-$CUTTLEFISH_VERSION.zip https://ci.android.com/builds/submitted/$CUTTLEFISH_VERSION/aosp_cf_x86_64_phone-userdebug/latest/raw/aosp_cf_x86_64_phone-img-$CUTTLEFISH_VERSION.zip
unzip aosp_cf_x86_64_phone-img-$CUTTLEFISH_VERSION.zip
rm aosp_cf_x86_64_phone-img-$CUTTLEFISH_VERSION.zip
ls -lhS ./*
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
https://ci.android.com/builds/submitted/$CUTTLEFISH_VERSION/aosp_cf_x86_64_phone-userdebug/latest/raw/cvd-host_package.tar.gz | tar -xzvf-
popd
############### Building and installing Debian package ...
git clone --depth 1 https://github.com/google/android-cuttlefish.git
pushd android-cuttlefish
pushd base
dpkg-buildpackage -uc -us
popd
apt-get install -y ./cuttlefish-base_*.deb
popd
rm -rf android-cuttlefish
addgroup --system kvm
usermod -a -G kvm,cvdnetwork root
############### Uninstall the build software
rm -rf "/${ndk:?}"
ccache --show-stats
apt-get purge -y \
$STABLE_EPHEMERAL
apt-get autoremove -y --purge

View File

@@ -63,6 +63,7 @@ apt-get install -y \
sysvinit-core
apt-get install -y --no-remove \
curl \
git \
git-lfs \
inetutils-syslogd \
@@ -94,7 +95,6 @@ apt-get install -y --no-remove \
socat \
vulkan-tools \
waffle-utils \
wget \
xauth \
xvfb \
zlib1g \

View File

@@ -29,6 +29,7 @@ STABLE_EPHEMERAL=" \
libx11-xcb-dev \
libxcb-dri2-0-dev \
libxkbcommon-dev \
libxrandr-dev \
libxrender-dev \
llvm-13-dev \
llvm-11-dev \
@@ -68,7 +69,7 @@ apt-get install -y --no-remove \
############### Build piglit
PIGLIT_OPTS="-DPIGLIT_BUILD_CL_TESTS=ON -DPIGLIT_BUILD_DMA_BUF_TESTS=ON" . .gitlab-ci/container/build-piglit.sh
PIGLIT_OPTS="-DPIGLIT_BUILD_GLX_TESTS=ON -DPIGLIT_BUILD_CL_TESTS=ON -DPIGLIT_BUILD_DMA_BUF_TESTS=ON" . .gitlab-ci/container/build-piglit.sh
############### Build dEQP GL
@@ -78,6 +79,10 @@ DEQP_TARGET=surfaceless . .gitlab-ci/container/build-deqp.sh
. .gitlab-ci/container/build-apitrace.sh
############### Build validation layer for zink
. .gitlab-ci/container/build-vulkan-validation.sh
############### Uninstall the build software
ccache --show-stats

View File

@@ -51,12 +51,12 @@ STABLE_EPHEMERAL=" \
apt-get install -y --no-remove --no-install-recommends \
$STABLE_EPHEMERAL \
curl \
libepoxy0 \
libxcb-shm0 \
pciutils \
python3-lxml \
python3-simplejson \
wget \
xinit \
xserver-xorg-video-amdgpu \
xserver-xorg-video-ati
@@ -66,10 +66,6 @@ apt-key add .gitlab-ci/container/debian/winehq.gpg.key
apt-add-repository https://dl.winehq.org/wine-builds/debian/
apt-get update -q
# Needed for Valve's tracing jobs to collect information about the graphics
# hardware on the test devices.
pip3 install gfxinfo-mupuf==0.0.9
# workaround wine needing 32-bit
# https://bugs.winehq.org/show_bug.cgi?id=53393
apt-get install -y --no-remove wine-stable-amd64 # a requirement for wine-stable
@@ -105,7 +101,7 @@ wine64 \
. .gitlab-ci/container/build-hang-detection.sh
############### Build piglit
############### Build piglit replayer
PIGLIT_BUILD_TARGETS="piglit_replayer" . .gitlab-ci/container/build-piglit.sh

View File

@@ -16,13 +16,11 @@ EPHEMERAL="
pkgconfig(gbm)
pkgconfig(openssl)
unzip
wget
xz
"
dnf install -y --setopt=install_weak_deps=False \
bison \
ccache \
clang-devel \
flex \
gcc \
@@ -61,6 +59,7 @@ dnf install -y --setopt=install_weak_deps=False \
"pkgconfig(xshmfence)" \
"pkgconfig(xxf86vm)" \
"pkgconfig(zlib)" \
procps-ng \
python-unversioned-command \
python3-devel \
python3-mako \
@@ -79,7 +78,8 @@ export XORG_RELEASES=https://xorg.freedesktop.org/releases/individu
export XORGMACROS_VERSION=util-macros-1.19.0
wget $XORG_RELEASES/util/$XORGMACROS_VERSION.tar.bz2
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O $XORG_RELEASES/util/$XORGMACROS_VERSION.tar.bz2
tar -xvf $XORGMACROS_VERSION.tar.bz2 && rm $XORGMACROS_VERSION.tar.bz2
cd $XORGMACROS_VERSION; ./configure; make install; cd ..
rm -rf $XORGMACROS_VERSION

View File

@@ -174,6 +174,8 @@ debian/android_build:
- .use-debian/x86_build-base
variables:
MESA_IMAGE_TAG: &debian-android_build ${DEBIAN_BUILD_TAG}
ANDROID_SDK_VERSION: 33
ANDROID_NDK: android-ndk-r25b
.use-debian/android_build:
extends:
@@ -189,7 +191,7 @@ debian/android_build:
debian/x86_test-base:
extends: debian/x86_build-base
variables:
KERNEL_URL: &kernel-rootfs-url "https://gitlab.freedesktop.org/gfx-ci/linux/-/archive/v6.0-for-mesa-ci-93bd820c433b/linux-v6.0-for-mesa-ci-93bd820c433b.tar.bz2"
KERNEL_URL: &kernel-rootfs-url "https://gitlab.freedesktop.org/gfx-ci/linux/-/archive/v6.1-for-mesa-ci-439f86d0051b/linux-v6.1-for-mesa-ci-439f86d0051b.tar.bz2"
MESA_IMAGE_TAG: &debian-x86_test-base ${DEBIAN_BASE_TAG}
.use-debian/x86_test-base:
@@ -234,6 +236,23 @@ debian/x86_test-vk:
needs:
- debian/x86_test-vk
# Debian 11 based x86 test image for Android
debian/x86_test-android:
extends: .use-debian/x86_test-base
variables:
MESA_IMAGE_TAG: &debian-x86_test-android ${DEBIAN_X86_TEST_ANDROID_TAG}
ANDROID_NDK: android-ndk-r25b
.use-debian/x86_test-android:
extends:
- .set-image-base-tag
variables:
MESA_BASE_TAG: *debian-x86_test-base
MESA_IMAGE_PATH: ${DEBIAN_X86_TEST_ANDROID_IMAGE_PATH}
MESA_IMAGE_TAG: *debian-x86_test-android
needs:
- debian/x86_test-android
# Debian 11 based ARM build image
debian/arm_build:
extends:
@@ -261,7 +280,7 @@ alpine/x86_build:
- .fdo.container-build@alpine
- .container
variables:
FDO_DISTRIBUTION_VERSION: "3.16"
FDO_DISTRIBUTION_VERSION: "3.17"
MESA_IMAGE_TAG: &alpine-x86_build ${ALPINE_X86_BUILD_TAG}
.use-alpine/x86_build:
@@ -273,13 +292,13 @@ alpine/x86_build:
needs:
- alpine/x86_build
# Fedora 34 based x86 build image
# Fedora 36 based x86 build image
fedora/x86_build:
extends:
- .fdo.container-build@fedora
- .container
variables:
FDO_DISTRIBUTION_VERSION: 34
FDO_DISTRIBUTION_VERSION: 36
MESA_IMAGE_TAG: &fedora-x86_build ${FEDORA_X86_BUILD_TAG}
.use-fedora/x86_build:
@@ -478,6 +497,7 @@ windows_test_vs2019:
MESA_BASE_IMAGE_PATH: *windows_vs_image_path
MESA_BASE_IMAGE_TAG: *windows_vs_image_tag
MESA_BASE_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_BASE_IMAGE_PATH}:${MESA_BASE_IMAGE_TAG}"
timeout: 2h 30m
needs:
- windows_vs2019

View File

@@ -3,7 +3,8 @@
APITRACE_VERSION="11.1"
APITRACE_VERSION_DATE=""
wget "https://github.com/apitrace/apitrace/releases/download/${APITRACE_VERSION}/apitrace-${APITRACE_VERSION}${APITRACE_VERSION_DATE}-win64.7z"
curl -L -O --retry 4 -f --retry-all-errors --retry-delay 60 \
"https://github.com/apitrace/apitrace/releases/download/${APITRACE_VERSION}/apitrace-${APITRACE_VERSION}${APITRACE_VERSION_DATE}-win64.7z"
7zr x "apitrace-${APITRACE_VERSION}${APITRACE_VERSION_DATE}-win64.7z" \
"apitrace-${APITRACE_VERSION}${APITRACE_VERSION_DATE}-win64/bin/apitrace.exe" \
"apitrace-${APITRACE_VERSION}${APITRACE_VERSION_DATE}-win64/bin/d3dretrace.exe"

View File

@@ -5,7 +5,8 @@ set -e
dxvk_install_release() {
local DXVK_VERSION=${1:-"1.10.3"}
wget "https://github.com/doitsujin/dxvk/releases/download/v${DXVK_VERSION}/dxvk-${DXVK_VERSION}.tar.gz"
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \
-O "https://github.com/doitsujin/dxvk/releases/download/v${DXVK_VERSION}/dxvk-${DXVK_VERSION}.tar.gz"
tar xzpf dxvk-"${DXVK_VERSION}".tar.gz
# https://github.com/doitsujin/dxvk/issues/2921
sed -i 's/wine="wine"/wine="wine32"/' "dxvk-${DXVK_VERSION}"/setup_dxvk.sh

View File

@@ -11,7 +11,8 @@ export DEBIAN_FRONTEND=noninteractive
check_minio()
{
MINIO_PATH="${MINIO_HOST}/mesa-lava/$1/${DISTRIBUTION_TAG}/${DEBIAN_ARCH}"
if wget -q --method=HEAD "https://${MINIO_PATH}/done"; then
if curl -L --retry 4 -f --retry-all-errors --retry-delay 60 -s -X HEAD \
"https://${MINIO_PATH}/done"; then
exit
fi
}
@@ -42,6 +43,7 @@ if [[ "$DEBIAN_ARCH" = "arm64" ]]; then
DEVICE_TREES+=" arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-limozeen-nots-r5.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/qcom/sc7180-trogdor-kingoftown-r1.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dtb"
KERNEL_IMAGE_NAME="Image"
elif [[ "$DEBIAN_ARCH" = "armhf" ]]; then
@@ -84,11 +86,13 @@ fi
apt-get update
apt-get install -y --no-remove \
-o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' \
${ARCH_PACKAGES} \
automake \
bc \
clang \
cmake \
curl \
debootstrap \
git \
glslang-tools \
@@ -120,7 +124,6 @@ apt-get install -y --no-remove \
python3-numpy \
python3-serial \
unzip \
wget \
zstd
@@ -186,7 +189,7 @@ if [[ "$DEBIAN_ARCH" = "arm64" ]] \
fi
############### Build piglit
PIGLIT_OPTS="-DPIGLIT_BUILD_DMA_BUF_TESTS=ON" . .gitlab-ci/container/build-piglit.sh
PIGLIT_OPTS="-DPIGLIT_BUILD_DMA_BUF_TESTS=ON -DPIGLIT_BUILD_GLX_TESTS=ON" . .gitlab-ci/container/build-piglit.sh
mv /piglit /lava-files/rootfs-${DEBIAN_ARCH}/.
############### Build libva tests

View File

@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
set -e
@@ -13,6 +13,7 @@ mount -t devpts devpts /dev/pts
mount -t tmpfs tmpfs /tmp
. ${VM_TEMP_DIR}/crosvm-env.sh
. ${VM_TEMP_DIR}/setup-test-env.sh
# .gitlab-ci.yml script variable is using relative paths to install directory,
# so change to that dir before running `crosvm-script`
@@ -31,7 +32,7 @@ DMESG_PID=$!
# Transfer the errors and crosvm-script output via a pair of virtio-vsocks
socat -d -u pipe:${STDERR_FIFO} vsock-listen:${VSOCK_STDERR} &
socat -d -U vsock-listen:${VSOCK_STDOUT} \
system:"stdbuf -eL sh ${VM_TEMP_DIR}/crosvm-script.sh 2> ${STDERR_FIFO}; echo \$? > ${VM_TEMP_DIR}/exit_code",nofork
system:"stdbuf -eL bash ${VM_TEMP_DIR}/crosvm-script.sh 2> ${STDERR_FIFO}; echo \$? > ${VM_TEMP_DIR}/exit_code",nofork
kill ${DMESG_PID}
wait

View File

@@ -66,9 +66,11 @@ set_vsock_context || { echo "Could not generate crosvm vsock CID" >&2; exit 1; }
echo "Variables passed through:"
SCRIPT_DIR=$(readlink -en "${0%/*}")
${SCRIPT_DIR}/common/generate-env.sh | tee ${VM_TEMP_DIR}/crosvm-env.sh
cp ${SCRIPTS_DIR}/setup-test-env.sh ${VM_TEMP_DIR}/setup-test-env.sh
# Set the crosvm-script as the arguments of the current script
echo "$@" > ${VM_TEMP_DIR}/crosvm-script.sh
echo ". ${VM_TEMP_DIR}/setup-test-env.sh" > ${VM_TEMP_DIR}/crosvm-script.sh
echo "$@" >> ${VM_TEMP_DIR}/crosvm-script.sh
# Setup networking
/usr/sbin/iptables-legacy -w -t nat -A POSTROUTING -o eth0 -j MASQUERADE
@@ -97,7 +99,7 @@ GALLIUM_DRIVER=${CROSVM_GALLIUM_DRIVER} \
VK_ICD_FILENAMES=$CI_PROJECT_DIR/install/share/vulkan/icd.d/${CROSVM_VK_DRIVER}_icd.x86_64.json \
crosvm --no-syslog run \
--gpu "${CROSVM_GPU_ARGS}" --gpu-render-server "path=/usr/local/libexec/virgl_render_server" \
-m "${CROSVM_MEMORY:-4096}" -c 2 --disable-sandbox \
-m "${CROSVM_MEMORY:-4096}" -c "${CROSVM_CPU:-2}" --disable-sandbox \
--shared-dir /:my_root:type=fs:writeback=true:timeout=60:cache=always \
--host-ip "192.168.30.1" --netmask "255.255.255.0" --mac "AA:BB:CC:00:00:12" \
-s $VM_SOCKET \

115
.gitlab-ci/cuttlefish-runner.sh Executable file
View File

@@ -0,0 +1,115 @@
#!/usr/bin/env bash
section_start cuttlefish_setup "cuttlefish: setup"
set -xe
export HOME=/cuttlefish
export PATH=$PATH:/cuttlefish/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${CI_PROJECT_DIR}/install/lib/:/cuttlefish/lib64
export EGL_PLATFORM=surfaceless
syslogd
chown root.kvm /dev/kvm
/etc/init.d/cuttlefish-host-resources start
cd /cuttlefish
launch_cvd --verbosity=DEBUG --report_anonymous_usage_stats=n --cpus=8 --memory_mb=8192 --gpu_mode="$ANDROID_GPU_MODE" --daemon --enable_minimal_mode=true --guest_enforce_security=false --use_overlay=false
sleep 1
cd -
adb connect vsock:3:5555
ADB="adb -s vsock:3:5555"
$ADB root
sleep 1
$ADB shell echo Hi from Android
$ADB logcat dEQP:D *:S &
# overlay vendor
OV_TMPFS="/data/overlay-remount"
$ADB shell mkdir -p "$OV_TMPFS"
$ADB shell mount -t tmpfs none "$OV_TMPFS"
$ADB shell mkdir -p "$OV_TMPFS/vendor-upper"
$ADB shell mkdir -p "$OV_TMPFS/vendor-work"
opts="lowerdir=/vendor,upperdir=$OV_TMPFS/vendor-upper,workdir=$OV_TMPFS/vendor-work"
$ADB shell mount -t overlay -o "$opts" none /vendor
$ADB shell setenforce 0
# deqp
$ADB push /deqp/modules/egl/deqp-egl /data/.
$ADB push /deqp/assets/gl_cts/data/mustpass/egl/aosp_mustpass/3.2.6.x/egl-master.txt /data/.
$ADB push /deqp-runner/deqp-runner /data/.
# download mesa-x86_64-android.tar.zst
MESA_ANDROID_ARTIFACT_URL=https://${PIPELINE_ARTIFACTS_BASE}/${MINIO_ARTIFACT_NAME}.tar.zst
curl -L --retry 4 -f --retry-all-errors --retry-delay 60 -o ${MINIO_ARTIFACT_NAME}.tar.zst ${MESA_ANDROID_ARTIFACT_URL}
tar -xvf ${MINIO_ARTIFACT_NAME}.tar.zst
$ADB push install/all-skips.txt /data/.
$ADB push install/$GPU_VERSION-flakes.txt /data/.
$ADB push install/deqp-$DEQP_SUITE.toml /data/.
# remove 32 bits libs from /vendor/lib
$ADB shell rm /vendor/lib/dri/${ANDROID_DRIVER}_dri.so
$ADB shell rm /vendor/lib/libglapi.so
$ADB shell rm /vendor/lib/egl/libGLES_mesa.so
$ADB shell rm /vendor/lib/egl/libEGL_angle.so
$ADB shell rm /vendor/lib/egl/libEGL_emulation.so
$ADB shell rm /vendor/lib/egl/libGLESv1_CM_angle.so
$ADB shell rm /vendor/lib/egl/libGLESv1_CM_emulation.so
$ADB shell rm /vendor/lib/egl/libGLESv2_angle.so
$ADB shell rm /vendor/lib/egl/libGLESv2_emulation.so
# replace on /vendor/lib64
$ADB push install/lib/dri/${ANDROID_DRIVER}_dri.so /vendor/lib64/dri/${ANDROID_DRIVER}_dri.so
$ADB push install/lib/libglapi.so /vendor/lib64/libglapi.so
$ADB push install/lib/libEGL.so /vendor/lib64/egl/libEGL_mesa.so
$ADB shell rm /vendor/lib64/egl/libEGL_angle.so
$ADB shell rm /vendor/lib64/egl/libEGL_emulation.so
$ADB shell rm /vendor/lib64/egl/libGLESv1_CM_angle.so
$ADB shell rm /vendor/lib64/egl/libGLESv1_CM_emulation.so
$ADB shell rm /vendor/lib64/egl/libGLESv2_angle.so
$ADB shell rm /vendor/lib64/egl/libGLESv2_emulation.so
RESULTS=/data/results
uncollapsed_section_switch cuttlefish_test "cuttlefish: testing"
set +e
$ADB shell "mkdir /data/results; cd /data; strace -o /data/results/out.strace -f -s 1000 ./deqp-runner \
suite \
--suite /data/deqp-$DEQP_SUITE.toml \
--output $RESULTS \
--skips /data/all-skips.txt $DEQP_SKIPS \
--flakes /data/$GPU_VERSION-flakes.txt \
--testlog-to-xml /deqp/executor/testlog-to-xml \
--fraction-start $CI_NODE_INDEX \
--fraction `expr $CI_NODE_TOTAL \* ${DEQP_FRACTION:-1}` \
--jobs ${FDO_CI_CONCURRENT:-4} \
$DEQP_RUNNER_OPTIONS"
EXIT_CODE=$?
set -e
section_switch cuttlefish_results "cuttlefish: gathering the results"
$ADB pull $RESULTS results
cp /cuttlefish/cuttlefish/instances/cvd-1/logs/logcat results
cp /cuttlefish/cuttlefish/instances/cvd-1/kernel.log results
cp /cuttlefish/cuttlefish/instances/cvd-1/logs/launcher.log results
section_end cuttlefish_results
exit $EXIT_CODE

View File

@@ -1,6 +1,6 @@
#!/bin/bash
echo -e "\e[0Ksection_start:$(date +%s):test_setup[collapsed=true]\r\e[0Kpreparing test setup"
section_start test_setup "deqp: preparing test setup"
set -ex
@@ -116,18 +116,19 @@ if [ -e "$INSTALL/$GPU_VERSION-skips.txt" ]; then
DEQP_SKIPS="$DEQP_SKIPS $INSTALL/$GPU_VERSION-skips.txt"
fi
if [ "$PIGLIT_PLATFORM" != "gbm" ] ; then
DEQP_SKIPS="$DEQP_SKIPS $INSTALL/x11-skips.txt"
fi
if [ "$PIGLIT_PLATFORM" = "gbm" ]; then
DEQP_SKIPS="$DEQP_SKIPS $INSTALL/gbm-skips.txt"
fi
report_load() {
echo "System load: $(cut -d' ' -f1-3 < /proc/loadavg)"
echo "# of CPU cores: $(cat /proc/cpuinfo | grep processor | wc -l)"
}
# wrapper to supress +x to avoid spamming the log
quiet() {
set +x
"$@"
set -x
}
if [ "$GALLIUM_DRIVER" = "virpipe" ]; then
# deqp is to use virpipe, and virgl_test_server llvmpipe
export GALLIUM_DRIVER="$GALLIUM_DRIVER"
@@ -152,11 +153,7 @@ if [ -z "$DEQP_SUITE" ]; then
fi
fi
set +x
echo -e "\e[0Ksection_end:$(date +%s):test_setup\r\e[0K"
echo -e "\e[0Ksection_start:$(date +%s):deqp[collapsed=false]\r\e[0Kdeqp-runner"
set -x
uncollapsed_section_switch deqp "deqp: deqp-runner"
set +e
if [ -z "$DEQP_SUITE" ]; then
@@ -189,11 +186,10 @@ fi
DEQP_EXITCODE=$?
set +x
echo -e "\e[0Ksection_end:$(date +%s):deqp\r\e[0K"
report_load
echo -e "\e[0Ksection_start:$(date +%s):test_post_process[collapsed=true]\r\e[0Kpost-processing test results"
section_switch test_post_process "deqp: post-processing test results"
set -x
# Remove all but the first 50 individual XML files uploaded as artifacts, to
@@ -230,6 +226,11 @@ if [ -n "$FLAKES_CHANNEL" ]; then
--branch-title "${CI_MERGE_REQUEST_TITLE:-$CI_COMMIT_TITLE}"
fi
echo -e "\e[0Ksection_end:$(date +%s):test_post_process\r\e[0K"
# Compress results.csv to save on bandwidth during the upload of artifacts to
# GitLab. This reduces the size in a VKCTS run from 135 to 7.6MB, and takes
# 0.17s on a Ryzen 5950X (16 threads, 0.95s when limited to 1 thread).
zstd --rm -T0 -8qc $RESULTS/results.csv -o $RESULTS/results.csv.zst
section_end test_post_process
exit $DEQP_EXITCODE

View File

@@ -16,8 +16,9 @@ fi
TMP_DIR=$(mktemp -d)
echo "Downloading archived master..."
/usr/bin/wget -O $TMP_DIR/$CI_PROJECT_NAME.tar.gz \
https://${MINIO_HOST}/git-cache/${FDO_UPSTREAM_REPO}/$CI_PROJECT_NAME.tar.gz
/usr/bin/wget \
-O "$TMP_DIR/$CI_PROJECT_NAME.tar.gz" \
"https://${MINIO_HOST}/git-cache/${FDO_UPSTREAM_REPO}/$CI_PROJECT_NAME.tar.gz"
# check wget error code
if [[ $? -ne 0 ]]

7
.gitlab-ci/gbm-skips.txt Normal file
View File

@@ -0,0 +1,7 @@
# gbm does not support reading the front buffer after a swapbuffers, and that's
# intentional. Don't bother running these tests when PIGLIT_PLATFORM=gbm.
#
# Note that this doesn't include tests like fbo-sys-blit, which draw/read front
# but don't swap.
spec@!opengl 1.0@gl-1.0-swapbuffers-behavior
spec@!opengl 1.1@read-front

View File

@@ -1,9 +1,9 @@
variables:
DEBIAN_X86_BUILD_BASE_IMAGE: "debian/x86_build-base"
DEBIAN_BASE_TAG: "2023-01-10-robust-wget"
DEBIAN_BASE_TAG: "2023-03-27-virglrenderer-crosvm"
DEBIAN_X86_BUILD_IMAGE_PATH: "debian/x86_build"
DEBIAN_BUILD_TAG: "2023-01-09-lavacli"
DEBIAN_BUILD_TAG: "2023-04-03-android-meson-aarch64"
DEBIAN_X86_BUILD_MINGW_IMAGE_PATH: "debian/x86_build-mingw"
DEBIAN_BUILD_MINGW_TAG: "2023-01-03-ci-libva-2.17"
@@ -13,19 +13,21 @@ variables:
DEBIAN_X86_TEST_IMAGE_GL_PATH: "debian/x86_test-gl"
DEBIAN_X86_TEST_IMAGE_VK_PATH: "debian/x86_test-vk"
DEBIAN_X86_TEST_IMAGE_PATH: ${DEBIAN_X86_TEST_IMAGE_GL_PATH}
DEBIAN_X86_TEST_ANDROID_IMAGE_PATH: "debian/x86_test-android"
DEBIAN_X86_TEST_GL_TAG: "2023-01-08-weston-xwayland"
DEBIAN_X86_TEST_VK_TAG: "2022-12-12-vkd3d-proton-uprev"
DEBIAN_X86_TEST_ANDROID_TAG: "2023-02-20-uprev-deqp-v2"
DEBIAN_X86_TEST_GL_TAG: "2023-04-11-piglit-355ad6bc"
DEBIAN_X86_TEST_VK_TAG: "2023-04-11-piglit-355ad6bc"
ALPINE_X86_BUILD_TAG: "2023-01-10-robust-wget"
FEDORA_X86_BUILD_TAG: "2023-01-10-robust-wget"
KERNEL_ROOTFS_TAG: "2023-01-10-virglrenderer"
ALPINE_X86_BUILD_TAG: "2023-03-20-3.17-bump"
FEDORA_X86_BUILD_TAG: "2023-03-13-procps-ng"
KERNEL_ROOTFS_TAG: "2023-04-11-piglit-355ad6bc"
WINDOWS_X64_VS_PATH: "windows/x64_vs"
WINDOWS_X64_VS_TAG: "2022-10-20-upgrade-zlib"
WINDOWS_X64_BUILD_PATH: "windows/x64_build"
WINDOWS_X64_BUILD_TAG: "2023-01-03-ci-libva-2.17"
WINDOWS_X64_BUILD_TAG: "2023-04-05-agility-710"
WINDOWS_X64_TEST_PATH: "windows/x64_test"
WINDOWS_X64_TEST_TAG: "2023-01-03-piglit-waffle"
WINDOWS_X64_TEST_TAG: "2023-04-05-agility-710"

View File

@@ -4,7 +4,6 @@
variables:
GIT_STRATEGY: none # testing doesn't build anything from source
FDO_CI_CONCURRENT: 6 # should be replaced by per-machine definitions
DEQP_VER: gles2
# proxy used to cache data locally
FDO_HTTP_CACHE_URI: "http://caching-proxy/cache/?uri="
# base system generated by the container build job, shared between many pipelines
@@ -32,7 +31,7 @@
tags:
- $RUNNER_TAG
after_script:
- wget -q "https://${JOB_RESULTS_PATH}" -O- | tar --zstd -x
- curl -L --retry 4 -f --retry-all-errors --retry-delay 60 -s "https://${JOB_RESULTS_PATH}" | tar --zstd -x
.lava-test:armhf:
variables:
@@ -40,7 +39,6 @@
KERNEL_IMAGE_NAME: zImage
KERNEL_IMAGE_TYPE: "zimage"
BOOT_METHOD: u-boot
HWCI_TEST_SCRIPT: "/install/deqp-runner.sh"
extends:
- .use-debian/arm_build # for same $MESA_ARTIFACTS_TAG as in kernel+rootfs_armhf
- .use-debian/x86_build
@@ -51,13 +49,18 @@
- debian/x86_build
- debian-armhf
.lava-test-deqp:armhf:
extends:
- .lava-test:armhf
variables:
HWCI_TEST_SCRIPT: "/install/deqp-runner.sh"
.lava-test:arm64:
variables:
ARCH: arm64
KERNEL_IMAGE_NAME: Image
KERNEL_IMAGE_TYPE: "image"
BOOT_METHOD: u-boot
HWCI_TEST_SCRIPT: "/install/deqp-runner.sh"
extends:
- .use-debian/arm_build # for same $MESA_ARTIFACTS_TAG as in kernel+rootfs_arm64
- .use-debian/x86_build
@@ -70,13 +73,18 @@
- debian/x86_build
- debian-arm64
.lava-test-deqp:arm64:
variables:
HWCI_TEST_SCRIPT: "/install/deqp-runner.sh"
extends:
- .lava-test:arm64
.lava-test:amd64:
variables:
ARCH: amd64
KERNEL_IMAGE_NAME: bzImage
KERNEL_IMAGE_TYPE: "zimage"
BOOT_METHOD: u-boot
HWCI_TEST_SCRIPT: "/install/deqp-runner.sh"
extends:
- .use-debian/x86_build-base # for same $MESA_ARTIFACTS_BASE_TAG as in kernel+rootfs_amd64
- .use-debian/x86_build
@@ -86,6 +94,12 @@
- kernel+rootfs_amd64
- debian-testing
.lava-test-deqp:amd64:
variables:
HWCI_TEST_SCRIPT: "/install/deqp-runner.sh"
extends:
- .lava-test:amd64
.lava-traces-base:
variables:
HWCI_TEST_SCRIPT: "/install/piglit/piglit-traces.sh"
@@ -121,3 +135,8 @@
extends:
- .lava-test:amd64
- .lava-piglit
.lava-piglit:arm64:
extends:
- .lava-test:arm64
- .lava-piglit

View File

@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#
# Copyright (C) 2022 Collabora Limited
# Author: Guilherme Gallo <guilherme.gallo@collabora.com>
@@ -26,6 +26,11 @@
set -ex
# Use this script in a python virtualenv for isolation
python3 -m venv .venv
. .venv/bin/activate
python3 -m pip install -r ${CI_PROJECT_DIR}/.gitlab-ci/lava/requirements-test.txt
TEST_DIR=${CI_PROJECT_DIR}/.gitlab-ci/tests
PYTHONPATH="${TEST_DIR}:${PYTHONPATH}" python3 -m \

View File

@@ -5,7 +5,8 @@ set -x
# Try to use the kernel and rootfs built in mainline first, so we're more
# likely to hit cache
if wget -q --method=HEAD "https://${BASE_SYSTEM_MAINLINE_HOST_PATH}/done"; then
if curl -s -X HEAD -L --retry 4 -f --retry-all-errors --retry-delay 60 \
"https://${BASE_SYSTEM_MAINLINE_HOST_PATH}/done"; then
BASE_SYSTEM_HOST_PATH="${BASE_SYSTEM_MAINLINE_HOST_PATH}"
else
BASE_SYSTEM_HOST_PATH="${BASE_SYSTEM_FORK_HOST_PATH}"
@@ -17,17 +18,27 @@ mkdir -p results/job-rootfs-overlay/
cp artifacts/ci-common/capture-devcoredump.sh results/job-rootfs-overlay/
cp artifacts/ci-common/init-*.sh results/job-rootfs-overlay/
cp artifacts/ci-common/intel-gpu-freq.sh results/job-rootfs-overlay/
cp "$SCRIPTS_DIR"/setup-test-env.sh results/job-rootfs-overlay/
# Prepare env vars for upload.
KERNEL_IMAGE_BASE_URL="https://${BASE_SYSTEM_HOST_PATH}" \
artifacts/ci-common/generate-env.sh > results/job-rootfs-overlay/set-job-env-vars.sh
echo -e "\e[0Ksection_start:$(date +%s):variables[collapsed=true]\r\e[0KVariables passed through:"
section_start variables "Variables passed through:"
cat results/job-rootfs-overlay/set-job-env-vars.sh
echo -e "\e[0Ksection_end:$(date +%s):variables\r\e[0K"
section_end variables
tar zcf job-rootfs-overlay.tar.gz -C results/job-rootfs-overlay/ .
ci-fairy s3cp --token-file "${CI_JOB_JWT_FILE}" job-rootfs-overlay.tar.gz "https://${JOB_ROOTFS_OVERLAY_PATH}"
ARTIFACT_URL="${FDO_HTTP_CACHE_URI:-}https://${BUILD_PATH}"
# Make it take the mesa build from MINIO_ARTIFACT_NAME, if it is specified in
# the environment. This will make the LAVA behavior consistent with the
# baremetal jobs.
if [ -n "${MINIO_ARTIFACT_NAME}" ]
then
ARTIFACT_URL="${FDO_HTTP_CACHE_URI:-}https://${PIPELINE_ARTIFACTS_BASE}/${MINIO_ARTIFACT_NAME}.tar.zst"
fi
touch results/lava.log
tail -f results/lava.log &
PYTHONPATH=artifacts/ artifacts/lava/lava_job_submitter.py \
@@ -35,7 +46,7 @@ PYTHONPATH=artifacts/ artifacts/lava/lava_job_submitter.py \
--pipeline-info "$CI_JOB_NAME: $CI_PIPELINE_URL on $CI_COMMIT_REF_NAME ${CI_NODE_INDEX}/${CI_NODE_TOTAL}" \
--rootfs-url-prefix "https://${BASE_SYSTEM_HOST_PATH}" \
--kernel-url-prefix "https://${BASE_SYSTEM_HOST_PATH}" \
--build-url "${FDO_HTTP_CACHE_URI:-}https://${BUILD_PATH}" \
--build-url "${ARTIFACT_URL}" \
--job-rootfs-overlay-url "${FDO_HTTP_CACHE_URI:-}https://${JOB_ROOTFS_OVERLAY_PATH}" \
--job-timeout ${JOB_TIMEOUT:-30} \
--first-stage-init artifacts/ci-common/init-stage1.sh \

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (C) 2020 - 2022 Collabora Limited
# Copyright (C) 2020 - 2023 Collabora Limited
# Authors:
# Gustavo Padovan <gustavo.padovan@collabora.com>
# Guilherme Gallo <guilherme.gallo@collabora.com>
@@ -61,6 +61,11 @@ NUMBER_OF_RETRIES_TIMEOUT_DETECTION = int(getenv("LAVA_NUMBER_OF_RETRIES_TIMEOUT
# How many attempts should be made when a timeout happen during LAVA device boot.
NUMBER_OF_ATTEMPTS_LAVA_BOOT = int(getenv("LAVA_NUMBER_OF_ATTEMPTS_LAVA_BOOT", 3))
# Supports any integers in [0, 100].
# The scheduler considers the job priority when ordering the queue
# to consider which job should run next.
JOB_PRIORITY = int(getenv("LAVA_JOB_PRIORITY", 75))
def generate_lava_yaml_payload(args) -> dict[str, Any]:
# General metadata and permissions, plus also inexplicably kernel arguments
@@ -68,7 +73,7 @@ def generate_lava_yaml_payload(args) -> dict[str, Any]:
'job_name': 'mesa: {}'.format(args.pipeline_info),
'device_type': args.device_type,
'visibility': { 'group': [ args.visibility_group ] },
'priority': 75,
'priority': JOB_PRIORITY,
'context': {
'extra_nfsroot_args': ' init=/init rootwait usbcore.quirks=0bda:8153:k'
},
@@ -161,7 +166,7 @@ def generate_lava_yaml_payload(args) -> dict[str, Any]:
x.rstrip() for x in init_sh if not x.startswith("#") and x.rstrip()
]
run_steps.append(
f"wget -S --progress=dot:giga -O- {args.job_rootfs_overlay_url} | tar -xz -C /",
f"curl -L --retry 4 -f --retry-all-errors --retry-delay 60 {args.job_rootfs_overlay_url} | tar -xz -C /",
)
if args.jwt_file:
@@ -180,7 +185,7 @@ def generate_lava_yaml_payload(args) -> dict[str, Any]:
run_steps += [
'mkdir -p {}'.format(args.ci_project_dir),
'wget -S --progress=dot:giga -O- {} | tar --zstd -x -C {}'.format(args.build_url, args.ci_project_dir),
'curl {} | tar --zstd -x -C {}'.format(args.build_url, args.ci_project_dir),
# Sleep a bit to give time for bash to dump shell xtrace messages into
# console which may cause interleaving with LAVA_SIGNAL_STARTTC in some

View File

@@ -0,0 +1,6 @@
-r requirements.txt
freezegun==1.1.0
hypothesis==6.67.1
pytest==7.2.1
pytest-cov==3.0.0
PyYAML==5.3.1

View File

@@ -0,0 +1 @@
lavacli==1.5.2

View File

@@ -0,0 +1,35 @@
import os
import re
from enum import Enum
class LavaFarm(Enum):
"""Enum class representing the different LAVA farms."""
LIMA = 1
COLLABORA = 2
UNKNOWN = 3
LAVA_FARM_RUNNER_PATTERNS: dict[LavaFarm, str] = {
# Lima pattern comes first, since it has the same prefix as the
# Collabora pattern.
LavaFarm.LIMA: r"^mesa-ci-[\x01-\x7F]+-lava-lima$",
LavaFarm.COLLABORA: r"^mesa-ci-[\x01-\x7F]+-lava-[\x01-\x7F]+$",
LavaFarm.UNKNOWN: r"^[\x01-\x7F]+",
}
def get_lava_farm() -> LavaFarm:
"""
Returns the LAVA farm based on the RUNNER_TAG environment variable.
:return: The LAVA farm
"""
runner_tag: str = os.getenv("RUNNER_TAG", "unknown")
for farm, pattern in LAVA_FARM_RUNNER_PATTERNS.items():
if re.match(pattern, runner_tag):
return farm
raise ValueError(f"Unknown LAVA runner tag: {runner_tag}")

View File

@@ -20,6 +20,7 @@ from typing import Optional, Union
from lava.exceptions import MesaCITimeoutError
from lava.utils.console_format import CONSOLE_LOG
from lava.utils.gitlab_section import GitlabSection
from lava.utils.lava_farm import LavaFarm, get_lava_farm
from lava.utils.lava_log_hints import LAVALogHints
from lava.utils.log_section import (
DEFAULT_GITLAB_SECTION_TIMEOUTS,
@@ -38,6 +39,8 @@ class LogFollower:
fallback_timeout: timedelta = FALLBACK_GITLAB_SECTION_TIMEOUT
_buffer: list[str] = field(default_factory=list, init=False)
log_hints: LAVALogHints = field(init=False)
lava_farm: LavaFarm = field(init=False, default=get_lava_farm())
_merge_next_line: str = field(default_factory=str, init=False)
def __post_init__(self):
section_is_created = bool(self.current_section)
@@ -124,6 +127,52 @@ class LogFollower:
return False
def remove_trailing_whitespace(self, line: dict[str, str]) -> None:
"""
Removes trailing whitespace from the end of the `msg` value in the log line dictionary.
Args:
line: A dictionary representing a single log line.
Note:
LAVA treats carriage return characters as a line break, so each carriage return in an output console
is mapped to a console line in LAVA. This method removes trailing `\r\n` characters from log lines.
"""
msg: Optional[str] = line.get("msg")
if not msg:
return False
messages = [msg] if isinstance(msg, str) else msg
for message in messages:
# LAVA logs brings raw messages, which includes newlines characters as \r\n.
line["msg"]: str = re.sub(r"\r\n$", "", message)
def merge_carriage_return_lines(self, line: dict[str, str]) -> bool:
"""
Merges lines that end with a carriage return character into a single line.
Args:
line: A dictionary representing a single log line.
Returns:
A boolean indicating whether the current line has been merged with the next line.
Note:
LAVA treats carriage return characters as a line break, so each carriage return in an output console
is mapped to a console line in LAVA.
"""
if line["msg"].endswith("\r"):
self._merge_next_line += line["msg"]
return True
if self._merge_next_line:
line["msg"] = self._merge_next_line + line["msg"]
self._merge_next_line = ""
return False
def feed(self, new_lines: list[dict[str, str]]) -> bool:
"""Input data to be processed by LogFollower instance
Returns true if the DUT (device under test) seems to be alive.
@@ -135,9 +184,14 @@ class LogFollower:
is_job_healthy = False
for line in new_lines:
self.remove_trailing_whitespace(line)
if self.detect_kernel_dump_line(line):
continue
if self.merge_carriage_return_lines(line):
continue
# At least we are fed with a non-kernel dump log, it seems that the
# job is progressing
is_job_healthy = True
@@ -166,7 +220,7 @@ class LogFollower:
elif line["lvl"] == "input":
prefix = "$ "
suffix = ""
elif line["lvl"] == "target":
elif line["lvl"] == "target" and self.lava_farm != LavaFarm.COLLABORA:
# gl_section_fix_gen will output the stored line if it can't find a
# match for the first split line
# So we can recover it and put it back to the buffer
@@ -211,7 +265,7 @@ def fix_lava_gitlab_section_log():
def print_log(msg):
def print_log(msg: str) -> None:
# Reset color from timestamp, since `msg` can tint the terminal color
print(f"{CONSOLE_LOG['RESET']}{datetime.now()}: {msg}")

View File

@@ -1,22 +1,29 @@
#!/bin/bash
#!/usr/bin/env bash
section_switch meson-configure "meson: configure"
set -e
set -o xtrace
CROSS_FILE=/cross_file-"$CROSS".txt
export PATH=$PATH:$PWD/.gitlab-ci/build
touch native.file
printf > native.file "%s\n" \
"[binaries]" \
"c = 'compiler-wrapper-${CC:-gcc}.sh'" \
"cpp = 'compiler-wrapper-${CXX:-g++}.sh'"
# We need to control the version of llvm-config we're using, so we'll
# tweak the cross file or generate a native file to do so.
if test -n "$LLVM_VERSION"; then
LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
echo -e "[binaries]\nllvm-config = '`which $LLVM_CONFIG`'" > native.file
echo "llvm-config = '`which $LLVM_CONFIG`'" >> native.file
if [ -n "$CROSS" ]; then
sed -i -e '/\[binaries\]/a\' -e "llvm-config = '`which $LLVM_CONFIG`'" $CROSS_FILE
fi
$LLVM_CONFIG --version
else
rm -f native.file
touch native.file
fi
# cross-xfail-$CROSS, if it exists, contains a list of tests that are expected
@@ -59,15 +66,19 @@ case $CI_JOB_NAME in
esac
rm -rf _build
meson _build --native-file=native.file \
meson setup _build \
--native-file=native.file \
--wrap-mode=nofallback \
--force-fallback-for perfetto \
${CROSS+--cross "$CROSS_FILE"} \
-D prefix=`pwd`/install \
-D libdir=lib \
-D buildtype=${BUILDTYPE:-debug} \
-D build-tests=true \
-D c_args="$(echo -n $C_ARGS)" \
-D c_link_args="$(echo -n $C_LINK_ARGS)" \
-D cpp_args="$(echo -n $CPP_ARGS)" \
-D cpp_link_args="$(echo -n $CPP_LINK_ARGS)" \
-D enable-glcpp-tests=false \
-D libunwind=${UNWIND} \
${DRI_LOADERS} \
@@ -79,11 +90,17 @@ meson _build --native-file=native.file \
${EXTRA_OPTION}
cd _build
meson configure
uncollapsed_section_switch meson-build "meson: build"
if command -V mold &> /dev/null ; then
mold --run ninja
else
ninja
fi
uncollapsed_section_switch meson-test "meson: test"
LC_ALL=C.UTF-8 meson test --num-processes ${FDO_CI_CONCURRENT:-4} --print-errorlogs ${MESON_TEST_ARGS}
if command -V mold &> /dev/null ; then
mold --run ninja install
@@ -91,3 +108,4 @@ else
ninja install
fi
cd ..
section_end meson-test

View File

@@ -1,7 +1,7 @@
#!/bin/sh
if [ "x$STRACEDIR" = "x" ]; then
STRACEDIR=meson-logs/strace/$(for i in $@; do basename -z -- $i; echo -n _; done)
STRACEDIR=meson-logs/strace/$(for i in $@; do basename -z -- $i; echo -n _; done).$$
fi
mkdir -p $STRACEDIR

View File

@@ -76,6 +76,14 @@ if [ -e "$INSTALL/$GPU_VERSION-skips.txt" ]; then
PIGLIT_SKIPS="$PIGLIT_SKIPS $INSTALL/$GPU_VERSION-skips.txt"
fi
if [ "$PIGLIT_PLATFORM" != "gbm" ] ; then
PIGLIT_SKIPS="$PIGLIT_SKIPS $INSTALL/x11-skips.txt"
fi
if [ "$PIGLIT_PLATFORM" = "gbm" ]; then
PIGLIT_SKIPS="$PIGLIT_SKIPS $INSTALL/gbm-skips.txt"
fi
set +e
piglit-runner \
@@ -114,4 +122,9 @@ if [ -n "$FLAKES_CHANNEL" ]; then
--branch-title "${CI_MERGE_REQUEST_TITLE:-$CI_COMMIT_TITLE}"
fi
# Compress results.csv to save on bandwidth during the upload of artifacts to
# GitLab. This reduces a full piglit run to 550 KB, down from 6 MB, and takes
# 55ms on my Ryzen 5950X (with or without parallelism).
zstd --rm -T0 -8qc $RESULTS/results.csv -o $RESULTS/results.csv.zst
exit $PIGLIT_EXITCODE

View File

@@ -12,8 +12,8 @@ if [ "$PIGLIT_REPLAY_SUBCOMMAND" = "profile" ]; then
# workaround for older Debian Bullseye libyaml 0.2.2
sed -i "/^%YAML 1\.2$/d" "$PIGLIT_REPLAY_DESCRIPTION_FILE"
yq -i -Y '. | del(.traces[][] | select(.label[0,1,2,3,4,5,6,7,8,9] == "no-perf"))' \
"$PIGLIT_REPLAY_DESCRIPTION_FILE" # label positions are a bit hack
yq -iY 'del(.traces[][] | select(.label[]? == "no-perf"))' \
"$PIGLIT_REPLAY_DESCRIPTION_FILE"
fi
# WINE
@@ -129,7 +129,7 @@ replay_minio_upload_images() {
fi
__MINIO_PATH="$PIGLIT_REPLAY_REFERENCE_IMAGES_BASE"
__DESTINATION_FILE_PATH="${line##*-}"
if wget -q --method=HEAD "https://${__MINIO_PATH}/${__DESTINATION_FILE_PATH}" 2>/dev/null; then
if curl -L -s -X HEAD "https://${__MINIO_PATH}/${__DESTINATION_FILE_PATH}" 2>/dev/null; then
continue
fi
else

View File

@@ -1,4 +1,6 @@
#!/bin/bash
#!/usr/bin/env bash
section_switch prepare-artifacts "artifacts: prepare"
set -e
set -o xtrace
@@ -36,6 +38,7 @@ cp -Rp .gitlab-ci/*.txt install/
cp -Rp .gitlab-ci/report-flakes.py install/
cp -Rp .gitlab-ci/valve install/
cp -Rp .gitlab-ci/vkd3d-proton install/
cp -Rp .gitlab-ci/setup-test-env.sh install/
cp -Rp .gitlab-ci/*-runner.sh install/
find . -path \*/ci/\*.txt \
-o -path \*/ci/\*.toml \
@@ -56,3 +59,5 @@ if [ -n "$MINIO_ARTIFACT_NAME" ]; then
zstd artifacts/install.tar -o ${MINIO_ARTIFACT_NAME}
ci-fairy s3cp --token-file "${CI_JOB_JWT_FILE}" ${MINIO_ARTIFACT_NAME} https://${PIPELINE_ARTIFACTS_BASE}/${MINIO_ARTIFACT_NAME}
fi
section_end prepare-artifacts

View File

@@ -1,7 +1,6 @@
#!/usr/bin/env bash
set -e
echo -e "\e[0Ksection_start:$(date +%s):shader-db-prepare[collapsed=true]\r\e[0KPreparing shader-db"
ARTIFACTSDIR=$(pwd)/shader-db
mkdir -p "$ARTIFACTSDIR"
export DRM_SHIM_DEBUG=true
@@ -10,32 +9,31 @@ LIBDIR=$(pwd)/install/lib
export LD_LIBRARY_PATH=$LIBDIR
cd /usr/local/shader-db
echo -e "\e[0Ksection_end:$(date +%s):shader-db-prepare\r\e[0K"
for driver in freedreno intel v3d vc4; do
echo -e "\e[0Ksection_start:$(date +%s):shader-db-${driver}[collapsed=true]\r\e[0KRunning shader-db for $driver"
section_start shader-db-${driver} "Running shader-db for $driver"
env LD_PRELOAD="$LIBDIR/lib${driver}_noop_drm_shim.so" \
./run -j"${FDO_CI_CONCURRENT:-4}" ./shaders \
> "$ARTIFACTSDIR/${driver}-shader-db.txt"
echo -e "\e[0Ksection_end:$(date +%s):shader-db-${driver}\r\e[0K"
section_end shader-db-${driver}
done
# Run shader-db over a number of supported chipsets for nouveau
for chipset in 40 a3 c0 e4 f0 134 162; do
echo -e "\e[0Ksection_start:$(date +%s):shader-db-nouveau-${chipset}[collapsed=true]\r\e[0KRunning shader-db for nouveau - ${chipset}"
section_start shader-db-nouveau-${chipset} "Running shader-db for nouveau - ${chipset}"
env LD_PRELOAD="$LIBDIR/libnouveau_noop_drm_shim.so" \
NOUVEAU_CHIPSET=${chipset} \
./run -j"${FDO_CI_CONCURRENT:-4}" ./shaders \
> "$ARTIFACTSDIR/nouveau-${chipset}-shader-db.txt"
echo -e "\e[0Ksection_end:$(date +%s):shader-db-nouveau-${chipset}\r\e[0K"
section_end shader-db-nouveau-${chipset}
done
# Run shader-db for r300 (RV370 and RV515)
for chipset in 0x5460 0x7140; do
echo -e "\e[0Ksection_start:$(date +%s):shader-db-r300-${chipset}[collapsed=true]\r\e[0KRunning shader-db for r300 - ${chipset}"
section_start shader-db-r300-${chipset} "Running shader-db for r300 - ${chipset}"
env LD_PRELOAD="$LIBDIR/libradeon_noop_drm_shim.so" \
RADEON_GPU_ID=${chipset} \
./run -j"${FDO_CI_CONCURRENT:-4}" -o r300 ./shaders \
> "$ARTIFACTSDIR/r300-${chipset}-shader-db.txt"
echo -e "\e[0Ksection_end:$(date +%s):shader-db-r300-${chipset}\r\e[0K"
section_end shader-db-r300-${chipset}
done

View File

@@ -0,0 +1,100 @@
#!/usr/bin/env bash
function x_off {
if [[ "$-" == *"x"* ]]; then
state_x=1
set +x
else
state_x=0
fi
}
# TODO: implement x_on !
function error {
x_off 2>/dev/null
RED="\e[0;31m"
ENDCOLOR="\e[0m"
# we force the following to be not in a section
section_end $CURRENT_SECTION
DATE_S=$(date -u +"%s")
JOB_START_S=$(date -u +"%s" -d "${CI_JOB_STARTED_AT:?}")
CURR_TIME=$((DATE_S-JOB_START_S))
CURR_MINSEC="$(printf "%02d" $((CURR_TIME/60))):$(printf "%02d" $((CURR_TIME%60)))"
echo -e "\n${RED}[${CURR_MINSEC}] ERROR: $*${ENDCOLOR}\n"
[ "$state_x" -eq 0 ] || set -x
}
function trap_err {
error ${CURRENT_SECTION:-'unknown-section'}: ret code: $*
}
function build_section_start {
local section_params=$1
shift
local section_name=$1
CURRENT_SECTION=$section_name
shift
CYAN="\e[0;36m"
ENDCOLOR="\e[0m"
DATE_S=$(date -u +"%s")
JOB_START_S=$(date -u +"%s" -d "${CI_JOB_STARTED_AT:?}")
CURR_TIME=$((DATE_S-JOB_START_S))
CURR_MINSEC="$(printf "%02d" $((CURR_TIME/60))):$(printf "%02d" $((CURR_TIME%60)))"
echo -e "\n\e[0Ksection_start:$(date +%s):$section_name$section_params\r\e[0K${CYAN}[${CURR_MINSEC}] $*${ENDCOLOR}\n"
}
function section_start {
x_off 2>/dev/null
build_section_start "[collapsed=true]" $*
[ "$state_x" -eq 0 ] || set -x
}
function build_section_end {
echo -e "\e[0Ksection_end:$(date +%s):$1\r\e[0K"
CURRENT_SECTION=""
}
function section_end {
x_off >/dev/null
build_section_end $*
[ "$state_x" -eq 0 ] || set -x
}
function section_switch {
x_off 2>/dev/null
if [ -n "$CURRENT_SECTION" ]
then
build_section_end $CURRENT_SECTION
fi
build_section_start "[collapsed=true]" $*
[ "$state_x" -eq 0 ] || set -x
}
function uncollapsed_section_switch {
x_off 2>/dev/null
if [ -n "$CURRENT_SECTION" ]
then
build_section_end $CURRENT_SECTION
fi
build_section_start "" $*
[ "$state_x" -eq 0 ] || set -x
}
export -f x_off
export -f error
export -f trap_err
export -f build_section_start
export -f section_start
export -f build_section_end
export -f section_end
export -f section_switch
export -f uncollapsed_section_switch
# Freedesktop requirement (needed for Wayland)
[ -n "${XDG_RUNTIME_DIR}" ] || export XDG_RUNTIME_DIR="$(mktemp -p "$PWD" -d xdg-runtime-XXXXXX)"
set -E
trap 'trap_err $?' ERR

View File

@@ -24,7 +24,7 @@
.restricted-rules:
rules:
# If the triggerer has access to the restricted traces and if it is pre-merge
- if: '($GITLAB_USER_LOGIN !~ "/^(robclark|anholt|flto|cwabbott0|Danil|tomeu|okias|gallo)$/") &&
- if: '($GITLAB_USER_LOGIN !~ "/^(robclark|anholt|flto|cwabbott0|Danil|tomeu|okias|gallo|kwg|majanes|llanderwelin|zmike)$/") &&
($GITLAB_USER_LOGIN != "marge-bot" || $CI_COMMIT_BRANCH)'
when: never
@@ -44,7 +44,6 @@
- src/drm-shim/**/*
- src/gbm/**/*
- src/gtest/**/*
- src/hgl/**/*
- src/include/**/*
# Some src/util and src/compiler files use headers from mesa/ (e.g.
# mtypes.h). We should clean that up.
@@ -53,6 +52,75 @@
- src/util/**/*
when: on_success
# Same core dependencies for doing manual runs.
.core-manual-rules:
rules:
# We only want manual jobs to show up when it's not marge's pre-merge CI
# run, otherwise she'll wait until her timeout. The exception is
# performance jobs, see below.
- if: '($GITLAB_USER_LOGIN == "marge-bot" &&
$CI_PIPELINE_SOURCE == "merge_request_event" &&
$CI_JOB_NAME !~ "/performance$/")'
when: never
- !reference [.scheduled_pipeline-rules, rules]
- changes:
*core_file_list
when: manual
# Rules for performance jobs tracking. We want perf jobs to run as code is
# merged to main, but we don't want them to block marge. So, they need to have
# only when: never or when: manual, and a separate script maintained by
# Collabora triggers the manual job after merge to main. These "never" filters
# need to come before any paths with "manual".
.performance-rules:
rules:
- !reference [.no_scheduled_pipelines-rules, rules]
# Run only on pre-merge pipelines from Marge
- if: $MESA_CI_PERFORMANCE_ENABLED == null
when: never
# Allow the merge to complete even before the job completes (since it won't
# even start until the separate script triggers on it).
allow_failure: true
.piglit-performance-base:
extends:
- .performance-rules
variables:
LAVA_JOB_PRIORITY: 40
PIGLIT_REPLAY_SUBCOMMAND: "profile"
PIGLIT_REPLAY_EXTRA_ARGS: "--db-path ${CI_PROJECT_DIR}/replayer-db/"
# More than this can hit OOM due to BOs leaked during the replay of the last frame
PIGLIT_REPLAY_LOOP_TIMES: 150
# We don't want for more than one workload to be submitted to the GPU at a time
FDO_CI_CONCURRENT: 1
# Piglit is very sparse in its status output and downloads of big traces can take a while
LAVA_DEVICE_HANGING_TIMEOUT_SEC: 600
GIT_STRATEGY: none
HWCI_FREQ_MAX: "true"
# Always use the same device
LAVA_TAGS: "cbg-0"
# Ensure that we are using the release build artifact
MINIO_ARTIFACT_NAME: mesa-${ARCH}-release
# Reset dependencies in performance jobs to enforce the release build artifact
dependencies: null
# Don't run in parallel. It is okay to performance jobs to take a little
# longer to finish, as they don't block marge from merging an MR.
parallel: null
.piglit-performance:arm64:
extends:
- .piglit-performance-base
needs:
- debian/arm64_test
- debian-arm64-release
.piglit-performance:amd64:
extends:
- .piglit-performance-base
needs:
- kernel+rootfs_amd64
- debian-release
# Mesa source file dependencies that may impact any GL driver test job.
.gl-rules:
rules:
@@ -86,6 +154,16 @@
- src/gallium/winsys/*
when: on_success
.gl-manual-rules:
rules:
- !reference [.core-manual-rules, rules]
- changes:
*mesa_core_file_list
when: manual
- changes:
*gallium_core_file_list
when: manual
# Source file dependencies that may impact any Vulkan driver build or test
.vulkan-rules:
rules:
@@ -94,6 +172,13 @@
- src/vulkan/**/*
when: on_success
.vulkan-manual-rules:
rules:
- !reference [.core-manual-rules, rules]
- changes:
*vulkan_file_list
when: manual
.softpipe-rules:
stage: software-renderer
rules:
@@ -124,6 +209,14 @@
- src/gallium/winsys/sw/**/*
when: on_success
.lavapipe-manual-rules:
stage: software-renderer
rules:
- !reference [.vulkan-manual-rules, rules]
- !reference [.gl-manual-rules, rules]
- changes: *lavapipe_file_list
when: manual
.llvmpipe-cl-rules:
stage: software-renderer
rules:
@@ -145,6 +238,7 @@
*llvmpipe_file_list
when: on_success
# TODO: remove together with Clover
.llvmpipe-clover-rules:
rules:
- !reference [.llvmpipe-cl-rules, rules]
@@ -178,11 +272,6 @@
rules:
- if: '$VALVE_FARM == "offline"'
when: never
# The Valve CI Farm uses allow lists for projects/users to prevent abuse,
# so only enable automatic testing when running in the context of Mesa to
# prevent failures in forks.
- if: '$CI_PROJECT_NAMESPACE != "mesa"'
when: never
.austriancoder-farm-rules:
rules:
@@ -211,6 +300,14 @@
- src/freedreno/registers/**/*
when: on_success
.freedreno-common-manual-rules:
rules:
- !reference [.freedreno-farm-rules, rules]
- !reference [.core-manual-rules, rules]
- changes:
*freedreno_core_file_list
when: manual
.freedreno-rules:
stage: freedreno
rules:
@@ -222,15 +319,33 @@
- src/gallium/winsys/freedreno/**/*
when: on_success
.freedreno-manual-rules:
stage: freedreno
rules:
- !reference [.freedreno-common-manual-rules, rules]
- !reference [.gl-manual-rules, rules]
- changes:
*freedreno_gl_file_list
when: manual
.turnip-rules:
stage: freedreno
rules:
- !reference [.freedreno-common-rules, rules]
- !reference [.vulkan-rules, rules]
- changes:
- changes: &freedreno_vulkan_file_list
- src/freedreno/vulkan/**/*
when: on_success
.turnip-manual-rules:
stage: freedreno
rules:
- !reference [.freedreno-common-manual-rules, rules]
- !reference [.vulkan-manual-rules, rules]
- changes:
*freedreno_vulkan_file_list
when: manual
# For piglit and skqp test jobs that run both GL and VK tests.
.freedreno-turnip-rules:
rules:
@@ -243,49 +358,42 @@
- !reference [.restricted-rules, rules]
- !reference [.freedreno-rules, rules]
# Rules for GL driver performance tracking. We want them to run as code is
# merged to main, but we don't want them to block marge. So, they need to have
# only when: never or when: manual, and a separate script maintained by
# Collabora triggers the manual job after merge to main.
.gl-rules-performance:
rules:
- !reference [.no_scheduled_pipelines-rules, rules]
# Run only on pre-merge pipelines from Marge
- if: '$GITLAB_USER_LOGIN != "marge-bot" || $CI_COMMIT_BRANCH'
when: never
- changes:
*mesa_core_file_list
when: manual
- changes:
*gallium_core_file_list
when: manual
# Unfortunately YAML doesn't let us concatenate arrays, so we have to do the
# rules duplication manually
.freedreno-rules-performance:
stage: freedreno
rules:
- !reference [.freedreno-farm-rules, rules]
- !reference [.gl-rules-performance, rules]
- changes:
*freedreno_core_file_list
when: manual
- changes:
*freedreno_gl_file_list
when: manual
- !reference [.performance-rules, rules]
- !reference [.freedreno-manual-rules, rules]
allow_failure: true # see comment in .performance-rules, which we don't inherit this line from.
variables:
LAVA_JOB_PRIORITY: 40
# Ensure that we are using the release build artifact
MINIO_ARTIFACT_NAME: mesa-arm64-release
needs:
- debian/arm64_test
- debian-arm64-release
dependencies: null
.nouveau-rules:
stage: nouveau
rules:
- !reference [.anholt-farm-rules, rules]
- !reference [.gl-rules, rules]
- changes:
- changes: &nouveau_file_list
- src/nouveau/**/*
- src/gallium/drivers/nouveau/**/*
- src/gallium/winsys/kmsro/**/*
- src/gallium/winsys/nouveau/**/*
when: on_success
.nouveau-manual-rules:
stage: nouveau
rules:
- !reference [.anholt-farm-rules, rules]
- !reference [.gl-manual-rules, rules]
- changes:
*nouveau_file_list
when: manual
.panfrost-midgard-rules:
stage: arm
rules:
@@ -306,6 +414,19 @@
- src/panfrost/midgard/**/*
when: on_success
.panfrost-midgard-manual-rules:
stage: arm
rules:
- !reference [.collabora-farm-rules, rules]
- !reference [.gl-manual-rules, rules]
- changes: *panfrost_gallium_file_list
when: manual
- changes: *panfrost_common_file_list
when: manual
- changes:
- src/panfrost/midgard/**/*
when: manual
.panfrost-bifrost-rules:
stage: arm
rules:
@@ -321,13 +442,32 @@
- changes: &panfrost_vulkan_file_list
- src/panfrost/vulkan/*
when: on_success
- changes:
- changes: &panfrost_bifrost_file_list
- src/panfrost/compiler/**/*
when: on_success
.panfrost-bifrost-manual-rules:
stage: arm
rules:
- !reference [.collabora-farm-rules, rules]
- !reference [.vulkan-manual-rules, rules]
- !reference [.gl-manual-rules, rules]
- changes:
*panfrost_common_file_list
when: manual
- changes:
*panfrost_gallium_file_list
when: manual
- changes:
*panfrost_vulkan_file_list
when: manual
- changes:
*panfrost_bifrost_file_list
when: manual
.broadcom-common-rules:
rules:
- changes:
- changes: &broadcom_file_list
- src/broadcom/meson.build
- src/broadcom/ci/**/*
- src/broadcom/cle/**/*
@@ -357,12 +497,24 @@
- !reference [.igalia-farm-rules, rules]
- !reference [.gl-rules, rules]
- !reference [.broadcom-common-rules, rules]
- changes:
- changes: &v3d_file_list
- src/gallium/drivers/v3d/**/*
- src/gallium/winsys/kmsro/**/*
- src/gallium/winsys/v3d/**/*
when: on_success
.v3d-manual-rules:
stage: broadcom
rules:
- !reference [.igalia-farm-rules, rules]
- !reference [.gl-manual-rules, rules]
- changes:
*broadcom_file_list
when: manual
- changes:
*v3d_file_list
when: manual
.v3dv-rules:
stage: broadcom
rules:
@@ -405,31 +557,13 @@
- !reference [.valve-farm-rules, rules]
- !reference [.radv-rules, rules]
.virgl-rules:
stage: layered-backends
.radv-valve-manual-rules:
stage: amd
rules:
- !reference [.gl-rules, rules]
- !reference [.valve-farm-rules, rules]
- !reference [.vulkan-manual-rules, rules]
- changes:
*llvmpipe_file_list
when: on_success
- changes: &virgl_file_list
- src/gallium/drivers/virgl/**/*
- src/gallium/winsys/virgl/**/*
when: on_success
# Unfortunately we can't sed the on_success from another rules set, so we have
# to do duplicate the files lists to set the job to manual (see
# .gl-rules-performance)
.virgl-iris-rules-performance:
stage: layered-backends
rules:
- !reference [.collabora-farm-rules, rules]
- !reference [.gl-rules-performance, rules]
- changes:
*llvmpipe_file_list
when: manual
- changes:
*virgl_file_list
*radv_file_list
when: manual
.venus-rules:
@@ -486,22 +620,38 @@
stage: intel
rules:
- !reference [.gl-rules, rules]
- changes:
- changes: &i915g_file_list
- src/gallium/drivers/i915/**/*
- src/gallium/winsys/i915/**/*
- src/intel/**/*
when: on_success
.i915g-manual-rules:
stage: intel
rules:
- !reference [.gl-manual-rules, rules]
- changes:
*i915g_file_list
when: manual
.crocus-rules:
stage: intel
rules:
- !reference [.gl-rules, rules]
- changes:
- changes: &crocus_file_list
- src/gallium/drivers/crocus/**/*
- src/gallium/winsys/crocus/**/*
- src/intel/**/*
when: on_success
.crocus-manual-rules:
stage: intel
rules:
- !reference [.gl-manual-rules, rules]
- changes:
*crocus_file_list
when: manual
.iris-rules:
stage: intel
rules:
@@ -514,17 +664,34 @@
- src/intel/**/*
when: on_success
.iris-manual-rules:
stage: intel
rules:
- !reference [.collabora-farm-rules, rules]
- !reference [.gl-manual-rules, rules]
- changes:
*iris_file_list
when: manual
# Unfortunately we can't sed the on_success from another rules set, so we have
# to do duplicate the files lists to set the job to manual (see
# .gl-rules-performance)
# .performance-rules)
.iris-rules-performance:
stage: intel
rules:
- !reference [.collabora-farm-rules, rules]
- !reference [.gl-rules-performance, rules]
- !reference [.performance-rules, rules]
- !reference [.gl-manual-rules, rules]
- changes:
*iris_file_list
when: manual
allow_failure: true # see comment in .performance-rules, which we don't inherit this line from.
variables:
LAVA_JOB_PRIORITY: 40
MINIO_ARTIFACT_NAME: "mesa-amd64-release"
needs:
- kernel+rootfs_amd64
- debian-release
.anv-rules:
stage: intel
@@ -536,6 +703,33 @@
- src/intel/**/*
when: on_success
.anv-manual-rules:
stage: intel
rules:
- !reference [.collabora-farm-rules, rules]
- !reference [.vulkan-manual-rules, rules]
- changes:
- src/intel/**/*
when: on_success
.hasvk-rules:
stage: intel
rules:
- !reference [.anholt-farm-rules, rules]
- !reference [.vulkan-rules, rules]
- changes:
- src/intel/**/*
when: on_success
.hasvk-manual-rules:
stage: intel
rules:
- !reference [.anholt-farm-rules, rules]
- !reference [.vulkan-manual-rules, rules]
- changes:
- src/intel/**/*
when: on_success
.intel-rules:
stage: intel
rules:
@@ -549,6 +743,50 @@
- src/intel/**/*
when: on_success
.virgl-rules:
stage: layered-backends
rules:
- !reference [.gl-rules, rules]
- changes:
*llvmpipe_file_list
when: on_success
- changes: &virgl_file_list
- src/gallium/drivers/virgl/**/*
- src/gallium/winsys/virgl/**/*
when: on_success
.virgl-iris-manual-rules:
stage: layered-backends
rules:
- !reference [.collabora-farm-rules, rules]
- !reference [.gl-manual-rules, rules]
- changes:
*virgl_file_list
when: manual
- changes:
*iris_file_list
when: manual
.virgl-iris-rules-performance:
stage: layered-backends
rules:
- !reference [.collabora-farm-rules, rules]
- !reference [.performance-rules, rules]
- !reference [.gl-manual-rules, rules]
- changes:
*llvmpipe_file_list
when: manual
- changes:
*virgl_file_list
when: manual
allow_failure: true # see comment in .performance-rules, which we don't inherit this line from.
variables:
LAVA_JOB_PRIORITY: 40
MINIO_ARTIFACT_NAME: "mesa-amd64-release"
needs:
- kernel+rootfs_amd64
- debian-release
.zink-common-rules:
rules:
- !reference [.gl-rules, rules]
@@ -556,6 +794,13 @@
- src/gallium/drivers/zink/**/*
when: on_success
.zink-common-manual-rules:
rules:
- !reference [.gl-manual-rules, rules]
- changes:
- src/gallium/drivers/zink/**/*
when: manual
.zink-lvp-rules:
stage: layered-backends
rules:
@@ -568,6 +813,12 @@
- !reference [.anv-rules, rules]
- !reference [.zink-common-rules, rules]
.zink-anv-manual-rules:
stage: layered-backends
rules:
- !reference [.anv-manual-rules, rules]
- !reference [.zink-common-manual-rules, rules]
.zink-anv-rules-restricted:
stage: layered-backends
rules:
@@ -581,6 +832,18 @@
- !reference [.turnip-rules, rules]
- !reference [.zink-common-rules, rules]
.zink-turnip-manual-rules:
stage: layered-backends
rules:
- !reference [.turnip-manual-rules, rules]
- !reference [.zink-common-manual-rules, rules]
.zink-radv-manual-rules:
stage: layered-backends
rules:
- !reference [.radv-valve-manual-rules, rules]
- !reference [.zink-common-manual-rules, rules]
# Unfortunately YAML doesn't let us concatenate arrays, so we have to do the
# rules duplication manually
.windows-build-rules:
@@ -626,7 +889,6 @@
rules:
- if: '$MICROSOFT_FARM == "offline"'
when: never
- !reference [.no_scheduled_pipelines-rules, rules]
- !reference [.core-rules, rules]
- changes: &spirv2dxil_file_list
- src/microsoft/ci/*
@@ -651,7 +913,7 @@
rules:
- !reference [.austriancoder-farm-rules, rules]
- !reference [.gl-rules, rules]
- changes:
- changes: &etnaviv_file_list
- src/etnaviv/**/*
- src/gallium/drivers/etnaviv/**/*
- src/gallium/winsys/etnaviv/**/*
@@ -660,6 +922,14 @@
- src/gallium/winsys/etnaviv/**/*
when: on_success
.etnaviv-manual-rules:
stage: etnaviv
rules:
- !reference [.gl-manual-rules, rules]
- changes:
*etnaviv_file_list
when: manual
# Rules for unusual architectures that only build a subset of drivers
.ppc64el-rules:
rules:
@@ -705,8 +975,15 @@
# Rules for linters
.lint-rustfmt-rules:
rules:
- !reference [.no_scheduled_pipelines-rules, rules]
- !reference [.core-rules, rules]
- changes:
- src/**/*.rs
when: on_success
.lint-clang-format-rules:
rules:
- !reference [.core-rules, rules]
- changes:
- src/**/asahi/**/*
- src/**/panfrost/**/*
when: on_success

View File

@@ -8,9 +8,9 @@
# Note: Build dir (and thus install) may be dirty due to GIT_STRATEGY
- rm -rf install
- tar -xf artifacts/install.tar
- echo -e "\e[0Ksection_start:$(date +%s):ldd_section[collapsed=true]\r\e[0KChecking ldd on driver build"
- section_start ldd_section "Checking ldd on driver build"
- LD_LIBRARY_PATH=install/lib find install/lib -name "*.so" -print -exec ldd {} \;
- echo -e "\e[0Ksection_end:$(date +%s):ldd_section\r\e[0K"
- section_end ldd_section
artifacts:
when: always
name: "mesa_${CI_JOB_NAME}"
@@ -27,7 +27,21 @@ rustfmt:
variables:
GIT_STRATEGY: fetch
script:
- git ls-files */{lib,app}.rs | xargs rustfmt --check
- shopt -s globstar
- rustfmt --check --verbose src/**/lib.rs
clang-format:
# Cancel job if a newer commit is pushed to the same branch
interruptible: true
stage: lint
extends:
- .use-debian/x86_build
- .lint-clang-format-rules
variables:
GIT_STRATEGY: fetch
script:
- shopt -s globstar
- clang-format-13 --Werror --dry-run src/**/{asahi,panfrost}/**/*.{h,c,cpp}
.test-gl:
extends:
@@ -52,6 +66,26 @@ rustfmt:
needs:
- debian/x86_test-gl
.test-android:
extends:
- .test
- .use-debian/x86_test-android
variables:
MINIO_ARTIFACT_NAME: mesa-x86_64-android
needs:
- job: debian-testing
artifacts: true # On the host we want the Linux build
- job: debian-android
artifacts: false # The Android build will be downloaded later
- job: debian/x86_test-android
artifacts: false
timeout: 20m
script:
- ./install/cuttlefish-runner.sh
artifacts:
paths:
- results/
.vkd3d-proton-test:
artifacts:
when: on_failure
@@ -89,9 +123,9 @@ rustfmt:
variables:
PIGLIT_REPLAY_EXTRA_ARGS: --keep-image --db-path ${CI_PROJECT_DIR}/replayer-db/ --minio_bucket=mesa-tracie-public --jwt-file=${CI_JOB_JWT_FILE}
script:
- echo -e "\e[0Ksection_start:$(date +%s):variables[collapsed=true]\r\e[0KVariables passed through:"
- section_start variables "Variables passed through:"
- install/common/generate-env.sh
- echo -e "\e[0Ksection_end:$(date +%s):variables\r\e[0K"
- section_end variables
- install/piglit/piglit-traces.sh
.deqp-test:
@@ -129,11 +163,11 @@ rustfmt:
# instead of fd.o. Set FDO_HTTP_CACHE_URI to an http cache for your test lab to
# improve it even more (see https://docs.mesa3d.org/ci/bare-metal.html for
# setup).
- echo -e "\e[0Ksection_start:$(date +%s):artifacts_download[collapsed=true]\r\e[0KDownloading artifacts from minio"
- section_start artifacts_download "Downloading artifacts from s3"
# Note: Build dir (and thus install) may be dirty due to GIT_STRATEGY
- rm -rf install
- wget ${FDO_HTTP_CACHE_URI:-}https://${PIPELINE_ARTIFACTS_BASE}/${MINIO_ARTIFACT_NAME}.tar.zst -S --progress=dot:giga -O- | tar --zstd -x
- echo -e "\e[0Ksection_end:$(date +%s):artifacts_download\r\e[0K"
- (set -x; curl -L --retry 4 -f --retry-all-errors --retry-delay 60 ${FDO_HTTP_CACHE_URI:-}https://${PIPELINE_ARTIFACTS_BASE}/${MINIO_ARTIFACT_NAME}.tar.zst | tar --zstd -x)
- section_end artifacts_download
artifacts:
when: always
name: "mesa_${CI_JOB_NAME}"
@@ -201,14 +235,14 @@ rustfmt:
# like FDO_DISTRIBUTION_TAG for *the* image, there is no way to
# depend on more than one image per job. So, the job container is
# built as part of the CI in the boot2container project.
image: registry.freedesktop.org/mupuf/valve-infra/mesa-trigger:2022-12-08.1
image: registry.freedesktop.org/mupuf/valve-infra/mesa-trigger:2023-02-27.1
timeout: 1h 40m
variables:
# No need by default to pull the whole repo
GIT_STRATEGY: none
# boot2container initrd configuration parameters.
B2C_KERNEL_URL: 'https://gitlab.freedesktop.org/mupuf/valve-infra/-/package_files/519/download' # Linux 6.1
B2C_INITRAMFS_URL: 'https://gitlab.freedesktop.org/mupuf/boot2container/-/releases/v0.9.8/downloads/initramfs.linux_amd64.cpio.xz'
B2C_INITRAMFS_URL: 'https://gitlab.freedesktop.org/mupuf/boot2container/-/releases/v0.9.9/downloads/initramfs.linux_amd64.cpio.xz'
B2C_JOB_SUCCESS_REGEX: '\[.*\]: Execution is over, pipeline status: 0\r$'
B2C_JOB_WARN_REGEX: '\*ERROR\* ring .* timeout, but soft recovered'
B2C_LOG_LEVEL: 6
@@ -219,7 +253,7 @@ rustfmt:
B2C_TIMEOUT_BOOT_RETRIES: 1
B2C_TIMEOUT_FIRST_MINUTES: 5
B2C_TIMEOUT_FIRST_RETRIES: 3
B2C_TIMEOUT_MINUTES: 2
B2C_TIMEOUT_MINUTES: 4
B2C_TIMEOUT_OVERALL_MINUTES: 90
B2C_TIMEOUT_RETRIES: 0
@@ -264,7 +298,7 @@ rustfmt:
[ -d "$CI_COMMON_SCRIPTS" ] || exit 1
B2C_TEST_SCRIPT="bash -c 'source ./set-job-env-vars.sh; tar xf ${INSTALL_TARBALL_NAME}; ${B2C_TEST_SCRIPT}'"
B2C_TEST_SCRIPT="bash -c 'tar xf ${INSTALL_TARBALL_NAME}; ./install/common/init-stage2.sh'"
# The Valve CI gateway receives jobs in a YAML format. Create a
# job description from the CI environment.
@@ -301,6 +335,7 @@ rustfmt:
# begins running on the remote DUT.
set +x
"$CI_COMMON_SCRIPTS"/generate-env.sh > ${JOB_FOLDER}/set-job-env-vars.sh
echo "export SCRIPTS_DIR=./install" >> ${JOB_FOLDER}/set-job-env-vars.sh
chmod +x ${JOB_FOLDER}/set-job-env-vars.sh
echo "Variables passed through:"
cat ${JOB_FOLDER}/set-job-env-vars.sh

View File

@@ -3,9 +3,12 @@ from unittest.mock import MagicMock, patch
import pytest
import yaml
from freezegun import freeze_time
from hypothesis import settings
from .lava.helpers import generate_testsuite_result, jobs_logs_response
settings.register_profile("ci", max_examples=1000, derandomize=True)
settings.load_profile("ci")
def pytest_configure(config):
config.addinivalue_line(

View File

@@ -0,0 +1,41 @@
import re
import pytest
from hypothesis import given
from hypothesis import strategies as st
from lava.utils.lava_farm import LAVA_FARM_RUNNER_PATTERNS, LavaFarm, get_lava_farm
@given(
runner_tag=st.text(
alphabet=st.characters(
min_codepoint=1, max_codepoint=127, blacklist_categories=("C",)
),
min_size=1,
)
)
def test_get_lava_farm_invalid_tags(runner_tag):
with pytest.MonkeyPatch().context() as mp:
mp.setenv("RUNNER_TAG", runner_tag)
assert get_lava_farm() == LavaFarm.UNKNOWN
def test_get_lava_farm_no_tag(monkeypatch):
monkeypatch.delenv("RUNNER_TAG", raising=False)
assert get_lava_farm() == LavaFarm.UNKNOWN
@given(
st.fixed_dictionaries(
{k: st.from_regex(v) for k, v in LAVA_FARM_RUNNER_PATTERNS.items()}
)
)
def test_get_lava_farm_valid_tags(runner_farm_tag: dict):
with pytest.MonkeyPatch().context() as mp:
for farm, tag in runner_farm_tag.items():
try:
mp.setenv("RUNNER_TAG", tag)
except ValueError:
# hypothesis may generate null bytes in the string
continue
assert get_lava_farm() == farm

View File

@@ -201,6 +201,52 @@ def test_fix_lava_gitlab_section_log(expected_message, messages):
assert expected_message in fixed_messages
@pytest.mark.parametrize(
"expected_message, messages",
GITLAB_SECTION_SPLIT_SCENARIOS.values(),
ids=GITLAB_SECTION_SPLIT_SCENARIOS.keys(),
)
def test_lava_gitlab_section_log_collabora(expected_message, messages, monkeypatch):
"""Check if LogFollower does not change the message if we are running in Collabora farm."""
monkeypatch.setenv("RUNNER_TAG", "mesa-ci-x86_64-lava-test")
lf = LogFollower()
for message in messages:
lf.feed([create_lava_yaml_msg(msg=message)])
new_messages = lf.flush()
new_messages = tuple(new_messages) if len(new_messages) > 1 else new_messages[0]
assert new_messages == expected_message
CARRIAGE_RETURN_SCENARIOS = {
"Carriage return at the end of the previous line": (
(
"\x1b[0Ksection_start:1677609903:test_setup[collapsed=true]\r\x1b[0K\x1b[0;36m[303:44] deqp: preparing test setup\x1b[0m",
),
(
"\x1b[0Ksection_start:1677609903:test_setup[collapsed=true]\r",
"\x1b[0K\x1b[0;36m[303:44] deqp: preparing test setup\x1b[0m\r\n",
),
),
"Newline at the end of the line": (
("\x1b[0K\x1b[0;36m[303:44] deqp: preparing test setup\x1b[0m", "log"),
("\x1b[0K\x1b[0;36m[303:44] deqp: preparing test setup\x1b[0m\r\n", "log"),
),
}
@pytest.mark.parametrize(
"expected_message, messages",
CARRIAGE_RETURN_SCENARIOS.values(),
ids=CARRIAGE_RETURN_SCENARIOS.keys(),
)
def test_lava_log_merge_carriage_return_lines(expected_message, messages):
lf = LogFollower()
for message in messages:
lf.feed([create_lava_yaml_msg(msg=message)])
new_messages = tuple(lf.flush())
assert new_messages == expected_message
WATCHDOG_SCENARIOS = {
"1 second before timeout": ({"seconds": -1}, does_not_raise()),
"1 second after timeout": ({"seconds": 1}, pytest.raises(MesaCITimeoutError)),

View File

@@ -9,9 +9,14 @@ $results = New-Item -ItemType Directory results
$baseline = ".\_install\warp-fails.txt"
$suite = ".\_install\deqp-dozen.toml"
$jobs = ""
if ($null -ne $env:FDO_CI_CONCURRENT) {
$jobs = "--jobs", "$($env:FDO_CI_CONCURRENT)"
}
$env:DZN_DEBUG = "warp"
$env:MESA_VK_IGNORE_CONFORMANCE_WARNING = "true"
deqp-runner suite --suite $($suite) --output $($results) --baseline $($baseline) --testlog-to-xml C:\deqp\executor\testlog-to-xml.exe --jobs 4 --fraction 3
deqp-runner suite --suite $($suite) --output $($results) --baseline $($baseline) --testlog-to-xml C:\deqp\executor\testlog-to-xml.exe $jobs --fraction 3
$deqpstatus = $?
$template = "See https://$($env:CI_PROJECT_ROOT_NAMESPACE).pages.freedesktop.org/-/$($env:CI_PROJECT_NAME)/-/jobs/$($env:CI_JOB_ID)/artifacts/results/{{testcase}}.xml"

View File

@@ -36,7 +36,7 @@ $depsInstallPath="C:\mesa-deps"
Push-Location $builddir
meson `
meson setup `
--default-library=shared `
--buildtype=release `
--wrap-mode=nodownload `
@@ -49,7 +49,7 @@ meson `
-Dshared-llvm=disabled `
-Dvulkan-drivers="swrast,amd,microsoft-experimental" `
-Dgallium-drivers="swrast,d3d12,zink" `
-Dgallium-va=true `
-Dgallium-va=enabled `
-Dvideo-codecs="h264dec,h264enc,h265dec,h265enc,vc1dec" `
-Dshared-glapi=enabled `
-Dgles1=enabled `

View File

@@ -12,7 +12,7 @@ $depsInstallPath="C:\mesa-deps"
Get-Date
Write-Host "Cloning DirectX-Headers"
git clone -b v1.606.4 --depth=1 https://github.com/microsoft/DirectX-Headers deps/DirectX-Headers
git clone -b v1.710.0-preview --depth=1 https://github.com/microsoft/DirectX-Headers deps/DirectX-Headers
if (!$?) {
Write-Host "Failed to clone DirectX-Headers repository"
Exit 1
@@ -84,26 +84,20 @@ if (!$buildstatus) {
}
Get-Date
Write-Host "Cloning LLVM release/12.x"
git clone -b release/12.x --depth=1 https://github.com/llvm/llvm-project deps/llvm-project
Write-Host "Cloning LLVM release/15.x"
git clone -b release/15.x --depth=1 https://github.com/llvm/llvm-project deps/llvm-project
if (!$?) {
Write-Host "Failed to clone LLVM repository"
Exit 1
}
# ideally we want to use a tag here insted of a sha,
# but as of today, SPIRV-LLVM-Translator doesn't have
# a tag matching LLVM 12.0.0
Get-Date
Write-Host "Cloning SPIRV-LLVM-Translator"
git clone https://github.com/KhronosGroup/SPIRV-LLVM-Translator deps/llvm-project/llvm/projects/SPIRV-LLVM-Translator
git clone -b llvm_release_150 https://github.com/KhronosGroup/SPIRV-LLVM-Translator deps/llvm-project/llvm/projects/SPIRV-LLVM-Translator
if (!$?) {
Write-Host "Failed to clone SPIRV-LLVM-Translator repository"
Exit 1
}
Push-Location deps/llvm-project/llvm/projects/SPIRV-LLVM-Translator
git checkout 5b641633b3bcc3251a52260eee11db13a79d7258
Pop-Location
Get-Date
# slightly convoluted syntax but avoids the CWD being under the PS filesystem meta-path

View File

@@ -132,7 +132,7 @@ cargo install --git https://gitlab.freedesktop.org/anholt/deqp-runner.git
Get-Date
Write-Host "Downloading DirectX 12 Agility SDK"
Invoke-WebRequest -Uri https://www.nuget.org/api/v2/package/Microsoft.Direct3D.D3D12/1.706.3-preview -OutFile 'agility.zip'
Invoke-WebRequest -Uri https://www.nuget.org/api/v2/package/Microsoft.Direct3D.D3D12/1.710.0-preview -OutFile 'agility.zip'
Expand-Archive -Path 'agility.zip' -DestinationPath 'C:\agility'
Remove-Item 'agility.zip'
@@ -148,7 +148,7 @@ Remove-Item -Recurse 'C:\agility'
Get-Date
Write-Host "Downloading Updated WARP"
Invoke-WebRequest -Uri https://www.nuget.org/api/v2/package/Microsoft.Direct3D.WARP/1.0.2 -OutFile 'warp.zip'
Invoke-WebRequest -Uri https://www.nuget.org/api/v2/package/Microsoft.Direct3D.WARP/1.0.5 -OutFile 'warp.zip'
Expand-Archive -Path 'warp.zip' -DestinationPath 'C:\warp'
Remove-Item 'warp.zip'

View File

@@ -4,10 +4,16 @@ Copy-Item -Path _install\bin\opengl32.dll -Destination C:\Piglit\bin\opengl32.dl
Copy-Item -Path _install\bin\libgallium_wgl.dll -Destination C:\Piglit\bin\libgallium_wgl.dll
Copy-Item -Path _install\bin\libglapi.dll -Destination C:\Piglit\bin\libglapi.dll
$jobs = ""
if ($null -ne $env:FDO_CI_CONCURRENT) {
$jobs = "--jobs", "$($env:FDO_CI_CONCURRENT)"
}
deqp-runner suite --output .\logs --suite "_install/$env:PIGLIT_SUITE" `
--skips "_install/$env:PIGLIT_SKIPS" `
--baseline "_install/$env:PIGLIT_BASELINE" `
--flakes "_install/$env:PIGLIT_FLAKES"
--flakes "_install/$env:PIGLIT_FLAKES" `
$jobs
if (!$?) {
Exit 1
}

19
.gitlab-ci/x11-skips.txt Normal file
View File

@@ -0,0 +1,19 @@
# These tests all read from the front buffer after a swap. Given that we
# run piglit tests in parallel in Mesa CI, and don't have a compositor
# running, the frontbuffer reads may end up with undefined results from
# windows overlapping us.
#
# Piglit does mark these tests as not to be run in parallel, but deqp-runner
# doesn't respect that. We need to extend deqp-runner to allow some tests to be
# marked as single-threaded and run after the rayon loop if we want to support
# them.
#
# Other front-buffer access tests like fbo-sys-blit, fbo-sys-sub-blit, or
# fcc-front-buffer-distraction don't appear here, because the DRI3 fake-front
# handling should be holding the pixels drawn by the test even if we happen to fail
# GL's window system pixel occlusion test.
#
# Note that glx skips don't appear here, they're in all-skips.txt (in case someone
# sets PIGLIT_PLATFORM=gbm to mostly use gbm, but still has an X server running).
spec@!opengl 1.0@gl-1.0-swapbuffers-behavior
spec@!opengl 1.1@read-front

View File

@@ -41,9 +41,9 @@ Alex Deucher <alexdeucher@gmail.com> <alex@botch2.(none)>
Alex Deucher <alexdeucher@gmail.com> <alex@cube.(none)>
Alex Deucher <alexdeucher@gmail.com> <alex@samba.(none)>
Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> <alyssa@rosenzweig.io>
Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> <a@rosenzweig.io>
Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> <alyssa@collabora.com>
Alyssa Rosenzweig <alyssa@rosenzweig.io> <alyssa.rosenzweig@collabora.com>
Alyssa Rosenzweig <alyssa@rosenzweig.io> <a@rosenzweig.io>
Alyssa Rosenzweig <alyssa@rosenzweig.io> <alyssa@collabora.com>
Andreas Fänger <a.faenger@e-sign.com> <a.faenger@e-sign.com>
@@ -68,6 +68,7 @@ Arthur Huillet <arthur.huillet@free.fr> Arthur HUILLET <arthur.huillet@free.fr>
Axel Davy <davyaxel0@gmail.com> <axel.davy@ens.fr>
Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> <basni@chromium.org>
Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> <basni@google.com>
Benjamin Franzke <benjaminfranzke@googlemail.com> ben <benjaminfranzke@googlemail.com>
@@ -114,12 +115,14 @@ Carl-Philip Hänsch <cphaensch@googlemail.com> <s3734770@mail.zih.tu-dresden.de>
Carl-Philip Hänsch <cphaensch@googlemail.com> <carli@carli-laptop.(none)>
Carl-Philip Hänsch <cphaensch@googlemail.com> <Carl-Philip.Haensch@mailbox.tu-dresden.de>
Chad Versace <chadversary@chromium.org> <chad@kiwitree.net>
Chad Versace <chadversary@chromium.org> <chad@chad-versace.us>
Chad Versace <chadversary@chromium.org> <Chad Versace chad@chad-versace.us>
Chad Versace <chadversary@chromium.org> <chad.versace@intel.com>
Chad Versace <chadversary@chromium.org> <chad.versace@linux.intel.com>
Chad Versace <chadversary@chromium.org> <chadversary@google.com>
Lina Versace <lina@kiwitree.net> <chad@kiwitree.net>
Lina Versace <lina@kiwitree.net> <chad@chad-versace.us>
Lina Versace <lina@kiwitree.net> <Chad Versace chad@chad-versace.us>
Lina Versace <lina@kiwitree.net> <chad.versace@intel.com>
Lina Versace <lina@kiwitree.net> <chad.versace@linux.intel.com>
Lina Versace <lina@kiwitree.net> <chadversary@google.com>
Lina Versace <lina@kiwitree.net> <chadversary@chromium.org>
Lina Versace <lina@kiwitree.net> <linyaa@google.com>
Chandu Babu Namburu <chandu@amd.com>
Chandu Babu Namburu <chandu@amd.com> <mailto:chandu@amd.com>
@@ -298,8 +301,10 @@ Jan Vesely <jano.vesely@gmail.com> Jan Vesely <jan.vesely@rutgers.edu>
Jan Zielinski <jan.zielinski@intel.com> jzielins <jan.zielinski@intel.com>
Jason Ekstrand <jason.ekstrand@collabora.com> <jason@jlekstrand.net>
Jason Ekstrand <jason.ekstrand@collabora.com> <jason.ekstrand@intel.com>
Faith Ekstrand <faith.ekstrand@collabora.com> <jason@jlekstrand.net>
Faith Ekstrand <faith.ekstrand@collabora.com> <jason.ekstrand@intel.com>
Faith Ekstrand <faith.ekstrand@collabora.com> <jason.ekstrand@collabora.com>
Faith Ekstrand <faith.ekstrand@collabora.com> <faith@gfxstrand.net>
Jeremy Huddleston <jeremyhu@apple.com>
Jeremy Huddleston <jeremyhu@apple.com> <jeremyhu@freedesktop.org>
@@ -648,6 +653,8 @@ Török Edwin <edwin+mesa@etorok.net> <edwintorok@gmail.com>
Vadym Shovkoplias <vadym.shovkoplias@globallogic.com>
Vadym Shovkoplias <vadym.shovkoplias@globallogic.com> <vadim.shovkoplias@gmail.com>
Val Packett <val@packett.cool> <greg@unrelenting.technology>
Varad Gautam <varad.gautam@collabora.com> <varadgautam@gmail.com>
Ville Syrjälä <ville.syrjala@linux.intel.com> Ville Syrjala <syrjala@freedesktop.org>

View File

@@ -40,11 +40,11 @@ meson.build @dbaker @eric
##########
# NIR
/src/compiler/nir/ @jekstrand
/src/compiler/nir/ @gfxstrand
# Vulkan
/src/vulkan/ @eric @jekstrand
/include/vulkan/ @eric @jekstrand
/src/vulkan/ @eric @gfxstrand
/include/vulkan/ @eric @gfxstrand
#############
@@ -79,12 +79,9 @@ meson.build @dbaker @eric
/src/glx/*glvnd* @kbrenneman
# Haiku
/include/HaikuGL/ @kallisti5
/src/egl/drivers/haiku/ @kallisti5
/src/gallium/frontends/hgl/ @kallisti5
/src/gallium/targets/haiku-softpipe/ @kallisti5
/src/gallium/winsys/sw/hgl/ @kallisti5
/src/hgl/ @kallisti5
# Loader - DRI/classic
/src/loader/ @xexaxo
@@ -128,11 +125,11 @@ meson.build @dbaker @eric
/src/imagination/rogue/ @simon-perretta-img
# Intel
/include/drm-uapi/i915_drm.h @kwg @llandwerlin @jekstrand @idr
/include/pci_ids/i*_pci_ids.h @kwg @llandwerlin @jekstrand @idr
/src/intel/ @kwg @llandwerlin @jekstrand @idr
/src/gallium/winsys/iris/ @kwg @llandwerlin @jekstrand @idr
/src/gallium/drivers/iris/ @kwg @llandwerlin @jekstrand @idr
/include/drm-uapi/i915_drm.h @kwg @llandwerlin @gfxstrand @idr
/include/pci_ids/i*_pci_ids.h @kwg @llandwerlin @gfxstrand @idr
/src/intel/ @kwg @llandwerlin @gfxstrand @idr
/src/gallium/winsys/iris/ @kwg @llandwerlin @gfxstrand @idr
/src/gallium/drivers/iris/ @kwg @llandwerlin @gfxstrand @idr
/src/gallium/drivers/i915/ @anholt
# Microsoft

View File

@@ -1 +1 @@
23.0.0-devel
23.1.0-devel

2
bin/ci/.gitignore vendored
View File

@@ -1,2 +1,2 @@
schema.graphql
gitlab_gql.py.cache.db
gitlab_gql.py.cache*

View File

@@ -195,7 +195,7 @@ def cancel_job(project, job) -> None:
"""Cancel GitLab job"""
pjob = project.jobs.get(job.id, lazy=True)
pjob.cancel()
print(f"{job.name}")
print(f"{job.name}", end=" ")
def cancel_jobs(project, to_cancel) -> None:
@@ -206,6 +206,7 @@ def cancel_jobs(project, to_cancel) -> None:
with ThreadPoolExecutor(max_workers=6) as exe:
part = partial(cancel_job, project)
exe.map(part, to_cancel)
print()
def print_log(project, job_id) -> None:

View File

@@ -211,7 +211,7 @@ def recurse_among_variables_space(var_graph) -> bool:
return updated
def get_job_final_definiton(job_name, merged_yaml, project_path, sha):
def get_job_final_definition(job_name, merged_yaml, project_path, sha):
job = merged_yaml[job_name]
variables = get_variables(job, merged_yaml, project_path, sha)
@@ -294,7 +294,7 @@ def main():
merged_yaml = fetch_merged_yaml(
gl_gql, {"projectPath": args.project_path, "sha": args.sha}
)
get_job_final_definiton(
get_job_final_definition(
args.print_job_manifest, merged_yaml, args.project_path, args.sha
)

View File

@@ -78,9 +78,9 @@ def commit(message: str) -> None:
def _calculate_release_start(major: str, minor: str) -> datetime.date:
"""Calclulate the start of the release for release candidates.
"""Calculate the start of the release for release candidates.
This is quarterly, on the second wednesday, in Januray, April, July, and Octobor.
This is quarterly, on the second wednesday, in January, April, July, and October.
"""
quarter = datetime.date.fromisoformat(f'20{major}-0{[1, 4, 7, 10][int(minor)]}-01')

View File

@@ -52,7 +52,7 @@ def mock_csv(data: typing.List[gen_calendar_entries.CalendarRowType]) -> typing.
@pytest.fixture(autouse=True, scope='module')
def disable_git_commits() -> None:
"""Mock out the commit function so no git commits are made durring testing."""
"""Mock out the commit function so no git commits are made during testing."""
with mock.patch('bin.gen_calendar_entries.commit', mock.Mock()):
yield

Some files were not shown because too many files have changed in this diff Show More