SaschaWillems / Vulkan-glTF-PBR

Physical based rendering with Vulkan using glTF 2.0 models
MIT License
915 stars 124 forks source link

When I create a offscreen Render pass to save the scene, the program always stucks. #43

Closed Superlee506 closed 4 years ago

Superlee506 commented 4 years ago

Thanks for this great project. I want to save the pbr result in a texutre, so I need to add a offscreen render pass. I implement this as follows:

  1. prepare offscreen renderPass as in https://github.com/SaschaWillems/Vulkan/tree/master/examples/offscreen.

  2. prepare a offscreen pipeline

    rasterizationStateCI.cullMode = VK_CULL_MODE_FRONT_BIT;
    pipelineCI.renderPass = offscreenPass.renderPass;
    VK_CHECK_RESULT(vkCreateGraphicsPipelines(
        device, pipelineCache, 1, &pipelineCI, nullptr, &pipelines.offscreen));
  3. build a command buffer and change the the recordCommandBuffers function.

But, when I run the project, it always stuck. I don't know why. Any suggestion would be appreciated.

SaschaWillems commented 4 years ago

It's pretty much impossible to help without a proper error description. What does "it always stuck" mean? Do you get an error? Do you get validation layer messages?

Vulkan applications usually can't get stuck at a rendering operation for too long as the TDR will kick in which will result in a Vulkan error.