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:
authorSergey Sharybin <sergey@blender.org>2020-11-06 15:18:48 +0300
committerSergey Sharybin <sergey@blender.org>2020-11-06 15:40:46 +0300
commita331d5c99299c4514ca33c843b1c79b872f2728d (patch)
treeb866b7f4b272365bf32f2cb248917932672b82d5 /source/blender/gpu/opengl
parent41db8f2fce1763c312a7fa47ed3aa338e6d77124 (diff)
Cleanup: Clang-Tidy, modernize-redundant-void-arg
Diffstat (limited to 'source/blender/gpu/opengl')
-rw-r--r--source/blender/gpu/opengl/gl_backend.cc10
-rw-r--r--source/blender/gpu/opengl/gl_batch.cc10
-rw-r--r--source/blender/gpu/opengl/gl_context.cc12
-rw-r--r--source/blender/gpu/opengl/gl_debug.cc4
-rw-r--r--source/blender/gpu/opengl/gl_debug_layer.cc2
-rw-r--r--source/blender/gpu/opengl/gl_drawlist.cc4
-rw-r--r--source/blender/gpu/opengl/gl_framebuffer.cc6
-rw-r--r--source/blender/gpu/opengl/gl_immediate.cc2
-rw-r--r--source/blender/gpu/opengl/gl_index_buffer.cc2
-rw-r--r--source/blender/gpu/opengl/gl_query.cc4
-rw-r--r--source/blender/gpu/opengl/gl_shader.cc12
-rw-r--r--source/blender/gpu/opengl/gl_state.cc18
-rw-r--r--source/blender/gpu/opengl/gl_texture.cc16
-rw-r--r--source/blender/gpu/opengl/gl_uniform_buffer.cc4
-rw-r--r--source/blender/gpu/opengl/gl_vertex_buffer.cc10
15 files changed, 58 insertions, 58 deletions
diff --git a/source/blender/gpu/opengl/gl_backend.cc b/source/blender/gpu/opengl/gl_backend.cc
index 46e048d7f7c..b444bd1859d 100644
--- a/source/blender/gpu/opengl/gl_backend.cc
+++ b/source/blender/gpu/opengl/gl_backend.cc
@@ -38,7 +38,7 @@ namespace blender::gpu {
/** \name Platform
* \{ */
-void GLBackend::platform_init(void)
+void GLBackend::platform_init()
{
BLI_assert(!GPG.initialized);
GPG.initialized = true;
@@ -135,7 +135,7 @@ void GLBackend::platform_init(void)
GPG.create_gpu_name(vendor, renderer, version);
}
-void GLBackend::platform_exit(void)
+void GLBackend::platform_exit()
{
BLI_assert(GPG.initialized);
GPG.clear();
@@ -147,7 +147,7 @@ void GLBackend::platform_exit(void)
/** \name Capabilities
* \{ */
-static bool detect_mip_render_workaround(void)
+static bool detect_mip_render_workaround()
{
int cube_size = 2;
float clear_color[4] = {1.0f, 0.5f, 0.0f, 0.0f};
@@ -192,7 +192,7 @@ static bool detect_mip_render_workaround(void)
return enable_workaround;
}
-static void detect_workarounds(void)
+static void detect_workarounds()
{
const char *vendor = (const char *)glGetString(GL_VENDOR);
const char *renderer = (const char *)glGetString(GL_RENDERER);
@@ -376,7 +376,7 @@ bool GLContext::debug_layer_workaround = false;
bool GLContext::unused_fb_slot_workaround = false;
float GLContext::derivative_signs[2] = {1.0f, 1.0f};
-void GLBackend::capabilities_init(void)
+void GLBackend::capabilities_init()
{
BLI_assert(GLEW_VERSION_3_3);
/* Common Capabilities. */
diff --git a/source/blender/gpu/opengl/gl_batch.cc b/source/blender/gpu/opengl/gl_batch.cc
index 6f36f128d18..b81c2d69122 100644
--- a/source/blender/gpu/opengl/gl_batch.cc
+++ b/source/blender/gpu/opengl/gl_batch.cc
@@ -50,7 +50,7 @@ using namespace blender::gpu;
* TODO(fclem): Could be revisited to avoid so much cross references.
* \{ */
-GLVaoCache::GLVaoCache(void)
+GLVaoCache::GLVaoCache()
{
init();
}
@@ -60,7 +60,7 @@ GLVaoCache::~GLVaoCache()
this->clear();
}
-void GLVaoCache::init(void)
+void GLVaoCache::init()
{
context_ = NULL;
interface_ = NULL;
@@ -149,7 +149,7 @@ void GLVaoCache::remove(const GLShaderInterface *interface)
}
}
-void GLVaoCache::clear(void)
+void GLVaoCache::clear()
{
GLContext *ctx = GLContext::get();
const int count = (is_dynamic_vao_count) ? dynamic_vaos.count : GPU_VAO_STATIC_LEN;
@@ -207,7 +207,7 @@ GLuint GLVaoCache::lookup(const GLShaderInterface *interface)
/* The GLVaoCache object is only valid for one GLContext.
* Reset the cache if trying to draw in another context; */
-void GLVaoCache::context_check(void)
+void GLVaoCache::context_check()
{
GLContext *ctx = GLContext::get();
BLI_assert(ctx);
@@ -282,7 +282,7 @@ GLuint GLVaoCache::vao_get(GPUBatch *batch)
/** \name Creation & Deletion
* \{ */
-GLBatch::GLBatch(void)
+GLBatch::GLBatch()
{
}
diff --git a/source/blender/gpu/opengl/gl_context.cc b/source/blender/gpu/opengl/gl_context.cc
index 9c98953f469..d766e6f0828 100644
--- a/source/blender/gpu/opengl/gl_context.cc
+++ b/source/blender/gpu/opengl/gl_context.cc
@@ -121,7 +121,7 @@ GLContext::~GLContext()
/** \name Activate / Deactivate context
* \{ */
-void GLContext::activate(void)
+void GLContext::activate()
{
/* Make sure no other context is already bound to this thread. */
BLI_assert(is_active_ == false);
@@ -160,7 +160,7 @@ void GLContext::activate(void)
immActivate();
}
-void GLContext::deactivate(void)
+void GLContext::deactivate()
{
immDeactivate();
is_active_ = false;
@@ -172,12 +172,12 @@ void GLContext::deactivate(void)
/** \name Flush, Finish & sync
* \{ */
-void GLContext::flush(void)
+void GLContext::flush()
{
glFlush();
}
-void GLContext::finish(void)
+void GLContext::finish()
{
glFinish();
}
@@ -191,7 +191,7 @@ void GLContext::finish(void)
* In this case we delay the deletion until the context is bound again.
* \{ */
-void GLSharedOrphanLists::orphans_clear(void)
+void GLSharedOrphanLists::orphans_clear()
{
/* Check if any context is active on this thread! */
BLI_assert(GLContext::get());
@@ -208,7 +208,7 @@ void GLSharedOrphanLists::orphans_clear(void)
lists_mutex.unlock();
};
-void GLContext::orphans_clear(void)
+void GLContext::orphans_clear()
{
/* Check if context has been activated by another thread! */
BLI_assert(this->is_active_on_thread());
diff --git a/source/blender/gpu/opengl/gl_debug.cc b/source/blender/gpu/opengl/gl_debug.cc
index 5564cbbabae..3737321ed90 100644
--- a/source/blender/gpu/opengl/gl_debug.cc
+++ b/source/blender/gpu/opengl/gl_debug.cc
@@ -141,7 +141,7 @@ static void APIENTRY debug_callback(GLenum UNUSED(source),
#undef APIENTRY
/* This function needs to be called once per context. */
-void init_gl_callbacks(void)
+void init_gl_callbacks()
{
CLOG_ENSURE(&LOG);
@@ -369,7 +369,7 @@ void GLContext::debug_group_begin(const char *name, int index)
}
}
-void GLContext::debug_group_end(void)
+void GLContext::debug_group_end()
{
if ((G.debug & G_DEBUG_GPU) && (GLEW_VERSION_4_3 || GLEW_KHR_debug)) {
glPopDebugGroup();
diff --git a/source/blender/gpu/opengl/gl_debug_layer.cc b/source/blender/gpu/opengl/gl_debug_layer.cc
index a4dc4679b7e..188083b0f50 100644
--- a/source/blender/gpu/opengl/gl_debug_layer.cc
+++ b/source/blender/gpu/opengl/gl_debug_layer.cc
@@ -108,7 +108,7 @@ DEBUG_FUNC_DECLARE(PFNGLUSEPROGRAMPROC, void, glUseProgram, GLuint, program);
/* Init a fallback layer (to KHR_debug) that covers only some functions.
* We override the functions pointers by our own implementation that just checks glGetError.
* Some additional functions (not overridable) are covered inside the header using wrappers. */
-void init_debug_layer(void)
+void init_debug_layer()
{
#define DEBUG_WRAP(function) \
do { \
diff --git a/source/blender/gpu/opengl/gl_drawlist.cc b/source/blender/gpu/opengl/gl_drawlist.cc
index 990e1a8014b..b0a8af5b482 100644
--- a/source/blender/gpu/opengl/gl_drawlist.cc
+++ b/source/blender/gpu/opengl/gl_drawlist.cc
@@ -88,7 +88,7 @@ GLDrawList::~GLDrawList()
GLContext::buf_free(buffer_id_);
}
-void GLDrawList::init(void)
+void GLDrawList::init()
{
BLI_assert(GLContext::get());
BLI_assert(MDI_ENABLED);
@@ -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;
diff --git a/source/blender/gpu/opengl/gl_framebuffer.cc b/source/blender/gpu/opengl/gl_framebuffer.cc
index a180aa270b0..661b976771f 100644
--- a/source/blender/gpu/opengl/gl_framebuffer.cc
+++ b/source/blender/gpu/opengl/gl_framebuffer.cc
@@ -92,7 +92,7 @@ GLFrameBuffer::~GLFrameBuffer()
}
}
-void GLFrameBuffer::init(void)
+void GLFrameBuffer::init()
{
context_ = GLContext::get();
state_manager_ = static_cast<GLStateManager *>(context_->state_manager);
@@ -154,7 +154,7 @@ bool GLFrameBuffer::check(char err_out[256])
return false;
}
-void GLFrameBuffer::update_attachments(void)
+void GLFrameBuffer::update_attachments()
{
/* Default frame-buffers cannot have attachments. */
BLI_assert(immutable_ == false);
@@ -236,7 +236,7 @@ void GLFrameBuffer::update_attachments(void)
}
}
-void GLFrameBuffer::apply_state(void)
+void GLFrameBuffer::apply_state()
{
if (dirty_state_ == false) {
return;
diff --git a/source/blender/gpu/opengl/gl_immediate.cc b/source/blender/gpu/opengl/gl_immediate.cc
index b71f8766dbb..4350902de73 100644
--- a/source/blender/gpu/opengl/gl_immediate.cc
+++ b/source/blender/gpu/opengl/gl_immediate.cc
@@ -135,7 +135,7 @@ uchar *GLImmediate::begin()
return (uchar *)data;
}
-void GLImmediate::end(void)
+void GLImmediate::end()
{
BLI_assert(prim_type != GPU_PRIM_NONE); /* make sure we're between a Begin/End pair */
diff --git a/source/blender/gpu/opengl/gl_index_buffer.cc b/source/blender/gpu/opengl/gl_index_buffer.cc
index 0096a9a500f..e2c18c5d0b9 100644
--- a/source/blender/gpu/opengl/gl_index_buffer.cc
+++ b/source/blender/gpu/opengl/gl_index_buffer.cc
@@ -33,7 +33,7 @@ GLIndexBuf::~GLIndexBuf()
GLContext::buf_free(ibo_id_);
}
-void GLIndexBuf::bind(void)
+void GLIndexBuf::bind()
{
if (is_subrange_) {
static_cast<GLIndexBuf *>(src_)->bind();
diff --git a/source/blender/gpu/opengl/gl_query.cc b/source/blender/gpu/opengl/gl_query.cc
index 6da5cacfcb2..8a42719c665 100644
--- a/source/blender/gpu/opengl/gl_query.cc
+++ b/source/blender/gpu/opengl/gl_query.cc
@@ -48,7 +48,7 @@ void GLQueryPool::reset(GPUQueryType type)
}
#endif
-void GLQueryPool::begin_query(void)
+void GLQueryPool::begin_query()
{
/* TODO add assert about expected usage. */
while (query_issued_ >= query_ids_.size()) {
@@ -59,7 +59,7 @@ void GLQueryPool::begin_query(void)
glBeginQuery(gl_type_, query_ids_[query_issued_++]);
}
-void GLQueryPool::end_query(void)
+void GLQueryPool::end_query()
{
/* TODO add assert about expected usage. */
glEndQuery(gl_type_);
diff --git a/source/blender/gpu/opengl/gl_shader.cc b/source/blender/gpu/opengl/gl_shader.cc
index 193e4ee8a70..57b9cac3f83 100644
--- a/source/blender/gpu/opengl/gl_shader.cc
+++ b/source/blender/gpu/opengl/gl_shader.cc
@@ -53,7 +53,7 @@ GLShader::GLShader(const char *name) : Shader(name)
debug::object_label(GL_PROGRAM, shader_program_, name);
}
-GLShader::~GLShader(void)
+GLShader::~GLShader()
{
#if 0 /* Would be nice to have, but for now the Deferred compilation \
* does not have a GPUContext. */
@@ -72,7 +72,7 @@ GLShader::~GLShader(void)
/** \name Shader stage creation
* \{ */
-char *GLShader::glsl_patch_get(void)
+char *GLShader::glsl_patch_get()
{
/** Used for shader patching. Init once. */
static char patch[512] = "\0";
@@ -172,7 +172,7 @@ void GLShader::fragment_shader_from_glsl(MutableSpan<const char *> sources)
frag_shader_ = this->create_shader_stage(GL_FRAGMENT_SHADER, sources);
}
-bool GLShader::finalize(void)
+bool GLShader::finalize()
{
if (compilation_failed_) {
return false;
@@ -201,13 +201,13 @@ bool GLShader::finalize(void)
/** \name Binding
* \{ */
-void GLShader::bind(void)
+void GLShader::bind()
{
BLI_assert(shader_program_ != 0);
glUseProgram(shader_program_);
}
-void GLShader::unbind(void)
+void GLShader::unbind()
{
#ifndef NDEBUG
glUseProgram(0);
@@ -259,7 +259,7 @@ bool GLShader::transform_feedback_enable(GPUVertBuf *buf_)
return true;
}
-void GLShader::transform_feedback_disable(void)
+void GLShader::transform_feedback_disable()
{
glEndTransformFeedback();
}
diff --git a/source/blender/gpu/opengl/gl_state.cc b/source/blender/gpu/opengl/gl_state.cc
index 8f2e0e2a72d..c5b5dd3efd2 100644
--- a/source/blender/gpu/opengl/gl_state.cc
+++ b/source/blender/gpu/opengl/gl_state.cc
@@ -42,7 +42,7 @@ namespace blender::gpu {
/** \name GLStateManager
* \{ */
-GLStateManager::GLStateManager(void)
+GLStateManager::GLStateManager()
{
/* Set other states that never change. */
glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
@@ -71,7 +71,7 @@ GLStateManager::GLStateManager(void)
set_mutable_state(mutable_state);
}
-void GLStateManager::apply_state(void)
+void GLStateManager::apply_state()
{
if (!this->use_bgl) {
this->set_state(this->state);
@@ -84,7 +84,7 @@ void GLStateManager::apply_state(void)
};
/* Will set all the states regardless of the current ones. */
-void GLStateManager::force_state(void)
+void GLStateManager::force_state()
{
/* Little exception for clip distances since they need to keep the old count correct. */
uint32_t clip_distances = current_.clip_distances;
@@ -511,7 +511,7 @@ void GLStateManager::texture_unbind(Texture *tex_)
tex->is_bound_ = false;
}
-void GLStateManager::texture_unbind_all(void)
+void GLStateManager::texture_unbind_all()
{
for (int i = 0; i < ARRAY_SIZE(textures_); i++) {
if (textures_[i] != 0) {
@@ -523,7 +523,7 @@ void GLStateManager::texture_unbind_all(void)
this->texture_bind_apply();
}
-void GLStateManager::texture_bind_apply(void)
+void GLStateManager::texture_bind_apply()
{
if (dirty_texture_binds_ == 0) {
return;
@@ -555,7 +555,7 @@ void GLStateManager::texture_unpack_row_length_set(uint len)
glPixelStorei(GL_UNPACK_ROW_LENGTH, len);
}
-uint64_t GLStateManager::bound_texture_slots(void)
+uint64_t GLStateManager::bound_texture_slots()
{
uint64_t bound_slots = 0;
for (int i = 0; i < ARRAY_SIZE(textures_); i++) {
@@ -603,7 +603,7 @@ void GLStateManager::image_unbind(Texture *tex_)
tex->is_bound_ = false;
}
-void GLStateManager::image_unbind_all(void)
+void GLStateManager::image_unbind_all()
{
for (int i = 0; i < ARRAY_SIZE(images_); i++) {
if (images_[i] != 0) {
@@ -614,7 +614,7 @@ void GLStateManager::image_unbind_all(void)
this->image_bind_apply();
}
-void GLStateManager::image_bind_apply(void)
+void GLStateManager::image_bind_apply()
{
if (dirty_image_binds_ == 0) {
return;
@@ -638,7 +638,7 @@ void GLStateManager::image_bind_apply(void)
}
}
-uint8_t GLStateManager::bound_image_slots(void)
+uint8_t GLStateManager::bound_image_slots()
{
uint8_t bound_slots = 0;
for (int i = 0; i < ARRAY_SIZE(images_); i++) {
diff --git a/source/blender/gpu/opengl/gl_texture.cc b/source/blender/gpu/opengl/gl_texture.cc
index 070a86509ff..993bb56612c 100644
--- a/source/blender/gpu/opengl/gl_texture.cc
+++ b/source/blender/gpu/opengl/gl_texture.cc
@@ -63,7 +63,7 @@ GLTexture::~GLTexture()
}
/* Return true on success. */
-bool GLTexture::init_internal(void)
+bool GLTexture::init_internal()
{
if ((format_ == GPU_DEPTH24_STENCIL8) && GPU_depth_blitting_workaround()) {
/* MacOS + Radeon Pro fails to blit depth on GPU_DEPTH24_STENCIL8
@@ -294,7 +294,7 @@ void GLTexture::update_sub(
* WARNING: Depth textures are not populated but they have their mips correctly defined.
* WARNING: This resets the mipmap range.
*/
-void GLTexture::generate_mipmap(void)
+void GLTexture::generate_mipmap()
{
this->ensure_mipmaps(9999);
/* Some drivers have bugs when using glGenerateMipmap with depth textures (see T56789).
@@ -440,7 +440,7 @@ void GLTexture::mip_range_set(int min, int max)
}
}
-struct GPUFrameBuffer *GLTexture::framebuffer_get(void)
+struct GPUFrameBuffer *GLTexture::framebuffer_get()
{
if (framebuffer_) {
return framebuffer_;
@@ -461,7 +461,7 @@ struct GPUFrameBuffer *GLTexture::framebuffer_get(void)
GLuint GLTexture::samplers_[GPU_SAMPLER_MAX] = {0};
-void GLTexture::samplers_init(void)
+void GLTexture::samplers_init()
{
glGenSamplers(GPU_SAMPLER_MAX, samplers_);
for (int i = 0; i <= GPU_SAMPLER_ICON - 1; i++) {
@@ -517,7 +517,7 @@ void GLTexture::samplers_init(void)
debug::object_label(GL_SAMPLER, icon_sampler, "icons");
}
-void GLTexture::samplers_update(void)
+void GLTexture::samplers_update()
{
if (!GLContext::texture_filter_anisotropic_support) {
return;
@@ -536,7 +536,7 @@ void GLTexture::samplers_update(void)
}
}
-void GLTexture::samplers_free(void)
+void GLTexture::samplers_free()
{
glDeleteSamplers(GPU_SAMPLER_MAX, samplers_);
}
@@ -649,7 +649,7 @@ bool GLTexture::proxy_check(int mip)
/** \} */
-void GLTexture::check_feedback_loop(void)
+void GLTexture::check_feedback_loop()
{
/* Recursive down sample workaround break this check.
* See #recursive_downsample() for more information. */
@@ -679,7 +679,7 @@ void GLTexture::check_feedback_loop(void)
}
/* TODO(fclem): Legacy. Should be removed at some point. */
-uint GLTexture::gl_bindcode_get(void) const
+uint GLTexture::gl_bindcode_get() const
{
return tex_id_;
}
diff --git a/source/blender/gpu/opengl/gl_uniform_buffer.cc b/source/blender/gpu/opengl/gl_uniform_buffer.cc
index e6aaddf75d3..7f404880092 100644
--- a/source/blender/gpu/opengl/gl_uniform_buffer.cc
+++ b/source/blender/gpu/opengl/gl_uniform_buffer.cc
@@ -55,7 +55,7 @@ GLUniformBuf::~GLUniformBuf()
/** \name Data upload / update
* \{ */
-void GLUniformBuf::init(void)
+void GLUniformBuf::init()
{
BLI_assert(GLContext::get());
@@ -111,7 +111,7 @@ void GLUniformBuf::bind(int slot)
#endif
}
-void GLUniformBuf::unbind(void)
+void GLUniformBuf::unbind()
{
#ifdef DEBUG
/* NOTE: This only unbinds the last bound slot. */
diff --git a/source/blender/gpu/opengl/gl_vertex_buffer.cc b/source/blender/gpu/opengl/gl_vertex_buffer.cc
index c6efe577e15..74640162a0b 100644
--- a/source/blender/gpu/opengl/gl_vertex_buffer.cc
+++ b/source/blender/gpu/opengl/gl_vertex_buffer.cc
@@ -27,19 +27,19 @@
namespace blender::gpu {
-void GLVertBuf::acquire_data(void)
+void GLVertBuf::acquire_data()
{
/* Discard previous data if any. */
MEM_SAFE_FREE(data);
data = (uchar *)MEM_mallocN(sizeof(uchar) * this->size_alloc_get(), __func__);
}
-void GLVertBuf::resize_data(void)
+void GLVertBuf::resize_data()
{
data = (uchar *)MEM_reallocN(data, sizeof(uchar) * this->size_alloc_get());
}
-void GLVertBuf::release_data(void)
+void GLVertBuf::release_data()
{
if (vbo_id_ != 0) {
GLContext::buf_free(vbo_id_);
@@ -75,12 +75,12 @@ void GLVertBuf::duplicate_data(VertBuf *dst_)
}
}
-void GLVertBuf::upload_data(void)
+void GLVertBuf::upload_data()
{
this->bind();
}
-void GLVertBuf::bind(void)
+void GLVertBuf::bind()
{
BLI_assert(GLContext::get() != NULL);