diff --git a/projects/fire_works/src/main.cpp b/projects/fire_works/src/main.cpp index ef1a66bfcd501948d0ed3004ba793071ce1dc7a0..7c70349574e5b05474263a12c2ffa99ac1f79500 100644 --- a/projects/fire_works/src/main.cpp +++ b/projects/fire_works/src/main.cpp @@ -201,6 +201,14 @@ int main(int argc, const char **argv) { features.requireFeature([](vk::PhysicalDeviceFeatures& features) { features.setGeometryShader(true); }); + + features.requireExtensionFeature<vk::PhysicalDeviceDescriptorIndexingFeatures>( + VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, + [](vk::PhysicalDeviceDescriptorIndexingFeatures& features) { + features.setDescriptorBindingPartiallyBound(true); + features.setDescriptorBindingVariableDescriptorCount(true); + } + ); vkcv::Core core = vkcv::Core::create( "Firework", diff --git a/projects/indirect_dispatch/src/App.cpp b/projects/indirect_dispatch/src/App.cpp index 1c42cafc8c45a00ea151f3bbe86cd02b6161bf7a..7e29ea3358e5e5c3034c96e645f611abab711de3 100644 --- a/projects/indirect_dispatch/src/App.cpp +++ b/projects/indirect_dispatch/src/App.cpp @@ -48,6 +48,14 @@ static vkcv::Features getAppFeatures() { features.setShaderFloat16(true); } ); + + features.requireExtensionFeature<vk::PhysicalDeviceDescriptorIndexingFeatures>( + VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, + [](vk::PhysicalDeviceDescriptorIndexingFeatures& features) { + features.setDescriptorBindingPartiallyBound(true); + features.setDescriptorBindingVariableDescriptorCount(true); + } + ); features.tryExtensionFeature<vk::PhysicalDeviceCoherentMemoryFeaturesAMD>( VK_AMD_DEVICE_COHERENT_MEMORY_EXTENSION_NAME, diff --git a/projects/indirect_draw/src/main.cpp b/projects/indirect_draw/src/main.cpp index 424f2e0708a38d60426aff78a61d4ea0af7bad5f..c24dd260812b7837742089eeedb8d3b3de2a42af 100644 --- a/projects/indirect_draw/src/main.cpp +++ b/projects/indirect_draw/src/main.cpp @@ -279,7 +279,6 @@ int main(int argc, const char** argv) { }); features.requireExtension(VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME); - features.requireExtension(VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME); features.requireExtensionFeature<vk::PhysicalDeviceDescriptorIndexingFeatures>( VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, [](vk::PhysicalDeviceDescriptorIndexingFeatures &features) { // features.setShaderInputAttachmentArrayDynamicIndexing(true); diff --git a/projects/particle_simulation/src/main.cpp b/projects/particle_simulation/src/main.cpp index 09cb702809f9f7c48105d8b95b4f398f2bbeb014..af291257fb38e3958f6f3f51fc92365d4eda181f 100644 --- a/projects/particle_simulation/src/main.cpp +++ b/projects/particle_simulation/src/main.cpp @@ -16,12 +16,22 @@ int main(int argc, const char **argv) { uint32_t windowWidth = 800; uint32_t windowHeight = 600; + + vkcv::Features features; + features.requireExtension(VK_KHR_SWAPCHAIN_EXTENSION_NAME); + features.requireExtensionFeature<vk::PhysicalDeviceDescriptorIndexingFeatures>( + VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, + [](vk::PhysicalDeviceDescriptorIndexingFeatures& features) { + features.setDescriptorBindingPartiallyBound(true); + features.setDescriptorBindingVariableDescriptorCount(true); + } + ); vkcv::Core core = vkcv::Core::create( applicationName, VK_MAKE_VERSION(0, 0, 1), {vk::QueueFlagBits::eTransfer, vk::QueueFlagBits::eGraphics, vk::QueueFlagBits::eCompute}, - { VK_KHR_SWAPCHAIN_EXTENSION_NAME } + features ); vkcv::WindowHandle windowHandle = core.createWindow(applicationName, windowWidth, windowHeight, true); vkcv::Window& window = core.getWindow(windowHandle); diff --git a/projects/path_tracer/src/main.cpp b/projects/path_tracer/src/main.cpp index 1a87015e58aee80feebb4bc5fafac0a482da5743..8e37e6af541461ab4b6135c8f39d9d3c54d598f0 100644 --- a/projects/path_tracer/src/main.cpp +++ b/projects/path_tracer/src/main.cpp @@ -47,11 +47,22 @@ int main(int argc, const char** argv) { const std::string applicationName = "Path Tracer"; + vkcv::Features features; + features.requireExtension(VK_KHR_SWAPCHAIN_EXTENSION_NAME); + + features.requireExtensionFeature<vk::PhysicalDeviceDescriptorIndexingFeatures>( + VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, + [](vk::PhysicalDeviceDescriptorIndexingFeatures& features) { + features.setDescriptorBindingPartiallyBound(true); + features.setDescriptorBindingVariableDescriptorCount(true); + } + ); + vkcv::Core core = vkcv::Core::create( applicationName, VK_MAKE_VERSION(0, 0, 1), { vk::QueueFlagBits::eTransfer,vk::QueueFlagBits::eGraphics, vk::QueueFlagBits::eCompute }, - { "VK_KHR_swapchain" } + features ); const int initialWidth = 1280; diff --git a/projects/ray_tracer/src/main.cpp b/projects/ray_tracer/src/main.cpp index 1a906d5d8141148acbbf767163fb173f8053d466..838fd15421d1a2ffde88ccd75309d2afa0d44e6c 100644 --- a/projects/ray_tracer/src/main.cpp +++ b/projects/ray_tracer/src/main.cpp @@ -35,11 +35,22 @@ int main(int argc, const char** argv) { const int windowWidth = 800; const int windowHeight = 600; + vkcv::Features features; + features.requireExtension(VK_KHR_SWAPCHAIN_EXTENSION_NAME); + + features.requireExtensionFeature<vk::PhysicalDeviceDescriptorIndexingFeatures>( + VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, + [](vk::PhysicalDeviceDescriptorIndexingFeatures& features) { + features.setDescriptorBindingPartiallyBound(true); + features.setDescriptorBindingVariableDescriptorCount(true); + } + ); + vkcv::Core core = vkcv::Core::create( applicationName, VK_MAKE_VERSION(0, 0, 1), { vk::QueueFlagBits::eTransfer,vk::QueueFlagBits::eGraphics, vk::QueueFlagBits::eCompute }, - { "VK_KHR_swapchain" } + features ); vkcv::WindowHandle windowHandle = core.createWindow(applicationName, windowWidth, windowHeight, true); diff --git a/projects/sph/src/main.cpp b/projects/sph/src/main.cpp index 3d8cf07842e542036125c26a2f95f298ec043343..b24ad3851c445602d5e385a54dac9009c2cb8263 100644 --- a/projects/sph/src/main.cpp +++ b/projects/sph/src/main.cpp @@ -16,12 +16,23 @@ int main(int argc, const char **argv) { const std::string applicationName = "SPH"; + vkcv::Features features; + features.requireExtension(VK_KHR_SWAPCHAIN_EXTENSION_NAME); + + features.requireExtensionFeature<vk::PhysicalDeviceDescriptorIndexingFeatures>( + VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, + [](vk::PhysicalDeviceDescriptorIndexingFeatures& features) { + features.setDescriptorBindingPartiallyBound(true); + features.setDescriptorBindingVariableDescriptorCount(true); + } + ); + // creating core object that will handle all vulkan objects vkcv::Core core = vkcv::Core::create( applicationName, VK_MAKE_VERSION(0, 0, 1), { vk::QueueFlagBits::eTransfer, vk::QueueFlagBits::eGraphics, vk::QueueFlagBits::eCompute }, - { VK_KHR_SWAPCHAIN_EXTENSION_NAME } + features ); vkcv::WindowHandle windowHandle = core.createWindow(applicationName, 1280, 720, true); diff --git a/projects/voxelization/src/main.cpp b/projects/voxelization/src/main.cpp index 9a6492b80febb61e38ee3a90f29921d5ca7ed9ba..835bbf27f64e286ba1c097ecf137703fb73cb8b2 100644 --- a/projects/voxelization/src/main.cpp +++ b/projects/voxelization/src/main.cpp @@ -37,6 +37,7 @@ int main(int argc, const char** argv) { VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME, [](vk::PhysicalDeviceDescriptorIndexingFeatures& features) { features.setDescriptorBindingPartiallyBound(true); + features.setDescriptorBindingVariableDescriptorCount(true); } ); diff --git a/src/vkcv/Core.cpp b/src/vkcv/Core.cpp index 4e7d9d94a3ed00a650c82eba7068e1e2e4e49fab..5213c572dc5ee5ac5a69ff574c6f5cee6fbea88c 100644 --- a/src/vkcv/Core.cpp +++ b/src/vkcv/Core.cpp @@ -309,9 +309,6 @@ namespace vkcv { m_currentSwapchainImageIndex = std::numeric_limits<uint32_t>::max(); } - m_Context.getDevice().waitIdle(); // TODO: this is a sin against graphics programming, but - // its getting late - Alex - m_ImageManager->setCurrentSwapchainImageIndex(m_currentSwapchainImageIndex); return (m_currentSwapchainImageIndex != std::numeric_limits<uint32_t>::max());