diff --git a/base/VulkanRaytracingSample.cpp b/base/VulkanRaytracingSample.cpp index 5628cea8..dadb0552 100644 --- a/base/VulkanRaytracingSample.cpp +++ b/base/VulkanRaytracingSample.cpp @@ -1,25 +1,105 @@ /* * Extended sample base class for ray tracing based samples * -* Copyright (C) 2020 by Sascha Willems - www.saschawillems.de +* Copyright (C) 2020-2021 by Sascha Willems - www.saschawillems.de * * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) */ #include "VulkanRaytracingSample.h" -void VulkanRaytracingSample::enableExtensions(bool rayqueryOnly) +void VulkanRaytracingSample::updateRenderPass() +{ + // Update the default render pass with different color attachment load ops to keep attachment contents + // With this change, we can e.g. draw an UI on top of the ray traced scene + + vkDestroyRenderPass(device, renderPass, nullptr); + + std::array attachments = {}; + // Color attachment + attachments[0].format = swapChain.colorFormat; + attachments[0].samples = VK_SAMPLE_COUNT_1_BIT; + attachments[0].loadOp = VK_ATTACHMENT_LOAD_OP_LOAD; + attachments[0].storeOp = VK_ATTACHMENT_STORE_OP_STORE; + attachments[0].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE; + attachments[0].stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE; + attachments[0].initialLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR; + attachments[0].finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR; + // Depth attachment + attachments[1].format = depthFormat; + attachments[1].samples = VK_SAMPLE_COUNT_1_BIT; + attachments[1].loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR; + attachments[1].storeOp = VK_ATTACHMENT_STORE_OP_STORE; + attachments[1].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_CLEAR; + attachments[1].stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE; + attachments[1].initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; + attachments[1].finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; + + VkAttachmentReference colorReference = {}; + colorReference.attachment = 0; + colorReference.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; + + VkAttachmentReference depthReference = {}; + depthReference.attachment = 1; + depthReference.layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; + + VkSubpassDescription subpassDescription = {}; + subpassDescription.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS; + subpassDescription.colorAttachmentCount = 1; + subpassDescription.pColorAttachments = &colorReference; + subpassDescription.pDepthStencilAttachment = &depthReference; + subpassDescription.inputAttachmentCount = 0; + subpassDescription.pInputAttachments = nullptr; + subpassDescription.preserveAttachmentCount = 0; + subpassDescription.pPreserveAttachments = nullptr; + subpassDescription.pResolveAttachments = nullptr; + + // Subpass dependencies for layout transitions + std::array dependencies; + + dependencies[0].srcSubpass = VK_SUBPASS_EXTERNAL; + dependencies[0].dstSubpass = 0; + dependencies[0].srcStageMask = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT; + dependencies[0].dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT; + dependencies[0].srcAccessMask = VK_ACCESS_MEMORY_READ_BIT; + dependencies[0].dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; + dependencies[0].dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT; + + dependencies[1].srcSubpass = 0; + dependencies[1].dstSubpass = VK_SUBPASS_EXTERNAL; + dependencies[1].srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT; + dependencies[1].dstStageMask = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT; + dependencies[1].srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; + dependencies[1].dstAccessMask = VK_ACCESS_MEMORY_READ_BIT; + dependencies[1].dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT; + + VkRenderPassCreateInfo renderPassInfo = {}; + renderPassInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO; + renderPassInfo.attachmentCount = static_cast(attachments.size()); + renderPassInfo.pAttachments = attachments.data(); + renderPassInfo.subpassCount = 1; + renderPassInfo.pSubpasses = &subpassDescription; + renderPassInfo.dependencyCount = static_cast(dependencies.size()); + renderPassInfo.pDependencies = dependencies.data(); + VK_CHECK_RESULT(vkCreateRenderPass(device, &renderPassInfo, nullptr, &renderPass)); +} + +void VulkanRaytracingSample::enableExtensions() { // Require Vulkan 1.1 apiVersion = VK_API_VERSION_1_1; // Ray tracing related extensions required by this sample enabledDeviceExtensions.push_back(VK_KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME); - if (!rayqueryOnly) enabledDeviceExtensions.push_back(VK_KHR_RAY_TRACING_PIPELINE_EXTENSION_NAME); + if (!rayQueryOnly) { + enabledDeviceExtensions.push_back(VK_KHR_RAY_TRACING_PIPELINE_EXTENSION_NAME); + } // Required by VK_KHR_acceleration_structure enabledDeviceExtensions.push_back(VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME); - if (!rayqueryOnly) enabledDeviceExtensions.push_back(VK_KHR_DEFERRED_HOST_OPERATIONS_EXTENSION_NAME); + if (!rayQueryOnly) { + enabledDeviceExtensions.push_back(VK_KHR_DEFERRED_HOST_OPERATIONS_EXTENSION_NAME); + } enabledDeviceExtensions.push_back(VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME); // Required for VK_KHR_ray_tracing_pipeline @@ -199,6 +279,10 @@ void VulkanRaytracingSample::prepare() vkCmdTraceRaysKHR = reinterpret_cast(vkGetDeviceProcAddr(device, "vkCmdTraceRaysKHR")); vkGetRayTracingShaderGroupHandlesKHR = reinterpret_cast(vkGetDeviceProcAddr(device, "vkGetRayTracingShaderGroupHandlesKHR")); vkCreateRayTracingPipelinesKHR = reinterpret_cast(vkGetDeviceProcAddr(device, "vkCreateRayTracingPipelinesKHR")); + // Update the render pass to keep the color attachment contents, so we can draw the UI on top of the ray traced output + if (!rayQueryOnly) { + updateRenderPass(); + } } VkStridedDeviceAddressRegionKHR VulkanRaytracingSample::getSbtEntryStridedDeviceAddressRegion(VkBuffer buffer, uint32_t handleCount) @@ -224,3 +308,24 @@ void VulkanRaytracingSample::createShaderBindingTable(ShaderBindingTable& shader // Map persistent shaderBindingTable.map(); } + +void VulkanRaytracingSample::drawUI(VkCommandBuffer commandBuffer, VkFramebuffer framebuffer) +{ + VkClearValue clearValues[2]; + clearValues[0].color = defaultClearColor; + clearValues[1].depthStencil = { 1.0f, 0 }; + + VkRenderPassBeginInfo renderPassBeginInfo = vks::initializers::renderPassBeginInfo(); + renderPassBeginInfo.renderPass = renderPass; + renderPassBeginInfo.renderArea.offset.x = 0; + renderPassBeginInfo.renderArea.offset.y = 0; + renderPassBeginInfo.renderArea.extent.width = width; + renderPassBeginInfo.renderArea.extent.height = height; + renderPassBeginInfo.clearValueCount = 2; + renderPassBeginInfo.pClearValues = clearValues; + renderPassBeginInfo.framebuffer = framebuffer; + + vkCmdBeginRenderPass(commandBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE); + VulkanExampleBase::drawUI(commandBuffer); + vkCmdEndRenderPass(commandBuffer); +} diff --git a/base/VulkanRaytracingSample.h b/base/VulkanRaytracingSample.h index e32f8adf..85bdc341 100644 --- a/base/VulkanRaytracingSample.h +++ b/base/VulkanRaytracingSample.h @@ -15,6 +15,9 @@ class VulkanRaytracingSample : public VulkanExampleBase { +protected: + // Update the default render pass with different color attachment load ops + virtual void updateRenderPass(); public: // Function pointers for ray tracing related stuff PFN_vkGetBufferDeviceAddressKHR vkGetBufferDeviceAddressKHR; @@ -45,7 +48,7 @@ public: VkDeviceMemory memory = VK_NULL_HANDLE; }; - // Holds information for a ray tracing tracing acceleration structure + // Holds information for a ray tracing acceleration structure struct AccelerationStructure { VkAccelerationStructureKHR handle; uint64_t deviceAddress = 0; @@ -67,7 +70,10 @@ public: VkStridedDeviceAddressRegionKHR stridedDeviceAddressRegion{}; }; - void enableExtensions(bool rayqueryOnly = false); + // Set to true, to denote that the sample only uses ray queries (changes extension and render pass handling) + bool rayQueryOnly = false; + + void enableExtensions(); ScratchBuffer createScratchBuffer(VkDeviceSize size); void deleteScratchBuffer(ScratchBuffer& scratchBuffer); void createAccelerationStructure(AccelerationStructure& accelerationStructure, VkAccelerationStructureTypeKHR type, VkAccelerationStructureBuildSizesInfoKHR buildSizeInfo); @@ -77,6 +83,8 @@ public: void deleteStorageImage(); VkStridedDeviceAddressRegionKHR getSbtEntryStridedDeviceAddressRegion(VkBuffer buffer, uint32_t handleCount); void createShaderBindingTable(ShaderBindingTable& shaderBindingTable, uint32_t handleCount); + // Draw the ImGUI UI overlay using a render pass + void drawUI(VkCommandBuffer commandBuffer, VkFramebuffer framebuffer); virtual void prepare(); }; diff --git a/base/vulkanexamplebase.h b/base/vulkanexamplebase.h index 12fe99d5..6f7e2bf8 100644 --- a/base/vulkanexamplebase.h +++ b/base/vulkanexamplebase.h @@ -200,7 +200,7 @@ public: /** @brief Set to true if v-sync will be forced for the swapchain */ bool vsync = false; /** @brief Enable UI overlay */ - bool overlay = false; + bool overlay = true; } settings; VkClearColorValue defaultClearColor = { { 0.025f, 0.025f, 0.025f, 1.0f } }; diff --git a/examples/bloom/bloom.cpp b/examples/bloom/bloom.cpp index 11b49dc0..a775c00b 100644 --- a/examples/bloom/bloom.cpp +++ b/examples/bloom/bloom.cpp @@ -97,7 +97,6 @@ public: { title = "Bloom (offscreen rendering)"; timerSpeed *= 0.5f; - settings.overlay = true; camera.type = Camera::CameraType::lookat; camera.setPosition(glm::vec3(0.0f, 0.0f, -10.25f)); camera.setRotation(glm::vec3(7.5f, -343.0f, 0.0f)); diff --git a/examples/computecloth/computecloth.cpp b/examples/computecloth/computecloth.cpp index 22d769d1..b08fd55c 100644 --- a/examples/computecloth/computecloth.cpp +++ b/examples/computecloth/computecloth.cpp @@ -96,7 +96,6 @@ public: camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f); camera.setRotation(glm::vec3(-30.0f, -45.0f, 0.0f)); camera.setTranslation(glm::vec3(0.0f, 0.0f, -5.0f)); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/computecullandlod/computecullandlod.cpp b/examples/computecullandlod/computecullandlod.cpp index a55904a4..c1888659 100644 --- a/examples/computecullandlod/computecullandlod.cpp +++ b/examples/computecullandlod/computecullandlod.cpp @@ -98,7 +98,6 @@ public: camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f); camera.setTranslation(glm::vec3(0.5f, 0.0f, 0.0f)); camera.movementSpeed = 5.0f; - settings.overlay = true; memset(&indirectStats, 0, sizeof(indirectStats)); } diff --git a/examples/computenbody/computenbody.cpp b/examples/computenbody/computenbody.cpp index 84d1c278..0d9b2a32 100644 --- a/examples/computenbody/computenbody.cpp +++ b/examples/computenbody/computenbody.cpp @@ -82,7 +82,6 @@ public: VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) { title = "Compute shader N-body system"; - settings.overlay = true; camera.type = Camera::CameraType::lookat; camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f); camera.setRotation(glm::vec3(-26.0f, 75.0f, 0.0f)); diff --git a/examples/computeparticles/computeparticles.cpp b/examples/computeparticles/computeparticles.cpp index bdfc49e4..46bb3ca7 100644 --- a/examples/computeparticles/computeparticles.cpp +++ b/examples/computeparticles/computeparticles.cpp @@ -78,7 +78,6 @@ public: VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) { title = "Compute shader particle system"; - settings.overlay = true; } ~VulkanExample() diff --git a/examples/computeraytracing/computeraytracing.cpp b/examples/computeraytracing/computeraytracing.cpp index f99893bc..ee18f8bd 100644 --- a/examples/computeraytracing/computeraytracing.cpp +++ b/examples/computeraytracing/computeraytracing.cpp @@ -81,7 +81,6 @@ public: VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) { title = "Compute shader ray tracing"; - settings.overlay = true; compute.ubo.aspectRatio = (float)width / (float)height; timerSpeed *= 0.25f; diff --git a/examples/computeshader/computeshader.cpp b/examples/computeshader/computeshader.cpp index dec255c4..96cf6e67 100644 --- a/examples/computeshader/computeshader.cpp +++ b/examples/computeshader/computeshader.cpp @@ -74,7 +74,6 @@ public: camera.setPosition(glm::vec3(0.0f, 0.0f, -2.0f)); camera.setRotation(glm::vec3(0.0f)); camera.setPerspective(60.0f, (float)width * 0.5f / (float)height, 1.0f, 256.0f); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/conditionalrender/conditionalrender.cpp b/examples/conditionalrender/conditionalrender.cpp index 5a888eca..3c8195e9 100644 --- a/examples/conditionalrender/conditionalrender.cpp +++ b/examples/conditionalrender/conditionalrender.cpp @@ -43,7 +43,6 @@ public: VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) { title = "Conditional rendering"; - settings.overlay = true; camera.type = Camera::CameraType::lookat; camera.setPerspective(45.0f, (float)width / (float)height, 0.1f, 512.0f); camera.setRotation(glm::vec3(-2.25f, -52.0f, 0.0f)); diff --git a/examples/conservativeraster/conservativeraster.cpp b/examples/conservativeraster/conservativeraster.cpp index 20e76ce7..19cc838c 100644 --- a/examples/conservativeraster/conservativeraster.cpp +++ b/examples/conservativeraster/conservativeraster.cpp @@ -87,7 +87,6 @@ public: VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) { title = "Conservative rasterization"; - settings.overlay = true; camera.type = Camera::CameraType::lookat; camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f); diff --git a/examples/debugmarker/debugmarker.cpp b/examples/debugmarker/debugmarker.cpp index 5f69c841..dc5e42a8 100644 --- a/examples/debugmarker/debugmarker.cpp +++ b/examples/debugmarker/debugmarker.cpp @@ -218,7 +218,6 @@ public: VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) { title = "Debugging with VK_EXT_debug_marker"; - settings.overlay = true; camera.setRotation(glm::vec3(-4.35f, 16.25f, 0.0f)); camera.setRotationSpeed(0.5f); camera.setPosition(glm::vec3(0.1f, 1.1f, -8.5f)); diff --git a/examples/deferred/deferred.cpp b/examples/deferred/deferred.cpp index c62ee304..8c5db8d9 100644 --- a/examples/deferred/deferred.cpp +++ b/examples/deferred/deferred.cpp @@ -111,7 +111,6 @@ public: camera.position = { 2.15f, 0.3f, -8.75f }; camera.setRotation(glm::vec3(-0.75f, 12.5f, 0.0f)); camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/deferredmultisampling/deferredmultisampling.cpp b/examples/deferredmultisampling/deferredmultisampling.cpp index 3f98b30f..3e95ae45 100644 --- a/examples/deferredmultisampling/deferredmultisampling.cpp +++ b/examples/deferredmultisampling/deferredmultisampling.cpp @@ -102,7 +102,6 @@ public: camera.setRotation(glm::vec3(-0.75f, 12.5f, 0.0f)); camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); paused = true; - settings.overlay = true; } ~VulkanExample() diff --git a/examples/deferredshadows/deferredshadows.cpp b/examples/deferredshadows/deferredshadows.cpp index 6ae3fcc1..73c20988 100644 --- a/examples/deferredshadows/deferredshadows.cpp +++ b/examples/deferredshadows/deferredshadows.cpp @@ -146,7 +146,6 @@ public: camera.setPerspective(60.0f, (float)width / (float)height, zNear, zFar); timerSpeed *= 0.25f; paused = true; - settings.overlay = true; } ~VulkanExample() diff --git a/examples/descriptorindexing/descriptorindexing.cpp b/examples/descriptorindexing/descriptorindexing.cpp index e72a60bf..354d3b55 100644 --- a/examples/descriptorindexing/descriptorindexing.cpp +++ b/examples/descriptorindexing/descriptorindexing.cpp @@ -48,7 +48,6 @@ public: VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) { title = "Descriptor indexing"; - settings.overlay = true; camera.type = Camera::CameraType::lookat; camera.setPosition(glm::vec3(0.0f, 0.0f, -10.0f)); camera.setRotation(glm::vec3(-35.0f, 0.0f, 0.0f)); diff --git a/examples/descriptorsets/descriptorsets.cpp b/examples/descriptorsets/descriptorsets.cpp index dcfb5385..5afbf6aa 100644 --- a/examples/descriptorsets/descriptorsets.cpp +++ b/examples/descriptorsets/descriptorsets.cpp @@ -41,7 +41,6 @@ public: VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) { title = "Using descriptor Sets"; - settings.overlay = true; camera.type = Camera::CameraType::lookat; camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f); camera.setRotation(glm::vec3(0.0f, 0.0f, 0.0f)); diff --git a/examples/displacement/displacement.cpp b/examples/displacement/displacement.cpp index 3ab093a2..125ff200 100644 --- a/examples/displacement/displacement.cpp +++ b/examples/displacement/displacement.cpp @@ -55,7 +55,6 @@ public: camera.setPosition(glm::vec3(0.0f, 0.0f, -1.25f)); camera.setRotation(glm::vec3(-20.0f, 45.0f, 0.0f)); camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/distancefieldfonts/distancefieldfonts.cpp b/examples/distancefieldfonts/distancefieldfonts.cpp index eac15676..30cafc75 100644 --- a/examples/distancefieldfonts/distancefieldfonts.cpp +++ b/examples/distancefieldfonts/distancefieldfonts.cpp @@ -100,7 +100,6 @@ public: camera.setPosition(glm::vec3(0.0f, 0.0f, -2.0f)); camera.setRotation(glm::vec3(0.0f)); camera.setPerspective(splitScreen ? 30.0f : 45.0f, (float)width / (float)(height * ((splitScreen) ? 0.5f : 1.0f)), 1.0f, 256.0f); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/dynamicuniformbuffer/dynamicuniformbuffer.cpp b/examples/dynamicuniformbuffer/dynamicuniformbuffer.cpp index 1ac90c20..d8487b54 100644 --- a/examples/dynamicuniformbuffer/dynamicuniformbuffer.cpp +++ b/examples/dynamicuniformbuffer/dynamicuniformbuffer.cpp @@ -101,7 +101,6 @@ public: camera.setPosition(glm::vec3(0.0f, 0.0f, -30.0f)); camera.setRotation(glm::vec3(0.0f)); camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/gears/gears.cpp b/examples/gears/gears.cpp index f01172b9..f3a059ea 100644 --- a/examples/gears/gears.cpp +++ b/examples/gears/gears.cpp @@ -38,7 +38,6 @@ public: camera.setRotation(glm::vec3(-23.75f, 41.25f, 21.0f)); camera.setPerspective(60.0f, (float)width / (float)height, 0.001f, 256.0f); timerSpeed *= 0.25f; - settings.overlay = true; } ~VulkanExample() diff --git a/examples/geometryshader/geometryshader.cpp b/examples/geometryshader/geometryshader.cpp index b8776f20..5fe9e4a3 100644 --- a/examples/geometryshader/geometryshader.cpp +++ b/examples/geometryshader/geometryshader.cpp @@ -51,7 +51,6 @@ public: camera.setPosition(glm::vec3(0.0f, 0.0f, -1.0f)); camera.setRotation(glm::vec3(0.0f, -25.0f, 0.0f)); camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 128.0f); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/gltfloading/gltfloading.cpp b/examples/gltfloading/gltfloading.cpp index 5f043e14..687a86dc 100644 --- a/examples/gltfloading/gltfloading.cpp +++ b/examples/gltfloading/gltfloading.cpp @@ -409,7 +409,6 @@ public: camera.setPosition(glm::vec3(0.0f, -0.1f, -1.0f)); camera.setRotation(glm::vec3(0.0f, -135.0f, 0.0f)); camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/gltfscenerendering/gltfscenerendering.cpp b/examples/gltfscenerendering/gltfscenerendering.cpp index 76e80e09..44322ad7 100644 --- a/examples/gltfscenerendering/gltfscenerendering.cpp +++ b/examples/gltfscenerendering/gltfscenerendering.cpp @@ -291,7 +291,6 @@ VulkanExample::VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) camera.setPosition(glm::vec3(0.0f, 1.0f, 0.0f)); camera.setRotation(glm::vec3(0.0f, -90.0f, 0.0f)); camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); - settings.overlay = true; } VulkanExample::~VulkanExample() diff --git a/examples/gltfskinning/gltfskinning.cpp b/examples/gltfskinning/gltfskinning.cpp index a95cb287..5a830578 100644 --- a/examples/gltfskinning/gltfskinning.cpp +++ b/examples/gltfskinning/gltfskinning.cpp @@ -649,7 +649,6 @@ VulkanExample::VulkanExample() : camera.setPosition(glm::vec3(0.0f, 0.75f, -2.0f)); camera.setRotation(glm::vec3(0.0f, 0.0f, 0.0f)); camera.setPerspective(60.0f, (float) width / (float) height, 0.1f, 256.0f); - settings.overlay = true; } VulkanExample::~VulkanExample() diff --git a/examples/hdr/hdr.cpp b/examples/hdr/hdr.cpp index 37e40168..cda5b452 100644 --- a/examples/hdr/hdr.cpp +++ b/examples/hdr/hdr.cpp @@ -109,7 +109,6 @@ public: camera.setPosition(glm::vec3(0.0f, 0.0f, -6.0f)); camera.setRotation(glm::vec3(0.0f, 0.0f, 0.0f)); camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/indirectdraw/indirectdraw.cpp b/examples/indirectdraw/indirectdraw.cpp index c541a0c1..c5e373a9 100644 --- a/examples/indirectdraw/indirectdraw.cpp +++ b/examples/indirectdraw/indirectdraw.cpp @@ -99,7 +99,6 @@ public: camera.setRotation(glm::vec3(-12.0f, 159.0f, 0.0f)); camera.setTranslation(glm::vec3(0.4f, 1.25f, 0.0f)); camera.movementSpeed = 5.0f; - settings.overlay = true; } ~VulkanExample() diff --git a/examples/inlineuniformblocks/inlineuniformblocks.cpp b/examples/inlineuniformblocks/inlineuniformblocks.cpp index 9fb0f92e..5b1725c0 100644 --- a/examples/inlineuniformblocks/inlineuniformblocks.cpp +++ b/examples/inlineuniformblocks/inlineuniformblocks.cpp @@ -72,7 +72,6 @@ public: camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); camera.movementSpeed = 4.0f; camera.rotationSpeed = 0.25f; - settings.overlay = true; srand((unsigned int)time(0)); diff --git a/examples/inputattachments/inputattachments.cpp b/examples/inputattachments/inputattachments.cpp index 22377ef2..4b454b08 100644 --- a/examples/inputattachments/inputattachments.cpp +++ b/examples/inputattachments/inputattachments.cpp @@ -79,7 +79,6 @@ public: camera.setPosition(glm::vec3(1.65f, 1.75f, -6.15f)); camera.setRotation(glm::vec3(-12.75f, 380.0f, 0.0f)); camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); - settings.overlay = true; UIOverlay.subpass = 1; } diff --git a/examples/instancing/instancing.cpp b/examples/instancing/instancing.cpp index 02058768..d8dbe2b7 100644 --- a/examples/instancing/instancing.cpp +++ b/examples/instancing/instancing.cpp @@ -79,7 +79,6 @@ public: camera.setPosition(glm::vec3(5.5f, -1.85f, -18.5f)); camera.setRotation(glm::vec3(-17.2f, -4.7f, 0.0f)); camera.setPerspective(60.0f, (float)width / (float)height, 1.0f, 256.0f); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/multisampling/multisampling.cpp b/examples/multisampling/multisampling.cpp index d962b253..408e18f7 100644 --- a/examples/multisampling/multisampling.cpp +++ b/examples/multisampling/multisampling.cpp @@ -56,7 +56,6 @@ public: camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); camera.setRotation(glm::vec3(0.0f, -90.0f, 0.0f)); camera.setTranslation(glm::vec3(2.5f, 2.5f, -7.5f)); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/multithreading/multithreading.cpp b/examples/multithreading/multithreading.cpp index 1c6e2dc4..38ef02f2 100644 --- a/examples/multithreading/multithreading.cpp +++ b/examples/multithreading/multithreading.cpp @@ -103,7 +103,6 @@ public: camera.setRotation(glm::vec3(0.0f)); camera.setRotationSpeed(0.5f); camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); - settings.overlay = true; // Get number of max. concurrent threads numThreads = std::thread::hardware_concurrency(); assert(numThreads > 0); diff --git a/examples/multiview/multiview.cpp b/examples/multiview/multiview.cpp index 36066dc2..20aa3d70 100644 --- a/examples/multiview/multiview.cpp +++ b/examples/multiview/multiview.cpp @@ -63,7 +63,6 @@ public: camera.setRotation(glm::vec3(0.0f, 90.0f, 0.0f)); camera.setTranslation(glm::vec3(7.0f, 3.2f, 0.0f)); camera.movementSpeed = 5.0f; - settings.overlay = true; // Enable extension required for multiview enabledDeviceExtensions.push_back(VK_KHR_MULTIVIEW_EXTENSION_NAME); diff --git a/examples/negativeviewportheight/negativeviewportheight.cpp b/examples/negativeviewportheight/negativeviewportheight.cpp index ba6a20fa..bf86730b 100644 --- a/examples/negativeviewportheight/negativeviewportheight.cpp +++ b/examples/negativeviewportheight/negativeviewportheight.cpp @@ -52,7 +52,6 @@ public: VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) { title = "Negative Viewport height"; - settings.overlay = true; // [POI] VK_KHR_MAINTENANCE1 is required for using negative viewport heights // Note: This is core as of Vulkan 1.1. So if you target 1.1 you don't have to explicitly enable this enabledDeviceExtensions.push_back(VK_KHR_MAINTENANCE1_EXTENSION_NAME); diff --git a/examples/occlusionquery/occlusionquery.cpp b/examples/occlusionquery/occlusionquery.cpp index 33f3fd7c..43e5d003 100644 --- a/examples/occlusionquery/occlusionquery.cpp +++ b/examples/occlusionquery/occlusionquery.cpp @@ -67,7 +67,6 @@ public: camera.setRotation(glm::vec3(0.0f, -123.75f, 0.0f)); camera.setRotationSpeed(0.5f); camera.setPerspective(60.0f, (float)width / (float)height, 1.0f, 256.0f); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/offscreen/offscreen.cpp b/examples/offscreen/offscreen.cpp index 5a0d4d51..4ae6cbe7 100644 --- a/examples/offscreen/offscreen.cpp +++ b/examples/offscreen/offscreen.cpp @@ -88,7 +88,6 @@ public: camera.setRotation(glm::vec3(-2.5f, 0.0f, 0.0f)); camera.setRotationSpeed(0.5f); camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); - settings.overlay = true; // The scene shader uses a clipping plane, so this feature has to be enabled enabledFeatures.shaderClipDistance = VK_TRUE; } diff --git a/examples/oit/oit.cpp b/examples/oit/oit.cpp index 98641deb..4458c3d4 100644 --- a/examples/oit/oit.cpp +++ b/examples/oit/oit.cpp @@ -83,7 +83,6 @@ public: camera.setPosition(glm::vec3(0.0f, 0.0f, -6.0f)); camera.setRotation(glm::vec3(0.0f, 0.0f, 0.0f)); camera.setPerspective(60.0f, (float) width / (float) height, 0.1f, 256.0f); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/parallaxmapping/parallaxmapping.cpp b/examples/parallaxmapping/parallaxmapping.cpp index b24a2d6b..d9af12e8 100644 --- a/examples/parallaxmapping/parallaxmapping.cpp +++ b/examples/parallaxmapping/parallaxmapping.cpp @@ -70,7 +70,6 @@ public: camera.setPosition(glm::vec3(0.0f, 1.25f, -1.5f)); camera.setRotation(glm::vec3(-45.0f, 0.0f, 0.0f)); camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/particlefire/particlefire.cpp b/examples/particlefire/particlefire.cpp index 4900771a..b4b9bb55 100644 --- a/examples/particlefire/particlefire.cpp +++ b/examples/particlefire/particlefire.cpp @@ -104,7 +104,6 @@ public: camera.setPosition(glm::vec3(0.0f, 0.0f, -75.0f)); camera.setRotation(glm::vec3(-15.0f, 45.0f, 0.0f)); camera.setPerspective(60.0f, (float)width / (float)height, 1.0f, 256.0f); - settings.overlay = true; timerSpeed *= 8.0f; rndEngine.seed(benchmark.active ? 0 : (unsigned)time(nullptr)); } diff --git a/examples/pbrbasic/pbrbasic.cpp b/examples/pbrbasic/pbrbasic.cpp index 989f8722..8eb6a176 100644 --- a/examples/pbrbasic/pbrbasic.cpp +++ b/examples/pbrbasic/pbrbasic.cpp @@ -81,7 +81,6 @@ public: camera.rotationSpeed = 0.25f; paused = true; timerSpeed *= 0.25f; - settings.overlay = true; // Setup some default materials (source: https://seblagarde.wordpress.com/2011/08/17/feeding-a-physical-based-lighting-mode/) materials.push_back(Material("Gold", glm::vec3(1.0f, 0.765557f, 0.336057f), 0.1f, 1.0f)); diff --git a/examples/pbribl/pbribl.cpp b/examples/pbribl/pbribl.cpp index 0c5344a8..49daccb3 100644 --- a/examples/pbribl/pbribl.cpp +++ b/examples/pbribl/pbribl.cpp @@ -118,8 +118,6 @@ public: materials.push_back(Material("Red", glm::vec3(1.0f, 0.0f, 0.0f))); materials.push_back(Material("Blue", glm::vec3(0.0f, 0.0f, 1.0f))); - settings.overlay = true; - for (auto material : materials) { materialNames.push_back(material.name); } diff --git a/examples/pbrtexture/pbrtexture.cpp b/examples/pbrtexture/pbrtexture.cpp index 0ce7eeb5..5be56716 100644 --- a/examples/pbrtexture/pbrtexture.cpp +++ b/examples/pbrtexture/pbrtexture.cpp @@ -82,8 +82,6 @@ public: camera.setRotation({ -7.75f, 150.25f, 0.0f }); camera.setPosition({ 0.7f, 0.1f, 1.7f }); - - settings.overlay = true; } ~VulkanExample() diff --git a/examples/pipelines/pipelines.cpp b/examples/pipelines/pipelines.cpp index e4a65bec..68d0415a 100644 --- a/examples/pipelines/pipelines.cpp +++ b/examples/pipelines/pipelines.cpp @@ -43,7 +43,6 @@ public: camera.setRotation(glm::vec3(-25.0f, 15.0f, 0.0f)); camera.setRotationSpeed(0.5f); camera.setPerspective(60.0f, (float)(width / 3.0f) / (float)height, 0.1f, 256.0f); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/pipelinestatistics/pipelinestatistics.cpp b/examples/pipelinestatistics/pipelinestatistics.cpp index cfba59a8..3d4292c0 100644 --- a/examples/pipelinestatistics/pipelinestatistics.cpp +++ b/examples/pipelinestatistics/pipelinestatistics.cpp @@ -60,7 +60,6 @@ public: camera.movementSpeed = 4.0f; camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); camera.rotationSpeed = 0.25f; - settings.overlay = true; } ~VulkanExample() diff --git a/examples/pushconstants/pushconstants.cpp b/examples/pushconstants/pushconstants.cpp index 5e34109b..5005698a 100644 --- a/examples/pushconstants/pushconstants.cpp +++ b/examples/pushconstants/pushconstants.cpp @@ -57,7 +57,6 @@ public: camera.setRotation(glm::vec3(0.0, 0.0f, 0.0f)); camera.setPerspective(60.0f, (float) width / (float) height, 0.1f, 256.0f); camera.setRotationSpeed(0.5f); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/pushdescriptors/pushdescriptors.cpp b/examples/pushdescriptors/pushdescriptors.cpp index e8df9602..080f5b41 100644 --- a/examples/pushdescriptors/pushdescriptors.cpp +++ b/examples/pushdescriptors/pushdescriptors.cpp @@ -52,7 +52,6 @@ public: VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) { title = "Push descriptors"; - settings.overlay = true; camera.type = Camera::CameraType::lookat; camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f); camera.setRotation(glm::vec3(0.0f, 0.0f, 0.0f)); diff --git a/examples/radialblur/radialblur.cpp b/examples/radialblur/radialblur.cpp index f3a8ff49..22daed60 100644 --- a/examples/radialblur/radialblur.cpp +++ b/examples/radialblur/radialblur.cpp @@ -89,7 +89,6 @@ public: camera.setRotation(glm::vec3(-16.25f, -28.75f, 0.0f)); camera.setPerspective(45.0f, (float)width / (float)height, 1.0f, 256.0f); timerSpeed *= 0.5f; - settings.overlay = true; } ~VulkanExample() diff --git a/examples/rayquery/rayquery.cpp b/examples/rayquery/rayquery.cpp index dec0c9df..a432fb3a 100644 --- a/examples/rayquery/rayquery.cpp +++ b/examples/rayquery/rayquery.cpp @@ -46,8 +46,8 @@ public: camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f); camera.setRotation(glm::vec3(0.0f, 0.0f, 0.0f)); camera.setTranslation(glm::vec3(0.0f, 3.0f, -10.0f)); - settings.overlay = true; - enableExtensions(true); + rayQueryOnly = true; + enableExtensions(); enabledDeviceExtensions.push_back(VK_KHR_RAY_QUERY_EXTENSION_NAME); } @@ -271,7 +271,7 @@ public: vkCmdBindPipeline(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline); scene.draw(drawCmdBuffers[i]); - drawUI(drawCmdBuffers[i]); + VulkanExampleBase::drawUI(drawCmdBuffers[i]); vkCmdEndRenderPass(drawCmdBuffers[i]); diff --git a/examples/raytracingcallable/raytracingcallable.cpp b/examples/raytracingcallable/raytracingcallable.cpp index fbcd125c..411a7331 100644 --- a/examples/raytracingcallable/raytracingcallable.cpp +++ b/examples/raytracingcallable/raytracingcallable.cpp @@ -1,7 +1,7 @@ /* * Vulkan Example - Hardware accelerated ray tracing callable shaders example * -* Dynamically calls different shaders based on the geoemtry id in the closest hit shader +* Dynamically calls different shaders based on the geometry id in the closest hit shader * * Relevant code parts are marked with [POI] * @@ -47,7 +47,6 @@ public: VulkanExample() : VulkanRaytracingSample() { title = "Ray tracing callable shaders"; - settings.overlay = false; timerSpeed *= 0.25f; camera.type = Camera::CameraType::lookat; camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f); @@ -581,6 +580,8 @@ public: VK_IMAGE_LAYOUT_GENERAL, subresourceRange); + drawUI(drawCmdBuffers[i], frameBuffers[i]); + VK_CHECK_RESULT(vkEndCommandBuffer(drawCmdBuffers[i])); } } diff --git a/examples/raytracingreflections/raytracingreflections.cpp b/examples/raytracingreflections/raytracingreflections.cpp index 0358aec7..359b027a 100644 --- a/examples/raytracingreflections/raytracingreflections.cpp +++ b/examples/raytracingreflections/raytracingreflections.cpp @@ -43,7 +43,6 @@ public: VulkanExample() : VulkanRaytracingSample() { title = "Ray tracing reflections"; - settings.overlay = false; timerSpeed *= 0.5f; camera.rotationSpeed *= 0.25f; camera.type = Camera::CameraType::firstperson; @@ -519,10 +518,7 @@ public: VK_IMAGE_LAYOUT_GENERAL, subresourceRange); - //@todo: Default render pass setup will overwrite contents - //vkCmdBeginRenderPass(drawCmdBuffers[i], &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE); - //drawUI(drawCmdBuffers[i]); - //vkCmdEndRenderPass(drawCmdBuffers[i]); + drawUI(drawCmdBuffers[i], frameBuffers[i]); VK_CHECK_RESULT(vkEndCommandBuffer(drawCmdBuffers[i])); } diff --git a/examples/raytracingshadows/raytracingshadows.cpp b/examples/raytracingshadows/raytracingshadows.cpp index 3f186caa..bdd08b56 100644 --- a/examples/raytracingshadows/raytracingshadows.cpp +++ b/examples/raytracingshadows/raytracingshadows.cpp @@ -43,7 +43,6 @@ public: VulkanExample() : VulkanRaytracingSample() { title = "Ray traced shadows"; - settings.overlay = false; timerSpeed *= 0.25f; camera.type = Camera::CameraType::lookat; camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f); @@ -514,6 +513,8 @@ public: VK_IMAGE_LAYOUT_GENERAL, subresourceRange); + drawUI(drawCmdBuffers[i], frameBuffers[i]); + VK_CHECK_RESULT(vkEndCommandBuffer(drawCmdBuffers[i])); } } diff --git a/examples/screenshot/screenshot.cpp b/examples/screenshot/screenshot.cpp index e5930b43..5e34c303 100644 --- a/examples/screenshot/screenshot.cpp +++ b/examples/screenshot/screenshot.cpp @@ -34,8 +34,6 @@ public: VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) { title = "Saving framebuffer to screenshot"; - settings.overlay = true; - camera.type = Camera::CameraType::lookat; camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f); camera.setRotation(glm::vec3(-25.0f, 23.75f, 0.0f)); diff --git a/examples/shadowmapping/shadowmapping.cpp b/examples/shadowmapping/shadowmapping.cpp index f1100bea..0592b4fc 100644 --- a/examples/shadowmapping/shadowmapping.cpp +++ b/examples/shadowmapping/shadowmapping.cpp @@ -102,7 +102,6 @@ public: camera.setRotation(glm::vec3(-15.0f, -390.0f, 0.0f)); camera.setPerspective(60.0f, (float)width / (float)height, 1.0f, 256.0f); timerSpeed *= 0.5f; - settings.overlay = true; } ~VulkanExample() diff --git a/examples/shadowmappingcascade/shadowmappingcascade.cpp b/examples/shadowmappingcascade/shadowmappingcascade.cpp index 14b9d362..b1ff72ca 100644 --- a/examples/shadowmappingcascade/shadowmappingcascade.cpp +++ b/examples/shadowmappingcascade/shadowmappingcascade.cpp @@ -141,7 +141,6 @@ public: camera.setPerspective(45.0f, (float)width / (float)height, zNear, zFar); camera.setPosition(glm::vec3(-0.12f, 1.14f, -2.25f)); camera.setRotation(glm::vec3(-17.0f, 7.0f, 0.0f)); - settings.overlay = true; timer = 0.2f; } diff --git a/examples/shadowmappingomni/shadowmappingomni.cpp b/examples/shadowmappingomni/shadowmappingomni.cpp index 02e39531..72e82bd5 100644 --- a/examples/shadowmappingomni/shadowmappingomni.cpp +++ b/examples/shadowmappingomni/shadowmappingomni.cpp @@ -93,7 +93,6 @@ public: VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) { title = "Point light shadows (cubemap)"; - settings.overlay = true; camera.type = Camera::CameraType::lookat; camera.setPerspective(45.0f, (float)width / (float)height, zNear, zFar); camera.setRotation(glm::vec3(-20.5f, -673.0f, 0.0f)); diff --git a/examples/specializationconstants/specializationconstants.cpp b/examples/specializationconstants/specializationconstants.cpp index 005f45aa..0384086d 100644 --- a/examples/specializationconstants/specializationconstants.cpp +++ b/examples/specializationconstants/specializationconstants.cpp @@ -44,7 +44,6 @@ public: camera.setPerspective(60.0f, ((float)width / 3.0f) / (float)height, 0.1f, 512.0f); camera.setRotation(glm::vec3(-40.0f, -90.0f, 0.0f)); camera.setTranslation(glm::vec3(0.0f, 0.0f, -2.0f)); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/sphericalenvmapping/sphericalenvmapping.cpp b/examples/sphericalenvmapping/sphericalenvmapping.cpp index 6b09a922..883184aa 100644 --- a/examples/sphericalenvmapping/sphericalenvmapping.cpp +++ b/examples/sphericalenvmapping/sphericalenvmapping.cpp @@ -44,7 +44,6 @@ public: camera.setRotation(glm::vec3(-25.0f, 23.75f, 0.0f)); camera.setRotationSpeed(0.75f); camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/ssao/ssao.cpp b/examples/ssao/ssao.cpp index db7a4763..16481821 100644 --- a/examples/ssao/ssao.cpp +++ b/examples/ssao/ssao.cpp @@ -124,7 +124,6 @@ public: VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) { title = "Screen space ambient occlusion"; - settings.overlay = true; camera.type = Camera::CameraType::firstperson; #ifndef __ANDROID__ camera.rotationSpeed = 0.25f; diff --git a/examples/stencilbuffer/stencilbuffer.cpp b/examples/stencilbuffer/stencilbuffer.cpp index b770e748..1deb28b4 100644 --- a/examples/stencilbuffer/stencilbuffer.cpp +++ b/examples/stencilbuffer/stencilbuffer.cpp @@ -43,7 +43,6 @@ public: camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f); camera.setRotation(glm::vec3(2.5f, -35.0f, 0.0f)); camera.setTranslation(glm::vec3(0.0f, 0.0f, -2.0f)); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/subpasses/subpasses.cpp b/examples/subpasses/subpasses.cpp index 91077877..d1e4ea93 100644 --- a/examples/subpasses/subpasses.cpp +++ b/examples/subpasses/subpasses.cpp @@ -105,7 +105,6 @@ public: camera.setPosition(glm::vec3(-3.2f, 1.0f, 5.9f)); camera.setRotation(glm::vec3(0.5f, 210.05f, 0.0f)); camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); - settings.overlay = true; UIOverlay.subpass = 2; } diff --git a/examples/terraintessellation/terraintessellation.cpp b/examples/terraintessellation/terraintessellation.cpp index 52ff4944..80a79e27 100644 --- a/examples/terraintessellation/terraintessellation.cpp +++ b/examples/terraintessellation/terraintessellation.cpp @@ -106,7 +106,6 @@ public: camera.setRotation(glm::vec3(-12.0f, 159.0f, 0.0f)); camera.setTranslation(glm::vec3(18.0f, 22.5f, 57.5f)); camera.movementSpeed = 7.5f; - settings.overlay = true; } ~VulkanExample() diff --git a/examples/tessellation/tessellation.cpp b/examples/tessellation/tessellation.cpp index 18761158..7bec8187 100644 --- a/examples/tessellation/tessellation.cpp +++ b/examples/tessellation/tessellation.cpp @@ -54,7 +54,6 @@ public: camera.setPosition(glm::vec3(0.0f, 0.0f, -4.0f)); camera.setRotation(glm::vec3(-350.0f, 60.0f, 0.0f)); camera.setPerspective(45.0f, (float)(width * ((splitScreen) ? 0.5f : 1.0f)) / (float)height, 0.1f, 256.0f); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/texture/texture.cpp b/examples/texture/texture.cpp index 932fe71c..4cc1f498 100644 --- a/examples/texture/texture.cpp +++ b/examples/texture/texture.cpp @@ -69,7 +69,6 @@ public: camera.setPosition(glm::vec3(0.0f, 0.0f, -2.5f)); camera.setRotation(glm::vec3(0.0f, 15.0f, 0.0f)); camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/texture3d/texture3d.cpp b/examples/texture3d/texture3d.cpp index 65a0427f..f2f672e2 100644 --- a/examples/texture3d/texture3d.cpp +++ b/examples/texture3d/texture3d.cpp @@ -175,7 +175,6 @@ public: camera.setPosition(glm::vec3(0.0f, 0.0f, -2.5f)); camera.setRotation(glm::vec3(0.0f, 15.0f, 0.0f)); camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); - settings.overlay = true; srand((unsigned int)time(NULL)); } diff --git a/examples/texturearray/texturearray.cpp b/examples/texturearray/texturearray.cpp index f5877d07..41cd5392 100644 --- a/examples/texturearray/texturearray.cpp +++ b/examples/texturearray/texturearray.cpp @@ -59,7 +59,6 @@ public: VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) { title = "Texture arrays"; - settings.overlay = true; camera.type = Camera::CameraType::lookat; camera.setPosition(glm::vec3(0.0f, 0.0f, -7.5f)); camera.setRotation(glm::vec3(-35.0f, 0.0f, 0.0f)); diff --git a/examples/texturecubemap/texturecubemap.cpp b/examples/texturecubemap/texturecubemap.cpp index d5ba0e1f..9a6fa606 100644 --- a/examples/texturecubemap/texturecubemap.cpp +++ b/examples/texturecubemap/texturecubemap.cpp @@ -61,7 +61,6 @@ public: camera.setRotation(glm::vec3(0.0f)); camera.setRotationSpeed(0.25f); camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/texturecubemaparray/texturecubemaparray.cpp b/examples/texturecubemaparray/texturecubemaparray.cpp index 6766cf0f..6d9c5494 100644 --- a/examples/texturecubemaparray/texturecubemaparray.cpp +++ b/examples/texturecubemaparray/texturecubemaparray.cpp @@ -61,7 +61,6 @@ public: camera.setPosition(glm::vec3(0.0f, 0.0f, -4.0f)); camera.setRotationSpeed(0.25f); camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/texturemipmapgen/texturemipmapgen.cpp b/examples/texturemipmapgen/texturemipmapgen.cpp index 66cf897a..1fae3773 100644 --- a/examples/texturemipmapgen/texturemipmapgen.cpp +++ b/examples/texturemipmapgen/texturemipmapgen.cpp @@ -55,7 +55,6 @@ public: camera.setTranslation(glm::vec3(40.75f, 0.0f, 0.0f)); camera.movementSpeed = 2.5f; camera.rotationSpeed = 0.5f; - settings.overlay = true; timerSpeed *= 0.05f; } diff --git a/examples/texturesparseresidency/texturesparseresidency.cpp b/examples/texturesparseresidency/texturesparseresidency.cpp index 1c7a348a..7b82a870 100644 --- a/examples/texturesparseresidency/texturesparseresidency.cpp +++ b/examples/texturesparseresidency/texturesparseresidency.cpp @@ -141,7 +141,6 @@ VulkanExample::VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) camera.setPosition(glm::vec3(0.0f, 0.0f, -12.0f)); camera.setRotation(glm::vec3(-90.0f, 0.0f, 0.0f)); camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); - settings.overlay = true; } VulkanExample::~VulkanExample() diff --git a/examples/variablerateshading/variablerateshading.cpp b/examples/variablerateshading/variablerateshading.cpp index cc58ae77..f367fce9 100644 --- a/examples/variablerateshading/variablerateshading.cpp +++ b/examples/variablerateshading/variablerateshading.cpp @@ -18,7 +18,6 @@ VulkanExample::VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) camera.setRotation(glm::vec3(0.0f, -90.0f, 0.0f)); camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); camera.setRotationSpeed(0.25f); - settings.overlay = true; enabledInstanceExtensions.push_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); enabledDeviceExtensions.push_back(VK_NV_SHADING_RATE_IMAGE_EXTENSION_NAME); } diff --git a/examples/viewportarray/viewportarray.cpp b/examples/viewportarray/viewportarray.cpp index f5f9ff52..9bbc6b52 100644 --- a/examples/viewportarray/viewportarray.cpp +++ b/examples/viewportarray/viewportarray.cpp @@ -43,7 +43,6 @@ public: camera.setRotation(glm::vec3(0.0f, 90.0f, 0.0f)); camera.setTranslation(glm::vec3(7.0f, 3.2f, 0.0f)); camera.setMovementSpeed(5.0f); - settings.overlay = true; } ~VulkanExample() diff --git a/examples/vulkanscene/vulkanscene.cpp b/examples/vulkanscene/vulkanscene.cpp index 23bd11a6..ce1d4417 100644 --- a/examples/vulkanscene/vulkanscene.cpp +++ b/examples/vulkanscene/vulkanscene.cpp @@ -63,7 +63,6 @@ public: camera.setRotation(glm::vec3(15.0f, 0.0f, 0.0f)); camera.setRotationSpeed(0.5f); camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 256.0f); - settings.overlay = true; } ~VulkanExample()