Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/intern/gpu_uniform_buffer.cc
| Show All 26 Lines | |||||
| #include "BLI_blenlib.h" | #include "BLI_blenlib.h" | ||||
| #include "BLI_math_base.h" | #include "BLI_math_base.h" | ||||
| #include "gpu_backend.hh" | #include "gpu_backend.hh" | ||||
| #include "gpu_node_graph.h" | #include "gpu_node_graph.h" | ||||
| #include "GPU_material.h" | #include "GPU_material.h" | ||||
| #include "GPU_extensions.h" | |||||
| #include "GPU_uniform_buffer.h" | #include "GPU_uniform_buffer.h" | ||||
| #include "gpu_uniform_buffer_private.hh" | #include "gpu_uniform_buffer_private.hh" | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Creation & Deletion | /** \name Creation & Deletion | ||||
| * \{ */ | * \{ */ | ||||
| namespace blender::gpu { | namespace blender::gpu { | ||||
| UniformBuf::UniformBuf(size_t size, const char *name) | UniformBuf::UniformBuf(size_t size, const char *name) | ||||
| { | { | ||||
| /* Make sure that UBO is padded to size of vec4 */ | /* Make sure that UBO is padded to size of vec4 */ | ||||
| BLI_assert((size % 16) == 0); | BLI_assert((size % 16) == 0); | ||||
| BLI_assert(size <= GPU_max_ubo_size()); | |||||
| size_in_bytes_ = size; | size_in_bytes_ = size; | ||||
| BLI_strncpy(name_, name, sizeof(name_)); | BLI_strncpy(name_, name, sizeof(name_)); | ||||
| } | } | ||||
| UniformBuf::~UniformBuf() | UniformBuf::~UniformBuf() | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 198 Lines • Show Last 20 Lines | |||||