Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2021-10-05 10:36:11 +0300
committerJeroen Bakker <jeroen@blender.org>2021-10-05 10:39:54 +0300
commit1d49293b80446b89b5b12fa0eeefaf14e5051e48 (patch)
tree72e007ea9d498576ad9b48050f81f38994aa0d98 /source/blender/gpu/GPU_viewport.h
parent08511b1c3de0338314940397083adaba4e9cf492 (diff)
DRW: Move buffer & temp textures & framebuffer management to DrawManager
This is a necessary step for EEVEE's new arch. This moves more data to the draw manager. This makes it easier to have the render or draw engines manage their own data. This makes more sense and cleans-up what the GPUViewport holds Also rewrites the Texture pool manager to be in C++. This also move the DefaultFramebuffer/TextureList and the engine related data to a new `DRWViewData` struct. This struct manages the per view (as in stereo view) engine data. There is a bit of cleanup in the way the draw manager is setup. We now use a temporary DRWData instead of creating a dummy viewport. Development: fclem, jbakker Differential Revision: https://developer.blender.org/D11966
Diffstat (limited to 'source/blender/gpu/GPU_viewport.h')
-rw-r--r--source/blender/gpu/GPU_viewport.h95
1 files changed, 10 insertions, 85 deletions
diff --git a/source/blender/gpu/GPU_viewport.h b/source/blender/gpu/GPU_viewport.h
index 0ecd5f3eb7b..4d9970dac90 100644
--- a/source/blender/gpu/GPU_viewport.h
+++ b/source/blender/gpu/GPU_viewport.h
@@ -35,76 +35,15 @@
extern "C" {
#endif
-#define GPU_INFO_SIZE 512 /* IMA_MAX_RENDER_TEXT */
#define GLA_PIXEL_OFS 0.375f
typedef struct GHash GHash;
typedef struct GPUViewport GPUViewport;
struct GPUFrameBuffer;
-
-/* Contains memory pools information. */
-typedef struct ViewportMemoryPool {
- struct BLI_memblock *commands;
- struct BLI_memblock *commands_small;
- struct BLI_memblock *callbuffers;
- struct BLI_memblock *obmats;
- struct BLI_memblock *obinfos;
- struct BLI_memblock *cullstates;
- struct BLI_memblock *shgroups;
- struct BLI_memblock *uniforms;
- struct BLI_memblock *views;
- struct BLI_memblock *passes;
- struct BLI_memblock *images;
- struct GPUUniformBuf **matrices_ubo;
- struct GPUUniformBuf **obinfos_ubo;
- struct GHash *obattrs_ubo_pool;
- uint ubo_len;
-} ViewportMemoryPool;
-
-/* All FramebufferLists are just the same pointers with different names. */
-typedef struct FramebufferList {
- struct GPUFrameBuffer *framebuffers[1];
-} FramebufferList;
-
-typedef struct TextureList {
- struct GPUTexture *textures[1];
-} TextureList;
-
-typedef struct PassList {
- struct DRWPass *passes[1];
-} PassList;
-
-typedef struct StorageList {
- void *storage[1]; /* Custom structs from the engine. */
-} StorageList;
-
-typedef struct ViewportEngineData {
- void *engine_type;
-
- FramebufferList *fbl;
- TextureList *txl;
- PassList *psl;
- StorageList *stl;
- char info[GPU_INFO_SIZE];
-
- TextureList *txl_stereo;
- StorageList *stl_stereo;
- /* We may want to put this elsewhere. */
- struct DRWTextStore *text_draw_cache;
-
- /* Profiling data. */
- double init_time;
- double render_time;
- double background_time;
-} ViewportEngineData;
-
-typedef struct ViewportEngineData_Info {
- int fbl_len;
- int txl_len;
- int psl_len;
- int stl_len;
-} ViewportEngineData_Info;
+struct DefaultFramebufferList;
+struct DefaultTextureList;
+struct DRWData;
GPUViewport *GPU_viewport_create(void);
GPUViewport *GPU_viewport_stereo_create(void);
@@ -129,35 +68,21 @@ void GPU_viewport_unbind_from_offscreen(GPUViewport *viewport,
bool display_colorspace,
bool do_overlay_merge);
-ViewportMemoryPool *GPU_viewport_mempool_get(GPUViewport *viewport);
-struct DRWInstanceDataList *GPU_viewport_instance_data_list_get(GPUViewport *viewport);
+struct DRWData **GPU_viewport_data_get(GPUViewport *viewport);
-void *GPU_viewport_engine_data_create(GPUViewport *viewport, void *engine_type);
-void *GPU_viewport_engine_data_get(GPUViewport *viewport, void *engine_handle);
-void *GPU_viewport_framebuffer_list_get(GPUViewport *viewport);
void GPU_viewport_stereo_composite(GPUViewport *viewport, Stereo3dFormat *stereo_format);
-void *GPU_viewport_texture_list_get(GPUViewport *viewport);
-void GPU_viewport_size_get(const GPUViewport *viewport, int size[2]);
-void GPU_viewport_size_set(GPUViewport *viewport, const int size[2]);
-void GPU_viewport_active_view_set(GPUViewport *viewport, int view);
-
-/* Profiling. */
-double *GPU_viewport_cache_time_get(GPUViewport *viewport);
void GPU_viewport_tag_update(GPUViewport *viewport);
bool GPU_viewport_do_update(GPUViewport *viewport);
-GPUTexture *GPU_viewport_color_texture(GPUViewport *viewport, int view);
+int GPU_viewport_active_view_get(GPUViewport *viewport);
+bool GPU_viewport_is_stereo_get(GPUViewport *viewport);
-/* Texture pool. */
-GPUTexture *GPU_viewport_texture_pool_query(
- GPUViewport *viewport, void *engine, int width, int height, int format);
-
-bool GPU_viewport_engines_data_validate(GPUViewport *viewport, void **engine_handle_array);
-void GPU_viewport_cache_release(GPUViewport *viewport);
+GPUTexture *GPU_viewport_color_texture(GPUViewport *viewport, int view);
+GPUTexture *GPU_viewport_overlay_texture(GPUViewport *viewport, int view);
+GPUTexture *GPU_viewport_depth_texture(GPUViewport *viewport);
-struct GPUFrameBuffer *GPU_viewport_framebuffer_default_get(GPUViewport *viewport);
-struct GPUFrameBuffer *GPU_viewport_framebuffer_overlay_get(GPUViewport *viewport);
+GPUFrameBuffer *GPU_viewport_framebuffer_overlay_get(GPUViewport *viewport);
#ifdef __cplusplus
}