When a VRS view is used with a depth/stencil view, the driver is
expected to copy the VRS rates to the HTILE buffer of the depth/stencil
view. Though if the image uses mipmaps and the base level can't support
HTILE there is no way to copy the rates. The workaround is to force VRS
to be 1x1 which is valid in Vulkan.
This fixes old VKCTS failures on RAPHAEL just because it supports
fragmentShadingRateWithShaderDepthStencilWrites compared to other GPUs
in CI (NAVI21/VANGOGH).
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit da0ee50c3b)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
This reverts commit d5916cb3ca.
The GL_ARB_ES3_compatibility spec, says the following:
> Issues
>
> 1) OpenGL-ES 3.0 contains several features that have been deprecated from
> the latest OpenGL Core specification. These were retained in OpenGL-ES
> 3.0 in order to provide backwards compatibility with OpenGL-ES 2.0. Those
> features are:
>
> [snip]
>
> * Legacy pixel formats - all ALPHA, LUMINANCE, LUMINANCE_ALPHA
>
> [snip]
>
> Should we bring these features back into the OpenGL 4.x Core specification
> so that it is a complete super-set of OpenGL-ES 3.0?
>
> RESOLVED: No, these will not be brought back into OpenGL 4.x Core. Apps
> written for OpenGL-ES 3.0 that want to also be compatible with OpenGL
> should make sure they don't use these features.
So, it seems pretty clear that we shouldn't have included these formats
here. So let's remove them.
Turns out, this is a CTS bug, see this for more details:
https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/6191
Fixes: d5916cb3ca ("mesa: check for ARB_ES3_compatibility in format checks")
(cherry picked from commit b92719f926)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
The Vulkan spec says:
If a fragment shader entry point statically uses an input variable
decorated with a BuiltIn of SampleId or SamplePosition,
sample shading is enabled and a value of 1.0 is used instead of minSampleShading.
If a fragment shader entry point statically uses an input variable decorated
with Sample, sample shading may be enabled and a value of 1.0 will be
used instead of minSampleShading if it is.
This means we have to overwrite the command buffer state entirely.
Cc: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit e7a035df65)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
This message was incorrect from the time it was introduced; the function
can return other error messages. If that happened in reality or not was
a bit more unsure, but that's not a good reason to make a blanket
statement like this. In either case, we do track properly now, and we
have for a long time.
The other, similar message in this function is correct.
Fixes: 916bc4491a ("mesa: Implement proper tracking logic for glGetGraphicsResetStatusARB")
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
(cherry picked from commit afe3f28013)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
Make sure to cast with the deref type that contains more information
than the returned type because it's valid in SPIR-V.
This fixes dEQP-VK.binding_model.descriptor_heap.graphics.*_vectors and
also the PositiveGpuAV.HeapWithUntypedPointers VVL test.
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit 975ae01208)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
We create driver param instructions once we encounter their first use
and cache them for further uses. This creates problems when the first
use occurs in a block that doesn't dominate all further uses. This was
hit in practice with a driver param that was used both in the preamble
and in the main shader.
Fix this by simply not caching driver params. Since they are simply movs
from const regs, ir3_cp or ir3_cse should clean up most cases of
multiple uses.
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: 8b0b81339b ("freedreno/ir3: add NIR compiler")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15418
(cherry picked from commit d8e1409948)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
v3dv_CmdFillBuffer was passing only the user-supplied dstOffset to
meta_fill_buffer, ignoring the destination VkBuffer's mem_offset.
When several VkBuffers share one VkDeviceMemory at different offsets
(sub-allocation) the fill landed on whichever VkBuffer was
bound at offset 0 of the memory object instead of the requested one.
Fixes: 5ed78d91fe ("v3dv: implement vkCmdFillBuffer")
Assisted-by: Claude Opus 4.7
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
(cherry picked from commit 8bd7f1d44b)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
This shouldn't be necessary because SDMA can detile the image just fine,
only buffer->image and image->image need to fallback.
It just works on GFX10+ because RADV is using NBC views, and I think
it works on eg. VEGA10 just by luck due to different
swizzles/alignments.
Fixes: 3d803d7a2e ("radv: Use compute copy for emulated formats")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit 5a95658fa8)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
The kernel looks at drm_panthor_timestamp_info::flags, so it can't be
uninitialized.
Fixes: 302127fe ("pan/kmod: Add timestamp uapi support")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
(cherry picked from commit 109af1b077)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
It's possible to use a shader that has ViewIndex input when multiview
isn't enabled. According to the Vulkan specification, when multiview
isn't enabled in a renderpass, the value of the ViewIndex input should
be 0.
However currently the driver does not emit execution of the PDS code
setting up view index, which leads to stale value to remain in
ViewIndex.
Setup the PDS code for setting view index and emit the command stream
for executing that PDS code when the shader wants ViewIndex, even if
multiview isn't enabled.
Fixes: 9d48088428 ("pvr: add view index support for vertex shaders")
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Nick Hamilton <nick.hamilton@imgtec.com>
(cherry picked from commit 3afc792dc8)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
Otherwise we'll hit a LLVM assert when handling load_const:
llvm/include/llvm/ADT/APInt.h:121: llvm::APInt::APInt(unsigned int, uint64_t, bool, bool): Assertion `llvm::isIntN(BitWidth, val) && "Value is not an N-bit signed value"' failed.
Cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com>
Acked-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 4bad47e991)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
llvmpipe supports real function calls, so we need to call nir_progress on
every function, not just the entry point.
Cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com>
Acked-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 3df48dec23)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
Some vulkancts tests rely on vkGetImageMemoryRequirements to return the same
exact size after exporting and importing an image. This broke when we started
adding padding to sampled surfaces to manage overfetch, because the texture
usage flag does not get applied to the ISL surface when the image is recreated
using an explicit layout.
Fixes: 8d13628f7 ("isl: Add additional alignment/padding requirements to prevent overfetch")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
(cherry picked from commit efc6a3053d)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
handle cases where attachments are remapped to higher indices than
the renderpass was created with
fixes:
dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.local_read.mapping_*_attachments_to_locs_from_*
cc: mesa-stable
(cherry picked from commit 563259eaa9)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
`b3210` was not removed in v11, and is causing a failure in
OpenCL-CTS when running `test_basic
vector_swizzle`. `invalid_instruction` assertion was triggered with
the message:
```
Invalid 8-bit widen:
r3 = LSHIFT_OR.v4i8.flow2 u1.b3210, u256, u256.b0
```
Restore `b3210` in the ISA XML file, and handle the case for it in
`va_pack_widen`.
Fixes: c36326d3 ("pan/bi: Remove b3210 from valid swizzle")
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
(cherry picked from commit 2b1d9a2afc)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
The parallel copies use the reloaded values in their srcs so make sure
reloads happen before them.
Fixes a RA validation error in Windrose.
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: fa22b0901a ("ir3/ra: Add specialized shared register RA/spilling")
(cherry picked from commit c67118a6eb)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
Initialize 'info' to NULL to avoid use of potentially uninitialized
value at the cleanup label when an earlier error causes a goto before
png_create_info_struct() is reached.
screenshot.cpp:808:9: warning: variable 'info' is used uninitialized whenever 'if'
condition is true [-Wsometimes-uninitialized]
screenshot.cpp:814:9: warning: variable 'info' is used uninitialized whenever 'if'
condition is true [-Wsometimes-uninitialized]
Fixes: eda55c7c2f ("vulkan/screenshot-layer: Add Vulkan screenshot layer")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Casey Bowman <casey.g.bowman@intel.com>
(cherry picked from commit 4c46cd8e9d)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
if this is unset, the view index is garbage and any shader accessing it
will read garbage
this is the source of all lavapipe flakes.
cc: mesa-stable
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
(cherry picked from commit 099933f004)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
`disk_cache_init` asserts `build_id_len == BUILD_ID_EXPECTED_HASH_LENGTH`
(20, the size of a GNU build-id SHA1 on ELF). Mach-O has no GNU
build-id; the closest equivalent is `LC_UUID`, which is 16 bytes.
`build_id_length()` therefore returns a non-20 value on macOS and the
assert fires as soon as `ENABLE_SHADER_CACHE` is on.
Relax the assertion to `<=` so any non-empty build id of acceptable
length is accepted while still catching impossibly long ones. The hash
only needs *some* unique-per-build identifier; the actual byte count
hashed is whatever `build_id_length()` returned.
Cc: mesa-stable
Suggested-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: Louis Montagne <louis@askem.eu>
(cherry picked from commit 14992361a4)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
../src/mesa/state_tracker/st_atom_framebuffer.c:203:27: warning: implicit conversion from 'unsigned int' to 'uint8_t' (aka 'unsigned char') changes value from 4294967295 to 255 [-Wconstant-conversion]
Fixes: 2b37f23314 ("gallium: fix pipe_framebuffer_state::view_mask")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
(cherry picked from commit 27c870a283)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
The vertex input state can be NULL if rasterization is disabled with
dynamic vertex inputs.
The input assembly state can be NULL if rasterization is disabled
and both states are dynamic (primive topology and primitive restart
enable).
This fixes a segfault with gpu-ratemeter vk_dyn.prim
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit 87be392251)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
We rely on tu_lrz_flush_valid_at_suspending_rp_boundary() to make sure
that subsequent resuming renderpasses get the correct LRZ state. However
this doesn't work on early a6xx GPUs without tracking support. Disable
LRZ in this case, similar to secondaries.
Cc: mesa-stable
(cherry picked from commit 638b10c5e0)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
This matches the behavior of radv for these two.
Fixes:
dEQP-VK.binding_model.descriptor_buffer.traditional_buffer.capture_replay.sparse_buffer_descriptor_data_consistency
dEQP-VK.binding_model.descriptor_buffer.traditional_buffer.capture_replay.sparse_buffer_descriptor_data_consistency_and_usage
Fixes: 8feed47fce ("tu: Initial support for sparse binding")
(cherry picked from commit 7372c7c9e2)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
samplers can be destroyed whenever, which makes it problematic to store
the pointers into descriptor layouts for embedded samplers. instead,
directly store the descriptor info into the layout, since this is all
constant data which is unaffected by object lifetimes
cc: mesa-stable
(cherry picked from commit 1da8528bbc)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
in a sequence like:
* CmdPushConstants
* CmdBindPipeline (doesn't use push constants)
* CmdDispatch
* CmdBindPipeline (uses push constants)
* CmdDispatch
the previous code would never update pushconsts and the second dispatch
would have no valid data
cc: mesa-stable
(cherry picked from commit f4461b66b6)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
Add a convenience helper function, and use this for checking
whether queries are active. This fixes a bug where we were
basically always using a software fallback for indirect
rendering rather than the CSF hardware loop.
Cc: mesa-stable
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
(cherry picked from commit 80e6b468f4)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>
Ensure the INDEX_OFFSET CSF register is set to 0 before an ordinary
draw. This is normally the case, but indirect draws can change it.
Cc: mesa-stable
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
(cherry picked from commit 2b10a6c37f)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41540>