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/draw/intern/draw_manager_data.c
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/draw/intern/draw_manager_data.c')
-rw-r--r--source/blender/draw/intern/draw_manager_data.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c
index af331c86a8b..f96bd474aec 100644
--- a/source/blender/draw/intern/draw_manager_data.c
+++ b/source/blender/draw/intern/draw_manager_data.c
@@ -87,7 +87,7 @@ static void draw_call_sort(DRWCommand *array, DRWCommand *array_tmp, int array_l
memcpy(array, array_tmp, sizeof(*array) * array_len);
}
-void drw_resource_buffer_finish(ViewportMemoryPool *vmempool)
+void drw_resource_buffer_finish(DRWData *vmempool)
{
int chunk_id = DRW_handle_chunk_get(&DST.resource_handle);
int elem_id = DRW_handle_id_get(&DST.resource_handle);
@@ -908,7 +908,8 @@ void DRW_shgroup_call_instances_with_attrs(DRWShadingGroup *shgroup,
drw_command_set_select_id(shgroup, NULL, DST.select_id);
}
DRWResourceHandle handle = drw_resource_handle(shgroup, ob ? ob->obmat : NULL, ob);
- GPUBatch *batch = DRW_temp_batch_instance_request(DST.idatalist, NULL, inst_attributes, geom);
+ GPUBatch *batch = DRW_temp_batch_instance_request(
+ DST.vmempool->idatalist, NULL, inst_attributes, geom);
drw_command_draw_instance(shgroup, batch, handle, 0, true);
}
@@ -1128,7 +1129,7 @@ DRWCallBuffer *DRW_shgroup_call_buffer(DRWShadingGroup *shgroup,
BLI_assert(format != NULL);
DRWCallBuffer *callbuf = BLI_memblock_alloc(DST.vmempool->callbuffers);
- callbuf->buf = DRW_temp_buffer_request(DST.idatalist, format, &callbuf->count);
+ callbuf->buf = DRW_temp_buffer_request(DST.vmempool->idatalist, format, &callbuf->count);
callbuf->buf_select = NULL;
callbuf->count = 0;
@@ -1138,12 +1139,12 @@ DRWCallBuffer *DRW_shgroup_call_buffer(DRWShadingGroup *shgroup,
GPU_vertformat_attr_add(&inst_select_format, "selectId", GPU_COMP_I32, 1, GPU_FETCH_INT);
}
callbuf->buf_select = DRW_temp_buffer_request(
- DST.idatalist, &inst_select_format, &callbuf->count);
+ DST.vmempool->idatalist, &inst_select_format, &callbuf->count);
drw_command_set_select_id(shgroup, callbuf->buf_select, -1);
}
DRWResourceHandle handle = drw_resource_handle(shgroup, NULL, NULL);
- GPUBatch *batch = DRW_temp_batch_request(DST.idatalist, callbuf->buf, prim_type);
+ GPUBatch *batch = DRW_temp_batch_request(DST.vmempool->idatalist, callbuf->buf, prim_type);
drw_command_draw(shgroup, batch, handle);
return callbuf;
@@ -1157,7 +1158,7 @@ DRWCallBuffer *DRW_shgroup_call_buffer_instance(DRWShadingGroup *shgroup,
BLI_assert(format != NULL);
DRWCallBuffer *callbuf = BLI_memblock_alloc(DST.vmempool->callbuffers);
- callbuf->buf = DRW_temp_buffer_request(DST.idatalist, format, &callbuf->count);
+ callbuf->buf = DRW_temp_buffer_request(DST.vmempool->idatalist, format, &callbuf->count);
callbuf->buf_select = NULL;
callbuf->count = 0;
@@ -1167,12 +1168,13 @@ DRWCallBuffer *DRW_shgroup_call_buffer_instance(DRWShadingGroup *shgroup,
GPU_vertformat_attr_add(&inst_select_format, "selectId", GPU_COMP_I32, 1, GPU_FETCH_INT);
}
callbuf->buf_select = DRW_temp_buffer_request(
- DST.idatalist, &inst_select_format, &callbuf->count);
+ DST.vmempool->idatalist, &inst_select_format, &callbuf->count);
drw_command_set_select_id(shgroup, callbuf->buf_select, -1);
}
DRWResourceHandle handle = drw_resource_handle(shgroup, NULL, NULL);
- GPUBatch *batch = DRW_temp_batch_instance_request(DST.idatalist, callbuf->buf, NULL, geom);
+ GPUBatch *batch = DRW_temp_batch_instance_request(
+ DST.vmempool->idatalist, callbuf->buf, NULL, geom);
drw_command_draw(shgroup, batch, handle);
return callbuf;