diff options
author | Juan A. Suarez Romero <[email protected]> | 2019-02-12 19:19:13 +0100 |
---|---|---|
committer | Juan A. Suarez Romero <[email protected]> | 2019-02-12 19:19:13 +0100 |
commit | 1ad26f941792f07f226c054811be78b0c0ac9fce (patch) | |
tree | cbc96f1796d96e29e5cb39e29e7bbeb5a587b8eb /src/vulkan | |
parent | 6c64413b6f5a01de42853c775acb93a0cfdf6be5 (diff) |
anv/cmd_buffer: check for NULL framebuffer
This can happen when we record a VkCmdDraw in a secondary buffer that
was created inheriting from the primary buffer, but with the framebuffer
set to NULL in the VkCommandBufferInheritanceInfo.
Vulkan 1.1.81 spec says that "the application must ensure (using scissor
if neccesary) that all rendering is contained in the render area [...]
[which] must be contained within the framebuffer dimesions".
While this should be done by the application, commit 465e5a86 added the
clamp to the framebuffer size, in case of application does not do it.
But this requires to know the framebuffer dimensions.
If we do not have a framebuffer at that moment, the best compromise we
can do is to just apply the scissor as it is, and let the application to
ensure the rendering is contained in the render area.
v2: do not clamp to framebuffer if there isn't a framebuffer
v3 (Jason):
- clamp earlier in the conditional
- clamp to render area if command buffer is primary
v4: clamp also x and y to render area (Jason)
v5: rename used variables (Jason)
Fixes: 465e5a86 ("anv: Clamp scissors to the framebuffer boundary")
CC: Jason Ekstrand <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/vulkan')
0 files changed, 0 insertions, 0 deletions