diff options
author | Dalai Felinto <dalai@blender.org> | 2020-08-06 17:44:21 +0300 |
---|---|---|
committer | Dalai Felinto <dalai@blender.org> | 2020-08-06 17:44:21 +0300 |
commit | 56af04d31f6aeab518e7cdc41ea29be73d621948 (patch) | |
tree | f4986ad1fb1384080347c982a974299ddd38c385 /source/blender/gpu | |
parent | 9696239762e7b2eddc28f8cabab395a83ea670cb (diff) | |
parent | bc8168f4a2795d65cbe3afc02e09582d43e337c5 (diff) |
Merge remote-tracking branch 'origin/blender-v2.90-release'
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/GPU_batch_presets.h | 2 | ||||
-rw-r--r-- | source/blender/gpu/GPU_viewport.h | 5 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_batch_presets.c | 13 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_viewport.c | 12 |
4 files changed, 32 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_batch_presets.h b/source/blender/gpu/GPU_batch_presets.h index eb803333d98..38de21e7955 100644 --- a/source/blender/gpu/GPU_batch_presets.h +++ b/source/blender/gpu/GPU_batch_presets.h @@ -50,6 +50,8 @@ bool gpu_batch_presets_unregister(struct GPUBatch *preset_batch); void gpu_batch_presets_reset(void); void gpu_batch_presets_exit(void); +void GPU_batch_presets_reset(void); + #ifdef __cplusplus } #endif diff --git a/source/blender/gpu/GPU_viewport.h b/source/blender/gpu/GPU_viewport.h index 50d265feaad..878e7e3e9a8 100644 --- a/source/blender/gpu/GPU_viewport.h +++ b/source/blender/gpu/GPU_viewport.h @@ -41,6 +41,8 @@ extern "C" { typedef struct GPUViewport GPUViewport; +struct GPUFrameBuffer; + /* Contains memory pools information */ typedef struct ViewportMemoryPool { struct BLI_memblock *commands; @@ -151,6 +153,9 @@ GPUTexture *GPU_viewport_texture_pool_query( bool GPU_viewport_engines_data_validate(GPUViewport *viewport, void **engine_handle_array); void GPU_viewport_cache_release(GPUViewport *viewport); +struct GPUFrameBuffer *GPU_viewport_framebuffer_default_get(GPUViewport *viewport); +struct GPUFrameBuffer *GPU_viewport_framebuffer_overlay_get(GPUViewport *viewport); + #ifdef __cplusplus } #endif diff --git a/source/blender/gpu/intern/gpu_batch_presets.c b/source/blender/gpu/intern/gpu_batch_presets.c index d16edab5ac9..7f842d4d508 100644 --- a/source/blender/gpu/intern/gpu_batch_presets.c +++ b/source/blender/gpu/intern/gpu_batch_presets.c @@ -406,4 +406,17 @@ void gpu_batch_presets_exit(void) BLI_mutex_end(&g_presets_3d.mutex); } +/** + * This function only needs to be accessed externally because + * we are drawing UI batches with the DRW old context. + * + * And now we use it for drawing the entire area. + * + * XXX (Clément) - to cleanup in the upcoming 2.91 refactor. + **/ +void GPU_batch_presets_reset() +{ + gpu_batch_presets_reset(); +} + /** \} */ diff --git a/source/blender/gpu/intern/gpu_viewport.c b/source/blender/gpu/intern/gpu_viewport.c index ed5297f0a4a..81315ec1f92 100644 --- a/source/blender/gpu/intern/gpu_viewport.c +++ b/source/blender/gpu/intern/gpu_viewport.c @@ -1035,3 +1035,15 @@ void GPU_viewport_free(GPUViewport *viewport) MEM_freeN(viewport); } + +GPUFrameBuffer *GPU_viewport_framebuffer_default_get(GPUViewport *viewport) +{ + DefaultFramebufferList *fbl = GPU_viewport_framebuffer_list_get(viewport); + return fbl->default_fb; +} + +GPUFrameBuffer *GPU_viewport_framebuffer_overlay_get(GPUViewport *viewport) +{ + DefaultFramebufferList *fbl = GPU_viewport_framebuffer_list_get(viewport); + return fbl->overlay_fb; +} |