GPU: Add Texture Usage Parameter to GPUOffscreen. #106899

Merged
Jeroen Bakker merged 5 commits from Jeroen-Bakker/blender:gpu-offscreen-texture-usage into main 2023-04-14 22:03:03 +02:00

5 Commits

Author SHA1 Message Date
Jeroen Bakker 2830dacaae Small tweaks in code readability. 2023-04-14 16:23:09 +02:00
Jeroen Bakker afb098771c Merge branch 'main' into gpu-offscreen-texture-usage 2023-04-14 16:16:00 +02:00
Jeroen Bakker a01991b538 Remove unneeded file. 2023-04-13 15:42:24 +02:00
Jeroen Bakker 36578ac4ee Automatic add GPU_TEXTURE_USAGE_ATTACHMENT. 2023-04-13 15:40:21 +02:00
Jeroen Bakker 29cc37cf22 GPU: Add texture usage parameter to GPUOffscreen.
Currently the Textures used for offscreen rendering don't have
the `GPU_TEXTURE_USAGE_HOST_READ` flag. But some cases it is
needed. This PR adds a parameter when creating an offscreen
buffer.

Other solution could be to add this flag to all textures, but
we chose not to do this as that reduces the amount of fine-tuning
options for Metal/Vulkan backends. GPU can store textures
differently based on its actual usage.

This option isn't available in the python API as we don't expect
add-on developers to fine-tune texture usages to this extent.
2023-04-13 12:33:50 +02:00