platform/upstream/mesa.git
16 months agoglsl: Move ForceGLSLAbsSqrt handling to glsl-to-nir.
Emma Anholt [Wed, 22 Mar 2023 20:03:05 +0000 (13:03 -0700)]
glsl: Move ForceGLSLAbsSqrt handling to glsl-to-nir.

Cutting more GLSL lowering pass in favor of nir builder.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22083>

16 months agoradv: fix leak of nir from retained shaders
Mike Blumenkrantz [Wed, 5 Apr 2023 14:07:40 +0000 (10:07 -0400)]
radv: fix leak of nir from retained shaders

if shaders are found in the app cache above, execution will goto done:
and the nir must still be freed

Fixes: 03d2bd6042d ("radv: ensure to retain NIR shaders for GPL libs found in the cache")

fixes #8786

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

16 months agopanfrost: assign the correct create_for_resource from the start
Eric Engestrom [Wed, 5 Apr 2023 16:28:24 +0000 (17:28 +0100)]
panfrost: assign the correct create_for_resource from the start

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

16 months agoutil/disk_cache: Move blob_put_cb to the async queue
Rob Clark [Sat, 1 Apr 2023 14:38:40 +0000 (07:38 -0700)]
util/disk_cache: Move blob_put_cb to the async queue

Move deflate and put to the queue for the blob cache case.  This moves
the overhead out of the app thread when storing new shaders.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22248>

16 months agoutil/disk_cache: Use queue state to skip put
Rob Clark [Sat, 1 Apr 2023 14:35:01 +0000 (07:35 -0700)]
util/disk_cache: Use queue state to skip put

If we move the blob-cache path into the async queue, then
path_init_failed is no longer a good way to check if puts
should be a no-op.  But fortunately checking if the queue
is initialized is, and is a more obvious check because
what it is guarding is a util_queue_add_job().

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22248>

16 months agoutil/disk_cache: Add NONE type
Rob Clark [Wed, 5 Apr 2023 15:57:17 +0000 (08:57 -0700)]
util/disk_cache: Add NONE type

Add an explicit enum for the DISK_CACHE_NONE type so that we don't
confuse with the MULTI_FILE case on android when the blob-cache is
used.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22248>

16 months agoutil/disk_cache: Split out queue initialization
Rob Clark [Sat, 1 Apr 2023 14:27:43 +0000 (07:27 -0700)]
util/disk_cache: Split out queue initialization

Split out a helper to initialize the queue, as we'll want to re-use this
for the blob-cache case.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22248>

16 months agointel/compiler: Support fmul_fsign opt for fp64 when int64 isn't supported
Jordan Justen [Fri, 31 Mar 2023 23:52:50 +0000 (16:52 -0700)]
intel/compiler: Support fmul_fsign opt for fp64 when int64 isn't supported

MTL support fp64, but not int64. The fsign(double(x))*FOO optimization
would try to use a 64-bit int xor operation to conditionally toggle
the sign bit off the result.

Since this only affects high bit of the result, we can do a 32-bit
move of the low dword, and a 32-bit xor on the high dword.

Fixes dEQP-VK.spirv_assembly.instruction.compute.float_controls.fp64.input_args.modf_denorm_flush_to_zero
on MTL.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22259>

16 months agoradv/amdgpu: Remove can_patch and chained submit code path.
Timur Kristóf [Thu, 30 Mar 2023 16:57:30 +0000 (18:57 +0200)]
radv/amdgpu: Remove can_patch and chained submit code path.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22220>

16 months agoradv: Chain cmd buffers in queue code when possible, not in winsys.
Timur Kristóf [Thu, 30 Mar 2023 16:54:35 +0000 (18:54 +0200)]
radv: Chain cmd buffers in queue code when possible, not in winsys.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22220>

16 months agoradv/amdgpu: Unchain CS array in queue code not in winsys.
Timur Kristóf [Thu, 30 Mar 2023 16:51:13 +0000 (18:51 +0200)]
radv/amdgpu: Unchain CS array in queue code not in winsys.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22220>

16 months agoradv/amdgpu: Walk chained CS objects for BO list.
Timur Kristóf [Thu, 30 Mar 2023 16:21:59 +0000 (18:21 +0200)]
radv/amdgpu: Walk chained CS objects for BO list.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22220>

16 months agoradv/amdgpu: Remember which CS the current one is chained to.
Timur Kristóf [Thu, 30 Mar 2023 16:13:28 +0000 (18:13 +0200)]
radv/amdgpu: Remember which CS the current one is chained to.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22220>

16 months agoradv/amdgpu: Extract radv_amdgpu_add_cs_to_bo_list function.
Timur Kristóf [Thu, 30 Mar 2023 16:09:23 +0000 (18:09 +0200)]
radv/amdgpu: Extract radv_amdgpu_add_cs_to_bo_list function.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22220>

16 months agoradv/amdgpu: Expose CS chain and unchain on the winsys.
Timur Kristóf [Thu, 22 Sep 2022 22:38:14 +0000 (15:38 -0700)]
radv/amdgpu: Expose CS chain and unchain on the winsys.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22220>

16 months agoradv/amdgpu: Extract CS chain and unchain functions.
Timur Kristóf [Thu, 22 Sep 2022 20:24:07 +0000 (13:24 -0700)]
radv/amdgpu: Extract CS chain and unchain functions.

Also add a comment that explains what chaining means
and add a check to make sure the HW IP type supports it.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22220>

16 months agoci: implement sections for cuttlefish
David Heidelberg [Sat, 18 Mar 2023 14:33:45 +0000 (15:33 +0100)]
ci: implement sections for cuttlefish

Reviewed-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22005>

16 months agoradv: emit the PS epilog after the graphics pipeline
Samuel Pitoiset [Wed, 5 Apr 2023 10:05:10 +0000 (12:05 +0200)]
radv: emit the PS epilog after the graphics pipeline

Otherwise, SPI_SHADER_PGM_RSRC1_PS is overwritten when the graphics
pipeline is emitted.

Fixes: 5c362cde33b ("radv: update PS num_vgprs in case of epilogs rather than overallocating VGPRs")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22310>

16 months agovc4/ci: add another sync flake
Eric Engestrom [Wed, 5 Apr 2023 11:49:20 +0000 (12:49 +0100)]
vc4/ci: add another sync flake

https://gitlab.freedesktop.org/mesa/mesa/-/jobs/39377396

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

16 months agoglthread: use id 0 for internal buffer objects
Mike Blumenkrantz [Tue, 4 Apr 2023 15:13:41 +0000 (11:13 -0400)]
glthread: use id 0 for internal buffer objects

-1 is an invalid buffer index which breaks app expectations, specifically
apitrace, which checks for return value of 0 from checking buffer bindings
to determine whether to inject user vertex buffer bindings and create functional
traces

this should fix capturing traces with drivers using glthread

fixes #8383

cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22293>

16 months agointel/fs: also allow vec8+ vectorization of load_global_const_block_intel
Lionel Landwerlin [Fri, 24 Mar 2023 11:29:59 +0000 (13:29 +0200)]
intel/fs: also allow vec8+ vectorization of load_global_const_block_intel

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>

16 months agointel/fs: optimize uniform SSBO & shared loads
Lionel Landwerlin [Mon, 6 Mar 2023 18:11:53 +0000 (20:11 +0200)]
intel/fs: optimize uniform SSBO & shared loads

Using divergence analysis, figure out when SSBO & shared memory loads
are uniform and carry the data only once in register space.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>

16 months agonir: add 2 new intel intrinsics for uniform ssbo/shared loads
Lionel Landwerlin [Tue, 7 Mar 2023 10:11:25 +0000 (12:11 +0200)]
nir: add 2 new intel intrinsics for uniform ssbo/shared loads

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>

16 months agonir: reuse nir_component_mask() where it makes sense
Lionel Landwerlin [Tue, 7 Mar 2023 11:09:43 +0000 (13:09 +0200)]
nir: reuse nir_component_mask() where it makes sense

Avoiding local bit field manipulations.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>

16 months agointel/fs: factor out lsc surface descriptor settings
Lionel Landwerlin [Mon, 6 Mar 2023 15:39:09 +0000 (17:39 +0200)]
intel/fs: factor out lsc surface descriptor settings

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>

16 months agointel/fs: copy instruction sources in logical send lowering
Lionel Landwerlin [Fri, 17 Mar 2023 08:38:11 +0000 (10:38 +0200)]
intel/fs: copy instruction sources in logical send lowering

Having references to inst->src[X] when you're also modifying
inst->src[X] is a receipe for disaster. Making changes to the lowering
code I've been bitten quite a few times by this take copies of all
sources to do the lowering.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>

16 months agointel/fs: UNDEF fixup_nomask_control_flow temp register
Lionel Landwerlin [Fri, 24 Mar 2023 11:56:06 +0000 (13:56 +0200)]
intel/fs: UNDEF fixup_nomask_control_flow temp register

Ensure that the register's liveness is not expanded to loops.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>

16 months agointel/fs: don't consider fixup_nomask_control_flow SENDs predicate
Lionel Landwerlin [Tue, 14 Mar 2023 16:22:50 +0000 (18:22 +0200)]
intel/fs: don't consider fixup_nomask_control_flow SENDs predicate

Those SENDs are still doing a full register write. We just inserted
some predication for a workaround.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>

16 months agointel/fs: run VGRF compaction just before max live register accounting
Lionel Landwerlin [Fri, 17 Mar 2023 07:42:31 +0000 (09:42 +0200)]
intel/fs: run VGRF compaction just before max live register accounting

There are a number of instances of the dead code elimination pass that
could reduce the count. For some reason this also seems to affect
register allocation itself.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>

16 months agoanv: ignore structure types handled in vk_device_memory_create
Marcin Ślusarz [Wed, 5 Apr 2023 08:44:31 +0000 (10:44 +0200)]
anv: ignore structure types handled in vk_device_memory_create

Without that we get warning from anv_debug_ignored_stype, called in
the default case.

Fixes: 4b0b75c27a7 ("anv: Use the new vk_device_memory base struct")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22295>

16 months agobroadcom/ci: run gl jobs on arm64, just like vk
Eric Engestrom [Mon, 3 Apr 2023 17:22:25 +0000 (18:22 +0100)]
broadcom/ci: run gl jobs on arm64, just like vk

These were running on armhf because that's the default in the custom
distro that Raspberry Pi provides, but arm64 is ~20% faster, and we
already run weekly tests on both arm64 & armhf, so let's keep only the
faster one in the pre-merge path.

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

16 months agor600/sfn: fix container allocators
Gert Wollny [Tue, 4 Apr 2023 13:58:27 +0000 (15:58 +0200)]
r600/sfn: fix container allocators

This fixes leaks in TexInstr and in Shader.

Thanks to Patrick Lerda for pointing out the bug.

Fixes: 79ca456b4837b3bc21cf9ef3c03c505c4b4909f6
    r600/sfn: rewrite NIR backend

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22300>

16 months agoradv: fix VS prologs with GPL and static binding stride
Samuel Pitoiset [Tue, 4 Apr 2023 11:10:01 +0000 (13:10 +0200)]
radv: fix VS prologs with GPL and static binding stride

When a graphics pipeline library is created with only the vertex input
state, the driver binds this state at pipeline bind time. Though the
vertex binding stride is not necessarily dynamic, in this case the
pipeline stride should be used.

This fixes GPU hangs with recent
dEQP-VK.pipeline.fast_linked_library.vertex_input.*.

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

16 months agov3d,v3dv: stop trying to force 16-bit TMU output for shadow comparisons
Iago Toral Quiroga [Mon, 3 Apr 2023 08:16:16 +0000 (10:16 +0200)]
v3d,v3dv: stop trying to force 16-bit TMU output for shadow comparisons

In V3D we were doing this incorrectly by peeking into the sampler state
unconditionally, which is not correct if the TMU operations don't use
sampler state at all (like PBOs). This was causing us to fail the second
test in this sequence when both tests run back back to back in the same
process:

dEQP-GLES3.functional.texture.shadow.2d.linear.greater_or_equal_depth_component32f
dEQP-GLES3.functional.texture.specification.teximage2d_pbo.rg32f_cube

Here, the first test would setup sampler state for shadow comparisons and
the second test would setup a PBO upload, which would incorrectly pick
up the sampler state to decide about the TMU output size for the PBO
operation.

In V3DV we were doing this right looking through each texture/sampler
instruction and checking if they all involved shadow comparisons or had
relaxed precission, defaulting to 32-bit otherwise.

This special-casing for shadow comparisons also leaks from drivers
into the compiler where we are forced to emit some pieces of sampler
state for 32-bit outputs, so we had to special-case shadow instructions
there as well and we also had a fix for CS textures not having correct
sampler state representing shadow operations too. Finally,
we also had  at least a couple of bugs where forcing 32-bit TMU output
through V3D_DEBUG wasn't correctly forcing shadow comparisons to actually
be 32-bit in all the right places, leading to visual bugs with the
option enabled (Sponza being one example of this). This change eliminates
all of these issues.

Finally, the performance improvement observed from special casing shadow
comparison is negligible, and in specific scenarios it can even be
detrimental to performance due to increased register pressure (Sponza with
PCF filtering set to 4 is an example of this again).

Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8684
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22284>

16 months agovulkan/wsi/display: set pDisplay to NULL on error
Iago Toral Quiroga [Tue, 4 Apr 2023 10:25:11 +0000 (12:25 +0200)]
vulkan/wsi/display: set pDisplay to NULL on error

the spec for vkGetDrmDisplayEXT says:

  "If there is no VkDisplayKHR corresponding to the connectorId on the
   physicalDevice, the returning display must be set to VK_NULL_HANDLE.
   The provided drmFd must correspond to the one owned by the physicalDevice.
   If not, the error code VK_ERROR_UNKNOWN must be returned. (...)
   The given connectorId must be a resource owned by the provided drmFd.
   If not, the error code VK_ERROR_UNKNOWN must be returned"

We were only setting the display pointer to VK_NULL_HANDLE if the provided
drmFd was valid, however, there are CTS tests checking that it is also set
to NULL when it is not.

Fixes the following test on all drivers exposing EXT_acquire_drm_display
(tested with Intel and V3DV):
dEQP-VK.wsi.acquire_drm_display.acquire_drm_display_invalid_fd

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22283>

16 months agov3dv: always acquire display device before checking if we can present
Iago Toral Quiroga [Tue, 4 Apr 2023 08:16:48 +0000 (10:16 +0200)]
v3dv: always acquire display device before checking if we can present

Usually, we postpone acquisition until a swapchain is created, but there are
some cases with display extensions (at least with EXT_acquire_drm_display)
where we need to acquire before a swapchain is ever created.

Fixes various tests in:
dEQP-VK.wsi.acquire_drm_display.*

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22283>

16 months agov3dv: drop unused parameter
Iago Toral Quiroga [Tue, 4 Apr 2023 08:12:02 +0000 (10:12 +0200)]
v3dv: drop unused parameter

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22283>

16 months agollvmpipe: clean-up llvmpipe_get_query_result()
Brian Paul [Tue, 4 Apr 2023 02:53:00 +0000 (20:53 -0600)]
llvmpipe: clean-up llvmpipe_get_query_result()

Get rid of the uint64 result pointer which was used by some query
types.  Handle each switch case with self-contained code.  Remove
unneeded casts.  Use MIN2/MAX2 macros.

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22281>

16 months agollvmpipe: s/unsigned/enum pipe_query_type/
Brian Paul [Tue, 4 Apr 2023 02:28:15 +0000 (20:28 -0600)]
llvmpipe: s/unsigned/enum pipe_query_type/

Note we should do the same for pipe_context::create_query()'s
query_type parameter.  That would touch quite a few files.

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22281>

16 months agollvmpipe: s/tabs/spaces/
Brian Paul [Mon, 3 Apr 2023 20:49:10 +0000 (14:49 -0600)]
llvmpipe: s/tabs/spaces/

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22281>

16 months agollvmpipe: rename some vars related to occlusion query and ps invocations
Brian Paul [Mon, 3 Apr 2023 20:47:53 +0000 (14:47 -0600)]
llvmpipe: rename some vars related to occlusion query and ps invocations

More consistent naming.

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22281>

16 months agollvmpipe: fix ps invocations query bug
Brian Paul [Tue, 4 Apr 2023 02:23:51 +0000 (20:23 -0600)]
llvmpipe: fix ps invocations query bug

We were not initializing the PS invocation count to zero before
computing the sum of the per-thread results.

This fixes an issue where querying the result of the query more
than once would cause the result to grow larger each time.

Signed-off-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22281>

16 months agoiris: report draw count for perfetto
Felix DeGrood [Tue, 4 Apr 2023 16:41:54 +0000 (16:41 +0000)]
iris: report draw count for perfetto

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22296>

16 months agoci: remove unused rules
Erik Faye-Lund [Mon, 3 Apr 2023 11:40:16 +0000 (13:40 +0200)]
ci: remove unused rules

These are no longer used.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22263>

16 months agovirgl/ci: clean up manual rules for virgl
Erik Faye-Lund [Mon, 3 Apr 2023 11:31:56 +0000 (13:31 +0200)]
virgl/ci: clean up manual rules for virgl

In f6c06ef2f66 ("ci: Add manual rules variations to disable irrelevant
driver jobs."), we fixed this for *most* driver. This fixes up the last
driver, hopefully removing an annoying needless button in the UI for
some MRs.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22263>

16 months agoci: move virgl-rules after intel-rules
Erik Faye-Lund [Mon, 3 Apr 2023 12:17:07 +0000 (14:17 +0200)]
ci: move virgl-rules after intel-rules

We're about to add a dependency on stuff from the intel-rules, and
moving virgl down here allows us to depend on them without having to
move the definition out of the intel-section.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Acked-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22263>

16 months agozink: rework choose_pdev (again)
Mike Blumenkrantz [Wed, 29 Mar 2023 13:16:18 +0000 (09:16 -0400)]
zink: rework choose_pdev (again)

there are two cases to be handled here:
* normal
* software

the latter case requires env vars based on the frontend, and if a sw
device isn't found then init should fail

the former case should (in theory) just yolo the first device and assume
that's what the user wanted based on whatever env vars and layers are
in use

fixes #7508, #7132

maybe also affects #8152

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

16 months agoRevert "microsoft/compiler: Use SRVs for read-only images"
Pedro J. Estébanez [Tue, 4 Apr 2023 18:27:09 +0000 (20:27 +0200)]
Revert "microsoft/compiler: Use SRVs for read-only images"

This reverts commit 54c32aeba6300f5cafc2bae18020398645925969.

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

16 months agospirv: Assume input attachments are read-only
Pedro J. Estébanez [Tue, 4 Apr 2023 18:26:36 +0000 (20:26 +0200)]
spirv: Assume input attachments are read-only

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

16 months agospirv2dxil: Split read-only image as SRV logic into declared and inferred
Pedro J. Estébanez [Tue, 4 Apr 2023 16:51:42 +0000 (18:51 +0200)]
spirv2dxil: Split read-only image as SRV logic into declared and inferred

Fixes: e0a090ad ("spirv2dxil: Only lower readonly images to SRVs when the option is set")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22289>

16 months agodzn: Claim fillModeNonSolid
Jesse Natalie [Fri, 31 Mar 2023 19:56:51 +0000 (12:56 -0700)]
dzn: Claim fillModeNonSolid

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

16 months agodzn: Handle polygon point mode
Jesse Natalie [Mon, 3 Apr 2023 22:18:07 +0000 (15:18 -0700)]
dzn: Handle polygon point mode

Note: The meaning of clockwise vs counter-clockwise changes after the
yz flip, therefore the determination of winding needs to be done before
the yz flip logic. Therefore the yz flip is moved to the GS and applied
as a lowering on top of the base GS.

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

16 months agodzn: Add a helper to generate triangle->point GS
Jesse Natalie [Mon, 3 Apr 2023 22:17:45 +0000 (15:17 -0700)]
dzn: Add a helper to generate triangle->point GS

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

16 months agospirv2dxil: Expose yz flip pass to external callers
Jesse Natalie [Mon, 3 Apr 2023 22:16:09 +0000 (15:16 -0700)]
spirv2dxil: Expose yz flip pass to external callers

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

16 months agod3d12: Move forward-front-face pass to common DXIL code
Jesse Natalie [Mon, 3 Apr 2023 22:56:26 +0000 (15:56 -0700)]
d3d12: Move forward-front-face pass to common DXIL code

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

16 months agor600: fix typo that could lead to a possible crash
Patrick Lerda [Sat, 25 Mar 2023 20:52:27 +0000 (21:52 +0100)]
r600: fix typo that could lead to a possible crash

For instance, with "piglit/bin/arb_shader_image_load_store-host-mem-barrier --quick -auto -fbo":
==18549==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61200000a059 at pc 0x7f65d8937b80 bp 0x7fff6ed19a00 sp 0x7fff6ed199f8
READ of size 1 at 0x61200000a059 thread T0
    #0 0x7f65d8937b7f in evergreen_set_shader_images ../src/gallium/drivers/r600/evergreen_state.c:4277
    #1 0x7f65d6b471b8 in st_bind_images ../src/mesa/state_tracker/st_atom_image.c:172
    #2 0x7f65d6b76b26 in st_validate_state ../src/mesa/state_tracker/st_util.h:129
    #3 0x7f65d6b76b26 in prepare_draw ../src/mesa/state_tracker/st_draw.c:88
    #4 0x7f65d6b77c8a in st_draw_gallium ../src/mesa/state_tracker/st_draw.c:141
    #5 0x7f65d72698a2 in _mesa_draw_arrays ../src/mesa/main/draw.c:1202

Fixes: a6b379284365 ("r600: add core pieces of image support.")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22273>

16 months agovc4/ci: add arm64 failure to flakes as it works on armhf
Eric Engestrom [Tue, 4 Apr 2023 17:09:25 +0000 (18:09 +0100)]
vc4/ci: add arm64 failure to flakes as it works on armhf

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

16 months agogallium/pipe: change PIPE_DEFAULT_DECODER_FEEDBACK_TIMEOUT_NS to 1 second
Sonny Jiang [Mon, 3 Apr 2023 15:58:29 +0000 (11:58 -0400)]
gallium/pipe: change PIPE_DEFAULT_DECODER_FEEDBACK_TIMEOUT_NS to 1 second

Fixes: 5e1bd07a ("radeonsi: vcn: implement the get_decoder_fence vfunc")
The commit [5e1bd07a] puts a timeout on fence_wait which causes a 8k AV1
decoding regression on gfx940. By adding DECODER_FEEDBACK_TIMEOUT to
add fence wait time.

Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22268>

16 months agodocs: Claim less functionality for glsl_compiler.
Emma Anholt [Mon, 3 Apr 2023 17:16:10 +0000 (10:16 -0700)]
docs: Claim less functionality for glsl_compiler.

It doesn't generate GPU code, just GLSL IR code.  Also, clarify where to
find the built tool, and what the options do.

Closes: #8674
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22271>

16 months agoci: Add missing dependency on doxygen sources for docs-generation jobs.
Emma Anholt [Mon, 3 Apr 2023 21:15:04 +0000 (14:15 -0700)]
ci: Add missing dependency on doxygen sources for docs-generation jobs.

!22191 broke docs generation and marge didn't notice because of missing
 deps.

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

16 months agodocs: Update Vulkan renderpass docs for !22191
Emma Anholt [Mon, 3 Apr 2023 21:19:12 +0000 (14:19 -0700)]
docs: Update Vulkan renderpass docs for !22191

Fixes: 6ad5f885afef ("vulkan: Drop VkRenderingSelfDependencyInfoMESA")
Closes: #8773
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22271>

16 months agoi915: hook new get_fd proc for drm winsys
Ryan Neph [Tue, 4 Apr 2023 16:11:56 +0000 (09:11 -0700)]
i915: hook new get_fd proc for drm winsys

Fixes: 853b4801f27 ("i915: Add support for `get_screen_fd`")
Signed-off-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22294>

16 months agovirgl: hook new get_fd proc for drm winsys
Ryan Neph [Tue, 4 Apr 2023 15:15:14 +0000 (08:15 -0700)]
virgl: hook new get_fd proc for drm winsys

Fixes: 2ade6917dacb ("virgl: Add support for `get_screen_fd`")
Signed-off-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22292>

16 months agoradv: update PS num_vgprs in case of epilogs rather than overallocating VGPRs
Daniel Schürmann [Mon, 3 Apr 2023 10:15:36 +0000 (12:15 +0200)]
radv: update PS num_vgprs in case of epilogs rather than overallocating VGPRs

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

16 months agoaco: don't use shared VGPRs for shaders consisting of multiple binaries
Daniel Schürmann [Mon, 3 Apr 2023 09:14:49 +0000 (11:14 +0200)]
aco: don't use shared VGPRs for shaders consisting of multiple binaries

When using multiple binaries, we don't know the required number of VGPRs beforehand,
which means we either have to over-allocate VGPRs or avoid shared VGPRs.
As bpermute is the only instructions needing shared VGPRs, we decide for the latter.

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

16 months agoaco/ra: adjust_max_used_regs() for fixed Operands
Daniel Schürmann [Mon, 3 Apr 2023 16:16:50 +0000 (18:16 +0200)]
aco/ra: adjust_max_used_regs() for fixed Operands

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

16 months agoaco: split ps_epilog args before exporting them
Daniel Schürmann [Tue, 14 Mar 2023 10:24:34 +0000 (11:24 +0100)]
aco: split ps_epilog args before exporting them

This avoids some unnecessary copies from extracting from the input vectors.

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

16 months agoanv: Drop dead code that sets the L3BypassDisable field
Sagar Ghuge [Tue, 28 Mar 2023 20:03:15 +0000 (13:03 -0700)]
anv: Drop dead code that sets the L3BypassDisable field

These helper functions will only get invoked for GFX < 11 and the
L3BypassDisable field is present starting from GFX12+.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22275>

16 months agoanv: Drop unused param from add_surface_reloc
Sagar Ghuge [Sun, 2 Apr 2023 05:08:24 +0000 (22:08 -0700)]
anv: Drop unused param from add_surface_reloc

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22275>

16 months agoci/zink: Disable godot-tps-gles3 on a630.
Emma Anholt [Tue, 4 Apr 2023 15:04:34 +0000 (08:04 -0700)]
ci/zink: Disable godot-tps-gles3 on a630.

This trace used too much memory to be run in parallel with our other
traces.

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

16 months agoUprev Piglit to 2391a83d1639a7ab7bbea02853b922878687b0e5
Collabora's Gfx CI Team [Sun, 2 Apr 2023 00:06:41 +0000 (00:06 +0000)]
Uprev Piglit to 2391a83d1639a7ab7bbea02853b922878687b0e5

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

16 months agoradv: enable shaders cache for libraries with GPL
Samuel Pitoiset [Fri, 6 Jan 2023 08:01:12 +0000 (09:01 +0100)]
radv: enable shaders cache for libraries with GPL

This was the last missing feature for GPL. The main problem is that
the on-disk shaders cache size will increase a lot because we don't
deduplicate shaders but there is on-going work to improve that.

We also can't use the shaders cache for libraries created with the
RETAIN_LINK_TIME_OPTIMIZATION flag and module identifiers because we
don't know the SPIR-V and thus can't retain NIR shaders for linking.

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

16 months agoradv: ensure to retain NIR shaders for GPL libs found in the cache
Samuel Pitoiset [Mon, 3 Apr 2023 08:12:25 +0000 (10:12 +0200)]
radv: ensure to retain NIR shaders for GPL libs found in the cache

Even if we are able to get the assembly from the shaders cache for
graphics pipeline libraries, we still need to retain NIR shaders in
case the LTO pipelines won't be find in the cache.

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

16 months agoradv: add VkGraphicsPipelineLibraryFlag to the graphics pipeline key
Samuel Pitoiset [Fri, 31 Mar 2023 14:30:09 +0000 (16:30 +0200)]
radv: add VkGraphicsPipelineLibraryFlag to the graphics pipeline key

This is to generate a different key for a library created with
FRAGMENT_SHADER_BIT and no FS (ie. it would generate a noop FS) and
a library created with FRAGMENT_OUTPUT_INTERFACE with no CB attachments.

Otherwise, the same key would be generated and this would corrupt
the cache.

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

16 months agoradv: remove dead code in radv_pipeline_get_nir()
Samuel Pitoiset [Mon, 3 Apr 2023 08:46:03 +0000 (10:46 +0200)]
radv: remove dead code in radv_pipeline_get_nir()

We either import the NIR or the assembly, so this was never reached.

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

16 months agoradv: allow to create/insert PS epilogs from/to the cache for libs
Samuel Pitoiset [Mon, 3 Apr 2023 08:11:21 +0000 (10:11 +0200)]
radv: allow to create/insert PS epilogs from/to the cache for libs

To cache PS epilogs compiled inside graphics pipeline libraries.

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

16 months agoradv: rely on non-NULL binaries when inserting shaders to the cache
Samuel Pitoiset [Fri, 6 Jan 2023 08:27:30 +0000 (09:27 +0100)]
radv: rely on non-NULL binaries when inserting shaders to the cache

With GPL, a stage can be imported from a library which means that the
binary is NULL (it's freed right after compilation) but the shader is
non-NULL. To avoid crashing, rely on non-NULL binaries because this
implies that the shader is non-NULL as well.

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

16 months agoradv: only copy non-NULL shaders when loaded from the cache
Samuel Pitoiset [Thu, 5 Jan 2023 16:58:45 +0000 (17:58 +0100)]
radv: only copy non-NULL shaders when loaded from the cache

With GPL, we don't necessarily load all stages from the same cache
entry and other stages might have been imported from libraries, so
don't overwrite them.

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

16 months agonir, spirv: Add support for VK_EXT_fragment_density_map
Connor Abbott [Fri, 25 Nov 2022 11:41:46 +0000 (12:41 +0100)]
nir, spirv: Add support for VK_EXT_fragment_density_map

This involves two new system values.

Reviewed-by: Faith Ekstrand <faith@gfxstrand.net>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20303>

16 months agoci/zink: Drop validation exception for leaks at device destroy.
Emma Anholt [Tue, 7 Feb 2023 18:09:17 +0000 (10:09 -0800)]
ci/zink: Drop validation exception for leaks at device destroy.

Between the recent glthread and zink fixes, we should be good to go.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22237>

16 months agoradeonsi: update test results
Pierre-Eric Pelloux-Prayer [Fri, 31 Mar 2023 15:34:58 +0000 (17:34 +0200)]
radeonsi: update test results

This test was fixed by bf910c94e06 ("glsl: fix gl_CullDistance lowering
from float[8] to vec4[2]").

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22237>

16 months agoutil/vbuf: fix index_bo leak
Pierre-Eric Pelloux-Prayer [Fri, 31 Mar 2023 15:01:53 +0000 (17:01 +0200)]
util/vbuf: fix index_bo leak

When indices are unrolled we still have to release the index_bo
references passed to us.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8272
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22237>

16 months agoutil/vbuf: clarify indirect draws handling
Pierre-Eric Pelloux-Prayer [Fri, 31 Mar 2023 14:59:32 +0000 (16:59 +0200)]
util/vbuf: clarify indirect draws handling

It wasn't obvious from the u_vbuf code alone that num_draws
is guaranteed to be 1 in the indirect case.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22237>

16 months agomesa: fix invalid index_bo refcounting
Pierre-Eric Pelloux-Prayer [Fri, 31 Mar 2023 14:57:08 +0000 (16:57 +0200)]
mesa: fix invalid index_bo refcounting

If take_index_buffer_ownership is true, then we should reserve
enough references of index_bo or we'll get an underflow later.

Fixes: 819627041e7 ("mesa: set pipe_draw_info::index::resource directly and remove gl_bo")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8747
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22237>

16 months agozink: be explicit about separate shader dsl indexing during creation
Mike Blumenkrantz [Mon, 3 Apr 2023 16:45:11 +0000 (12:45 -0400)]
zink: be explicit about separate shader dsl indexing during creation

this fixes a minor issue where a fs without a vs dsl would have the wrong
index

Fixes: e3b746e3a31 ("zink: use GPL to handle (simple) separate shader objects")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22269>

16 months agoanv: check for MESA_SHADER_TESS_CTRL with get_tcs_prog_data
Tapani Pälli [Tue, 4 Apr 2023 07:15:29 +0000 (10:15 +0300)]
anv: check for MESA_SHADER_TESS_CTRL with get_tcs_prog_data

Fixes: 86d931724db ("anv: Implement Wa_14015297576")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22282>

16 months agoanv: take primitive ID override to account Wa_14015297576
Tapani Pälli [Tue, 4 Apr 2023 05:40:34 +0000 (08:40 +0300)]
anv: take primitive ID override to account Wa_14015297576

Commit ca4ec49b0e0 took primitive ID override fields in to use, this
has to be checked as part of Wa_14015297576.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22282>

16 months agozink: always store nir serialized
Mike Blumenkrantz [Wed, 29 Mar 2023 11:47:43 +0000 (07:47 -0400)]
zink: always store nir serialized

this saves a ton of memory and has minimal, if any cpu impact

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

16 months agozink: store num_inlinable_uniforms separately for cs programs
Mike Blumenkrantz [Wed, 29 Mar 2023 12:40:14 +0000 (08:40 -0400)]
zink: store num_inlinable_uniforms separately for cs programs

compute is a special case because the zink_shader itself is created
in a thread, which means it cannot be accessed directly at bind time
since it may not have finished creating itself yet

to avoid prematurely waiting on an async fence, the one value needed
at bind time can instead be stored separately

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

16 months agozink: move nir cloning out to callers of zink_shader_compile
Mike Blumenkrantz [Wed, 29 Mar 2023 12:10:51 +0000 (08:10 -0400)]
zink: move nir cloning out to callers of zink_shader_compile

this will make more sense with future changes

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

16 months agozink: break out nir blob deserializing
Mike Blumenkrantz [Wed, 29 Mar 2023 12:08:00 +0000 (08:08 -0400)]
zink: break out nir blob deserializing

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

16 months agozink: simplify assign_io() further
Mike Blumenkrantz [Wed, 29 Mar 2023 11:46:10 +0000 (07:46 -0400)]
zink: simplify assign_io() further

no functional changes

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

16 months agozink: store nir as serialized on zink_shader structs
Mike Blumenkrantz [Tue, 28 Mar 2023 22:52:31 +0000 (18:52 -0400)]
zink: store nir as serialized on zink_shader structs

nir_shader objects are hefty, and they really add up when there's a lot
of them. there's also not much use in keeping them around, as any time
they'll be used, they're always cloned first, and deserializing isn't
likely to be any slower than a clone

cuts driver memory usage by ~40% for tomb raider

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

16 months agozink: streamline nir cloning for assign_io
Mike Blumenkrantz [Tue, 28 Mar 2023 22:51:42 +0000 (18:51 -0400)]
zink: streamline nir cloning for assign_io

more relics from the time of pipe_shader_type

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

16 months agozink: directly return nir from zink_shader_tcs_create
Mike Blumenkrantz [Wed, 29 Mar 2023 12:18:04 +0000 (08:18 -0400)]
zink: directly return nir from zink_shader_tcs_create

not currently used but will be

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

16 months agozink: swap nir pointers when compiling compute shaders
Mike Blumenkrantz [Tue, 28 Mar 2023 22:47:08 +0000 (18:47 -0400)]
zink: swap nir pointers when compiling compute shaders

these are the same pointer, just use a different one

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

16 months agozink: pass nir directly to zink_shader_tcs_create()
Mike Blumenkrantz [Tue, 28 Mar 2023 22:46:02 +0000 (18:46 -0400)]
zink: pass nir directly to zink_shader_tcs_create()

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

16 months agozink: simplify fbfetch output detection from fs
Mike Blumenkrantz [Tue, 28 Mar 2023 22:43:18 +0000 (18:43 -0400)]
zink: simplify fbfetch output detection from fs

this should be identical to the previous code, except it also
handles depth/stencil (not yet supported)

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

16 months agozink: use zink_shader::info instead of zink_shader::nir::info
Mike Blumenkrantz [Tue, 28 Mar 2023 22:42:44 +0000 (18:42 -0400)]
zink: use zink_shader::info instead of zink_shader::nir::info

no functional changes

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

16 months agozink: generate flat_flags during shader creation
Mike Blumenkrantz [Wed, 29 Mar 2023 20:53:52 +0000 (16:53 -0400)]
zink: generate flat_flags during shader creation

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