private static void submitCommandBuffer(VkQueue queue, VkCommandBuffer commandBuffer) { if (commandBuffer == null || commandBuffer.address() == 0) return; VkSubmitInfo submitInfo = VkSubmitInfo.calloc() .sType(VK_STRUCTURE_TYPE_SUBMIT_INFO); PointerBuffer pCommandBuffers = memAllocPointer(1) .put(commandBuffer) .flip(); submitInfo.pCommandBuffers(pCommandBuffers); int err = vkQueueSubmit(queue, submitInfo, VK_NULL_HANDLE); memFree(pCommandBuffers); submitInfo.free(); if (err != VK_SUCCESS) { throw new AssertionError("Failed to submit command buffer: " + VKUtil.translateVulkanResult(err)); } }
private static void submitCommandBuffer(VkQueue queue, VkCommandBuffer commandBuffer) { if (commandBuffer == null || commandBuffer.address() == NULL) return; VkSubmitInfo submitInfo = VkSubmitInfo.calloc() .sType(VK_STRUCTURE_TYPE_SUBMIT_INFO); PointerBuffer pCommandBuffers = memAllocPointer(1) .put(commandBuffer) .flip(); submitInfo.pCommandBuffers(pCommandBuffers); int err = vkQueueSubmit(queue, submitInfo, VK_NULL_HANDLE); memFree(pCommandBuffers); submitInfo.free(); if (err != VK_SUCCESS) { throw new AssertionError("Failed to submit command buffer: " + translateVulkanResult(err)); } }
private static void submitCommandBuffer(VkQueue queue, VkCommandBuffer commandBuffer) { if (commandBuffer == null || commandBuffer.address() == NULL) return; VkSubmitInfo submitInfo = VkSubmitInfo.callocStack() .sType(VK_STRUCTURE_TYPE_SUBMIT_INFO); PointerBuffer pCommandBuffers = stackMallocPointer(1) .put(commandBuffer) .flip(); submitInfo.pCommandBuffers(pCommandBuffers); int err = vkQueueSubmit(queue, submitInfo, VK_NULL_HANDLE); if (err != VK_SUCCESS) { throw new AssertionError("Failed to submit command buffer: " + translateVulkanResult(err)); } }