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:
authorJeroen Bakker <j.bakker@atmind.nl>2019-03-26 17:06:29 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2019-03-26 17:07:05 +0300
commit33a759a39c9493dd2c89068107e697e0d84a81b2 (patch)
treecdadead7ff6850b4c327231c80abdad70b3bfdc9 /source/blender/editors/space_view3d
parentfb96dcd71395b5bb9b4f37c822cac802c98ebb42 (diff)
Revert "DRW Manager: create and use new DRW_framebuffer_depth_read utility."
This reverts commit 40f8f445a3f9b6bc24b58e45be46060cc36c0394. There are many paths that lead to uninitialized depth buffer where the depth read would fail. Fix T62965
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/view3d_draw_legacy.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c b/source/blender/editors/space_view3d/view3d_draw_legacy.c
index 3822176b7d5..30d8c00e7b5 100644
--- a/source/blender/editors/space_view3d/view3d_draw_legacy.c
+++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c
@@ -226,6 +226,12 @@ void view3d_opengl_read_pixels(ARegion *ar, int x, int y, int w, int h, int form
glReadPixels(ar->winrct.xmin + x, ar->winrct.ymin + y, w, h, format, type, data);
}
+/* XXX depth reading exception, for code not using gpu offscreen */
+static void view3d_opengl_read_Z_pixels(ARegion *ar, int x, int y, int w, int h, int format, int type, void *data)
+{
+ glReadPixels(ar->winrct.xmin + x, ar->winrct.ymin + y, w, h, format, type, data);
+}
+
void ED_view3d_select_id_validate_with_select_mode(ViewContext *vc, short select_mode)
{
/* TODO: Create a flag in `DRW_manager` because the drawing is no longer
@@ -739,6 +745,7 @@ void ED_view3d_draw_bgpic_test(
/* *********************** */
+/* XXX warning, not using gpu offscreen here */
void view3d_update_depths_rect(ARegion *ar, ViewDepths *d, rcti *rect)
{
/* clamp rect by region */
@@ -789,14 +796,14 @@ void view3d_update_depths_rect(ARegion *ar, ViewDepths *d, rcti *rect)
}
if (d->damaged) {
- DRW_framebuffer_depth_read(rect, d->depths);
+ /* XXX using special function here, it doesn't use the gpu offscreen system */
+ view3d_opengl_read_Z_pixels(ar, d->x, d->y, d->w, d->h, GL_DEPTH_COMPONENT, GL_FLOAT, d->depths);
glGetDoublev(GL_DEPTH_RANGE, d->depth_range);
d->damaged = false;
}
}
-/* note, with nouveau drivers the glReadPixels() is very slow. [#24339]
- * XXX warning, not using gpu offscreen here */
+/* note, with nouveau drivers the glReadPixels() is very slow. [#24339] */
void ED_view3d_depth_update(ARegion *ar)
{
RegionView3D *rv3d = ar->regiondata;