Commit Graph

168071 Commits

Author SHA1 Message Date
Faith Ekstrand 06257514c1 nir: Return a mesa_prim from gs_in_prim_for_topology
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24821>
2023-12-05 23:12:32 +00:00
Faith Ekstrand e3ff5a3b0e intel/vec4: Use MESA_PRIM_* instead of GL_*
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24821>
2023-12-05 23:12:32 +00:00
Faith Ekstrand b97003e49a glsl: Properly remap GL_* to MESA_PRIM
Instead of blatantly assuming with no assert that they're the same, add
a remap function.  Also, be more careful about which enum we use where.
In the AST, we use GLenum and GL_FOO because we also need GL_ISOLINES.
When we translate to shader info, GS gets translated into mesa_prim
and tessellation gets translated into tess_primitive_mode which has
ISOLINES as a valid primitive value.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24821>
2023-12-05 23:12:32 +00:00
Faith Ekstrand a41d65cfba dxil: Use mesa_prim consistently
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24821>
2023-12-05 23:12:32 +00:00
Karol Herbst 65de9bc81a clc: add dump_llvm debug options
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26524>
2023-12-05 22:45:53 +00:00
Karol Herbst d9d398e652 clc: allow debug flag to be read from other files
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26524>
2023-12-05 22:45:53 +00:00
Samuel Pitoiset 3678482f1e radv: set combinedImageSamplerDescriptorCount to 1 for multi-planar formats
RADV compacts all descriptors for multi-planar images into one
combined image sampler, so it should be 96, and not eg. 192 for a two
planes format.

Fixes new CTS
dEQP-VK.binding_model.descriptor_buffer.ycbcr_sampler.*array.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26498>
2023-12-05 22:27:19 +00:00
Alyssa Rosenzweig 65e431e61a nir/lower_idiv: Optimize idiv sign calculation
Save a comparison, and move out the comparison to be more backend friendly.
Saves 2 instrs on AGX (as the remaining comparison now fuses with bcsel).

Results on AGX, all affected shaders in asphalt9.

   total instructions in shared programs: 1813003 -> 1812611 (-0.02%)
   instructions in affected programs: 119646 -> 119254 (-0.33%)
   helped: 333
   HURT: 0
   Instructions are helped.

   total bytes in shared programs: 11870344 -> 11867208 (-0.03%)
   bytes in affected programs: 820888 -> 817752 (-0.38%)
   helped: 333
   HURT: 0
   Bytes are helped.

and on Mali-G57:

   total instructions in shared programs: 2677538 -> 2677205 (-0.01%)
   instructions in affected programs: 206923 -> 206590 (-0.16%)
   helped: 333
   HURT: 0
   Instructions are helped.

   total cvt in shared programs: 14667.50 -> 14662.30 (-0.04%)
   cvt in affected programs: 1953.64 -> 1948.44 (-0.27%)
   helped: 333
   HURT: 0
   Cvt are helped.

   total quadwords in shared programs: 1450664 -> 1450544 (<.01%)
   quadwords in affected programs: 5064 -> 4944 (-2.37%)
   helped: 15
   HURT: 0
   Quadwords are helped.

   total threads in shared programs: 53282 -> 53309 (0.05%)
   threads in affected programs: 27 -> 54 (100.00%)
   helped: 27
   HURT: 0
   Threads are helped.

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/26489>
2023-12-05 21:46:26 +00:00
Eric Engestrom 910000f30f freedreno/ci: add more flakes seen on a630
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/52365773 and its
automatic retry https://gitlab.freedesktop.org/mesa/mesa/-/jobs/52365892
have two distinct sets of failures; add all of them as flakes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26517>
2023-12-05 21:21:07 +00:00
Eric Engestrom 21b0445d05 freedreno/ci: add flake seen on a630
Failed in https://gitlab.freedesktop.org/mesa/mesa/-/jobs/52372985 and
passed in the retry https://gitlab.freedesktop.org/mesa/mesa/-/jobs/52374333

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26517>
2023-12-05 21:21:07 +00:00
Rhys Perry e110eac171 aco: insert p_end_wqm before p_jump_to_epilog
Otherwise, we can transition to exact before p_jump_to_epilog, then
transition to WQM again and then back to exact:
p_jump_to_epilog //transitions to exact
p_logical_end //transitions to wqm
p_end_wqm //transitions to exact

We rely on ssa elimination to clean most of this up.

fossil-db (navi21):
Totals from 1 (0.00% of 79330) affected shaders:
Instrs: 111 -> 110 (-0.90%)
CodeSize: 572 -> 568 (-0.70%)
Copies: 16 -> 15 (-6.25%)

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/25440>
2023-12-05 21:02:04 +00:00
Connor Abbott 24527b3d28 tu: Move shader linking to tu_shader.cc
This creates a function that can be used by both pipelines and shaders.

Note that we cannot yet call tu_CreateShadersEXT directly inside the
pipeline due to things like pipeline feedback, multiview, and so on, but
further extensions will hopefully bring us closer to that ideal.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25679>
2023-12-05 20:38:28 +00:00
Connor Abbott ca03e6ab3f tu: Make filling out tu_program_state not depend on the pipeline
We will need to fill it out at draw time for shader objects.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25679>
2023-12-05 20:38:28 +00:00
Connor Abbott 88db736472 tu: Rework dynamic offset handling
With shader objects, we won't have the pipeline layout available. This
means that the current way we implement dynamic offset descriptors in
combination with fast-linking and independent descriptor sets, where we
use the pipeline layout when fast-linking that has pre-computed offsets
for each descriptor set, won't work. Instead we need to piece together
the sizes of the descriptors in each descriptor set from the shaders.
This is already effectively what we do when we stitch together the
pipeline layout when fast-linking, but we need to make it work with just
the shaders.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25679>
2023-12-05 20:38:28 +00:00
Connor Abbott af691ec8e4 tu: Don't use pipeline layout to emit shared const enable
It won't exist when we emit this at draw time for shader objects.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25679>
2023-12-05 20:38:27 +00:00
Faith Ekstrand 785290836b nak: Add a barrier propagation pass
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26463>
2023-12-05 18:59:40 +00:00
Faith Ekstrand a595535074 nak: Force RA to allocate bar_in/out to the same register
OpBreak and OpBSsy aren't very SSA friendly as they require bar_in and
bar_out to be assigned the same register.  We need to encure that RA
knows about this restriction.  For now, we just special-case these two
instructions.  In the future we may want a more generic mechanism for
this but it's not worth it for just two instructions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26463>
2023-12-05 18:59:40 +00:00
Faith Ekstrand eda940c855 nak: Make barriers SSA-friendly
The NIR intrinsics now take and return a barrier whenever one is
modified instead of modifying in-place.  In NAK, we give the internal
instructions the same treatment and convert everything to use barrier
SSA values and RegRefs.  In nak_from_nir, we move all barriers to/from
GPRs.  We'll clean up the massive pile of OpBMov later.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26463>
2023-12-05 18:59:40 +00:00
Faith Ekstrand 71813afa7a nak: Take num_barriers from RA
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26463>
2023-12-05 18:59:40 +00:00
Faith Ekstrand dca65f62c8 nak: Add support for spilling barriers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26463>
2023-12-05 18:59:40 +00:00
Faith Ekstrand 7cd9680554 nak: Add back OpBMov with better semantics
It now takes a regular Src and Dst and we handle both GPR -> Bar vs.
Bar -> GPR forms in the emit code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26463>
2023-12-05 18:59:40 +00:00
Faith Ekstrand 40c96ff6ea nak: Add a barrier register file
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26463>
2023-12-05 18:59:40 +00:00
Faith Ekstrand 618723428a nak: Fix scheduling for control barriers
OpBar and OpBSync both stall the thread until other threads get to that
point.  These instructions must have .yld set.  Also, warp barrier ops
don't support the usual instruction barrier mechanism so they should be
marked as having a fixed latency.  It's unclear if the barrier file is
internally scoreboarded or if warp barrier ops just stall the whole
thread.  In either case, this seems necessary.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26463>
2023-12-05 18:59:40 +00:00
Faith Ekstrand 45686ec0ba nak: Replace OpBMov with OpBClear
This is all we're using it for right now and an op that simply clears
has far more obvious semantics than something which reads from and then
clears its source.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26463>
2023-12-05 18:59:40 +00:00
Faith Ekstrand 3348446422 nak: Simplify Src::is_predicate()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26463>
2023-12-05 18:59:40 +00:00
Samuel Pitoiset 13dcbdcdf3 radv: make sure to reset the stipple line state when it's disabled
In a scenario like:
CmdBindPipeline(stipple line enabled)
CmdDraw()
CmdBindPipeline(stipple line disabled)
CmdDraw()

The second draw wasn't resetting the stipple line state and this might
have caused issues, though it's uncovered by VK CTS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26429>
2023-12-05 18:29:30 +00:00
Samuel Pitoiset e88973fd02 radv: change the reset stipple pattern mode for adjacent lines
Ported from RadeonSI. This isn't covered by VK CTS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26429>
2023-12-05 18:29:29 +00:00
Samuel Pitoiset 16d5ffc3ee radv: update the reset stipple pattern mode
PAL recently changed the mode. This doesn't fix anything known.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26429>
2023-12-05 18:29:29 +00:00
Samuel Pitoiset 949fdc9a73 radv: advertise VK_EXT_depth_clamp_zero_one
RADV already implements this behavior, so enabling this extension is
a no-op.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26443>
2023-12-05 18:10:31 +00:00
Lionel Landwerlin 8d6c059bd2 intel/tools: 32bit compile fixes
Fixes: 03712579b0 ("intel/tools: add hang_replay tool")
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/26514>
2023-12-05 17:45:18 +00:00
Rhys Perry 7a37a39fe0 aco: simplify v_mul_* labelling slightly
This was from before VALU_instruction existed.

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/26445>
2023-12-05 16:56:58 +00:00
Rhys Perry 468ee8b80c aco: implement 16-bit fsat on GFX8
GFX8 doesn't have v_med3_f16.

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/26445>
2023-12-05 16:56:58 +00:00
Rhys Perry de51a21e26 aco: implement 16-bit derivatives
These are used by radeonsi.

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/26445>
2023-12-05 16:56:58 +00:00
Rhys Perry 997a0884a5 aco: implement 16-bit fsign on GFX8
GFX8 doesn't have v_med3_i16.

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/26445>
2023-12-05 16:56:58 +00:00
Rhys Perry b7725b072b aco: flush denormals for 16-bit fmin/fmax on GFX8
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/26445>
2023-12-05 16:56:57 +00:00
Yonggang Luo a9a2eabea8 glsl: move glsl_get_gl_type into glsl/linker_util.h
glsl_get_gl_type only accessed in src/compiler/glsl files, do not expose it
in libcompiler

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25879>
2023-12-05 16:16:55 +00:00
Boris Brezillon 1d4583759a panfrost: Restrict job descriptor emission to JM hardware
CSF hardware issue jobs through command stream instructions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26356>
2023-12-05 15:55:21 +00:00
Boris Brezillon 54e0086abe panfrost: Restrict job chain helpers to JM hardware
Jobs are issued through command stream instructions on CSF hardware.
Don't expose the job chain helpers in that case.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26356>
2023-12-05 15:55:21 +00:00
Boris Brezillon 1481883a6e panfrost: Make pan_afbc_compression_mode() per-gen
With the introduction of v10, we need this function to have a
per-gen name to avoid duplicates. While at it, move it to pan_texture.c
since the prototype is already defined in pan_texture.h.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26356>
2023-12-05 15:55:21 +00:00
Boris Brezillon e144347140 panfrost: Rename pan_cs.{c,h} into pan_desc.{c,h}
Pre v10 Mali GPU were describing GPU jobs as a chain of job descriptors,
but new generations moved to a command stream based approach. The
pan_cs.{h,c} name was chosen based on the assumption this job chain
would replace the command stream we have on other GPUs, things will
become a lot more confusing now that we have a real command stream.

Let's rename these files before it happens. Given all the helpers in
there are either emitting descriptors, and calculating values to be
put in such descriptors, pan_desc.{c,h} sounds like an acceptable
name.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26356>
2023-12-05 15:55:21 +00:00
Boris Brezillon dc087a3184 panfrost: s/pan_scoreboard/pan_jc/
What pan_scoreboard manipulates is a job chain, how dependencies
between jobs is implemented is an implementation detail, and shouldn't
leak through the name.

Let's rename pan_scoreboard.h pan_jc.h, and prefix the functions
accordingly.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26356>
2023-12-05 15:55:21 +00:00
Boris Brezillon 692a4b1804 panfrost: Don't leak NIR compute shaders
We never steal the NIR program or free it explicitly, and the state
tracker expects drivers to take ownership of the program object. Since
panfrost doesn't need to keep the original NIR shader around for
compute, let's just free it before returning.

Fixes: 40372bd720 ("panfrost: Implement a disk cache")
Cc: stable
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26424>
2023-12-05 15:29:28 +00:00
Karol Herbst b470bd7359 rusticl/gl: make GLX support optional
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26394>
2023-12-05 14:44:52 +00:00
Karol Herbst 494fd5d068 rusticl: add x11 dependency
This is needed by `glx.h` pulling in `X11/Xlib.h`

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10221
Fixes: df0623e51a ("rusticl, meson: Add gl/egl/glx bindings")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26394>
2023-12-05 14:44:52 +00:00
Samuel Pitoiset 338319741c radv: add DGC support for mesh shader only
This only implements mesh shaders with DGC because task shaders are
really tricky. I will address them later.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25890>
2023-12-05 14:17:39 +00:00
Samuel Pitoiset eb3e1bdfe6 radv: only initialize the VTX base SGPR if non-zero with DGC
Otherwise, its value is incorrect.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25890>
2023-12-05 14:17:39 +00:00
Samuel Pitoiset 1deedc70db radv: only initialize the VBO reg if VBOs are bound with DGC
With mesh shader there is no VBO at all.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25890>
2023-12-05 14:17:39 +00:00
Samuel Pitoiset 400cfa0eba radv: remove never used binds_state for DGC
This has been removed a while ago.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25890>
2023-12-05 14:17:39 +00:00
Mario Kleiner 1700c6af6f v3d: add B10G10R10[X2/A2]_UNORM to format table.
Enables 10 bpc / color depth 30 bit support under XOrg
with X11/GLX/OpenGL.

Successfully tested with RaspberryPi OS 11,
running X-Server 1.20, and also with Weston,
on a RaspberryPi 400 on top of current Mesa 24.0-devel.

Alejandro Piñeiro also performed a GLES CTS run
with successful result, citing him:
"Full GLES 31 CTS finished with 0 failres. So all ok"

Note that this commit was originally developed and
successfully tested by myself against Mesa 23.1-devel
from February 2023, and therefore should apply and work
cleanly against recent Mesa stable branches. One could
see this commit as a trivial compatibility fix against
X-Server 1.20 / modesetting-ddx 1.20, which is why I'm
also nominating this commit for the current 23.3 stable
branch, and also the 23.2 stable branch, so it may make
it into RaspberryPi OS 12. Thanks for the consideration.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Backport-to: 23.2
Backport-to: 23.3
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26472>
2023-12-05 13:56:23 +00:00
Eric Engestrom 48324e3734 radeonsi/ci: update vangogh piglit expectations
Looking good there, Vangogh!

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26466>
2023-12-05 13:34:32 +00:00