ready for remove swapchain

main-headless
ink-soul 2024-04-16 14:45:19 +08:00
parent 57e8516d0c
commit c2b3bbec51
4 changed files with 17 additions and 13 deletions

View File

@ -110,8 +110,8 @@ void VulkanExampleBase::prepare()
/*
Swapchain
*/
initSwapchain();
setupSwapChain();
//initSwapchain();
//setupSwapChain();
#if defined(VK_USE_PLATFORM_ANDROID_KHR)
width = swapChain.extent.width;

Binary file not shown.

View File

@ -1992,12 +1992,14 @@ PlumageRender::PlumageRender()
outputImageSequence();
imageSequenceToVideo();
VK_CHECK_RESULT(vkWaitForFences(device, 1, &waitFences[frameIndex], VK_TRUE, UINT64_MAX));
imageSequenceToVideo();
VK_CHECK_RESULT(vkResetFences(device, 1, &waitFences[frameIndex]));
/*
VkResult acquire = swapChain.acquireNextImage(presentCompleteSemaphores[frameIndex], &currentBuffer);
if ((acquire == VK_ERROR_OUT_OF_DATE_KHR) || (acquire == VK_SUBOPTIMAL_KHR)) {
windowResize();
@ -2007,6 +2009,7 @@ PlumageRender::PlumageRender()
}
*/
// Update UBOs
updateUniformBuffers();
@ -2015,18 +2018,19 @@ PlumageRender::PlumageRender()
memcpy(currentUB.params.mapped, &shaderData, sizeof(shaderData));
memcpy(currentUB.skybox.mapped, &shaderDataSkybox, sizeof(shaderDataSkybox));
const VkPipelineStageFlags waitDstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
VkSubmitInfo submitInfo{};
submitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
submitInfo.pWaitDstStageMask = &waitDstStageMask;
submitInfo.pWaitSemaphores = &presentCompleteSemaphores[frameIndex];
submitInfo.waitSemaphoreCount = 1;
//submitInfo.pWaitSemaphores = &presentCompleteSemaphores[frameIndex];
//submitInfo.waitSemaphoreCount = 1;
submitInfo.pSignalSemaphores = &renderCompleteSemaphores[frameIndex];
submitInfo.signalSemaphoreCount = 1;
submitInfo.pCommandBuffers = &commandBuffers[currentBuffer];
submitInfo.commandBufferCount = 1;
VK_CHECK_RESULT(vkQueueSubmit(queue, 1, &submitInfo, waitFences[frameIndex]));
//显示队列
/*
VkResult present = swapChain.queuePresent(queue, currentBuffer, renderCompleteSemaphores[frameIndex]);
@ -2308,7 +2312,7 @@ PlumageRender::PlumageRender()
for (int32_t i = 0; i < __argc; i++) { PlumageRender::args.push_back(__argv[i]); };
plumageRender = new PlumageRender();
plumageRender->initVulkan();
plumageRender->setupWindow(hInstance, WndProc);
//plumageRender->setupWindow(hInstance, WndProc);
plumageRender->prepare();
plumageRender->renderLoop();
delete(plumageRender);

View File

@ -139,9 +139,9 @@ public:
struct FilePath
{ //model path
std::string glTFModelFilePath = getAssetPath() + "models/sauvage_perfume.glb";
std::string modelVertShaderPath = getAssetPath() + "buster_drone/shaders/glsl/mesh.vert.spv";
std::string modelFragShaderPath = getAssetPath() + "buster_drone/shaders/glsl/mesh.frag.spv";
std::string glTFModelFilePath = getAssetPath() + "models/DamagedHelmet/DamagedHelmet.gltf";
//std::string modelVertShaderPath = getAssetPath() + "buster_drone/shaders/glsl/mesh.vert.spv";
//std::string modelFragShaderPath = getAssetPath() + "buster_drone/shaders/glsl/mesh.frag.spv";
//ui
std::string uiVertShaderPath = getAssetPath() + "shaders/ui.vert.spv";
@ -152,7 +152,7 @@ public:
std::string skyboxVertShaderPath = getAssetPath() + "shaders/skybox.vert.spv";
std::string skyboxFragShaderPath = getAssetPath() + "shaders/skybox.frag.spv";
std::string iblTexturesFilePath = getAssetPath() + "textures/hdr/gcanyon_cube.ktx";
//std::string iblTexturesFilePath = getAssetPath() + "textures/hdr/gcanyon_cube.ktx";
//tonemapping
std::string tonemappingVertShaderPath = getAssetPath() + "buster_drone/shaders/glsl/genbrdflut.vert.spv";
std::string tonemappingEnableFragShaderPath = getAssetPath() + "buster_drone/shaders/glsl/tonemapping_enable.frag.spv";
@ -169,7 +169,7 @@ public:
std::string brdfVertShaderPath = getAssetPath() + "shaders/genbrdflut.vert.spv";
std::string brdfFragShaderPath = getAssetPath() + "shaders/genbrdflut.frag.spv";
// environment map texture
std::string envMapFilePath = getAssetPath() + "environments/kloofendal_43d_clear_puresky_hdr16f_cube.ktx";
std::string envMapFilePath = getAssetPath() + "environments/metro_noord_4k_hdr16f_cube.ktx";
std::string emptyEnvmapFilePath = getAssetPath() + "textures/empty.ktx";
// pbr shader
std::string pbrVertShaderPath = getAssetPath() + "shaders/pbr.vert.spv";