Commit Graph

9219 Commits

Author SHA1 Message Date
Yonggang Luo df242a2c06 auxiliary: Remove pipe_tsd
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17213>
2022-07-29 23:59:12 +00:00
Yonggang Luo 48e72da0dd gallium: Rename macros HAVE_PIPE_LOADER*
Rename macro HAVE_PIPE_LOADER_DRI to HAVE_DRI
Rename macro HAVE_PIPE_LOADER_KMS to HAVE_DRISW_KMS

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17784>
2022-07-29 12:57:26 +00:00
Yonggang Luo 98fa0c3351 gallium: Do not call to pipe_loader_sw_probe_kms when not present
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17784>
2022-07-29 12:57:26 +00:00
Yonggang Luo 34572042c7 gallium: Move -DHAVE_PIPE_LOADER_DRI and -DHAVE_PIPE_LOADER_KMS to be pre_args
There is non pipe-loader source code depends on it.
After doing this, we found that shared library pipe_swrast depends on libswdri
The error message is:
src/gallium/targets/pipe-loader/pipe_swrast.so.p/pipe_swrast.c.o:pipe_swrast.c:swrast_driver_descriptor: error: undefined reference to 'dri_create_sw_winsys'
src/gallium/targets/pipe-loader/pipe_swrast.so.p/pipe_swrast.c.o:pipe_swrast.c:swrast_driver_descriptor: error: undefined reference to 'kms_dri_create_winsys'

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17784>
2022-07-29 12:57:26 +00:00
Eric Engestrom 2c67457e5e util/list: rename LIST_ENTRY() to list_entry()
This follows the Linux kernel convention, and avoids collision with
macOS header macro.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6751
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6840
Cc: mesa-stable
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17772>
2022-07-28 10:10:44 +00:00
Marek Olšák 83d820973c util/u_threaded: fix a CPU storage crash due to an invalid codepath taken
Fixes: 3df9d8ed80 - gallium/u_threaded: implement pipelined partial buffer uploads using CPU storage

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6837
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6594
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6613

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17556>
2022-07-28 01:11:01 +00:00
Dave Airlie 189755a9ac util/pack_color: clamp depth values outside range for unorm formats.
For unrestricted depth ranges, depth clear values for unorm buffers
need to be explicitly clamped. However this has to happen in the
driver when we know the depth buffer format, not at the API level.

Just add clamps to the non-f32 cases and separate it out.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17612>
2022-07-28 10:35:04 +10:00
Brian Paul c9c5fc1e9a gallivm: rename 'var' param in emit_store_reg(), emit_store_var().
Rename 'dst' param' to 'vals'.  This parameter contains the values
which we're storing.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17561>
2022-07-27 22:24:56 +00:00
Brian Paul 68616b1629 gallivm: fix incorrect memset() in SOA emit_load_const()
The memset() call to zero-out the unused elements of outval[] used
the wrong bytecount.  Just replace it with a simpler for loop.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17561>
2022-07-27 22:24:56 +00:00
Brian Paul 9984ec67f2 gallivm: simplify shuffling in emit_store_reg()
The writemask can be implemented with just one llvm vector shuffle.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17561>
2022-07-27 22:24:56 +00:00
Brian Paul ef7da4b292 gallivm: asst. clean-ups in lp_bld_swizzle.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17561>
2022-07-27 22:24:56 +00:00
Brian Paul 4a30155c72 llvmpipe: replace 'unsigned' with enum types
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17561>
2022-07-27 22:24:56 +00:00
Brian Paul 49966374c8 gallivm: asst. clean-ups in lp_bld_const.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17561>
2022-07-27 22:24:55 +00:00
Dave Airlie a2cd47acdb gallivm: fix casting around read invocation.
Fixes zink KHR-GL46.shader_ballot_tests.ShaderBallotAvailability

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17588>
2022-07-27 20:58:55 +00:00
Dave Airlie ce65e0428a gallivm: use progress from subgroup lowering.
This makes sure the pack lowering gets called again.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17588>
2022-07-27 20:58:55 +00:00
Mike Blumenkrantz 62044403a9 util/blitter: respect PIPE_TEXTURE_RECT
if this isn't supported, don't use rect-related sampling

cc: mesa-stable

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17714>
2022-07-26 19:30:44 +00:00
Emma Anholt bd8740da77 gallivm: Optimize single-invocation SSBO stores.
The CTS does a lot of 1x1x1 compute shaders (all that stuff like
dEQP-GLES31.functional.shaders.builtin_functions.precision.mul.highp_compute.scalar)
which finish with store_ssbos.  Instead of doing the invocation loop in
that case (which LLVM has to later unroll), just emit the single
invocation's store.

Fixes timeouts running
dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer.36, which does
a spectacular number of SSBO stores in a long 1x1x1 compute shader.
Reduces runtime of on llvmpipe from 66s to 29s locally, and virgl from
1:38 to 43s.  virgl
dEQP-GLES31.functional.ssbo.layout.random.nested_structs_arrays_instance_arrays.22
goes down to 7 seconds.

Fixes: #6797
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17730>
2022-07-26 18:59:45 +00:00
Emma Anholt 8d41f8f384 gallivm: Refactor a bit of UBO/SSBO range checking.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17730>
2022-07-26 18:59:45 +00:00
Erik Faye-Lund ba2146f93f gallium/hud: do not use texture-rect for font
RECT textures used to be required to be supported by drivers. But since
the state-tracker learned how to lower these to 2D textures, some
drivers no longer support them.

While we have lowering in place for this, lowering it involves some
needless overhead. So let's just use a 2D texture instead of a RECT
texture.

Because having two versions and switching between them is more
complicated than it needs to be, let's just always use a 2D texture.
Similarly, let's just always multiply the reciprocal here, so we don't
have to test for PIPE_CAP_TGSI_DIV first.

Cc: mesa-stable
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17707>
2022-07-25 18:12:05 +00:00
Marek Olšák 3e94d498b3 gallium: add pipe_blit_info::dst_sample, update u_blitter to write that sample
A new radeonsi blit test will use it to upload different sample values
into MSAA textures.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17694>
2022-07-23 18:21:31 +00:00
Mihai Preda da9feae735 gallivm: push LLVM version guard into assert
The asserts that check the pointer element type can't be used on LLVM >= 15.
Instead of using precompiler #if, use boolean shortcut in assert.

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17650>
2022-07-23 17:34:08 +00:00
Mihai Preda f0fda08739 gallivm: add lp_build_struct_get() variants that take the LLVM type
This is needed for LLVM-15 opaque pointers.
The new variants taking the type are named with the suffix "2", using
the same naming pattern LLVM (e.g. LLVMBuildGEP2 vs. LLVMBuildGEP).

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17650>
2022-07-23 17:34:08 +00:00
Mihai Preda 8c4aef2abb gallivm: refactor a bit the cache access in view of LLVM opaque pointers
LLVM 15 requires transition to opaque pointers; factorize a bit the cache
memthods to help this transition.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17650>
2022-07-23 17:34:08 +00:00
Mihai Preda b549394992 gallivm: fix a few llvm non-opaque pointers
As LLVM 15 transitions to opaque pointers, we need to update
the deprecated methods dealing with non-opaque pointers.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17650>
2022-07-23 17:34:08 +00:00
Emma Anholt f6c5b1d6c6 nir: Split usub_sat lowering flag from uadd_sat.
Intel vec4 would like to do uadd_sat, but use lowering for usub_sat.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17637>
2022-07-22 17:54:28 +00:00
Mike Blumenkrantz 6b07893b31 util/vbuf: handle multidraws
this moves the handling from cso_conext to vbuf, which reduces overhead
for draws that aren't rewritten

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17686>
2022-07-22 12:40:56 +00:00
Dave Airlie 21dd305694 llvmpipe: fix aniso cube map arrays.
There was a coordinate missing when you have cube map arrays,
and aniso sampling.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fixes: ce2b711c0a ("gallivm: add support for anisotropic sampling.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17704>
2022-07-22 14:18:39 +10:00
Sil Vilerino 74c5d01169 vl: Replace usage of entrypoint UNKNOWN with PROCESSING for VP
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17557>
2022-07-21 22:40:30 +00:00
Marek Olšák 2474d92071 ttn: set dest_type for TXQ
It was failing an assertion in tgsi_to_nir and NIR validation.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17691>
2022-07-21 20:05:12 +00:00
Konstantin Seurer 74fe2c805f util: Remove format desc null check
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17490>
2022-07-21 12:48:01 +00:00
Konstantin Seurer f10b9563dd tgsi: Remove format desc null check
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17490>
2022-07-21 12:48:01 +00:00
Konstantin Seurer 927f863364 gallivm: Remove format desc null checks
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17490>
2022-07-21 12:48:01 +00:00
Mihai Preda bc78b861ca gallium: LLVM-15 contexts use non-opaque pointers
LLVM-15 enables opaque pointers by default. We temporarilly request
non-opaque pointers while we migrate our code to support non-opaque pointers.

This workaround needs to be removed before LLVM-16.

See #6615

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17514>
2022-07-17 21:44:37 +00:00
Brian Paul 98593360c4 gallivm: increase LP_MAX_TGSI_SHADER_IMAGES from 16 to 32
This allows a VMware test to pass.  The comments in lp_bld_limits.h
mention SM 3.0 requirements, but we're in the SM 5.0 era...

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
2022-07-14 19:16:07 +00:00
Brian Paul 26775d7ca7 gallivm: s/0/LP_BLD_TEX_MODIFIER_NONE/
A minor readability improvement.

Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
2022-07-14 19:16:07 +00:00
Brian Paul 3e50112861 nir: add const qualifiers, move some decls in nir_to_tgsi_info.c
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
2022-07-14 19:16:07 +00:00
Brian Paul 0c80bdf758 gallivm: s/unsigned/enum pipe_swizzle/
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17062>
2022-07-14 19:16:07 +00:00
Kai Wasserbäch 301bcbac0e fix(gallivm): Replace LLVMConstF* with LLVMBuild* methods.
LLVM 15 removed support for LLVMConstF in commit
4bb7b6fae3be02031878b2aa3be584c6627ad8ec.

Reference: 4bb7b6fae3
Reference: 07146a9e64/llvm/docs/ReleaseNotes.rst (changes-to-the-c-api)
Closes: mesa/mesa#6863
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Tested-by: Marcus Seyfarth <m.seyfarth@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17518>
2022-07-14 10:02:14 +00:00
Jesse Natalie acba2bbb0e gallium, mesa: Support setting timeline semaphore values
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:17 +00:00
Jesse Natalie 8cd391a63e gallium: Add a new fence type with a pipe cap to indicate it can be imported
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:16 +00:00
Jesse Natalie 633a469a7a driver_noop: Remove infinite recursion from create_fence_win32
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:16 +00:00
Jesse Natalie 7c4fa79bfa gallium: Add 'name' field to Win32 semaphore import
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17446>
2022-07-14 03:45:16 +00:00
Georg Lehmann d472c45810 nir_to_tgsi: Lower uadd_sat/usub_sat.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17468>
2022-07-13 07:34:09 +00:00
Mike Blumenkrantz 21b3a23404 mesa: fix SignalSemaphoreEXT behavior
the EXT_external_object spec originally was underspecified with regards
to this function, leaving room for synchronization errors where:
* app calls SignalSemaphoreEXT to signal a semaphore
* mesa defers pipe_context::fence_server_signal with threaded context
* driver defers gpu submission
* SignalSemaphoreEXT has long since returned, app submits vk cmdbuf waiting on semaphore
* spec violation / device lost

to prevent this, the spec is being changed to:
1) require an implicit flush when calling SignalSemaphoreEXT
2) require that this implicit flush also forces GPU submission before SignalSemaphoreEXT returns

all affected drivers have been updated

fixes #6568

cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17376>
2022-07-10 16:15:17 +00:00
Marek Olšák c9ca8abe4f Change all debug_assert calls to assert
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17403>
2022-07-10 00:50:35 +00:00
Marek Olšák 2f01a22fe4 util: remove our redefinition of assert
I think we can all agree that our own assert is unnecessary.

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

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17403>
2022-07-10 00:50:34 +00:00
Jason Ekstrand b2ab6d10e4 mesa,glsl,ttn: Set subgroup_size to UNIFORM
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17337>
2022-07-08 22:47:22 +00:00
Mike Blumenkrantz c4e18cd4dd mesa/st: add PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_FREEDRENO
this is for drivers (like freedreno) which need the format in the sampler
state in order to accurately handle border colors

when set, drivers MAY receive a format in the sampler state if the frontend
supports it (e.g., nine does not), and the cso sampler cache will include
the format member of the struct

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17189>
2022-07-07 20:39:30 +00:00
Gert Wollny 198bcf7726 tgsi: Don't bother setting the TGSI_PROPERTY_SEPARABLE_PROGRAM
Most drivers don't care about the property, and virgl should only handle
it if the host supports it.

This is a partial revert of b634030, i.e. we keep the definition of the
property, but we don't set it only based on the shader info.

Fixes: b634030542
  tgsi: Add SEPARABLE_PROGRAM property

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17344>
2022-07-07 09:46:53 +00:00
Alyssa Rosenzweig 151aa19c21 ttn: Set nir->info.separate_shader
TGSI has no legitimate[1] notion of linked shaders, which means tgsi_to_nir
should conservatively assume everything all shaders are separable. This requires
setting nir->info.separate_shader to warn drivers that shader CSOs might be
mixed and matched. Otherwise, the driver might enable optimizations that
are invalid for separate shaders, causing issues when the shaders are
later treated as separable.

This will fix varying linking with u_blitter's shaders on Panfrost (Bifrost and
older), when util_blitter_clear is used with Panfrost.

[1] There was a TGSI property added recently to forward
nir->info.separate_shader up to virglrenderer, but it's not actually used for
anything in virglrenderer and I am still struggling to understand what the use
case would be. My gut says we should revert b634030542 ("tgsi: Add
SEPARABLE_PROGRAM property"), but I'm not interested in fighting that yak right
now. Notably, the u_blitter and hud shaders are separable but are not marked
with this property.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17282>
2022-07-05 17:38:54 +00:00