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:
authorSybren A. Stüvel <sybren@blender.org>2020-11-06 19:49:09 +0300
committerSybren A. Stüvel <sybren@blender.org>2020-11-06 20:08:25 +0300
commit16732def37c5a66f3ea28dbe247b09cc6bca6677 (patch)
tree5d14f5c920a1411e336bd80b12becbb3f73de19a /source/blender/gpu/opengl/gl_batch.cc
parent88926375a0e4e45f72c87b9e487c060ddd3c9216 (diff)
Cleanup: Clang-Tidy modernize-use-nullptr
Replace `NULL` with `nullptr` in C++ code. No functional changes.
Diffstat (limited to 'source/blender/gpu/opengl/gl_batch.cc')
-rw-r--r--source/blender/gpu/opengl/gl_batch.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/gpu/opengl/gl_batch.cc b/source/blender/gpu/opengl/gl_batch.cc
index b81c2d69122..89486b73b05 100644
--- a/source/blender/gpu/opengl/gl_batch.cc
+++ b/source/blender/gpu/opengl/gl_batch.cc
@@ -62,11 +62,11 @@ GLVaoCache::~GLVaoCache()
void GLVaoCache::init()
{
- context_ = NULL;
- interface_ = NULL;
+ context_ = nullptr;
+ interface_ = nullptr;
is_dynamic_vao_count = false;
for (int i = 0; i < GPU_VAO_STATIC_LEN; i++) {
- static_vaos.interfaces[i] = NULL;
+ static_vaos.interfaces[i] = nullptr;
static_vaos.vao_ids[i] = 0;
}
vao_base_instance_ = 0;
@@ -93,7 +93,7 @@ void GLVaoCache::insert(const GLShaderInterface *interface, GLuint vao)
else {
/* Erase previous entries, they will be added back if drawn again. */
for (int i = 0; i < GPU_VAO_STATIC_LEN; i++) {
- if (static_vaos.interfaces[i] != NULL) {
+ if (static_vaos.interfaces[i] != nullptr) {
const_cast<GLShaderInterface *>(static_vaos.interfaces[i])->ref_remove(this);
context_->vao_free(static_vaos.vao_ids[i]);
}
@@ -143,7 +143,7 @@ void GLVaoCache::remove(const GLShaderInterface *interface)
if (interfaces[i] == interface) {
context_->vao_free(vaos[i]);
vaos[i] = 0;
- interfaces[i] = NULL;
+ interfaces[i] = nullptr;
break; /* cannot have duplicates */
}
}
@@ -157,7 +157,7 @@ void GLVaoCache::clear()
const GLShaderInterface **interfaces = (is_dynamic_vao_count) ? dynamic_vaos.interfaces :
static_vaos.interfaces;
/* Early out, nothing to free. */
- if (context_ == NULL) {
+ if (context_ == nullptr) {
return;
}
@@ -174,7 +174,7 @@ void GLVaoCache::clear()
}
for (int i = 0; i < count; i++) {
- if (interfaces[i] != NULL) {
+ if (interfaces[i] != nullptr) {
const_cast<GLShaderInterface *>(interfaces[i])->ref_remove(this);
}
}
@@ -213,7 +213,7 @@ void GLVaoCache::context_check()
BLI_assert(ctx);
if (context_ != ctx) {
- if (context_ != NULL) {
+ if (context_ != nullptr) {
/* IMPORTANT: Trying to draw a batch in multiple different context will trash the VAO cache.
* This has major performance impact and should be avoided in most cases. */
context_->vao_cache_unregister(this);
@@ -307,7 +307,7 @@ void GLBatch::bind(int i_first)
#if GPU_TRACK_INDEX_RANGE
/* Can be removed if GL 4.3 is required. */
- if (!GLContext::fixed_restart_index_support && (elem != NULL)) {
+ if (!GLContext::fixed_restart_index_support && (elem != nullptr)) {
glPrimitiveRestartIndex(this->elem_()->restart_index());
}
#endif