Merge branch 'fix/nullable' of https://github.com/mtszkarbowiak/FlaxEngine into mtszkarbowiak-fix/nullable

This commit is contained in:
Wojtek Figat
2024-10-25 15:38:44 +02:00
16 changed files with 610 additions and 140 deletions

View File

@@ -104,7 +104,7 @@ bool GraphicsService::Init()
GPUDevice* device = nullptr;
// Null
if (!device && CommandLine::Options.Null)
if (!device && CommandLine::Options.Null.IsTrue())
{
#if GRAPHICS_API_NULL
device = CreateGPUDeviceNull();
@@ -114,7 +114,7 @@ bool GraphicsService::Init()
}
// Vulkan
if (!device && CommandLine::Options.Vulkan)
if (!device && CommandLine::Options.Vulkan.IsTrue())
{
#if GRAPHICS_API_VULKAN
device = CreateGPUDeviceVulkan();
@@ -124,7 +124,7 @@ bool GraphicsService::Init()
}
// DirectX 12
if (!device && CommandLine::Options.D3D12)
if (!device && CommandLine::Options.D3D12.IsTrue())
{
#if GRAPHICS_API_DIRECTX12
if (Platform::IsWindows10())
@@ -137,7 +137,7 @@ bool GraphicsService::Init()
}
// DirectX 11 and DirectX 10
if (!device && (CommandLine::Options.D3D11 || CommandLine::Options.D3D10))
if (!device && (CommandLine::Options.D3D11.IsTrue() || CommandLine::Options.D3D10.IsTrue()))
{
#if GRAPHICS_API_DIRECTX11
device = CreateGPUDeviceDX11();
@@ -193,10 +193,10 @@ bool GraphicsService::Init()
// Initialize
if (device->IsDebugToolAttached
#if USE_EDITOR || !BUILD_RELEASE
|| CommandLine::Options.ShaderProfile
|| CommandLine::Options.ShaderProfile.IsTrue()
#endif
#if USE_EDITOR
|| CommandLine::Options.ShaderDebug
|| CommandLine::Options.ShaderDebug.IsTrue()
#endif
)
{

View File

@@ -249,12 +249,12 @@ bool ShaderAssetBase::LoadShaderCache(ShaderCacheResult& result)
options.SourceLength = sourceLength;
options.Profile = shaderProfile;
options.Output = &cacheStream;
if (CommandLine::Options.ShaderDebug)
if (CommandLine::Options.ShaderDebug.IsTrue())
{
options.GenerateDebugData = true;
options.NoOptimize = true;
}
else if (CommandLine::Options.ShaderProfile)
else if (CommandLine::Options.ShaderProfile.IsTrue())
{
options.GenerateDebugData = true;
}

View File

@@ -193,8 +193,8 @@ bool ShaderCacheManagerService::Init()
CacheVersion cacheVersion;
const String cacheVerFile = rootDir / TEXT("CacheVersion");
#if USE_EDITOR
const bool shaderDebug = CommandLine::Options.ShaderDebug;
const bool shaderProfile = CommandLine::Options.ShaderProfile;
const bool shaderDebug = CommandLine::Options.ShaderDebug.IsTrue();
const bool shaderProfile = CommandLine::Options.ShaderProfile.IsTrue();
#else
const bool shaderDebug = false;
#endif