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:
Diffstat (limited to 'source/blender/gpu/opengl/gl_drawlist.cc')
-rw-r--r--source/blender/gpu/opengl/gl_drawlist.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/gpu/opengl/gl_drawlist.cc b/source/blender/gpu/opengl/gl_drawlist.cc
index 990e1a8014b..aecadc4d14a 100644
--- a/source/blender/gpu/opengl/gl_drawlist.cc
+++ b/source/blender/gpu/opengl/gl_drawlist.cc
@@ -65,13 +65,13 @@ typedef struct GLDrawCommandIndexed {
GLDrawList::GLDrawList(int length)
{
BLI_assert(length > 0);
- batch_ = NULL;
+ batch_ = nullptr;
buffer_id_ = 0;
command_len_ = 0;
command_offset_ = 0;
data_offset_ = 0;
data_size_ = 0;
- data_ = NULL;
+ data_ = nullptr;
if (GLContext::multi_draw_indirect_support) {
/* Alloc the biggest possible command list, which is indexed. */
@@ -88,12 +88,12 @@ GLDrawList::~GLDrawList()
GLContext::buf_free(buffer_id_);
}
-void GLDrawList::init(void)
+void GLDrawList::init()
{
BLI_assert(GLContext::get());
BLI_assert(MDI_ENABLED);
- BLI_assert(data_ == NULL);
- batch_ = NULL;
+ BLI_assert(data_ == nullptr);
+ batch_ = nullptr;
command_len_ = 0;
if (buffer_id_ == 0) {
@@ -105,7 +105,7 @@ void GLDrawList::init(void)
glBindBuffer(GL_DRAW_INDIRECT_BUFFER, buffer_id_);
/* If buffer is full, orphan buffer data and start fresh. */
// if (command_offset_ >= data_size_) {
- glBufferData(GL_DRAW_INDIRECT_BUFFER, buffer_size_, NULL, GL_DYNAMIC_DRAW);
+ glBufferData(GL_DRAW_INDIRECT_BUFFER, buffer_size_, nullptr, GL_DYNAMIC_DRAW);
data_offset_ = 0;
// }
/* Map the remaining range. */
@@ -123,7 +123,7 @@ void GLDrawList::append(GPUBatch *gpu_batch, int i_first, int i_count)
return;
}
- if (data_ == NULL) {
+ if (data_ == nullptr) {
this->init();
}
@@ -169,7 +169,7 @@ void GLDrawList::append(GPUBatch *gpu_batch, int i_first, int i_count)
}
}
-void GLDrawList::submit(void)
+void GLDrawList::submit()
{
if (command_len_ == 0) {
return;
@@ -177,7 +177,7 @@ void GLDrawList::submit(void)
/* Something's wrong if we get here without MDI support. */
BLI_assert(MDI_ENABLED);
BLI_assert(data_);
- BLI_assert(GLContext::get()->shader != NULL);
+ BLI_assert(GLContext::get()->shader != nullptr);
/* Only do multi-draw indirect if doing more than 2 drawcall. This avoids the overhead of
* buffer mapping if scene is not very instance friendly. BUT we also need to take into
@@ -190,7 +190,7 @@ void GLDrawList::submit(void)
glBindBuffer(GL_DRAW_INDIRECT_BUFFER, buffer_id_);
glFlushMappedBufferRange(GL_DRAW_INDIRECT_BUFFER, 0, command_offset_);
glUnmapBuffer(GL_DRAW_INDIRECT_BUFFER);
- data_ = NULL; /* Unmapped */
+ data_ = nullptr; /* Unmapped */
data_offset_ += command_offset_;
batch_->bind(0);
@@ -227,7 +227,7 @@ void GLDrawList::submit(void)
/* Do not submit this buffer again. */
command_len_ = 0;
/* Avoid keeping reference to the batch. */
- batch_ = NULL;
+ batch_ = nullptr;
}
/** \} */