Cleanup: improve 'view3d_opengl_read_Z_pixels' comment

The comment implies that the operation is slow because it creates and
destroys a framebuffer.

Actually the slowness comes from forcing CPU-GPU synchronization.
This commit is contained in:
Germano Cavalcante
2023-07-12 12:24:36 -03:00
parent 1837bda030
commit c284555d03

View File

@@ -2219,8 +2219,8 @@ static void validate_object_select_id(Depsgraph *depsgraph,
v3d->runtime.flag |= V3D_RUNTIME_DEPTHBUF_OVERRIDDEN;
}
/* TODO: Creating, attaching texture, and destroying a framebuffer is quite slow.
* Calling this function should be avoided during interactive drawing. */
/* Avoid calling this function multiple times in sequence to prevent frequent CPU-GPU
* synchronization (which can be very slow). */
static void view3d_opengl_read_Z_pixels(GPUViewport *viewport, rcti *rect, void *data)
{
GPUTexture *depth_tx = GPU_viewport_depth_texture(viewport);