この中の *fbl
の型になっている EEVEE_FramebufferList ~ は ~eevee_private.h
で以下の通り定義されています。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
typedef struct EEVEE_FramebufferList {
/* Effects */
struct GPUFrameBuffer *gtao_fb;
struct GPUFrameBuffer *gtao_debug_fb;
struct GPUFrameBuffer *downsample_fb;
struct GPUFrameBuffer *bloom_blit_fb;
struct GPUFrameBuffer *bloom_down_fb[MAX_BLOOM_STEP];
struct GPUFrameBuffer *bloom_accum_fb[MAX_BLOOM_STEP - 1];
struct GPUFrameBuffer *sss_blur_fb;
struct GPUFrameBuffer *sss_blit_fb;
struct GPUFrameBuffer *sss_resolve_fb;
struct GPUFrameBuffer *sss_clear_fb;
struct GPUFrameBuffer *sss_accum_fb;
struct GPUFrameBuffer *dof_down_fb;
struct GPUFrameBuffer *dof_scatter_fb;
struct GPUFrameBuffer *volumetric_fb;
struct GPUFrameBuffer *volumetric_scat_fb;
struct GPUFrameBuffer *volumetric_integ_fb;
struct GPUFrameBuffer *screen_tracing_fb;
struct GPUFrameBuffer *refract_fb;
struct GPUFrameBuffer *mist_accum_fb;
struct GPUFrameBuffer *ao_accum_fb;
struct GPUFrameBuffer *velocity_resolve_fb;
struct GPUFrameBuffer *update_noise_fb;
struct GPUFrameBuffer *planarref_fb;
struct GPUFrameBuffer *planar_downsample_fb;
struct GPUFrameBuffer *main_fb;
struct GPUFrameBuffer *main_color_fb;
struct GPUFrameBuffer *effect_fb;
struct GPUFrameBuffer *effect_color_fb;
struct GPUFrameBuffer *double_buffer_fb;
struct GPUFrameBuffer *double_buffer_color_fb;
struct GPUFrameBuffer *double_buffer_depth_fb;
struct GPUFrameBuffer *taa_history_fb;
struct GPUFrameBuffer *taa_history_color_fb;
} EEVEE_FramebufferList;
|
GPUFrameBuffer
は GPU_framebuffer.h
でtypedefしてあり、
1
|
typedef struct GPUFrameBuffer GPUFrameBuffer;
|
構造体は gpu_framebuffer.c
に定義されていて、
1
2
3
4
5
6
7
8
9
10
11
|
struct GPUFrameBuffer {
GPUContext *ctx;
GLuint object;
GPUAttachment attachments[GPU_FB_MAX_ATTACHEMENT];
uint16_t dirty_flag;
int width, height;
bool multisample;
/* TODO Check that we always use the right context when binding
* (FBOs are not shared across ogl contexts). */
// void *ctx;
};
|
GPUContext
は GPU_context.h
でtypedefしていて、
1
|
typedef struct GPUContext GPUContext;
|
GPUContext
の構造体は gpu_context.cpp
に定義されています。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
struct GPUContext {
GLuint default_vao;
GPUFrameBuffer *current_fbo;
std::unordered_set<GPUBatch *> batches; /* Batches that have VAOs from this context */
#ifdef DEBUG
std::unordered_set<GPUFrameBuffer *> framebuffers; /* Framebuffers that have FBO from this context */
#endif
std::vector<GLuint> orphaned_vertarray_ids;
std::vector<GLuint> orphaned_framebuffer_ids;
std::mutex orphans_mutex; /* todo: try spinlock instead */
#if TRUST_NO_ONE
pthread_t thread; /* Thread on which this context is active. */
bool thread_is_used;
GPUContext() {
thread_is_used = false;
current_fbo = 0;
}
#endif
};
|