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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Rhys Perry [Fri, 28 Jan 2022 14:49:50 +0000 (14:49 +0000)]
aco: preserve pass_flags during format conversions
This helps the "vopc() & exec" optimization.
fossil-db (Sienna Cichlid):
Totals from 1638 (1.21% of 134913) affected shaders:
CodeSize: 3331804 -> 3327520 (-0.13%); split: -0.19%, +0.06%
Instrs: 611807 -> 610096 (-0.28%)
Latency: 5579326 -> 5574874 (-0.08%)
InvThroughput: 936782 -> 936731 (-0.01%); split: -0.01%, +0.00%
Copies: 43324 -> 43302 (-0.05%); split: -0.06%, +0.01%
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/14773>
Rhys Perry [Fri, 28 Jan 2022 13:47:16 +0000 (13:47 +0000)]
aco: optimize abs(mul(a, b))
fossil-db (Sienna Cichlid):
Totals from 18 (0.01% of 134913) affected shaders:
CodeSize: 173924 -> 173852 (-0.04%)
Instrs: 33864 -> 33846 (-0.05%)
Latency: 122233 -> 122211 (-0.02%)
InvThroughput: 22482 -> 22462 (-0.09%)
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/14773>
Rhys Perry [Fri, 28 Jan 2022 13:48:34 +0000 (13:48 +0000)]
aco: fix neg(abs(mul(a, b))) if the mul is not VOP3
Previously, is_abs was just ignored if mul_instr->isVOP3()==false.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes:
93c8ebfa780 ("aco: Initial commit of independent AMD compiler")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14773>
Ella Stanforth [Sun, 12 Dec 2021 22:39:55 +0000 (22:39 +0000)]
vulkan: Allow RegisterDisplayEventEXT before first page flip
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14685>
Connor Abbott [Thu, 27 Jan 2022 17:33:55 +0000 (18:33 +0100)]
tu: Initial link-time optimizations
This is mostly taken from radv, and cleaned up a bit: don't explicitly
list every stage at the beginning, and name the shaders "producer" and
"consumer" to reduce confusion. I also stripped out a lot of other stuff
to get to the bare minimum of calling nir_link_opt_varyings,
nir_remove_unused_varyings, and nir_compact_varyings and then cleaning
up the fallout. In the future we may want to temporarily scalarize I/O
like radv does, and add back a few things like the psize optimization.
In the meantime this already provides a lot of benefit.
Results from the radv fossil_db with some apps not compilable by turnip
removed:
Totals:
MaxWaves: 1637288 -> 1668200 (+1.89%); split: +1.89%, -0.00%
Instrs:
54620287 ->
54114442 (-0.93%); split: -0.98%, +0.05%
CodeSize:
92235646 ->
91277584 (-1.04%); split: -1.07%, +0.03%
NOPs:
11176775 ->
11185206 (+0.08%); split: -0.63%, +0.71%
Full: 1689271 -> 1657175 (-1.90%); split: -1.92%, +0.02%
(ss): 1318763 -> 1317757 (-0.08%); split: -1.40%, +1.32%
(sy): 618795 -> 617724 (-0.17%); split: -0.70%, +0.53%
(ss)-stall: 3496370 -> 3470116 (-0.75%); split: -1.37%, +0.62%
(sy)-stall:
23512954 ->
23511164 (-0.01%); split: -1.04%, +1.03%
STPs: 27557 -> 27461 (-0.35%)
LDPs: 22948 -> 22804 (-0.63%)
Cat0:
11823765 ->
11829681 (+0.05%); split: -0.62%, +0.67%
Cat1: 3120042 -> 2991831 (-4.11%); split: -4.43%, +0.32%
Cat2:
28605309 ->
28324829 (-0.98%); split: -0.98%, +0.00%
Cat3: 7334628 -> 7252342 (-1.12%); split: -1.12%, +0.00%
Cat4: 1216514 -> 1204894 (-0.96%)
Cat5: 863976 -> 861926 (-0.24%)
Cat6: 1648571 -> 1641457 (-0.43%)
Totals from 23575 (16.16% of 145856) affected shaders:
MaxWaves: 258806 -> 289718 (+11.94%); split: +11.94%, -0.00%
Instrs: 7571190 -> 7065345 (-6.68%); split: -7.04%, +0.36%
CodeSize:
13864308 ->
12906246 (-6.91%); split: -7.09%, +0.18%
NOPs: 959185 -> 967616 (+0.88%); split: -7.35%, +8.23%
Full: 313335 -> 281239 (-10.24%); split: -10.36%, +0.11%
(ss): 154628 -> 153622 (-0.65%); split: -11.90%, +11.25%
(sy): 69758 -> 68687 (-1.54%); split: -6.21%, +4.67%
(ss)-stall: 322002 -> 295748 (-8.15%); split: -14.92%, +6.76%
(sy)-stall: 3270366 -> 3268576 (-0.05%); split: -7.45%, +7.40%
STPs: 3624 -> 3528 (-2.65%)
LDPs: 1074 -> 930 (-13.41%)
Cat0: 1022684 -> 1028600 (+0.58%); split: -7.13%, +7.71%
Cat1: 531102 -> 402891 (-24.14%); split: -26.04%, +1.90%
Cat2: 4090309 -> 3809829 (-6.86%); split: -6.86%, +0.00%
Cat3: 1449686 -> 1367400 (-5.68%); split: -5.69%, +0.01%
Cat4: 103543 -> 91923 (-11.22%)
Cat5: 57441 -> 55391 (-3.57%)
Cat6: 316096 -> 308982 (-2.25%)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14767>