diff --git a/base/VulkanAndroid.cpp b/base/VulkanAndroid.cpp index 0a5470e7..43d8c1c7 100644 --- a/base/VulkanAndroid.cpp +++ b/base/VulkanAndroid.cpp @@ -1,7 +1,7 @@ /* * Android Vulkan function pointer loader * -* Copyright (C) 2016-2024 by Sascha Willems - www.saschawillems.de +* Copyright (C) 2016-2025 by Sascha Willems - www.saschawillems.de * * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) */ @@ -359,7 +359,6 @@ namespace vks jni->DeleteLocalRef(jmessage); androidApp->activity->vm->DetachCurrentThread(); - return; } } } diff --git a/base/VulkanAndroid.h b/base/VulkanAndroid.h index 9db7e82b..f3201bde 100644 --- a/base/VulkanAndroid.h +++ b/base/VulkanAndroid.h @@ -1,7 +1,7 @@ /* * Android Vulkan function pointer prototypes * -* Copyright (C) 2016-2024 by Sascha Willems - www.saschawillems.de +* Copyright (C) 2016-2025 by Sascha Willems - www.saschawillems.de * * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) */ @@ -29,16 +29,6 @@ #include #include -// Missing from the NDK -namespace std -{ - template - std::unique_ptr make_unique(Args&&... args) - { - return std::unique_ptr(new T(std::forward(args)...)); - } -} - // Global reference to android application object extern android_app* androidApp; diff --git a/examples/dynamicrenderingmultisampling/dynamicrenderingmultisampling.cpp b/examples/dynamicrenderingmultisampling/dynamicrenderingmultisampling.cpp index b9837eae..3b904335 100644 --- a/examples/dynamicrenderingmultisampling/dynamicrenderingmultisampling.cpp +++ b/examples/dynamicrenderingmultisampling/dynamicrenderingmultisampling.cpp @@ -40,7 +40,6 @@ public: VkDeviceMemory memory{ VK_NULL_HANDLE }; }; Image renderImage; - Image depthStencilRenderImage; VulkanExample() : VulkanExampleBase() { @@ -67,7 +66,7 @@ public: deviceCreatepNextChain = &enabledDynamicRenderingFeaturesKHR; } - ~VulkanExample() + ~VulkanExample() override { if (device) { vkDestroyPipeline(device, pipeline, nullptr); @@ -160,7 +159,7 @@ public: } // Enable physical device features required for this example - virtual void getEnabledFeatures() + void getEnabledFeatures() override { // Enable anisotropic filtering if supported if (deviceFeatures.samplerAnisotropy) { @@ -174,7 +173,7 @@ public: model.loadFromFile(getAssetPath() + "models/voyager.gltf", vulkanDevice, queue, glTFLoadingFlags); } - void buildCommandBuffers() + void buildCommandBuffers() override { VkCommandBufferBeginInfo cmdBufInfo = vks::initializers::commandBufferBeginInfo(); @@ -365,7 +364,7 @@ public: memcpy(uniformBuffer.mapped, &uniformData, sizeof(uniformData)); } - void prepare() + void prepare() override { VulkanExampleBase::prepare(); @@ -390,7 +389,7 @@ public: VulkanExampleBase::submitFrame(); } - virtual void render() + void render() override { if (!prepared) return; diff --git a/examples/triangle/triangle.cpp b/examples/triangle/triangle.cpp index 21c4954f..e7619c82 100644 --- a/examples/triangle/triangle.cpp +++ b/examples/triangle/triangle.cpp @@ -6,7 +6,7 @@ * Contrary to the other examples, this one won't make use of helper functions or initializers * Except in a few cases (swap chain setup e.g.) * -* Copyright (C) 2016-2024 by Sascha Willems - www.saschawillems.de +* Copyright (C) 2016-2025 by Sascha Willems - www.saschawillems.de * * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) */ @@ -126,7 +126,7 @@ public: // Values not set here are initialized in the base class constructor } - ~VulkanExample() + ~VulkanExample() override { // Clean up used Vulkan resources // Note: Inherited destructor cleans up resources stored in base class @@ -452,7 +452,7 @@ public: // Create the depth (and stencil) buffer attachments used by our framebuffers // Note: Override of virtual function in the base class and called from within VulkanExampleBase::prepare - void setupDepthStencil() + void setupDepthStencil() override { // Create an optimal image used as the depth stencil attachment VkImageCreateInfo imageCI{}; @@ -502,7 +502,7 @@ public: // Create a frame buffer for each swap chain image // Note: Override of virtual function in the base class and called from within VulkanExampleBase::prepare - void setupFrameBuffer() + void setupFrameBuffer() override { // Create a frame buffer for every image in the swapchain frameBuffers.resize(swapChain.images.size()); @@ -533,7 +533,7 @@ public: // This allows the driver to know up-front what the rendering will look like and is a good opportunity to optimize especially on tile-based renderers (with multiple subpasses) // Using sub pass dependencies also adds implicit layout transitions for the attachment used, so we don't need to add explicit image memory barriers to transform them // Note: Override of virtual function in the base class and called from within VulkanExampleBase::prepare - void setupRenderPass() + void setupRenderPass() override { // This example will use a single render pass with one subpass @@ -622,7 +622,7 @@ public: // Vulkan loads its shaders from an immediate binary representation called SPIR-V // Shaders are compiled offline from e.g. GLSL using the reference glslang compiler // This function loads such a shader from a binary file and returns a shader module structure - VkShaderModule loadSPIRVShader(std::string filename) + VkShaderModule loadSPIRVShader(const std::string& filename) { size_t shaderSize; char* shaderCode{ nullptr }; @@ -886,7 +886,7 @@ public: } - void prepare() + void prepare() override { VulkanExampleBase::prepare(); createSynchronizationPrimitives(); @@ -900,7 +900,7 @@ public: prepared = true; } - virtual void render() + void render() override { if (!prepared) return; diff --git a/examples/trianglevulkan13/trianglevulkan13.cpp b/examples/trianglevulkan13/trianglevulkan13.cpp index 78824c60..462462de 100644 --- a/examples/trianglevulkan13/trianglevulkan13.cpp +++ b/examples/trianglevulkan13/trianglevulkan13.cpp @@ -117,7 +117,7 @@ public: deviceCreatepNextChain = &enabledFeatures; } - ~VulkanExample() + ~VulkanExample() override { // Clean up used Vulkan resources // Note: Inherited destructor cleans up resources stored in base class @@ -381,7 +381,7 @@ public: // Create the depth (and stencil) buffer attachments // While we don't do any depth testing in this sample, having depth testing is very common so it's a good idea to learn it from the very start - void setupDepthStencil() + void setupDepthStencil() override { // Create an optimal tiled image used as the depth stencil attachment VkImageCreateInfo imageCI{ VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO }; @@ -428,7 +428,7 @@ public: // Vulkan loads its shaders from an immediate binary representation called SPIR-V // Shaders are compiled offline from e.g. GLSL using the reference glslang compiler // This function loads such a shader from a binary file and returns a shader module structure - VkShaderModule loadSPIRVShader(std::string filename) + VkShaderModule loadSPIRVShader(const std::string& filename) { size_t shaderSize; char* shaderCode{ nullptr }; @@ -661,7 +661,7 @@ public: } - void prepare() + void prepare() override { VulkanExampleBase::prepare(); createSynchronizationPrimitives(); @@ -673,7 +673,7 @@ public: prepared = true; } - virtual void render() override + void render() override { // Use a fence to wait until the command buffer has finished execution before using it again vkWaitForFences(device, 1, &waitFences[currentFrame], VK_TRUE, UINT64_MAX);