diff --git a/src/modules/graphics/vulkan/Buffer.h b/src/modules/graphics/vulkan/Buffer.h index 1c4fe2cae..7e6d6b8b5 100644 --- a/src/modules/graphics/vulkan/Buffer.h +++ b/src/modules/graphics/vulkan/Buffer.h @@ -42,7 +42,7 @@ class Buffer final , public Volatile { public: - Buffer(love::graphics::Graphics *gfx, const Settings& settings, const std::vector &format, const void *data, size_t size, size_t arraylength); + Buffer(love::graphics::Graphics *gfx, const Settings &settings, const std::vector &format, const void *data, size_t size, size_t arraylength); virtual ~Buffer(); virtual bool loadVolatile() override; diff --git a/src/modules/graphics/vulkan/Graphics.cpp b/src/modules/graphics/vulkan/Graphics.cpp index 25cb1d397..ebfc21969 100644 --- a/src/modules/graphics/vulkan/Graphics.cpp +++ b/src/modules/graphics/vulkan/Graphics.cpp @@ -1316,7 +1316,7 @@ bool Graphics::checkValidationSupport() { bool layerFound = false; - for (const auto& layerProperties : availableLayers) + for (const auto &layerProperties : availableLayers) { if (strcmp(layerName, layerProperties.layerName) == 0) { @@ -1754,7 +1754,7 @@ VkSurfaceFormatKHR Graphics::chooseSwapSurfaceFormat(const std::vector attachments; - for (const auto& colorView : configuration.colorViews) + for (const auto &colorView : configuration.colorViews) attachments.push_back(colorView); if (configuration.staticData.depthView) @@ -2323,7 +2323,7 @@ void Graphics::setRenderPass(const RenderTargets &rts, int pixelw, int pixelh, b // fixme: hasSRGBtexture RenderPassConfiguration renderPassConfiguration{}; - for (const auto& color : rts.colors) + for (const auto &color : rts.colors) renderPassConfiguration.colorAttachments.push_back({ Vulkan::getTextureFormat(color.texture->getPixelFormat(), isPixelFormatSRGB(color.texture->getPixelFormat())).internalFormat, false, diff --git a/src/modules/graphics/vulkan/Graphics.h b/src/modules/graphics/vulkan/Graphics.h index c601d7893..444f18739 100644 --- a/src/modules/graphics/vulkan/Graphics.h +++ b/src/modules/graphics/vulkan/Graphics.h @@ -70,23 +70,23 @@ struct RenderPassConfiguration bool resolve = false; } staticData; - bool operator==(const RenderPassConfiguration &conf) const + bool operator==(const RenderPassConfiguration &conf) const { return colorAttachments == conf.colorAttachments && (memcmp(&staticData, &conf.staticData, sizeof(StaticRenderPassConfiguration)) == 0); - } + } }; struct RenderPassConfigurationHasher { - size_t operator()(const RenderPassConfiguration &configuration) const + size_t operator()(const RenderPassConfiguration &configuration) const { size_t hashes[] = { XXH32(configuration.colorAttachments.data(), configuration.colorAttachments.size() * sizeof(VkFormat), 0), XXH32(&configuration.staticData, sizeof(configuration.staticData), 0), }; return XXH32(hashes, sizeof(hashes), 0); - } + } }; struct FramebufferConfiguration @@ -126,7 +126,8 @@ struct FramebufferConfigurationHasher struct OptionalInstanceExtensions { - bool physicalDeviceProperties2 = false; + // VK_KHR_get_physical_device_properties2 + bool physicalDeviceProperties2 = false; }; struct OptionalDeviceFeatures @@ -155,7 +156,7 @@ struct OptionalDeviceFeatures struct GraphicsPipelineConfiguration { - VkRenderPass renderPass; + VkRenderPass renderPass; VertexAttributes vertexAttributes; Shader *shader = nullptr; bool wireFrame; @@ -328,10 +329,10 @@ private: void createScreenshotCallbackBuffers(); void createDefaultRenderPass(); void createDefaultFramebuffers(); - VkFramebuffer createFramebuffer(FramebufferConfiguration &configuration); - VkFramebuffer getFramebuffer(FramebufferConfiguration &configuration); + VkFramebuffer createFramebuffer(FramebufferConfiguration &configuration); + VkFramebuffer getFramebuffer(FramebufferConfiguration &configuration); void createDefaultShaders(); - VkRenderPass createRenderPass(RenderPassConfiguration &configuration); + VkRenderPass createRenderPass(RenderPassConfiguration &configuration); VkPipeline createGraphicsPipeline(GraphicsPipelineConfiguration &configuration); void createColorResources(); VkFormat findSupportedFormat(const std::vector &candidates, VkImageTiling tiling, VkFormatFeatureFlags features); @@ -376,7 +377,7 @@ private: VkQueue graphicsQueue = VK_NULL_HANDLE; VkQueue presentQueue = VK_NULL_HANDLE; VkSurfaceKHR surface = VK_NULL_HANDLE; - VkSwapchainKHR swapChain = VK_NULL_HANDLE; + VkSwapchainKHR swapChain = VK_NULL_HANDLE; VkSurfaceTransformFlagBitsKHR preTransform = {}; Matrix4 displayRotation; std::vector swapChainImages; @@ -392,7 +393,7 @@ private: VmaAllocation depthImageAllocation = VK_NULL_HANDLE; VkRenderPass defaultRenderPass = VK_NULL_HANDLE; std::vector defaultFramebuffers; - std::unordered_map renderPasses; + std::unordered_map renderPasses; std::unordered_map framebuffers; std::unordered_map graphicsPipelines; std::unordered_map renderPassUsages; @@ -401,7 +402,7 @@ private: std::unordered_map samplers; VkCommandPool commandPool = VK_NULL_HANDLE; std::vector commandBuffers; - Shader* computeShader = nullptr; + Shader *computeShader = nullptr; std::vector imageAvailableSemaphores; std::vector renderFinishedSemaphores; std::vector inFlightFences; diff --git a/src/modules/graphics/vulkan/Shader.cpp b/src/modules/graphics/vulkan/Shader.cpp index 0a17ff70f..f1f46a4ba 100644 --- a/src/modules/graphics/vulkan/Shader.cpp +++ b/src/modules/graphics/vulkan/Shader.cpp @@ -340,7 +340,7 @@ void Shader::cmdPushDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBind uniformWrite.dstArrayElement = 0; uniformWrite.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER; uniformWrite.descriptorCount = 1; - uniformWrite.pBufferInfo = &bufferInfo; + uniformWrite.pBufferInfo = &bufferInfo; vkUpdateDescriptorSets(device, 1, &uniformWrite, 0, nullptr); diff --git a/src/modules/graphics/vulkan/Shader.h b/src/modules/graphics/vulkan/Shader.h index 66abcd9ab..ea5124976 100644 --- a/src/modules/graphics/vulkan/Shader.h +++ b/src/modules/graphics/vulkan/Shader.h @@ -102,7 +102,7 @@ private: size_t baseoff, const std::string &basename); void initDescriptorSet(); - void updateUniform(const UniformInfo* info, int count, bool internal); + void updateUniform(const UniformInfo *info, int count, bool internal); VkDescriptorSet allocateDescriptorSet();