[Bf-blender-cvs] [c62b1850e35] functions: rename "size_of_type" to just "size"
Jacques Lucke
noreply at git.blender.org
Mon Jul 29 17:58:05 CEST 2019
Commit: c62b1850e35cef51e87510f7f687649b3a8ce3fa
Author: Jacques Lucke
Date: Mon Jul 29 17:55:52 2019 +0200
Branches: functions
https://developer.blender.org/rBc62b1850e35cef51e87510f7f687649b3a8ce3fa
rename "size_of_type" to just "size"
===================================================================
M source/blender/functions/backends/tuple/cpp_types.hpp
M source/blender/functions/backends/tuple/tuple.cpp
M source/blender/functions/backends/tuple_call/fgraph_tuple_call.cpp
M source/blender/functions/functions/auto_vectorization.cpp
M source/blender/functions/functions/switch.cpp
M source/blender/simulations/bparticles/particle_function.cpp
===================================================================
diff --git a/source/blender/functions/backends/tuple/cpp_types.hpp b/source/blender/functions/backends/tuple/cpp_types.hpp
index a9ba15e15de..511aa8708c8 100644
--- a/source/blender/functions/backends/tuple/cpp_types.hpp
+++ b/source/blender/functions/backends/tuple/cpp_types.hpp
@@ -23,7 +23,7 @@ class CPPTypeInfo : public TypeExtension {
/**
* Get the size of the type in bytes.
*/
- virtual uint size_of_type() const = 0;
+ virtual uint size() const = 0;
/**
* Get the alignment requirements for this type.
@@ -72,7 +72,7 @@ class CPPTypeInfo : public TypeExtension {
template<typename T> class CPPTypeInfoForType : public CPPTypeInfo {
public:
- uint size_of_type() const override
+ uint size() const override
{
return sizeof(T);
}
diff --git a/source/blender/functions/backends/tuple/tuple.cpp b/source/blender/functions/backends/tuple/tuple.cpp
index 78b7160cba3..509684c8cc5 100644
--- a/source/blender/functions/backends/tuple/tuple.cpp
+++ b/source/blender/functions/backends/tuple/tuple.cpp
@@ -12,7 +12,7 @@ TupleMeta::TupleMeta(ArrayRef<SharedType> types) : m_types(types)
m_size__data = pad_up(m_size__data, alignment);
m_offsets.append(m_size__data);
m_type_info.append(&info);
- m_size__data += info.size_of_type();
+ m_size__data += info.size();
if (!info.trivially_destructible()) {
m_all_trivially_destructible = false;
}
diff --git a/source/blender/functions/backends/tuple_call/fgraph_tuple_call.cpp b/source/blender/functions/backends/tuple_call/fgraph_tuple_call.cpp
index 5c4e745708b..634e6fa8117 100644
--- a/source/blender/functions/backends/tuple_call/fgraph_tuple_call.cpp
+++ b/source/blender/functions/backends/tuple_call/fgraph_tuple_call.cpp
@@ -89,14 +89,14 @@ class ExecuteFGraph : public TupleCallBody {
if (body == nullptr) {
for (auto type : fn->input_types()) {
CPPTypeInfo &type_info = type->extension<CPPTypeInfo>();
- uint type_size = type_info.size_of_type();
+ uint type_size = type_info.size();
m_input_info.append(SocketInfo(type_info, m_inputs_buffer_size, false));
m_inputs_buffer_size += type_size;
}
for (auto type : fn->output_types()) {
CPPTypeInfo &type_info = type->extension<CPPTypeInfo>();
- uint type_size = type_info.size_of_type();
+ uint type_size = type_info.size();
m_output_info.append(SocketInfo(type_info, m_outputs_buffer_size, false));
m_outputs_buffer_size += type_size;
}
diff --git a/source/blender/functions/functions/auto_vectorization.cpp b/source/blender/functions/functions/auto_vectorization.cpp
index fef2d08a980..d5a92098302 100644
--- a/source/blender/functions/functions/auto_vectorization.cpp
+++ b/source/blender/functions/functions/auto_vectorization.cpp
@@ -130,7 +130,7 @@ class AutoVectorizationGen : public LLVMBuildIRBody {
Vector<llvm::Value *> data_pointers;
for (uint i = 0; i < m_input_info.size(); i++) {
if (m_input_info[i].is_list) {
- uint stride = m_input_info[i].base_cpp_type->size_of_type();
+ uint stride = m_input_info[i].base_cpp_type->size();
llvm::Value *data_ptr = builder.CreateCallPointer((void *)m_input_info[i].get_data_ptr_fn,
{interface.get_input(i)},
builder.getVoidPtrTy(),
@@ -148,7 +148,7 @@ class AutoVectorizationGen : public LLVMBuildIRBody {
{
Vector<llvm::Value *> data_pointers;
for (uint i = 0; i < m_output_info.size(); i++) {
- uint stride = m_output_info[i].base_cpp_type->size_of_type();
+ uint stride = m_output_info[i].base_cpp_type->size();
llvm::Value *output_list = builder.CreateCallPointer(
(void *)m_output_info[i].get_new_list_fn,
diff --git a/source/blender/functions/functions/switch.cpp b/source/blender/functions/functions/switch.cpp
index 10cff5557b2..250bece4bd1 100644
--- a/source/blender/functions/functions/switch.cpp
+++ b/source/blender/functions/functions/switch.cpp
@@ -18,7 +18,7 @@ class LazyBoolSwitch : public LazyInTupleCallBody {
public:
LazyBoolSwitch(SharedType type)
- : m_type(type), m_type_size(type->extension<CPPTypeInfo>().size_of_type())
+ : m_type(type), m_type_size(type->extension<CPPTypeInfo>().size())
{
}
diff --git a/source/blender/simulations/bparticles/particle_function.cpp b/source/blender/simulations/bparticles/particle_function.cpp
index 219c6c65fcb..7fe1767202b 100644
--- a/source/blender/simulations/bparticles/particle_function.cpp
+++ b/source/blender/simulations/bparticles/particle_function.cpp
@@ -119,7 +119,7 @@ void ParticleFunction::init_without_deps(ParticleFunctionResult *result,
uint output_index = m_output_indices[parameter_index];
CPPTypeInfo &type_info = m_fn_no_deps->output_type(output_index)->extension<CPPTypeInfo>();
- uint output_stride = type_info.size_of_type();
+ uint output_stride = type_info.size();
void *output_buffer = array_allocator.allocate(output_stride);
result->m_buffers[parameter_index] = output_buffer;
@@ -172,7 +172,7 @@ void ParticleFunction::init_with_deps(ParticleFunctionResult *result,
uint output_index = m_output_indices[parameter_index];
CPPTypeInfo &type_info = m_fn_with_deps->output_type(output_index)->extension<CPPTypeInfo>();
- uint output_stride = type_info.size_of_type();
+ uint output_stride = type_info.size();
void *output_buffer = array_allocator.allocate(output_stride);
result->m_buffers[parameter_index] = output_buffer;
More information about the Bf-blender-cvs
mailing list