OSDN Git Service

radv: Fix off by one in MAX_VBS assert.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fri, 25 Aug 2017 12:14:12 +0000 (14:14 +0200)
committerAndres Gomez <agomez@igalia.com>
Wed, 6 Sep 2017 15:05:10 +0000 (18:05 +0300)
e.g. 0 + 32 <= 32 should be valid.

Fixes: f4e499ec791 "radv: add initial non-conformant radv vulkan driver"
Tested-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit fba0e078695847bf1e4fdc9e6a44099bf901f4cf)

src/amd/vulkan/radv_cmd_buffer.c

index 4d8a27f..6b0f6df 100644 (file)
@@ -1884,7 +1884,7 @@ void radv_CmdBindVertexBuffers(
        /* We have to defer setting up vertex buffer since we need the buffer
         * stride from the pipeline. */
 
-       assert(firstBinding + bindingCount < MAX_VBS);
+       assert(firstBinding + bindingCount <= MAX_VBS);
        for (uint32_t i = 0; i < bindingCount; i++) {
                vb[firstBinding + i].buffer = radv_buffer_from_handle(pBuffers[i]);
                vb[firstBinding + i].offset = pOffsets[i];