11/*
2- * Copyright 2019-2024 Diligent Graphics LLC
2+ * Copyright 2019-2025 Diligent Graphics LLC
33 * Copyright 2015-2019 Egor Yusov
44 *
55 * Licensed under the Apache License, Version 2.0 (the "License");
@@ -40,8 +40,8 @@ RefCntAutoPtr<IShader> CreateTestShader(const char* FileName,
4040 const char * EntryPoint,
4141 SHADER_TYPE ShaderType)
4242{
43- auto * pEnv = GPUTestingEnvironment::GetInstance ();
44- auto * pDevice = pEnv->GetDevice ();
43+ GPUTestingEnvironment * pEnv = GPUTestingEnvironment::GetInstance ();
44+ IRenderDevice* pDevice = pEnv->GetDevice ();
4545
4646 ShaderCreateInfo ShaderCI;
4747
@@ -64,23 +64,23 @@ RefCntAutoPtr<IShader> CreateTestShader(const char* FileName,
6464
6565TEST (HLSL2GLSLConverterTest, VS_PS)
6666{
67- auto * pEnv = GPUTestingEnvironment::GetInstance ();
67+ GPUTestingEnvironment * pEnv = GPUTestingEnvironment::GetInstance ();
6868 if (pEnv->GetDevice ()->GetDeviceInfo ().IsWebGPUDevice ())
6969 {
7070 GTEST_SKIP () << " WebGPU can't handle shaders in this test" ;
7171 }
7272
7373 GPUTestingEnvironment::ScopedReset EnvironmentAutoReset;
7474
75- auto pVS = CreateTestShader (" VS_PS.hlsl" , " TestVS" , SHADER_TYPE_VERTEX);
75+ RefCntAutoPtr<IShader> pVS = CreateTestShader (" VS_PS.hlsl" , " TestVS" , SHADER_TYPE_VERTEX);
7676 EXPECT_NE (pVS, nullptr );
77- auto pPS = CreateTestShader (" VS_PS.hlsl" , " TestPS" , SHADER_TYPE_PIXEL);
77+ RefCntAutoPtr<IShader> pPS = CreateTestShader (" VS_PS.hlsl" , " TestPS" , SHADER_TYPE_PIXEL);
7878 EXPECT_NE (pPS, nullptr );
7979}
8080
8181TEST (HLSL2GLSLConverterTest, CS_RWTex1D)
8282{
83- auto * pEnv = GPUTestingEnvironment::GetInstance ();
83+ GPUTestingEnvironment * pEnv = GPUTestingEnvironment::GetInstance ();
8484 if (pEnv->GetDevice ()->GetDeviceInfo ().IsWebGPUDevice ())
8585 {
8686 GTEST_SKIP () << " WebGPU can't handle shaders in this test" ;
@@ -92,13 +92,13 @@ TEST(HLSL2GLSLConverterTest, CS_RWTex1D)
9292
9393 GPUTestingEnvironment::ScopedReset EnvironmentAutoReset;
9494
95- auto pCS = CreateTestShader (" CS_RWTex1D.hlsl" , " TestCS" , SHADER_TYPE_COMPUTE);
95+ RefCntAutoPtr<IShader> pCS = CreateTestShader (" CS_RWTex1D.hlsl" , " TestCS" , SHADER_TYPE_COMPUTE);
9696 EXPECT_NE (pCS, nullptr );
9797}
9898
9999TEST (HLSL2GLSLConverterTest, CS_RWTex2D_1)
100100{
101- auto * pEnv = GPUTestingEnvironment::GetInstance ();
101+ GPUTestingEnvironment * pEnv = GPUTestingEnvironment::GetInstance ();
102102 if (pEnv->GetDevice ()->GetDeviceInfo ().IsWebGPUDevice ())
103103 {
104104 GTEST_SKIP () << " WebGPU can't handle shaders in this test" ;
@@ -110,13 +110,13 @@ TEST(HLSL2GLSLConverterTest, CS_RWTex2D_1)
110110
111111 GPUTestingEnvironment::ScopedReset EnvironmentAutoReset;
112112
113- auto pCS = CreateTestShader (" CS_RWTex2D_1.hlsl" , " TestCS" , SHADER_TYPE_COMPUTE);
113+ RefCntAutoPtr<IShader> pCS = CreateTestShader (" CS_RWTex2D_1.hlsl" , " TestCS" , SHADER_TYPE_COMPUTE);
114114 EXPECT_NE (pCS, nullptr );
115115}
116116
117117TEST (HLSL2GLSLConverterTest, CS_RWTex2D_2)
118118{
119- auto * pEnv = GPUTestingEnvironment::GetInstance ();
119+ GPUTestingEnvironment * pEnv = GPUTestingEnvironment::GetInstance ();
120120 if (pEnv->GetDevice ()->GetDeviceInfo ().IsWebGPUDevice ())
121121 {
122122 GTEST_SKIP () << " WebGPU can't handle shaders in this test" ;
@@ -128,13 +128,13 @@ TEST(HLSL2GLSLConverterTest, CS_RWTex2D_2)
128128
129129 GPUTestingEnvironment::ScopedReset EnvironmentAutoReset;
130130
131- auto pCS = CreateTestShader (" CS_RWTex2D_2.hlsl" , " TestCS" , SHADER_TYPE_COMPUTE);
131+ RefCntAutoPtr<IShader> pCS = CreateTestShader (" CS_RWTex2D_2.hlsl" , " TestCS" , SHADER_TYPE_COMPUTE);
132132 EXPECT_NE (pCS, nullptr );
133133}
134134
135135TEST (HLSL2GLSLConverterTest, CS_RWBuff)
136136{
137- auto * pEnv = GPUTestingEnvironment::GetInstance ();
137+ GPUTestingEnvironment * pEnv = GPUTestingEnvironment::GetInstance ();
138138 if (pEnv->GetDevice ()->GetDeviceInfo ().IsWebGPUDevice ())
139139 {
140140 GTEST_SKIP () << " WebGPU can't handle shaders in this test" ;
@@ -146,21 +146,21 @@ TEST(HLSL2GLSLConverterTest, CS_RWBuff)
146146
147147 GPUTestingEnvironment::ScopedReset EnvironmentAutoReset;
148148
149- auto pCS = CreateTestShader (" CS_RWBuff.hlsl" , " TestCS" , SHADER_TYPE_COMPUTE);
149+ RefCntAutoPtr<IShader> pCS = CreateTestShader (" CS_RWBuff.hlsl" , " TestCS" , SHADER_TYPE_COMPUTE);
150150 EXPECT_NE (pCS, nullptr );
151151}
152152
153153TEST (HLSL2GLSLConverterTest, GS)
154154{
155- auto * pEnv = GPUTestingEnvironment::GetInstance ();
155+ GPUTestingEnvironment * pEnv = GPUTestingEnvironment::GetInstance ();
156156 if (!pEnv->GetDevice ()->GetDeviceInfo ().Features .GeometryShaders )
157157 {
158158 GTEST_SKIP () << " This device does not support geometry shaders" ;
159159 }
160160
161161 GPUTestingEnvironment::ScopedReset EnvironmentAutoReset;
162162
163- auto pGS = CreateTestShader (" GS.hlsl" , " main" , SHADER_TYPE_GEOMETRY);
163+ RefCntAutoPtr<IShader> pGS = CreateTestShader (" GS.hlsl" , " main" , SHADER_TYPE_GEOMETRY);
164164 EXPECT_NE (pGS, nullptr );
165165}
166166
@@ -170,7 +170,7 @@ TEST(HLSL2GLSLConverterTest, Preprocessor)
170170
171171 for (const char * Entry : {" main1" , " main2" , " main3" })
172172 {
173- auto pVS = CreateTestShader (" PreprocessorTest.hlsl" , Entry, SHADER_TYPE_PIXEL);
173+ RefCntAutoPtr<IShader> pVS = CreateTestShader (" PreprocessorTest.hlsl" , Entry, SHADER_TYPE_PIXEL);
174174 EXPECT_NE (pVS, nullptr );
175175 }
176176}
0 commit comments