Setting layer_offset would not cause any issues, but it's ignored by the
GPU. Therefore, removing it for correctness.
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41645>
The android extension enables the driver to blit from single-sampled
color attachments.
Adding this image usage expressess that functionality and causes anv to
generate the ISL_FORMAT_RAW-formatted clear color during fast-clears.
This fixes an assert failure when anv tries to override the clear color
format used for a blorp_blit() call to ISL_FORMAT_RAW.
There are other ways to handle this, but this solution is consistent
with our handling of multisample images (which may be resolved as well).
Fixes: 465c186fc5 ("anv: Prepare for format width changes in blorp_copy()")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/15463
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41650>
This is now dead code. This code is not used by RADV.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41461>
We always use sample_id to load the sample position from memory.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41461>
no change in behavior other than getting pixel_coord from the beginning
unconditionally
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41461>
FYI, ac_nir_lower_ps_early is only used by radeonsi.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41461>
The scalarBlockLayout feature was already exposed via the Vulkan 1.2
feature struct, but Vulkan 1.1 clients (e.g. Dawn) need the EXT to
discover it.
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41673>
B10G11R11_UFLOAT_PACK32 maps to V3D_INTERNAL_TYPE_16F on the TLB,
which canonicalizes NaN bit patterns when arbitrary 32 bits are
reinterpreted as that format. The same canonicalization happens in
the blit shader when sampling a B10G11R11 source. Both break the
bit-exactness that vkCmdCopyImage, vkCmdCopyImageToBuffer and
vkCmdCopyBufferToImage require, since the spec defines them as raw
byte copies for any pair of texel-size compatible formats.
Fix it by aliasing the format to R32_UINT whenever B10G11R11 is
involved.
This fixes dEQP-VK.api.copy_and_blit.*b10g11r11*,
dEQP-VK.image.subresource_layout.*b10g11r11* and
dEQP-VK.api.image_clearing.*b10g11r11* failures on V3D 7.1.7 (rpi5)
and V3D 4.2 (rpi4).
Assisted-by: Claude Opus 4.7
Cc: mesa-stable
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41599>
The HW can do up to UINT32_MAX but we're using that value to signal
indirect dispatch arguments.
A game like Resident Evil Requiem will use more than 64k on X
dimension.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41592>
to strengthen it and fix a rare case of incorrect behavior.
This is the incorrect behavior that's fixed:
if (invocation_id == 0)
patch_output[0] = invocation_id;
else if (invocation_id == 1)
patch_output[1] = invocation_id;
else
patch_output[2] = invocation_id;
The stored SSA defs are the same, but each invocation writes a different
value to different outputs, so they are not duplicated, but the code
incorrectly treated them as duplicated and removed [1] and [2].
The requirement for correctness is that if an output is duplicated,
it must have stores in the same blocks as the output it duplicates.
To fix the incorrect behavior, awareness of blocks is added to the algorithm,
which leads to the following new cases that are optimized:
1. Different blocks store different SSA defs, but equal in each block:
if (..) {
output[0] = a;
output[1] = a; // eliminated
} else {
output[0] = b;
output[1] = b; // eliminated
}
2. Different GS emit sections store different SSA defs, but equal in each
section:
output[0] = a;
output[1] = a; // eliminated
emit_vertex;
output[0] = b;
output[1] = b; // eliminated
emit_vertex;
3. A weird case that could be duplicated but is left alone due to
the counterexample above:
if (..)
output[0] = a;
else
output[1] = a;
Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41329>
By adding it to the list of files needed to compile `libmesa` instead of
relying on the racy "build this no matter what" mechanism which is
intended only for root nodes (≈ the binaries that we provide to users).
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41617>
This is temporarily using the main software backend's driver id to
ensure a valid status on CTS. It'll be updated once the vulkan headers
are updated with mr 8272 on khronos side.
Test: dEQP-VK.api.driver_properties#driver_id_match
Reviewed-by: David Gilhooley <djgilhooley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41656>
Fixes the following with meson2hermetic:
src/freedreno/registers/adreno/a6xx_perfcntrs.py/genrule.sbox.textproto
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "gen_header.py", line 1220, in <module>
File "gen_header.py", line 1216, in main
File "gen_header.py", line 1177, in dump_py_defines
File "gen_header.py", line 688, in parse
File "gen_header.py", line 680, in do_parse
File "external/python/cpython3/Modules/pyexpat.c", line 471, in StartElement
File "gen_header.py", line 732, in start_element
File "gen_header.py", line 673, in do_parse
FileNotFoundError:
[Errno 2] No such file or directory: './out/src/freedreno/registers/adreno/adreno_common.xml'
Soong/Bazel `genrules` run in a separate sandbox, and require that
all dependencies be explicitly declared. It is necessary for
reproducible, hermetic and distributed builds.
Meson prefers explicit dependency declaration too, but does not
require it. For example, if `adreno_common.xml` is modified, and
it is in `depend_files` for the `adreno_pm4.xml.h` custom_target,
meson knows to re-gen `adreno_pm4.xml.h` during incremental builds.
For freedreno, the custom targets in `src/freedreno/registers/*`
don't declare all XML dependencies that are actually used.
This patch fixes this. The other option is workaround this in
meson2hermetic, but being more explicit conceptually more correct.
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41518>
Fixes:
src/freedreno/vulkan/tu_knl_kgsl.cc:1455:16:
error: 'alignof' applied to an expression is a GNU extension [-Werror,-Wgnu-alignof-expression]
alignof(*objs), VK_SYSTEM_ALLOCATION_SCOPE_COMMAND);
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41518>
Fixes:
src/freedreno/vulkan/tu_cmd_buffer.cc:2162:10:
error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
The other option is the [[fallthrough]] annotation.
Reviewed-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41518>
UBO and sampler descriptors are smaller than texture descriptors, but
the nature of Vulkan descriptor sets means we need to make them just as
big. Zero out the remaining dwords so that we don't get garbage that
trips up asserts in gfxrecon-replay.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41608>
As most work for maintenance5 is already done in the common Vulkan
runtime, functions required by it are implemented in pvr driver and
blitting functions are changed to use common functions for acquiring
subresource layer count, advertise VK_KHR_maintenance5 now.
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41569>
It's implemented like GetDeviceImageMemoryRequirements by creating a
temporary image.
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41569>
As the functionality of GetImageSubresourceLayout was already a
dedicated function, simply changing the parameters for the function call
is enough to implement GetImageSubresourceLayout2.
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41569>
As the implementation of GetRenderAreaGranularity does not reference the
render pass object, just move it to a new function and use it for both
functions.
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41569>
As index buffer bound checking isn't yet supported by the driver, the
newly added size parameter is just assert-checked.
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41569>