[Bf-blender-cvs] [ee710262222] greasepencil-object: Fixes after merge

Antonio Vazquez noreply at git.blender.org
Wed Feb 28 10:14:18 CET 2018


Commit: ee7102622223800bdf9a3617c60a2ea16e58884a
Author: Antonio Vazquez
Date:   Wed Feb 28 10:14:05 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rBee7102622223800bdf9a3617c60a2ea16e58884a

Fixes after merge

===================================================================

M	source/blender/draw/intern/draw_manager.c
M	source/blender/draw/intern/draw_manager_framebuffer.c

===================================================================

diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index 25ad53e98ac..dce5414d07e 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -1250,7 +1250,7 @@ void DRW_render_gpencil_to_image(RenderEngine *engine, struct RenderLayer *rende
 
 	if (draw_engine_gpencil_type.render_to_image) {
 		if (DRW_render_check_object_type(draw_ctx->depsgraph, OB_GPENCIL)) {
-			ViewportEngineData *gpdata = DRW_viewport_engine_data_ensure(&draw_engine_gpencil_type);
+			ViewportEngineData *gpdata = drw_viewport_engine_data_ensure(&draw_engine_gpencil_type);
 			draw_engine_gpencil_type.render_to_image(gpdata, engine, render_layer, rect);
 		}
 	}
diff --git a/source/blender/draw/intern/draw_manager_framebuffer.c b/source/blender/draw/intern/draw_manager_framebuffer.c
index a76b1c42a53..2f67a8c9cb8 100644
--- a/source/blender/draw/intern/draw_manager_framebuffer.c
+++ b/source/blender/draw/intern/draw_manager_framebuffer.c
@@ -30,6 +30,29 @@ GPUFrameBuffer *DRW_framebuffer_create(void)
 	return GPU_framebuffer_create();
 }
 
+/* create multisample framebuffer */
+void DRW_framebuffer_create_multisample(DefaultFramebufferList *dfbl, DefaultTextureList *dtxl, int rect_w, int rect_h)
+{
+	if (U.ogl_multisamples > 0) {
+		if (!dfbl->multisample_fb) {
+			dfbl->multisample_fb = GPU_framebuffer_create();
+			if (dfbl->multisample_fb) {
+				/* Color */
+				dtxl->multisample_color = GPU_texture_create_2D_multisample(rect_w, rect_h, NULL, U.ogl_multisamples, NULL);
+				GPU_framebuffer_texture_attach(dfbl->multisample_fb, dtxl->multisample_color, 0, 0);
+				/* Depth */
+				dtxl->multisample_depth = GPU_texture_create_depth_with_stencil_multisample(rect_w, rect_h,
+					U.ogl_multisamples, NULL);
+				GPU_framebuffer_texture_attach(dfbl->multisample_fb, dtxl->multisample_depth, 0, 0);
+
+				if (!GPU_framebuffer_check_valid(dfbl->multisample_fb, NULL)) {
+					GPU_framebuffer_free(dfbl->multisample_fb);
+				}
+			}
+		}
+	}
+}
+
 void DRW_framebuffer_init(
         GPUFrameBuffer **fb, void *engine_type, int width, int height,
         DRWFboTexture textures[MAX_FBO_TEX], int textures_len)



More information about the Bf-blender-cvs mailing list