From f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Tue, 29 Oct 2024 14:49:26 +0800 Subject: format * format * Minor test fixes * enable checking cpp format in ci --- tools/render-test/slang-support.h | 66 ++++++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 26 deletions(-) (limited to 'tools/render-test/slang-support.h') 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 - +#include "options.h" +#include "shader-input-layout.h" #include "slang.h" -#include "shader-input-layout.h" -#include "options.h" +#include -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 slangProgram; ShaderProgramDesc desc = {}; - /// Compile request that owns the lifetime of compiled kernel code. + /// Compile request that owns the lifetime of compiled kernel code. ComPtr m_requestForKernels = nullptr; - /// Compile request that owns the lifetime of reflection information. + /// Compile request that owns the lifetime of reflection information. ComPtr 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& 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& 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 -- cgit v1.2.3