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:
authorCampbell Barton <ideasman42@gmail.com>2017-04-12 12:49:19 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-04-12 12:51:14 +0300
commit0c9a2def8b1e40a0b5a3ed348d1fd92cc13096ff (patch)
tree8749b8080b9b02514cc7f9d08dab6391ce716844 /source/blender/gpu/GPU_viewport.h
parentb380f4927e30bc2877b4f3a760fefa0dfc3614e1 (diff)
Draw Engine: remove hard coded limit on array sizes
This removes MAX_STORAGE, MAX_BUFFERS, MAX_TEXTURES, MAX_PASSES limits. Actual memory saving isn't so important, it just means we don't need to manually bump these based on changes to engines.
Diffstat (limited to 'source/blender/gpu/GPU_viewport.h')
-rw-r--r--source/blender/gpu/GPU_viewport.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/gpu/GPU_viewport.h b/source/blender/gpu/GPU_viewport.h
index 8bc7bdb6df2..36e1eea5d61 100644
--- a/source/blender/gpu/GPU_viewport.h
+++ b/source/blender/gpu/GPU_viewport.h
@@ -41,26 +41,21 @@
typedef struct GPUViewport GPUViewport;
-#define MAX_BUFFERS 8
-#define MAX_TEXTURES 16
-#define MAX_PASSES 16
-#define MAX_STORAGE 9 /* extend if needed */
-
/* All FramebufferLists are just the same pointers with different names */
typedef struct FramebufferList {
- struct GPUFrameBuffer *framebuffers[MAX_BUFFERS];
+ struct GPUFrameBuffer *framebuffers[0];
} FramebufferList;
typedef struct TextureList {
- struct GPUTexture *textures[MAX_TEXTURES];
+ struct GPUTexture *textures[0];
} TextureList;
typedef struct PassList {
- struct DRWPass *passes[MAX_PASSES];
+ struct DRWPass *passes[0];
} PassList;
typedef struct StorageList {
- void *storage[MAX_STORAGE]; /* custom structs from the engine */
+ void *storage[0]; /* custom structs from the engine */
} StorageList;
typedef struct ViewportEngineData {
@@ -78,6 +73,13 @@ typedef struct ViewportEngineData {
double background_time;
} ViewportEngineData;
+typedef struct ViewportEngineData_Info {
+ int fbl_len;
+ int txl_len;
+ int psl_len;
+ int stl_len;
+} ViewportEngineData_Info;
+
GPUViewport *GPU_viewport_create(void);
void GPU_viewport_bind(GPUViewport *viewport, const rcti *rect);
void GPU_viewport_unbind(GPUViewport *viewport);