platform/upstream/mesa.git
17 months agoci/radv: Add a skip for navi21-llvm for a test that consistently timeouts.
Emma Anholt [Mon, 13 Feb 2023 20:08:57 +0000 (12:08 -0800)]
ci/radv: Add a skip for navi21-llvm for a test that consistently timeouts.

I had seen this in my last round of work, but forgot to git add the skips
file.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21294>

17 months agozink: verify compressed format layer count when creating surfaces
Mike Blumenkrantz [Mon, 13 Feb 2023 21:43:21 +0000 (16:43 -0500)]
zink: verify compressed format layer count when creating surfaces

this is illegal for some cases, and mesa/st is equipped to handle
per-layer copying here

fixes #8283

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21292>

17 months agozink: don't handle mutable init on surface creation with tc enabled
Mike Blumenkrantz [Mon, 13 Feb 2023 19:56:06 +0000 (14:56 -0500)]
zink: don't handle mutable init on surface creation with tc enabled

using the cmdbuf during this call is illegal and causes desync, thus
the initialization has to be deferred until the surface is bound

fixes #7579

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21292>

17 months agozink: const-ify a surface param
Mike Blumenkrantz [Mon, 13 Feb 2023 19:55:31 +0000 (14:55 -0500)]
zink: const-ify a surface param

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21292>

17 months agozink: break out pipe_surface init for new surface creation
Mike Blumenkrantz [Mon, 13 Feb 2023 19:55:14 +0000 (14:55 -0500)]
zink: break out pipe_surface init for new surface creation

no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21292>

17 months agozink: account for null surface when trying to retain clears on fb bind
Mike Blumenkrantz [Mon, 13 Feb 2023 19:53:43 +0000 (14:53 -0500)]
zink: account for null surface when trying to retain clears on fb bind

not currently possible but will be soon

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21292>

17 months agozink: only try for a fb rebind if fb binds exist in rebind_image()
Mike Blumenkrantz [Mon, 13 Feb 2023 19:52:57 +0000 (14:52 -0500)]
zink: only try for a fb rebind if fb binds exist in rebind_image()

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21292>

17 months agozink: fix indentation of rebind_image()
Mike Blumenkrantz [Mon, 13 Feb 2023 19:52:33 +0000 (14:52 -0500)]
zink: fix indentation of rebind_image()

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21292>

17 months agocrocus: switch gen4/5 tiling flags to follow suggestions.
Dave Airlie [Tue, 14 Feb 2023 00:58:45 +0000 (10:58 +1000)]
crocus: switch gen4/5 tiling flags to follow suggestions.

Fixes: 6043f66dd332 ("crocus: disable Y tiling for render targets properly.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21300>

17 months agobroadcom/ci: mark test as flaky
Eric Engestrom [Mon, 13 Feb 2023 22:12:04 +0000 (22:12 +0000)]
broadcom/ci: mark test as flaky

It passed once here: https://gitlab.freedesktop.org/gdevi/mesa/-/jobs/36317041

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21295>

17 months agoRevert "freedreno/a5xx: Fix clip_mask"
Emma Anholt [Mon, 13 Feb 2023 21:20:22 +0000 (13:20 -0800)]
Revert "freedreno/a5xx: Fix clip_mask"

This reverts commit 2dfebf34874b5365156d254c2c1ba2ecc5262deb.

It causes GPU hangs in piglit tests like
spec@glsl-1.20@execution@clipping@vs-clip-vertex-enables, for reasons I'm
totally unclear on.  The commit was not necessary, because the frontend
lowering already handles disabled clip planes by storing 0.0 to the
corresponding clipdist array element in that shader variant.  Add a note
to that effect.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21298>

17 months agoci/freedreno: Update manual-run xfails for a530.
Emma Anholt [Mon, 13 Feb 2023 20:13:32 +0000 (12:13 -0800)]
ci/freedreno: Update manual-run xfails for a530.

While I'm having a hard time stabilizing most of the test list on this HW
due to the clip-enable GPU hangs leaking into random other tests, these
have been consistent in the last 4 runs.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21298>

17 months agod3d12: Don't clear d3d12_shader_key
Giancarlo Devich [Thu, 9 Feb 2023 23:26:00 +0000 (15:26 -0800)]
d3d12: Don't clear d3d12_shader_key

The shader key structure is quite large and memsetting it to zero to be
able to create or often simply find an existing shader is responsible
for a large portion of CPU usage during benchmarks.

This change is more surgical about what, when, and how things get
cleared.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21247>

17 months agonir: Check sampler_binding is valid when lowering tex shadow
Giancarlo Devich [Fri, 10 Feb 2023 23:30:09 +0000 (15:30 -0800)]
nir: Check sampler_binding is valid when lowering tex shadow

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21247>

17 months agod3d12: Add unions to encompass shader key stage vars, use in hashing
Giancarlo Devich [Thu, 9 Feb 2023 23:22:51 +0000 (15:22 -0800)]
d3d12: Add unions to encompass shader key stage vars, use in hashing

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21247>

17 months agod3d12: Use varying comparison function for TESS stage key compare
Giancarlo Devich [Thu, 9 Feb 2023 20:34:17 +0000 (12:34 -0800)]
d3d12: Use varying comparison function for TESS stage key compare

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21247>

17 months agoutil/disk_cache: Handle OS'es without d_type in struct dirent
Alan Coopersmith [Fri, 3 Feb 2023 21:12:38 +0000 (13:12 -0800)]
util/disk_cache: Handle OS'es without d_type in struct dirent

Needed to build on Solaris

Fixes: f58e6fee745 ("util/disk_cache: delete more cache items in one go when full")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21110>

17 months agozink: always use NEAREST for zs blits
Mike Blumenkrantz [Wed, 8 Feb 2023 20:36:51 +0000 (15:36 -0500)]
zink: always use NEAREST for zs blits

LINEAR is illegal, and swapping filtering at this point still
seems to be conformant given questionable GL spec requirements for
LINEAR zs filtering

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21203>

17 months agoradv/rra: Hide deferred accel struct data destruction behind an env var
Konstantin Seurer [Sat, 14 Jan 2023 12:38:09 +0000 (13:38 +0100)]
radv/rra: Hide deferred accel struct data destruction behind an env var

Keeping around copies of the BVHs in CPU memory can cause issues with
Applications creating a large amount of acceleration structures (Control).
This commit adds back the old path of copying acceleration structures
while still keeping the deferred, possibly more accurate path around.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20700>

17 months agoradv/rra: Find copy memory index when initializing the trace state
Konstantin Seurer [Sat, 14 Jan 2023 12:20:05 +0000 (13:20 +0100)]
radv/rra: Find copy memory index when initializing the trace state

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20700>

17 months agoanv/hasvk: handle a SAMPLED_READ/STORAGE_READ access flags
Lionel Landwerlin [Mon, 13 Feb 2023 07:18:28 +0000 (09:18 +0200)]
anv/hasvk: handle a SAMPLED_READ/STORAGE_READ access flags

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21277>

17 months agozink: free resource objects' views array during destruction
SoroushIMG [Mon, 13 Feb 2023 14:38:26 +0000 (14:38 +0000)]
zink: free resource objects' views array during destruction

since the array is not ralloc managed, it has be explicitly freed.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21285>

17 months agozink: stop creating pipeline library cache for non-optimal_key drivers
SoroushIMG [Sun, 12 Feb 2023 17:13:48 +0000 (17:13 +0000)]
zink: stop creating pipeline library cache for non-optimal_key drivers

currently the nin-optimal codepath doesn't use this at all and this just
leaks memory due to not handling non-tcs generated shaders.

Fixes: 487ac6dbd60 ("zink: implement cross-program pipeline library sharing")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21285>

17 months agozink: allocate program shader caches from the program's mem ctx
SoroushIMG [Sun, 12 Feb 2023 17:05:15 +0000 (17:05 +0000)]
zink: allocate program shader caches from the program's mem ctx

these will now be freed when the program itself is freed.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21285>

17 months agozink: fix compute shader leaks
SoroushIMG [Sun, 12 Feb 2023 00:36:29 +0000 (00:36 +0000)]
zink: fix compute shader leaks

Compute program owns the nir and zink shaders now and must free them
too when destroyed.

Fixes: 4cb4bb555e7 ("zink: create compute programs from compute shaders directly")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21285>

17 months agoci/mingw: drop useless -Wno-error flags
Michel Zou [Fri, 10 Feb 2023 16:46:46 +0000 (17:46 +0100)]
ci/mingw: drop useless -Wno-error flags

Will prevent merging incorrect code like in #8260

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21244>

17 months agoradv: fix a hang with binning on CHIP_RENOIR
Chia-I Wu [Sat, 11 Feb 2023 00:39:46 +0000 (16:39 -0800)]
radv: fix a hang with binning on CHIP_RENOIR

Using (6, 16) for (context_states_per_bin, persistent_states_per_bin)
causes gpu hang in RDR2 benchmark on CHIP_RENOIR.  Follow radeonsi and
use (3, 8) instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21254>

17 months agovirgl: enable timer queries only if host supports it
osy [Mon, 19 Dec 2022 02:29:50 +0000 (18:29 -0800)]
virgl: enable timer queries only if host supports it

Timer queries is tied to GL_ARB_timer_query/GL_EXT_disjoint_timer_query
support on the host. We have a flag that detects this so lets use it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20380>

17 months agopan/decode: Add support for decoding CSF
Alyssa Rosenzweig [Sat, 21 Jan 2023 21:25:13 +0000 (16:25 -0500)]
pan/decode: Add support for decoding CSF

Add support to pandecode for Mali architecture v10, featuring the new command
stream frontend (CSF). This replaces the "job chain" with a new Command
Execution Unit (CEU) that runs a domain-specific assembly language. That
requires us to refactor pandecode substantially, splitting out JM-only code from
shared JM/CSF common code, and adding new CSF-only decode routines to
disassemble and interpret CSF command streams and pretty-printing the
data structures hit.

This is of course impossible to do properly, since the CEU is pretty easily
Turing-complete and hence subject to the halting problem. But we implement some
simple heuristics to follow jumps that are just good enough for the simple
command streams emitting by both the DDK and Panfrost.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20837>

17 months agopanfrost: Fix some fields in v10.xml
Alyssa Rosenzweig [Sat, 11 Feb 2023 03:12:26 +0000 (22:12 -0500)]
panfrost: Fix some fields in v10.xml

Correct some errors from the file's initial check in, as we're about to add
corresponding pandecode changes for the file.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20837>

17 months agoasahi: Implement indirect draws
Alyssa Rosenzweig [Sun, 12 Feb 2023 17:19:58 +0000 (12:19 -0500)]
asahi: Implement indirect draws

Passes dEQP-GLES31.functional.draw_indirect.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21273>

17 months agoasahi: Refactor index buffer upload for indirect
Alyssa Rosenzweig [Sun, 12 Feb 2023 17:14:13 +0000 (12:14 -0500)]
asahi: Refactor index buffer upload for indirect

We need to avoid the reference to draws->count when indirect draws are used, as
it is not available CPU side.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21273>

17 months agoasahi: Remove default=true on index list values
Alyssa Rosenzweig [Sun, 12 Feb 2023 17:22:47 +0000 (12:22 -0500)]
asahi: Remove default=true on index list values

These will cause issues with indirect draws.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21273>

17 months agopanvk: Disable SNORM rendering
Alyssa Rosenzweig [Tue, 7 Feb 2023 18:27:08 +0000 (13:27 -0500)]
panvk: Disable SNORM rendering

Driver isn't ready for this yet. 7f98a9ba2bd ("panfrost: Implement
GL_EXT_render_snorm on Bifrost+") caused piles of tests to go from NotSupported
-> Fail, so let's functionally revert that.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21257>

17 months agopanvk: Fix varying linking
Alyssa Rosenzweig [Tue, 7 Feb 2023 18:23:54 +0000 (13:23 -0500)]
panvk: Fix varying linking

Since 2316b80d77e ("panfrost: Don't use nir_variable to link varyings"), we can
only get correct type information from the fragment shader inputs (not the
vertex shader output). Fixes piles of CTS regressions.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21257>

17 months agopanvk: Take lock when tracing
Alyssa Rosenzweig [Tue, 7 Feb 2023 17:18:35 +0000 (12:18 -0500)]
panvk: Take lock when tracing

We're not supposed to call the GENX(pandecode_jc) routines (e.g.
pandecode_jc_v7), since it's an internal interface that expects the caller to
take a lock first. Instead we're supposed to call the non-GenXML pandecode_jc
entrypoint which does the locking properly. Fixes assertion failures when
tracing with recent pandecode:

deqp-vk: ../src/util/simple_mtx.h:142: simple_mtx_assert_locked: Assertion `mtx->val' failed.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21257>

17 months agorusticl/program: enable spirv
Karol Herbst [Mon, 5 Sep 2022 15:22:56 +0000 (17:22 +0200)]
rusticl/program: enable spirv

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/19008>

17 months agorusticl/kernel: fix clGetKernelInfo CL_KERNEL_ATTRIBUTES for non source programs
Karol Herbst [Mon, 13 Feb 2023 11:04:10 +0000 (12:04 +0100)]
rusticl/kernel: fix clGetKernelInfo CL_KERNEL_ATTRIBUTES for non source programs

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19008>

17 months agoanv: bump ANV_MAX_QUEUE_FAMILIES
Marcin Ślusarz [Mon, 13 Feb 2023 09:09:35 +0000 (10:09 +0100)]
anv: bump ANV_MAX_QUEUE_FAMILIES

Now it's possible to overflow anv_physical_device.queue.families
and anv_device.decoder.

CID: 1520852

Fixes: 056b0cb87f2 ("anv: add video engine support in various places")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21278>

17 months agonvc0/nv50: support and enable EXT_memory_object*
Yusuf Khan [Fri, 28 Oct 2022 06:58:29 +0000 (01:58 -0500)]
nvc0/nv50: support and enable EXT_memory_object*

Passes the ext_external_objects-memory-object-api-errors piglit:

./bin/ext_external_objects-memory-object-api-errors
Mesa: User error: GL_INVALID_VALUE in glTexStorageMem1DEXT(memory=0)
PIGLIT: {"subtest": {"1D texture" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTexStorageMem2DEXT(memory=0)
PIGLIT: {"subtest": {"2D texture" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTexStorageMem3DEXT(memory=0)
PIGLIT: {"subtest": {"3D texture" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTextureStorageMem1DEXT(memory=0)
PIGLIT: {"subtest": {"1D texture direct state access" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTexureStorageMem2DEXT(memory=0)
PIGLIT: {"subtest": {"2D texture direct state access" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTextureStorageMem3DEXT(memory=0)
PIGLIT: {"subtest": {"3D texture direct state access" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTexStorageMem2DMultisampleEXT(memory=0)
PIGLIT: {"subtest": {"2D texture ms" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTexStorageMem3DMultisampleEXT(memory=0)
PIGLIT: {"subtest": {"3D texture ms" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTextureStorageMem2DMultisampleEXT(memory=0)
PIGLIT: {"subtest": {"2D texture ms direct state access" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glTextureStorageMem3DMultisampleEXT(memory=0)
PIGLIT: {"subtest": {"3D texture ms direct state access" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glBufferStorageMemEXT(memory == 0)
PIGLIT: {"subtest": {"buffer storage" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glNamedBufferStorageMemEXT(memory == 0)
PIGLIT: {"subtest": {"buffer storage direct state access" : "pass"}}
Mesa: User error: GL_INVALID_ENUM in glGetUnsignedBytevEXT(pname=0xffffffff)
PIGLIT: {"subtest": {"unsigned-byte-v-bad-enum" : "pass"}}
Mesa: User error: GL_INVALID_ENUM in glGetUnsignedBytei_vEXT(pname=0xffffffff)
PIGLIT: {"subtest": {"unsigned-byte-i-v-bad-enum" : "pass"}}
Mesa: User error: GL_INVALID_VALUE in glGetUnsignedBytei_vEXT(pname=GL_DEVICE_UUID_EXT)
PIGLIT: {"subtest": {"unsigned-byte-i-v-bad-value" : "pass"}}

Signed-off-by: Yusuf Khan <yusisamerican@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19405>

17 months agoasahi: Add XML for VDM memory barriers
Alyssa Rosenzweig [Sun, 12 Feb 2023 01:20:39 +0000 (20:20 -0500)]
asahi: Add XML for VDM memory barriers

We'll use these in our implementation of transform feedback.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21272>

17 months agoasahi: Add XML for indirect draws
Alyssa Rosenzweig [Sat, 11 Feb 2023 22:39:37 +0000 (17:39 -0500)]
asahi: Add XML for indirect draws

Nice and simple.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21272>

17 months agoasahi: Add XML for indirect dispatch
Alyssa Rosenzweig [Sat, 11 Feb 2023 21:12:04 +0000 (16:12 -0500)]
asahi: Add XML for indirect dispatch

This splits up the CDM commands into their subparts, after which
indirect dispatch is straightforward.

Also fix the pipeline bits.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21272>

17 months agoasahi: Submit batches that don't touch RTs
Alyssa Rosenzweig [Thu, 9 Feb 2023 19:50:26 +0000 (14:50 -0500)]
asahi: Submit batches that don't touch RTs

If there is any draw, we should submit in case there are active queries,
fragment shader side effects, etc. Together with previous commit fixes
no_attachment framebuffers.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21267>

17 months agoagx: Write sample mask even with no colour output
Alyssa Rosenzweig [Thu, 9 Feb 2023 19:48:47 +0000 (14:48 -0500)]
agx: Write sample mask even with no colour output

Needed for discard to work properly, which has visible side effects with
occlusion queries. Fixes no_attachment framebuffers together with the next
commit.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21267>

17 months agoagx: Implement load_helper_invocation
Alyssa Rosenzweig [Fri, 10 Feb 2023 03:58:59 +0000 (22:58 -0500)]
agx: Implement load_helper_invocation

Passes dEQP-GLES31.functional.shaders.helper_invocation.*

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21265>

17 months agoagx: Remove bogus gl_Position assertion
Alyssa Rosenzweig [Fri, 10 Feb 2023 22:21:17 +0000 (17:21 -0500)]
agx: Remove bogus gl_Position assertion

It is reasonable not to write gl_Position in a transform feedback program.

Fixes rendering of the apitrace of Domekeeper in #7798.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21266>

17 months agoagx: Fix AGX_MAX_CF_BINDINGS
Alyssa Rosenzweig [Thu, 9 Feb 2023 20:06:04 +0000 (15:06 -0500)]
agx: Fix AGX_MAX_CF_BINDINGS

Potentially could be larger with aliasing of component offsets, though that
would be silly.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21266>

17 months agoagx: Respect component in frag load_input
Alyssa Rosenzweig [Thu, 9 Feb 2023 20:05:40 +0000 (15:05 -0500)]
agx: Respect component in frag load_input

Fixes fails in dEQP-GLES31.functional.separate_shader.random.*.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21266>

17 months agoagx: Remove unused AGX_MAX_VARYINGS
Alyssa Rosenzweig [Thu, 9 Feb 2023 20:01:12 +0000 (15:01 -0500)]
agx: Remove unused AGX_MAX_VARYINGS

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21266>

17 months agozink: also replace hash_entry::key when replacing separable program
Mike Blumenkrantz [Sun, 12 Feb 2023 21:58:19 +0000 (16:58 -0500)]
zink: also replace hash_entry::key when replacing separable program

this otherwise still points to the separable program's shader array
and will access freed memory

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>

17 months agozink: calloc separable program zink_gfx_library_key struct
Mike Blumenkrantz [Sun, 12 Feb 2023 21:46:40 +0000 (16:46 -0500)]
zink: calloc separable program zink_gfx_library_key struct

this matches other zink_gfx_library_key allocations

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>

17 months agozink: implement a scaling descriptor buffer size
Mike Blumenkrantz [Fri, 10 Feb 2023 21:02:03 +0000 (16:02 -0500)]
zink: implement a scaling descriptor buffer size

previously descriptor buffers were sized to allow for 25,000 descriptors

this is a great number.

but in some scenarios it's overkill, and it's theoretically possible that
it might be underkill in others (citation needed), so add some handling
for both cases to save small amounts of vram on average and not crash
in the distant future when hypercomputers try running drawoverhead

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>

17 months agozink: store base descriptor size on the screen
Mike Blumenkrantz [Fri, 10 Feb 2023 21:00:16 +0000 (16:00 -0500)]
zink: store base descriptor size on the screen

useful to have this around for reuse

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>

17 months agozink: ensure db is bound before separate shader update
Mike Blumenkrantz [Fri, 10 Feb 2023 20:40:44 +0000 (15:40 -0500)]
zink: ensure db is bound before separate shader update

seems unlikely but who knows

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>

17 months agozink: move db_bound to batch descriptor data
Mike Blumenkrantz [Fri, 10 Feb 2023 20:34:45 +0000 (15:34 -0500)]
zink: move db_bound to batch descriptor data

this is where descriptor stuff goes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>

17 months agozink: move zink_batch_state::db_bound reset to zink_batch_descriptor_reset()
Mike Blumenkrantz [Fri, 10 Feb 2023 20:32:46 +0000 (15:32 -0500)]
zink: move zink_batch_state::db_bound reset to zink_batch_descriptor_reset()

descriptor code goes in descriptor file

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>

17 months agozink: rename a struct member for clarity
Mike Blumenkrantz [Fri, 10 Feb 2023 20:02:29 +0000 (15:02 -0500)]
zink: rename a struct member for clarity

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>

17 months agozink: add an io assignment pass for separate shaders
Mike Blumenkrantz [Fri, 10 Feb 2023 18:31:51 +0000 (13:31 -0500)]
zink: add an io assignment pass for separate shaders

usually this is handled by zink_compiler_assign_io() for full pipelines,
where locations are compacted and variables are eliminated, but separate
shaders still need to have "correct" locations set, which can be achieved
by relying on 'location' instead of the (failed) attempt by the frontend
to set 'driver_location' with nir_assign_io_var_locations()

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>

17 months agozink: use a single descriptor buffer for all non-bindless types
Mike Blumenkrantz [Fri, 10 Feb 2023 14:49:58 +0000 (09:49 -0500)]
zink: use a single descriptor buffer for all non-bindless types

the descriptor count (buffer size) calculated for buffers was based
on drawoverhead throughput, which is the fastest descriptors can be changed
at the cpu level. these cases demonstrate the maximum speed that ANY
descriptor can be changed, which means that changing multiple types in
a given cmdbuf will, at best, be the same throughput

thus, instead of allocating a separate buffer for each type, only a single
buffer needs to be allocated, and all descriptors can be bound to this buffer

this should reduce descriptor vram usage by ~80%

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>

17 months agozink: rework separate shader descriptor iterating
Mike Blumenkrantz [Fri, 10 Feb 2023 15:29:45 +0000 (10:29 -0500)]
zink: rework separate shader descriptor iterating

using the shader struct members is a bit more natural here and
avoids some confusion when one of the stages has no descriptors

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>

17 months agozink: flag gfx programs as removed-from-cache by default
Mike Blumenkrantz [Fri, 10 Feb 2023 15:42:24 +0000 (10:42 -0500)]
zink: flag gfx programs as removed-from-cache by default

this fixes some desync where async programs are destroyed before being
added to the cache

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>

17 months agozink: assert that the found program matches the expected one in shader_free
Mike Blumenkrantz [Fri, 10 Feb 2023 15:41:50 +0000 (10:41 -0500)]
zink: assert that the found program matches the expected one in shader_free

avoid bugs

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>

17 months agozink: don't fetch/update pipeline cache for separate shader programs
Mike Blumenkrantz [Fri, 10 Feb 2023 15:01:40 +0000 (10:01 -0500)]
zink: don't fetch/update pipeline cache for separate shader programs

this is illegal

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>

17 months agozink: fix descriptor pool free iterating
Mike Blumenkrantz [Fri, 10 Feb 2023 14:36:30 +0000 (09:36 -0500)]
zink: fix descriptor pool free iterating

these arrays are sparsely allocated, and using pop() on them will
fail to access some elements

Fixes: cf7c17a7af3 ("zink: rework descriptor pool overflow")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>

17 months agozink: sync LTO compiles for GPL pipelines on shader free
Mike Blumenkrantz [Fri, 10 Feb 2023 14:01:48 +0000 (09:01 -0500)]
zink: sync LTO compiles for GPL pipelines on shader free

this avoids invalid access

affects:
KHR-Single-GL46.arrays_of_arrays_gl.InteractionStorageBuffers2

Fixes: 41ffb15de56 ("zink: implement async gfx precompile")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>

17 months agozink: allocate all batch command buffers in one call
Mike Blumenkrantz [Fri, 10 Feb 2023 13:32:49 +0000 (08:32 -0500)]
zink: allocate all batch command buffers in one call

just simpler

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>

17 months agointel/dev: add a default urb value for intel_stub_gpu on dg2
Lionel Landwerlin [Fri, 10 Feb 2023 20:04:57 +0000 (22:04 +0200)]
intel/dev: add a default urb value for intel_stub_gpu on dg2

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21249>

17 months agoradv simplify compiling graphics shaders with a mask of active NIR stages
Samuel Pitoiset [Fri, 10 Feb 2023 10:37:31 +0000 (11:37 +0100)]
radv simplify compiling graphics shaders with a mask of active NIR stages

Instead of recomputing the same bitfield everywhere.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21237>

17 months agoradv: only initialize shader arguments for the active stages
Samuel Pitoiset [Fri, 10 Feb 2023 10:21:28 +0000 (11:21 +0100)]
radv: only initialize shader arguments for the active stages

Other stages don't need to be initialized.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21237>

17 months agoradv: use last_vgt_api_stage for determining the last stage with XFB
Samuel Pitoiset [Fri, 10 Feb 2023 10:32:07 +0000 (11:32 +0100)]
radv: use last_vgt_api_stage for determining the last stage with XFB

It's shorter and cleaner.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21237>

17 months agozink: add a local is_compute var for set_shader_images
Mike Blumenkrantz [Thu, 9 Feb 2023 22:20:54 +0000 (17:20 -0500)]
zink: add a local is_compute var for set_shader_images

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>

17 months agozink: pull out image descriptor updating in set_shader_images
Mike Blumenkrantz [Thu, 9 Feb 2023 22:20:06 +0000 (17:20 -0500)]
zink: pull out image descriptor updating in set_shader_images

no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>

17 months agozink: rework set_shader_images() hook
Mike Blumenkrantz [Thu, 9 Feb 2023 22:15:50 +0000 (17:15 -0500)]
zink: rework set_shader_images() hook

this makes the code more methodical, readable, and correct, fixing a
number of issues along the way:
* inaccurate write_bind_count incrementing
* inaccurate barrier_access write unsetting
* inefficient partial rebinds
* leaking texel buffers

also add some comments to make this clearer

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>

17 months agozink: unref image buffer descriptors on unbind
Mike Blumenkrantz [Thu, 9 Feb 2023 21:10:56 +0000 (16:10 -0500)]
zink: unref image buffer descriptors on unbind

Fixes: 7ab5c5d36d2 ("zink: use EXT_descriptor_buffer with ZINK_DESCRIPTORS=db")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>

17 months agozink: remove stale comment
Mike Blumenkrantz [Thu, 9 Feb 2023 20:59:04 +0000 (15:59 -0500)]
zink: remove stale comment

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>

17 months agozink: unset gfx shader read when unbinding shader images
Mike Blumenkrantz [Thu, 9 Feb 2023 20:53:32 +0000 (15:53 -0500)]
zink: unset gfx shader read when unbinding shader images

this otherwise will never be unset

Fixes: 50e764fa50d ("zink: track gfx/compute descriptor barrier info")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>

17 months agozink: rename some variables in zink_set_shader_images()
Mike Blumenkrantz [Thu, 9 Feb 2023 20:20:27 +0000 (15:20 -0500)]
zink: rename some variables in zink_set_shader_images()

this is more consistent with set_sampler_views

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>

17 months agoradv: fix importing retained NIR shaders when a lib uses the RETAIN bit
Samuel Pitoiset [Fri, 10 Feb 2023 17:08:53 +0000 (18:08 +0100)]
radv: fix importing retained NIR shaders when a lib uses the RETAIN bit

Fixes couple of GPL regressions with VKCTS, I thought this was test
bugs but it's valid behaviour as long as the libary uses
VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21245>

17 months agoradv: Use common Get*OpaqueCaptureDescriptorDataEXT
Alyssa Rosenzweig [Fri, 10 Feb 2023 00:18:43 +0000 (19:18 -0500)]
radv: Use common Get*OpaqueCaptureDescriptorDataEXT

Now stubbed by the Vulkan runtime for you, deduplicate.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by; Samuel Pitoiset <samuel.pitoiset@gmail.com>

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21230>

17 months agotu,vulkan: Add common Get*OpaqueCaptureDescriptorDataEXT
Alyssa Rosenzweig [Fri, 10 Feb 2023 00:16:22 +0000 (19:16 -0500)]
tu,vulkan: Add common Get*OpaqueCaptureDescriptorDataEXT

In both tu and radv, these are all trivial. Move the trivial implementation from
tu to common code to deduplicate the boilerplate.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by; Samuel Pitoiset <samuel.pitoiset@gmail.com>

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21230>

17 months agoiris: handle error in iris_resource_from_handle
Tapani Pälli [Fri, 10 Feb 2023 08:02:29 +0000 (10:02 +0200)]
iris: handle error in iris_resource_from_handle

In similar manner as fdab8fef7aff we might fail creating resource,
let application handle the error. Application may have given wrong
input pitch when importing dmabuf.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8248
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21233>

17 months agofix(FTBFS): clover: fix LLVM #include of Triple.h, moved to TargetParser
Kai Wasserbäch [Sat, 11 Feb 2023 17:12:01 +0000 (18:12 +0100)]
fix(FTBFS): clover: fix LLVM #include of Triple.h, moved to TargetParser

Upstream moved Triple.h from ADT to TargetParser in LLVM 17.

Reference: https://github.com/llvm/llvm-project/commit/62c7f035b4392c1933550eead6ddab35122720bc
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21262>

17 months agofix(FTBFS): gallivm: fix LLVM #include of Triple.h, moved to TargetParser
Kai Wasserbäch [Sat, 11 Feb 2023 17:10:08 +0000 (18:10 +0100)]
fix(FTBFS): gallivm: fix LLVM #include of Triple.h, moved to TargetParser

Upstream moved Triple.h from ADT to TargetParser in LLVM 17.

Reference: https://github.com/llvm/llvm-project/commit/62c7f035b4392c1933550eead6ddab35122720bc
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21262>

17 months agou_pipe_screen_lookup_or_create: avoid re-querying the fd to have a consistent hash key
Eric Engestrom [Thu, 15 Dec 2022 14:54:51 +0000 (14:54 +0000)]
u_pipe_screen_lookup_or_create: avoid re-querying the fd to have a consistent hash key

In every current driver, the fd we get back from the screen is the fd we
gave to screen_create() three lines above (or a dup() thereof, which we
consider to be the same since we look inside it for the file description
instead).

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>

17 months agoasahi: use u_pipe_screen_lookup_or_create() to keep track of and reuse screens
Eric Engestrom [Wed, 14 Dec 2022 22:20:57 +0000 (22:20 +0000)]
asahi: use u_pipe_screen_lookup_or_create() to keep track of and reuse screens

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>

17 months agopanfrost: use u_pipe_screen_lookup_or_create() to keep track of and reuse screens
Eric Engestrom [Tue, 13 Dec 2022 15:49:57 +0000 (15:49 +0000)]
panfrost: use u_pipe_screen_lookup_or_create() to keep track of and reuse screens

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>

17 months agovc4: use u_pipe_screen_lookup_or_create() to keep track of and reuse screens
Eric Engestrom [Thu, 8 Dec 2022 17:40:27 +0000 (17:40 +0000)]
vc4: use u_pipe_screen_lookup_or_create() to keep track of and reuse screens

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>

17 months agov3d: use u_pipe_screen_lookup_or_create() to keep track of and reuse screens
Eric Engestrom [Thu, 1 Dec 2022 13:48:17 +0000 (13:48 +0000)]
v3d: use u_pipe_screen_lookup_or_create() to keep track of and reuse screens

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>

17 months agolima: replace custom code with u_pipe_screen_lookup_or_create()
Eric Engestrom [Tue, 13 Dec 2022 21:02:22 +0000 (21:02 +0000)]
lima: replace custom code with u_pipe_screen_lookup_or_create()

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>

17 months agofreedreno: replace custom code with u_pipe_screen_lookup_or_create()
Eric Engestrom [Tue, 13 Dec 2022 20:52:22 +0000 (20:52 +0000)]
freedreno: replace custom code with u_pipe_screen_lookup_or_create()

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>

17 months agogallium: move etnaviv screen_lookup_or_create function to common code
Eric Engestrom [Fri, 9 Dec 2022 20:52:15 +0000 (20:52 +0000)]
gallium: move etnaviv screen_lookup_or_create function to common code

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>

17 months agoetnaviv: use simple_mtx to avoid breaking windows in the next commit
Eric Engestrom [Fri, 9 Dec 2022 20:52:15 +0000 (20:52 +0000)]
etnaviv: use simple_mtx to avoid breaking windows in the next commit

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>

17 months agoutil: avoid calling kcmp on Android
Eric Engestrom [Wed, 1 Feb 2023 17:58:02 +0000 (17:58 +0000)]
util: avoid calling kcmp on Android

On some combinations of Android version and kernel version, calling kcmp
results in seccomp killing the process.

As there doesn't seem to be a way to query for that in advance, skip
this check altogether on Android.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>

17 months agogallium/u_screen.h: add missing stdint.h include
Eric Engestrom [Mon, 12 Dec 2022 21:27:06 +0000 (21:27 +0000)]
gallium/u_screen.h: add missing stdint.h include

For uint64_t.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>

17 months agoradv: Implement VK_ACCESS_2_DESCRIPTOR_BUFFER_READ_BIT_EXT.
Hans-Kristian Arntzen [Sun, 12 Feb 2023 15:20:26 +0000 (16:20 +0100)]
radv: Implement VK_ACCESS_2_DESCRIPTOR_BUFFER_READ_BIT_EXT.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Fixes: 46e0c77 ("radv: implement VK_EXT_descriptor_buffer")
Co-authored-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21271>

17 months agoradv: Fix missing VK_ACCESS_2_SHADER_SAMPLED_READ_BIT.
Hans-Kristian Arntzen [Sun, 12 Feb 2023 15:02:26 +0000 (16:02 +0100)]
radv: Fix missing VK_ACCESS_2_SHADER_SAMPLED_READ_BIT.

Cannot be used for SSBO, so ignore SCACHE invalidation.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Fixes: 8df17163c78 ("radv: implement vkCmdWaitEvents2KHR")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21271>

17 months agoradv: Fix invalid 64-bit shift.
Hans-Kristian Arntzen [Sun, 12 Feb 2023 14:40:31 +0000 (15:40 +0100)]
radv: Fix invalid 64-bit shift.

For sync2 bits, overflow can happen.
Use BITFIELD64_BIT to align with ANV.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Fixes: 8df17163c78 ("radv: implement vkCmdWaitEvents2KHR")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21271>

17 months agoglsl/standalone: Do not pass memory allocated with ralloc_size to free
Michel Dänzer [Wed, 8 Feb 2023 16:36:35 +0000 (17:36 +0100)]
glsl/standalone: Do not pass memory allocated with ralloc_size to free

Pointed out by GCC:

In function ‘load_text_file’,
    inlined from ‘standalone_compile_shader’ at ../src/compiler/glsl/standalone.cpp:491:38,
    inlined from ‘main’ at ../src/compiler/glsl/main.cpp:98:45:
../src/compiler/glsl/standalone.cpp:358:17: error: ‘free’ called on pointer ‘block_195’ with nonzero offset 48 [-Werror=free-nonheap-object]
  358 |             free(text);
      |                 ^
In function ‘ralloc_size’,
    inlined from ‘load_text_file’ at ../src/compiler/glsl/standalone.cpp:352:31,
    inlined from ‘standalone_compile_shader’ at ../src/compiler/glsl/standalone.cpp:491:38,
    inlined from ‘main’ at ../src/compiler/glsl/main.cpp:98:45:
../src/util/ralloc.c:117:18: note: returned from ‘malloc’
  117 |    void *block = malloc(align64(size + sizeof(ralloc_header),
      |                  ^

Fixes: a9696e79fb3a ("main: Close memory leak of shader string from load_text_file.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21215>

17 months agoglsl/standalone: Fix up _mesa_reference_shader_program_data signature
Michel Dänzer [Wed, 8 Feb 2023 15:48:43 +0000 (16:48 +0100)]
glsl/standalone: Fix up _mesa_reference_shader_program_data signature

Drop the unused ctx parameter, to match the main Mesa code.

Fixes ODR violation flagged by -Wodr with LTO enabled:

../src/mesa/main/shaderobj.h:74:1: error: ‘_mesa_reference_shader_program_data’ violates the C++ One Definition Rule [-Werror=odr]
   74 | _mesa_reference_shader_program_data(struct gl_shader_program_data **ptr,
      | ^
../src/compiler/glsl/standalone_scaffolding.cpp:76:1: note: type mismatch in parameter 1
   76 | _mesa_reference_shader_program_data(struct gl_context *ctx,
      | ^
../src/compiler/glsl/standalone_scaffolding.cpp:76:1: note: ‘_mesa_reference_shader_program_data’ was previously declared here
../src/compiler/glsl/standalone_scaffolding.cpp:76:1: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used

Fixes: 717a720e9c95 ("mesa: drop unused context parameter to shader program data reference.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21215>