diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2024-10-29 14:49:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-29 14:49:26 +0800 |
| commit | f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 (patch) | |
| tree | ea1d61342cd29368e19135000ec2948813096205 /tools/render-test/slang-support.h | |
| parent | a729c15e9dce9f5116a38afc66329ab2ca4cea54 (diff) | |
format
* format
* Minor test fixes
* enable checking cpp format in ci
Diffstat (limited to 'tools/render-test/slang-support.h')
| -rw-r--r-- | tools/render-test/slang-support.h | 66 |
1 files changed, 40 insertions, 26 deletions
diff --git a/tools/render-test/slang-support.h b/tools/render-test/slang-support.h index c93008999..d52e94b47 100644 --- a/tools/render-test/slang-support.h +++ b/tools/render-test/slang-support.h @@ -1,14 +1,14 @@ // slang-support.h #pragma once -#include <slang-rhi.h> - +#include "options.h" +#include "shader-input-layout.h" #include "slang.h" -#include "shader-input-layout.h" -#include "options.h" +#include <slang-rhi.h> -namespace renderer_test { +namespace renderer_test +{ struct ShaderCompileRequest { @@ -52,36 +52,34 @@ struct ShaderCompilerUtil { struct Input { - SlangCompileTarget target; - SlangSourceLanguage sourceLanguage; - SlangPassThrough passThrough; - Slang::String profile; + SlangCompileTarget target; + SlangSourceLanguage sourceLanguage; + SlangPassThrough passThrough; + Slang::String profile; }; struct Output { - void set( - slang::IComponentType* slangProgram); + void set(slang::IComponentType* slangProgram); void reset(); - ~Output() - { - reset(); - } + ~Output() { reset(); } ComPtr<slang::IComponentType> slangProgram; ShaderProgramDesc desc = {}; - /// Compile request that owns the lifetime of compiled kernel code. + /// Compile request that owns the lifetime of compiled kernel code. ComPtr<SlangCompileRequest> m_requestForKernels = nullptr; - /// Compile request that owns the lifetime of reflection information. + /// Compile request that owns the lifetime of reflection information. ComPtr<SlangCompileRequest> m_extraRequestForReflection = nullptr; SlangCompileRequest* getRequestForKernels() const { return m_requestForKernels; } - SlangCompileRequest* getRequestForReflection() const { return m_extraRequestForReflection ? m_extraRequestForReflection : m_requestForKernels; } + SlangCompileRequest* getRequestForReflection() const + { + return m_extraRequestForReflection ? m_extraRequestForReflection : m_requestForKernels; + } SlangSession* session = nullptr; - }; struct OutputAndLayout @@ -91,13 +89,29 @@ struct ShaderCompilerUtil Slang::String sourcePath; }; - static SlangResult compileWithLayout(slang::IGlobalSession* globalSession, const Options& options, const ShaderCompilerUtil::Input& input, OutputAndLayout& output); - - static SlangResult readSource(const Slang::String& inSourcePath, Slang::List<char>& outSourceText); - - static SlangResult _compileProgramImpl(slang::IGlobalSession* globalSession, const Options& options, const Input& input, const ShaderCompileRequest& request, Output& out); - static SlangResult compileProgram(slang::IGlobalSession* globalSession, const Options& options, const Input& input, const ShaderCompileRequest& request, Output& out); + static SlangResult compileWithLayout( + slang::IGlobalSession* globalSession, + const Options& options, + const ShaderCompilerUtil::Input& input, + OutputAndLayout& output); + + static SlangResult readSource( + const Slang::String& inSourcePath, + Slang::List<char>& outSourceText); + + static SlangResult _compileProgramImpl( + slang::IGlobalSession* globalSession, + const Options& options, + const Input& input, + const ShaderCompileRequest& request, + Output& out); + static SlangResult compileProgram( + slang::IGlobalSession* globalSession, + const Options& options, + const Input& input, + const ShaderCompileRequest& request, + Output& out); }; -} // renderer_test +} // namespace renderer_test |
