Commit graph

71368 commits

Author SHA1 Message Date
Eric Engestrom
54d8f2a1cf llvmpipe/ci: document fixed tests
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37575>
2025-09-25 17:07:59 +00:00
Silvio Vilerino
d4f44edbff mediafoundation: Use d3d12 extension set_video_encoder_max_async_queue_depth to save memory in low latency (no async/in flight frames)
Reviewed-by: Pohsiang (John) Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37565>
2025-09-25 16:17:28 +00:00
Silvio Vilerino
d7c4131963 d3d12: Fix video encoder async depth fence wait off by one bug
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37565>
2025-09-25 16:17:28 +00:00
Silvio Vilerino
b8f2c41581 d3d12: Allow frontends to set_video_encoder_max_async_queue_depth() to manage encoder memory overhead
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37565>
2025-09-25 16:17:28 +00:00
Silvio Vilerino
b2b009fc29 d3d12: Use lower size estimations for compressed output bitstream sizes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37565>
2025-09-25 16:17:28 +00:00
Silvio Vilerino
0395dca6d6 mediafoundation: Use lower size estimations for compressed output bitstream sizes
Reviewed-by: Pohsiang (John) Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37565>
2025-09-25 16:17:27 +00:00
Marek Olšák
a441a30921 radeonsi: compute blake3 hashes of internal shaders if they are not set
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37566>
2025-09-25 14:22:57 +00:00
Marek Olšák
e018b916d1 radeonsi/ci: primitive_counter failures are no longer reproducible on gfx12
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37566>
2025-09-25 14:22:57 +00:00
Marek Olšák
6d88d2c2c3 radeonsi: switch VBO descriptor uploads from u_upload_alloc_ref to u_upload_alloc
This is cleaner. No effect on behavior.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37566>
2025-09-25 14:22:57 +00:00
Marek Olšák
cc29c41f06 radeonsi: don't ref and unref an index buffer uploaded from a user buffer
This replaces u_upload_data_ref with u_upload_data.

No effect since TC ensures we don't get user buffers.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37566>
2025-09-25 14:22:57 +00:00
Marek Olšák
f140b96edc radeonsi: remove recursion from si_set_constant_buffer
Instead of calling self to bind NULL on user buffer upload failure,
upload sooner and set input = NULL on failure.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37566>
2025-09-25 14:22:57 +00:00
Marek Olšák
1a8088d62b radeonsi: if rebinding the same constbuf, don't update refcount with atomics
It was decrementing and then incrementing the refcount in that case.

If buffers->buffers[slot] == buffer, there are no atomics.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37566>
2025-09-25 14:22:57 +00:00
Marek Olšák
cfeccfbb3a radeonsi: inline si_upload_const_buffer
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37566>
2025-09-25 14:22:57 +00:00
Marek Olšák
baa7a5fd80 radeonsi: always set TC_L2 for CP DMA on GFX12
TC_L2 likely means MALL, though it could also have no meaning.
CP never uses L2 on GFX12.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37566>
2025-09-25 14:22:56 +00:00
Christian Gmeiner
e39ba2f6e8 etnaviv: Fix util_blitter_save_so_targets(..) call
The current code was conditionally passing empty streamout targets to
util_blitter_save_so_targets() only when ETNA_DBG_DEQP was enabled.

Since etnaviv supports hardware streamout on some GPUs, we should
always pass the actual streamout state to properly save and restore
it during blitter operations.

Fixes: 52bc3c2d20 ("etnaviv: Implement stream output target management")
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37564>
2025-09-25 10:44:37 +00:00
Caio Oliveira
f00fca998e intel/mda: Add MDA_FILTER to select which archives to generate
Matches if names contains the filter value, multiple values separated by
commas.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29146>
2025-09-24 23:08:45 -07:00
Caio Oliveira
dedbe0e826 iris: Create archive file when using INTEL_DEBUG=mda
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29146>
2025-09-24 23:08:45 -07:00
Silvio Vilerino
12354cd96e d3d12: Fix typo in cast when reading pipe_h265_enc_picture_desc::gpu_stats_psnr
Reviewed-by: Pohsiang (John) Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37551>
2025-09-24 17:41:45 +00:00
Mario Kleiner
fc44e708d7 asahi: Set PIPE_BIND_SCANOUT in agx_resource_from_handle().
Commit 534a04d557 optimized agx_resource_from_handle() to lazily
defer assignment of a kms-ro renderonly_scanout object to an imported
resource until its kms winsys handle is actually queried by a caller
via agx_resource_get_handle(), to avoid unnecessary import into the
DCP display controller. Only resources with bind flag PIPE_BIND_SCANOUT
will get a renderonly_scanout object assigned during such queries.

Problem: This prevents Mesa GBM's gbm_bo_import() function from properly
importing dmabufs for direct scanout use by some Wayland compositors,
e.g., GNOME mutter.

gbm_bo_import() of dmabuf fd's (GBM_BO_IMPORT_FD / GBM_BO_IMPORT_FD_MODIFIER),
even with GBM_BO_USE_SCANOUT flag, will not mark an imported bo with the
PIPE_BIND_SCANOUT bind flag before internally assigning its KMS winsys
handle via screen->resource_get_handle() -> agx_resource_get_handle(),
causing silent failure of that query. Therefore gbm_bo_import() seems
to return a successfully created gbm_bo with all proper properties,
but gbm_bo_get_handle() and gbm_bo_get_handle_for_plane() will return
invalid handles. These invalid handles cause drmAddFbXXX ioctl calls to
fail, and therefore failure of direct scanout of wl_buffers.

Setting PIPE_BIND_SCANOUT for a resource in agx_resource_from_handle()
may retain the optimization and makes gbm_bo_get_handle[_for_plane]()
work. This fixes direct scanout of fullscreen wl_surface / wl_buffers
under at least GNOME mutter 48.

Fixes: 534a04d557 ("asahi: Flip kmsro around to allocate on the GPU")
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37538>
2025-09-24 15:14:42 +00:00
Daniel Schürmann
dd68825feb radeonsi: allow for unsigned wraps for shared memory intrinsics in nir_opt_offsets
Also set correct maxima.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37453>
2025-09-24 14:28:24 +00:00
David Rosca
27f1c671ec radeonsi/uvd: Swap order of comparison to avoid warning
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This code worked correctly because va frontend only sets 15 references
and thus ref[15] is always NULL. But the code is still written as being
able to handle 16 refs, so let's fix that.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13920
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37456>
2025-09-24 11:40:28 +00:00
Eric Engestrom
5b4903a2bd i915/meson: generate intel_device_info_gen.h before compiling i915_drm_winsys.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37544>
2025-09-24 10:23:18 +00:00
Eric Engestrom
559851ab9e freedreno/meson: generate xml headers before compiling gmemtool
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37544>
2025-09-24 10:23:18 +00:00
Rhys Perry
bf9a3bfd86 rusticl: support NIR_DEBUG=progress_validation
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35069>
2025-09-24 08:20:29 +00:00
Rhys Perry
20c316718c rusticl: support NIR_DEBUG=invalidate_metadata/extended_validation
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35069>
2025-09-24 08:20:29 +00:00
Lionel Landwerlin
1d8847afcf anv: fix streamout config comparison
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: e76ed91d3f ("anv: switch over to runtime pipelines")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37251>
2025-09-23 16:01:30 +00:00
Lionel Landwerlin
8e93e7cd72 brw: layout patch in VUE in position independent way
Only if required. I somehow misunderstood that those would need to be
independent too, not just the vertex slots.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 8dee4813b0 ("brw: add ability to compute VUE map for separate tcs/tes")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37251>
2025-09-23 16:01:30 +00:00
Mike Blumenkrantz
3b6b03bd3b zink: convert task_payload offset to array index in prepass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37528>
2025-09-23 10:56:50 -04:00
José Roberto de Souza
5a482a7a3d gallium/llvmpipe/test: Rename rsqrtf() to _rsqrtf()
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Some versions of math.h exports rsqrtf() while others don't, so this
was causing compilation to fail when it is supported.
I have not found a easy way to detect if rsqrtf() is supported and
as this is only used in a llvmpipe tests it is not worthy do changes
in Meson files to detected if it is supported.

So here just renaming the Mesa function to _rsqrtf() and fixing the
build for both math.h versions.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13797
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12934
Reviewed-by: Roland Scheidegger <roland.scheidegger@broadcom.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37515>
2025-09-23 14:02:23 +00:00
Valentine Burley
e2e13f23a0 zink/ci: Re-enable ASan leak detection and drop VVL filter on CML
This job is stable again with the fix in c85168160e ("zink: reset batch
states on destroy")

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37519>
2025-09-23 10:56:31 +00:00
Qiang Yu
c334ade0c2 gallium: fix eglExportDMABUFImageQueryMESA crash for r600
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
r600 does not implement pipe_screen.resource_get_param, so
dri2_resource_get_param just return false here.

eglExportDMABUFImageQueryMESA has been changed to support
multi plane resource, so some emulated multi plane format
gets here and return NULL which causes following queries
with this return value crash.

Fixes: f416a52960 ("egl: refine dma buf export to support multi plane")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13921
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37503>
2025-09-23 02:08:57 +00:00
sarbes
2f99f95288 lima: wire up anisotropic filtering
v2:
- AF seems to be log2 based, so convert accordingly

v3:
- actually expose AF

v4:
- REALLY expose AF
- remove log2 modifier assert
- use log2 modifier
- rename AF field
- advertise AF support in features

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37189>
2025-09-22 19:40:31 +00:00
Mike Blumenkrantz
9f893de953 hud: delete buffer refcounting
this otherwise leaks memory

Fixes: b3133e250e ("gallium: add pipe_context::resource_release to eliminate buffer refcounting")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37516>
2025-09-22 18:44:36 +00:00
Christian Gmeiner
0c6c1fa484 etnaviv: Implement hardware based streamout support
Add support for hardware-accelerated transform feedback using the TFB
command register to control capture state.

Maintains the hardware state through an enum distinguishing between
idle (no hardware state established), active (hardware currently
capturing), and paused (hardware stopped).

Hardware commands are emitted based on state transitions:
 - ENABLE when moving from idle to active
 - RESUME when transitioning from paused to active
 - DISABLE when stopping capture

Transform feedback buffer setup is using the existing dirty state
mechanism through ETNA_DIRTY_STREAMOUT_BUFS, while command emission uses
the new ETNA_DIRTY_STREAMOUT_CMD flag. Buffer descriptors are computed by
mapping vertex shader transform feedback outputs to fragment shader input
registers, as required by the hardware.

A 64-byte context buffer is allocated per context to maintain hardware
state isolation between applications using transform feedback
simultaneously. The hardware state persists across pause and resume
cycles within a command stream but resets during flushes since transform
feedback state does not survive command buffer boundaries.

The implementation enables the full transform feedback capability with
support for 4 buffers and up to 64 separate or interleaved components,
replacing the previous debug-only stub implementation.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37320>
2025-09-22 15:36:32 +00:00
Christian Gmeiner
52bc3c2d20 etnaviv: Implement stream output target management
Add infrastructure for stream output by implementing the required Gallium
interface functions for creating, destroying, and binding stream output targets.

This lays the groundwork for transform feedback support in etnaviv.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37320>
2025-09-22 15:36:32 +00:00
Christian Gmeiner
bdd9d8b13d etnaviv: Support PIPE_QUERY_PRIMITIVES_EMITTED
Add support for transform feedback primitive counting queries using the
hardware TFB query mechanism. The implementation uses dedicated query
registers (VIVS_TFB_QUERY_BUFFER and VIVS_TFB_QUERY_COMMAND) to track
the number of primitives written during transform feedback operations.

The hardware automatically accumulates primitive counts and stores the
final result at offset 0 of the query buffer, eliminating the need for
manual accumulation.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37320>
2025-09-22 15:36:31 +00:00
Christian Gmeiner
bbac6a8b53 etnaviv: Pass context to acc sample provider supports(..) function
Extend the supports(..) function signature in acc sample providers
to accept an etna_context parameter, enabling GPU feature validation
during query type support checks.

This change prepares the infrastructure for query providers to make
context-aware decisions based on available GPU capabilities.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37320>
2025-09-22 15:36:31 +00:00
Christian Gmeiner
ebd5504f73 etnaviv: Support hw based rasterizer_discard
Add native hardware support for rasterizer_discard on GPU cores that
support the HWTFB (Hardware Transform Feedback) feature. This moves
rasterizer discard handling from software clipping to dedicated
hardware state.

Passes all dEQP-GLES3.functional.rasterizer_discard.* with HWTFB.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37320>
2025-09-22 15:36:31 +00:00
Seán de Búrca
53040a1600 rusticl/kernel: remove mutexes from kernel structure
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37354>
2025-09-22 10:57:46 +00:00
Seán de Búrca
c440beb171 rusticl/kernel: add Kernel::mut_ref_from_raw()
The OpenCL spec indicates that functions which modify `cl_kernel` are
not thread-safe, allowing us to handle those functions with standard
mutability.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37354>
2025-09-22 10:57:46 +00:00
Karol Herbst
6f41c62720 rusticl/mesa: make PipeScreen refcounted
Reviewed-by: Seán de Búrca <sdeburca@fastmail.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37377>
2025-09-22 10:16:13 +00:00
Karol Herbst
501f59e159 rusticl/mesa: make PipeScreen transparent
Reviewed-by: Seán de Búrca <sdeburca@fastmail.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37377>
2025-09-22 10:16:13 +00:00
Karol Herbst
f7fcd7ed5d rusticl/mesa: rework Context creation
Reviewed-by: Seán de Búrca <sdeburca@fastmail.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37377>
2025-09-22 10:16:12 +00:00
Karol Herbst
6a71ecaad7 rusticl/mesa: add PipeScreen::pipe
Reviewed-by: Seán de Búrca <sdeburca@fastmail.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37377>
2025-09-22 10:16:11 +00:00
Karol Herbst
b67be5d829 rusticl/util: make ThreadSafeCPtr Copy, Clone and transparent
Reviewed-by: Seán de Búrca <sdeburca@fastmail.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37377>
2025-09-22 10:16:11 +00:00
Qiang Yu
93024ea247 radeonsi: hide real modifier export behind AMD_DEBUG
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Some applications are not ready to handle multi plane
modifiers.

User who want this feature can use AMD_DEBUG=export_modifier
to enable it again.

Fixes: 0a266f0256 ("radeonsi: really support eglExportDMABUFImageQueryMESA")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13917
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37433>
2025-09-22 01:51:21 +00:00
Qiang Yu
996c0af482 radeonsi: fix use aco/llvm debug options
They should be moved to shader options.

Fixes: 5c92fe45a1 ("radeonsi: support more than 64 options for AMD_DEBUG")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37433>
2025-09-22 01:51:21 +00:00
Eric Engestrom
19dc279d43 zink/ci: drop gbm override now that debian has a usable xorg
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35853 gave us
a debian package which has `--disable-thread-safety-constructor` removed,
fixing this bug.

The `blender-demo-ellie_pose.trace` and `counterstrike-v2.trace` updates
are because there's a rectangle at the top (for blender, window title
bar I expect) or on the sides (counterstrike, padding for image ratio)
which renders grey in gbm and black in xorg.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37437>
2025-09-20 06:59:01 +00:00
Roland Scheidegger
b0be900f93 llvmpipe: implement GL_ARB_sample_locations
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Needing the positions both in the scene for rasterization (in fixed point)
and in the fs (as floats) is a bit awkward, for now just put it in fs key.
Otherwise pretty straight forward.

Reviewed-by: Michal Krol <michal.krol@broadcom.com>
Reviewed-by: Brian Paul <brian.paul@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37181>
2025-09-20 01:57:05 +00:00
Roland Scheidegger
60924b4819 gallium,mesa/st: reverse logic for y flip for programmable sample locations
mesa/st flips y coordinates if fbo orientation is Y_0_BOTTOM (essentially
user fbos), and all 3 gallium drivers supporting the feature then
unconditionally reverse this flip. llvmpipe wants to support this as well,
and it would have to do the flip too, and it's actually problematic for
lavapipe, since then lavapipe would have to flip as well, which means that
we'd lose the ability to set y positions to 0 (as the flip with the 4 bit
values does 16-val), and vulkan requires the minimum to be 0.
Hence, reverse this and flip when fbo orientation is Y_0_TOP. I don't actually
pretend to know if this is correct or if just no flipping should occur, but at
least this is consistent with how default sample locations are reported by mesa
via glGetMultisamplefv (which does y flip with the values it gets via
pipe->get_sample_position() if it's a winsys fb).

Reviewed-by: Michal Krol <michal.krol@broadcom.com>
Reviewed-by: Brian Paul <brian.paul@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37181>
2025-09-20 01:57:04 +00:00