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:
authorGermano Cavalcante <germano.costa@ig.com.br>2021-08-23 18:33:12 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2021-08-23 19:41:03 +0300
commit6e51ef953168743a1023712b4180e7f97ea8d1c5 (patch)
tree9ad8c1ea70b222794406f50ba4bba80aa7c55d8f /source/blender/draw/intern/draw_cache_extract_mesh.cc
parentebdae7573618637c60e836bbc00618f65a7a7c4f (diff)
Cleanup: rename 'MeshBufferCache' to 'MeshBufferList'
`MeshBufferList` is more specific and can avoid confusion with `MeshBufferExtractionCache`.
Diffstat (limited to 'source/blender/draw/intern/draw_cache_extract_mesh.cc')
-rw-r--r--source/blender/draw/intern/draw_cache_extract_mesh.cc46
1 files changed, 25 insertions, 21 deletions
diff --git a/source/blender/draw/intern/draw_cache_extract_mesh.cc b/source/blender/draw/intern/draw_cache_extract_mesh.cc
index 1bc2b8a9def..82ce4087ff8 100644
--- a/source/blender/draw/intern/draw_cache_extract_mesh.cc
+++ b/source/blender/draw/intern/draw_cache_extract_mesh.cc
@@ -162,7 +162,7 @@ struct ExtractTaskData {
const MeshRenderData *mr = nullptr;
MeshBatchCache *cache = nullptr;
ExtractorRunDatas *extractors = nullptr;
- MeshBufferCache *mbc = nullptr;
+ MeshBufferList *mbuflist = nullptr;
eMRIterType iter_type;
bool use_threading = false;
@@ -170,9 +170,13 @@ struct ExtractTaskData {
ExtractTaskData(const MeshRenderData *mr,
struct MeshBatchCache *cache,
ExtractorRunDatas *extractors,
- MeshBufferCache *mbc,
+ MeshBufferList *mbuflist,
const bool use_threading)
- : mr(mr), cache(cache), extractors(extractors), mbc(mbc), use_threading(use_threading)
+ : mr(mr),
+ cache(cache),
+ extractors(extractors),
+ mbuflist(mbuflist),
+ use_threading(use_threading)
{
iter_type = extractors->iter_types();
};
@@ -204,13 +208,13 @@ static void extract_task_data_free(void *data)
BLI_INLINE void extract_init(const MeshRenderData *mr,
struct MeshBatchCache *cache,
ExtractorRunDatas &extractors,
- MeshBufferCache *mbc,
+ MeshBufferList *mbuflist,
void *data_stack)
{
uint32_t data_offset = 0;
for (ExtractorRunData &run_data : extractors) {
const MeshExtract *extractor = run_data.extractor;
- run_data.buffer = mesh_extract_buffer_get(extractor, mbc);
+ run_data.buffer = mesh_extract_buffer_get(extractor, mbuflist);
run_data.data_offset = data_offset;
extractor->init(mr, cache, run_data.buffer, POINTER_OFFSET(data_stack, data_offset));
data_offset += (uint32_t)extractor->data_size;
@@ -445,7 +449,7 @@ static void extract_task_range_run(void *__restrict taskdata)
settings.func_reduce = extract_task_reduce;
settings.min_iter_per_thread = MIN_RANGE_LEN;
- extract_init(data->mr, data->cache, *data->extractors, data->mbc, userdata_chunk);
+ extract_init(data->mr, data->cache, *data->extractors, data->mbuflist, userdata_chunk);
if (iter_type & MR_ITER_LOOPTRI) {
extract_task_range_run_iter(data->mr, data->extractors, MR_ITER_LOOPTRI, is_mesh, &settings);
@@ -474,10 +478,10 @@ static struct TaskNode *extract_task_node_create(struct TaskGraph *task_graph,
const MeshRenderData *mr,
MeshBatchCache *cache,
ExtractorRunDatas *extractors,
- MeshBufferCache *mbc,
+ MeshBufferList *mbuflist,
const bool use_threading)
{
- ExtractTaskData *taskdata = new ExtractTaskData(mr, cache, extractors, mbc, use_threading);
+ ExtractTaskData *taskdata = new ExtractTaskData(mr, cache, extractors, mbuflist, use_threading);
struct TaskNode *task_node = BLI_task_graph_node_create(
task_graph,
extract_task_range_run,
@@ -561,7 +565,7 @@ static struct TaskNode *mesh_extract_render_data_node_create(struct TaskGraph *t
static void mesh_buffer_cache_create_requested(struct TaskGraph *task_graph,
MeshBatchCache *cache,
- MeshBufferCache *mbc,
+ MeshBufferList *mbuflist,
MeshBufferExtractionCache *extraction_cache,
Mesh *me,
@@ -615,7 +619,7 @@ static void mesh_buffer_cache_create_requested(struct TaskGraph *task_graph,
#define EXTRACT_ADD_REQUESTED(type, name) \
do { \
- if (DRW_##type##_requested(mbc->type.name)) { \
+ if (DRW_##type##_requested(mbuflist->type.name)) { \
const MeshExtract *extractor = mesh_extract_override_get( \
&extract_##name, do_hq_normals, override_single_mat); \
extractors.append(extractor); \
@@ -647,19 +651,19 @@ static void mesh_buffer_cache_create_requested(struct TaskGraph *task_graph,
EXTRACT_ADD_REQUESTED(vbo, skin_roots);
EXTRACT_ADD_REQUESTED(ibo, tris);
- if (DRW_ibo_requested(mbc->ibo.lines_loose)) {
+ if (DRW_ibo_requested(mbuflist->ibo.lines_loose)) {
/* `ibo.lines_loose` require the `ibo.lines` buffer. */
- if (mbc->ibo.lines == nullptr) {
- DRW_ibo_request(nullptr, &mbc->ibo.lines);
+ if (mbuflist->ibo.lines == nullptr) {
+ DRW_ibo_request(nullptr, &mbuflist->ibo.lines);
}
- const MeshExtract *extractor = DRW_ibo_requested(mbc->ibo.lines) ?
+ const MeshExtract *extractor = DRW_ibo_requested(mbuflist->ibo.lines) ?
&extract_lines_with_lines_loose :
&extract_lines_loose_only;
extractors.append(extractor);
}
- else if (DRW_ibo_requested(mbc->ibo.lines)) {
+ else if (DRW_ibo_requested(mbuflist->ibo.lines)) {
const MeshExtract *extractor;
- if (mbc->ibo.lines_loose != nullptr) {
+ if (mbuflist->ibo.lines_loose != nullptr) {
/* Update `ibo.lines_loose` as it depends on `ibo.lines`. */
extractor = &extract_lines_with_lines_loose;
}
@@ -714,7 +718,7 @@ static void mesh_buffer_cache_create_requested(struct TaskGraph *task_graph,
ExtractorRunDatas *single_threaded_extractors = new ExtractorRunDatas();
single_threaded_extractors->append(extractor);
struct TaskNode *task_node = extract_task_node_create(
- task_graph, mr, cache, single_threaded_extractors, mbc, false);
+ task_graph, mr, cache, single_threaded_extractors, mbuflist, false);
BLI_task_graph_edge_create(task_node_mesh_render_data, task_node);
}
@@ -725,7 +729,7 @@ static void mesh_buffer_cache_create_requested(struct TaskGraph *task_graph,
extractors.filter_threaded_extractors_into(*multi_threaded_extractors);
if (!multi_threaded_extractors->is_empty()) {
struct TaskNode *task_node = extract_task_node_create(
- task_graph, mr, cache, multi_threaded_extractors, mbc, true);
+ task_graph, mr, cache, multi_threaded_extractors, mbuflist, true);
BLI_task_graph_edge_create(task_node_mesh_render_data, task_node);
}
@@ -738,7 +742,7 @@ static void mesh_buffer_cache_create_requested(struct TaskGraph *task_graph,
/* Run all requests on the same thread. */
ExtractorRunDatas *extractors_copy = new ExtractorRunDatas(extractors);
struct TaskNode *task_node = extract_task_node_create(
- task_graph, mr, cache, extractors_copy, mbc, false);
+ task_graph, mr, cache, extractors_copy, mbuflist, false);
BLI_task_graph_edge_create(task_node_mesh_render_data, task_node);
}
@@ -775,7 +779,7 @@ static void mesh_buffer_cache_create_requested(struct TaskGraph *task_graph,
extern "C" {
void mesh_buffer_cache_create_requested(struct TaskGraph *task_graph,
MeshBatchCache *cache,
- MeshBufferCache *mbc,
+ MeshBufferList *mbuflist,
MeshBufferExtractionCache *extraction_cache,
Mesh *me,
@@ -792,7 +796,7 @@ void mesh_buffer_cache_create_requested(struct TaskGraph *task_graph,
{
blender::draw::mesh_buffer_cache_create_requested(task_graph,
cache,
- mbc,
+ mbuflist,
extraction_cache,
me,
is_editmode,