Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/opengl/gl_framebuffer.cc
| Show All 17 Lines | |||||
| */ | */ | ||||
| /** \file | /** \file | ||||
| * \ingroup gpu | * \ingroup gpu | ||||
| */ | */ | ||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "GPU_extensions.h" | #include "GPU_capabilities.h" | ||||
| #include "gl_backend.hh" | #include "gl_backend.hh" | ||||
| #include "gl_framebuffer.hh" | #include "gl_framebuffer.hh" | ||||
| #include "gl_state.hh" | #include "gl_state.hh" | ||||
| #include "gl_texture.hh" | #include "gl_texture.hh" | ||||
| namespace blender::gpu { | namespace blender::gpu { | ||||
| ▲ Show 20 Lines • Show All 168 Lines • ▼ Show 20 Lines | for (GPUAttachmentType type = GPU_FB_MAX_ATTACHMENT - 1; type >= 0; --type) { | ||||
| } | } | ||||
| /* We found one depth buffer type. Stop here, otherwise we would | /* We found one depth buffer type. Stop here, otherwise we would | ||||
| * override it by setting GPU_FB_DEPTH_ATTACHMENT */ | * override it by setting GPU_FB_DEPTH_ATTACHMENT */ | ||||
| if (type == GPU_FB_DEPTH_STENCIL_ATTACHMENT) { | if (type == GPU_FB_DEPTH_STENCIL_ATTACHMENT) { | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| if (GPU_unused_fb_slot_workaround()) { | if (GLContext::unused_fb_slot_workaround) { | ||||
| /* Fill normally un-occupied slots to avoid rendering artifacts on some hardware. */ | /* Fill normally un-occupied slots to avoid rendering artifacts on some hardware. */ | ||||
| GLuint gl_tex = 0; | GLuint gl_tex = 0; | ||||
| /* NOTE: Inverse iteration to get the first color texture. */ | /* NOTE: Inverse iteration to get the first color texture. */ | ||||
| for (int i = ARRAY_SIZE(gl_attachments_) - 1; i >= 0; --i) { | for (int i = ARRAY_SIZE(gl_attachments_) - 1; i >= 0; --i) { | ||||
| GPUAttachmentType type = GPU_FB_COLOR_ATTACHMENT0 + i; | GPUAttachmentType type = GPU_FB_COLOR_ATTACHMENT0 + i; | ||||
| GPUAttachment &attach = attachments_[type]; | GPUAttachment &attach = attachments_[type]; | ||||
| if (attach.tex != NULL) { | if (attach.tex != NULL) { | ||||
| gl_tex = GPU_texture_opengl_bindcode(attach.tex); | gl_tex = GPU_texture_opengl_bindcode(attach.tex); | ||||
| ▲ Show 20 Lines • Show All 284 Lines • Show Last 20 Lines | |||||