Commit graph

160573 commits

Author SHA1 Message Date
Kenneth Graunke
c9d399604e st/mesa: Optionally call nir_vectorize_tess_levels()
This lets us vectorize gl_TessLevel{Inner,Outer} writes, using a pass
developed for RADV.  Not all backends are prepared to handle this, so
we make it optional.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17944>
2022-09-27 18:17:47 -07:00
Kenneth Graunke
be21d54aca intel/compiler: Use an existing URB write to end TCS threads when viable
VS, TCS, TES, and GS threads must end with a URB write message with the
EOT (end of thread) bit set.  For VS and TES, we shadow output variables
with temporaries and perform all stores at the end of the shader, giving
us an existing message to do the EOT.

In tessellation control shaders, we don't defer output stores until the
end of the thread like we do for vertex or evaluation shaders.  We just
process store_output and store_per_vertex_output intrinsics where they
occur, which may be in control flow.  So we can't guarantee that there's
a URB write being at the end of the shader.

Traditionally, we've just emitted a separate URB write to finish TCS
threads, doing a writemasked write to an single patch header DWord.
On Broadwell, we need to set a "TR DS Cache Disable" bit, so this is
a convenient spot to do so.  But on other platforms, there's no such
field, and this write is purely wasteful.

Insetad of emitting a separate write, we can just look for an existing
URB write at the end of the program and tag that with EOT, if possible.
We already had code to do this for geometry shaders, so just lift it
into a helper function and reuse it.

No changes in shader-db.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17944>
2022-09-27 18:17:42 -07:00
Lionel Landwerlin
19c40e0730 ci: disable intel-clc on debian-vulkan
We're getting a number of UBSan error while running intel-clc in that
image. It seems that we're the first ones to run into a number of code
paths with intel-clc and it shows a number of undefined behavior
operations like signed extension stuff in NIR/IntelBackend, unaligned
pointer accesses in embedded list iterators, etc...

Preparing some patches in a different MR to fix this.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18788>
2022-09-27 20:53:11 +00:00
Lionel Landwerlin
38b5521be2 ci: bump llvm to 13 for some builders
Namely :
  - debian-clang
  - debian-cl
  - debian-vulkan

Seems to trigger/fix failures on llvmpipe, filed
https://gitlab.freedesktop.org/mesa/mesa/-/issues/7336

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18788>
2022-09-27 20:53:11 +00:00
Lionel Landwerlin
64645d1f14 ci/debian: don't use libclc from the system
Debian (unlike Ubuntu) has a broken libclc package missing files we
would very much like to have in our image, so that intel_clc doesn't
fail. Namely :

   /usr/lib/clc/spirv-mesa3d-.spv
   /usr/lib/clc/spirv64-mesa3d-.spv

Dropping libclc from the distribution and build int the build & base
test image.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18788>
2022-09-27 20:53:11 +00:00
Lionel Landwerlin
78b1e0340e ci: build our own version of the LLVM SPIRV translator
Debian stable and Fedora do not package the required version for
intel-clc.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18788>
2022-09-27 20:53:11 +00:00
Lionel Landwerlin
05b1f3fd97 ci: disable intel-clc on fedora
Would require Fedora 35.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18788>
2022-09-27 20:53:11 +00:00
Lionel Landwerlin
f0c516c331 ci: add python3-ply to debian/fedora images
This is needed by Anv to parse GRL (meta opencl kernels).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18788>
2022-09-27 20:53:11 +00:00
Dave Airlie
f292212615 gallivm/nir: bitcast when non-float ptr type.
This matters more when opaque pointers are used.

Fixes: 203920d4c6 ("gallivm: add atomic 32-bit float support")

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18835>
2022-09-27 19:20:32 +00:00
Dave Airlie
c642fa122c gallivm/nir: fix fmin/fmax translation
Fixes: 203920d4c6 ("gallivm: add atomic 32-bit float support")

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18835>
2022-09-27 19:20:32 +00:00
Dave Airlie
d132625eed lavapipe: add fmin/fmax to image lowering.
Fixes: 31695f81c9 ("lavapipe: export VK_KHR_shader_atomic_float")

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18835>
2022-09-27 19:20:32 +00:00
Mike Blumenkrantz
549f0b956e zink: also lower 64bit function temps
now that these aren't always lowered from indirects,
64bit function temp arrays may exist in shaders, and they need to use
all the same rewrite machinery

fixes #7310

SoroushIMG <soroush.kashani@imgtec.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18728>
2022-09-27 18:38:25 +00:00
Mike Blumenkrantz
b3a44cfbb9 zink: split up lower_64bit_vars pass
the component functions will be reused; no functional changes

SoroushIMG <soroush.kashani@imgtec.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18728>
2022-09-27 18:38:25 +00:00
Mike Blumenkrantz
0f053f0f07 zink: always run optimize_nir after lower_64bit_vars
it's otherwise possible (and likely) that optimizations won't
happen since there's no shader key data active

Fixes: 5b2f850425 ("zink: rewrite 64bit shader i/o as 32bit")

SoroushIMG <soroush.kashani@imgtec.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18728>
2022-09-27 18:38:25 +00:00
Mike Blumenkrantz
17e3df4cd2 zink: don't flatten 64bit arrays during rewrite
dunno what I was thinking here

Fixes: 5b2f850425 ("zink: rewrite 64bit shader i/o as 32bit")

SoroushIMG <soroush.kashani@imgtec.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18728>
2022-09-27 18:38:25 +00:00
Mike Blumenkrantz
52edd8f764 nir/opt_undef: add a pass to clean up 64bit undefs
somehow 64bit lowering creates patterns like

vec1 64 ssa_1 = undefined
ssa_2 = unpack_64_2x32_split_x ssa_1

and then the 64bit value is never otherwise used. for this case, rewriting
the unpack to just be a 32bit undef allows the 64bit undef to be optimized
out, avoiding spec violations

fixes #6945

SoroushIMG <soroush.kashani@imgtec.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18728>
2022-09-27 18:38:25 +00:00
Karol Herbst
38543af8f7 rusticl/device: fix custom device detection
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18809>
2022-09-27 17:54:57 +00:00
Mike Blumenkrantz
645f2da3fa zink: always set VK_PIPELINE_CREATE_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT sometimes
some drivers (mostly desktop) are known to ignore this pipeline flag,
thus it can be set unconditionally in pipeline state to deduplicate
pipeline variants without affecting performance

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18787>
2022-09-27 17:32:57 +00:00
Mike Blumenkrantz
97c7eaf17f zink: use feedback loop layout to correctly handle implicit feedback loops
an implicit feedback loop occurs when an app happens to bind the same image
as both a framebuffer attachment and a sampler for the same draw

an explicit feedback loop occurs when an app uses fbfetch to read data back
from the framebuffer using input attachments

fbfetch is already handled, but implicit feedback loops require more work:
* detecting them happens on-the-fly
* pipeline variants are required

this handles implicit feedback loops by detecting them at draw time during
barrier updates and then flagging pipeline state change to trigger variant creation.
the bits are then unset when the framebuffer/sampler binds are removed

fixes #7309

fixes (tu):
KHR-GL46.texture_barrier.disjoint-texels
KHR-GL46.texture_barrier.overlapping-texels
KHR-GL46.texture_barrier.same-texel-rw-multipass
KHR-GL46.texture_barrier_ARB.disjoint-texels
KHR-GL46.texture_barrier_ARB.overlapping-texels
KHR-GL46.texture_barrier_ARB.same-texel-rw-multipass

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18787>
2022-09-27 17:32:56 +00:00
Mike Blumenkrantz
902f64f906 zink: add a mask of fb attachment idx for resources
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18787>
2022-09-27 17:32:56 +00:00
Mike Blumenkrantz
dbf2186a28 zink: reorder zink_resource a little
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18787>
2022-09-27 17:32:56 +00:00
Mike Blumenkrantz
630967b252 zink: rename fb_binds -> fb_bind_count
this is more accurate

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18787>
2022-09-27 17:32:56 +00:00
Mike Blumenkrantz
bc5ed17844 zink: remove zink_context::new_swapchain
this was my (feeble) attempt at tracking validity for swapchain images,
but it doesn't actually work right, and zink_resource::valid is better

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18787>
2022-09-27 17:32:56 +00:00
Mike Blumenkrantz
a6cfb72010 zink: enable VK_ATTACHMENT_LOAD_OP_DONT_CARE for zs in renderpasses
dynamic render path already handled this

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18787>
2022-09-27 17:32:56 +00:00
Mike Blumenkrantz
7829fb9adf mesa: set normalized_coords for bindless texture buffer samplers
this isn't "used", but it's the default

cc: mesa-stable

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18845>
2022-09-27 17:04:14 +00:00
Adam Jackson
c268ae9efe egl: Remove a bogus restriction from eglMakeCurrent
The comment here is from the EGL_MESA_configless_context era, and maybe
that was true, but EGL_KHR_no_config_context has no such restriction.
The only restriction is that both surfaces be compatible with the
context, but a no-config context is defined to be compatible with any
surface.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18824>
2022-09-27 16:00:45 +00:00
Adam Jackson
71224789cf egl/dri2: Fix a weird conditional in dri2_make_current
It's not valid to get here with no context but with real surfaces.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18824>
2022-09-27 16:00:45 +00:00
Adam Jackson
04826cd9fc egl: Factor some common terminate cleanup up to common code
It's a little difficult to see from the diff, but this is effectively
the same calling sequence as before, and more importantly it means the
backend only cleans up backend state rather than needing to call up to
the core.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18824>
2022-09-27 16:00:45 +00:00
Adam Jackson
a942068fdb egl: Formatting fix
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18824>
2022-09-27 16:00:45 +00:00
Adam Jackson
a436fdd560 mesa/fbo: Don't force both read/draw bindings to zero
... when we're only changing one of the two to zero. I could maybe
understand the old behavior here if we really did need both read/draw to
either be both from winsys or both user, but we don't. You can still
get to that half-and-half state even with the old code, you just need to
set whichever of read/draw to 0 that you want first, and then set the
other to the user fbo.

The first code to introduce a read fb to this path was dbfb375805,
which was trying to make sure we restored both values passed to
glXMakeCurrentRead when going back to fb 0. The commit message suggests
that "the API" doesn't allow split read/draw, but that seems to have
ignored the #ifdef EXT_framebuffer_object code immediately nearby which
did exactly that.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18824>
2022-09-27 16:00:45 +00:00
Ruijing Dong
27dff086ec radeonsi/vce: using fixed value for vce 52
VCE 52 needs some hard-coded values.

Fixed: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7290

Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18823>
2022-09-27 13:17:26 +00:00
LingMan
b23fe77cf4 rusticl: Fix compilation if stdout and/or stderr aren't symbols
ISO C only guarantees that `stdout` and `stderr` are expressions of type `FILE*`. It does not
guarantee that they are symbols which can be bound to. In particular, they are macros on the BSDs,
which bindgen cannot deal with (yet?).
Add our own symbol-defining wrapper.

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

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18810>
2022-09-27 12:36:22 +00:00
David Heidelberg
a1d34d8c95 ci/amd: move radeonsi in amd directory
Deduplicate jobs, make easier to use GL+VK scenarios.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17938>
2022-09-27 11:59:28 +00:00
David Heidelberg
f66420c692 ci/radeonsi: add traces for radeonsi Zork
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17938>
2022-09-27 11:59:28 +00:00
David Heidelberg
7d7e1c620b ci/traces: prevent showing wine instalation dialog
Causing piglit timeouts because of an open window instead of running apitrace.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17938>
2022-09-27 11:59:27 +00:00
David Heidelberg
e76a755044 ci: also handle default wine rootfs (for testing)
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17938>
2022-09-27 11:59:27 +00:00
David Heidelberg
1e27a72c81 ci/dxvk: fix DXVK 64-bit only wine setup
Reported: https://github.com/doitsujin/dxvk/issues/2921

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17938>
2022-09-27 11:59:27 +00:00
David Heidelberg
dd79695b3b ci/lava: prepare wineprefix for GL and DXVK
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17938>
2022-09-27 11:59:27 +00:00
David Heidelberg
7901fec52e ci/lava: add wine and apitrace into amd64 rootfs container
Wine is from WineHQ, with stripped i386 part, which we don't use.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17938>
2022-09-27 11:59:27 +00:00
Samuel Pitoiset
29305a89b0 radv: fix handling multiview with GPL
When multiview is used, the last pre-rasterization stage should export
the layer to the fragment shader. With GPL, the next stage is
implicitly FS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18699>
2022-09-27 11:38:07 +00:00
Samuel Pitoiset
0c6f52a999 radv: fix handling primitive ID and clip/cull distances with GPL
When compiling the pre-rasterization stages with GPL, we can't know if
the fragment shader reads the primitive ID or the clip/cull distances
as inputs and we have to export them unconditionally.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18699>
2022-09-27 11:38:06 +00:00
Samuel Pitoiset
630bb53e68 radv: fix handling ViewportIndex with GPL
When the fragment shader reads the viewport index as input and the last
pre-rasterization stage doesn't export it, it should be implicitly
zero (ie. first viewport). When the next stage is known, it's already
lowered in NIR, but with GPL we can't because we don't know if the FS
reads it. To fix this use AC_EXP_PARAM_DEFAULT_VAL_000.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18699>
2022-09-27 11:38:06 +00:00
Samuel Pitoiset
515847b2a7 radv: rework multiview lowering in NIR slightly
This will be used to export multiview unconditionally with GPL.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18699>
2022-09-27 11:38:06 +00:00
Iago Toral Quiroga
b6093ffbe7 v3dv: expose VK_EXT_image_robustness
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18820>
2022-09-27 09:08:29 +00:00
Iago Toral Quiroga
c7e022abfd broadcom/compiler: add a lowering for robust image access
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18820>
2022-09-27 09:08:29 +00:00
Iago Toral Quiroga
adcfd9bc2f broadcom/compiler: rename static helpers involved with robust buffer access
To make it explicit that they involve buffers, since we will be adding
robust image access shortly.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18820>
2022-09-27 09:08:29 +00:00
Iago Toral Quiroga
5e5eaa3f1a broadcom/compiler: rename v3d_nir_lower_robust_buffer_access.c
We are going to add code to handle image robustness shortly, so
better rename this to v3d_nir_lower_robust_access.c

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18820>
2022-09-27 09:08:29 +00:00
Erik Faye-Lund
c816081eea docs: fixup broken rst syntax
Seems I messed this up when converting things, and nobody noticed until
now!

Fixes: d4397c0048 ("docs: use envvar role for envvars")
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18641>
2022-09-27 08:59:23 +00:00
Yonggang Luo
9cbfe9a8ba ci/docs: Stick to specific version of python packages
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18833>
2022-09-27 08:22:23 +00:00
Erik Faye-Lund
21107a244a mesa/main: don't copy signed rgtc via float
There's no good reason to copy via float instead of snorm, so let's take
that shortcut.

Acked-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18565>
2022-09-27 07:10:02 +00:00