Commit graph

193947 commits

Author SHA1 Message Date
Faith Ekstrand
105bdf2e36 nvk: Add a helper for dispatching compute shaders
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30826>
2024-08-24 03:30:56 +00:00
Faith Ekstrand
83feed1d22 nvk: Refactor compute shader dispatch
This splits state flushing from QMD/root upload.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30826>
2024-08-24 03:30:56 +00:00
Faith Ekstrand
db0c2aa796 nvk: Expose a new nvk_compile_nir_shader() helper
This helper is intended for internal driver shaders.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30826>
2024-08-24 03:30:56 +00:00
Faith Ekstrand
cdef36c422 nvk: Disable conditional rendering around CopyQueryPoolResults
Fixes: 57c38a5669 ("nvk: Implement CopyQueryPoolResults with a compute shader")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30826>
2024-08-24 03:30:56 +00:00
Dylan Baker
24d9cea5ff mesa/program: remove memcpy where src == dst
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30802>
2024-08-23 21:45:34 +00:00
Rob Clark
76e350671f freedreno/a6xx: Sysmem clear fixes
Handled signed/unsigned channel clamping.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11676
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30794>
2024-08-23 17:55:46 +00:00
Mike Lothian
2cf590dd60 Revert "device_select: shortcut EnumeratePhysicalDevice* for count-only calls"
This reverts commit 86bb1036e2.

This is causing crashes in the Vulkan backend of Chromium

Signed-off-by: Mike Lothian <mike@fireburn.co.uk>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11769
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30820>
2024-08-23 17:22:54 +00:00
Eric R. Smith
9e04c0a818 panfrost: add support for image2DMSArray on bifrost
On bifrost we only can use 3 coordinates for images, but
image2DMSArray needs 4 (x, y, sample#, and array index).
We work around this by making the image nr_samples times
higher than the original image, using the Y coordinate to
address the sample plane. This limits the maximum image
height (to 4K pixels instead of 64K pixels in the 16 sample
case) but at least allows us to use the images.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30521>
2024-08-23 16:57:58 +00:00
Eric R. Smith
3173b2c9b7 panfrost: implement image2dms support for valhall
On valhall, the sample index should go in the R component
of the image load/store/lea instruction. This provides a
straightforward way to implement image2DMS and
image2DMSArray image load and store for valhall.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30521>
2024-08-23 16:57:58 +00:00
Eric R. Smith
657591728a panfrost: move lower_image_ms to after lower_atomics
The nir_lower_image_atomics_to_global pass can create some image
load/stores, so we need to do the multisample image load/store
lowering after this.

Also, the pass only actually works on bifrost and below, so skip it
for valhall.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30521>
2024-08-23 16:57:58 +00:00
Eric R. Smith
346ec90fdd panfrost: move pan_arch definition out of genxml to pan_props.h
The pan_arch function is useful elsewhere, and doesn't rely on
anything else within genxml/gen_macros.h.

It's useful, for example, to find the architecture from the
GPU id in bifrost_compile.c, where before we were using ad-hoc
shifting.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30521>
2024-08-23 16:57:58 +00:00
Eric R. Smith
1fd00e4270 panfrost: Add b2i16 conversion to table
This is needed by the newer image2dMS code.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30521>
2024-08-23 16:57:58 +00:00
chyyran
8c68eeb890 spirv_to_dxil: add missing SPIR-V capabilities
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30776>
2024-08-23 16:36:59 +00:00
Mike Blumenkrantz
0e73926c20 device-select: block xserver+zink reordering via xcb
this is broken

Fixes: 991cc686a5f (egl: really fix kopper fd passing)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30816>
2024-08-23 16:00:47 +00:00
Nanley Chery
23658920d1 anv,iris: Skip tex invalidate for clear conversion
The hardware's clear color conversion feature requires invalidating the
texture cache for every fast clear. We're no longer using the hardware
feature, so we longer need the invalidation.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30646>
2024-08-23 15:28:34 +00:00
Nanley Chery
7b9400b7f7 intel/blorp: Don't use clear color conversion on gfx12
Instead of using the clear color conversion feature by the hardware, use
software to write out the converted clear color pixel.

When testing a patch which moves a state cache invalidate to occur after
fast clears instead of before, this prevents the following failures on
tgl/zink:

* piglit.spec.arb_texture_cube_map_array.arb_texture_cube_map_array-cubemap
* piglit.spec.ext_framebuffer_object.fbo-generatemipmap-formats

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30646>
2024-08-23 15:28:34 +00:00
Nanley Chery
b404ca0eb0 intel: Don't use HW clear color conversion on gfx11
The hardware's clear color conversion feature unfortunately requires
invalidating the texture cache for every fast clear. To avoid the
performance penalty that comes with the invalidation, avoid using the
hardware feature and write out the converted clear color pixel
ourselves.

When testing a patch which moves a state cache invalidate to occur after
fast clears instead of before, this prevents the following failures on
icl/zink:

* piglit.fast_color_clear.fcc-read-after-clear sample tex
* piglit.spec.arb_clear_texture.arb_clear_texture-cube

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30646>
2024-08-23 15:28:34 +00:00
Nanley Chery
dfcd93d12f intel/isl: Fix packing of SINT formats
Prevents the next patch from failing many multisampled, signed integer
rendering tests. For example:

 dEQP-VK.renderpass2.suballocation.multisample_resolve.r8_sint.samples_4

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30646>
2024-08-23 15:28:34 +00:00
Boris Brezillon
fba1c3c721 panvk: Prepare cmd_meta for Valhall
We don't have an RSD descriptor on Valhall, and the vertex
attributes are part of the driver descriptor set, which we
re-emit anyway.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
2024-08-23 14:39:00 +00:00
Boris Brezillon
713f5c3600 panvk: Prepare the cmd_desc_state logic for Valhall
Quite a few things are common to Valhall/Bifrost. Specialize what's
different, and move the move to the root driver directory.

We don't compile it on v10 as this requires the cmd_buffer bits
that are not yet defined.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
2024-08-23 14:39:00 +00:00
Boris Brezillon
c257bf5142 panvk: Conditionally register an host address when tracking user memory
When PANVK_DEBUG=dump, all internal buffers get dumped, but not the user
ones, because they don't have a host address attached to them. Let's
register one when mappings dump is enabled.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
2024-08-23 14:39:00 +00:00
Boris Brezillon
b7e0f14959 panvk: Move panvk_debug_adjust_bo_flags() to panvk_device.h
We will need it for the CSF backend.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
2024-08-23 14:39:00 +00:00
Boris Brezillon
b1db49d078 panvk: Allow more descriptor sets on Valhall
The hardware limit on Valhall is 16 descriptor tables, but we reserve
one for our internal descriptors (dummy sampler, vertex attributes and
dynamic buffers), which leaves us with 15 user descriptor sets.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
2024-08-23 14:39:00 +00:00
Boris Brezillon
5571a4cdaa panvk: Make panvk_queue_finish() a per-arch function
The JM implementation of queue_finish() is simple enough to be inlined,
but that won't be the case of the CSF implementation. So let's make
this function per-arch so we can move it to panvk_vX_queue.c.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
2024-08-23 14:38:59 +00:00
Boris Brezillon
09682bc5b0 panvk: Prepare panvk_cmd_pool for CSF
We will have a new BO pool for CS buffers in the CSF backend.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
2024-08-23 14:38:59 +00:00
Boris Brezillon
598a8d9d11 panvk: Collect allocated push sets at the command level
It makes the reset of command buffers a tad simpler, and it allows
re-cycling push sets.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
2024-08-23 14:38:59 +00:00
Boris Brezillon
5b1cddf35f panvk: Prepare the blend logic for Valhall
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
2024-08-23 14:38:59 +00:00
Rebecca Mckeever
c1b3db966a panvk: Move the VkEvent logic to the jm folder and make it per-arch
The CSF implementation will be completely different.

Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
2024-08-23 14:38:59 +00:00
Mary Guillemard
27beadcbdb panvk: Extend the shader logic to support Valhall
Co-developed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
2024-08-23 14:38:59 +00:00
Mary Guillemard
e350c334b6 panvk: Extend the descriptor lowering pass to support Valhall
Co-developed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
2024-08-23 14:38:59 +00:00
Mike Blumenkrantz
5984fc21a2 lavapipe: VK_EXT_pipeline_robustness
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30790>
2024-08-23 14:14:49 +00:00
Samuel Pitoiset
28c957409f radv/amdgpu: do not check that a CS is aligned if no padding is added
Some video queues don't require padding.

Fixes: d5efbc7f1c ("radv/amdgpu: fix CS padding for non-GFX/COMPUTE queues")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30795>
2024-08-23 13:48:51 +00:00
Collabora's Gfx CI Team
e3113ffcfd Uprev Piglit to 6533b66878c8cb9361c554b7ff940518ab12c816
Fix 038b3c24d70762071d5ed2a219fe1a99a4ba46c6 image build and some expectation files updated.

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30687>
2024-08-23 12:48:30 +00:00
Samuel Pitoiset
3af0f0129c radv: fix DRLR with subpass input attachments and feedback loops
Dynamic rendering local read allows the application to use subpass input
attachments with feedback loops. But unless legacy RPs where it's
possible to determine feedback look at creation time, with dynamic
rendering it's not possible.

To fix that, the driver needs to determine at draw time if a feedback
loop is present, and it needs to decompress DCC/HTILE if necessary.

See https://gitlab.khronos.org/vulkan/vulkan/-/issues/3928 for more
information.

Note that VKCTS is still missing coverage but this has been reported.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11127
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30124>
2024-08-23 12:20:02 +00:00
Samuel Pitoiset
4a191e34c9 radv: add support for input attachment indices with DRLR
They will be used to detect feedback loops.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30124>
2024-08-23 12:20:02 +00:00
Samuel Pitoiset
ab2c8af634 radv: add radv_shader_info::ps::uses_fbfetch_output
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30124>
2024-08-23 12:20:02 +00:00
Samuel Pitoiset
541a204733 radv: use the Mesa-specifc dynamic rendering flag for meta operations
Meta operations never use subpass input attachments.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30124>
2024-08-23 12:20:02 +00:00
Samuel Pitoiset
e57d3551da vk/render_pass: add Mesa-specific flag for dynamic rendering
VK_KHR_dynamic_rendering_local_read allows the application to sample
from a subpass input attachment where this attachment is also the color
attachment (aka. feedback loop). With legacy RPs, it's easy to detect
that at RP creation time by looking at the input<->color indices but
with DRLR this needs to be determined dynamically.

This flag would help when legacy RPs are converted to dynamic rendering
because it's not possible to know if a subpass used input attachments.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30124>
2024-08-23 12:20:02 +00:00
Eric Engestrom
f5923fc2dc venus/ci: move postmerge jobs to -postmerge stage
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30807>
2024-08-23 11:53:41 +00:00
Eric Engestrom
8190165a0a lavapipe/ci: move postmerge jobs to -postmerge stage
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30807>
2024-08-23 11:53:41 +00:00
Eric Engestrom
f9fd30d62d r300/ci: move postmerge jobs to -postmerge stage
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30807>
2024-08-23 11:53:41 +00:00
Erik Faye-Lund
b20eb7ba33 mesa/main: switch from deny-list to allow-list
Now that we are explicitly checking for all supported formats, start
rejecting anything that isn't supported. This should make it easier to
avoid accidentally support formats without enabling the right
extensions-bits first.

A few tests regress on Lima, because we (corretly) deny using GL_FLOAT
as a texture component type. This should be fixed in the Piglit case to
skip the test there instead, but for now let's just update and document
the change.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29835>
2024-08-23 11:21:27 +00:00
Erik Faye-Lund
71cc56e1f7 mesa/main: validate half-float types
Half-float textures got a bit strange in GLES2; they were added by the
OES_texture_float extension, but that added a *different* enum with a
*different* value than what ended up in ARB_half_float_pixel and GLES3.

So, we need to check separately for these. The former one is only
supported on GLES.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29835>
2024-08-23 11:21:27 +00:00
Erik Faye-Lund
63a2f94962 mesa/main: validate integer-formats
RG integer-textures are only supported on OpenGL if the combination
of EXT_texture_integer and ARB_texture_rg is supported. It's also
supported on GL3, but both of those extensions are required there
anyway. In addition GLES3 is supported.

BGR, BGRA and alpha integer-textures are only supported by
EXT_texture_integer.

Luminance and luminance-alpha integer-textures similarly, but are
unsupported in core contexts, because general luminance support is
removed.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29835>
2024-08-23 11:21:27 +00:00
Erik Faye-Lund
dea1b68f73 mesa/main: validate abgr format
This one is fairly trivial; this format has only ever been added by the
EXT_abgr extension. We always support it on GL, but never on GLES.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29835>
2024-08-23 11:21:26 +00:00
Erik Faye-Lund
87edfee086 mesa/main: validate bgr formats
BGR and BGRA formats are either supported by desktop GL or by the
EXT_texture_format_BGRA8888 extension. Either of these should always be
supported, so let's just assert it and return true.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29835>
2024-08-23 11:21:26 +00:00
Erik Faye-Lund
e8226bda60 mesa/main: validate desktop gl format/types
Most of these are either always supported, or supported on GL
compatibilitry profile. There's a few exceptions, though.

Luminance, luminance-alpha and alpha formats were removed from core
profiles, but are supported in all versions of GLES.

Float formats were always supported on desktop, but on GLES it was
initially added as a GLES2 extension through OES_texture_float, and
finally promoted to core in GLES3. However, since we check for
OES_texture_float support to to enable GLES3 support, only checking
for the extension is sufficient.

The 16-bit BGRA formats are supported on GL from version 1.2, and on
GLES by the EXT_read_format_bgra extensions. Either of these should
always be supported, so let's just assert this and return true.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29835>
2024-08-23 11:21:26 +00:00
Erik Faye-Lund
ca2fbfdaa0 mesa/main: check depth/stencil formats
GL_DEPTH_COMPONENT is supported from OpenGL 1.4 and later, or using
OES_depth_texture on OpenGL ES.

GL_DEPTH_STENCIL is supported from OpenGL 3.0 on, or by
EXT_packed_depth_stencil. The latter is always supported in the first
place, so no need to test for the former.

In addition, there's an interaction between OES_depth_texture and
OES_packed_depth_stencil that allows this on OpenGL ES 2.0 and later.

The end result is that we alway support GL_DEPTH_STENCIL, with the
notable exception of OpenGL ES 1.x.

Similarly, we always support either EXT_packed_depth_stencil or the OES
variant, both of which adds support for the GL_UNSIGNED_INT_24_8 type.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29835>
2024-08-23 11:21:26 +00:00
Erik Faye-Lund
ea6f960ec8 mesa/main: validate GL_UNSIGNED_INT_10_10_10_2
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29835>
2024-08-23 11:21:26 +00:00
Erik Faye-Lund
9409113d26 mesa/main: validate GL_UNSIGNED_INT_2_10_10_10_REV
This type is allowed in OpenGL 1.2, which is guaranteed on desktop GL.
For OpenGL ES, it got introduced in EXT_texture_type_2_10_10_10_REV as
well as OpenGL ES 3.0. However, we already require
EXT_texture_type_2_10_10_10_REV for OpenGL ES 3.0 support, so just
checking for the extension should be enough.

We already have a helper that does all of the above, so let's use that
one.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29835>
2024-08-23 11:21:26 +00:00