This commit is contained in:
Mars 2024-10-06 18:34:42 -04:00
parent 61a2e9367b
commit 79fdc8c38a
Signed by: pupbrained
GPG key ID: 0FF5B8826803F895
2 changed files with 51 additions and 50 deletions

View file

@ -126,7 +126,7 @@
vulkanDir = "${mesa.drivers}/share/vulkan/icd.d"; vulkanDir = "${mesa.drivers}/share/vulkan/icd.d";
vulkanFiles = builtins.filter (file: builtins.match ".*\\.json$" file != null) (builtins.attrNames (builtins.readDir vulkanDir)); vulkanFiles = builtins.filter (file: builtins.match ".*\\.json$" file != null) (builtins.attrNames (builtins.readDir vulkanDir));
vulkanPaths = lib.concatStringsSep ":" (map (file: "${vulkanDir}/${file}") vulkanFiles); vulkanPaths = lib.concatStringsSep ":" (map (file: "${vulkanDir}/${file}") vulkanFiles);
in "${linuxPackages_latest.nvidia_x11}/share/vulkan/icd.d/nvidia_icd.x86_64.json:${vulkanPaths}"; in "${linuxPackages_latest.nvidia_x11_vulkan_beta}/share/vulkan/icd.d/nvidia_icd.x86_64.json:${vulkanPaths}";
shellHook = '' shellHook = ''
export PATH="${llvmPackages_18.clang-tools.override {enableLibcxx = true;}}/bin:$PATH" export PATH="${llvmPackages_18.clang-tools.override {enableLibcxx = true;}}/bin:$PATH"

View file

@ -604,6 +604,7 @@ class VulkanApp {
} }
fn drawFrame() -> void { fn drawFrame() -> void {
try {
vk::Result result = vk::Result result =
mDevice->waitForFences(mInFlightFences[mCurrentFrame].get(), vk::Bool32(vk::True), UINT64_MAX); mDevice->waitForFences(mInFlightFences[mCurrentFrame].get(), vk::Bool32(vk::True), UINT64_MAX);
@ -630,7 +631,9 @@ class VulkanApp {
mCommandBuffers[mCurrentFrame]->reset(vk::CommandBufferResetFlagBits::eReleaseResources); mCommandBuffers[mCurrentFrame]->reset(vk::CommandBufferResetFlagBits::eReleaseResources);
recordCommandBuffer(mCommandBuffers[mCurrentFrame].get(), imageIndexValue); recordCommandBuffer(mCommandBuffers[mCurrentFrame].get(), imageIndexValue);
std::array<vk::PipelineStageFlags, 1> waitStages = { vk::PipelineStageFlagBits::eColorAttachmentOutput }; std::array<vk::PipelineStageFlags, 1> waitStages = {
vk::PipelineStageFlagBits::eColorAttachmentOutput
};
vk::SubmitInfo submitInfo { vk::SubmitInfo submitInfo {
.waitSemaphoreCount = 1, .waitSemaphoreCount = 1,
@ -652,7 +655,6 @@ class VulkanApp {
.pImageIndices = &imageIndexValue, .pImageIndices = &imageIndexValue,
}; };
try {
vk::Result presentResult = mPresentQueue.presentKHR(presentInfo); vk::Result presentResult = mPresentQueue.presentKHR(presentInfo);
fmt::println("Present result: {}", vk::to_string(presentResult)); fmt::println("Present result: {}", vk::to_string(presentResult));
@ -667,7 +669,6 @@ class VulkanApp {
mCurrentFrame = (mCurrentFrame + 1) % MAX_FRAMES_IN_FLIGHT; mCurrentFrame = (mCurrentFrame + 1) % MAX_FRAMES_IN_FLIGHT;
} catch (vk::OutOfDateKHRError& err) { } catch (vk::OutOfDateKHRError& err) {
fmt::println("Caught OutOfDateKHRError: {}", err.what());
mFramebufferResized = false; mFramebufferResized = false;
recreateSwapChain(); recreateSwapChain();
return; return;