platform/upstream/mesa.git
2 years agoutil/utrace: make generated code a tiny bit nicer to look at
Lionel Landwerlin [Mon, 31 Jan 2022 14:54:53 +0000 (16:54 +0200)]
util/utrace: make generated code a tiny bit nicer to look at

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14818>

2 years agoutil/u_trace: make mako conditional code easier to read
Lionel Landwerlin [Sun, 30 Jan 2022 19:48:13 +0000 (21:48 +0200)]
util/u_trace: make mako conditional code easier to read

It was difficult to read the conditional code.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14818>

2 years agointel/tracepoint: simplify tracepoint descriptions
Lionel Landwerlin [Mon, 31 Jan 2022 14:45:00 +0000 (16:45 +0200)]
intel/tracepoint: simplify tracepoint descriptions

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Suggested-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14818>

2 years agovulkan/wsi/wayland: remove format switch from wl_shm_format_for_vk_format
Simon Ser [Thu, 20 Jan 2022 11:10:42 +0000 (12:10 +0100)]
vulkan/wsi/wayland: remove format switch from wl_shm_format_for_vk_format

Instead of maintaining two similar switches (one for DRM formats,
one for wl_shm formats), only maintain a single switch (for DRM)
and convert DRM formats to enum wl_shm_format. This reduces the
risk to have inconsistencies between these two functions.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14634>

2 years agovulkan/wsi/wayland: use DRM_FORMAT_INVALID
Simon Ser [Thu, 20 Jan 2022 11:08:20 +0000 (12:08 +0100)]
vulkan/wsi/wayland: use DRM_FORMAT_INVALID

Instead of using the magic value 0, use the define.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14634>

2 years agovulkan/wsi/wayland: use enum wl_shm_format
Simon Ser [Thu, 20 Jan 2022 11:05:21 +0000 (12:05 +0100)]
vulkan/wsi/wayland: use enum wl_shm_format

libwayland defines an enum for wl_shm formats. Let's use it instead
of uint32_t.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14634>

2 years agodocs: update INTEL_DEBUG environment variable documentation
Lionel Landwerlin [Mon, 31 Jan 2022 08:50:39 +0000 (10:50 +0200)]
docs: update INTEL_DEBUG environment variable documentation

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5929
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14800>

2 years agov3dv: don't submit noop job if there is nothing to wait on or signal
Iago Toral Quiroga [Mon, 31 Jan 2022 12:07:32 +0000 (13:07 +0100)]
v3dv: don't submit noop job if there is nothing to wait on or signal

Also, do not unconditionally flag signaling for submits without any
command buffers.

Reviewed-by: Melissa Wen <mwen@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14802>

2 years agoglthread: call _mesa_glthread_BindBuffer unconditionally
Chia-I Wu [Sat, 22 Jan 2022 09:03:07 +0000 (01:03 -0800)]
glthread: call _mesa_glthread_BindBuffer unconditionally

_mesa_marshal_GetIntegerv expects those states to be tracked.  I am not
sure if this covers all states that _mesa_marshal_GetIntegerv needs, but
this fixes Civ5 for virgl at least.

Fixes: e48f676835d ("glthread: don't sync for more glGetIntegerv enums for glretrace")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14659>

2 years agomesa: stop truncating MESA_GLSL=dump
Mike Blumenkrantz [Thu, 27 Jan 2022 15:55:35 +0000 (10:55 -0500)]
mesa: stop truncating MESA_GLSL=dump

this adds a new helper function that can be used to directly dump longer
strings to the log file, such as shaders

fixes #5614

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

2 years agoaux/vbuf: add fastpath for skipping identical vbuf updates
Mike Blumenkrantz [Thu, 20 Jan 2022 17:06:05 +0000 (12:06 -0500)]
aux/vbuf: add fastpath for skipping identical vbuf updates

the overhead of comparing these is MUCH less than the overhead of queuing a
driver method and performing the update

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

2 years agoaux/vbuf: move mask-clearing for vbuf updates after buffer scanning
Mike Blumenkrantz [Thu, 20 Jan 2022 16:51:28 +0000 (11:51 -0500)]
aux/vbuf: move mask-clearing for vbuf updates after buffer scanning

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

2 years agoaux/vbuf: use local var for modifying unaligned_vb_mask during update
Mike Blumenkrantz [Thu, 20 Jan 2022 16:51:06 +0000 (11:51 -0500)]
aux/vbuf: use local var for modifying unaligned_vb_mask during update

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

2 years agoiris: implement inter-context busy-tracking
Paulo Zanoni [Fri, 28 Jan 2022 23:11:49 +0000 (15:11 -0800)]
iris: implement inter-context busy-tracking

Previously, no buffers were ever marked as EXEC_OBJECT_ASYNC so the
Kernel would ensure dependency tracking for us. After we implemented
explicit busy tracking in commit 89a34cb8450a, only the external
objects kept relying on the Kernel's implicit tracking and Iris did
inter-batch busy tracking, meaning we lost inter-screen and
inter-context synchronization. This seemed fine to me since, as far as
I understdood, it is the duty of the application to synchronize itself
against multiple screens and contexts.

The problem here is that applications were actually relying on the old
behavior where the Kernel guarantees synchronization, so 89a34cb8450a
can be seen as a regression. This commit addresses the inter-context
synchronization case.

v2: Rebase after the changes from a90a1f15a7c8. This new version is
significantly different.

Cc: mesa-stable (see the backport in MR !14783)
References: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14783
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5731
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5812
Fixes: 89a34cb8450a ("iris: switch to explicit busy tracking")
References: a90a1f15a7c8 ("iris: Create an IRIS_BATCH_BLITTER for using the BLT command streamer")
Tested-by: Konstantin Kharlamov <hi-angel@yandex.ru> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14505>

2 years agoiris: save some iris_syncobj_reference() calls at update_bo_syncobjs()
Paulo Zanoni [Thu, 27 Jan 2022 00:56:48 +0000 (16:56 -0800)]
iris: save some iris_syncobj_reference() calls at update_bo_syncobjs()

Save some iris_syncobj_reference() calls at at update_bo_syncobjs() by
refactoring the function, moving the unnecessary calls out of the for
loop. Also improve the documentation and drive-by fix a white space
issue.

Commit a90a1f15a7c8 incremented IRIS_BATCH_COUNT and adjusted the code
involving it. But the way it was done at update_bo_syncobjs() means
we'll now call iris_syncobj_reference() more than the amount of times
we need. This isn't a problem since in the second call we're moving
the reference from something to the same thing, but still we can get
away with just not doing it, so why not?

There is also the question of whether we should really iterate over
IRIS_BATCH_COUNT or something else (to save time on platforms that
don't have as many batches as IRIS_BATCH_COUNT), but this is a matter
for a separate patch (see MR !14747). In this patch we reorder the
operations a little bit so when the time comes there will be just one
loop to adjust.

I also changed the order so first we look at's in bo_deps and only
later we write to bo_deps. This is more future-proof and will make the
next patch easier to land and understand.

Reference: a90a1f15a7c8 ("iris: Create an IRIS_BATCH_BLITTER for using the BLT command streamer")
Reference: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14747
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14505>

2 years agoiris: Return non-zero stride for clear color plane
Nanley Chery [Fri, 21 Jan 2022 18:05:30 +0000 (13:05 -0500)]
iris: Return non-zero stride for clear color plane

Before this patch, when querying the clear color plane's stride, iris
would return the aux surface stride. This was okay because the clear
color plane wasn't really used for anything.

This doesn't work on XeHP however. On that platform, the aux surface
stride is zero (because it doesn't have an ISL surface for the CCS).
This is a problem because mesa's implementation of eglCreateImage
rejects strides of zero (see dri2_check_dma_buf_attribs) and this value
may be queried from GBM and passed into EGL.

When the DG2 clear color modifier is enabled, this avoids EGL_BAD_ACCESS
errors when running the piglit test,
ext_image_dma_buf_import-intel_modifiers.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14759>

2 years agoiris: Pick the right BO in iris_resource_get_param
Nanley Chery [Thu, 30 Dec 2021 23:38:16 +0000 (18:38 -0500)]
iris: Pick the right BO in iris_resource_get_param

Pick the clear color BO if the clear color plane is being queried. This
avoids picking a NULL aux BO on XeHP.

When creating shared resources, we place the gallium-visible planes in
the same buffer object. However, when importing them, we aren't very
strict about each plane sharing the same BO. So, instead of just using
res->bo, we use a couple ternaries to figure out the right one.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14759>

2 years agoiris: Refactor a ternary in iris_resource_get_param
Nanley Chery [Fri, 28 Jan 2022 02:47:08 +0000 (21:47 -0500)]
iris: Refactor a ternary in iris_resource_get_param

Suggested-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14759>

2 years agov3dv: move sems_info from event_wait job to wait_thread info
Melissa Wen [Fri, 28 Jan 2022 18:28:20 +0000 (18:28 +0000)]
v3dv: move sems_info from event_wait job to wait_thread info

Semaphores info was stored as an info of event_wait cpu jobs and this
leads to mem leak when the same event_wait job in the same cmd buffer
batch was submitted more than once. As a result,
`dEQP-VK.api.command_buffers.record_simul_use_primary` fails due to a
double-free of sems_info.

In this patch, we no longer use v3dv_event_wait_cpu_job_info to store
semaphores from a submit info, since semaphores is related to a queue
submission and not to the event_wait job type. If we spawn a wait_thread,
we copy semaphores to an auxiliary struct (v3dv_wait_thread_info) that
will be used in wait_thread to get job and semaphores information. When
the spawned thread finishes, it releases the related
v3dv_wait_thread_info and the semaphores copy as well.

Fixes: d5bd18fb ("v3dv: store wait semaphores in event_wait_cpu_job_info")

Suggested-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Melissa Wen <mwen@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14736>

2 years agod3d12: ARB_transform_feedback3
Jesse Natalie [Thu, 27 Jan 2022 21:23:36 +0000 (13:23 -0800)]
d3d12: ARB_transform_feedback3

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>

2 years agod3d12: Handle indexed queries
Jesse Natalie [Sat, 29 Jan 2022 17:41:03 +0000 (09:41 -0800)]
d3d12: Handle indexed queries

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>

2 years agod3d12: Fix xfb varying matching for vars with location_frac
Jesse Natalie [Fri, 28 Jan 2022 19:48:06 +0000 (11:48 -0800)]
d3d12: Fix xfb varying matching for vars with location_frac

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>

2 years agod3d12: Unpack multi-stream varyings
Jesse Natalie [Fri, 28 Jan 2022 19:46:02 +0000 (11:46 -0800)]
d3d12: Unpack multi-stream varyings

DXIL doesn't support a single varying having components belonging
to multiple streams. For geometry shader outputs, whenever we find
this to be the case, break up that variable into multiple sub-
variables, and update stores to that variable to write to the new
sub-variables instead.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>

2 years agomicrosoft/compiler: Support multiple GS output streams
Jesse Natalie [Fri, 28 Jan 2022 19:43:21 +0000 (11:43 -0800)]
microsoft/compiler: Support multiple GS output streams

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>

2 years agomicrosoft/compiler: Correctly support I/O on variables with location_frac
Jesse Natalie [Fri, 28 Jan 2022 19:42:59 +0000 (11:42 -0800)]
microsoft/compiler: Correctly support I/O on variables with location_frac

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>

2 years agod3d12: ARB_transform_feedback2
Jesse Natalie [Wed, 26 Jan 2022 16:41:22 +0000 (08:41 -0800)]
d3d12: ARB_transform_feedback2

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>

2 years agod3d12: Switch primitives-generated query to use XFB, GS, and IA data
Jesse Natalie [Sat, 29 Jan 2022 17:37:49 +0000 (09:37 -0800)]
d3d12: Switch primitives-generated query to use XFB, GS, and IA data

Per https://www.supergoodcode.com/primitive-pain/ this is how it should work

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>

2 years agod3d12: Rewrite subquery logic
Jesse Natalie [Thu, 27 Jan 2022 15:19:51 +0000 (07:19 -0800)]
d3d12: Rewrite subquery logic

The previous logic was a bit bolted-on, using a linked list of queries
to implement cases where a GL query needed maybe multiple D3D queries.
Once the sub-query was created, it was always begun/ended along with
the parent query, but that's not sufficient or correct.

Instead, we need to be able to have mutually-exclusive subqueries
underneath a parent query. This will let us handle using different
counters for the same GL query in different pipeline configs, and then
accumulating the results together.

Fixes the arb_transform_feedback2-pause-counting piglit test.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>

2 years agod3d12: Compute transform UBO0 is actually binding 1
Jesse Natalie [Thu, 27 Jan 2022 17:08:04 +0000 (09:08 -0800)]
d3d12: Compute transform UBO0 is actually binding 1

Since lower_uniforms_to_ubo will unconditionally increment UBO indices
from 0 to 1.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>

2 years agod3d12: Implement DrawAuto aka DrawTransformFeedback
Jesse Natalie [Wed, 26 Jan 2022 23:51:54 +0000 (15:51 -0800)]
d3d12: Implement DrawAuto aka DrawTransformFeedback

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>

2 years agod3d12: Move "fake" SO buffer handling to compute transforms instead of CPU readback
Jesse Natalie [Wed, 26 Jan 2022 22:34:47 +0000 (14:34 -0800)]
d3d12: Move "fake" SO buffer handling to compute transforms instead of CPU readback

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>

2 years agod3d12: Move compute transform state save/restore to compute_transforms.cpp
Jesse Natalie [Wed, 26 Jan 2022 22:31:48 +0000 (14:31 -0800)]
d3d12: Move compute transform state save/restore to compute_transforms.cpp

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>

2 years agod3d12: Add a compute transform for draw auto
Jesse Natalie [Wed, 26 Jan 2022 21:24:31 +0000 (13:24 -0800)]
d3d12: Add a compute transform for draw auto

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>

2 years agod3d12: Add a couple compute transforms for "fake" SO buffers
Jesse Natalie [Wed, 26 Jan 2022 20:52:31 +0000 (12:52 -0800)]
d3d12: Add a couple compute transforms for "fake" SO buffers

This solves 2 problems with the CPU readback we're doing for this now:
1. It's not on the CPU
2. It handles gaps, leaving the destination buffer intact in those gaps

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>

2 years agod3d12: Add a comment for what the existing compute transform does
Jesse Natalie [Wed, 26 Jan 2022 20:54:21 +0000 (12:54 -0800)]
d3d12: Add a comment for what the existing compute transform does

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>

2 years agod3d12: SO buffer filled size is only 32-bit
Jesse Natalie [Wed, 26 Jan 2022 19:35:11 +0000 (11:35 -0800)]
d3d12: SO buffer filled size is only 32-bit

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>

2 years agod3d12: Move indirect compute to real indirect dispatches
Jesse Natalie [Wed, 26 Jan 2022 17:30:28 +0000 (09:30 -0800)]
d3d12: Move indirect compute to real indirect dispatches

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>

2 years agod3d12: Support transform feedback pause/resume
Jesse Natalie [Wed, 26 Jan 2022 14:49:21 +0000 (06:49 -0800)]
d3d12: Support transform feedback pause/resume

Don't unconditionally reallocate/zero the fill buffer count, only
when a specific value is to be assigned.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>

2 years agod3d12: Include SO buffer count as a PSO dirty bit
Jesse Natalie [Thu, 27 Jan 2022 18:00:35 +0000 (10:00 -0800)]
d3d12: Include SO buffer count as a PSO dirty bit

ctx->gfx_pipeline_state::num_so_targets is used when compiling PSOs,
so make sure that changes to that value result in PSO recompiles.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>

2 years agod3d12: Add UAV barriers for UAVs that are being used by compute transforms
Jesse Natalie [Wed, 26 Jan 2022 16:31:33 +0000 (08:31 -0800)]
d3d12: Add UAV barriers for UAVs that are being used by compute transforms

If an indirect arg buffer is being produced by a compute shader, then when
we go to consume it as an SSBO in a compute transform pass, we need to insert
a UAV barrier to prevent the two dispatches from overlapping. For app dispatches,
this is the app's responsibility via explicit barrier APIs, and if they don't,
then they're allowed to overlap.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>

2 years agod3d12: Fix compute transform for multi-draw indirect with dynamic count + state vars
Jesse Natalie [Thu, 27 Jan 2022 15:58:46 +0000 (07:58 -0800)]
d3d12: Fix compute transform for multi-draw indirect with dynamic count + state vars

NIR validation will complain on the UBO range not being set.

Fixes: 3a8c8d25 ("d3d12: Add a compute transformation to handle indirect draws that need draw params")
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>

2 years agomicrosoft/compiler: Fix UAV resource ID counting for static indexed handles
Jesse Natalie [Thu, 27 Jan 2022 17:55:36 +0000 (09:55 -0800)]
microsoft/compiler: Fix UAV resource ID counting for static indexed handles

Skip resource space 2 after computing the ID it would've used.

Fixes: e5f353f2 ("microsoft/compiler: Emit statically-indexed resource handles and scratch later")
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14787>

2 years agozink: use SpvScopeDevice over SpvScopeWorkgroup for atomic shader ops
Mike Blumenkrantz [Tue, 18 Jan 2022 15:39:25 +0000 (10:39 -0500)]
zink: use SpvScopeDevice over SpvScopeWorkgroup for atomic shader ops

Workgroup is only allowed in compute shaders, and Device should be more
in line with the intended use here

the alternative would be to keep using Workgroup for compute and use Device
otherwise, but this would effectively make atomic ops non-atomic, which seems
like it isn't desirable

cc: mesa-stable

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14690>

2 years agozink: cast image atomic op params/results based on image type
Mike Blumenkrantz [Fri, 14 Jan 2022 21:30:28 +0000 (16:30 -0500)]
zink: cast image atomic op params/results based on image type

according to spec, these must match the texel pointer type

cc: mesa-stable

fixes (nvidia):
dEQP-GLES31.functional.image_load_store.2d.atomic.exchange_r32f_return_value
dEQP-GLES31.functional.image_load_store.2d_array.atomic.exchange_r32f_return_value
dEQP-GLES31.functional.image_load_store.cube.atomic.exchange_r32f_return_value

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14690>

2 years agozink: add warning printf for drivers missing VK_EXT_shader_atomic_float
Mike Blumenkrantz [Fri, 14 Jan 2022 21:10:47 +0000 (16:10 -0500)]
zink: add warning printf for drivers missing VK_EXT_shader_atomic_float

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14690>

2 years agozink: enable VK_EXT_shader_atomic_float
Mike Blumenkrantz [Fri, 14 Jan 2022 21:10:11 +0000 (16:10 -0500)]
zink: enable VK_EXT_shader_atomic_float

this is needed for atomic ops, but we can let drivers that don't support
it have some warning messages instead of gating features

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14690>

2 years agozink: handle swizzled offset/count values for shader bitfield ops
Mike Blumenkrantz [Fri, 14 Jan 2022 20:39:11 +0000 (15:39 -0500)]
zink: handle swizzled offset/count values for shader bitfield ops

glsl/nir automatically swizzle the value if a vecN is being used, but spirv
requires a single scalar, so this has to be detected and unswizzled to avoid
violating spec and crashing shader compilers that are less permissive than mesa's

fixes (nvidia):
dEQP-GLES31.functional.shaders.builtin_functions.integer.bitfieldextract*
KHR-GL46.shader_bitfield_operation.bitfieldExtract*

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14690>

2 years agomicrosoft/spirv_to_dxil: Define idep_libspirv_to_dxil
Boris Brezillon [Mon, 24 Jan 2022 12:53:20 +0000 (13:53 +0100)]
microsoft/spirv_to_dxil: Define idep_libspirv_to_dxil

So we can re-use it when we need to define a dependency on spirv_to_dxil.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14765>

2 years agomicrosoft/spirv_to_dxil: Make sure the SampleMask is a uint
Boris Brezillon [Fri, 14 Jan 2022 09:44:04 +0000 (01:44 -0800)]
microsoft/spirv_to_dxil: Make sure the SampleMask is a uint

DXIL doesn't like when SV_Coverage (AKA SampleMask in DXIL) is a
signed integer. Fix the type while we're in the NIR domain.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14765>

2 years agomicrosoft/spirv_to_dxil: Lower atomics to their dxil variants
Boris Brezillon [Fri, 14 Jan 2022 09:05:04 +0000 (01:05 -0800)]
microsoft/spirv_to_dxil: Lower atomics to their dxil variants

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14765>

2 years agomicrosoft/spirv_to_dxil: Discard PSIZ accesses
Boris Brezillon [Mon, 8 Nov 2021 12:51:59 +0000 (13:51 +0100)]
microsoft/spirv_to_dxil: Discard PSIZ accesses

D3D12 doesn't support gl_PointSize, so let's consider PointSize is
always 1.0 and discard any PointSize access.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14765>

2 years agomicrosoft/spirv_to_dxil: Allow passing a vulkan -> d3d12 binding mapping table
Louis-Francis Ratté-Boulianne [Mon, 24 Jan 2022 11:10:49 +0000 (12:10 +0100)]
microsoft/spirv_to_dxil: Allow passing a vulkan -> d3d12 binding mapping table

Vulkan bindings take only one slot per variable, but d3d12 ones take one
slot per entry when the variable is an array. This forces us to pass
an explicit vulkan -> d3d12 mapping table when dealing with vulkan
shaders.

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

2 years agomicrosoft/spirv_to_dxil: Lower push constant loads to UBO loads
Louis-Francis Ratté-Boulianne [Mon, 24 Jan 2022 10:59:07 +0000 (11:59 +0100)]
microsoft/spirv_to_dxil: Lower push constant loads to UBO loads

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

2 years agomicrosoft/spirv_to_dxil: lower input attachments
Louis-Francis Ratté-Boulianne [Wed, 10 Nov 2021 03:54:57 +0000 (22:54 -0500)]
microsoft/spirv_to_dxil: lower input attachments

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

2 years agomicrosoft/spirv_to_dxil: check for variables r/w access
Louis-Francis Ratté-Boulianne [Wed, 10 Nov 2021 03:54:29 +0000 (22:54 -0500)]
microsoft/spirv_to_dxil: check for variables r/w access

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

2 years agomicrosoft/spirv_to_dxil: Support [un]conditional YZ-flip
Boris Brezillon [Thu, 14 Oct 2021 10:36:53 +0000 (03:36 -0700)]
microsoft/spirv_to_dxil: Support [un]conditional YZ-flip

The unconditional Y-flip is needed for Vulkan 1.0 since D3D12 and
Vulkan coordinate systems differ. Conditional YZ-flip is needed if
we want to support negative viewport height/depth.

Prepare spirv_to_dxil() to support that, and while at it, prepare
things for multi-viewport: the Y/Z flips are per-viewport and encoded
in a 32bit bitmask, with the upper 16bits reserved for Z flips, and the
lower 16bits reserved for Y flips.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14765>

2 years agomicrosoft/spirv_to_dxil: Allow dumping NIR
Boris Brezillon [Thu, 14 Oct 2021 09:38:42 +0000 (02:38 -0700)]
microsoft/spirv_to_dxil: Allow dumping NIR

Dumping NIR shaders is a useful debug feature. Let's tweak the
spirv_to_nir() helper so we can pass debugging options and
add one to allow dumping NIR.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14765>

2 years agomicrosoft/spirv_to_dxil: Remove dead variables after the struct split pass
Boris Brezillon [Mon, 24 Jan 2022 10:49:33 +0000 (11:49 +0100)]
microsoft/spirv_to_dxil: Remove dead variables after the struct split pass

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14765>

2 years agoanv/image: Call into WSI to create swapchain images
Jason Ekstrand [Fri, 23 Jul 2021 05:30:16 +0000 (00:30 -0500)]
anv/image: Call into WSI to create swapchain images

This guarantees that we get an image that's created with exactly the
swapchain image creation parameters instead of trying to emulate it
inside the driver.  Ideally, we'd use the fancy new bind helper too but
our magic ANV_IMAGE_MEMORY_BINDING_PRIVATE gets in the way and we really
do want to re-bind ourself.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agoanv/image: Add some asserts when binding swapchain images
Jason Ekstrand [Fri, 23 Jul 2021 05:30:04 +0000 (00:30 -0500)]
anv/image: Add some asserts when binding swapchain images

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/wsi: Add image create and bind helpers
Jason Ekstrand [Fri, 23 Jul 2021 04:58:14 +0000 (23:58 -0500)]
vulkan/wsi: Add image create and bind helpers

These are needed to properly implement the Vulkan 1.1 swapchain image
create/bind functionality.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agowsi/common: Set VK_IMAGE_CREATE_ALIAS_BIT
Jason Ekstrand [Mon, 9 Aug 2021 15:23:18 +0000 (10:23 -0500)]
wsi/common: Set VK_IMAGE_CREATE_ALIAS_BIT

With Vulkan 1.1, we have a VkImageSwapchainCreateInfoKHR struct which
lets you create a new VkImage which aliases a swapchain image.  However,
there is no corresponding swapchain create flag so we have to set
VK_IMAGE_CREATE_ALIAS_BIT all the time.

We need to do a bit of work in ANV to prevent it from asserting the
moment it sees one of these.  Fortunately, they're already safe because
WSI images go through a different bind path for
VkBindImageMemorySwapchainInfoKHR.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/wsi/drm: Drop wsi_create_native/prime_image
Jason Ekstrand [Fri, 23 Jul 2021 04:50:22 +0000 (23:50 -0500)]
vulkan/wsi/drm: Drop wsi_create_native/prime_image

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/wsi/win32: Break create_win32_image in pieces
Jason Ekstrand [Fri, 23 Jul 2021 03:14:55 +0000 (22:14 -0500)]
vulkan/wsi/win32: Break create_win32_image in pieces

This is similar to the previous two commits that we did for DRM native
images.  It breaks it into configure/create/bind and calls
wsi_create_image to walk through the three-step process.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/wsi/win32: Delete unnecessary copy+paste from DRM
Jason Ekstrand [Thu, 22 Jul 2021 23:27:09 +0000 (18:27 -0500)]
vulkan/wsi/win32: Delete unnecessary copy+paste from DRM

The Win32 WSI just does a copy into the window on the CPU.  There's no
need for external memory or modifiers or implicit sync or any of that.
While we're at it, rename to create_win32_image.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/wsi/display: Split image creation
Jason Ekstrand [Fri, 23 Jul 2021 04:49:09 +0000 (23:49 -0500)]
vulkan/wsi/display: Split image creation

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/wsi/wayland: Split image creation
Jason Ekstrand [Fri, 23 Jul 2021 04:44:25 +0000 (23:44 -0500)]
vulkan/wsi/wayland: Split image creation

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/wsi/x11: Split image creation
Jason Ekstrand [Fri, 23 Jul 2021 04:10:39 +0000 (23:10 -0500)]
vulkan/wsi/x11: Split image creation

Store the wsi_image_create_info in the swapchain and call
wsi_configure_*_image once per swapchain and then use wsi_create_image
for each image.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/wsi/drm: Break create_prime_image in pieces
Jason Ekstrand [Thu, 22 Jul 2021 23:24:02 +0000 (18:24 -0500)]
vulkan/wsi/drm: Break create_prime_image in pieces

This is similar to the previous two commits that we did for DRM native
images.  It breaks it into configure/create/bind/finish and calls
wsi_create_image to walk through the process.  The primary difference is
that prime images need fifth step in the process to set up the blit
command buffer.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/wsi: Add a helper for the configure/create/bind pattern
Jason Ekstrand [Fri, 23 Jul 2021 03:31:57 +0000 (22:31 -0500)]
vulkan/wsi: Add a helper for the configure/create/bind pattern

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/wsi/drm: Break create_native_image in pieces
Jason Ekstrand [Thu, 22 Jul 2021 22:50:38 +0000 (17:50 -0500)]
vulkan/wsi/drm: Break create_native_image in pieces

Instead of making create_native_image one monolithic function, break it
into a configure stage and a create stage.  The configure stage is
further broken up, first into a common piece that constructs a simple
VkImageCreateInfo and a couple chain-ins.  The second adds the extra
stuff for create_native_image.  This is to prepare for eventually
storing those structs in the swapchain itself.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/wsi: Set MUTABLE_FORMAT_BIT in the prime path
Jason Ekstrand [Thu, 22 Jul 2021 23:38:20 +0000 (18:38 -0500)]
vulkan/wsi: Set MUTABLE_FORMAT_BIT in the prime path

Fixes: 4bdf8547f4dc "vulkan/wsi: Implement VK_KHR_swapchain_mutable_format"

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12031>

2 years agovulkan/overlay: revise and reformat README
Caleb Callaway [Fri, 28 Jan 2022 20:15:59 +0000 (12:15 -0800)]
vulkan/overlay: revise and reformat README

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

2 years agoturnip: respect buf->bo_offset in transform feedback
Chia-I Wu [Sat, 29 Jan 2022 00:53:48 +0000 (16:53 -0800)]
turnip: respect buf->bo_offset in transform feedback

buf->bo->iova should always be offset by buf->bo_offset.

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

2 years agovulkan/wsi/wayland: Fix add_drm_format_modifier aplha/opaqueness.
Georg Lehmann [Mon, 17 Jan 2022 23:38:10 +0000 (00:38 +0100)]
vulkan/wsi/wayland: Fix add_drm_format_modifier aplha/opaqueness.

This had the opposite problem of the shm path. R8G8B8A8 was always support if
either DRM_FORMAT_XBGR8888 or DRM_FORMAT_ABGR8888 was supported, but we need
both.

Fixes: d944136f363 ("vulkan/wsi/wayland: don't expose surface formats not fully supported")

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14588>

2 years agovulkan/wsi/wayland: Add modifiers for RGB formats.
Georg Lehmann [Tue, 18 Jan 2022 10:19:34 +0000 (11:19 +0100)]
vulkan/wsi/wayland: Add modifiers for RGB formats.

These formats get overwritten after the FALLTHROUGH, so no modifers got added
to them at all.

Fixes: 151b65b2119 ("vulkan/wsi/wayland: generalize modifier handling")

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14588>

2 years agovulkan/wsi/wayland: Convert missing vulkan formats to shm formats.
Georg Lehmann [Mon, 17 Jan 2022 23:40:00 +0000 (00:40 +0100)]
vulkan/wsi/wayland: Convert  missing vulkan formats to shm formats.

Fixes: 6b36f35734a ("vulkan/wsi/wl: add wl_shm support for lavapipe.")

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

2 years agovulkan/wsi/wayland: Fix add_wl_shm_format alpha/opaqueness.
Georg Lehmann [Mon, 17 Jan 2022 23:13:09 +0000 (00:13 +0100)]
vulkan/wsi/wayland: Fix add_wl_shm_format alpha/opaqueness.

We need both the SHM format with alpha and the opaque format to fully support
a vulkan format with alpha. Previously no surface format was reported because
the vulkan formats with aplha were never added as opaque.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5879
Fixes: d944136f363 ("vulkan/wsi/wayland: don't expose surface formats not fully supported")

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

2 years agoetnaviv: add support for INTEL_blackhole_render
Christian Gmeiner [Sat, 29 Jan 2022 16:24:29 +0000 (17:24 +0100)]
etnaviv: add support for INTEL_blackhole_render

Passes the following piglits:
 - spec@intel_blackhole_render@intel_blackhole-draw_gles2
 - spec@intel_blackhole_render@intel_blackhole-draw_gles3

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14792>

2 years agomicrosoft/compiler: textureLoad() doesn't take a LOD on MS textures
Boris Brezillon [Wed, 8 Dec 2021 09:50:41 +0000 (10:50 +0100)]
microsoft/compiler: textureLoad() doesn't take a LOD on MS textures

Make sure the LOD is zero in that case.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13993>

2 years agomicrosoft/compiler: Skip images in redirect_texture_derefs()
Boris Brezillon [Wed, 1 Dec 2021 08:19:06 +0000 (09:19 +0100)]
microsoft/compiler: Skip images in redirect_texture_derefs()

The input attachment lowering pass turns input attachment loads into
texel fetch operation, and insert an image -> texture deref cast along
the way. In this situation, we can end up with a texture deref chain
pointing to an image variable, which is not a combined sampler+texture
object. Bail out when an image type is found, like we do for bare
textures.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13993>

2 years agomicrosoft/compiler: Fix sampler/texture array emission
Boris Brezillon [Wed, 1 Dec 2021 08:13:26 +0000 (09:13 +0100)]
microsoft/compiler: Fix sampler/texture array emission

Those need to be declared as sampler/SRV arrays, as we do for UAVs and
CBVs.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13993>

2 years agomicrosoft/compiler: Use SRVs for read-only images
Louis-Francis Ratté-Boulianne [Wed, 10 Nov 2021 03:51:02 +0000 (22:51 -0500)]
microsoft/compiler: Use SRVs for read-only images

Acked-by: Enrico Galli <enrico.galli@intel.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13993>

2 years agomicrosoft/compiler: Add subpass input types
Louis-Francis Ratté-Boulianne [Wed, 10 Nov 2021 03:43:41 +0000 (22:43 -0500)]
microsoft/compiler: Add subpass input types

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

2 years agomicrosoft/compiler: add support for load_layer_id
Louis-Francis Ratté-Boulianne [Wed, 10 Nov 2021 03:14:04 +0000 (22:14 -0500)]
microsoft/compiler: add support for load_layer_id

We simply return 0 for now as we don't support multi-view yet.

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

2 years agosvga: silence -Wsometimes-uninitialized
Thomas H.P. Andersen [Thu, 20 Jan 2022 01:04:43 +0000 (02:04 +0100)]
svga: silence -Wsometimes-uninitialized

Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14790>

2 years agoanv: drop a set but unused variable
Thomas H.P. Andersen [Sun, 26 Dec 2021 00:07:41 +0000 (01:07 +0100)]
anv: drop a set but unused variable

Fixes a warning with clang

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

2 years agoanv: drop a set but unused variable
Thomas H.P. Andersen [Sun, 26 Dec 2021 00:07:47 +0000 (01:07 +0100)]
anv: drop a set but unused variable

Fixes a warning with clang

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

2 years agopanfrost: mark two variables as unused
Thomas H.P. Andersen [Tue, 28 Dec 2021 15:31:13 +0000 (16:31 +0100)]
panfrost: mark two variables as unused

The variables are currently unused as panvk does not support
SSBOs yet.

Silences a compile warning with clang

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14790>

2 years agobroadcom: drop unused functions
Thomas H.P. Andersen [Sat, 8 Jan 2022 17:28:48 +0000 (18:28 +0100)]
broadcom: drop unused functions

Fixes a clang warning about unused static inlined functions

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14790>

2 years agov3d: avoid warning about unused function
Thomas H.P. Andersen [Sat, 8 Jan 2022 19:34:01 +0000 (20:34 +0100)]
v3d: avoid warning about unused function

This function is only used if V3D_VERSION < 40

Fixes a clang warning about unused static inlined functions.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14790>

2 years agov3d: avoid warning about unused function
Thomas H.P. Andersen [Mon, 17 Jan 2022 18:52:36 +0000 (19:52 +0100)]
v3d: avoid warning about unused function

This function is only used if V3D_VERSION >= 40

Fixes a clang warning about unused static inlined functions.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14790>

2 years agovc4: drop unused function
Thomas H.P. Andersen [Sat, 8 Jan 2022 19:35:45 +0000 (20:35 +0100)]
vc4: drop unused function

Fixes a clang warning about unused static inlined functions

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14790>

2 years agoanv: avoid warning about unused function
Thomas H.P. Andersen [Sat, 8 Jan 2022 19:36:48 +0000 (20:36 +0100)]
anv: avoid warning about unused function

This function is only used if GFX_VER == 7

Fixes a clang warning about unused static inlined functions.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14790>

2 years agoci/freedreno: properly test sysmem and gmem paths
Danylo Piliaiev [Mon, 27 Dec 2021 11:49:42 +0000 (13:49 +0200)]
ci/freedreno: properly test sysmem and gmem paths

After autotuner introduction most CTS tests are running in
sysmem mode. Now we have to force gmem run and add a small
forced sysmem run since it's not guaranteed that autotuner
would select gmem in future.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12128>

2 years agotu: add debug option to force gmem
Danylo Piliaiev [Thu, 7 Oct 2021 12:09:32 +0000 (15:09 +0300)]
tu: add debug option to force gmem

With autotuner we now want to be able to force gmem rendering,
it will respect existing constraints though.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12128>

2 years agofreedreno: Update gmem/sysmem debug options to be in line with turnip
Danylo Piliaiev [Fri, 28 Jan 2022 12:52:23 +0000 (14:52 +0200)]
freedreno: Update gmem/sysmem debug options to be in line with turnip

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12128>

2 years agotu: implement sysmem vs gmem autotuner
Danylo Piliaiev [Thu, 29 Jul 2021 11:21:05 +0000 (14:21 +0300)]
tu: implement sysmem vs gmem autotuner

The implementation is separate from Freedreno due to multithreading
support.

In Vulkan application may fill command buffer from many threads
and expect no locking to occur. We do introduce the possibility of
locking on renderpass end, however assuming that application
doesn't have a huge amount of slightly different renderpasses,
there would be minimal to none contention.

Other assumptions are:
- Application does submit command buffers soon after their creation.

Breaking the above may lead to some decrease in performance or
autotuner turning itself off.

The heuristic is too simplistic at the moment, to find a proper
one - we should run a bunch of traces with sysmem and gmem, and
build better heuristic from gathered data.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12128>

2 years agoanv: tidy long lines in descriptor code
Lionel Landwerlin [Mon, 31 Jan 2022 07:51:00 +0000 (09:51 +0200)]
anv: tidy long lines in descriptor code

No functional change.

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

2 years agod3d12: Fix "use of designated initializers requires at least '/std:c++20'" error
Boris Brezillon [Mon, 24 Jan 2022 09:31:10 +0000 (01:31 -0800)]
d3d12: Fix "use of designated initializers requires at least '/std:c++20'" error

Fixes: 3a8c8d25fd7e ("d3d12: Add a compute transformation to handle indirect draws that need draw params")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14762>