Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey>2021-12-07 20:50:48 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-12-07 21:01:42 +0300
commit5e37f70307bdacedd0f7da65f8b385bc1426f21d (patch)
treedbf2d3085b28c5a674e18eb698fe0456836eec3c /intern/cycles/session/tile.cpp
parenta92805bf24f52e1764a5f930bbe9e4e8fcc7e24d (diff)
Fix T93350: Cycles renders shows black during rendering huge resolutions
The root of the issue is caused by Cycles ignoring OpenGL limitation on the maximum resolution of textures: Cycles was allocating texture of the final render resolution. It was exceeding limitation on certain GPUs and driver. The idea is simple: use multiple textures for the display, each of which will fit into OpenGL limitations. There is some code which allows the display driver to know when to start the new tile. Also added some code to allow force graphics interop to be re-created. The latter one ended up not used in the final version of the patch, but it might be helpful for other drivers implementation. The tile size is limited to 8K now as it is the safest size for textures on many GPUs and OpenGL drivers. Differential Revision: https://developer.blender.org/D13385
Diffstat (limited to 'intern/cycles/session/tile.cpp')
-rw-r--r--intern/cycles/session/tile.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/intern/cycles/session/tile.cpp b/intern/cycles/session/tile.cpp
index 3b8482fa16f..afd1f334120 100644
--- a/intern/cycles/session/tile.cpp
+++ b/intern/cycles/session/tile.cpp
@@ -341,8 +341,10 @@ int TileManager::compute_render_tile_size(const int suggested_tile_size) const
/* Must be a multiple of IMAGE_TILE_SIZE so that we can write render tiles into the image file
* aligned on image tile boundaries. We can't set IMAGE_TILE_SIZE equal to the render tile size
* because too big tile size leads to integer overflow inside OpenEXR. */
- return (suggested_tile_size <= IMAGE_TILE_SIZE) ? suggested_tile_size :
- align_up(suggested_tile_size, IMAGE_TILE_SIZE);
+ const int computed_tile_size = (suggested_tile_size <= IMAGE_TILE_SIZE) ?
+ suggested_tile_size :
+ align_up(suggested_tile_size, IMAGE_TILE_SIZE);
+ return min(computed_tile_size, MAX_TILE_SIZE);
}
void TileManager::reset_scheduling(const BufferParams &params, int2 tile_size)