Blender
V4.3
intern
cycles
test
integrator_tile_test.cpp
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2
*
3
* SPDX-License-Identifier: Apache-2.0 */
4
5
#include "testing/testing.h"
6
7
#include "
integrator/tile.h
"
8
#include "
util/math.h
"
9
10
CCL_NAMESPACE_BEGIN
11
12
TEST
(
tile_calculate_best_size
, Basic)
13
{
14
/* Make sure CPU-like case is handled properly. */
15
EXPECT_EQ
(
tile_calculate_best_size
(
false
,
make_int2
(1920, 1080), 1, 1, 1.0f),
TileSize
(1, 1, 1));
16
EXPECT_EQ
(
tile_calculate_best_size
(
false
,
make_int2
(1920, 1080), 100, 1, 1.0f),
17
TileSize
(1, 1, 1));
18
19
/* Enough path states to fit an entire image with all samples. */
20
EXPECT_EQ
(
tile_calculate_best_size
(
false
,
make_int2
(1920, 1080), 1, 1920 * 1080, 1.0f),
21
TileSize
(1920, 1080, 1));
22
EXPECT_EQ
(
tile_calculate_best_size
(
false
,
make_int2
(1920, 1080), 100, 1920 * 1080 * 100, 1.0f),
23
TileSize
(1920, 1080, 100));
24
}
25
26
TEST
(
tile_calculate_best_size
, Extreme)
27
{
28
EXPECT_EQ
(
tile_calculate_best_size
(
false
,
make_int2
(32, 32), 262144, 131072, 1.0f),
29
TileSize
(1, 1, 512));
30
EXPECT_EQ
(
tile_calculate_best_size
(
false
,
make_int2
(32, 32), 1048576, 131072, 1.0f),
31
TileSize
(1, 1, 1024));
32
EXPECT_EQ
(
tile_calculate_best_size
(
false
,
make_int2
(32, 32), 10485760, 131072, 1.0f),
33
TileSize
(1, 1, 4096));
34
35
EXPECT_EQ
(
tile_calculate_best_size
(
false
,
make_int2
(32, 32), 8192 * 8192 * 2, 1024, 1.0f),
36
TileSize
(1, 1, 1024));
37
}
38
39
CCL_NAMESPACE_END
EXPECT_EQ
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
CCL_NAMESPACE_END
#define CCL_NAMESPACE_END
Definition
device/cuda/compat.h:10
make_int2
ccl_device_forceinline int2 make_int2(const int x, const int y)
Definition
device/metal/compat.h:242
tile_calculate_best_size
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)
Definition
integrator/tile.cpp:39
tile.h
TEST
CCL_NAMESPACE_BEGIN TEST(tile_calculate_best_size, Basic)
Definition
integrator_tile_test.cpp:12
CCL_NAMESPACE_BEGIN
Definition
python.cpp:44
TileSize
Definition
integrator/tile.h:13
math.h
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0