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