blender/intern/cycles/session
Sergey Sharybin 3d9f4012dc Cycles: Fixes for viewport render on Metal drawing backend
This change fixes issues with viewport rendering when Metal
GPU backend is used for drawing. This is not a default build
configuration and requires the following tweaks:

- Enable WITH_METAL_BACKEND CMake option (set it to on)
- Use `--gpu-backend metal` command line arguments

It also helps using the `--factory-startup` command line
argument to ensure Eevee is not used (it is not ported and
will crash).

The root of the problem was in the use of glViewport().
It is replaced with the GPU_viewport_size_get_i() which
is supposed to be portable equivalent form the GPU module.
Without this change the viewport size is detected to be 0
which backfired in few places.

The rest of the changes were to make the code more robust
in the extreme conditions instead of asserting or crashing.

Simplified and streamlined GPU resources creation in the
display driver. It was a bit convoluted mix of creation of
the GPU resources and resizing them to the proper size. It
even seemed to be done in the reverse order. Now it is as
simple as "just ensure GPU resources are there for the
given texture or buffer size".

Also avoid division by zero in the tile manager.

Differential Revision: https://developer.blender.org/D16679
2022-12-02 16:46:43 +01:00
..
buffers.cpp Fix T98367: Light group passes do not work when shadow catcher is used 2022-07-24 20:36:46 +02:00
buffers.h Cycles: Add support for light groups 2022-04-02 06:14:27 +02:00
CMakeLists.txt Cleanup OpenGL linking and related code after libepoxy merge 2022-08-15 16:47:20 +02:00
denoising.cpp Cleanup: spelling in comments, additional white space 2022-06-07 15:01:03 +10:00
denoising.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
display_driver.h Cleanup: use better matching integer types for graphics interop handle 2022-12-01 15:55:48 +01:00
merge.cpp Cycles: Fix a few type casting warnings 2022-04-05 18:09:21 +02:00
merge.h Cleanup: spelling in comments 2022-11-10 11:34:10 +11:00
output_driver.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00
session.cpp Fix frozen image editor when Cycles compiles kernels 2022-11-23 10:23:05 +01:00
session.h Cycles: Add Hydra render delegate 2022-03-23 16:39:05 +01:00
tile.cpp Cycles: Fixes for viewport render on Metal drawing backend 2022-12-02 16:46:43 +01:00
tile.h Cycles: use SPDX license headers 2022-02-11 17:47:34 +01:00