Iago Toral Quiroga
6d84348bb4
v3dv: expose support for basic subgroup operations
...
Relevant CTS tests (requires Vulkan 1.1):
dEQP-VK.subgroups.builtin_var.compute.*
dEQP-VK.subgroups.basic.compute.*
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11620 >
2021-06-29 08:43:06 +02:00
Iago Toral Quiroga
b7cbb38222
v3dv: expose correct subgroup size
...
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11620 >
2021-06-29 08:43:06 +02:00
Iago Toral Quiroga
bf175fbb6a
broadcom/util: don't use compute supergroup packing with subgroups
...
When using subgroups there are additional restrictions to consider,
so for now we keep it simple and disable supergroup packing in that
scenario.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11620 >
2021-06-29 08:43:06 +02:00
Iago Toral Quiroga
10313b03b5
broadcom/compiler: track if a compute shader uses subgroup functionality
...
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11620 >
2021-06-29 08:43:06 +02:00
Iago Toral Quiroga
5081de07f7
broadcom/compiler: add a set_a_flags_for_subgroup helper
...
We will need this in the future to implement more subgroup operations,
so make this code available in a helper.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11620 >
2021-06-29 08:43:06 +02:00
Iago Toral Quiroga
b9f510087d
broadcom/compiler: add a ntq_emit_cond_to_bool helper
...
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11620 >
2021-06-29 08:43:06 +02:00
Iago Toral Quiroga
53341e44ad
broadcom/compiler: implement more subgroup intrinsics
...
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11620 >
2021-06-29 08:43:06 +02:00
Iago Toral Quiroga
87fa5908b3
broadcom/compiler: add FLAFIRST and FLNAFIRST opcodes
...
We will at least need the former to implement subgroupElect()
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11620 >
2021-06-29 08:43:06 +02:00
Iago Toral Quiroga
a9ad04f17d
broadcom/compiler: lower nir_intrinsic_load_num_subgroups
...
The number of subgroups is the local workgroup size divided by the
dispatch width.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11620 >
2021-06-29 08:43:06 +02:00
Iago Toral Quiroga
30dec8b414
broadcom/compiler: implement nir_intrinsic_load_subgroup_id correctly
...
For some reason, this was implemented with the bulk of the compute
shader enablement, but this intrinsic is specific to subgroups and
thus was not really used. Also, its implementation was not correct,
since it was returning the element index within the subgroup, not
the subgroup index itself, which is the index of the batch in the
dispatch.
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11620 >
2021-06-29 08:43:06 +02:00
Lionel Landwerlin
71b7c7b0dc
intel/perf: use the right popcount for 64bits
...
We're currently using the 32bit version which is dropping half the
bits of the 64bits values.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Cc: mesa-stable
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11607 >
2021-06-29 06:29:53 +00:00
Timothy Arceri
01fa90b456
util: add some workarounds for the game Luna Sky
...
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4948
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11602 >
2021-06-29 02:59:28 +00:00
Timothy Arceri
a73e7305e9
util/driconf: add new ignore_write_to_readonly_var workaround
...
This forces the GLSL compiler to ignore writes to readonly vars
rather than throwing an error.
Cc: mesa-stable
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11602 >
2021-06-29 02:59:28 +00:00
Timothy Arceri
e607205af0
glsl: force_glsl_version to shaders with no defined version
...
If a shader has no defined version force_glsl_version was
previous ignored and the shader would default to 110. This updates
the code so that those shaders are forced to a new level also.
We reused the existing code to make sure a sensible value is set
for the version.
Cc: mesa-stable
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11602 >
2021-06-29 02:59:28 +00:00
Timothy Arceri
02dd03ff3c
i965: don't crash on incorrect texture use
...
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4995
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11603 >
2021-06-29 01:38:05 +00:00
Timothy Arceri
328ea8e04a
mesa: don't crash on incorrect texture use
...
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4995
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11603 >
2021-06-29 01:38:05 +00:00
Timothy Arceri
a917c7433a
util/tests: initialise key in cache_test
...
Fixes: e8495646af ("glsl/tests: changes to test_disk_cache_create test")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2631
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11623 >
2021-06-28 23:53:10 +00:00
Yiwei Zhang
58a4ae3b99
venus: resolve AHB external format with DRM format
...
AHardwareBuffer_Format is lossier than DRM_FORMAT_*, which ends up with
unable to resolve implementation defined format upon creating sampler
ycbcr conversion. So we now use DRM format as AHB external format.
An external format error return in vkCreateSamplerYcbcrConversion is
also removed here since that is already an invalid usage per spec
(partly because there is no proper error code to return here).
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org >
Reviewed-by: Chia-I Wu <olvaffe@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11480 >
2021-06-28 22:18:19 +00:00
Yiwei Zhang
0679cffb02
venus: remove unsupported AHB formats
...
Likely not going to support them either.
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org >
Reviewed-by: Chia-I Wu <olvaffe@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11480 >
2021-06-28 22:18:19 +00:00
Yiwei Zhang
891cf98a88
venus: use the mesa "drm-uapi/drm_fourcc.h" header
...
Prepare for later CI integration.
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org >
Reviewed-by: Chia-I Wu <olvaffe@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11480 >
2021-06-28 22:18:19 +00:00
Emma Anholt
71617c3328
i915g: Fix off-by-one in constant count assertion.
...
You can have up to C[31].
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11617 >
2021-06-28 15:01:37 -07:00
Emma Anholt
ccc9418b27
i915g: Mark program errors on setting up temps, constants, and immediates.
...
We would proceed through the compiler, and usually fail for some other
reason (ALU ops, etc.), but best to be sure.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11617 >
2021-06-28 15:01:37 -07:00
Emma Anholt
7ddebb0289
i915g: Remove redundant p->error setting.
...
i915_program_error() already does it.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11617 >
2021-06-28 15:01:37 -07:00
Emma Anholt
ec646fdd45
i915g: Use stdbool.h instead of custom bools.
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11617 >
2021-06-28 15:01:37 -07:00
Emma Anholt
247cee92df
i915g: replace "uint" with normal uint32_t.
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11617 >
2021-06-28 15:01:37 -07:00
Emma Anholt
c786159186
i915g: Improve logging of unsupported opcodes.
...
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11617 >
2021-06-28 15:01:37 -07:00
Emma Anholt
e65ea05276
i915g: Stop translating the fragment program on the first error.
...
It would proceed through printing errors for each of the unsupported loop
opcodes in the program.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11617 >
2021-06-28 15:01:37 -07:00
Emma Anholt
8259ff0d22
i915g: Log program compile errors to mesa_loge().
...
Now these major driver failures are no longer hidden under -DDEBUG, and
would also work on android (you know, if you cared). We do want to
suppress logging for u_blitter shaders that fail to compile during
util_blitter_cache_all_shaders().
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11617 >
2021-06-28 15:01:37 -07:00
Emma Anholt
7921648cd6
i915g: Use the normal compile error path for empty FSes.
...
This means they'll get dumped and you'll see the passthrough FS.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11617 >
2021-06-28 15:01:37 -07:00
Emma Anholt
d83f0c1c04
i915g: Enable dumping of fragment shaders under I915_DEBUG=fs.
...
Probably the most common thing I want to debug in this driver, and we
didn't have a good option for it.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11617 >
2021-06-28 14:58:28 -07:00
Emma Anholt
005b0f015b
i915g: Allow use of I915_DEBUG= options on non-DEBUG builds.
...
All the checks should be cheap, no need making things harder to debug.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11617 >
2021-06-28 14:58:28 -07:00
Emma Anholt
79800a957d
i915g: Bake the decls and program together.
...
Simplifies program upload a bunch, and will let us disasm the program
independently of the whole cmd buffer.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11617 >
2021-06-28 14:58:28 -07:00
Emma Anholt
26afccb97e
i915g: Apply clang-format.
...
Add the format file copied from freedreno, and run clang-format
--style=file -i src/gallium/drivers/i915/*.[ch] (with clang-format 11).
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11617 >
2021-06-28 14:58:28 -07:00
Yiwei Zhang
8391fb98cd
venus: properly support GPU_DATA_BUFFER for AHB
...
CrOS gralloc was missing support for GPU_DATA_BUFFER, which was only
fixed until recently. Now we can allcate properly.
This patch also removes a redundant TODO regarding image format list
support for AHB. vkGetPhysicalDeviceImageFormatProperties2 has already
checked the support for such though it only checks whether the optimal
tiling and the associated drm format modifier for the AHB image format
itself applies to the entire format list or not. Given the use case for
such combination is quite limited, we choose not to add new gralloc
support to force linear modifier as a fallback for wider coverage.
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org >
Reviewed-by: Chia-I Wu <olvaffe@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11501 >
2021-06-28 21:13:54 +00:00
Eleni Maria Stea
e094f75bd0
intel: PAGE_SIZE used in allocators shouldn't be defined on FreeBSD
...
iris, i965, and anv define the PAGE_SIZE in anv_allocator and bufmgr
files. As on FreeBSD the page size is defined in machine/param.h that is
indirectly included by those files, we'd rather define it only when the
system is not FreeBSD to avoid compile errors.
v2: Changed the path in the comment to make clear that machine/params.h
is a FreeBSD system file.
Signed-off-by: Eleni Maria Stea <elene.mst@gmail.com >
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11203 >
2021-06-28 21:12:24 +03:00
Eleni Maria Stea
49e8b77fd9
intel: struct bitset is renamed to brw_bitset
...
Static struct bitset was renamed to brw_bitset as a struct bitset
is defined in sys/_bitset.h included by pthread_np.h on FreeBSD that
is indirectly included by src/intel/compiler/brw_nir_lower_shader_calls.c
Signed-off-by: Eleni Maria Stea <elene.mst@gmail.com >
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11203 >
2021-06-28 21:12:24 +03:00
Eleni Maria Stea
91b83dce0a
util: Removed unused statement from FreeBSD build
...
Statement (void*)debug_name when FreeBSD is defined has no use. Removed
it to fix compiler warnings.
Signed-off-by: Eleni Maria Stea <elene.mst@gmail.com >
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11203 >
2021-06-28 21:12:24 +03:00
Eleni Maria Stea
32b94df23e
util: replaced ENODATA with ENOATTR for non-Linux systems
...
On Linux ENODATA is defined but on BSD, and MacOSX ENOATTR is used
instead. Defined ENODATA to be ENOATTR when the system is not Linux.
v2: Replaced ENODATA and ENOATTR with -EFAULT that is exists everywhere
and added a comment (Ian Romanick)
Signed-off-by: Eleni Maria Stea <elene.mst@gmail.com >
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11203 >
2021-06-28 21:12:24 +03:00
Mike Blumenkrantz
d8bbb9daa2
util/vbuf: flag fallback_always if any prim types are missing from restart modes
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11608 >
2021-06-28 17:05:53 +00:00
Mike Blumenkrantz
00272aa4a1
util/vbuf: always claim support for PATCHES in restart modes
...
this avoids forcing rewrites for patch mode which break tessellation
Reviewed-by: Marek Olšák <marek.olsak@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11608 >
2021-06-28 17:05:53 +00:00
Emma Anholt
fd5293cc43
turnip: Short-circuit if ladder generation for constant index SSBO/UBOs.
...
The compiler *can* eventually chew through all the copy prop, constant
folding, and dead_cf necessary to use just our constant index, but we can
save a whole lot of hassle by chasing the MOVs up front and finding the
constant.
dEQP-VK.ubo.3_level_array.scalar.row_major_mat4.both goes from 2.0s to
1.6s on a release build (3.1s to 2.1s for a debug build like we use in CI).
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11613 >
2021-06-28 16:26:24 +00:00
Emma Anholt
0afab39af9
nir: Add a helper for chasing movs with nir_ssa_scalar().
...
Sometimes you might want to find a constant source without going through
all the copy prop and constant folding to make your source be a
load_const.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net >
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11613 >
2021-06-28 16:26:24 +00:00
Connor Abbott
9133999430
ir3/sched: Speed up live_effect
...
If we've identified another use that isn't scheduled yet, we can break
right away rather than iterating through all the other uses. While this
could be optimized further, this simple change makes
dEQP-VK.subgroups.ballot_broadcast.compute.subgroupbroadcast_ivec4 go
from 40 seconds to 1.9 seconds on a release build according to my
unscientific testing.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11613 >
2021-06-28 16:26:24 +00:00
Connor Abbott
56dc84b95c
freedreno/computerator: Fix local_size typo
...
Fixes: cbc68c79a5 ("freedreno: Add local_size to ir3_shader_variant")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11622 >
2021-06-28 16:06:23 +00:00
Rhys Perry
502b06c4f5
nir/opt_load_store_vectorize: fix check_for_robustness() with deref access
...
We could do better if we knew the nir_address_format to obtain
addition_bits, but the only affected driver (Turnip) probably won't
benefit because it doesn't vectorize across vec4.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com >
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev >
Fixes: 2e7bceb220 ("nir/load_store_vectorizer: fix check_for_robustness() with indirect loads")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4922
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11382 >
2021-06-28 15:15:42 +00:00
Ella-0
86fe8db4aa
anv: expose primary node to VK_EXT_physical_device_drm even when VK_KHR_display is not enabled
...
Fixes: e9e1e0362b ("anv: implement VK_EXT_physical_device_drm")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11616 >
2021-06-28 14:03:22 +00:00
Marek Olšák
24292cc003
radeonsi: move the accepting code into the bbox cull branch in prim discard CS
...
This reduces the number of jumps. No change in behavior.
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11510 >
2021-06-28 13:23:14 +00:00
Marek Olšák
b141e50282
radeonsi: add optimal multi draws and draw-level splitting for prim discard CS
...
This is a partial rewrite of some parts of the code.
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11510 >
2021-06-28 13:23:14 +00:00
Marek Olšák
81365c86f9
radeonsi: fix issues with draw-level splitting for the prim discard CS
...
- move the unreachable statement up by inlining u_decomposed_prims_for_vertices
- the last draw was not submitted after splitting
- move "count" to the non-multi draw path
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11510 >
2021-06-28 13:23:14 +00:00
Marek Olšák
9fa0d2cf35
radeonsi: change how the prim discard CS is enabled and splitting limits
...
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11510 >
2021-06-28 13:23:14 +00:00