Skip to content

Commit bfe75be

Browse files
committed
format code
1 parent f49e1e1 commit bfe75be

File tree

5 files changed

+41
-41
lines changed

5 files changed

+41
-41
lines changed

source/slang/slang-compiler.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1722,7 +1722,7 @@ SlangResult CodeGenContext::emitWithDownstreamForEntryPoints(ComPtr<IArtifact>&
17221722
}
17231723
}
17241724
}
1725-
//HERE
1725+
// HERE
17261726
}
17271727
});
17281728

tools/gfx-unit-test/precompiled-module-2.cpp

+6-7
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ void precompiledModule2TestImplCommon(
180180
printf("File, Line: %s, %d\n", __FILE__, __LINE__);
181181
fflush(stdout);
182182
fflush(stderr);
183-
183+
184184
const int numberCount = 4;
185185
float initialData[] = {0.0f, 0.0f, 0.0f, 0.0f};
186186
IBufferResource::Desc bufferDesc = {};
@@ -199,13 +199,13 @@ void precompiledModule2TestImplCommon(
199199
printf("File, Line: %s, %d\n", __FILE__, __LINE__);
200200
fflush(stdout);
201201
fflush(stderr);
202-
202+
203203
GFX_CHECK_CALL_ABORT(
204204
device->createBufferResource(bufferDesc, (void*)initialData, numbersBuffer.writeRef()));
205205
printf("File, Line: %s, %d\n", __FILE__, __LINE__);
206206
fflush(stdout);
207207
fflush(stderr);
208-
208+
209209
ComPtr<IResourceView> bufferView;
210210
IResourceView::Desc viewDesc = {};
211211
viewDesc.type = IResourceView::Type::UnorderedAccess;
@@ -215,7 +215,7 @@ void precompiledModule2TestImplCommon(
215215
printf("File, Line: %s, %d\n", __FILE__, __LINE__);
216216
fflush(stdout);
217217
fflush(stderr);
218-
218+
219219
// We have done all the set up work, now it is time to start recording a command buffer for
220220
// GPU execution.
221221
{
@@ -241,7 +241,7 @@ void precompiledModule2TestImplCommon(
241241
printf("File, Line: %s, %d\n", __FILE__, __LINE__);
242242
fflush(stdout);
243243
fflush(stderr);
244-
244+
245245
compareComputeResult(device, numbersBuffer, Slang::makeArray<float>(3.0f, 3.0f, 3.0f, 3.0f));
246246
printf("File, Line: %s, %d\n", __FILE__, __LINE__);
247247
fflush(stdout);
@@ -298,15 +298,14 @@ SLANG_UNIT_TEST(precompiledTargetModule2Vulkan)
298298
}
299299
catch (const std::exception&)
300300
{
301-
printf("Caught exception\n");
301+
printf("Caught exception\n");
302302
fflush(stdout);
303303
}
304304
catch (...)
305305
{
306306
printf("Caught unknown exception\n");
307307
fflush(stdout);
308308
}
309-
310309
}
311310

312311
} // namespace gfx_test

tools/gfx/renderer-shared.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1184,8 +1184,8 @@ Result ShaderProgramBase::compileShaders(RendererBase* device)
11841184
{
11851185
ComPtr<slang::IBlob> diagnosticsBlob;
11861186
auto result = precompileService->getPrecompiledTargetCode(
1187-
compileTarget,
1188-
downstreamIR.writeRef(),
1187+
compileTarget,
1188+
downstreamIR.writeRef(),
11891189
diagnosticsBlob.writeRef());
11901190
if (result == SLANG_OK)
11911191
{

tools/gfx/vulkan/vk-shader-program.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
// vk-shader-program.cpp
22
#include "vk-shader-program.h"
33

4+
#include "external/spirv-tools/include/spirv-tools/linker.hpp"
45
#include "vk-device.h"
56
#include "vk-util.h"
67

7-
#include "external/spirv-tools/include/spirv-tools/linker.hpp"
8-
98
namespace gfx
109
{
1110

@@ -71,14 +70,14 @@ VkPipelineShaderStageCreateInfo ShaderProgramImpl::compileEntryPoint(
7170
return shaderStageCreateInfo;
7271
}
7372

74-
static ComPtr<ISlangBlob> LinkUsingSPIRVTools(List<ComPtr<ISlangBlob> > kernelCodes)
73+
static ComPtr<ISlangBlob> LinkUsingSPIRVTools(List<ComPtr<ISlangBlob>> kernelCodes)
7574
{
7675
spvtools::Context context(SPV_ENV_UNIVERSAL_1_5);
7776
spvtools::LinkerOptions options;
7877
spvtools::MessageConsumer consumer = [](spv_message_level_t level,
79-
const char* source,
80-
const spv_position_t& position,
81-
const char* message)
78+
const char* source,
79+
const spv_position_t& position,
80+
const char* message)
8281
{
8382
printf("SPIRV-TOOLS: %s\n", message);
8483
printf("SPIRV-TOOLS: %s\n", source);
@@ -108,7 +107,8 @@ static ComPtr<ISlangBlob> LinkUsingSPIRVTools(List<ComPtr<ISlangBlob> > kernelCo
108107

109108
// Replace kernel code with linked binary
110109
// Creates a new blob with the linked binary
111-
linkedKernelCode = RawBlob::create(linked_binary.data(), linked_binary.size() * sizeof(uint32_t));
110+
linkedKernelCode =
111+
RawBlob::create(linked_binary.data(), linked_binary.size() * sizeof(uint32_t));
112112

113113
return linkedKernelCode;
114114
}

tools/slang-test/slang-test-main.cpp

+25-24
Original file line numberDiff line numberDiff line change
@@ -2684,7 +2684,7 @@ static TestResult runCPPCompilerSharedLibrary(TestContext* context, TestInput& i
26842684
{
26852685
printf("Unable to access 'test' function\n");
26862686
}
2687-
2687+
26882688
printf("Unload handle\n");
26892689
fflush(stdout);
26902690
SharedLibrary::unload(handle);
@@ -4555,12 +4555,16 @@ static SlangResult runUnitTestModule(
45554555
SLANG_RETURN_ON_FAIL(loader->loadSharedLibrary(
45564556
Path::combine(context->dllDirectoryPath, moduleName).getBuffer(),
45574557
moduleLibrary.writeRef()));
4558-
printf("FILE LINE: %s %d\n", __FILE__, __LINE__); fflush(stdout); fflush(stderr);
4558+
printf("FILE LINE: %s %d\n", __FILE__, __LINE__);
4559+
fflush(stdout);
4560+
fflush(stderr);
45594561
UnitTestGetModuleFunc getModuleFunc =
45604562
(UnitTestGetModuleFunc)moduleLibrary->findFuncByName("slangUnitTestGetModule");
45614563
if (!getModuleFunc)
45624564
return SLANG_FAIL;
4563-
printf("FILE LINE: %s %d\n", __FILE__, __LINE__); fflush(stdout); fflush(stderr);
4565+
printf("FILE LINE: %s %d\n", __FILE__, __LINE__);
4566+
fflush(stdout);
4567+
fflush(stderr);
45644568

45654569
IUnitTestModule* testModule = getModuleFunc();
45664570
if (!testModule)
@@ -4637,7 +4641,7 @@ static SlangResult runUnitTestModule(
46374641
printf("2RPC FILE LINE: %s %d\n", __FILE__, __LINE__);
46384642
const auto testResult = _asTestResult(ToolReturnCode(exeRes.resultCode));
46394643
printf("2RPC FILE LINE: %s %d\n", __FILE__, __LINE__);
4640-
4644+
46414645
// If the test fails, output any output - which might give information about
46424646
// individual tests that have failed.
46434647
if (SLANG_FAILED(rpcRes) || testResult == TestResult::Fail)
@@ -4663,13 +4667,12 @@ static SlangResult runUnitTestModule(
46634667
fflush(stderr);
46644668
printf("TF FILE LINE: %s %d\n", __FILE__, __LINE__);
46654669
fflush(stdout);
4666-
fflush(stderr);
4670+
fflush(stderr);
46674671
test.testFunc(&unitTestContext);
46684672
printf("TF2 FILE LINE: %s %d\n", __FILE__, __LINE__);
46694673
printf("FILE LINE: %s %d\n", __FILE__, __LINE__);
46704674
fflush(stdout);
46714675
fflush(stderr);
4672-
46734676
}
46744677
catch (...)
46754678
{
@@ -4712,7 +4715,6 @@ static SlangResult runUnitTestModule(
47124715
printf("B Ran unit test file %s line %d\n", __FILE__, __LINE__);
47134716
fflush(stdout);
47144717
fflush(stderr);
4715-
47164718
}
47174719
}
47184720

@@ -4775,7 +4777,7 @@ SlangResult innerMain(int argc, char** argv)
47754777
{
47764778
SlangSession* session = context.getSession();
47774779

4778-
4780+
47794781
out.print("Supported backends:");
47804782

47814783
for (int i = 0; i < SLANG_PASS_THROUGH_COUNT_OF; ++i)
@@ -4818,7 +4820,7 @@ SlangResult innerMain(int argc, char** argv)
48184820
SLANG_CPP_SOURCE,
48194821
SLANG_SHADER_HOST_CALLABLE);
48204822
out.print("FILE LINE: %s %d\n", __FILE__, __LINE__);
4821-
4823+
48224824
if (hasLlvm && hostCallableCompiler == SLANG_PASS_THROUGH_LLVM && SLANG_PROCESSOR_X86)
48234825
{
48244826
// TODO(JS)
@@ -4831,10 +4833,9 @@ SlangResult innerMain(int argc, char** argv)
48314833
categorySet.add("war-double-host-callable", fullTestCategory);
48324834
}
48334835
out.print("FILE LINE: %s %d\n", __FILE__, __LINE__);
4834-
48354836
}
48364837
out.print("FILE LINE: %s %d\n", __FILE__, __LINE__);
4837-
4838+
48384839
// Working out what renderApis is worked on on demand through
48394840
// _getAvailableRenderApiFlags()
48404841

@@ -4843,21 +4844,21 @@ SlangResult innerMain(int argc, char** argv)
48434844
context.setInnerMainFunc("slangc", &SlangCTool::innerMain);
48444845
}
48454846
out.print("FILE LINE: %s %d\n", __FILE__, __LINE__);
4846-
4847+
48474848
SLANG_RETURN_ON_FAIL(
48484849
Options::parse(argc, argv, &categorySet, StdWriters::getError(), &context.options));
48494850
out.print("FILE LINE: %s %d\n", __FILE__, __LINE__);
4850-
4851+
48514852
Options& options = context.options;
48524853
out.print("FILE LINE: %s %d\n", __FILE__, __LINE__);
4853-
4854+
48544855
context.setMaxTestRunnerThreadCount(options.serverCount);
48554856
out.print("FILE LINE: %s %d\n", __FILE__, __LINE__);
4856-
4857+
48574858
// Set up the prelude/s
48584859
TestToolUtil::setSessionDefaultPreludeFromExePath(argv[0], context.getSession());
48594860
out.print("FILE LINE: %s %d\n", __FILE__, __LINE__);
4860-
4861+
48614862
if (options.outputMode == TestOutputMode::TeamCity)
48624863
{
48634864
// On TeamCity CI there is an issue with unix/linux targets where test system may be
@@ -4876,11 +4877,11 @@ SlangResult innerMain(int argc, char** argv)
48764877
_disableD3D12Backend(&context);
48774878
#endif
48784879
out.print("FILE LINE: %s %d\n", __FILE__, __LINE__);
4879-
4880+
48804881
if (options.subCommand.getLength())
48814882
{
48824883
out.print("FILE LINE: %s %d\n", __FILE__, __LINE__);
4883-
4884+
48844885
// Get the function from the tool
48854886
auto func = context.getInnerMainFunc(options.binDir, options.subCommand);
48864887
if (!func)
@@ -4907,20 +4908,20 @@ SlangResult innerMain(int argc, char** argv)
49074908
args.getBuffer());
49084909
}
49094910
out.print("FILE LINE: %s %d\n", __FILE__, __LINE__);
4910-
4911+
49114912
if (options.includeCategories.getCount() == 0)
49124913
{
49134914
options.includeCategories.add(fullTestCategory, fullTestCategory);
49144915
}
49154916
out.print("FILE LINE: %s %d\n", __FILE__, __LINE__);
4916-
4917+
49174918
// Don't include OptiX tests unless the client has explicit opted into them.
49184919
if (!options.includeCategories.containsKey(optixTestCategory))
49194920
{
49204921
options.excludeCategories.add(optixTestCategory, optixTestCategory);
49214922
}
49224923
out.print("FILE LINE: %s %d\n", __FILE__, __LINE__);
4923-
4924+
49244925
// Exclude rendering tests when building under AppVeyor.
49254926
//
49264927
// TODO: this is very ad hoc, and we should do something cleaner.
@@ -4947,7 +4948,7 @@ SlangResult innerMain(int argc, char** argv)
49474948
runTestsInDirectory(&context);
49484949
}
49494950
out.print("FILE LINE: %s %d\n", __FILE__, __LINE__);
4950-
4951+
49514952
// Run the unit tests (these are internal C++ tests - not specified via files in a
49524953
// directory) They are registered with SLANG_UNIT_TEST macro
49534954
//
@@ -4987,7 +4988,7 @@ SlangResult innerMain(int argc, char** argv)
49874988
TestReporter::set(nullptr);
49884989
}
49894990
out.print("4941 FILE LINE: %s %d\n", __FILE__, __LINE__);
4990-
4991+
49914992
// If we have a couple failed tests, they maybe intermittent failures due to parallel
49924993
// excution or driver instability. We can try running them again.
49934994
static constexpr int kFailedTestLimitForRetry = 16;
@@ -5021,7 +5022,7 @@ SlangResult innerMain(int argc, char** argv)
50215022
}
50225023
}
50235024
out.print("4975 FILE LINE: %s %d\n", __FILE__, __LINE__);
5024-
5025+
50255026
reporter.outputSummary();
50265027
return reporter.didAllSucceed() ? SLANG_OK : SLANG_FAIL;
50275028
}

0 commit comments

Comments
 (0)