Commit Graph

192236 Commits

Author SHA1 Message Date
Alyssa Rosenzweig
26de3d5366 glsl/float64: handle signed zero with min/max
Ensure the following identities hold to match IEEE-754-2019 and upcoming NIR:

   min(-0, +0) = -0
   min(+0, -0) = -0
   max(-0, +0) = +0
   max(+0, -0) = +0

To implement, we specialize a version of flt64_nonnan. The regular flt64 has
extra logic to handle signed zero, so this version is actually simpler. So in
addition to the bug fix, this is an optimization. Compute shaders from
KHR-GL46.gpu_shader_fp64.builtin.max_dvec4 before and after:

   before: 136 inst, 122 alu, 122 fscib, 4 ic, 1006 bytes, 39 regs, 28 uniforms
   after:  104 inst,  90 alu,  90 fscib, 4 ic,  766 bytes, 39 regs, 28 uniforms

I will happy take a 24% reduction in instruction count as the cost of standards
conformance ^_^

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30075>
2024-07-15 19:29:00 +00:00
Alyssa Rosenzweig
6f48fa4ebe nir: strengthen fmin/fmax definitions with signed zero
SPIR-V strengthened the semantics around signed zero, requiring fmin(-0, +0) =
-0. Since nir_op_fmin is commutative, we must also require fmin(+0, -0) = -0 to
match, although it's unclear if SPIR-V requires that. We must strengthen NIR's
definitions accordingly.

This strengthening is additionally motivated by the existing nir_opt_algebraic
rule like:

   (('fmin', a, ('fneg', a)), ('fneg', ('fabs', a))),

With the strengthened new definition, this transform is clearly exact. With the
weaker definition, the transform could change the sign of zero based on
implementation-defined behaviours which ... while, not exactly unsound, is
undesireable semantically.

...

This is probably technically a bug fix, but I'm not convinced it's worth it's
weight in backporting.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30075>
2024-07-15 19:29:00 +00:00
Alyssa Rosenzweig
7fc5a2296b nir: use MIN2/MAX2 opcodes for imin/umax folding
This is more idiomatic and already #include'd.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30075>
2024-07-15 19:29:00 +00:00
Alyssa Rosenzweig
e8db5759b8 nir/search: use ALU float control helpers
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30075>
2024-07-15 19:29:00 +00:00
Alyssa Rosenzweig
d4c6fbc4a7 nir: add nir_alu_instr float controls queries
These are helpful now that float_controls2 exists, these are common
patterns worth factoring out into helpers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30075>
2024-07-15 19:29:00 +00:00
Konstantin Seurer
43dadbd2fa nir: Add FLOAT_CONTROLS_.*_PRESERVE
A logical or of all bit sizes.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30075>
2024-07-15 19:28:59 +00:00
Alyssa Rosenzweig
fc1521e57c util: add dui/uid helpers
like fui/uif but for fp64. will be used for NIR constant folding.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30075>
2024-07-15 19:28:59 +00:00
C Stout
b16b1d05c5 meson: remove unnecessary line continuation
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30190>
2024-07-15 18:46:31 +00:00
Marek Olšák
2afd233145 radeonsi: lock a mutex when updating scratch_va for compute shaders
Fixes: 3b0bfd254f - radeonsi/gfx11: make flat_scratch changes for compute

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30071>
2024-07-15 13:52:27 -04:00
Marek Olšák
a5b4ae67ae ac: add radeon_info::has_scratch_base_registers
Fixes: 3b0bfd254f - radeonsi/gfx11: make flat_scratch changes for compute

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30071>
2024-07-15 13:52:25 -04:00
Marek Olšák
bc4382348d radeonsi: don't update compute scratch if the compute shader doesn't use it
We need to save the last COMPUTE_TMPRING_SIZE value in si_context because
it's no longer computed when compute scratch isn't used.

Fixes: 3b0bfd254f - radeonsi/gfx11: make flat_scratch changes for compute

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30071>
2024-07-15 13:52:22 -04:00
Marek Olšák
c353394a21 radeonsi: replace si_shader::scratch_bo with scratch_va, don't set it on gfx11+
This removes the unnecessary buffer reference and improves this fragile
code.

Fixes: 3b0bfd254f - radeonsi/gfx11: make flat_scratch changes for compute
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11463

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30071>
2024-07-15 13:52:18 -04:00
C Stout
880f0fc8ce vulkan/util: add missing dependencies
gen_enum_to_str.py and vk_struct_type_cast_gen.py both import
vk_extensions.py

Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30164>
2024-07-15 16:19:41 +00:00
Marek Olšák
7ff016610f radeonsi/ci: update gfx11 failures
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30173>
2024-07-15 15:00:50 +00:00
Marek Olšák
02e60a221c radeonsi: rewrite the clear/copy_buffer microbenchmark
It removes testing cases that we don't need, and adds testing cases that we
need, such as alignment and the default codepath. The result is much less code.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30173>
2024-07-15 15:00:50 +00:00
Marek Olšák
65b09edff2 radeonsi: clear buffers with a 12B clear value by clearing 4 dwords per thread
It's faster than clearing 3 dwords per thread.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30173>
2024-07-15 15:00:50 +00:00
Marek Olšák
9fa0cb8aa8 radeonsi: add dwords_per_thread parameter into si_compute_clear_copy_buffer
It will be used by the dmaperf microbenchmark.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30173>
2024-07-15 15:00:50 +00:00
Marek Olšák
ca4f6fde54 radeonsi: use a hash_table and define a shader key for the DMA compute shader
Right now the shader has 3 variants, and there will be more.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30173>
2024-07-15 15:00:50 +00:00
Marek Olšák
8df427f162 radeonsi: add fail_if_slow parameter into compute_clear/copy_buffer
and move all failure paths into it.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30173>
2024-07-15 15:00:50 +00:00
Mike Blumenkrantz
e42a25aea1 mesa/st: load state params for feedback draws with allow_st_finalize_nir_twice
as proposed by Amol Surati, this should ensure that the params are always updated

Fixes: 5eb0136a3c ("mesa/st: when creating draw shader variants, use the base nir and skip driver opts")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30126>
2024-07-15 13:11:20 +00:00
Georg Lehmann
b0ad3c2160 aco: fix s_delay_alu with salu and trans dependency
These events were silently truncated in get_counters_for_event.
The integer types in this pass are a bit all over the place, maybe we should
consider using typedefs for clarity or a different solution with type safety.

Fixes: 9e9cabd2fa ("aco/waitcnt: support GFX12 in waitcnt pass")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30163>
2024-07-15 12:02:35 +00:00
Mark Collins
a4b8d17c29 fd/meson: Only build 'ds' when system has DRM
This would result in compilation errors on non-DRM Turnip builds
that included perfetto support.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30147>
2024-07-15 11:39:20 +00:00
Mark Collins
d77b0f7cb1 tu/kgsl: Fix profiling buffer GPU IOVA
The IOVA being submitted was of the suballocation rather than
the parent buffer.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30147>
2024-07-15 11:39:20 +00:00
Mark Collins
0d6faa21f8 tu/kgsl: Spin unti KGSL reports queue timestamp during profiling
KGSL writes the profiling values asynchronously while we read them
immediately after the IOCTL returns which can result in the struct
not being filled in by the time we read it, this results in AGI not
correctly processing any timestamps from larger submits which take
longer to queue. To fix this, we now busy-wait on until the value
has been written out by KGSL.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30147>
2024-07-15 11:39:20 +00:00
Juan A. Suarez Romero
2d54a605fe v3dv: free temp image created when copying with blit
This fixes a leak that happens when copying a image using blit, and the
image is a compressed one.

In this case a new image view is created that can be re-interpreted to
perform the copy, but was not properly free.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30161>
2024-07-15 11:14:29 +00:00
Juan A. Suarez Romero
cbd3927445 v3d: expose ARB_depth_clamp in V3D 7.x
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30155>
2024-07-15 11:45:37 +02:00
Juan A. Suarez Romero
f8623ea7da v3dv: adversise VK_EXT_depth_clamp_zero_one
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30148>
2024-07-15 09:17:40 +00:00
Eric Engestrom
ce7e1e0f7a v3d/ci: add disabled job for CL testing on the RPi5
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30076>
2024-07-15 08:29:36 +00:00
Eric Engestrom
7c40c35b97 v3d/ci: rename "rusticl on v3d" suite to v3d-rusticl
There's nothing rpi4-specific in there, it just tests rusticl on v3d,
and the next commit will do exactly that on the rpi5.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30076>
2024-07-15 08:29:36 +00:00
Eric Engestrom
beb05d14ae v3d/ci: add disabled job for GL testing on the RPi5
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30076>
2024-07-15 08:29:36 +00:00
Samuel Pitoiset
15a3aff0f1 radv: use zero allocation for the device queues
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30153>
2024-07-15 09:34:42 +02:00
Samuel Pitoiset
5fa22f9fec radv: regroup all tools initialization in one helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30153>
2024-07-15 09:34:42 +02:00
Samuel Pitoiset
9d2751bbde radv: add radv_device_init_rmv()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30153>
2024-07-15 09:34:42 +02:00
Samuel Pitoiset
27a90f1f29 radv: add helpers for init/deinit device fault detection
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30153>
2024-07-15 09:34:42 +02:00
Samuel Pitoiset
351fba7ee3 radv: add radv_device_init_trap_handler()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30153>
2024-07-15 09:34:42 +02:00
Samuel Pitoiset
4ab6357c42 radv: simplify keeping shader info for GPU hangs debugging
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30153>
2024-07-15 09:34:42 +02:00
Samuel Pitoiset
fe09a6d72b radv: add helpers for init/deinit RGP
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30153>
2024-07-15 09:34:42 +02:00
Samuel Pitoiset
033084c912 radv: add helpers for init/deinit device memory cache
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30153>
2024-07-15 09:34:42 +02:00
Samuel Pitoiset
01339c6c93 radv: add radv_device_init_perf_counter()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30153>
2024-07-15 09:34:42 +02:00
Samuel Pitoiset
5657f21fcf radv: destroy the perf counter BO in radv_device_finish_perf_counter()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30153>
2024-07-15 09:34:42 +02:00
Josh Simmons
c68408d195 radv: Fix crash when using SQTT and NO_COMPUTE
Signed-off-by: Josh Simmons <josh@nega.tv>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30177>
2024-07-15 07:05:40 +00:00
Dave Airlie
d94a40fe08 anv/video: use correct offset for MPR row store scratch buffer.
While playing with zink video, I found this was using the wrong
offset.

Fixes: 98c58a16ef ("anv: add initial video decode support for h264.")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30143>
2024-07-15 01:05:18 +00:00
M Henning
e506955056 nir: Handle texop_*_nv in nir_tex_instr_is_query
Fixes: aa1f00cf ("nir/gather_info: handle uses_fbfetch_output for texture operations")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11505
Tested-by: Thomas H.P. Andersen <phomes@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30166>
2024-07-13 15:36:29 +00:00
Eric Engestrom
bfef1a4450 lvp+zink/ci: document a flake seen in a merge pipeline
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30175>
2024-07-13 10:17:10 +00:00
Eric Engestrom
f0af09d1f6 turnip+zink/ci: add two more CS related flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30174>
2024-07-13 09:55:17 +00:00
Eric Engestrom
89742437ef zink+nvk/ci: document regression from !30033
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30171>
2024-07-13 11:30:09 +02:00
Eric Engestrom
92572501bb zink+nvk/ci: ascii-sort fails
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30171>
2024-07-13 11:30:09 +02:00
Pierre-Eric Pelloux-Prayer
a04dc1a451 frontends/dri: add error logs to dri2_create_image_from_fd
These silent failures are hard to track otherwise.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30159>
2024-07-13 02:44:17 +00:00
Pierre-Eric Pelloux-Prayer
252485b0e2 radeonsi: fix si_get_dmabuf_modifier_planes for gfx12
DCC_RETILE/DCC only makes sense if TILE_VERSION is lower than
AMD_FMT_MOD_TILE_VER_GFX12.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30159>
2024-07-13 02:44:17 +00:00
Marek Olšák
0bb83a4060 ac/surface: finish display DCC for gfx12
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30114>
2024-07-13 02:17:37 +00:00