[Bf-blender-cvs] [39af6c27f58] blender2.8: DRW: Change framebuffer texture creation.
Clément Foucault
noreply at git.blender.org
Tue Jan 16 18:22:29 CET 2018
Commit: 39af6c27f58df4da3325b843dadb1608181b83bb
Author: Clément Foucault
Date: Mon Jan 15 16:54:24 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB39af6c27f58df4da3325b843dadb1608181b83bb
DRW: Change framebuffer texture creation.
Instead of creating non temp textures only at framebuffer creation, we create them and bind them if their pointer is NULL.
This should simplify the framebuffers creation code.
===================================================================
M source/blender/draw/intern/draw_manager.c
===================================================================
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index 5d8f604e86b..ae7712a36c3 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -2329,6 +2329,7 @@ void DRW_framebuffer_init(
for (int i = 0; i < textures_len; ++i) {
int channels;
bool is_depth;
+ bool create_tex = false;
DRWFboTexture fbotex = textures[i];
bool is_temp = (fbotex.flag & DRW_TEX_TEMP) != 0;
@@ -2341,16 +2342,18 @@ void DRW_framebuffer_init(
*fbotex.tex = GPU_viewport_texture_pool_query(
DST.viewport, engine_type, width, height, channels, gpu_format);
}
- else if (create_fb) {
+ else {
*fbotex.tex = GPU_texture_create_2D_custom(
width, height, channels, gpu_format, NULL, NULL);
+ create_tex = true;
}
}
- if (create_fb) {
- if (!is_depth) {
- ++color_attachment;
- }
+ if (!is_depth) {
+ ++color_attachment;
+ }
+
+ if (create_fb || create_tex) {
drw_texture_set_parameters(*fbotex.tex, fbotex.flag);
GPU_framebuffer_texture_attach(*fb, *fbotex.tex, color_attachment, 0);
}
More information about the Bf-blender-cvs
mailing list