Cleanup: Clang-Tidy, modernize-redundant-void-arg
This commit is contained in:
@@ -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. */
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 { \
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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_);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
@@ -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_;
|
||||
}
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user