Commit graph

151389 commits

Author SHA1 Message Date
David Heidelberg
d25fa88c6c ci/zink: add lavapipe flakes
Listed from: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7613
Bug: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7781

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20093>
2022-12-01 10:59:15 +00:00
Erik Faye-Lund
66b438dca1 zink: do not complain about missing line-stipple support
We can lower this now, so let's not complain about it...

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19117>
2022-12-01 10:21:02 +00:00
Erik Faye-Lund
d4a5977b17 zink: lower line stipple
This lowers line-stippling to a combination of geometry and fragment
shaders:

- The geometry shader computes the length of each line-segment, and
  outputs a varying that produces the stipple position.
- The fragment shader looks up the stipple position in the
  stipple-pattern once per sample, and updates the sample mask
  accordingly.

In case there's no geometry shader in place, we create a new
pass-through shader.

We should probably not declare the the push-constants in the pipeline
layout unless they're actually needed. But we already do this
unconditionally for the vertex shader and tesselation push-constants, so
let's do it unconditionally for these as well for now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19117>
2022-12-01 10:21:02 +00:00
Erik Faye-Lund
ad6eedab00 zink: allow to generate any vertex shader stage
There's times when it's going to be useful to generate geometry shaders
as well, so let's generalize the infrastructure for generated shader
stages a bit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19117>
2022-12-01 10:21:02 +00:00
Erik Faye-Lund
09ced773fc zink: process non-optimal-key passes first
Right now, it's only the vertex-shader that needs special handling for
non-optimal keys. That makes it possible to use fallthrough to always
end up in the last-vertex-stage conditional.

But we're about to add special handling for the geometry stage as well,
so let's prepare by splitting the switch-statement in two; one that only
happens for non-optimal keys, and does all the needed processing there,
and one that deals with the rest.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19117>
2022-12-01 10:21:02 +00:00
Erik Faye-Lund
81fcbfae74 zink: give gs its own shader-key
Line-stipple lowering is going to need some geometry-shader specific
lowering, so lets give the GS its own shader-key struct.

The GS variant only needs a non-optimal variant, so let's assert that to
be sure.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19117>
2022-12-01 10:21:02 +00:00
Erik Faye-Lund
85964945e7 zink: emit vars with nir_var_shader_temp mode
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19117>
2022-12-01 10:21:02 +00:00
Erik Faye-Lund
4b17c099ca zink: add line-stippling lowering passes
There's two notable limitations here:
- This will viewport-map to viewport #0 only. This is because we need
  the viewport-scale factors, which we'll be uploading using
  push-constants. And we don't want to waste too many of those...
- It's missing a "global" stipple-counter. It doesn't seem like there's
  a portable way of implementing this, so this is going to require a VK
  extension that can be implemented in a hardware-specific way in the
  long run. For now, let's just ignore the global stipple counter.

These two limitations don't seem viable to overcome for now, so but this
is better than nothing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19117>
2022-12-01 10:21:02 +00:00
Erik Faye-Lund
9f67e72e84 zink: setup driver-workaround for missing linestipple
This is not ideal, but at least it should work. In the long run, we
might want to store a bit per mode we're missing, so we can do this
conditionally. But that's quite a bit more complicated, so let's go with
this for now.

The line-stippling logic needs non-optimal shader-keys. So let's drop
some perf on the floor here.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19117>
2022-12-01 10:21:02 +00:00
Emma Anholt
d09848d84d glx: Require __DRI_SWRAST >= 4 for doing swrast.
The only implementer in tree is v4.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20044>
2022-12-01 09:17:31 +00:00
Emma Anholt
7d36423032 egl: Refactor common error handling for context creation.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20044>
2022-12-01 09:17:31 +00:00
Emma Anholt
d592f56746 egl: Bump minimum version of __DRI_SWRAST to 4.
The only implementer in tree is v4.  This simplifies some bits now that we
always have CreateContextAttribs.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20044>
2022-12-01 09:17:31 +00:00
Emma Anholt
f4af33a36c glx: Require __DRI_DRI2 v2 for doing X11 DRI2.
The only implementer in tree is v4.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20044>
2022-12-01 09:17:31 +00:00
Emma Anholt
9fd2901454 egl: Require __DRI_DRI2 v4 if we're to do DRI2.
The only in-tree implementers are v4.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20044>
2022-12-01 09:17:30 +00:00
Emma Anholt
0847140e71 egl: Bump __DRI_CONFIG_OPTIONS min version to 2.
The only implementer in tree is v2.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20044>
2022-12-01 09:17:30 +00:00
Emma Anholt
d92dd4fb2f egl: Bump minimum version of __DRI_IMAGE to 6 and drop version checks.
All __DRI_IMAGEs in tree are v6+ (lowest being drisw) and implement
createImageFromTexture.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20044>
2022-12-01 09:17:30 +00:00
Emma Anholt
12d67aabed egl: Bump required version of optional __DRI2_FENCE to 2.
The only implementer of it in tree is v2, so no need for checks.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20044>
2022-12-01 09:17:30 +00:00
Emma Anholt
bb28bff583 gbm: Bump required __DRI_IMAGE version to 6.
That's the minimum implemented in tree (gallium swrast).  Drops a few more
version checks.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20044>
2022-12-01 09:17:30 +00:00
Emma Anholt
65822a31e2 gbm: Drop support for __DRI_DRI2 < 4 and __DRI_SWRAST < 4.
We're always loading a gallium driver built from this tree, so it's always
v4.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20044>
2022-12-01 09:17:30 +00:00
Connor Abbott
ccef6d1f5f freedreno/fdl: Set sRGB bit for storage images
This probably wasn't noticed earlier because tests using sRGB storage
images didn't exist, and we didn't know whether this works, but this
fixes dEQP-VK.image.store.without_format.2d.*_srgb which also proves
that the bit works.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20060>
2022-12-01 06:07:30 +00:00
Alyssa Rosenzweig
1555ac6f0b agx: Clamp point sizes
Fixes vs-point_size-zero.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20017>
2022-12-01 05:58:30 +00:00
Alyssa Rosenzweig
7108619c0d agx: Handle 32-bit gl_FragCoord.zw
The coefficient register is 16-bit so our builder will make the iter 16-bit too
(maybe not the best design...), force fp32 to match the NIR intrinsic.

Fixes glsl-fs-fragcoord-zw-ortho

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20017>
2022-12-01 05:58:30 +00:00
Alyssa Rosenzweig
eb4187b02d agx: Handle large varying indices
Fixes glsl-max-varyings.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20017>
2022-12-01 05:58:30 +00:00
Alyssa Rosenzweig
21f9a72c77 asahi: Support one-sided polygon modes
We can implement glPolygonMode(GL_FRONT_AND_BACK, ...) natively. What we can't
implement natively are two-sided polygon modes. For that Apple has a nontrivial
lowering which I don't feel the need to implement unless someone actually hits a
workload other than Piglit that uses it.

Vulkan requires only one-sided polygon modes (so this is sufficient there), and
GLES doesn't have polygon modes at all. If an app hits the unimplemented case,
throw a warning like Zink does.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20017>
2022-12-01 05:58:30 +00:00
Alyssa Rosenzweig
5e15b3c323 asahi: Handle NULL sampler views
Fixes fp-fragment-position (crash->pass).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20017>
2022-12-01 05:58:30 +00:00
Alyssa Rosenzweig
63d4f30aa7 asahi: Unset GL_CLAMP
Use the Zink lowering for the legacy mode, it's not too many instructions on AGX
anyway. Fixes texwrap tests.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20017>
2022-12-01 05:58:30 +00:00
Alyssa Rosenzweig
47cb8278be asahi: Set frag coord caps correctly
Fixes ./glsl-arb-fragment-coord-conventions, c.f. 12facf23b1 ("panfrost: Don't set CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER").

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20017>
2022-12-01 05:58:30 +00:00
Alyssa Rosenzweig
0bd71f7421 asahi: Set PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION
Fixes arb-provoking-vertex-render.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20017>
2022-12-01 05:58:30 +00:00
Alyssa Rosenzweig
1bf7d7139f asahi: Set PIPE_CAP_SUPPORTED_PRIM_MODES
To lower GL_POLYGONS which we don't do natively. Fixes a pile of crashes in
Piglit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20017>
2022-12-01 05:58:30 +00:00
Jason Ekstrand
216e5d6e10 hasvk: Drop anv_nir_add_base_work_group_id()
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20068>
2022-12-01 04:56:48 +00:00
Jason Ekstrand
2806968af8 anv: Drop anv_nir_add_base_work_group_id()
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20068>
2022-12-01 04:56:48 +00:00
Jason Ekstrand
b4dd3df227 intel/nir: Set has_base_workgroup_id for lower_compute_system_values
This option didn't exist half a decade ago when I first implemented base
workgroup support in ANV.  It's cleaner to just have split system values
like all the other zero_base+base things do.

We currently only do this for COMPUTE and not KERNEL because it lets us
avoid changing intel_clc for now.  We can add KERNEL later if needed.
We also don't do this lowering for task/mesh.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20068>
2022-12-01 04:56:48 +00:00
Jason Ekstrand
19ad2629d0 hasvk: Implement lower_base_workgroup_id
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20068>
2022-12-01 04:56:48 +00:00
Jason Ekstrand
3c09571f67 anv: Implement lower_base_workgroup_id
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20068>
2022-12-01 04:56:48 +00:00
Jason Ekstrand
f2aee04d28 crocus: Lower load_base_workgroup_id to zero
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20068>
2022-12-01 04:56:48 +00:00
Jason Ekstrand
4abdecce22 iris: Lower load_base_workgroup_id to zero
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20068>
2022-12-01 04:56:48 +00:00
Jason Ekstrand
7d2e3f660c intel/fs: Support load_workgroup_id_zero_base
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20068>
2022-12-01 04:56:48 +00:00
Jason Ekstrand
4fb33124c3 nir/divergence: Handle base_workgroup_id and workgrpu_id_zero_base
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20068>
2022-12-01 04:56:48 +00:00
Bas Nieuwenhuizen
9a311a1891 radv: Remove the old LBVH shader.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19891>
2022-12-01 02:20:48 +00:00
Bas Nieuwenhuizen
5ba950eb14 radv: Switch to new LBVH implementation.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19891>
2022-12-01 02:20:48 +00:00
Bas Nieuwenhuizen
ea159e47a5 radv: Add new LBVH shaders.
Contrary to the previous implementation, this actually implements an LBVH builder.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19891>
2022-12-01 02:20:48 +00:00
Bas Nieuwenhuizen
f531f671ef radv: Handle nodes with 2 invalid children in internal node converter.
Fixes: 682dc5c28e ("radv: Add conversion shader for internal nodes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19891>
2022-12-01 02:20:48 +00:00
Alyssa Rosenzweig
8e125b6c15 panfrost: Enable AFBC of more formats
Enable AFBC for all RGBA UNORM formats possible in v5. This does not
cover the AFBC rules for newer gens, nor for YUV.

Noticed with an uncompressed R8 UNORM texture in SuperTuxKart.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19758>
2022-12-01 02:03:15 +00:00
Alyssa Rosenzweig
c7eb6a9fbb panfrost: Enable AFBC of sRGB formats
AFBC of sRGB formats should just work. We just need to flip it on and enjoy
the improved performance.

In particular, this means that RGBA8 UNORM and RGBA8 sRGB UNORM are now
considered compatible formats for AFBC. That's a bug fix, because
GALLIUM_HUD use will act like a texture view between sRGB and linear
views. For FBOs, that will "just" result in a decompression, hurting
performance. For window system rendering with AFBC, that will cause an
assertion failure, as we cannot decompress SHARED resources.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19758>
2022-12-01 02:03:15 +00:00
Alyssa Rosenzweig
8b7038ab3e panfrost: Enable AFBC of cube maps
Missed by mistake. This is not the same as 3D AFBC, it's just like a 2D
array. Noted in a supertuxkart pandecode.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19758>
2022-12-01 02:03:15 +00:00
Alyssa Rosenzweig
cd21cf5ab6 panfrost: Handle all RGB AFBC modes on v9
We're about to enable AFBC on more formats in the core AFBC code. The plane
descriptor packing needs to be aware of these new formats.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19758>
2022-12-01 02:03:15 +00:00
Georg Lehmann
a3beb82cf6 aco: Use wave size specific opcode for s_or in cube map coord code.
Cc: mesa-stable

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20041>
2022-12-01 01:39:27 +00:00
Jason Ekstrand
0531630658 nir/builder: Also short-circuit for auto-generated nir_t2t<N>()
This makes nir_i2i32(b, x) behave exactly like nir_i2iN(b, x, 32) etc.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7787
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20067>
2022-12-01 01:10:12 +00:00
Jason Ekstrand
e67e2293fa nir/builder: Rework the boolean conversion helpers
Move them up to where the other conversion helpers.  For nir_b2<T>(),
suffix them with N like all the others and make them use
nir_type_convert() as well.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20067>
2022-12-01 01:10:12 +00:00
Jason Ekstrand
d9a24632d3 nir/builder: Drop nir_i2i and nir_u2u in favor of nir_x2xN
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20067>
2022-12-01 01:10:12 +00:00