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>2022-10-07 01:06:27 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-10-07 13:43:10 +0300
commita945cf4d0fc38f3c84747767612ad1d748ceb2a0 (patch)
tree72aa5ff66b79168506cb9542d0144d42c10dd1d4 /source/blender/draw/intern/draw_manager.c
parent223f970407666828922616f1646768433ab7e7a0 (diff)
DRW: Move clipping planes to their own UBO
This is part of the effor to simplify the View struct in order to implement multiview rendering.
Diffstat (limited to 'source/blender/draw/intern/draw_manager.c')
-rw-r--r--source/blender/draw/intern/draw_manager.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index 50ea27efba1..83dc08f2f23 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -612,6 +612,11 @@ static void drw_manager_init(DRWManager *dst, GPUViewport *viewport, const int s
G_draw.view_ubo = GPU_uniformbuf_create_ex(sizeof(ViewInfos), NULL, "G_draw.view_ubo");
}
+ if (G_draw.clipping_ubo == NULL) {
+ G_draw.clipping_ubo = GPU_uniformbuf_create_ex(
+ sizeof(float4) * 6, NULL, "G_draw.clipping_ubo");
+ }
+
if (dst->draw_list == NULL) {
dst->draw_list = GPU_draw_list_create(DRW_DRAWLIST_LEN);
}
@@ -3079,6 +3084,7 @@ void DRW_engines_free(void)
DRW_UBO_FREE_SAFE(G_draw.block_ubo);
DRW_UBO_FREE_SAFE(G_draw.view_ubo);
+ DRW_UBO_FREE_SAFE(G_draw.clipping_ubo);
DRW_TEXTURE_FREE_SAFE(G_draw.ramp);
DRW_TEXTURE_FREE_SAFE(G_draw.weight_ramp);