Commit graph

172255 commits

Author SHA1 Message Date
Ian Romanick
a3cfec0690 intel/eu/validate: Use a single macro define half_float_conversion cases
This is what other tests do. The next commit will add a third set of
possible results (for Gfx12.5+), and the multiple macro method does not
scale.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23262>
2023-06-06 06:10:53 +00:00
Ian Romanick
7ef45e661f intel/fs: Add constant propagation for ADD3
v2: Require that the constant value be representable as either uint16_t
or int16_t. Suggested by Matt.

v3: Remove redundant patterns. Noticed by Matt.

shader-db:

DG2
total instructions in shared programs: 23103767 -> 23103577 (<.01%)
instructions in affected programs: 51822 -> 51632 (-0.37%)
helped: 98 / HURT: 15

total cycles in shared programs: 842347714 -> 842380017 (<.01%)
cycles in affected programs: 1942595 -> 1974898 (1.66%)
helped: 97 / HURT: 32

Nearly all of the affected shaders (around 9,900) are shaders in
Cyberpunk 2077. It's about an even split between vertex and fragment
shaders. The majority of the remaining affected shaders (3,600) are
from Strange Brigade. This was also a nearly even split between
fragment and vertex.

All but two of the lost shaders are SIMD32 fragment shaders in
Cyberpunk 2077. The other two are SIMD32 fragment shaders in Dota2.

fossil-db:

DG2
Instructions in all programs: 196379107 -> 196248608 (-0.1%)
helped: 13467 / HURT: 1210

Cycles in all programs: 13931355281 -> 13929955971 (-0.0%)
helped: 11801 / HURT: 2922

Lost: 90

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23262>
2023-06-06 06:10:53 +00:00
Ian Romanick
7b34808649 nir/algebraic: Fixup iadd3 related patterns
There should not be any isub at this point due to lowerings that happened
ages before getting to late algebraic.

shader-db:

DG2
total instructions in shared programs: 23103769 -> 23103767 (<.01%)
instructions in affected programs: 65 -> 63 (-3.08%)
helped: 1 / HURT: 0

total cycles in shared programs: 842348074 -> 842347714 (<.01%)
cycles in affected programs: 28572 -> 28212 (-1.26%)
helped: 3 / HURT: 0

One compute shader in Assassin's Creed Odyssey was affected.

fossil-db:

DG2
Instructions in all programs: 196400668 -> 196400676 (+0.0%)
helped: 8 / HURT: 5

Cycles in all programs: 13931740724 -> 13931758003 (+0.0%)
helped: 8 / HURT: 7

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23262>
2023-06-06 06:10:53 +00:00
Ian Romanick
9a9a86013c intel/fs: Allow HF const in MAD on Gfx12.5 if all sources are HF
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23262>
2023-06-06 06:10:53 +00:00
Ian Romanick
4f272bf001 intel/fs: Fix handling of W, UW, and HF constants in combine_constants
Sources that are already W, UW, or HF can be represented as those types
by definition. Pass them through. Previously an HF source on a MAD would
have been marked as !can_promote. I'm pretty sure this means it would
get moved out to a register, but I did not verify this.

For ADD3, a constant source could be D or UD. In this case, the value
must be tested to determine whether it can be represented as W or
UW. The patterns in opt_algebraic won't generate an ADD3 with constant
source, so this problem cannot occur yet.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23262>
2023-06-06 06:10:53 +00:00
Ian Romanick
4cc3206218 intel/fs: Don't munge source order of 3-src instructions in opt_algebraic
This only impacts ADD3, so at this point it should not have any
affect. As soon as constants are propagated into ADD3 instructions, it
will be a problem.

The worst part is, the ADD3 instrutions that are broken by the old code
aren't even "progress" on this pass.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23262>
2023-06-06 06:10:53 +00:00
Caio Oliveira
60a00f246b nir/print: Print 0 when mem_modes or resource_intel have no values
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23376>
2023-06-06 01:23:18 +00:00
Dave Airlie
8bdd3e318b docs: update docs for lavapipe mesh shading
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23447>
2023-06-06 01:17:34 +00:00
David Heidelberg
bc3f2ab62b traces: update sir-f720 trace expectations for zink on anv and freedreno
Same changes on both driver, looks OK.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23445>
2023-06-05 20:49:13 +00:00
Dave Airlie
4909a216a5 lavapipe: enable task/mesh shaders.
This is the enable for the exts/features/properties.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:47 +10:00
Dave Airlie
aa2c209260 lavapipe: add execution backends for mesh shader draw apis
This binds the mesh draw apis to the gallium backend ones.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:47 +10:00
Dave Airlie
5c6c226f5a lavapipe: add support for task/mesh shader stages in various places
this bumps the LVP_SHADER_STAGES to allow task/mesh shaders to be used,
and adds them to various state binding and execution places.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:47 +10:00
Dave Airlie
092b1daaf6 lavapipe: add mesh query support
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:47 +10:00
Dave Airlie
ccb16259cb lavapipe: handle some mesh shader stage differences.
certain state info is no long required if you using mesh/task in the
pipeline.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:47 +10:00
Dave Airlie
8f8c55fd38 llvmpipe: enable task/mesh shader support.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:47 +10:00
Dave Airlie
450c95c7b4 llvmpipe: add mesh shader drawing.
This is the big execution one, it implement the draw mesh callback.

This executes task shaders and mesh shaders with no overlap.

When task shaders finish, the mesh shader is launched using the payload
data, unless no task shader is run, then the mesh shader is launched.

Once the mesh shader is finished the data is supplied to the draw
pipeline to convert to linear vertex data with no per-prim data,
then passed to draw for clipping and further processing.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:47 +10:00
Dave Airlie
8fcb024047 llvmpipe/cs: add multiple stride indirect to fill_grid_info.
mesh shaders needs to iterate across multiple indirect draws

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:47 +10:00
Dave Airlie
3994fb1e19 llvmpipe/cs: add task/mesh shader support to compute shader builder.
This allows generating task and mesh variants of compute shaders.

It adds:
- vertex and primitive outputs support - aos writing.
- payload support
- mesh iface for the output and count callbacks.
- draw_id
- multiple iteration support to the exec fn to allow launches
in multiple passes to reduce memory usage

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:47 +10:00
Dave Airlie
51eb3cc563 gallivm/cs: add payload ptr to the cs thread data.
This fits best at a thread level beside shared.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:47 +10:00
Dave Airlie
e4c5a9383d llvmpipe: bind task/mesh resources and dirty bits
This binds the task/mesh states to be updated on dirty changes

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:47 +10:00
Dave Airlie
936db9f8f3 llvmpipe: add query support for task/mesh shaders
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:47 +10:00
Dave Airlie
575cc620cd llvmpipe: add debug bit for mesh shaders
Reviewed-by: Roland Scheidegger <sroland@vmware.com>#
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:47 +10:00
Dave Airlie
fcf653067e llvmpipe: add dirty bits for mesh and task shaders.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:47 +10:00
Dave Airlie
24f4f35eac llvmpipe: bump dirty tracker to 64-bits.
We need a lot more dirty states for task/mesh

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:47 +10:00
Dave Airlie
d9fae96618 llvmpipe: start adding task/mesh support.
This is just some infrastructure for creating shaders and contexts.

task/mesh shaders are based on compute shaders and share nearly all
their code with compute.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:47 +10:00
Dave Airlie
b0b81b279c llvmpipe: resize arrays to handle mesh shaders.
This just bumps some limits.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:47 +10:00
Dave Airlie
7f1151d90d gallivm/nir: add support for mesh shader outputs.
mesh shaders can have vertex and primitive outputs, and act a bit
like TCS shaders, add the callback to allow the driver to decide
how to store these.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:47 +10:00
Dave Airlie
a1106fd8b8 gallivm/nir: call task shader lowering.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:47 +10:00
Dave Airlie
a29ed5ba5d gallivm/nir: add a mesh interface and vert/prim count setting.
This adds a callback to the driver for a mesh interface to implement
the set_vertex_and_primitive_count intrinsic

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:47 +10:00
Dave Airlie
24fe5abbae gallivm/nir: add launch mesh workgroups
add support the launch mesh workgroups intrinsic for task shaders.

This writes the values out to the start of the payload.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:46 +10:00
Dave Airlie
97a2d0aded gallivm: add support for payload access
mesh shading has a payload to pass between task and mesh shaders,
this acts like shared memory as well, so we use the standard memory
hooks to access it.

This current adds the payload after the 12-byte header which will
contain the x/y/z grid sizes.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:46 +10:00
Dave Airlie
f3e6582f32 draw: add support for per primitive aos emission
This add support to the aos emit code so that mesh shaders
can use it for per prim outputs.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:46 +10:00
Dave Airlie
fe0e4bf863 draw: add mesh pipeline middle end.
This sets up the mesh pipeline to call the post vs clipping
and so emit for stats (not for so).

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:46 +10:00
Dave Airlie
888fb3d360 draw: add a mesh primitive assembler.
This is assembles prims from mesh vertex and per-primitive outputs.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:46 +10:00
Dave Airlie
bb1be13bb8 draw: move draw_vertex_info and draw_prim_info to public header.
Need to use these in llvmpipe for mesh shaders

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:46 +10:00
Dave Airlie
03768014fa draw: add mesh shader infrastructure
This adds draw mesh shader infrastructure, as mesh shaders have
to be able to feed into the post vs stages like clipping, so
we have to wire informational things up.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:46 +10:00
Dave Airlie
6123f8e245 lavapipe: fix indentation whitespace
these were indented too much.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:46 +10:00
Dave Airlie
cbb8632991 lavapipe: fix pipeline sanitizing.
This isn't needed for fragment shader.

Cc: mesa-stable
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23066>
2023-06-06 05:01:46 +10:00
Jesse Natalie
954e56bb18 d3d12: Fully initialize UAV desc for null SSBOs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23440>
2023-06-05 16:27:08 +00:00
Samuel Pitoiset
df8b41b0b4 zink/ci: remove useless RADV_PERFTEST=gpl
This option 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/23442>
2023-06-05 16:00:52 +00:00
Juan A. Suarez Romero
3fa3c23623 broadcom/ci: update expected results
Update failing/flake list.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23441>
2023-06-05 17:00:04 +02:00
Erik Faye-Lund
6d142078bc nir: use generated immediate comparison helpers
This makes the code a bit less verbose, so let's use the helpers.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23393>
2023-06-05 13:40:08 +00:00
Erik Faye-Lund
82465f1418 nir: generate nir_{cmp}_imm variants
We have a couple of open-coded variants of these, but let's generate all
of them for completeness.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23393>
2023-06-05 13:40:07 +00:00
Erik Faye-Lund
28b1c5bca1 nir: use nir_i{ne,eq}_imm helpers
We already have these, so let's use them more.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23393>
2023-06-05 13:40:07 +00:00
Erik Faye-Lund
57260a836a d3d12, dozen: make sure we pass float to fge
This doesn't matter much in practice, because the integer an float
representations of zero are the same. But it's easier to understand
what's going on if the correct type is used, so let's clean this up.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23393>
2023-06-05 13:40:07 +00:00
Karmjit Mahil
817be4b860 pvr: Fix typo causing seg faults copying immutable samplers
Fixes seg faults in:
  dEQP-VK.binding_model.shader_access.primary_cmd_buf
    .sampler_immutable.no_access.single_descriptor.*
  dEQP-VK.binding_model.shader_access.primary_cmd_buf
    .sampler_immutable.no_access.multiple_contiguous_descriptors.*

It does not fix them. Now they just hit asserts in the compiler.

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/23357>
2023-06-05 13:06:57 +00:00
Pavel Ondračka
1021e2b946 r300: fail linking instead of using dummy shaders
We need to tell the apps about the hardware limtations, so that they
have a chance to take a fallback path. Fixes GTK misrendering, due to
use of the dummy shaders (now properly fallbacks to software).

Based on a MR by Filip Gawin.

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

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22708>
2023-06-05 12:40:52 +00:00
Rhys Perry
9ae5c942da aco/tests: add discard export target tests
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/23371>
2023-06-05 11:42:21 +00:00
Rhys Perry
21867b45c1 aco: fix has_color_exports=true for mrtz exports
V_008DFC_SQ_EXP_NULL is after V_008DFC_SQ_EXP_MRTZ.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Tested-by: Mikhail Gavrilov mikhail.v.gavrilov@gmail.com
Fixes: d3611af389 ("aco: support nir_export_amd with ps targets")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9135
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23371>
2023-06-05 11:42:21 +00:00
Sergi Blanch Torne
7447c15894 Revert "ci: disable Collabora's LAVA lab for maintance"
This reverts commit 7059aa2f84

Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23429>
2023-06-05 10:48:21 +00:00