diff options
author | Samuel Pitoiset <[email protected]> | 2017-09-18 11:44:54 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-09-20 10:27:32 +0200 |
commit | 505c2fea3a39af039fe6387642ad0e798b998d39 (patch) | |
tree | df5c070fea810e284996280ad204cf696bb84f75 | |
parent | 2ad1f20cd02b1b362d506924a52b7538f9b55d6a (diff) |
radv: add some assertions in vkCmdSetScissor()
To check some valid usage requirements.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Dave Airlie <[email protected]>
-rw-r--r-- | src/amd/vulkan/radv_cmd_buffer.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 5644c1584e7..d7b27cae27c 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -2518,8 +2518,11 @@ void radv_CmdSetScissor( const VkRect2D* pScissors) { RADV_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer); - const uint32_t total_count = firstScissor + scissorCount; + + assert(firstScissor < MAX_SCISSORS); + assert(total_count >= 1 && total_count <= MAX_SCISSORS); + if (cmd_buffer->state.dynamic.scissor.count < total_count) cmd_buffer->state.dynamic.scissor.count = total_count; |