Blender V4.3
integrator/tile.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#pragma once
6
7#include <iosfwd>
8
9#include "util/types.h"
10
12
13struct TileSize {
14 TileSize() = default;
15
16 inline TileSize(int width, int height, int num_samples)
18 {
19 }
20
21 inline bool operator==(const TileSize &other) const
22 {
23 return width == other.width && height == other.height && num_samples == other.num_samples;
24 }
25 inline bool operator!=(const TileSize &other) const
26 {
27 return !(*this == other);
28 }
29
30 int width = 0, height = 0;
31 int num_samples = 0;
32};
33
34std::ostream &operator<<(std::ostream &os, const TileSize &tile_size);
35
36/* Calculate tile size which is best suitable for rendering image of a given size with given number
37 * of active path states.
38 * Will attempt to provide best guess to keep path tracing threads of a device as localized as
39 * possible, and have as many threads active for every tile as possible. */
40TileSize tile_calculate_best_size(const bool accel_rt,
41 const int2 &image_size,
42 const int num_samples,
43 const int max_num_path_states,
44 const float scrambling_distance);
45
#define CCL_NAMESPACE_END
std::ostream & operator<<(std::ostream &os, const TileSize &tile_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)
TileSize()=default
bool operator!=(const TileSize &other) const
TileSize(int width, int height, int num_samples)
bool operator==(const TileSize &other) const