Java 类org.lwjgl.vulkan.VkCommandBufferAllocateInfo 实例源码

项目:oreon-engine    文件:VKRenderEngine.java   
private VkCommandBuffer createCommandBuffer(VkDevice device, long commandPool) {
    VkCommandBufferAllocateInfo cmdBufAllocateInfo = VkCommandBufferAllocateInfo.calloc()
            .sType(VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
            .commandPool(commandPool)
            .level(VK_COMMAND_BUFFER_LEVEL_PRIMARY)
            .commandBufferCount(1);
    PointerBuffer pCommandBuffer = memAllocPointer(1);
    int err = vkAllocateCommandBuffers(device, cmdBufAllocateInfo, pCommandBuffer);
    cmdBufAllocateInfo.free();
    long commandBuffer = pCommandBuffer.get(0);
    memFree(pCommandBuffer);
    if (err != VK_SUCCESS) {
        throw new AssertionError("Failed to allocate command buffer: " + VKUtil.translateVulkanResult(err));
    }
    return new VkCommandBuffer(commandBuffer, device);
}
项目:lwjgl3-swt    文件:ClearScreenDemo.java   
private static VkCommandBuffer createCommandBuffer(VkDevice device, long commandPool) {
    VkCommandBufferAllocateInfo cmdBufAllocateInfo = VkCommandBufferAllocateInfo.calloc()
            .sType(VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
            .commandPool(commandPool)
            .level(VK_COMMAND_BUFFER_LEVEL_PRIMARY)
            .commandBufferCount(1);
    PointerBuffer pCommandBuffer = memAllocPointer(1);
    int err = vkAllocateCommandBuffers(device, cmdBufAllocateInfo, pCommandBuffer);
    cmdBufAllocateInfo.free();
    long commandBuffer = pCommandBuffer.get(0);
    memFree(pCommandBuffer);
    if (err != VK_SUCCESS) {
        throw new AssertionError("Failed to allocate command buffer: " + translateVulkanResult(err));
    }
    return new VkCommandBuffer(commandBuffer, device);
}
项目:autostack    文件:ClearScreenDemoUseNewStack.java   
private static VkCommandBuffer createCommandBuffer(VkDevice device, long commandPool) {
    VkCommandBufferAllocateInfo cmdBufAllocateInfo = VkCommandBufferAllocateInfo.callocStack()
            .sType(VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
            .commandPool(commandPool)
            .level(VK_COMMAND_BUFFER_LEVEL_PRIMARY)
            .commandBufferCount(1);
    PointerBuffer pCommandBuffer = stackMallocPointer(1);
    int err = vkAllocateCommandBuffers(device, cmdBufAllocateInfo, pCommandBuffer);
    long commandBuffer = pCommandBuffer.get(0);
    if (err != VK_SUCCESS) {
        throw new AssertionError("Failed to allocate command buffer: " + translateVulkanResult(err));
    }
    return new VkCommandBuffer(commandBuffer, device);
}
项目:autostack    文件:ClearScreenDemoUseCallerStack.java   
private static VkCommandBuffer createCommandBuffer(VkDevice device, long commandPool) {
    VkCommandBufferAllocateInfo cmdBufAllocateInfo = VkCommandBufferAllocateInfo.callocStack()
            .sType(VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
            .commandPool(commandPool)
            .level(VK_COMMAND_BUFFER_LEVEL_PRIMARY)
            .commandBufferCount(1);
    PointerBuffer pCommandBuffer = stackMallocPointer(1);
    int err = vkAllocateCommandBuffers(device, cmdBufAllocateInfo, pCommandBuffer);
    long commandBuffer = pCommandBuffer.get(0);
    if (err != VK_SUCCESS) {
        throw new AssertionError("Failed to allocate command buffer: " + translateVulkanResult(err));
    }
    return new VkCommandBuffer(commandBuffer, device);
}