diff options
author | Samuel Pitoiset <[email protected]> | 2018-09-12 23:20:38 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2018-09-14 10:59:52 +0200 |
commit | abdf396cbeaec2bfe9da2fd773d42fa3022ca8b5 (patch) | |
tree | 2c538c76569d3537697c8c06f6b61e0e6eb655e4 /src/amd/vulkan/radv_cmd_buffer.c | |
parent | 18464d298b4ffee7fcbf76bba217fce1bf4e9bdd (diff) |
radv: fix VK_EXT_conditional_rendering visibility
It's actually just the opposite.
This fixes the new Sascha conditionalrender demo.
CC: 18.2 <[email protected]>
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_cmd_buffer.c')
-rw-r--r-- | src/amd/vulkan/radv_cmd_buffer.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 33b65b9e771..5b2a45f5cee 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -4468,19 +4468,27 @@ void radv_CmdBeginConditionalRenderingEXT( { RADV_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer); RADV_FROM_HANDLE(radv_buffer, buffer, pConditionalRenderingBegin->buffer); - bool inverted; + bool draw_visible = true; uint64_t va; va = radv_buffer_get_va(buffer->bo) + pConditionalRenderingBegin->offset; - inverted = pConditionalRenderingBegin->flags & VK_CONDITIONAL_RENDERING_INVERTED_BIT_EXT; + /* By default, if the 32-bit value at offset in buffer memory is zero, + * then the rendering commands are discarded, otherwise they are + * executed as normal. If the inverted flag is set, all commands are + * discarded if the value is non zero. + */ + if (pConditionalRenderingBegin->flags & + VK_CONDITIONAL_RENDERING_INVERTED_BIT_EXT) { + draw_visible = false; + } /* Enable predication for this command buffer. */ - si_emit_set_predication_state(cmd_buffer, inverted, va); + si_emit_set_predication_state(cmd_buffer, draw_visible, va); cmd_buffer->state.predicating = true; /* Store conditional rendering user info. */ - cmd_buffer->state.predication_type = inverted; + cmd_buffer->state.predication_type = draw_visible; cmd_buffer->state.predication_va = va; } |