Fix #114151: Workbench: Assert with volume and thumbnail rendering

This is caused by some path not setting the proper usage flag
on the main depth stencil texture making impossible to use
stencil view of this texture.

Make this flag mandatory for offscreen buffer fixes the issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/115361
This commit is contained in:
Clément Foucault
2023-11-24 16:52:21 +01:00
committed by Clément Foucault
parent ecb0d25c6f
commit b607c8677a

View File

@@ -686,8 +686,10 @@ GPUOffScreen *GPU_offscreen_create(int width,
ofs->color = GPU_texture_create_2d("ofs_color", width, height, 1, format, usage, nullptr);
if (depth) {
/* Format view flag is needed by Workbench Volumes to read the stencil view. */
eGPUTextureUsage depth_usage = usage | GPU_TEXTURE_USAGE_FORMAT_VIEW;
ofs->depth = GPU_texture_create_2d(
"ofs_depth", width, height, 1, GPU_DEPTH24_STENCIL8, usage, nullptr);
"ofs_depth", width, height, 1, GPU_DEPTH24_STENCIL8, depth_usage, nullptr);
}
if ((depth && !ofs->depth) || !ofs->color) {