diff options
author | Samuel Pitoiset <[email protected]> | 2019-10-21 16:03:47 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2019-10-23 08:57:31 +0200 |
commit | 956d825ed845dd239b7098eccd5f5a7b4fecad9c (patch) | |
tree | bf2679a376417b364ae97da85d1e72a580354641 /src/amd | |
parent | 411ad8e7c5973f58cdc94d5ce45df21c7b994f52 (diff) |
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 <[email protected]>
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/vulkan/radv_cmd_buffer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 6a9002eaa44..fb2490f6382 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -1001,6 +1001,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); |