VSE: Scopes improvements #116798

Merged
Aras Pranckevicius merged 13 commits from aras_p/blender:vse-scopes into main 2024-01-05 22:03:13 +01:00
256 changed files with 1276 additions and 1099 deletions
Showing only changes of commit fba624ed84 - Show all commits

View File

@ -1025,7 +1025,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Ninja")
option(WITH_NINJA_POOL_JOBS "\
Enable Ninja pools of jobs, to try to ease building on machines with 16GB of RAM or less \
(if not yet defined, will try to set best values based on detected machine specifications)."
OFF
ON
)
mark_as_advanced(WITH_NINJA_POOL_JOBS)
endif()
@ -1649,22 +1649,30 @@ if("${CMAKE_GENERATOR}" MATCHES "Ninja" AND WITH_NINJA_POOL_JOBS)
# Note: this gives mem in MB.
cmake_host_system_information(RESULT _TOT_MEM QUERY TOTAL_PHYSICAL_MEMORY)
# Heuristics: the more cores we have, the more free memory we have to keep
# for the non-heavy tasks too.
if(${_TOT_MEM} LESS 8000 AND ${_NUM_CORES} GREATER 2)
set(_compile_heavy_jobs "1")
elseif(${_TOT_MEM} LESS 16000 AND ${_NUM_CORES} GREATER 4)
set(_compile_heavy_jobs "2")
elseif(${_TOT_MEM} LESS 24000 AND ${_NUM_CORES} GREATER 8)
set(_compile_heavy_jobs "3")
elseif(${_TOT_MEM} LESS 32000 AND ${_NUM_CORES} GREATER 16)
set(_compile_heavy_jobs "4")
elseif(${_TOT_MEM} LESS 64000 AND ${_NUM_CORES} GREATER 32)
set(_compile_heavy_jobs "8")
else()
set(_compile_heavy_jobs "")
# Heuristics: Assume 8Gb of RAM is needed per heavy compile job.
# Typical RAM peak usage of these is actually less than 3GB currently,
# but this also accounts for the part of the physical RAM being used by other unrelated
# processes on the system, and the part being used by the 'regular' compile and linking jobs.
#
# Also always cap heavy jobs amount to `number of available threads - 1`, to ensure that even if
# there would be enough RAM, the machine never ends up handling only heavy jobs at some point.
# This can have annoying sides effects, like lack of output in the console for several minutes,
# which can lead to a wrong detection of 'unresponsive' state by the buildbots e.g.
#
# Currently, these settings applied to a 64GB/16threads linux machine will use, for a full build:
# - release build:
# * RAM: typically less than 20%, with some peaks at 25%.
# * CPU: over 90% of usage on average over the whole build time.
# - debug with ASAN build:
# * RAM: typically less than 40%, with some peaks at 50%.
# * CPU: over 90% of usage on average over the whole build time.
math(EXPR _compile_heavy_jobs "${_TOT_MEM} / 8000")
math(EXPR _compile_heavy_jobs_max "${_NUM_CORES} - 1")
if(${_compile_heavy_jobs} GREATER ${_compile_heavy_jobs_max})
set(_compile_heavy_jobs ${_compile_heavy_jobs_max})
elseif(${_compile_heavy_jobs} LESS 1)
set(_compile_heavy_jobs 1)
endif()
set(NINJA_MAX_NUM_PARALLEL_COMPILE_HEAVY_JOBS "${_compile_heavy_jobs}" CACHE STRING "\
Define the maximum number of concurrent heavy compilation jobs, for ninja build system \
(used for some targets which cpp files can take several GB each during compilation)."
@ -1672,18 +1680,33 @@ Define the maximum number of concurrent heavy compilation jobs, for ninja build
)
mark_as_advanced(NINJA_MAX_NUM_PARALLEL_COMPILE_HEAVY_JOBS)
set(_compile_heavy_jobs)
set(_compile_heavy_jobs_max)
# Only set regular compile jobs if we set heavy jobs,
# otherwise default (using all cores) if fine.
if(NINJA_MAX_NUM_PARALLEL_COMPILE_HEAVY_JOBS)
math(EXPR _compile_jobs "${_NUM_CORES} - 1")
# Heuristics: Assume 2Gb of RAM is needed per heavy compile job.
# Typical RAM peak usage of these is actually way less than 1GB usually,
# but this also accounts for the part of the physical RAM being used by other unrelated
# processes on the system, and the part being used by the 'heavy' compile and linking jobs.
#
# If there are 'enough' cores available, cap the maximum number of regular jobs to
# `number of cores - 1`, otherwise allow using all cores if there is enough RAM available.
# This allows to ensure that the heavy jobs won't get starved by too many normal jobs,
# since the former usually take a long time to process.
math(EXPR _compile_jobs "${_TOT_MEM} / 2000")
if(${_NUM_CORES} GREATER 3)
math(EXPR _compile_jobs_max "${_NUM_CORES} - 1")
else()
set(_compile_jobs "")
set(_compile_jobs_max ${_NUM_CORES})
endif()
if(${_compile_jobs} GREATER ${_compile_jobs_max})
set(_compile_jobs ${_compile_jobs_max})
elseif(${_compile_jobs} LESS 1)
set(_compile_jobs 1)
endif()
set(NINJA_MAX_NUM_PARALLEL_COMPILE_JOBS "${_compile_jobs}" CACHE STRING
"Define the maximum number of concurrent compilation jobs, for ninja build system." FORCE)
mark_as_advanced(NINJA_MAX_NUM_PARALLEL_COMPILE_JOBS)
set(_compile_jobs)
set(_compile_jobs_max)
# In practice, even when there is RAM available,
# this proves to be quicker than running in parallel (due to slow disks accesses).

View File

@ -223,6 +223,20 @@ function(blender_target_include_dirs_sys
blender_target_include_dirs_impl(${target} TRUE "${_ALL_INCS}")
endfunction()
# Enable unity build for the given target.
function(blender_set_target_unity_build target batch_size)
if(WITH_UNITY_BUILD)
set_target_properties(${target} PROPERTIES
UNITY_BUILD ON
UNITY_BUILD_BATCH_SIZE ${batch_size}
)
if(WITH_NINJA_POOL_JOBS AND NINJA_MAX_NUM_PARALLEL_COMPILE_HEAVY_JOBS)
# Unity builds are typically heavy.
set_target_properties(${target} PROPERTIES JOB_POOL_COMPILE compile_heavy_job_pool)
endif()
endif()
endfunction()
# Set include paths for header files included with "*.h" syntax.
# This enables auto-complete suggestions for user header files on Xcode.
# Build process is not affected since the include paths are the same

View File

@ -327,6 +327,28 @@ int armature_bonecoll_find_index(const bArmature *armature, const ::BoneCollecti
*/
int armature_bonecoll_find_parent_index(const bArmature *armature, int bcoll_index);
/**
* Find the child number of this bone collection.
*
* This is the offset of this collection relative to the parent's first child.
* In other words, the first child has number 0, second child has number 1, etc.
*
* This requires a scan of the array, hence the function is called 'find' and not 'get'.
*/
int armature_bonecoll_child_number_find(const bArmature *armature, const ::BoneCollection *bcoll);
/**
* Move this bone collection to a new child number.
*
* \return the new absolute index of the bone collection, or -1 if the new child number was not
* valid.
*
* \see armature_bonecoll_child_number_find
*/
int armature_bonecoll_child_number_set(bArmature *armature,
::BoneCollection *bcoll,
int new_child_number);
bool armature_bonecoll_is_root(const bArmature *armature, int bcoll_index);
bool armature_bonecoll_is_child_of(const bArmature *armature,

View File

@ -1075,6 +1075,55 @@ int armature_bonecoll_find_parent_index(const bArmature *armature, const int bco
return -1;
}
int armature_bonecoll_child_number_find(const bArmature *armature, const ::BoneCollection *bcoll)
{
const int bcoll_index = armature_bonecoll_find_index(armature, bcoll);
const int parent_index = armature_bonecoll_find_parent_index(armature, bcoll_index);
return bonecoll_child_number(armature, parent_index, bcoll_index);
}
int armature_bonecoll_child_number_set(bArmature *armature,
::BoneCollection *bcoll,
int new_child_number)
{
const int bcoll_index = armature_bonecoll_find_index(armature, bcoll);
const int parent_index = armature_bonecoll_find_parent_index(armature, bcoll_index);
BoneCollection fake_armature_parent = {};
fake_armature_parent.child_count = armature->collection_root_count;
BoneCollection *parent_bcoll;
if (parent_index < 0) {
parent_bcoll = &fake_armature_parent;
}
else {
parent_bcoll = armature->collection_array[parent_index];
}
/* Bounds checks. */
if (new_child_number >= parent_bcoll->child_count) {
return -1;
}
if (new_child_number < 0) {
new_child_number = parent_bcoll->child_count - 1;
}
/* Store the parent's child_index, as that might move if to_index is the first child
* (bonecolls_move_to_index() will keep it pointing at that first child). */
const int old_parent_child_index = parent_bcoll->child_index;
const int to_index = parent_bcoll->child_index + new_child_number;
internal::bonecolls_move_to_index(armature, bcoll_index, to_index);
parent_bcoll->child_index = old_parent_child_index;
/* Make sure that if this was the active bone collection, its index also changes. */
if (armature->runtime.active_collection_index == bcoll_index) {
ANIM_armature_bonecoll_active_index_set(armature, to_index);
}
return to_index;
}
bool armature_bonecoll_is_root(const bArmature *armature, const int bcoll_index)
{
BLI_assert(bcoll_index >= 0);

View File

@ -1317,46 +1317,66 @@ class ANIM_armature_bone_collections_testlist : public testing::Test {
BKE_libblock_free_datablock(&arm.id, 0);
}
void expect_bcolls(std::initializer_list<std::string> expect_names)
testing::AssertionResult expect_bcolls(std::vector<std::string> expect_names)
{
EXPECT_EQ(expect_names.size(), arm.collection_array_num);
int index = 0;
for (const std::string &expect_bcoll : expect_names) {
BoneCollection *actual_bcoll = arm.collection_array[index];
EXPECT_EQ(expect_bcoll, std::string(actual_bcoll->name))
<< "Expected collection_array[" << index << "] to be " << expect_bcoll << ", but it is "
<< actual_bcoll->name;
index++;
std::vector<std::string> actual_names;
for (const BoneCollection *bcoll : arm.collections_span()) {
actual_names.push_back(bcoll->name);
}
if (expect_names == actual_names) {
return testing::AssertionSuccess();
}
testing::AssertionResult failure = testing::AssertionFailure();
failure << "Expected bone collections differ from actual ones:" << std::endl;
/* This is what you get when C++ doesn't even have a standard library
* function to do something like `expect_names.join(", ")`. */
failure << "Expected collections: [";
for (int i = 0; i < expect_names.size() - 1; i++) {
failure << expect_names[i] << ", ";
}
failure << expect_names.back() << "]" << std::endl;
failure << "Actual collections : [";
for (int i = 0; i < actual_names.size() - 1; i++) {
failure << actual_names[i] << ", ";
}
failure << actual_names.back() << "]" << std::endl;
internal::bonecolls_debug_list(&arm);
return failure;
}
};
TEST_F(ANIM_armature_bone_collections_testlist, move_before_after_index__before_first_sibling)
{
EXPECT_EQ(1, ANIM_armature_bonecoll_move_before_after_index(&arm, 3, 1, MoveLocation::Before));
expect_bcolls({"root", "child2", "child0", "child1", "child1_0"});
EXPECT_TRUE(expect_bcolls({"root", "child2", "child0", "child1", "child1_0"}));
EXPECT_EQ(0, armature_bonecoll_find_parent_index(&arm, 1));
}
TEST_F(ANIM_armature_bone_collections_testlist, move_before_after_index__after_first_sibling)
{
EXPECT_EQ(2, ANIM_armature_bonecoll_move_before_after_index(&arm, 3, 1, MoveLocation::After));
expect_bcolls({"root", "child0", "child2", "child1", "child1_0"});
EXPECT_TRUE(expect_bcolls({"root", "child0", "child2", "child1", "child1_0"}));
EXPECT_EQ(0, armature_bonecoll_find_parent_index(&arm, 2));
}
TEST_F(ANIM_armature_bone_collections_testlist, move_before_after_index__before_last_sibling)
{
EXPECT_EQ(2, ANIM_armature_bonecoll_move_before_after_index(&arm, 1, 3, MoveLocation::Before));
expect_bcolls({"root", "child1", "child0", "child2", "child1_0"});
EXPECT_TRUE(expect_bcolls({"root", "child1", "child0", "child2", "child1_0"}));
EXPECT_EQ(0, armature_bonecoll_find_parent_index(&arm, 2));
}
TEST_F(ANIM_armature_bone_collections_testlist, move_before_after_index__after_last_sibling)
{
EXPECT_EQ(3, ANIM_armature_bonecoll_move_before_after_index(&arm, 1, 3, MoveLocation::After));
expect_bcolls({"root", "child1", "child2", "child0", "child1_0"});
EXPECT_TRUE(expect_bcolls({"root", "child1", "child2", "child0", "child1_0"}));
EXPECT_EQ(0, armature_bonecoll_find_parent_index(&arm, 3));
}
@ -1364,7 +1384,7 @@ TEST_F(ANIM_armature_bone_collections_testlist,
move_before_after_index__other_parent_before__move_left)
{
EXPECT_EQ(1, ANIM_armature_bonecoll_move_before_after_index(&arm, 4, 1, MoveLocation::Before));
expect_bcolls({"root", "child1_0", "child0", "child1", "child2"});
EXPECT_TRUE(expect_bcolls({"root", "child1_0", "child0", "child1", "child2"}));
EXPECT_EQ(0, armature_bonecoll_find_parent_index(&arm, 1));
}
@ -1372,7 +1392,7 @@ TEST_F(ANIM_armature_bone_collections_testlist,
move_before_after_index__other_parent_after__move_left)
{
EXPECT_EQ(2, ANIM_armature_bonecoll_move_before_after_index(&arm, 4, 1, MoveLocation::After));
expect_bcolls({"root", "child0", "child1_0", "child1", "child2"});
EXPECT_TRUE(expect_bcolls({"root", "child0", "child1_0", "child1", "child2"}));
EXPECT_EQ(0, armature_bonecoll_find_parent_index(&arm, 2));
}
@ -1380,7 +1400,7 @@ TEST_F(ANIM_armature_bone_collections_testlist,
move_before_after_index__other_parent_before__move_right)
{
EXPECT_EQ(3, ANIM_armature_bonecoll_move_before_after_index(&arm, 1, 4, MoveLocation::Before));
expect_bcolls({"root", "child1", "child2", "child0", "child1_0"});
EXPECT_TRUE(expect_bcolls({"root", "child1", "child2", "child0", "child1_0"}));
EXPECT_EQ(1, armature_bonecoll_find_parent_index(&arm, 3));
}
@ -1388,24 +1408,77 @@ TEST_F(ANIM_armature_bone_collections_testlist,
move_before_after_index__other_parent_after__move_right)
{
EXPECT_EQ(4, ANIM_armature_bonecoll_move_before_after_index(&arm, 1, 4, MoveLocation::After));
expect_bcolls({"root", "child1", "child2", "child1_0", "child0"});
EXPECT_TRUE(expect_bcolls({"root", "child1", "child2", "child1_0", "child0"}));
EXPECT_EQ(1, armature_bonecoll_find_parent_index(&arm, 4));
}
TEST_F(ANIM_armature_bone_collections_testlist, move_before_after_index__to_root__before)
{
EXPECT_EQ(0, ANIM_armature_bonecoll_move_before_after_index(&arm, 4, 0, MoveLocation::Before));
expect_bcolls({"child1_0", "root", "child0", "child1", "child2"});
EXPECT_TRUE(expect_bcolls({"child1_0", "root", "child0", "child1", "child2"}));
EXPECT_EQ(-1, armature_bonecoll_find_parent_index(&arm, 0));
}
TEST_F(ANIM_armature_bone_collections_testlist, move_before_after_index__to_root__after)
{
EXPECT_EQ(1, ANIM_armature_bonecoll_move_before_after_index(&arm, 4, 0, MoveLocation::After));
expect_bcolls({"root", "child1_0", "child0", "child1", "child2"});
EXPECT_TRUE(expect_bcolls({"root", "child1_0", "child0", "child1", "child2"}));
EXPECT_EQ(-1, armature_bonecoll_find_parent_index(&arm, 1));
}
TEST_F(ANIM_armature_bone_collections_testlist, child_number_set__roots)
{
/* Test with only one root. */
EXPECT_EQ(0, armature_bonecoll_child_number_set(&arm, root, 0));
EXPECT_TRUE(expect_bcolls({"root", "child0", "child1", "child2", "child1_0"}));
/* Move to "after the last child", which is the one root itself. */
EXPECT_EQ(0, armature_bonecoll_child_number_set(&arm, root, -1));
EXPECT_TRUE(expect_bcolls({"root", "child0", "child1", "child2", "child1_0"}));
EXPECT_EQ(0, armature_bonecoll_child_number_set(&arm, root, 0));
EXPECT_TRUE(expect_bcolls({"root", "child0", "child1", "child2", "child1_0"}));
/* Going beyond the number of children is not allowed. */
EXPECT_EQ(-1, armature_bonecoll_child_number_set(&arm, root, 1));
EXPECT_TRUE(expect_bcolls({"root", "child0", "child1", "child2", "child1_0"}));
/* Add two roots to be able to play. */
ANIM_armature_bonecoll_new(&arm, "root1");
ANIM_armature_bonecoll_new(&arm, "root2");
EXPECT_TRUE(expect_bcolls({"root", "root1", "root2", "child0", "child1", "child2", "child1_0"}));
/* Move the old root in between the two new ones. */
EXPECT_EQ(1, armature_bonecoll_child_number_set(&arm, root, 1));
EXPECT_TRUE(expect_bcolls({"root1", "root", "root2", "child0", "child1", "child2", "child1_0"}));
/* And to the last one. */
EXPECT_EQ(2, armature_bonecoll_child_number_set(&arm, root, 2));
EXPECT_TRUE(expect_bcolls({"root1", "root2", "root", "child0", "child1", "child2", "child1_0"}));
}
TEST_F(ANIM_armature_bone_collections_testlist, child_number_set__siblings)
{
/* Move child0 to itself. */
EXPECT_EQ(1, armature_bonecoll_child_number_set(&arm, child0, 0));
EXPECT_TRUE(expect_bcolls({"root", "child0", "child1", "child2", "child1_0"}));
/* Move child2 to itself. */
EXPECT_EQ(3, armature_bonecoll_child_number_set(&arm, child2, -1));
EXPECT_TRUE(expect_bcolls({"root", "child0", "child1", "child2", "child1_0"}));
/* Going beyond the number of children is not allowed. */
EXPECT_EQ(-1, armature_bonecoll_child_number_set(&arm, child0, 3));
EXPECT_TRUE(expect_bcolls({"root", "child0", "child1", "child2", "child1_0"}));
/* Move child0 to in between child1 and child2. */
EXPECT_EQ(2, armature_bonecoll_child_number_set(&arm, child0, 1));
EXPECT_TRUE(expect_bcolls({"root", "child1", "child0", "child2", "child1_0"}));
/* Move child0 to the last spot. */
EXPECT_EQ(3, armature_bonecoll_child_number_set(&arm, child0, 2));
EXPECT_TRUE(expect_bcolls({"root", "child1", "child2", "child0", "child1_0"}));
}
class ANIM_armature_bone_collections_liboverrides
: public ANIM_armature_bone_collections_testlist {
protected:
@ -1469,16 +1542,16 @@ TEST_F(ANIM_armature_bone_collections_liboverrides, bcoll_insert_copy_after)
&dst_arm, &arm, anchor, src_root);
/* Check the array order. */
expect_bcolls({"root",
"new_root",
"child0",
"child1",
"child2",
"child1_0",
"new_child1",
"new_child2",
"new_gchild1",
"new_gchild2"});
EXPECT_TRUE(expect_bcolls({"root",
"new_root",
"child0",
"child1",
"child2",
"child1_0",
"new_child1",
"new_child2",
"new_gchild1",
"new_gchild2"}));
/* Check that the copied root is actually stored in the destination armature array. */
const int new_root_index = armature_bonecoll_find_index(&dst_arm, copy_root);

View File

@ -335,7 +335,7 @@ void BKE_lnor_space_define(MLoopNorSpace *lnor_space,
*/
void BKE_lnor_space_add_loop(MLoopNorSpaceArray *lnors_spacearr,
MLoopNorSpace *lnor_space,
int ml_index,
int corner,
void *bm_loop,
bool is_single);
void BKE_lnor_space_custom_data_to_normal(const MLoopNorSpace *lnor_space,

View File

@ -504,17 +504,17 @@ struct SculptSession {
/* Mesh connectivity maps. */
/* Vertices to adjacent polys. */
blender::GroupedSpan<int> pmap;
blender::GroupedSpan<int> vert_to_face_map;
/* Edges to adjacent faces. */
blender::Array<int> edge_to_face_offsets;
blender::Array<int> edge_to_face_indices;
blender::GroupedSpan<int> epmap;
blender::GroupedSpan<int> edge_to_face_map;
/* Vertices to adjacent edges. */
blender::Array<int> vert_to_edge_offsets;
blender::Array<int> vert_to_edge_indices;
blender::GroupedSpan<int> vemap;
blender::GroupedSpan<int> vert_to_edge_map;
/* Mesh Face Sets */
/* Total number of faces of the base mesh. */

View File

@ -20,7 +20,7 @@ enum PBVHType {
PBVH_BMESH,
};
/* #PBVHNodeFlags is needed by `DRW_render.h` and `draw_cache.cc`. */
/* #PBVHNodeFlags is needed by `DRW_render.hh` and `draw_cache.cc`. */
enum PBVHNodeFlags {
PBVH_Leaf = 1 << 0,

View File

@ -563,7 +563,7 @@ void BKE_pbvh_vertex_color_get(const PBVH *pbvh, PBVHVertRef vertex, float r_col
void BKE_pbvh_ensure_node_loops(PBVH *pbvh);
int BKE_pbvh_debug_draw_gen_get(PBVHNode *node);
void BKE_pbvh_pmap_set(PBVH *pbvh, blender::GroupedSpan<int> pmap);
void BKE_pbvh_pmap_set(PBVH *pbvh, blender::GroupedSpan<int> vert_to_face_map);
namespace blender::bke::pbvh {
Vector<PBVHNode *> search_gather(PBVH *pbvh,

View File

@ -95,7 +95,7 @@
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_query.hh"
#include "DRW_engine.h"
#include "DRW_engine.hh"
#include "BLO_read_write.hh"

View File

@ -48,7 +48,7 @@
#include "DEG_depsgraph_debug.hh"
#include "DEG_depsgraph_query.hh"
#include "DRW_engine.h"
#include "DRW_engine.hh"
#include "RE_engine.h"

View File

@ -43,7 +43,7 @@
#include "DEG_depsgraph_build.hh"
#include "DRW_engine.h"
#include "DRW_engine.hh"
#include "BLO_read_write.hh"

View File

@ -472,16 +472,16 @@ void BKE_lnor_space_define(MLoopNorSpace *lnor_space,
void BKE_lnor_space_add_loop(MLoopNorSpaceArray *lnors_spacearr,
MLoopNorSpace *lnor_space,
const int ml_index,
const int corner,
void *bm_loop,
const bool is_single)
{
BLI_assert((lnors_spacearr->data_type == MLNOR_SPACEARR_LOOP_INDEX && bm_loop == nullptr) ||
(lnors_spacearr->data_type == MLNOR_SPACEARR_BMLOOP_PTR && bm_loop != nullptr));
lnors_spacearr->lspacearr[ml_index] = lnor_space;
lnors_spacearr->lspacearr[corner] = lnor_space;
if (bm_loop == nullptr) {
bm_loop = POINTER_FROM_INT(ml_index);
bm_loop = POINTER_FROM_INT(corner);
}
if (is_single) {
BLI_assert(lnor_space->loops == nullptr);
@ -490,7 +490,7 @@ void BKE_lnor_space_add_loop(MLoopNorSpaceArray *lnors_spacearr,
}
else {
BLI_assert((lnor_space->flags & MLNOR_SPACE_IS_SINGLE) == 0);
BLI_linklist_prepend_nlink(&lnor_space->loops, bm_loop, &lnors_spacearr->loops_pool[ml_index]);
BLI_linklist_prepend_nlink(&lnor_space->loops, bm_loop, &lnors_spacearr->loops_pool[corner]);
}
}

View File

@ -66,7 +66,7 @@
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_query.hh"
#include "DRW_engine.h"
#include "DRW_engine.hh"
#include "GPU_texture.h"

View File

@ -72,7 +72,7 @@ void multires_reshape_apply_base_refit_base_mesh(MultiresReshapeContext *reshape
blender::MutableSpan<blender::float3> base_positions = base_mesh->vert_positions_for_write();
/* Update the context in case the vertices were duplicated. */
reshape_context->base_positions = base_positions;
const blender::GroupedSpan<int> pmap = base_mesh->vert_to_face_map();
const blender::GroupedSpan<int> vert_to_face_map = base_mesh->vert_to_face_map();
float(*origco)[3] = static_cast<float(*)[3]>(
MEM_calloc_arrayN(base_mesh->verts_num, sizeof(float[3]), __func__));
@ -84,17 +84,15 @@ void multires_reshape_apply_base_refit_base_mesh(MultiresReshapeContext *reshape
float avg_no[3] = {0, 0, 0}, center[3] = {0, 0, 0}, push[3];
/* Don't adjust vertices not used by at least one face. */
if (!pmap[i].size()) {
if (!vert_to_face_map[i].size()) {
continue;
}
/* Find center. */
int tot = 0;
for (int j = 0; j < pmap[i].size(); j++) {
const blender::IndexRange face = reshape_context->base_faces[pmap[i][j]];
for (const int face : vert_to_face_map[i]) {
/* This double counts, not sure if that's bad or good. */
for (const int corner : face) {
for (const int corner : reshape_context->base_faces[face]) {
const int vndx = reshape_context->base_corner_verts[corner];
if (vndx != i) {
add_v3_v3(center, origco[vndx]);
@ -105,8 +103,8 @@ void multires_reshape_apply_base_refit_base_mesh(MultiresReshapeContext *reshape
mul_v3_fl(center, 1.0f / tot);
/* Find normal. */
for (int j = 0; j < pmap[i].size(); j++) {
const blender::IndexRange face = reshape_context->base_faces[pmap[i][j]];
for (int j = 0; j < vert_to_face_map[i].size(); j++) {
const blender::IndexRange face = reshape_context->base_faces[vert_to_face_map[i][j]];
/* Set up face, loops, and coords in order to call #bke::mesh::face_normal_calc(). */
blender::Array<int> face_verts(face.size());

View File

@ -135,7 +135,7 @@
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_query.hh"
#include "DRW_engine.h"
#include "DRW_engine.hh"
#include "BLO_read_write.hh"
#include "BLO_readfile.h"

View File

@ -1442,13 +1442,13 @@ static void sculptsession_free_pbvh(Object *object)
ss->pbvh = nullptr;
}
ss->pmap = {};
ss->vert_to_face_map = {};
ss->edge_to_face_offsets = {};
ss->edge_to_face_indices = {};
ss->epmap = {};
ss->edge_to_face_map = {};
ss->vert_to_edge_offsets = {};
ss->vert_to_edge_indices = {};
ss->vemap = {};
ss->vert_to_edge_map = {};
MEM_SAFE_FREE(ss->preview_vert_list);
ss->preview_vert_count = 0;
@ -1749,11 +1749,11 @@ static void sculpt_update_object(Depsgraph *depsgraph,
sculpt_update_persistent_base(ob);
if (ob->type == OB_MESH) {
ss->pmap = mesh->vert_to_face_map();
ss->vert_to_face_map = mesh->vert_to_face_map();
}
if (ss->pbvh) {
BKE_pbvh_pmap_set(ss->pbvh, ss->pmap);
BKE_pbvh_pmap_set(ss->pbvh, ss->vert_to_face_map);
}
if (ss->deform_modifiers_active) {
@ -2174,7 +2174,7 @@ PBVH *BKE_sculpt_object_pbvh_ensure(Depsgraph *depsgraph, Object *ob)
}
BKE_pbvh_update_active_vcol(pbvh, BKE_object_get_original_mesh(ob));
BKE_pbvh_pmap_set(pbvh, ob->sculpt->pmap);
BKE_pbvh_pmap_set(pbvh, ob->sculpt->vert_to_face_map);
return pbvh;
}
@ -2197,7 +2197,7 @@ PBVH *BKE_sculpt_object_pbvh_ensure(Depsgraph *depsgraph, Object *ob)
}
}
BKE_pbvh_pmap_set(pbvh, ob->sculpt->pmap);
BKE_pbvh_pmap_set(pbvh, ob->sculpt->vert_to_face_map);
ob->sculpt->pbvh = pbvh;
sculpt_attribute_update_refs(ob);

View File

@ -1170,7 +1170,7 @@ static void pbvh_faces_update_normals(PBVH &pbvh, Span<PBVHNode *> nodes, Mesh &
for (const PBVHNode *node : nodes) {
for (const int vert : node->vert_indices.as_span().take_front(node->uniq_verts)) {
if (update_tags[vert]) {
faces_to_update.add_multiple(pbvh.pmap[vert]);
faces_to_update.add_multiple(pbvh.vert_to_face_map[vert]);
}
}
}
@ -1211,11 +1211,11 @@ static void pbvh_faces_update_normals(PBVH &pbvh, Span<PBVHNode *> nodes, Mesh &
if (pbvh.deformed) {
normals_calc_verts_simple(
pbvh.pmap, pbvh.face_normals, verts_to_update, pbvh.vert_normals_deformed);
pbvh.vert_to_face_map, pbvh.face_normals, verts_to_update, pbvh.vert_normals_deformed);
}
else {
mesh.runtime->vert_normals_cache.update([&](Vector<float3> &r_data) {
normals_calc_verts_simple(pbvh.pmap, pbvh.face_normals, verts_to_update, r_data);
normals_calc_verts_simple(pbvh.vert_to_face_map, pbvh.face_normals, verts_to_update, r_data);
});
pbvh.vert_normals = mesh.runtime->vert_normals_cache.data();
}
@ -3043,9 +3043,9 @@ void BKE_pbvh_update_active_vcol(PBVH *pbvh, Mesh *mesh)
BKE_pbvh_get_color_layer(mesh, &pbvh->color_layer, &pbvh->color_domain);
}
void BKE_pbvh_pmap_set(PBVH *pbvh, const blender::GroupedSpan<int> pmap)
void BKE_pbvh_pmap_set(PBVH *pbvh, const blender::GroupedSpan<int> vert_to_face_map)
{
pbvh->pmap = pmap;
pbvh->vert_to_face_map = vert_to_face_map;
}
void BKE_pbvh_ensure_node_loops(PBVH *pbvh)

View File

@ -93,7 +93,7 @@ static void pbvh_vertex_color_get(const PBVH &pbvh, PBVHVertRef vertex, float r_
if (pbvh.color_domain == AttrDomain::Corner) {
int count = 0;
zero_v4(r_color);
for (const int i_face : pbvh.pmap[index]) {
for (const int i_face : pbvh.vert_to_face_map[index]) {
const IndexRange face = pbvh.faces[i_face];
Span<T> colors{static_cast<const T *>(pbvh.color_layer->data) + face.start(), face.size()};
Span<int> face_verts = pbvh.corner_verts.slice(face);
@ -124,7 +124,7 @@ static void pbvh_vertex_color_set(PBVH &pbvh, PBVHVertRef vertex, const float co
int index = vertex.i;
if (pbvh.color_domain == AttrDomain::Corner) {
for (const int i_face : pbvh.pmap[index]) {
for (const int i_face : pbvh.vert_to_face_map[index]) {
const IndexRange face = pbvh.faces[i_face];
MutableSpan<T> colors{static_cast<T *>(pbvh.color_layer->data) + face.start(), face.size()};
Span<int> face_verts = pbvh.corner_verts.slice(face);

View File

@ -183,7 +183,7 @@ struct PBVH {
BMLog *bm_log;
blender::GroupedSpan<int> pmap;
blender::GroupedSpan<int> vert_to_face_map;
CustomDataLayer *color_layer;
blender::bke::AttrDomain color_domain;

View File

@ -114,7 +114,7 @@
#include "IMB_colormanagement.h"
#include "IMB_imbuf.h"
#include "DRW_engine.h"
#include "DRW_engine.hh"
#include "bmesh.hh"

View File

@ -60,7 +60,7 @@
#include "RE_texture.h"
#include "DRW_engine.h"
#include "DRW_engine.hh"
#include "BLO_read_write.hh"

View File

@ -35,7 +35,7 @@
#include "BLT_translation.h"
#include "DRW_engine.h"
#include "DRW_engine.hh"
#include "DEG_depsgraph.hh"

View File

@ -89,7 +89,7 @@
#include "BKE_undo_system.h"
#include "BKE_workspace.h"
#include "DRW_engine.h"
#include "DRW_engine.hh"
#include "DEG_depsgraph.hh"

View File

@ -3402,7 +3402,6 @@ void blo_do_versions_280(FileData *fd, Library * /*lib*/, Main *bmain)
copy_v3_fl(v3d->shading.single_color, 0.8f);
v3d->shading.shadow_intensity = 0.5;
v3d->overlay.backwire_opacity = 0.5f;
v3d->overlay.normals_length = 0.1f;
v3d->overlay.flag = 0;
}

View File

@ -648,10 +648,7 @@ if(WITH_COMPOSITOR_CPU)
blender_add_lib(bf_compositor "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
if(WITH_UNITY_BUILD)
set_target_properties(bf_compositor PROPERTIES UNITY_BUILD ON)
set_target_properties(bf_compositor PROPERTIES UNITY_BUILD_BATCH_SIZE 10)
endif()
blender_set_target_unity_build(bf_compositor 10)
if(COMMAND target_precompile_headers)
target_precompile_headers(bf_compositor PRIVATE COM_precomp.h)

View File

@ -28,11 +28,16 @@ class Context;
class CachedMaskKey {
public:
int2 size;
float aspect_ratio;
bool use_feather;
int motion_blur_samples;
float motion_blur_shutter;
CachedMaskKey(int2 size, bool use_feather, int motion_blur_samples, float motion_blur_shutter);
CachedMaskKey(int2 size,
float aspect_ratio,
bool use_feather,
int motion_blur_samples,
float motion_blur_shutter);
uint64_t hash() const;
};
@ -53,6 +58,7 @@ class CachedMask : public CachedResource {
Mask *mask,
int2 size,
int frame,
float aspect_ratio,
bool use_feather,
int motion_blur_samples,
float motion_blur_shutter);
@ -81,6 +87,7 @@ class CachedMaskContainer : CachedResourceContainer {
CachedMask &get(Context &context,
Mask *mask,
int2 size,
float aspect_ratio,
bool use_feather,
int motion_blur_samples,
float motion_blur_shutter);

View File

@ -31,10 +31,12 @@ namespace blender::realtime_compositor {
*/
CachedMaskKey::CachedMaskKey(int2 size,
float aspect_ratio,
bool use_feather,
int motion_blur_samples,
float motion_blur_shutter)
: size(size),
aspect_ratio(aspect_ratio),
use_feather(use_feather),
motion_blur_samples(motion_blur_samples),
motion_blur_shutter(motion_blur_shutter)
@ -43,12 +45,13 @@ CachedMaskKey::CachedMaskKey(int2 size,
uint64_t CachedMaskKey::hash() const
{
return get_default_hash_4(size, use_feather, motion_blur_samples, motion_blur_shutter);
return get_default_hash_4(
size, use_feather, motion_blur_samples, float2(motion_blur_shutter, aspect_ratio));
}
bool operator==(const CachedMaskKey &a, const CachedMaskKey &b)
{
return a.size == b.size && a.use_feather == b.use_feather &&
return a.size == b.size && a.aspect_ratio == b.aspect_ratio && a.use_feather == b.use_feather &&
a.motion_blur_samples == b.motion_blur_samples &&
a.motion_blur_shutter == b.motion_blur_shutter;
}
@ -104,6 +107,7 @@ CachedMask::CachedMask(Context &context,
Mask *mask,
int2 size,
int frame,
float aspect_ratio,
bool use_feather,
int motion_blur_samples,
float motion_blur_shutter)
@ -117,7 +121,10 @@ CachedMask::CachedMask(Context &context,
for (const int64_t x : IndexRange(size.x)) {
/* Compute the coordinates in the [0, 1] range and add 0.5 to evaluate the mask at the
* center of pixels. */
const float2 coordinates = (float2(x, y) + 0.5f) / float2(size);
float2 coordinates = (float2(x, y) + 0.5f) / float2(size);
/* Do aspect ratio correction around the center 0.5 point. */
coordinates = (coordinates - float2(0.5)) * float2(1.0, aspect_ratio) + float2(0.5);
float mask_value = 0.0f;
for (MaskRasterHandle *handle : handles) {
mask_value += BKE_maskrasterize_handle_sample(handle, coordinates);
@ -175,11 +182,13 @@ void CachedMaskContainer::reset()
CachedMask &CachedMaskContainer::get(Context &context,
Mask *mask,
int2 size,
float aspect_ratio,
bool use_feather,
int motion_blur_samples,
float motion_blur_shutter)
{
const CachedMaskKey key(size, use_feather, motion_blur_samples, motion_blur_shutter);
const CachedMaskKey key(
size, aspect_ratio, use_feather, motion_blur_samples, motion_blur_shutter);
auto &cached_masks_for_id = map_.lookup_or_add_default(mask->id.name);
@ -193,6 +202,7 @@ CachedMask &CachedMaskContainer::get(Context &context,
mask,
size,
context.get_frame_number(),
aspect_ratio,
use_feather,
motion_blur_samples,
motion_blur_shutter);

View File

@ -24,9 +24,10 @@
* and intertwined with the Gaussian blur implementation as follows. A search window of a radius
* equivalent to the dilate/erode distance is applied on the image to find either the minimum or
* maximum pixel value multiplied by its corresponding falloff value in the window. For dilation,
* we try to find the maximum, and for erosion, we try to find the minimum. Additionally, we also
* save the falloff value where the minimum or maximum was found. The found value will be that of
* the narrow band distance field and the saved falloff value will be used as the mixing factor
* we try to find the maximum, and for erosion, we try to find the minimum. The implementation uses
* an inverse function to find the minimum, specified through the FUNCTION macro. Additionally, we
* also save the falloff value where the minimum or maximum was found. The found value will be that
* of the narrow band distance field and the saved falloff value will be used as the mixing factor
* with the Gaussian blur.
*
* To make sense of the aforementioned algorithm, assume we are dilating a binary image by 5 pixels
@ -59,7 +60,7 @@ void main()
float accumulated_value = 0.0;
/* Compute the contribution of the center pixel to the blur result. */
float center_value = texture_load(input_tx, texel).x;
float center_value = FUNCTION(texture_load(input_tx, texel).x);
accumulated_value += center_value * texture_load(weights_tx, 0).x;
/* Start with the center value as the maximum/minimum distance and reassign to the true maximum
@ -80,7 +81,7 @@ void main()
* needed to evaluated the positive and negative sides as explain above. */
for (int s = -1; s < 2; s += 2) {
/* Compute the contribution of the pixel to the blur result. */
float value = texture_load(input_tx, texel + ivec2(s * i, 0)).x;
float value = FUNCTION(texture_load(input_tx, texel + ivec2(s * i, 0)).x);
accumulated_value += value * weight;
/* The distance is computed such that its highest value is the pixel value itself, so
@ -88,7 +89,7 @@ void main()
float falloff_distance = value * falloff;
/* Find either the maximum or the minimum for the dilate and erode cases respectively. */
if (COMPARE(falloff_distance, limit_distance)) {
if (falloff_distance > limit_distance) {
limit_distance = falloff_distance;
limit_distance_falloff = falloff;
}
@ -102,5 +103,5 @@ void main()
/* Write the value using the transposed texel. See the execute_distance_feather_horizontal_pass
* method for more information on the rational behind this. */
imageStore(output_img, texel.yx, vec4(value));
imageStore(output_img, texel.yx, vec4(FUNCTION(value)));
}

View File

@ -14,10 +14,10 @@ GPU_SHADER_CREATE_INFO(compositor_morphological_distance_feather_shared)
GPU_SHADER_CREATE_INFO(compositor_morphological_distance_feather_dilate)
.additional_info("compositor_morphological_distance_feather_shared")
.define("COMPARE(x, y)", "x > y")
.define("FUNCTION(x)", "x")
.do_static_compilation(true);
GPU_SHADER_CREATE_INFO(compositor_morphological_distance_feather_erode)
.additional_info("compositor_morphological_distance_feather_shared")
.define("COMPARE(x, y)", "x < y")
.define("FUNCTION(x)", "1.0 - x")
.do_static_compilation(true);

View File

@ -53,7 +53,7 @@
#include "DNA_sequence_types.h"
#include "DNA_sound_types.h"
#include "DRW_engine.h"
#include "DRW_engine.hh"
#ifdef NESTED_ID_NASTY_WORKAROUND
# include "DNA_curve_types.h"

View File

@ -25,7 +25,7 @@
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DRW_engine.h"
#include "DRW_engine.hh"
#include "DEG_depsgraph.hh"

View File

@ -12,7 +12,7 @@
#include "BLI_utildefines.h"
#include "DRW_engine.h"
#include "DRW_engine.hh"
namespace blender::deg {

View File

@ -225,17 +225,17 @@ set(SRC
engines/overlay/overlay_volume.cc
engines/overlay/overlay_wireframe.cc
DRW_engine.h
DRW_engine.hh
DRW_pbvh.hh
DRW_select_buffer.hh
intern/DRW_gpu_wrapper.hh
intern/DRW_render.h
intern/DRW_render.hh
intern/attribute_convert.hh
intern/draw_attributes.hh
intern/draw_cache.h
intern/draw_cache.hh
intern/draw_cache_extract.hh
intern/draw_cache_impl.hh
intern/draw_cache_inline.h
intern/draw_cache_inline.hh
intern/draw_color_management.h
intern/draw_command.hh
intern/draw_common.h
@ -256,7 +256,7 @@ set(SRC
intern/draw_pbvh.hh
intern/draw_resource.hh
intern/draw_sculpt.hh
intern/draw_shader.h
intern/draw_shader.hh
intern/draw_shader_shared.h
intern/draw_state.h
intern/draw_subdivision.hh

View File

@ -12,10 +12,6 @@
#include "DNA_object_enums.h"
#ifdef __cplusplus
extern "C" {
#endif
struct ARegion;
struct DRWData;
struct DRWInstanceDataList;
@ -176,11 +172,16 @@ void DRW_xr_drawing_end(void);
/* For garbage collection */
void DRW_cache_free_old_batches(struct Main *bmain);
namespace blender::draw {
void DRW_cache_free_old_subdiv(void);
/* For the OpenGL evaluators and garbage collected subdivision data. */
void DRW_subdiv_free(void);
} // namespace blender::draw
/* Never use this. Only for closing blender. */
void DRW_gpu_context_enable_ex(bool restore);
void DRW_gpu_context_disable_ex(bool restore);
@ -221,6 +222,3 @@ void DRW_cdlayer_attr_aliases_add(struct GPUVertFormat *format,
const char *layer_name,
bool is_active_render,
bool is_active_layer);
#ifdef __cplusplus
}
#endif

View File

@ -9,7 +9,7 @@
* When we only need simple flat shaders.
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "BKE_global.h"
#include "BKE_object.hh"
@ -154,6 +154,7 @@ static void basic_cache_populate_particles(void *vedata, Object *ob)
static void basic_cache_populate(void *vedata, Object *ob)
{
using namespace blender::draw;
BASIC_StorageList *stl = ((BASIC_Data *)vedata)->stl;
/* TODO(fclem): fix selection of smoke domains. */

View File

@ -6,7 +6,7 @@
* \ingroup draw_engine
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "GPU_shader.h"

View File

@ -22,7 +22,7 @@
#include "ED_view3d.hh"
#include "DRW_render.h"
#include "DRW_render.hh"
#include "IMB_colormanagement.h"

View File

@ -8,7 +8,7 @@
* Eevee's bloom shader.
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "GPU_texture.h"

View File

@ -28,8 +28,8 @@
* of render samples is used.
*/
#include "DRW_engine.h"
#include "DRW_render.h"
#include "DRW_engine.hh"
#include "DRW_render.hh"
#include "BKE_cryptomatte.h"
@ -250,6 +250,7 @@ void EEVEE_cryptomatte_object_curves_cache_populate(EEVEE_Data *vedata,
EEVEE_ViewLayerData *sldata,
Object *ob)
{
using namespace blender::draw;
BLI_assert(ob->type == OB_CURVES);
Material *material = BKE_object_material_get_eval(ob, CURVES_MATERIAL_NR);
DRWShadingGroup *grp = eevee_cryptomatte_shading_group_create(

View File

@ -8,7 +8,7 @@
* All specific data handler for Objects, Lights, ViewLayers, ...
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "BLI_ghash.h"
#include "BLI_memblock.h"

View File

@ -15,7 +15,7 @@
* difference with our actual implementation that prioritize quality.
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "DNA_camera_types.h"
#include "DNA_screen_types.h"

View File

@ -8,7 +8,7 @@
* Gather all screen space effects technique such as Bloom, Motion Blur, DoF, SSAO, SSR, ...
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "BKE_global.h" /* for G.debug_value */

View File

@ -6,7 +6,7 @@
* \ingroup draw_engine
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "draw_color_management.h" /* TODO: remove dependency. */

View File

@ -8,7 +8,7 @@
* Eevee's indirect lighting cache.
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "BKE_global.h"
@ -62,13 +62,13 @@
(IRRADIANCE_MAX_POOL_SIZE / IRRADIANCE_SAMPLE_SIZE_Y)
/* TODO: should be replace by a more elegant alternative. */
extern "C" void DRW_gpu_context_enable(void);
extern "C" void DRW_gpu_context_disable(void);
void DRW_gpu_context_enable(void);
void DRW_gpu_context_disable(void);
extern "C" void DRW_system_gpu_render_context_enable(void *re_system_gpu_context);
extern "C" void DRW_system_gpu_render_context_disable(void *re_system_gpu_context);
extern "C" void DRW_blender_gpu_render_context_enable(void *re_blender_gpu_context);
extern "C" void DRW_blender_gpu_render_context_disable(void *re_blender_gpu_context);
void DRW_system_gpu_render_context_enable(void *re_system_gpu_context);
void DRW_system_gpu_render_context_disable(void *re_system_gpu_context);
void DRW_blender_gpu_render_context_enable(void *re_blender_gpu_context);
void DRW_blender_gpu_render_context_disable(void *re_blender_gpu_context);
struct EEVEE_LightBake {
Depsgraph *depsgraph;
@ -926,6 +926,7 @@ static void eevee_lightbake_delete_resources(EEVEE_LightBake *lbake)
/* Cache as in draw cache not light cache. */
static void eevee_lightbake_cache_create(EEVEE_Data *vedata, EEVEE_LightBake *lbake)
{
using namespace blender::draw;
EEVEE_TextureList *txl = vedata->txl;
EEVEE_StorageList *stl = vedata->stl;
EEVEE_FramebufferList *fbl = vedata->fbl;

View File

@ -6,7 +6,7 @@
* \ingroup draw_engine
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "BLI_rand.h"
#include "BLI_string_utils.hh"

View File

@ -5,7 +5,7 @@
/** \file
* \ingroup draw_engine
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "BKE_camera.h"
#include "BKE_studiolight.h"

View File

@ -11,7 +11,7 @@
* These functions are not to be used in the final executable.
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "BLI_fileops.h"
#include "BLI_rand.h"

View File

@ -6,7 +6,7 @@
* \ingroup draw_engine
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "BLI_alloca.h"
#include "BLI_ghash.h"
@ -971,6 +971,7 @@ void EEVEE_object_curves_cache_populate(EEVEE_Data *vedata,
Object *ob,
bool *cast_shadow)
{
using namespace blender::draw;
EeveeMaterialCache matcache = eevee_material_cache_get(
vedata, sldata, ob, CURVES_MATERIAL_NR - 1, true);

View File

@ -9,8 +9,8 @@
* IMPORTANT: This is a "post process" of the Z depth so it will lack any transparent objects.
*/
#include "DRW_engine.h"
#include "DRW_render.h"
#include "DRW_engine.hh"
#include "DRW_render.hh"
#include "DNA_world_types.h"

View File

@ -8,7 +8,7 @@
* Gather all screen space effects technique such as Bloom, Motion Blur, DoF, SSAO, SSR, ...
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "BLI_rand.h"
#include "BLI_string_utils.hh"
@ -278,6 +278,7 @@ void EEVEE_motion_blur_curves_cache_populate(EEVEE_ViewLayerData * /*sldata*/,
EEVEE_Data *vedata,
Object *ob)
{
using namespace blender::draw;
EEVEE_PassList *psl = vedata->psl;
EEVEE_StorageList *stl = vedata->stl;
EEVEE_EffectsInfo *effects = stl->effects;
@ -433,6 +434,7 @@ static void motion_blur_remove_vbo_reference_from_batch(GPUBatch *batch,
void EEVEE_motion_blur_cache_finish(EEVEE_Data *vedata)
{
using namespace blender::draw;
EEVEE_StorageList *stl = vedata->stl;
EEVEE_EffectsInfo *effects = stl->effects;
GHashIterator ghi;

View File

@ -8,7 +8,7 @@
* Implementation of the screen space Ground Truth Ambient Occlusion.
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "BLI_string_utils.hh"

View File

@ -8,7 +8,7 @@
#pragma once
#include "DRW_render.h"
#include "DRW_render.hh"
#include "BLI_bitmap.h"

View File

@ -10,8 +10,8 @@
* Render functions for final render outputs.
*/
#include "DRW_engine.h"
#include "DRW_render.h"
#include "DRW_engine.hh"
#include "DRW_render.hh"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
@ -538,6 +538,7 @@ static void eevee_render_draw_background(EEVEE_Data *vedata)
void EEVEE_render_draw(EEVEE_Data *vedata, RenderEngine *engine, RenderLayer *rl, const rcti *rect)
{
using namespace blender::draw;
const char *viewname = RE_GetActiveRenderView(engine->re);
EEVEE_PassList *psl = vedata->psl;
EEVEE_StorageList *stl = vedata->stl;

View File

@ -6,8 +6,8 @@
* \ingroup draw_engine
*/
#include "DRW_engine.h"
#include "DRW_render.h"
#include "DRW_engine.hh"
#include "DRW_render.hh"
#include "draw_color_management.h" /* TODO: remove dependency. */

View File

@ -8,7 +8,7 @@
* Screen space reflections and refractions techniques.
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "BLI_dynstr.h"
#include "BLI_string_utils.hh"

View File

@ -6,7 +6,7 @@
* \ingroup draw_engine
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "BKE_lib_id.h"
#include "BKE_node.hh"

View File

@ -8,7 +8,7 @@
* Screen space subsurface scattering technique.
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "BLI_string_utils.hh"

View File

@ -8,7 +8,7 @@
* Temporal super sampling technique
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "ED_screen.hh"

View File

@ -8,7 +8,7 @@
* Volumetric effects rendering using frostbite approach.
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "BLI_listbase.h"
#include "BLI_rand.h"

View File

@ -8,7 +8,7 @@
#include <array>
#include "DRW_render.h"
#include "DRW_render.hh"
#include "DNA_camera_types.h"
#include "DNA_view3d_types.h"

View File

@ -17,7 +17,7 @@
* There are some difference with our actual implementation that prioritize quality.
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "BKE_camera.h"
#include "DNA_camera_types.h"

View File

@ -11,7 +11,7 @@
#include "ED_screen.hh"
#include "ED_view3d.hh"
#include "DRW_render.h"
#include "DRW_render.hh"
#include "RE_pipeline.h"

View File

@ -8,7 +8,7 @@
#pragma once
#include "DRW_render.h"
#include "DRW_render.hh"
#include "RE_engine.h"
#ifdef __cplusplus

View File

@ -18,7 +18,7 @@
#include "GPU_framebuffer.h"
#include "GPU_texture.h"
#include "DRW_render.h"
#include "DRW_render.hh"
#include "RE_pipeline.h"
#include "eevee_film.hh"

View File

@ -28,7 +28,7 @@
#pragma once
#include "DRW_render.h"
#include "DRW_render.hh"
#include "eevee_shader_shared.hh"

View File

@ -10,7 +10,7 @@
#pragma once
#include "DRW_render.h"
#include "DRW_render.hh"
#include "eevee_material.hh"
#include "eevee_shader_shared.hh"

View File

@ -12,7 +12,7 @@
#pragma once
#include "DRW_render.h"
#include "DRW_render.hh"
#include "eevee_shader_shared.hh"

View File

@ -13,7 +13,7 @@
#include "BKE_object.hh"
#include "DEG_depsgraph.hh"
#include "DNA_lightprobe_types.h"
#include "DRW_render.h"
#include "DRW_render.hh"
#include "eevee_ambient_occlusion.hh"
#include "eevee_camera.hh"

View File

@ -10,7 +10,7 @@
#include <mutex>
#include "DRW_render.h"
#include "DRW_render.hh"
#include "BKE_global.h"
#include "BKE_lightprobe.h"

View File

@ -8,7 +8,7 @@
#pragma once
#include "DRW_render.h"
#include "DRW_render.hh"
#include "BLI_map.hh"
#include "BLI_vector.hh"

View File

@ -14,7 +14,7 @@
#include "BLI_math_bits.h"
#include "DRW_render.h"
#include "DRW_render.hh"
#include "draw_shader_shared.h"
#include "eevee_lut.hh"

View File

@ -12,7 +12,7 @@
#include "DNA_scene_types.h"
#include "DRW_render.h"
#include "DRW_render.hh"
#include "eevee_shader_shared.hh"

View File

@ -17,7 +17,7 @@
#include "GPU_framebuffer.h"
#include "GPU_texture.h"
#include "DRW_render.h"
#include "DRW_render.hh"
#include "eevee_film.hh"
#include "eevee_instance.hh"

View File

@ -12,7 +12,7 @@
#pragma once
#include "DRW_render.h"
#include "DRW_render.hh"
#include "eevee_shader_shared.hh"

View File

@ -13,7 +13,7 @@
#include "BLI_system.h"
#include "BLI_vector.hh"
#include "DNA_scene_types.h"
#include "DRW_render.h"
#include "DRW_render.hh"
#include "eevee_shader_shared.hh"

View File

@ -15,7 +15,7 @@
#include <string>
#include "BLI_string_ref.hh"
#include "DRW_render.h"
#include "DRW_render.hh"
#include "GPU_material.h"
#include "GPU_shader.h"

View File

@ -16,7 +16,7 @@
#include "BLI_map.hh"
#include "DEG_depsgraph_query.hh"
#include "DNA_object_types.h"
#include "DRW_render.h"
#include "DRW_render.hh"
#include "GPU_material.h"
#include "eevee_shader_shared.hh"

View File

@ -16,7 +16,7 @@
*/
#include "BKE_global.h"
#include "DRW_render.h"
#include "DRW_render.hh"
#include "eevee_instance.hh"

View File

@ -16,7 +16,7 @@
#pragma once
#include "DRW_render.h"
#include "DRW_render.hh"
#include "eevee_camera.hh"
#include "eevee_pipeline.hh"

View File

@ -9,8 +9,8 @@
* We use it for depth and non-mesh objects.
*/
#include "DRW_engine.h"
#include "DRW_render.h"
#include "DRW_engine.hh"
#include "DRW_render.hh"
#include "DNA_modifier_types.h"
#include "DNA_screen_types.h"

View File

@ -6,7 +6,7 @@
* \ingroup draw
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "gpencil_engine.h"

View File

@ -11,7 +11,7 @@
#include "BKE_gpencil_legacy.h"
#include "BKE_image.h"
#include "DRW_gpu_wrapper.hh"
#include "DRW_render.h"
#include "DRW_render.hh"
#include "draw_manager.hh"
#include "draw_pass.hh"

View File

@ -6,8 +6,8 @@
* \ingroup draw
*/
#include "DRW_engine.h"
#include "DRW_render.h"
#include "DRW_engine.hh"
#include "DRW_render.hh"
#include "ED_gpencil_legacy.hh"
#include "ED_view3d.hh"

View File

@ -6,7 +6,7 @@
* \ingroup draw_engine
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "DNA_light_types.h"

View File

@ -14,8 +14,8 @@
#include "DNA_shader_fx_types.h"
#include "DRW_engine.h"
#include "DRW_render.h"
#include "DRW_engine.hh"
#include "DRW_render.hh"
#include "ED_screen.hh"
#include "ED_view3d.hh"

View File

@ -10,7 +10,7 @@
#include "DNA_gpencil_legacy_types.h"
#include "DRW_render.h"
#include "DRW_render.hh"
#include "BLI_bitmap.h"

View File

@ -5,8 +5,8 @@
/** \file
* \ingroup draw
*/
#include "DRW_engine.h"
#include "DRW_render.h"
#include "DRW_engine.hh"
#include "DRW_render.hh"
#include "BKE_gpencil_legacy.h"
#include "BKE_gpencil_modifier_legacy.h"
@ -173,6 +173,7 @@ void GPENCIL_engine_init(void *ved)
void GPENCIL_cache_init(void *ved)
{
using namespace blender::draw;
GPENCIL_Data *vedata = (GPENCIL_Data *)ved;
GPENCIL_PassList *psl = vedata->psl;
GPENCIL_TextureList *txl = vedata->txl;
@ -465,6 +466,7 @@ static void gpencil_stroke_cache_populate(bGPDlayer *gpl,
bGPDstroke *gps,
void *thunk)
{
using namespace blender::draw;
gpIterPopulateData *iter = (gpIterPopulateData *)thunk;
bGPdata *gpd = static_cast<bGPdata *>(iter->ob->data);
@ -750,6 +752,7 @@ void GPENCIL_cache_finish(void *ved)
static void GPENCIL_draw_scene_depth_only(void *ved)
{
using namespace blender::draw;
GPENCIL_Data *vedata = (GPENCIL_Data *)ved;
GPENCIL_PrivateData *pd = vedata->stl->pd;
DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get();
@ -917,6 +920,7 @@ static void GPENCIL_fast_draw_end(GPENCIL_Data *vedata)
void GPENCIL_draw_scene(void *ved)
{
using namespace blender::draw;
GPENCIL_Data *vedata = (GPENCIL_Data *)ved;
GPENCIL_PrivateData *pd = vedata->stl->pd;
GPENCIL_FramebufferList *fbl = vedata->fbl;

View File

@ -10,7 +10,7 @@
#include "BKE_grease_pencil.hh"
#include "DRW_gpu_wrapper.hh"
#include "DRW_render.h"
#include "DRW_render.hh"
#include "draw_manager.hh"
#include "draw_pass.hh"

View File

@ -11,7 +11,7 @@
#include "BKE_gpencil_legacy.h"
#include "BKE_image.h"
#include "DRW_gpu_wrapper.hh"
#include "DRW_render.h"
#include "DRW_render.hh"
#include "draw_manager.hh"
#include "draw_pass.hh"

View File

@ -11,7 +11,7 @@
#include "BKE_gpencil_legacy.h"
#include "BKE_image.h"
#include "DRW_gpu_wrapper.hh"
#include "DRW_render.h"
#include "DRW_render.hh"
#include "draw_manager.hh"
#include "draw_pass.hh"

View File

@ -13,7 +13,7 @@
#include "BKE_grease_pencil.hh"
#include "BKE_image.h"
#include "DRW_gpu_wrapper.hh"
#include "DRW_render.h"
#include "DRW_render.hh"
#include "draw_manager.hh"
#include "draw_pass.hh"

View File

@ -7,7 +7,7 @@
*/
#include "BLI_rect.h"
#include "DRW_render.h"
#include "DRW_render.hh"
#include "BKE_object.hh"

View File

@ -8,7 +8,7 @@
#pragma once
#include "DRW_render.h"
#include "DRW_render.hh"
namespace blender::draw::greasepencil {

View File

@ -5,7 +5,7 @@
/** \file
* \ingroup draw
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "gpencil_engine.h"

View File

@ -15,7 +15,7 @@
#include "BLI_link_utils.h"
#include "BLI_memblock.h"
#include "DRW_render.h"
#include "DRW_render.hh"
#include "BKE_camera.h"

View File

@ -8,7 +8,7 @@
* Draw engine to draw the Image/UV editor
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include <memory>
#include <optional>

View File

@ -18,7 +18,7 @@
#include "image_texture_info.hh"
#include "image_usage.hh"
#include "DRW_render.h"
#include "DRW_render.hh"
namespace blender::draw::image_engine {

View File

@ -6,7 +6,7 @@
* \ingroup draw_engine
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "BLI_dynstr.h"

View File

@ -40,7 +40,7 @@
* - No convergence time (compared to TAA).
*/
#include "DRW_render.h"
#include "DRW_render.hh"
#include "ED_screen.hh"

Some files were not shown because too many files have changed in this diff Show More