diff options
Diffstat (limited to 'tools/render-test/render-test-main.cpp')
| -rw-r--r-- | tools/render-test/render-test-main.cpp | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/tools/render-test/render-test-main.cpp b/tools/render-test/render-test-main.cpp index 5feeeaf21..c04d6db00 100644 --- a/tools/render-test/render-test-main.cpp +++ b/tools/render-test/render-test-main.cpp @@ -99,9 +99,9 @@ public: Result applyBinding(PipelineType pipelineType, ICommandEncoder* encoder); void setProjectionMatrix(IShaderObject* rootObject); - Result writeBindingOutput(const char* fileName); + Result writeBindingOutput(const String& fileName); - Result writeScreen(const char* filename); + Result writeScreen(const String& filename); protected: /// Called in initialize @@ -652,12 +652,12 @@ void RenderTestApp::finalize() { } -Result RenderTestApp::writeBindingOutput(const char* fileName) +Result RenderTestApp::writeBindingOutput(const String& fileName) { // Wait until everything is complete m_queue->wait(); - FILE * f = fopen(fileName, "wb"); + FILE * f = fopen(fileName.getBuffer(), "wb"); if (!f) { return SLANG_FAIL; @@ -729,7 +729,7 @@ Result RenderTestApp::writeBindingOutput(const char* fileName) return SLANG_OK; } -Result RenderTestApp::writeScreen(const char* filename) +Result RenderTestApp::writeScreen(const String& filename) { size_t rowPitch, pixelSize; ComPtr<ISlangBlob> blob; @@ -738,7 +738,7 @@ Result RenderTestApp::writeScreen(const char* filename) auto bufferSize = blob->getBufferSize(); uint32_t width = static_cast<uint32_t>(rowPitch / pixelSize); uint32_t height = static_cast<uint32_t>(bufferSize / rowPitch); - return PngSerializeUtil::write(filename, blob, width, height); + return PngSerializeUtil::write(filename.getBuffer(), blob, width, height); } Result RenderTestApp::update() @@ -768,7 +768,7 @@ Result RenderTestApp::update() m_queue->wait(); // If we are in a mode where output is requested, we need to snapshot the back buffer here - if (m_options.outputPath || m_options.performanceProfile) + if (m_options.outputPath.getLength() || m_options.performanceProfile) { // Wait until everything is complete @@ -807,7 +807,7 @@ Result RenderTestApp::update() _outputProfileTime(m_startTicks, endTicks); } - if (m_options.outputPath) + if (m_options.outputPath.getLength()) { if (m_options.shaderType == Options::ShaderProgramType::Compute || m_options.shaderType == Options::ShaderProgramType::GraphicsCompute) { @@ -909,8 +909,6 @@ static SlangResult _innerMain(Slang::StdWriters* stdWriters, SlangSession* sessi input.profile = ""; input.target = SLANG_TARGET_NONE; - input.args = &options.slangArgs[0]; - input.argCount = options.slangArgCount; SlangSourceLanguage nativeLanguage = SLANG_SOURCE_LANGUAGE_UNKNOWN; SlangPassThrough slangPassThrough = SLANG_PASS_THROUGH_NONE; @@ -1020,7 +1018,7 @@ static SlangResult _innerMain(Slang::StdWriters* stdWriters, SlangSession* sessi #endif // Use the profile name set on options if set - input.profile = options.profileName ? options.profileName : input.profile; + input.profile = options.profileName.getLength() ? options.profileName : input.profile; StringBuilder rendererName; auto info = @@ -1085,11 +1083,17 @@ static SlangResult _innerMain(Slang::StdWriters* stdWriters, SlangSession* sessi desc.requiredFeatures = requiredFeatureList.getBuffer(); desc.requiredFeatureCount = (int)requiredFeatureList.getCount(); - for (int i = 0; i < options.slangArgCount; i++) + + // Look for args going to slang { - if (UnownedStringSlice(options.slangArgs[i]) == "-matrix-layout-column-major") + const auto& args = options.downstreamArgs.getArgsByName("slang"); + for (const auto& arg : args) { - desc.slang.defaultMatrixLayoutMode = SLANG_MATRIX_LAYOUT_COLUMN_MAJOR; + if (arg.value == "-matrix-layout-column-major") + { + desc.slang.defaultMatrixLayoutMode = SLANG_MATRIX_LAYOUT_COLUMN_MAJOR; + break; + } } } |
