@@ -18,6 +18,7 @@ extern int g_validation_level;
1818
1919void test_aux_channels (const char *arch_list[], const char *preferred_device) {
2020 using namespace std ::chrono;
21+ using namespace Ray ;
2122
2223 const char TestName[] = " aux_channels" ;
2324
@@ -43,21 +44,21 @@ void test_aux_channels(const char *arch_list[], const char *preferred_device) {
4344 // Setup scene
4445 //
4546
46- Ray:: principled_mat_desc_t mat_desc;
47- mat_desc.base_texture = Ray:: TextureHandle{0 };
47+ principled_mat_desc_t mat_desc;
48+ mat_desc.base_texture = TextureHandle{0 };
4849 mat_desc.roughness = 1 .0f ;
49- mat_desc.roughness_texture = Ray:: TextureHandle{2 };
50+ mat_desc.roughness_texture = TextureHandle{2 };
5051 mat_desc.metallic = 1 .0f ;
51- mat_desc.metallic_texture = Ray:: TextureHandle{3 };
52- mat_desc.normal_map = Ray:: TextureHandle{1 };
53- mat_desc.alpha_texture = Ray:: TextureHandle{4 };
52+ mat_desc.metallic_texture = TextureHandle{3 };
53+ mat_desc.normal_map = TextureHandle{1 };
54+ mat_desc.alpha_texture = TextureHandle{4 };
5455
5556 const char *textures[] = {
5657 " test_data/textures/Fence007A_2K_Color.tga" , " test_data/textures/Fence007A_2K_NormalGL.tga" ,
5758 " test_data/textures/Fence007A_2K_Roughness.tga" , " test_data/textures/Fence007A_2K_Metalness.tga" ,
5859 " test_data/textures/Fence007A_2K_Opacity.tga" };
5960
60- Ray:: settings_t s;
61+ settings_t s;
6162 s.w = test_img_w;
6263 s.h = test_img_h;
6364 s.preferred_device = preferred_device;
@@ -69,7 +70,7 @@ void test_aux_channels(const char *arch_list[], const char *preferred_device) {
6970 const double BaseColor_MinPSNR = 28.44 , Normals_MinPSNR = 38.34 , Depth_MinPSNR = 43.3 ;
7071
7172 for (const char **arch = arch_list; *arch; ++arch) {
72- const auto rt = Ray:: RendererTypeFromName (*arch);
73+ const auto rt = RendererTypeFromName (*arch);
7374
7475 for (const bool use_hwrt : {false , true }) {
7576 if (use_hwrt && g_nohwrt) {
@@ -81,24 +82,23 @@ void test_aux_channels(const char *arch_list[], const char *preferred_device) {
8182 const auto start_time = high_resolution_clock::now ();
8283
8384 using namespace std ::placeholders;
84- auto parallel_for =
85- std::bind (&ThreadPool::ParallelFor<Ray::ParallelForFunction>, std::ref (threads), _1, _2, _3);
85+ auto parallel_for = std::bind (&ThreadPool::ParallelFor<ParallelForFunction>, std::ref (threads), _1, _2, _3);
8686
87- auto renderer = std::unique_ptr<Ray:: RendererBase>(Ray:: CreateRenderer (s, &g_log_err, parallel_for, rt));
87+ auto renderer = std::unique_ptr<RendererBase>(CreateRenderer (s, &g_log_err, parallel_for, rt));
8888 if (!renderer || renderer->type () != rt || renderer->is_hwrt () != use_hwrt) {
8989 // skip unsupported (we fell back to some other renderer)
9090 continue ;
9191 }
9292 if (preferred_device) {
9393 // make sure we use requested device
94- if (!require (Ray:: MatchDeviceNames (renderer->device_name (), preferred_device))) {
94+ if (!require (MatchDeviceNames (renderer->device_name (), preferred_device))) {
9595 std::lock_guard<std::mutex> _ (g_stdout_mtx);
9696 printf (" Wrong device: %s (%s was requested)\n " , renderer->device_name (), preferred_device);
9797 return ;
9898 }
9999 }
100100
101- auto scene = std::unique_ptr<Ray:: SceneBase>(renderer->CreateScene ());
101+ auto scene = std::unique_ptr<SceneBase>(renderer->CreateScene ());
102102
103103 setup_test_scene (threads, *scene, -1 , 0 .0f , mat_desc, textures, eTestScene::Standard);
104104
@@ -107,8 +107,8 @@ void test_aux_channels(const char *arch_list[], const char *preferred_device) {
107107 schedule_render_jobs (threads, *renderer, scene.get (), s, SampleCount, eDenoiseMethod::None, false ,
108108 name_buf);
109109
110- const auto base_color_pixels = renderer->get_aux_pixels_ref (Ray:: eAUXBuffer::BaseColor);
111- const auto depth_normals_pixels = renderer->get_aux_pixels_ref (Ray:: eAUXBuffer::DepthNormals);
110+ const auto base_color_pixels = renderer->get_aux_pixels_ref (eAUXBuffer::BaseColor);
111+ const auto depth_normals_pixels = renderer->get_aux_pixels_ref (eAUXBuffer::DepthNormals);
112112
113113 std::unique_ptr<uint8_t []> base_color_data_u8 (new uint8_t [test_img_w * test_img_h * 3 ]);
114114 std::unique_ptr<uint8_t []> normals_data_u8 (new uint8_t [test_img_w * test_img_h * 3 ]);
@@ -119,7 +119,7 @@ void test_aux_channels(const char *arch_list[], const char *preferred_device) {
119119 for (int j = 0 ; j < test_img_h; j++) {
120120 for (int i = 0 ; i < test_img_w; i++) {
121121 { // check base color
122- Ray:: color_rgba_t c = base_color_pixels.ptr [j * base_color_pixels.pitch + i];
122+ color_rgba_t c = base_color_pixels.ptr [j * base_color_pixels.pitch + i];
123123
124124 for (int k = 0 ; k < 3 ; ++k) {
125125 if (c.v [k] < 0 .0031308f ) {
@@ -146,7 +146,7 @@ void test_aux_channels(const char *arch_list[], const char *preferred_device) {
146146 base_color_mse += diff_b * diff_b;
147147 }
148148 { // check normals
149- const Ray:: color_rgba_t &n = depth_normals_pixels.ptr [j * depth_normals_pixels.pitch + i];
149+ const color_rgba_t &n = depth_normals_pixels.ptr [j * depth_normals_pixels.pitch + i];
150150
151151 const auto r = uint8_t ((n.v [0 ] * 0 .5f + 0 .5f ) * 255 );
152152 const auto g = uint8_t ((n.v [1 ] * 0 .5f + 0 .5f ) * 255 );
@@ -165,7 +165,7 @@ void test_aux_channels(const char *arch_list[], const char *preferred_device) {
165165 normals_mse += diff_b * diff_b;
166166 }
167167 { // check depth
168- const Ray:: color_rgba_t &n = depth_normals_pixels.ptr [j * depth_normals_pixels.pitch + i];
168+ const color_rgba_t &n = depth_normals_pixels.ptr [j * depth_normals_pixels.pitch + i];
169169
170170 const auto u8 = uint8_t (n.v [3 ] * 255 );
171171
@@ -197,25 +197,25 @@ void test_aux_channels(const char *arch_list[], const char *preferred_device) {
197197 {
198198 std::lock_guard<std::mutex> _ (g_stdout_mtx);
199199 if (g_minimal_output) {
200- printf (" \r %s (%6s, %s): %.1f%% " , name_buf, Ray:: RendererTypeName (rt), s.use_hwrt ? " HWRT" : " SWRT" ,
200+ printf (" \r %s (%6s, %s): %.1f%% " , name_buf, RendererTypeName (rt), s.use_hwrt ? " HWRT" : " SWRT" ,
201201 100.0 );
202202 }
203203 printf (" (PSNR: %.2f/%.2f dB, %.2f/%.2f dB, %.2f/%.2f dB, Time: %.2fm)\n " , base_color_psnr,
204204 BaseColor_MinPSNR, normals_psnr, Normals_MinPSNR, depth_psnr, Depth_MinPSNR, test_duration_m);
205205 fflush (stdout);
206206 }
207207
208- std::string type_name = Ray:: RendererTypeName (rt);
208+ std::string type_name = RendererTypeName (rt);
209209 if (use_hwrt) {
210210 type_name += " _HWRT" ;
211211 }
212212
213213 snprintf (name_buf, sizeof (name_buf), " test_data/%s/%s_base_color_out.tga" , TestName, type_name.c_str ());
214- Ray:: WriteTGA (&base_color_data_u8[0 ], test_img_w, test_img_h, 3 , name_buf);
214+ WriteTGA (&base_color_data_u8[0 ], test_img_w, test_img_h, 3 , name_buf);
215215 snprintf (name_buf, sizeof (name_buf), " test_data/%s/%s_normals_out.tga" , TestName, type_name.c_str ());
216- Ray:: WriteTGA (&normals_data_u8[0 ], test_img_w, test_img_h, 3 , name_buf);
216+ WriteTGA (&normals_data_u8[0 ], test_img_w, test_img_h, 3 , name_buf);
217217 snprintf (name_buf, sizeof (name_buf), " test_data/%s/%s_depth_out.tga" , TestName, type_name.c_str ());
218- Ray:: WriteTGA (&depth_data_u8[0 ], test_img_w, test_img_h, 3 , name_buf);
218+ WriteTGA (&depth_data_u8[0 ], test_img_w, test_img_h, 3 , name_buf);
219219
220220 require (base_color_psnr >= BaseColor_MinPSNR);
221221 require (normals_psnr >= Normals_MinPSNR);
0 commit comments