Skip to content

Commit

Permalink
Fix queue family error.
Browse files Browse the repository at this point in the history
This fixes graphicsCommandPool uses transferCommandPool even if two queue families are different.
  • Loading branch information
stripe2933 committed Dec 20, 2024
1 parent b608ea8 commit 713156e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions impl/MainApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -928,16 +928,18 @@ auto vk_gltf_viewer::MainApp::processEqmapChange(
} };

const vk::raii::CommandPool transferCommandPool { gpu.device, vk::CommandPoolCreateInfo { {}, gpu.queueFamilies.transfer } };

std::variant<vk::CommandPool, vk::raii::CommandPool> computeCommandPool = *transferCommandPool;
std::variant<vk::CommandPool, vk::raii::CommandPool> graphicsCommandPool = *transferCommandPool;
if (gpu.queueFamilies.compute != gpu.queueFamilies.transfer) {
computeCommandPool = decltype(computeCommandPool) {
std::in_place_type<vk::raii::CommandPool>,
gpu.device,
vk::CommandPoolCreateInfo { {}, gpu.queueFamilies.compute },
};
}
else if (gpu.queueFamilies.graphicsPresent != gpu.queueFamilies.transfer) {

std::variant<vk::CommandPool, vk::raii::CommandPool> graphicsCommandPool = *transferCommandPool;
if (gpu.queueFamilies.graphicsPresent != gpu.queueFamilies.transfer) {
graphicsCommandPool = decltype(graphicsCommandPool) {
std::in_place_type<vk::raii::CommandPool>,
gpu.device,
Expand Down

0 comments on commit 713156e

Please sign in to comment.