summaryrefslogtreecommitdiffstats
path: root/tools/render-test/options.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2018-05-03 14:25:13 -0400
committerGitHub <noreply@github.com>2018-05-03 14:25:13 -0400
commit367f3a78a40731da45ee12b9a18c94707f1d1429 (patch)
tree5993ef627e1a094ea1d401c31e6b00e3c63c308a /tools/render-test/options.cpp
parent78935493587ec65a199d844327613021667acc1b (diff)
Feature/vulkan first render (#545)
* First pass at InputLayout for Vulkan Add support for RGBA_Float32 * Use VulkanModule and VulkanApi to handle accessing Vulkan types. * First pass at Vulkan swap chain/Device queue. * Added VulkanUtil for generic function functions. * Move more functionality to VulkanApi and VulkanUtil. Make Buffer able to initialize itself. * More tidy up around VulkanDeviceQueue * First pass use of VulkanDeviceQueue in VkRenderer * First pass use of VulkanSwapChain on VkRenderer * Added depth formats. Binding for constant and vertex buffers for Vulkan. * Setting up VkImageView on backbuffers. * First pass support for setting up vkRenderPass. * Fixes to work around Vulkan swap chain/verification issues. * Added support for Pipeline and a pipeline cache. * Working without waiting - because use of pipeline cache. * Added support for VkFramebuffer in Vulkan. * First pass at creating Vulkan graphics pipeline. * More efforts to get Vulkan to render. * Small improvement for checking of Binding flags. * Removed setConstantBuffers from the Renderer interface - so that all resource binding takes place through the BindingState. To make this work required a 'hack' in render-test main.cpp - so that the constant buffer binding that is needed in some tests is only added when it doesn't clash. * RendererID -> unified into RendererType. Added getRendererType to Renderer interface. Added ProjectionStyle, and function to get from RendererType. Added getIdentityProjection to RendererUtil - to get projection that is the 'identity' - but hits the same pixels for all projection styles. * Fix build problem on Win32 on Vulkan where should use VK_NULL_HANDLE. * Improve naming, comments. Remove dead code. * Remove unwanted comment.
Diffstat (limited to 'tools/render-test/options.cpp')
-rw-r--r--tools/render-test/options.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/tools/render-test/options.cpp b/tools/render-test/options.cpp
index bdf635620..1aa72c033 100644
--- a/tools/render-test/options.cpp
+++ b/tools/render-test/options.cpp
@@ -11,13 +11,17 @@ namespace renderer_test {
Options gOptions;
// Only set it, if the
-void setDefaultRendererID(RendererID id)
+void setDefaultRendererType(RendererType type)
{
- gOptions.rendererID = (gOptions.rendererID == RendererID::NONE) ? id : gOptions.rendererID;
+ gOptions.rendererType = (gOptions.rendererType == RendererType::Unknown) ? type : gOptions.rendererType;
}
SlangResult parseOptions(int* argc, char** argv)
{
+ typedef Options::ShaderProgramType ShaderProgramType;
+ typedef Options::InputLanguageID InputLanguageID;
+
+
int argCount = *argc;
char const* const* argCursor = argv;
char const* const* argEnd = argCursor + argCount;
@@ -60,32 +64,32 @@ SlangResult parseOptions(int* argc, char** argv)
}
else if( strcmp(arg, "-hlsl") == 0 )
{
- setDefaultRendererID( RendererID::D3D11);
+ setDefaultRendererType( RendererType::DirectX11);
gOptions.inputLanguageID = InputLanguageID::Native;
}
else if( strcmp(arg, "-glsl") == 0 )
{
- setDefaultRendererID(RendererID::GL);
+ setDefaultRendererType( RendererType::OpenGl);
gOptions.inputLanguageID = InputLanguageID::Native;
}
else if( strcmp(arg, "-hlsl-rewrite") == 0 )
{
- setDefaultRendererID(RendererID::D3D11);
+ setDefaultRendererType( RendererType::DirectX11);
gOptions.inputLanguageID = InputLanguageID::NativeRewrite;
}
else if( strcmp(arg, "-glsl-rewrite") == 0 )
{
- setDefaultRendererID(RendererID::GL);
+ setDefaultRendererType(RendererType::OpenGl);
gOptions.inputLanguageID = InputLanguageID::NativeRewrite;
}
else if( strcmp(arg, "-slang") == 0 )
{
- setDefaultRendererID(RendererID::D3D11);
+ setDefaultRendererType( RendererType::DirectX11);
gOptions.inputLanguageID = InputLanguageID::Slang;
}
else if( strcmp(arg, "-glsl-cross") == 0 )
{
- setDefaultRendererID(RendererID::GL);
+ setDefaultRendererType(RendererType::OpenGl);
gOptions.inputLanguageID = InputLanguageID::Slang;
}
else if( strcmp(arg, "-xslang") == 0 )
@@ -97,9 +101,9 @@ SlangResult parseOptions(int* argc, char** argv)
fprintf(stderr, "expected argument for '%s' option\n", arg);
return SLANG_FAIL;
}
- if( gOptions.slangArgCount == kMaxSlangArgs )
+ if( gOptions.slangArgCount == Options::kMaxSlangArgs )
{
- fprintf(stderr, "maximum number of '%s' options exceeded (%d)\n", arg, kMaxSlangArgs);
+ fprintf(stderr, "maximum number of '%s' options exceeded (%d)\n", arg, Options::kMaxSlangArgs);
return SLANG_FAIL;
}
gOptions.slangArgs[gOptions.slangArgCount++] = *argCursor++;
@@ -119,21 +123,21 @@ SlangResult parseOptions(int* argc, char** argv)
else if (strcmp(arg, "-vk") == 0
|| strcmp(arg, "-vulkan") == 0)
{
- gOptions.rendererID = RendererID::VK;
+ gOptions.rendererType = RendererType::Vulkan;
}
else if (strcmp(arg, "-d3d12") == 0
|| strcmp(arg, "-dx12") == 0)
{
- gOptions.rendererID = RendererID::D3D12;
+ gOptions.rendererType = RendererType::DirectX12;
}
else if(strcmp(arg, "-gl") == 0)
{
- gOptions.rendererID = RendererID::GL;
+ gOptions.rendererType = RendererType::OpenGl;
}
else if (strcmp(arg, "-d3d11") == 0
|| strcmp(arg, "-dx11") == 0)
{
- gOptions.rendererID = RendererID::D3D11;
+ gOptions.rendererType = RendererType::DirectX11;
}
else
{