Blender  V3.3
integrator_tile_test.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2011-2022 Blender Foundation */
3 
4 #include "testing/testing.h"
5 
6 #include "integrator/tile.h"
7 #include "util/math.h"
8 
10 
12 {
13  /* Make sure CPU-like case is handled properly. */
14  EXPECT_EQ(tile_calculate_best_size(false, make_int2(1920, 1080), 1, 1, 1.0f), TileSize(1, 1, 1));
15  EXPECT_EQ(tile_calculate_best_size(false, make_int2(1920, 1080), 100, 1, 1.0f),
16  TileSize(1, 1, 1));
17 
18  /* Enough path states to fit an entire image with all samples. */
19  EXPECT_EQ(tile_calculate_best_size(false, make_int2(1920, 1080), 1, 1920 * 1080, 1.0f),
20  TileSize(1920, 1080, 1));
21  EXPECT_EQ(tile_calculate_best_size(false, make_int2(1920, 1080), 100, 1920 * 1080 * 100, 1.0f),
22  TileSize(1920, 1080, 100));
23 }
24 
26 {
27  EXPECT_EQ(tile_calculate_best_size(false, make_int2(32, 32), 262144, 131072, 1.0f),
28  TileSize(1, 1, 512));
29  EXPECT_EQ(tile_calculate_best_size(false, make_int2(32, 32), 1048576, 131072, 1.0f),
30  TileSize(1, 1, 1024));
31  EXPECT_EQ(tile_calculate_best_size(false, make_int2(32, 32), 10485760, 131072, 1.0f),
32  TileSize(1, 1, 4096));
33 
34  EXPECT_EQ(tile_calculate_best_size(false, make_int2(32, 32), 8192 * 8192 * 2, 1024, 1.0f),
35  TileSize(1, 1, 1024));
36 }
37 
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9
TileSize tile_calculate_best_size(const bool accel_rt, const int2 &image_size, const int num_samples, const int max_num_path_states, const float scrambling_distance)
CCL_NAMESPACE_BEGIN TEST(tile_calculate_best_size, Basic)
#define make_int2(x, y)
Definition: metal/compat.h:206