Mesa (staging/19.2): radv: do not emit rbplus if attachments are undefined

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Oct 25 17:02:19 UTC 2019


Module: Mesa
Branch: staging/19.2
Commit: e8d4a75d9a4826f5f94ac62865dde5235cb85daa
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e8d4a75d9a4826f5f94ac62865dde5235cb85daa

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Mon Oct 21 16:03:47 2019 +0200

radv: do not emit rbplus if attachments are undefined

Fixes some crashes with dEQP-VK.geometry.layered.*.secondary_cmd_buffer
on Raven and other chips that allow rbplus.

This just prevents a crash and rbplus probaby needs more work.

Cc: 19.2 <mesa-stable at lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
(cherry picked from commit 956d825ed845dd239b7098eccd5f5a7b4fecad9c)

---

 src/amd/vulkan/radv_cmd_buffer.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index c7c4e2e66f3..cdb63ad70a4 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -998,6 +998,9 @@ radv_emit_rbplus_state(struct radv_cmd_buffer *cmd_buffer)
 	unsigned sx_blend_opt_epsilon = 0;
 	unsigned sx_blend_opt_control = 0;
 
+	if (!cmd_buffer->state.attachments || !subpass)
+		return;
+
 	for (unsigned i = 0; i < subpass->color_count; ++i) {
 		if (subpass->color_attachments[i].attachment == VK_ATTACHMENT_UNUSED) {
 			sx_blend_opt_control |= S_02875C_MRT0_COLOR_OPT_DISABLE(1) << (i * 4);




More information about the mesa-commit mailing list