Skip to content

Commit be63583

Browse files
MeshShaderTest: don't use auto where unnecessary
1 parent a00a3b8 commit be63583

1 file changed

Lines changed: 52 additions & 52 deletions

File tree

Tests/DiligentCoreAPITest/src/MeshShaderTest.cpp

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -69,25 +69,25 @@ namespace
6969

7070
TEST(MeshShaderTest, DrawTriangle)
7171
{
72-
auto* pEnv = GPUTestingEnvironment::GetInstance();
73-
auto* pDevice = pEnv->GetDevice();
72+
GPUTestingEnvironment* pEnv = GPUTestingEnvironment::GetInstance();
73+
IRenderDevice* pDevice = pEnv->GetDevice();
7474
if (!pDevice->GetDeviceInfo().Features.MeshShaders)
7575
{
7676
GTEST_SKIP() << "Mesh shader is not supported by this device";
7777
}
7878

7979
GPUTestingEnvironment::ScopedReset EnvironmentAutoReset;
8080

81-
auto* pSwapChain = pEnv->GetSwapChain();
82-
auto* pContext = pEnv->GetDeviceContext();
81+
ISwapChain* pSwapChain = pEnv->GetSwapChain();
82+
IDeviceContext* pContext = pEnv->GetDeviceContext();
8383

8484
RefCntAutoPtr<ITestingSwapChain> pTestingSwapChain(pSwapChain, IID_TestingSwapChain);
8585
if (pTestingSwapChain)
8686
{
8787
pContext->Flush();
8888
pContext->InvalidateState();
8989

90-
auto deviceType = pDevice->GetDeviceInfo().Type;
90+
const RENDER_DEVICE_TYPE deviceType = pDevice->GetDeviceInfo().Type;
9191
switch (deviceType)
9292
{
9393
#if D3D12_SUPPORTED
@@ -124,8 +124,8 @@ TEST(MeshShaderTest, DrawTriangle)
124124

125125
GraphicsPipelineStateCreateInfo PSOCreateInfo;
126126

127-
auto& PSODesc = PSOCreateInfo.PSODesc;
128-
auto& GraphicsPipeline = PSOCreateInfo.GraphicsPipeline;
127+
PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
128+
GraphicsPipelineDesc& GraphicsPipeline = PSOCreateInfo.GraphicsPipeline;
129129

130130
PSODesc.Name = "Mesh shader test";
131131

@@ -182,25 +182,25 @@ TEST(MeshShaderTest, DrawTriangle)
182182

183183
TEST(MeshShaderTest, DrawTriangleIndirect)
184184
{
185-
auto* pEnv = GPUTestingEnvironment::GetInstance();
186-
auto* pDevice = pEnv->GetDevice();
185+
GPUTestingEnvironment* pEnv = GPUTestingEnvironment::GetInstance();
186+
IRenderDevice* pDevice = pEnv->GetDevice();
187187
if (!pDevice->GetDeviceInfo().Features.MeshShaders)
188188
{
189189
GTEST_SKIP() << "Mesh shader is not supported by this device";
190190
}
191191

192192
GPUTestingEnvironment::ScopedReset EnvironmentAutoReset;
193193

194-
auto* pSwapChain = pEnv->GetSwapChain();
195-
auto* pContext = pEnv->GetDeviceContext();
194+
ISwapChain* pSwapChain = pEnv->GetSwapChain();
195+
IDeviceContext* pContext = pEnv->GetDeviceContext();
196196

197197
RefCntAutoPtr<ITestingSwapChain> pTestingSwapChain(pSwapChain, IID_TestingSwapChain);
198198
if (pTestingSwapChain)
199199
{
200200
pContext->Flush();
201201
pContext->InvalidateState();
202202

203-
auto deviceType = pDevice->GetDeviceInfo().Type;
203+
const RENDER_DEVICE_TYPE deviceType = pDevice->GetDeviceInfo().Type;
204204
switch (deviceType)
205205
{
206206
#if D3D12_SUPPORTED
@@ -239,8 +239,8 @@ TEST(MeshShaderTest, DrawTriangleIndirect)
239239

240240
GraphicsPipelineStateCreateInfo PSOCreateInfo;
241241

242-
auto& PSODesc = PSOCreateInfo.PSODesc;
243-
auto& GraphicsPipeline = PSOCreateInfo.GraphicsPipeline;
242+
PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
243+
GraphicsPipelineDesc& GraphicsPipeline = PSOCreateInfo.GraphicsPipeline;
244244

245245
PSODesc.Name = "Mesh shader test";
246246

@@ -319,8 +319,8 @@ TEST(MeshShaderTest, DrawTriangleIndirect)
319319

320320
TEST(MeshShaderTest, DrawTriangleIndirectCount)
321321
{
322-
auto* pEnv = GPUTestingEnvironment::GetInstance();
323-
auto* pDevice = pEnv->GetDevice();
322+
GPUTestingEnvironment* pEnv = GPUTestingEnvironment::GetInstance();
323+
IRenderDevice* pDevice = pEnv->GetDevice();
324324
if (!pDevice->GetDeviceInfo().Features.MeshShaders)
325325
{
326326
GTEST_SKIP() << "Mesh shader is not supported by this device";
@@ -332,16 +332,16 @@ TEST(MeshShaderTest, DrawTriangleIndirectCount)
332332

333333
GPUTestingEnvironment::ScopedReset EnvironmentAutoReset;
334334

335-
auto* pSwapChain = pEnv->GetSwapChain();
336-
auto* pContext = pEnv->GetDeviceContext();
335+
ISwapChain* pSwapChain = pEnv->GetSwapChain();
336+
IDeviceContext* pContext = pEnv->GetDeviceContext();
337337

338338
RefCntAutoPtr<ITestingSwapChain> pTestingSwapChain(pSwapChain, IID_TestingSwapChain);
339339
if (pTestingSwapChain)
340340
{
341341
pContext->Flush();
342342
pContext->InvalidateState();
343343

344-
auto deviceType = pDevice->GetDeviceInfo().Type;
344+
const RENDER_DEVICE_TYPE deviceType = pDevice->GetDeviceInfo().Type;
345345
switch (deviceType)
346346
{
347347
#if D3D12_SUPPORTED
@@ -374,8 +374,8 @@ TEST(MeshShaderTest, DrawTriangleIndirectCount)
374374

375375
GraphicsPipelineStateCreateInfo PSOCreateInfo;
376376

377-
auto& PSODesc = PSOCreateInfo.PSODesc;
378-
auto& GraphicsPipeline = PSOCreateInfo.GraphicsPipeline;
377+
PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
378+
GraphicsPipelineDesc& GraphicsPipeline = PSOCreateInfo.GraphicsPipeline;
379379

380380
PSODesc.Name = "Mesh shader test";
381381

@@ -458,25 +458,25 @@ TEST(MeshShaderTest, DrawTriangleIndirectCount)
458458

459459
TEST(MeshShaderTest, DrawTrisWithAmplificationShader)
460460
{
461-
auto* pEnv = GPUTestingEnvironment::GetInstance();
462-
auto* pDevice = pEnv->GetDevice();
461+
GPUTestingEnvironment* pEnv = GPUTestingEnvironment::GetInstance();
462+
IRenderDevice* pDevice = pEnv->GetDevice();
463463
if (!pDevice->GetDeviceInfo().Features.MeshShaders)
464464
{
465465
GTEST_SKIP() << "Mesh shader is not supported by this device";
466466
}
467467

468468
GPUTestingEnvironment::ScopedReset EnvironmentAutoReset;
469469

470-
auto* pSwapChain = pEnv->GetSwapChain();
471-
auto* pContext = pEnv->GetDeviceContext();
470+
ISwapChain* pSwapChain = pEnv->GetSwapChain();
471+
IDeviceContext* pContext = pEnv->GetDeviceContext();
472472

473473
RefCntAutoPtr<ITestingSwapChain> pTestingSwapChain(pSwapChain, IID_TestingSwapChain);
474474
if (pTestingSwapChain)
475475
{
476476
pContext->Flush();
477477
pContext->InvalidateState();
478478

479-
auto deviceType = pDevice->GetDeviceInfo().Type;
479+
const RENDER_DEVICE_TYPE deviceType = pDevice->GetDeviceInfo().Type;
480480
switch (deviceType)
481481
{
482482
#if D3D12_SUPPORTED
@@ -513,8 +513,8 @@ TEST(MeshShaderTest, DrawTrisWithAmplificationShader)
513513

514514
GraphicsPipelineStateCreateInfo PSOCreateInfo;
515515

516-
auto& PSODesc = PSOCreateInfo.PSODesc;
517-
auto& GraphicsPipeline = PSOCreateInfo.GraphicsPipeline;
516+
PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
517+
GraphicsPipelineDesc& GraphicsPipeline = PSOCreateInfo.GraphicsPipeline;
518518

519519
PSODesc.Name = "Amplification shader test";
520520

@@ -580,9 +580,9 @@ TEST(MeshShaderTest, DrawTrisWithAmplificationShader)
580580

581581
TEST(MeshShaderTest, DrawTriangle_MSL)
582582
{
583-
auto* pEnv = GPUTestingEnvironment::GetInstance();
584-
auto* pDevice = pEnv->GetDevice();
585-
const auto& deviceInfo = pDevice->GetDeviceInfo();
583+
GPUTestingEnvironment* pEnv = GPUTestingEnvironment::GetInstance();
584+
IRenderDevice* pDevice = pEnv->GetDevice();
585+
const RenderDeviceInfo& deviceInfo = pDevice->GetDeviceInfo();
586586
if (!deviceInfo.IsMetalDevice())
587587
{
588588
GTEST_SKIP() << "MSL is only supported in Metal";
@@ -594,8 +594,8 @@ TEST(MeshShaderTest, DrawTriangle_MSL)
594594

595595
GPUTestingEnvironment::ScopedReset EnvironmentAutoReset;
596596

597-
auto* pSwapChain = pEnv->GetSwapChain();
598-
auto* pContext = pEnv->GetDeviceContext();
597+
ISwapChain* pSwapChain = pEnv->GetSwapChain();
598+
IDeviceContext* pContext = pEnv->GetDeviceContext();
599599

600600
RefCntAutoPtr<ITestingSwapChain> pTestingSwapChain(pSwapChain, IID_TestingSwapChain);
601601
if (pTestingSwapChain)
@@ -606,7 +606,7 @@ TEST(MeshShaderTest, DrawTriangle_MSL)
606606
#if METAL_SUPPORTED
607607
MeshShaderDrawReferenceMtl(pSwapChain);
608608
#else
609-
LOG_ERROR_AND_THROW("Metal is not supported");
609+
UNEXPECTED("Metal is not supported. This test should've been skipped");
610610
#endif
611611

612612
pTestingSwapChain->TakeSnapshot();
@@ -620,8 +620,8 @@ TEST(MeshShaderTest, DrawTriangle_MSL)
620620

621621
GraphicsPipelineStateCreateInfo PSOCreateInfo;
622622

623-
auto& PSODesc = PSOCreateInfo.PSODesc;
624-
auto& GraphicsPipeline = PSOCreateInfo.GraphicsPipeline;
623+
PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
624+
GraphicsPipelineDesc& GraphicsPipeline = PSOCreateInfo.GraphicsPipeline;
625625

626626
PSODesc.Name = "MSL mesh shader test";
627627

@@ -676,9 +676,9 @@ TEST(MeshShaderTest, DrawTriangle_MSL)
676676

677677
TEST(MeshShaderTest, DrawTriangleIndirect_MSL)
678678
{
679-
auto* pEnv = GPUTestingEnvironment::GetInstance();
680-
auto* pDevice = pEnv->GetDevice();
681-
const auto& deviceInfo = pDevice->GetDeviceInfo();
679+
GPUTestingEnvironment* pEnv = GPUTestingEnvironment::GetInstance();
680+
IRenderDevice* pDevice = pEnv->GetDevice();
681+
const RenderDeviceInfo& deviceInfo = pDevice->GetDeviceInfo();
682682
if (!deviceInfo.IsMetalDevice())
683683
{
684684
GTEST_SKIP() << "MSL is only supported in Metal";
@@ -690,8 +690,8 @@ TEST(MeshShaderTest, DrawTriangleIndirect_MSL)
690690

691691
GPUTestingEnvironment::ScopedReset EnvironmentAutoReset;
692692

693-
auto* pSwapChain = pEnv->GetSwapChain();
694-
auto* pContext = pEnv->GetDeviceContext();
693+
ISwapChain* pSwapChain = pEnv->GetSwapChain();
694+
IDeviceContext* pContext = pEnv->GetDeviceContext();
695695

696696
RefCntAutoPtr<ITestingSwapChain> pTestingSwapChain(pSwapChain, IID_TestingSwapChain);
697697
if (pTestingSwapChain)
@@ -702,7 +702,7 @@ TEST(MeshShaderTest, DrawTriangleIndirect_MSL)
702702
#if METAL_SUPPORTED
703703
MeshShaderIndirectDrawReferenceMtl(pSwapChain);
704704
#else
705-
LOG_ERROR_AND_THROW("Metal is not supported");
705+
UNEXPECTED("Metal is not supported. This test should've been skipped");
706706
#endif
707707

708708
pTestingSwapChain->TakeSnapshot();
@@ -716,8 +716,8 @@ TEST(MeshShaderTest, DrawTriangleIndirect_MSL)
716716

717717
GraphicsPipelineStateCreateInfo PSOCreateInfo;
718718

719-
auto& PSODesc = PSOCreateInfo.PSODesc;
720-
auto& GraphicsPipeline = PSOCreateInfo.GraphicsPipeline;
719+
PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
720+
GraphicsPipelineDesc& GraphicsPipeline = PSOCreateInfo.GraphicsPipeline;
721721

722722
PSODesc.Name = "MSL mesh shader indirect test";
723723

@@ -795,9 +795,9 @@ TEST(MeshShaderTest, DrawTriangleIndirect_MSL)
795795

796796
TEST(MeshShaderTest, DrawTrisWithAmplificationShader_MSL)
797797
{
798-
auto* pEnv = GPUTestingEnvironment::GetInstance();
799-
auto* pDevice = pEnv->GetDevice();
800-
const auto& deviceInfo = pDevice->GetDeviceInfo();
798+
GPUTestingEnvironment* pEnv = GPUTestingEnvironment::GetInstance();
799+
IRenderDevice* pDevice = pEnv->GetDevice();
800+
const RenderDeviceInfo& deviceInfo = pDevice->GetDeviceInfo();
801801
if (!deviceInfo.IsMetalDevice())
802802
{
803803
GTEST_SKIP() << "MSL is only supported in Metal";
@@ -809,8 +809,8 @@ TEST(MeshShaderTest, DrawTrisWithAmplificationShader_MSL)
809809

810810
GPUTestingEnvironment::ScopedReset EnvironmentAutoReset;
811811

812-
auto* pSwapChain = pEnv->GetSwapChain();
813-
auto* pContext = pEnv->GetDeviceContext();
812+
ISwapChain* pSwapChain = pEnv->GetSwapChain();
813+
IDeviceContext* pContext = pEnv->GetDeviceContext();
814814

815815
RefCntAutoPtr<ITestingSwapChain> pTestingSwapChain(pSwapChain, IID_TestingSwapChain);
816816
if (pTestingSwapChain)
@@ -821,7 +821,7 @@ TEST(MeshShaderTest, DrawTrisWithAmplificationShader_MSL)
821821
#if METAL_SUPPORTED
822822
AmplificationShaderDrawReferenceMtl(pSwapChain);
823823
#else
824-
LOG_ERROR_AND_THROW("Metal is not supported");
824+
UNEXPECTED("Metal is not supported. This test should've been skipped");
825825
#endif
826826

827827
pTestingSwapChain->TakeSnapshot();
@@ -835,8 +835,8 @@ TEST(MeshShaderTest, DrawTrisWithAmplificationShader_MSL)
835835

836836
GraphicsPipelineStateCreateInfo PSOCreateInfo;
837837

838-
auto& PSODesc = PSOCreateInfo.PSODesc;
839-
auto& GraphicsPipeline = PSOCreateInfo.GraphicsPipeline;
838+
PipelineStateDesc& PSODesc = PSOCreateInfo.PSODesc;
839+
GraphicsPipelineDesc& GraphicsPipeline = PSOCreateInfo.GraphicsPipeline;
840840

841841
PSODesc.Name = "MSL amplification shader test";
842842

0 commit comments

Comments
 (0)