Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/GPU_framebuffer.h
| Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | void GPU_framebuffer_texture_layer_attach( | ||||
| GPUFrameBuffer *fb, struct GPUTexture *tex, int slot, int layer, int mip); | GPUFrameBuffer *fb, struct GPUTexture *tex, int slot, int layer, int mip); | ||||
| void GPU_framebuffer_texture_cubeface_attach( | void GPU_framebuffer_texture_cubeface_attach( | ||||
| GPUFrameBuffer *fb, struct GPUTexture *tex, int slot, int face, int mip); | GPUFrameBuffer *fb, struct GPUTexture *tex, int slot, int face, int mip); | ||||
| void GPU_framebuffer_texture_detach(GPUFrameBuffer *fb, struct GPUTexture *tex); | void GPU_framebuffer_texture_detach(GPUFrameBuffer *fb, struct GPUTexture *tex); | ||||
| void GPU_framebuffer_texture_detach_slot( | void GPU_framebuffer_texture_detach_slot( | ||||
| GPUFrameBuffer *fb, struct GPUTexture *tex, int type); | GPUFrameBuffer *fb, struct GPUTexture *tex, int type); | ||||
| /** | /** | ||||
| * How to use GPU_framebuffer_ensure_config(). | * How to use #GPU_framebuffer_ensure_config(). | ||||
| * | * | ||||
| * Example : | * Example: | ||||
| * \code{.c} | |||||
| * GPU_framebuffer_ensure_config(&fb, { | * GPU_framebuffer_ensure_config(&fb, { | ||||
| * GPU_ATTACHMENT_TEXTURE(depth), // must be depth buffer | * GPU_ATTACHMENT_TEXTURE(depth), // must be depth buffer | ||||
| * GPU_ATTACHMENT_TEXTURE(tex1), | * GPU_ATTACHMENT_TEXTURE(tex1), | ||||
| * GPU_ATTACHMENT_TEXTURE_CUBEFACE(tex2, 0), | * GPU_ATTACHMENT_TEXTURE_CUBEFACE(tex2, 0), | ||||
| * GPU_ATTACHMENT_TEXTURE_LAYER_MIP(tex2, 0, 0) | * GPU_ATTACHMENT_TEXTURE_LAYER_MIP(tex2, 0, 0) | ||||
| * }) | * }) | ||||
| * \encode | |||||
| * | * | ||||
| * Note : Unspecified attachements (i.e: those beyond the last | * \note Unspecified attachements (i.e: those beyond the last | ||||
| * GPU_ATTACHMENT_* in GPU_framebuffer_ensure_config list) | * GPU_ATTACHMENT_* in GPU_framebuffer_ensure_config list) are left unchanged. | ||||
| * are left unchanged. | * | ||||
| * Note : Make sure that the dimensions of your textures matches | * \note Make sure that the dimensions of your textures matches | ||||
| * otherwise you will have an invalid framebuffer error. | * otherwise you will have an invalid framebuffer error. | ||||
| **/ | */ | ||||
| #define GPU_framebuffer_ensure_config(_fb, ...) do { \ | #define GPU_framebuffer_ensure_config(_fb, ...) do { \ | ||||
| if (*(_fb) == NULL) { \ | if (*(_fb) == NULL) { \ | ||||
| *(_fb) = GPU_framebuffer_create(); \ | *(_fb) = GPU_framebuffer_create(); \ | ||||
| } \ | } \ | ||||
| GPUAttachment config[] = __VA_ARGS__; \ | GPUAttachment config[] = __VA_ARGS__; \ | ||||
| GPU_framebuffer_config_array(*(_fb), config, (sizeof(config) / sizeof(GPUAttachment))); \ | GPU_framebuffer_config_array(*(_fb), config, (sizeof(config) / sizeof(GPUAttachment))); \ | ||||
| } while (0) | } while (0) | ||||
| ▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines | |||||