platform/upstream/mesa.git
13 months agodzn: Fix multisample counts in device limits
Jesse Natalie [Wed, 14 Jun 2023 19:29:13 +0000 (12:29 -0700)]
dzn: Fix multisample counts in device limits

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

13 months agodzn: Remove dynamic check for block-compressed support
Jesse Natalie [Wed, 14 Jun 2023 19:11:24 +0000 (12:11 -0700)]
dzn: Remove dynamic check for block-compressed support

None of this is optional in D3D

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

13 months agodzn: Use common GetPhysicalDeviceFeatures2
Jesse Natalie [Wed, 14 Jun 2023 19:07:57 +0000 (12:07 -0700)]
dzn: Use common GetPhysicalDeviceFeatures2

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

13 months agodzn: Inline D3D12 device creation in physical device creation
Jesse Natalie [Wed, 14 Jun 2023 18:57:18 +0000 (11:57 -0700)]
dzn: Inline D3D12 device creation in physical device creation

This was effectively happening *anyway* because WSI init was calling
functions that needed a D3D12 device around to be able to answer.
Just remove the whole song and dance of maybe not having a device.

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

13 months agoutil: reinstate ENUM_PACKED
Michel Zou [Tue, 6 Jun 2023 19:18:17 +0000 (21:18 +0200)]
util: reinstate ENUM_PACKED

gets rid of warning: 'gcc_struct' attribute ignored [-Wattributes] introduced by !23338

Fixes: 86532fa21de ("util: Use the gcc_struct attribute for packed structures in mingw")
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23478>

13 months agoegl/haiku: Fix potential crash if double buffering is disabled
Alexander von Gluck IV [Fri, 9 Jun 2023 16:48:44 +0000 (11:48 -0500)]
egl/haiku: Fix potential crash if double buffering is disabled

* Don't assume the existence of the back buffer in swap_buffers

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

13 months agoci: mark the valve farm as down
Eric Engestrom [Wed, 21 Jun 2023 20:34:25 +0000 (21:34 +0100)]
ci: mark the valve farm as down

docker daemon is down on mupuf-gfx10-vangogh-{1..3}

Signed-off-by: Eric Engestrom <eric@igalia.com>
13 months agointel/fs: Add missing newline
Ian Romanick [Wed, 21 Jun 2023 14:51:00 +0000 (07:51 -0700)]
intel/fs: Add missing newline

Emacs will add a newline to the end of this file whether I've edited
that line or not. It was driving me up the wall, so... yeah.

Trivial.

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

13 months agoradv: inline radv_can_enable_dual_src()
Mike Blumenkrantz [Thu, 8 Jun 2023 19:05:46 +0000 (15:05 -0400)]
radv: inline radv_can_enable_dual_src()

this is unexpectedly heavy

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

13 months agoradv: remove redundant intermediate variable in radv_is_mrt0_dual_src()
Mike Blumenkrantz [Thu, 8 Jun 2023 19:02:40 +0000 (15:02 -0400)]
radv: remove redundant intermediate variable in radv_is_mrt0_dual_src()

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

13 months agodzn: Ignore export access parameters
Jesse Natalie [Wed, 21 Jun 2023 15:39:02 +0000 (08:39 -0700)]
dzn: Ignore export access parameters

D3D requires these to just be GENERIC_ALL. Fixes some sharing tests.

Fixes: c64f1b66 ("dzn: Hook up win32 semaphore import/export")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23772>

13 months agoasahi: drop unnecessary DRM_FORMAT_MOD_{LINEAR,INVALID} fallbacks
Eric Engestrom [Wed, 21 Jun 2023 14:22:39 +0000 (15:22 +0100)]
asahi: drop unnecessary DRM_FORMAT_MOD_{LINEAR,INVALID} fallbacks

Since afe134a49c ("asahi: Drop macOS backend"), `drm_fourcc.h` is
unconditionally included, meaning these defines are now dead code.

Fixes: afe134a49c5ef79ca612 ("asahi: Drop macOS backend")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23773>

13 months agoaco: don't set exec_hi for wave32 scan reductions
Rhys Perry [Tue, 20 Jun 2023 13:31:55 +0000 (14:31 +0100)]
aco: don't set exec_hi for wave32 scan reductions

fossil-db (wave32):
Totals from 21 (0.02% of 133428) affected shaders:
Instrs: 10778 -> 10712 (-0.61%)
CodeSize: 56604 -> 56208 (-0.70%)
Latency: 168293 -> 168251 (-0.02%)
InvThroughput: 25256 -> 25253 (-0.01%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23745>

13 months agopvr: Fix csb control stream extension
Karmjit Mahil [Tue, 6 Jun 2023 10:51:01 +0000 (11:51 +0100)]
pvr: Fix csb control stream extension

Previously we reserved space for a stream link and whenever we ran
out of space in the current bo, allocated a new one, and emitted a
link to it. This is problematic as stream links can only be emitted
at state update boundaries so the handling could have produced a
corrupted control stream.

That's fixed by using a `relocation_mark` set by the driver to
indicate where a state update was last started, so csb can relocate
the whole update into the new bo and link to it.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23520>

13 months agointel/fs: Constant propagate into SHADER_OPCODE_SHUFFLE
Ian Romanick [Wed, 7 Jun 2023 17:57:47 +0000 (10:57 -0700)]
intel/fs: Constant propagate into SHADER_OPCODE_SHUFFLE

Code already exists to convert SHADER_OPCODE_SHUFFLE into a simple MOV
when either source is constant. However... the constants have to
actually get into those sources!

On a shader that I'm working on that multiplies very large matrices using
lots of subgroup operations,

-SIMD8 shader: 1378 instructions. 3 loops. 793896 cycles. 0:0 spills:fills, 23 sends, scheduled with mode non-lifo. Promoted 0 constants. Compacted 22048 to 21664 bytes (2%)
+SIMD8 shader: 346 instructions. 3 loops. 61742 cycles. 0:0 spills:fills, 23 sends, scheduled with mode top-down. Promoted 0 constants. Compacted 5536 to 5216 bytes (6%)

No changes in shader-db or fossil-db on any Intel platform.

v2: Merge a bunch of identical cases. Suggested by Ken.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com> [v1]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23609>

13 months agopvr: Fix dynamic offset patching
Karmjit Mahil [Fri, 9 Jun 2023 11:53:20 +0000 (12:53 +0100)]
pvr: Fix dynamic offset patching

Previously the set of dynamic offsets were being reused per each
binding. That's now fixed, by using an offset to determine where
each binding's dynamic offsets reside.

Tests fixed:
  dEQP-VK.binding_model.descriptor_copy.{compute,graphics}
    .{uniform,storage}_buffer_dynamic_0

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Fixes: aa791961a82e ("pvr: Add support for dynamic buffers descriptors")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23587>

13 months agopvr: Fix barrier insertion on merged subpasses
SoroushIMG [Thu, 15 Jun 2023 12:53:56 +0000 (13:53 +0100)]
pvr: Fix barrier insertion on merged subpasses

The driver can merge subpasses within a render pass into a single
hw render. While doing so it makes the assumption that the subpasses
in an hw render will all be submitted in a single job.

On vkCmdPipelineBarrier() the driver was previously incorrectly
inserting an event sub-cmd on a merged subpass, breaking that
assumption leading to incorrect values for input attachments.

Signed-off-by: Soroush Kashani <soroush.kashani@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Fixes: 6d672e033683 ("pvr: Add initial vkCmdPipelineBarrier skeleton.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23693>

13 months agopvr: Fix seg fault on empty descriptor set
Karmjit Mahil [Thu, 15 Jun 2023 14:47:38 +0000 (15:47 +0100)]
pvr: Fix seg fault on empty descriptor set

Vulkan allows empty descriptor sets to be created. When we setup
the descriptor set addresses table we fill in the address of the
`bo` for each valid/currently bound desc set. For empty desc sets
there is no `bo` which was causing a seg fault. Now skip them,
leaving their address set to `~0`.

Reported-by: Simon Perretta <simon.perretta@imgtec.com>
Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Fixes: ce67f5ac944 ("pvr: Write descriptor set addrs table dev addr into shareds")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23692>

13 months agoradv: Move most of DB_SHADER_CONTROL to PS, more precise GFX11 blend WA
Vitaliy Triang3l Kuzmin [Mon, 3 Apr 2023 19:28:36 +0000 (22:28 +0300)]
radv: Move most of DB_SHADER_CONTROL to PS, more precise GFX11 blend WA

Move most of the DB_SHADER_CONTROL fields from the pipeline to the pixel
shader for preparation for shader objects.

Also, the GFX11 export conflict bug workaround doesn't need to be enabled
for non-1x sample counts or if blending is not enabled, so make the
application of DB_SHADER_CONTROL consider the current sample count and
blending state even if they're dynamic.

Having access to the exact sample count in DB_SHADER_CONTROL setup is also
necessary for good performance in SampleInterlock execution modes of
fragment shader interlock, for configuration of POPS_OVERLAP_NUM_SAMPLES
(GFX9-10.3) or OVERRIDE_INTRINSIC_RATE (GFX11), as PixelInterlock is
massively slower with multisampling due to overlap between adjacent
polygons sharing covered pixels among the common edge.

The name of the dynamic state controlling DB_SHADER_CONTROL is now
unambiguous - previously line rasterization mode had effect on attachment
feedback loop state emission.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23474>

13 months agoisl: add surface creation reporting mechanism
Lionel Landwerlin [Fri, 3 Dec 2021 10:11:02 +0000 (12:11 +0200)]
isl: add surface creation reporting mechanism

We have a number of users reporting surface creation issues with
modifiers etc...

This makes Anv & Iris printout the reason of the failure with
INTEL_DEBUG=isl Failure example in Iris :

MESA: debug: ISL surface failed: ../src/intel/isl/isl.c:1729: requested row pitch (42B) less than minimum alignment requirement (1024B) extent=160x160x1 dim=2d msaa=1x levels=1 rpitch=42 fmt=B8G8R8X8_UNORM usage=+rt+tex+disp

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14039>

13 months agoisl: assert on gfx8 condition that should not be met
Lionel Landwerlin [Wed, 14 Jun 2023 12:34:12 +0000 (15:34 +0300)]
isl: assert on gfx8 condition that should not be met

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14039>

13 months agoisl: assert on gfx7 condition that should not be met
Lionel Landwerlin [Thu, 21 Jul 2022 12:52:19 +0000 (15:52 +0300)]
isl: assert on gfx7 condition that should not be met

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14039>

13 months agoisl: assert on gfx6 condition that should not be met
Lionel Landwerlin [Mon, 7 Mar 2022 08:44:57 +0000 (10:44 +0200)]
isl: assert on gfx6 condition that should not be met

Those 2 cases should have been handled earlier.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14039>

13 months agozink: radv vangogh ci updates
Mike Blumenkrantz [Wed, 21 Jun 2023 11:57:38 +0000 (07:57 -0400)]
zink: radv vangogh ci updates

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

13 months agozink: always clamp NUM_QUERIES to 500
Mike Blumenkrantz [Mon, 19 Jun 2023 20:55:36 +0000 (16:55 -0400)]
zink: always clamp NUM_QUERIES to 500

this avoids ooming on some weaker GPUs with big query energy

cc: mesa-stable

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

13 months agozink: recache present semaphores
Mike Blumenkrantz [Wed, 14 Jun 2023 19:46:09 +0000 (15:46 -0400)]
zink: recache present semaphores

this otherwise depletes the entire cache

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

13 months agozink: acquire persistently bound swapchain descriptors before setting usage
Mike Blumenkrantz [Mon, 19 Jun 2023 15:05:13 +0000 (11:05 -0400)]
zink: acquire persistently bound swapchain descriptors before setting usage

if a swapchain image is bound as a sampler across batches then it needs
to be acquired again before it is used

cc: mesa-stable

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

13 months agozink: fix ubo array sizing in ntv
Mike Blumenkrantz [Mon, 19 Jun 2023 14:30:58 +0000 (10:30 -0400)]
zink: fix ubo array sizing in ntv

there are only 2 ubos that can be emitted, except the emitted ubos
can start at an offset based on the first-used ubo, which means this
has to support the full range of ubo indices

fixes oob access in game Beyond All Reason

cc: mesa-stable

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

13 months agovulkan/video: consider removed bits when calculating the size of comsumed data.
Hyunjun Ko [Fri, 16 Jun 2023 06:12:27 +0000 (15:12 +0900)]
vulkan/video: consider removed bits when calculating the size of comsumed data.

Closes: mesa/mesa#9170

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23688>

13 months agoutil/rbsp: keep track of removed bits for the emulation
Hyunjun Ko [Fri, 16 Jun 2023 06:09:11 +0000 (15:09 +0900)]
util/rbsp: keep track of removed bits for the emulation
 prevention three bytes.

This is needed for the next patch to fix a way to get how much data
is comsumed in rbsp by considering cases of removed bits for emulation
prevention three bytes.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23688>

13 months agovulkan/video: move parsing longterm rps in h265 slice parsing.
Hyunjun Ko [Thu, 15 Jun 2023 06:41:20 +0000 (15:41 +0900)]
vulkan/video: move parsing longterm rps in h265 slice parsing.

It was just by mistake.

Fixes: efdcacb230 ("vulkan/video: add to parse h265 slice.")

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23688>

13 months agovulkan/video: adds more conditions for setting loop_filter_across_slices_enable in...
Hyunjun Ko [Thu, 15 Jun 2023 06:38:18 +0000 (15:38 +0900)]
vulkan/video: adds more conditions for setting loop_filter_across_slices_enable in h265 slice parsing.

Fixes: efdcacb230 ("vulkan/video: add to parse h265 slice.")

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23688>

13 months agoradv/rt: Store the prolog outside the shaders array
Konstantin Seurer [Tue, 20 Jun 2023 16:19:57 +0000 (18:19 +0200)]
radv/rt: Store the prolog outside the shaders array

Avoids including it in executable statistics queries.

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

13 months agoradv: Use _mesa_shader_stage_to_string for executable name
Konstantin Seurer [Thu, 8 Jun 2023 14:07:41 +0000 (16:07 +0200)]
radv: Use _mesa_shader_stage_to_string for executable name

We can not use it for all stages because RADV has some special stages
and shader-db doesn't handle all stages.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23524>

13 months agoradv: Implement executable properties for ray tracing stages
Konstantin Seurer [Thu, 8 Jun 2023 13:58:19 +0000 (15:58 +0200)]
radv: Implement executable properties for ray tracing stages

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23524>

13 months agoradv: Use get_shader_from_executable_index for executable properties
Konstantin Seurer [Thu, 8 Jun 2023 13:25:24 +0000 (15:25 +0200)]
radv: Use get_shader_from_executable_index for executable properties

This will make handling ray tracing pipelines easier.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23524>

13 months agoradv: Adjust the traversal shader description
Konstantin Seurer [Thu, 8 Jun 2023 13:24:34 +0000 (15:24 +0200)]
radv: Adjust the traversal shader description

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23524>

13 months agoradv: Move the shader type to radv_shader_info
Konstantin Seurer [Thu, 8 Jun 2023 13:22:56 +0000 (15:22 +0200)]
radv: Move the shader type to radv_shader_info

Since the default value is 0, this removes some boilerplate.
Moving it to the shader info also makes it accessible using
radv_shader.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23524>

13 months agointel/compiler: add more validation for acc register usage
Tapani Pälli [Wed, 8 Mar 2023 11:21:48 +0000 (13:21 +0200)]
intel/compiler: add more validation for acc register usage

This is described in Wa_14014617373 and a programming note has
been added to specification.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23682>

13 months agoradv: enable NV_device_generated_commands on GFX6
Samuel Pitoiset [Tue, 20 Jun 2023 12:25:13 +0000 (14:25 +0200)]
radv: enable NV_device_generated_commands on GFX6

Now that GFX6 supports IBs, DGC can also be enabled.
Pass all vkd3d-proton tests on Pitcairn.

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

13 months agoradv: implement padding cmdbuffer for DGC on GFX6
Samuel Pitoiset [Tue, 20 Jun 2023 12:24:30 +0000 (14:24 +0200)]
radv: implement padding cmdbuffer for DGC on GFX6

GFX6 only supports PKT2_NOP_PAD.

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

13 months agoutil: Fixes prototype of threads_timespec_compare
Yonggang Luo [Tue, 20 Jun 2023 18:49:39 +0000 (02:49 +0800)]
util: Fixes prototype of threads_timespec_compare

using const struct timespec * is enough

Fixes: 45bd24708a9 ("c11: Improve mtx_timedlock to use timespec_get instead of time(NULL)")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9230

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23753>

13 months agoradv/video: drop incorrect defines for uapi ones.
Dave Airlie [Wed, 21 Jun 2023 00:33:32 +0000 (10:33 +1000)]
radv/video: drop incorrect defines for uapi ones.

I missed there's an off by one, and found the kernel defined
the correct bits, so just use that.

Fixes: 9477f117f4d4 ("radv/video: add initial frameworking.")
Reviewed-by: Lynne <dev@lynne.ee>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23757>

13 months agointel/stub_gpu: Don't run program again after using GDB
Ian Romanick [Mon, 19 Jun 2023 23:28:23 +0000 (16:28 -0700)]
intel/stub_gpu: Don't run program again after using GDB

Fixes: c56dd678e48 ("intel/stub_gpu: add an option to launch valgrind")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23736>

13 months agoutil/blitter: fix util_blitter_clear_buffer() refcnt imbalance
Patrick Lerda [Tue, 13 Jun 2023 13:23:53 +0000 (15:23 +0200)]
util/blitter: fix util_blitter_clear_buffer() refcnt imbalance

Indeed, the vertex state was restored using a specific
condition at the util_blitter_restore_vertex_states()
level. This change ensures that the condition is the
same when the vertex state is saved.

The function util_blitter_clear_buffer() is only called
by the r600 driver on pre-evergreen gpus.

This issue is triggered on a rv770 gpu with "piglit/bin/fbo-1d -auto -fbo"
or "piglit/bin/draw_buffers_gles2 -auto -fbo"
while setting GALLIUM_REFCNT_LOG=refcnt.log.

Fixes: 5f566faa4607 ("radeonsi: don't save and restore vertex buffers and elements for u_blitter")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23721>

13 months agozink: only retry bo allocation after reclaim if reclaims actually happened
Mike Blumenkrantz [Wed, 3 May 2023 20:11:37 +0000 (16:11 -0400)]
zink: only retry bo allocation after reclaim if reclaims actually happened

this should cut down on allocation error spam

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

13 months agoaux/pipebuffer: add a return to pb_cache_release_all_buffers()
Mike Blumenkrantz [Wed, 3 May 2023 20:10:08 +0000 (16:10 -0400)]
aux/pipebuffer: add a return to pb_cache_release_all_buffers()

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

13 months agoaux/pipebuffer: add a return to pb_slabs_reclaim()
Mike Blumenkrantz [Wed, 3 May 2023 20:07:34 +0000 (16:07 -0400)]
aux/pipebuffer: add a return to pb_slabs_reclaim()

this lets drivers determine whether any reclaims have happened

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

13 months agointel/compiler: Respect NIR_DEBUG_PRINT_INTERNAL flag
Caio Oliveira [Tue, 20 Jun 2023 21:42:02 +0000 (14:42 -0700)]
intel/compiler: Respect NIR_DEBUG_PRINT_INTERNAL flag

If flag is not set, don't print debugging
information for internal shaders.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23756>

13 months agonir/print: Print whether the shader is internal or not
Caio Oliveira [Tue, 20 Jun 2023 20:56:05 +0000 (13:56 -0700)]
nir/print: Print whether the shader is internal or not

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23756>

13 months agorusticl/memory: fix clippy errors
norablackcat [Tue, 20 Jun 2023 19:56:56 +0000 (13:56 -0600)]
rusticl/memory: fix clippy errors

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

13 months agoaco/gfx11: schedule for VMEM store clauses
Rhys Perry [Wed, 7 Jun 2023 16:08:10 +0000 (17:08 +0100)]
aco/gfx11: schedule for VMEM store clauses

fossil-db (gfx1100):
Totals from 49486 (37.09% of 133428) affected shaders:
Instrs: 18376819 -> 18480712 (+0.57%); split: -0.00%, +0.57%
CodeSize: 91810836 -> 92227292 (+0.45%); split: -0.00%, +0.45%
VGPRs: 2031824 -> 2047784 (+0.79%); split: -0.02%, +0.81%
Latency: 104259318 -> 103804792 (-0.44%); split: -0.44%, +0.00%
InvThroughput: 16388760 -> 16399819 (+0.07%); split: -0.13%, +0.19%
VClause: 568844 -> 432401 (-23.99%)
Copies: 1197942 -> 1231202 (+2.78%); split: -0.08%, +2.86%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23505>

13 months agoaco/gfx11: use s_clause with stores
Rhys Perry [Wed, 7 Jun 2023 16:33:46 +0000 (17:33 +0100)]
aco/gfx11: use s_clause with stores

fossil-db (gfx1100):
Totals from 3535 (2.65% of 133428) affected shaders:
Instrs: 1963996 -> 1968979 (+0.25%)
CodeSize: 10077784 -> 10097716 (+0.20%)
Latency: 13264216 -> 13264741 (+0.00%)
InvThroughput: 2995676 -> 3004083 (+0.28%); split: -0.00%, +0.28%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23505>

13 months agoaco: don't try to form load+store clauses
Rhys Perry [Wed, 7 Jun 2023 16:00:12 +0000 (17:00 +0100)]
aco: don't try to form load+store clauses

fossil-db (gfx1100):
Totals from 79 (0.06% of 133428) affected shaders:
MaxWaves: 1484 -> 1408 (-5.12%)
Instrs: 216290 -> 216255 (-0.02%); split: -0.04%, +0.03%
CodeSize: 1149288 -> 1149148 (-0.01%); split: -0.03%, +0.02%
VGPRs: 7384 -> 7840 (+6.18%)
Latency: 3303521 -> 3305077 (+0.05%); split: -0.05%, +0.10%
InvThroughput: 2716621 -> 2719973 (+0.12%); split: -0.01%, +0.13%
VClause: 5605 -> 6170 (+10.08%)
SClause: 3005 -> 2983 (-0.73%); split: -0.77%, +0.03%
Copies: 33428 -> 33490 (+0.19%); split: -0.07%, +0.26%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23505>

13 months agozink: fix anv ci flake wildcarding
Mike Blumenkrantz [Tue, 20 Jun 2023 17:51:29 +0000 (13:51 -0400)]
zink: fix anv ci flake wildcarding

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

13 months agozink: ZINK_HEAP_HOST_VISIBLE_CACHED -> ZINK_HEAP_HOST_VISIBLE_COHERENT_CACHED
Mike Blumenkrantz [Mon, 19 Jun 2023 15:55:39 +0000 (11:55 -0400)]
zink: ZINK_HEAP_HOST_VISIBLE_CACHED -> ZINK_HEAP_HOST_VISIBLE_COHERENT_CACHED

all host-visible memory in zink is expected to be coherent, and this makes
that expectation more explicit

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

13 months agozink: add COHERENT requirement for CACHED memory
Mike Blumenkrantz [Mon, 19 Jun 2023 14:24:28 +0000 (10:24 -0400)]
zink: add COHERENT requirement for CACHED memory

zink doesn't handle non-coherent cached memory correctly, so ensure
that scenario is never hit

cc: mesa-stable

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

13 months agocompiler: Move spirv into a module of its own
Caio Oliveira [Thu, 15 Jun 2023 05:13:39 +0000 (22:13 -0700)]
compiler: Move spirv into a module of its own

For historical reasons, nir and vtn were compiled together,
and a bunch of vtn specific targets were defined in
src/compiler/meson.build.

Now that we can, make src/compiler/spirv produce an internal
library that depends on NIR, and is used by the drivers/tools.
Also move the vtn specific targets into that directory's
meson.build.

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

13 months agoisl: Add and use size and alignment calculators
Nanley Chery [Fri, 16 Jun 2023 15:45:07 +0000 (11:45 -0400)]
isl: Add and use size and alignment calculators

Instead of interleaving the code for the size and alignment
calculations, split them out into their own functions.

This should make the code easier to follow and avoid some uninitialized
variable warnings.

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

13 months agoaco/gfx10+: use v_cndmask with literal for reduction identity
Georg Lehmann [Fri, 16 Jun 2023 13:07:52 +0000 (15:07 +0200)]
aco/gfx10+: use v_cndmask with literal for reduction identity

Totals from 10 (0.01% of 132657) affected shaders:
CodeSize: 171576 -> 171288 (-0.17%)
Instrs: 32127 -> 32055 (-0.22%)
Latency: 219145 -> 219027 (-0.05%)
InvThroughput: 130287 -> 130041 (-0.19%)

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23695>

13 months agoaco: combine scalar mul+pk_add to pk_fma
Georg Lehmann [Thu, 9 Mar 2023 13:51:50 +0000 (14:51 +0100)]
aco: combine scalar mul+pk_add to pk_fma

Foz-DB Navi21:
Totals from 12 (0.01% of 134913) affected shaders:
CodeSize: 37860 -> 37668 (-0.51%)
Instrs: 6757 -> 6733 (-0.36%)
Latency: 25632 -> 25589 (-0.17%)
InvThroughput: 2637 -> 2622 (-0.57%)

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21819>

13 months agoaco: use uses helpers for pk_fma opt
Georg Lehmann [Thu, 9 Mar 2023 13:17:53 +0000 (14:17 +0100)]
aco: use uses helpers for pk_fma opt

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21819>

13 months agoradv: use wave32 for small workgroups
Rhys Perry [Fri, 9 Jun 2023 14:41:05 +0000 (15:41 +0100)]
radv: use wave32 for small workgroups

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

13 months agoradv: refactor CS subgroup size determination
Rhys Perry [Fri, 9 Jun 2023 14:39:28 +0000 (15:39 +0100)]
radv: refactor CS subgroup size determination

This is less convoluted.

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

13 months agoradeonsi/vcn: update luma and chroma size
SureshGuttula [Mon, 5 Jun 2023 19:51:05 +0000 (01:21 +0530)]
radeonsi/vcn: update luma and chroma size

This patch will adjust aligned_height to enc_alignment  which
is helping to address some corner cases like 4096x64/64x<>.

Actually less dpb size causing PROTECTION_FAULT. This change is
fixing the issue.

Signed-off-by: SureshGuttula <suresh.guttula@amd.com>
Reviewed-by: Boyuan Zhang Boyuan.Zhang@amd.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23448>

13 months agoradv: advertise VK_EXT_depth_bias_control
Samuel Pitoiset [Tue, 16 May 2023 13:11:49 +0000 (15:11 +0200)]
radv: advertise VK_EXT_depth_bias_control

Pass new CTS on RDNA2.

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

13 months agoradv: implement VK_EXT_depth_bias_control
Samuel Pitoiset [Tue, 16 May 2023 13:11:26 +0000 (15:11 +0200)]
radv: implement VK_EXT_depth_bias_control

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

13 months agovulkan/runtime: call CmdSetDepthBias2EXT() from CmdSetDepthBias()
Samuel Pitoiset [Tue, 20 Jun 2023 07:43:38 +0000 (09:43 +0200)]
vulkan/runtime: call CmdSetDepthBias2EXT() from CmdSetDepthBias()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23696>

13 months agor600/sfn: Implement source mod optimization in backend
Gert Wollny [Fri, 16 Jun 2023 15:52:36 +0000 (17:52 +0200)]
r600/sfn: Implement source mod optimization in backend

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

13 months agor600/sfn: add source and dest mod info to opcode table
Gert Wollny [Fri, 16 Jun 2023 15:51:39 +0000 (17:51 +0200)]
r600/sfn: add source and dest mod info to opcode table

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

13 months agor600/sfn: allow source mods for per source with multi-slot ops
Gert Wollny [Fri, 16 Jun 2023 15:50:55 +0000 (17:50 +0200)]
r600/sfn: allow source mods for per source with multi-slot ops

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

13 months agor600/sfn: drop use of nir source mods
Gert Wollny [Fri, 16 Jun 2023 15:46:07 +0000 (17:46 +0200)]
r600/sfn: drop use of nir source mods

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

13 months agor600/sfn: Fix typo
Gert Wollny [Fri, 16 Jun 2023 15:53:19 +0000 (17:53 +0200)]
r600/sfn: Fix typo

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

13 months agovirgl: don't allow vertex input arrays on GLES hosts
Gert Wollny [Thu, 24 Mar 2022 11:39:40 +0000 (12:39 +0100)]
virgl: don't allow vertex input arrays on GLES hosts

v2: - use new HOST_IS_GLES flag (Corentin)
    - drop stray fprintf (Emma)
    - reorder cases to avoid code replication

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

13 months agozink, drirc: Add Borderlands 2 workaround to fix spir-v 1.6 translated discard
Illia Polishchuk [Fri, 16 Jun 2023 12:53:36 +0000 (15:53 +0300)]
zink, drirc: Add Borderlands 2 workaround to fix spir-v 1.6 translated discard

The game expects HLSL discard behavour

But it fails only on Zink because GLSL discard translates to
nir_intrinsic_discard (BRW_PREDICATE_ALIGN1_ANY4H in native Intel asm)
but Zink replaces it with OpTerminateInvocation SPIR-V and it translates to
nir_intrinsic_terminate (BRW_PREDICATE_NORMAL in native Intel asm)

Bisected commit in ZINK: bd816084

On AMD it works because they enabled the
glsl_correct_derivatives_after_discard by default: !10522 (17861aff)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9205
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Illia Polishchuk <illia.a.polishchuk@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23694>

13 months agoetnaviv: remove not used tgsi includes
Christian Gmeiner [Tue, 20 Jun 2023 06:53:15 +0000 (08:53 +0200)]
etnaviv: remove not used tgsi includes

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23738>

13 months agoetnaviv: drop usage of tgsi_swizzle_names
Christian Gmeiner [Tue, 20 Jun 2023 06:48:47 +0000 (08:48 +0200)]
etnaviv: drop usage of tgsi_swizzle_names

Gets rid of extern usage.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23738>

13 months agoetnaviv: remove tgsi remains
Christian Gmeiner [Tue, 20 Jun 2023 06:45:39 +0000 (08:45 +0200)]
etnaviv: remove tgsi remains

tokens member was not used for a long time.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23738>

13 months agov3d: clear alpha-only as red-only
Juan A. Suarez Romero [Tue, 6 Jun 2023 15:03:29 +0000 (17:03 +0200)]
v3d: clear alpha-only as red-only

When clearing an alpha-only format, set the alpha channel into red
channel.

Fixes `spec@ext_texture_integer@multisample-fast-clear
gl_ext_texture_integer`.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23497>

13 months agogallium/util: fix color clamp for alpha-only formats
Juan A. Suarez Romero [Tue, 6 Jun 2023 14:59:59 +0000 (16:59 +0200)]
gallium/util: fix color clamp for alpha-only formats

Alpha format only contains one channel, but it is placed in the 4th
position, not 1st.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23497>

13 months agoisl: handle DRM_FORMAT_MOD_INVALID in isl_drm_modifier_has_aux
Tapani Pälli [Mon, 19 Jun 2023 08:20:38 +0000 (11:20 +0300)]
isl: handle DRM_FORMAT_MOD_INVALID in isl_drm_modifier_has_aux

This fixes crashes with piglit.spec.ext_external_objects.* tests on TGL
that started to trigger with commit 8bc7bcfa0c19.

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

13 months agogallium: Remove unused os_process.h in gallium/auxiliary
Yonggang Luo [Wed, 1 Feb 2023 07:15:45 +0000 (15:15 +0800)]
gallium: Remove unused os_process.h in gallium/auxiliary

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23503>

13 months agodd: Replace the usage of os_get_process_name with util_get_process_name in dd_draw.c
Yonggang Luo [Tue, 31 Jan 2023 08:37:07 +0000 (16:37 +0800)]
dd: Replace the usage of os_get_process_name with util_get_process_name in dd_draw.c

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23503>

13 months agozink: Replace the usage of os_get_process_name with util_get_process_name
Yonggang Luo [Wed, 1 Feb 2023 07:01:55 +0000 (15:01 +0800)]
zink: Replace the usage of os_get_process_name with util_get_process_name

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23503>

13 months agomesa: Fix use after free.
Mykola Piatykop [Wed, 1 Mar 2023 14:48:45 +0000 (16:48 +0200)]
mesa: Fix use after free.

Reset the pointer to the earlier free st_context.
Check the st_context pointer before st_glFlush.

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

Signed-off-by: Mykola Piatykop <mykola.piatykop@globallogic.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21656>

13 months agocompiler/clc: Move related NIR passes to the common mesa clc
Caio Oliveira [Thu, 15 Jun 2023 05:35:23 +0000 (22:35 -0700)]
compiler/clc: Move related NIR passes to the common mesa clc

These were historically in the spirv+nir combo, but the common mesa clc
is a better home for them.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Nora Allen <blackcatgames@protonmail.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23667>

13 months agocompiler/clc: Rename the internal library from libclc to libmesaclc
Caio Oliveira [Thu, 15 Jun 2023 06:42:24 +0000 (23:42 -0700)]
compiler/clc: Rename the internal library from libclc to libmesaclc

There is an actual external libclc and we do use it, so rename the
internal common library to avoid confusion.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Nora Allen <blackcatgames@protonmail.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23667>

13 months agointel/compiler: Move brw_kernel.c to the intel_clc target
Caio Oliveira [Thu, 15 Jun 2023 18:31:39 +0000 (11:31 -0700)]
intel/compiler: Move brw_kernel.c to the intel_clc target

Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23667>

13 months agoanv: add VK_EXT_depth_bias_control support
Lionel Landwerlin [Tue, 6 Jun 2023 05:07:10 +0000 (08:07 +0300)]
anv: add VK_EXT_depth_bias_control support

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23716>

13 months agovulkan/runtime: add support for EXT_depth_bias_control
Lionel Landwerlin [Tue, 6 Jun 2023 04:55:05 +0000 (07:55 +0300)]
vulkan/runtime: add support for EXT_depth_bias_control

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23716>

13 months agovulkan: registry/headers bump to 1.3.254
Lionel Landwerlin [Tue, 6 Jun 2023 04:29:55 +0000 (07:29 +0300)]
vulkan: registry/headers bump to 1.3.254

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Constantine Shablya <constantine.shablya@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23716>

13 months agoanv: switch copy query results with shaders from semaphore waits to flushes
Lionel Landwerlin [Thu, 15 Jun 2023 12:14:04 +0000 (15:14 +0300)]
anv: switch copy query results with shaders from semaphore waits to flushes

Since we expect the number of copies to be > 6, emitting fewer
commands makes more sense.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23675>

13 months agoanv: tracking query buffer writes & query clears separately
Lionel Landwerlin [Thu, 15 Jun 2023 10:44:44 +0000 (13:44 +0300)]
anv: tracking query buffer writes & query clears separately

Clears should be flushed only on :
  - vkCmdBeginQuery*
  - vkCmdWriteTimestamp*
  - vkCmdWriteAccelerationStructuresPropertiesKHR
  - vkCmdCopyQueryPoolResults

Buffer writes should be flush only on :
  - vkCmdCopyQueryPoolResults

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23675>

13 months agoanv: fix pending query bits for compute only command buffers
Lionel Landwerlin [Thu, 15 Jun 2023 10:41:58 +0000 (13:41 +0300)]
anv: fix pending query bits for compute only command buffers

If we do the clear operations on a compute only command buffer, the
operations will not use render target writes but compute shader writes
instead.

Probably not an issue right now because this is not a feature we've
enabled.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23675>

13 months agoanv: change the way we clear pending query bits
Lionel Landwerlin [Thu, 15 Jun 2023 10:33:28 +0000 (13:33 +0300)]
anv: change the way we clear pending query bits

Instead of having genX(emit_apply_pipe_flushes) doing the clearing,
ask genX(emit_apply_pipe_flushes) for the emitted bits and do the
clearing using a helper.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23675>

13 months agoanv: track buffer writes from shaders for query results writes
Lionel Landwerlin [Thu, 15 Jun 2023 11:04:14 +0000 (14:04 +0300)]
anv: track buffer writes from shaders for query results writes

In the following sequence :
   - write buffer B with a shader
   - barrier on buffer from shader-write to transfer
   - vkCmdCopyQueryPoolResults to buffer B

The barrier should take care of ordering things between the shader
writes and vkCmdCopyQueryPoolResults.

The problem is that vkCmdCopyQueryPoolResults runs on the command
streamer and that is not coherent or synchronized in the same way as
shaders.

This change marks the barrier has potentially containing pending
buffer writes for queries so that we can insert the necessary flush
for vkCmdCopyQueryPoolResults later.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9013
Cc: mesa-stable
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23675>

13 months agoanv: add missing query clear flush for acceleration structure queries
Lionel Landwerlin [Thu, 15 Jun 2023 10:46:50 +0000 (13:46 +0300)]
anv: add missing query clear flush for acceleration structure queries

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: a787728906 ("anv: enable blorp query reset for performance queries")
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23675>

13 months agocompiler/types: fix size of padded OpenCL Structs
Karol Herbst [Sat, 17 Jun 2023 06:50:12 +0000 (08:50 +0200)]
compiler/types: fix size of padded OpenCL Structs

In C the size of a struct { uin32_t a; uint8_t b; } is 8, not 5, so we have
to account for the biggest alignment across all struct members.

Funny that the OpenCL CTS doesn't catch that.

Fixes: 44d32e62fb8 ("glsl: add cl_size and cl_alignment")
Signed-off-by: Karol Herbst <git@karolherbst.de>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23701>

13 months agoc11: Implement os_time_get_nano with timespec_get(&ts, TIME_MONOTONIC)
Yonggang Luo [Mon, 13 Feb 2023 18:49:56 +0000 (02:49 +0800)]
c11: Implement os_time_get_nano with timespec_get(&ts, TIME_MONOTONIC)

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23733>

13 months agoc11: Improve mtx_timedlock to use timespec_get instead of time(NULL)
Yonggang Luo [Mon, 13 Feb 2023 03:07:59 +0000 (11:07 +0800)]
c11: Improve mtx_timedlock to use timespec_get instead of time(NULL)

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23733>