Merge remote-tracking branch 'origin/1.1' into linux-editor

# Conflicts:
#	Source/FlaxEngine.Gen.cs
#	Source/Tools/Flax.Build/Utilities/Utilities.cs
This commit is contained in:
Wojtek Figat
2021-02-16 18:54:25 +01:00
654 changed files with 19651 additions and 10556 deletions

View File

@@ -44,7 +44,7 @@ void CmdBufferVulkan::End()
ASSERT(IsOutsideRenderPass());
#if GPU_ALLOW_PROFILE_EVENTS
// End reaming events
// End remaining events
while (_eventsBegin--)
vkCmdEndDebugUtilsLabelEXT(GetHandle());
#endif

View File

@@ -1155,7 +1155,7 @@ void GPUContextVulkan::FlushState()
void GPUContextVulkan::Flush()
{
// Flush reaming and buffered commands
// Flush remaining and buffered commands
FlushState();
_currentState = nullptr;

View File

@@ -1076,7 +1076,7 @@ GPUDeviceVulkan::GPUDeviceVulkan(ShaderProfile shaderProfile, GPUAdapterVulkan*
GPUDevice* GPUDeviceVulkan::Create()
{
#if !USE_EDITOR && (PLATFORM_WINDOWS || PLATFORM_LINUX)
auto settings = PlatformSettings::Instance();
auto settings = PlatformSettings::Get();
if (!settings->SupportVulkan)
{
// Skip if there is no support
@@ -1363,23 +1363,7 @@ PixelFormat GPUDeviceVulkan::GetClosestSupportedPixelFormat(PixelFormat format,
if (flags & GPUTextureFlags::UnorderedAccess)
wantedFeatureFlags |= VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT;
// Check actual device for format support
const auto isSupported = [&](VkFormat vkFormat)
{
VkFormatProperties props;
vkGetPhysicalDeviceFormatProperties(Adapter->Gpu, vkFormat, &props);
const VkFormatFeatureFlags featureFlags = optimalTiling ? props.optimalTilingFeatures : props.linearTilingFeatures;
if ((featureFlags & wantedFeatureFlags) != wantedFeatureFlags)
return false;
//VkImageFormatProperties imageProps;
//vkGetPhysicalDeviceImageFormatProperties(Adapter->Gpu, vkFormat, , &imageProps);
return true;
};
VkFormat vkFormat = RenderToolsVulkan::ToVulkanFormat(format);
if (!isSupported(vkFormat))
if (!IsVkFormatSupported(RenderToolsVulkan::ToVulkanFormat(format), wantedFeatureFlags, optimalTiling))
{
// Special case for depth-stencil formats
if (flags & GPUTextureFlags::DepthStencil)
@@ -1389,7 +1373,7 @@ PixelFormat GPUDeviceVulkan::GetClosestSupportedPixelFormat(PixelFormat format,
// Spec guarantees at least one depth-only, and one depth-stencil format to be supported
if (hasStencil)
{
if (isSupported(VK_FORMAT_D32_SFLOAT_S8_UINT))
if (IsVkFormatSupported(VK_FORMAT_D32_SFLOAT_S8_UINT, wantedFeatureFlags, optimalTiling))
format = PixelFormat::D32_Float;
else
format = PixelFormat::D24_UNorm_S8_UInt;
@@ -1493,6 +1477,20 @@ bool GPUDeviceVulkan::SaveValidationCache()
#endif
bool GPUDeviceVulkan::IsVkFormatSupported(VkFormat vkFormat, VkFormatFeatureFlags wantedFeatureFlags, bool optimalTiling) const
{
VkFormatProperties props;
vkGetPhysicalDeviceFormatProperties(Adapter->Gpu, vkFormat, &props);
const VkFormatFeatureFlags featureFlags = optimalTiling ? props.optimalTilingFeatures : props.linearTilingFeatures;
if ((featureFlags & wantedFeatureFlags) != wantedFeatureFlags)
return false;
//VkImageFormatProperties imageProps;
//vkGetPhysicalDeviceImageFormatProperties(Adapter->Gpu, vkFormat, , &imageProps);
return true;
}
GPUContext* GPUDeviceVulkan::GetMainContext()
{
return reinterpret_cast<GPUContext*>(MainContext);

View File

@@ -720,6 +720,10 @@ public:
#endif
private:
bool IsVkFormatSupported(VkFormat vkFormat, VkFormatFeatureFlags wantedFeatureFlags, bool optimalTiling) const;
public:
// [GPUDevice]

View File

@@ -232,10 +232,10 @@ public:
}
/// <summary>
/// Converts Flax comparision function to the Vulkan comparision operation.
/// Converts Flax comparison function to the Vulkan comparison operation.
/// </summary>
/// <param name="value">The Flax comparision function.</param>
/// <returns>The Vulkan comparision operation.</returns>
/// <param name="value">The Flax comparison function.</param>
/// <returns>The Vulkan comparison operation.</returns>
static FORCE_INLINE VkCompareOp ToVulkanCompareOp(const ComparisonFunc value)
{
return ComparisonFuncToVkCompareOp[(int32)value];