anv/cmd_buffer: skip vkCmdExecuteCommands() on broken command buffers
authorIago Toral Quiroga <itoral@igalia.com>
Mon, 6 Mar 2017 11:16:05 +0000 (12:16 +0100)
committerIago Toral Quiroga <itoral@igalia.com>
Thu, 16 Mar 2017 10:40:05 +0000 (11:40 +0100)
v2: Assert on secondary commands, applications should've called
    vkEndCommandBuffer() and received an error for them before (Jason)

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/intel/vulkan/genX_cmd_buffer.c

index 89aeff2c9d6751163f7fd11ee0c1aa429c74d7fa..4d14fcd2f733f22006fde25541e9f0e32ea79ac5 100644 (file)
@@ -646,6 +646,9 @@ genX(CmdExecuteCommands)(
 
    assert(primary->level == VK_COMMAND_BUFFER_LEVEL_PRIMARY);
 
+   if (anv_batch_has_error(&primary->batch))
+      return;
+
    /* The secondary command buffers will assume that the PMA fix is disabled
     * when they begin executing.  Make sure this is true.
     */
@@ -655,6 +658,7 @@ genX(CmdExecuteCommands)(
       ANV_FROM_HANDLE(anv_cmd_buffer, secondary, pCmdBuffers[i]);
 
       assert(secondary->level == VK_COMMAND_BUFFER_LEVEL_SECONDARY);
+      assert(!anv_batch_has_error(&secondary->batch));
 
       if (secondary->usage_flags &
           VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT) {