To check some valid usage requirements.

Signed-off-by: Samuel Pitoiset <samuel.pitoi...@gmail.com>
---
 src/amd/vulkan/radv_cmd_buffer.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 3877c17aed..1f38ecbffe 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;
 
-- 
2.14.1

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to