当前位置: 首页>>代码示例>>Java>>正文


Java VkSubpassDescription类代码示例

本文整理汇总了Java中org.lwjgl.vulkan.VkSubpassDescription的典型用法代码示例。如果您正苦于以下问题:Java VkSubpassDescription类的具体用法?Java VkSubpassDescription怎么用?Java VkSubpassDescription使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


VkSubpassDescription类属于org.lwjgl.vulkan包,在下文中一共展示了VkSubpassDescription类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createClearRenderPass

import org.lwjgl.vulkan.VkSubpassDescription; //导入依赖的package包/类
private static long createClearRenderPass(VkDevice device, int colorFormat) {
    VkAttachmentDescription.Buffer attachments = VkAttachmentDescription.callocStack(1)
            .format(colorFormat)
            .samples(VK_SAMPLE_COUNT_1_BIT)
            .loadOp(VK_ATTACHMENT_LOAD_OP_CLEAR)
            .storeOp(VK_ATTACHMENT_STORE_OP_STORE)
            .stencilLoadOp(VK_ATTACHMENT_LOAD_OP_DONT_CARE)
            .stencilStoreOp(VK_ATTACHMENT_STORE_OP_DONT_CARE)
            .initialLayout(VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL)
            .finalLayout(VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);

    VkAttachmentReference.Buffer colorReference = VkAttachmentReference.callocStack(1)
            .attachment(0)
            .layout(VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);

    VkSubpassDescription.Buffer subpass = VkSubpassDescription.callocStack(1)
            .pipelineBindPoint(VK_PIPELINE_BIND_POINT_GRAPHICS)
            .flags(VK_FLAGS_NONE)
            .pInputAttachments(null)
            .colorAttachmentCount(colorReference.remaining())
            .pColorAttachments(colorReference)
            .pResolveAttachments(null)
            .pDepthStencilAttachment(null)
            .pPreserveAttachments(null);

    VkRenderPassCreateInfo renderPassInfo = VkRenderPassCreateInfo.callocStack()
            .sType(VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
            .pNext(NULL)
            .pAttachments(attachments)
            .pSubpasses(subpass)
            .pDependencies(null);

    LongBuffer pRenderPass = stackMallocLong(1);
    int err = vkCreateRenderPass(device, renderPassInfo, null, pRenderPass);
    long renderPass = pRenderPass.get(0);
    if (err != VK_SUCCESS) {
        throw new AssertionError("Failed to create clear render pass: " + translateVulkanResult(err));
    }
    return renderPass;
}
 
开发者ID:LWJGLX,项目名称:autostack,代码行数:41,代码来源:ClearScreenDemoUseNewStack.java

示例2: createRenderPass

import org.lwjgl.vulkan.VkSubpassDescription; //导入依赖的package包/类
private long createRenderPass(VkDevice device, int colorFormat) {
    VkAttachmentDescription.Buffer attachments = VkAttachmentDescription.calloc(1)
            .format(colorFormat)
            .samples(VK_SAMPLE_COUNT_1_BIT)
            .loadOp(VK_ATTACHMENT_LOAD_OP_CLEAR)
            .storeOp(VK_ATTACHMENT_STORE_OP_STORE)
            .stencilLoadOp(VK_ATTACHMENT_LOAD_OP_DONT_CARE)
            .stencilStoreOp(VK_ATTACHMENT_STORE_OP_DONT_CARE)
            .initialLayout(VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL)
            .finalLayout(VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);

    VkAttachmentReference.Buffer colorReference = VkAttachmentReference.calloc(1)
            .attachment(0)
            .layout(VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);

    VkSubpassDescription.Buffer subpass = VkSubpassDescription.calloc(1)
            .pipelineBindPoint(VK_PIPELINE_BIND_POINT_GRAPHICS)
            .flags(0)
            .pInputAttachments(null)
            .colorAttachmentCount(colorReference.remaining())
            .pColorAttachments(colorReference) // <- only color attachment
            .pResolveAttachments(null)
            .pDepthStencilAttachment(null)
            .pPreserveAttachments(null);

    VkRenderPassCreateInfo renderPassInfo = VkRenderPassCreateInfo.calloc()
            .sType(VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
            .pNext(0)
            .pAttachments(attachments)
            .pSubpasses(subpass)
            .pDependencies(null);

    LongBuffer pRenderPass = memAllocLong(1);
    int err = vkCreateRenderPass(device, renderPassInfo, null, pRenderPass);
    long renderPass = pRenderPass.get(0);
    memFree(pRenderPass);
    renderPassInfo.free();
    colorReference.free();
    subpass.free();
    attachments.free();
    if (err != VK_SUCCESS) {
        throw new AssertionError("Failed to create clear render pass: " + VKUtil.translateVulkanResult(err));
    }
    
    return renderPass;
}
 
开发者ID:oreonengine,项目名称:oreon-engine,代码行数:47,代码来源:VKRenderEngine.java

示例3: createClearRenderPass

import org.lwjgl.vulkan.VkSubpassDescription; //导入依赖的package包/类
private static long createClearRenderPass(VkDevice device, int colorFormat) {
    VkAttachmentDescription.Buffer attachments = VkAttachmentDescription.calloc(1)
            .format(colorFormat)
            .samples(VK_SAMPLE_COUNT_1_BIT)
            .loadOp(VK_ATTACHMENT_LOAD_OP_CLEAR)
            .storeOp(VK_ATTACHMENT_STORE_OP_STORE)
            .stencilLoadOp(VK_ATTACHMENT_LOAD_OP_DONT_CARE)
            .stencilStoreOp(VK_ATTACHMENT_STORE_OP_DONT_CARE)
            .initialLayout(VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL)
            .finalLayout(VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);

    VkAttachmentReference.Buffer colorReference = VkAttachmentReference.calloc(1)
            .attachment(0)
            .layout(VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);

    VkSubpassDescription.Buffer subpass = VkSubpassDescription.calloc(1)
            .pipelineBindPoint(VK_PIPELINE_BIND_POINT_GRAPHICS)
            .flags(VK_FLAGS_NONE)
            .pInputAttachments(null)
            .colorAttachmentCount(colorReference.remaining())
            .pColorAttachments(colorReference)
            .pResolveAttachments(null)
            .pDepthStencilAttachment(null)
            .pPreserveAttachments(null);

    VkRenderPassCreateInfo renderPassInfo = VkRenderPassCreateInfo.calloc()
            .sType(VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
            .pNext(NULL)
            .pAttachments(attachments)
            .pSubpasses(subpass)
            .pDependencies(null);

    LongBuffer pRenderPass = memAllocLong(1);
    int err = vkCreateRenderPass(device, renderPassInfo, null, pRenderPass);
    long renderPass = pRenderPass.get(0);
    memFree(pRenderPass);
    renderPassInfo.free();
    colorReference.free();
    subpass.free();
    attachments.free();
    if (err != VK_SUCCESS) {
        throw new AssertionError("Failed to create clear render pass: " + translateVulkanResult(err));
    }
    return renderPass;
}
 
开发者ID:httpdigest,项目名称:lwjgl3-swt,代码行数:46,代码来源:ClearScreenDemo.java


注:本文中的org.lwjgl.vulkan.VkSubpassDescription类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。