diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2017-02-12 23:43:13 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2017-02-12 23:43:13 +0300 |
commit | 10b24eabbab0193f6944cdf3bec7b386c75d5445 (patch) | |
tree | 28cefb0f056191e09828cb79d2f7f728df4e2ead /source/blender/gpu/GPU_viewport.h | |
parent | f754ce1c5e050d1637fe97d78f782d6a68da6c15 (diff) | |
parent | b104057d001d2472cc55c7fa51cff3275e331523 (diff) |
Merge branch 'blender2.8' into transform-manipulators
Conflicts:
source/blender/editors/interface/resources.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/transform/transform_manipulator.c
source/blender/gpu/CMakeLists.txt
source/blender/gpu/intern/gpu_shader.c
Diffstat (limited to 'source/blender/gpu/GPU_viewport.h')
-rw-r--r-- | source/blender/gpu/GPU_viewport.h | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/source/blender/gpu/GPU_viewport.h b/source/blender/gpu/GPU_viewport.h index fce509377ab..9de16f64ca1 100644 --- a/source/blender/gpu/GPU_viewport.h +++ b/source/blender/gpu/GPU_viewport.h @@ -34,12 +34,57 @@ #include <stdbool.h> +#include "DNA_vec_types.h" + +#include "GPU_framebuffer.h" +#include "GPU_texture.h" + typedef struct GPUViewport GPUViewport; -GPUViewport *GPU_viewport_create(void); +#define MAX_BUFFERS 8 +#define MAX_TEXTURES 16 +#define MAX_PASSES 16 +#define MAX_STORAGE 2 /* extend if needed */ + +/* All FramebufferLists are just the same pointers with different names */ +typedef struct FramebufferList { + struct GPUFrameBuffer *framebuffers[MAX_BUFFERS]; +} FramebufferList; + +typedef struct TextureList { + struct GPUTexture *textures[MAX_TEXTURES]; +} TextureList; + +typedef struct PassList { + struct DRWPass *passes[MAX_TEXTURES]; +} PassList; +typedef struct StorageList { + void *storage[MAX_STORAGE]; /* custom structs from the engine */ +} StorageList; + +/* Buffer and textures used by the viewport by default */ +typedef struct DefaultFramebufferList { + struct GPUFrameBuffer *default_fb; +} DefaultFramebufferList; + +typedef struct DefaultTextureList { + struct GPUTexture *color; + struct GPUTexture *depth; +} DefaultTextureList; + +typedef struct DefaultPassList { + struct DRWPass *non_meshes_pass; + struct DRWPass *ob_center_pass; +} DefaultPassList; + +GPUViewport *GPU_viewport_create(void); +void GPU_viewport_bind(GPUViewport *viewport, const rcti *rect, const char *engine); +void GPU_viewport_unbind(GPUViewport *viewport); void GPU_viewport_free(GPUViewport *viewport); +void GPU_viewport_get_engine_data(GPUViewport *viewport, void **fbs, void **txs, void **pss, void **str); + /* debug */ bool GPU_viewport_debug_depth_create(GPUViewport *viewport, int width, int height, char err_out[256]); void GPU_viewport_debug_depth_free(GPUViewport *viewport); |