Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/gpencil/gpencil_render.c
| Show First 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | void GPENCIL_render_init(GPENCIL_Data *vedata, | ||||
| } | } | ||||
| const bool do_region = (scene->r.mode & R_BORDER) != 0; | const bool do_region = (scene->r.mode & R_BORDER) != 0; | ||||
| const bool do_clear_z = !pix_z || do_region; | const bool do_clear_z = !pix_z || do_region; | ||||
| const bool do_clear_col = !pix_col || do_region; | const bool do_clear_col = !pix_col || do_region; | ||||
| /* FIXME(fclem): we have a precision loss in the depth buffer because of this reupload. | /* FIXME(fclem): we have a precision loss in the depth buffer because of this reupload. | ||||
| * Find where it comes from! */ | * Find where it comes from! */ | ||||
| /* In multi view render the textures can be reused. */ | |||||
| if (txl->render_depth_tx && !do_clear_z) { | |||||
| GPU_texture_update(txl->render_depth_tx, GPU_DATA_FLOAT, pix_z); | |||||
| } | |||||
| else { | |||||
| txl->render_depth_tx = DRW_texture_create_2d( | txl->render_depth_tx = DRW_texture_create_2d( | ||||
| size[0], size[1], GPU_DEPTH_COMPONENT24, 0, do_region ? NULL : pix_z); | size[0], size[1], GPU_DEPTH_COMPONENT24, 0, do_region ? NULL : pix_z); | ||||
| } | |||||
| if (txl->render_color_tx && !do_clear_col) { | |||||
| GPU_texture_update(txl->render_color_tx, GPU_DATA_FLOAT, pix_col); | |||||
| } | |||||
| else { | |||||
| txl->render_color_tx = DRW_texture_create_2d( | txl->render_color_tx = DRW_texture_create_2d( | ||||
| size[0], size[1], GPU_RGBA16F, 0, do_region ? NULL : pix_col); | size[0], size[1], GPU_RGBA16F, 0, do_region ? NULL : pix_col); | ||||
| } | |||||
| GPU_framebuffer_ensure_config(&fbl->render_fb, | GPU_framebuffer_ensure_config(&fbl->render_fb, | ||||
| { | { | ||||
| GPU_ATTACHMENT_TEXTURE(txl->render_depth_tx), | GPU_ATTACHMENT_TEXTURE(txl->render_depth_tx), | ||||
| GPU_ATTACHMENT_TEXTURE(txl->render_color_tx), | GPU_ATTACHMENT_TEXTURE(txl->render_color_tx), | ||||
| }); | }); | ||||
| if (do_clear_z || do_clear_col) { | if (do_clear_z || do_clear_col) { | ||||
| ▲ Show 20 Lines • Show All 140 Lines • Show Last 20 Lines | |||||