We don't actually care if previous suspended RP had depth-only draws
with color writes skipped, we only care if previous RP disabled LRZ
writes due to this; the mere fact of first draws being depth-only
doesn't affect LRZ of next draws in any way.
However, for next RPs in suspend-resume chain we have to assume that
previous RP may have had color writes.
For secondary cmdbufs with ordinary renderpasses it is easy to be
less pessimistic, and that's what we do in order to not regress
DXVK performance.
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39293>
radv_dump_shader_stats() printed stats for every shader with a certain
stage, and we called this function each time an RT shader is compiled.
This means we could repeat the stats for a shader.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39484>
This can happen if a loop has no continues, and the later code should work
fine in this situation.
This fixes war_thunder/0013a69e097b2471 on navi21.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Fixes: 6b9d28ab9b ("aco/insert_fp_mode: insert fp mode in reverse")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39481>
Use wl_display_roundtrip() instead of wl_display_flush() when freeing
a swapchain to ensure the compositor has processed buffer release
events before continuing.
wl_display_flush() only sends pending requests without waiting for
the compositor to process them. When rapidly creating and destroying
large swapchain buffers, buffer references may not be released quickly
enough (e.g., during CTS testing), causing memory to accumulate.
Using wl_display_roundtrip() ensures synchronization with the
compositor, allowing buffers to be released promptly.
Signed-off-by: Wei Zhao <Wei.Zhao@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39475>
We were initializing to a nir_const_value of undefined (in practice on x86
builds, a pointer value), with .b set to 0. Those values would get dumped
in the annotated shader disassembly at the end of a test where all inputs
where unexpectedly skipped, producing very surprising output.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
The mul is 24-bit sign-extended, so in simplifying we should retain that.
If nothing else, this keeps us on the happy path of mul24s.
I didn't fix the other broken pattern, since it's not really part of this
MR.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
We were enumerating enough for a single component, but not all the
combinations. This helps show that our fdots fail pretty consistently.
And triggers more skipping from the fany_equal16s thanks to varied inputs.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
As I introduced another layer of iteration for signed zero testing, the
former logic got unwieldy. In fact, it was already unwieldy enough that I
forgot to clear all_skipped when the assert failed, allowing a failing
test to be marked UNSUPPORTED instead of XFAIL.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39369>
Pipeline creation can generate draw state that will, depending on creation
state, assume enabled depth and stencil attachments. Later on, the pipeline
can be used in a render pass that disables those attachments, while the
draw state will still be emitting as if those attachments are present and
usable. Specifically, this affects pairings of depth attachments and
TU_DYNAMIC_STATE_RB_DEPTH_CNTL, and of stencil attachments and
TU_DYNAMIC_STATE_DS.
When a pipeline is bound, ignore its set depth/stencil state if that state
was enabled and the pipeline is either bound outside of a render pass or
inside a render pass that disables the relevant attachment. This way the
depth/stencil state will be treated as dynamic and will be recomputed and
emitted during the draw state emission, taking into account the available
attachments inside the render pass.
Fixes: dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.basic.partial_binding_depth_stencil
Signed-off-by: Zan Dobersek <zdobersek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39323>
MESA_VK_DYNAMIC_DS_DEPTH_BOUNDS_TEST_BOUNDS state should be emitted as part
of TU_DYNAMIC_STATE_RB_DEPTH_CNTL along with other depth state, and not as
part of dynamic stencil state.
Signed-off-by: Zan Dobersek <zdobersek@igalia.com>
Fixes: 979cf7bac0 ("tu: Merge depth/stencil draw states")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39323>
Add support for VK_EXT_blend_operation_advanced to the Honeykrisp
Vulkan driver. Extend agx_blend_rt_key with a tagged mode field
interpreted via pack/unpack helpers for standard and advanced blend
state.
The driver advertises full extension support including all operations,
independent blend, non-premultiplied colors, and correlated overlap.
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38929>
Add support for advanced blending (VK_EXT_blend_operation_advanced and
GL_KHR_blend_equation_advanced), enabling around 40 advanced blend modes
including multiply, screen, overlay, HSL modes (hue, saturation, color,
luminosity), Porter-Duff modes, and extended modes like lineardodge
and vividlight.
Advanced blending slots into the existing blending logic alongside logic
operations and standard blending. The implementation supports both
premultiplied and non-premultiplied alpha for source and destination, and
provides three overlap modes (uncorrelated, conjoint, disjoint).
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38929>
Move the blend equation helper functions (blend_multiply, blend_screen,
blend_overlay, etc.) from gl_nir_lower_blend_equation_advanced.c to a
new shared header file nir_blend_equation_advanced_helper.h.
These helpers implement the mathematical blend operations defined by
KHR_blend_equation_advanced and will be reused by the new NIR lowering
pass for VK_EXT_blend_operation_advanced.
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38929>
Implement state management for VK_EXT_blend_operation_advanced. Add
MESA_VK_DYNAMIC_CB_BLEND_ADVANCED dynamic state and parse
VkPipelineColorBlendAdvancedStateCreateInfoEXT during pipeline creation.
The parsed state is propagated to per-attachment fields for
src_premultiplied, dst_premultiplied, blend_overlap, and clamp_results.
Implement vk_common_CmdSetColorBlendAdvancedEXT for dynamic state
updates. When the extension info is not provided, set Vulkan spec
defaults of srcPremultiplied=true, dstPremultiplied=true, and
blendOverlap=UNCORRELATED.
Per Vulkan spec, attachmentCount is ignored when COLOR_BLEND_ENABLE,
COLOR_BLEND_EQUATION, COLOR_WRITE_MASK, and COLOR_BLEND_ADVANCED are
all dynamic. When advancedBlendCoherentOperations is not enabled, mark
COLOR_BLEND_ADVANCED as dynamic upfront in vk_get_dynamic_graphics_states()
so downstream code only needs to check the dynamic bit.
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38929>