From f221bc63614d71fa422a95e260907fd33dbc0857 Mon Sep 17 00:00:00 2001 From: Wojciech Figat Date: Thu, 7 Jul 2022 15:34:15 +0200 Subject: [PATCH] Minor improvements --- Content/Shaders/GI/DDGI.flax | 4 ++-- Source/Editor/Windows/Assets/MaterialInstanceWindow.cs | 2 ++ Source/Engine/GraphicsDevice/Vulkan/GPUSwapChainVulkan.cpp | 5 +++++ Source/Engine/Renderer/GBufferPass.cpp | 1 - 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Content/Shaders/GI/DDGI.flax b/Content/Shaders/GI/DDGI.flax index dea6b002c..1ec0c1389 100644 --- a/Content/Shaders/GI/DDGI.flax +++ b/Content/Shaders/GI/DDGI.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5acf61b87b00dbf2e7f0c3485783f8d6cb9b5bf33bbd90ad0de5be989f88102f -size 23472 +oid sha256:51ad2cd9624e0cb0536897efe6647fea07ee84bd85428132f3b1aeb232fc834f +size 23610 diff --git a/Source/Editor/Windows/Assets/MaterialInstanceWindow.cs b/Source/Editor/Windows/Assets/MaterialInstanceWindow.cs index 55ee8a4f3..977416fcd 100644 --- a/Source/Editor/Windows/Assets/MaterialInstanceWindow.cs +++ b/Source/Editor/Windows/Assets/MaterialInstanceWindow.cs @@ -347,6 +347,8 @@ namespace FlaxEditor.Windows.Assets Before = !isOverride, }); } + if (undoActions.Count == 0) + return; proxy.Window._undo.AddAction(new MultiUndoAction(undoActions)); proxy.Window.MarkAsEdited(); Presenter.BuildLayoutOnUpdate(); diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUSwapChainVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/GPUSwapChainVulkan.cpp index 6fab41edd..4c719844f 100644 --- a/Source/Engine/GraphicsDevice/Vulkan/GPUSwapChainVulkan.cpp +++ b/Source/Engine/GraphicsDevice/Vulkan/GPUSwapChainVulkan.cpp @@ -362,6 +362,11 @@ bool GPUSwapChainVulkan::CreateSwapChain(int32 width, int32 height) VALIDATE_VULKAN_RESULT(vkGetPhysicalDeviceSurfaceCapabilitiesKHR(gpu, _surface, &surfProperties)); width = Math::Clamp(width, surfProperties.minImageExtent.width, surfProperties.maxImageExtent.width); height = Math::Clamp(height, surfProperties.minImageExtent.height, surfProperties.maxImageExtent.height); + if (width <= 0 || height <= 0) + { + LOG(Error, "Vulkan SwapChain dimensions are invalid {}x{} (minImageExtent={}x{}, maxImageExtent={}x{})", width, height, surfProperties.minImageExtent.width, surfProperties.minImageExtent.height, surfProperties.maxImageExtent.width, surfProperties.maxImageExtent.height); + return true; + } VkSwapchainCreateInfoKHR swapChainInfo; RenderToolsVulkan::ZeroStruct(swapChainInfo, VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR); swapChainInfo.surface = _surface; diff --git a/Source/Engine/Renderer/GBufferPass.cpp b/Source/Engine/Renderer/GBufferPass.cpp index 7603a3c0f..450fedcbe 100644 --- a/Source/Engine/Renderer/GBufferPass.cpp +++ b/Source/Engine/Renderer/GBufferPass.cpp @@ -402,7 +402,6 @@ void GBufferPass::DrawDecals(RenderContext& renderContext, GPUTextureView* light // Cache data auto device = GPUDevice::Instance; auto context = device->GetMainContext(); - auto& view = renderContext.View; auto model = _boxModel.Get(); auto buffers = renderContext.Buffers;