From 48abc09d8482da53a002aa2a51df2af1e1319741 Mon Sep 17 00:00:00 2001 From: Chris Blackbourn Date: Fri, 5 May 2023 23:44:56 +1200 Subject: [PATCH] Cleanup: format --- .../engines/eevee_next/eevee_cryptomatte.cc | 3 +-- .../draw/intern/draw_manager_profiling.cc | 3 +-- source/blender/gpu/intern/gpu_shader_log.cc | 3 +-- source/blender/gpu/metal/mtl_shader.mm | 15 ++++------- .../modifiers/intern/MOD_weightvg_util.cc | 26 ++++++++++--------- tests/python/bl_imbuf_load.py | 1 + 6 files changed, 23 insertions(+), 28 deletions(-) diff --git a/source/blender/draw/engines/eevee_next/eevee_cryptomatte.cc b/source/blender/draw/engines/eevee_next/eevee_cryptomatte.cc index 81d1f9ddb0e..bfa9d1a9a14 100644 --- a/source/blender/draw/engines/eevee_next/eevee_cryptomatte.cc +++ b/source/blender/draw/engines/eevee_next/eevee_cryptomatte.cc @@ -26,8 +26,7 @@ void Cryptomatte::begin_sync() session_.reset(BKE_cryptomatte_init_from_view_layer(inst_.view_layer)); for (const std::string &layer_name : - bke::cryptomatte::BKE_cryptomatte_layer_names_get(*session_)) - { + bke::cryptomatte::BKE_cryptomatte_layer_names_get(*session_)) { StringRef layer_name_ref = layer_name; bke::cryptomatte::CryptomatteLayer *layer = bke::cryptomatte::BKE_cryptomatte_layer_get( *session_, layer_name); diff --git a/source/blender/draw/intern/draw_manager_profiling.cc b/source/blender/draw/intern/draw_manager_profiling.cc index 1aa962c5d0a..a8314ff0f2f 100644 --- a/source/blender/draw/intern/draw_manager_profiling.cc +++ b/source/blender/draw/intern/draw_manager_profiling.cc @@ -300,8 +300,7 @@ void DRW_stats_draw(const rcti *rect) BLI_snprintf(stat_string, sizeof(stat_string), "GPU Memory"); draw_stat(rect, 0, v, stat_string, sizeof(stat_string)); - BLI_snprintf( - stat_string, sizeof(stat_string), "%.2fMB", double(tex_mem + vbo_mem) / 1000000.0); + BLI_snprintf(stat_string, sizeof(stat_string), "%.2fMB", double(tex_mem + vbo_mem) / 1000000.0); draw_stat_5row(rect, 1, v++, stat_string, sizeof(stat_string)); BLI_snprintf(stat_string, sizeof(stat_string), "Textures"); draw_stat(rect, 1, v, stat_string, sizeof(stat_string)); diff --git a/source/blender/gpu/intern/gpu_shader_log.cc b/source/blender/gpu/intern/gpu_shader_log.cc index 77a8209d6ed..ffd4c082995 100644 --- a/source/blender/gpu/intern/gpu_shader_log.cc +++ b/source/blender/gpu/intern/gpu_shader_log.cc @@ -240,8 +240,7 @@ void Shader::print_log(Span sources, CLG_Severity severity = error ? CLG_SEVERITY_ERROR : CLG_SEVERITY_WARN; if (((LOG.type->flag & CLG_FLAG_USE) && (LOG.type->level >= 0)) || - (severity >= CLG_SEVERITY_WARN)) - { + (severity >= CLG_SEVERITY_WARN)) { const char *_str = BLI_dynstr_get_cstring(dynstr); CLG_log_str(LOG.type, severity, this->name, stage, _str); MEM_freeN((void *)_str); diff --git a/source/blender/gpu/metal/mtl_shader.mm b/source/blender/gpu/metal/mtl_shader.mm index f96a2ab3da4..94c3ef22a5d 100644 --- a/source/blender/gpu/metal/mtl_shader.mm +++ b/source/blender/gpu/metal/mtl_shader.mm @@ -338,8 +338,7 @@ bool MTLShader::finalize(const shader::ShaderCreateInfo *info) if (error) { /* Only exit out if genuine error and not warning. */ if ([[error localizedDescription] rangeOfString:@"Compilation succeeded"].location == - NSNotFound) - { + NSNotFound) { const char *errors_c_str = [[error localizedDescription] UTF8String]; const char *sources_c_str = shd_builder_->glsl_fragment_source_.c_str(); @@ -878,8 +877,7 @@ MTLRenderPipelineStateInstance *MTLShader::bake_pipeline_state( } else { for (const uint i : - IndexRange(pipeline_descriptor.vertex_descriptor.max_attribute_value + 1)) - { + IndexRange(pipeline_descriptor.vertex_descriptor.max_attribute_value + 1)) { /* Metal back-end attribute descriptor state. */ const MTLVertexAttributeDescriptorPSO &attribute_desc = @@ -1072,8 +1070,7 @@ MTLRenderPipelineStateInstance *MTLShader::bake_pipeline_state( bool null_pointsize = true; float MTL_pointsize = pipeline_descriptor.point_size; if (pipeline_descriptor.vertex_descriptor.prim_topology_class == - MTLPrimitiveTopologyClassPoint) - { + MTLPrimitiveTopologyClassPoint) { /* `if pointsize is > 0.0`, PROGRAM_POINT_SIZE is enabled, and `gl_PointSize` shader keyword * overrides the value. Otherwise, if < 0.0, use global constant point size. */ if (MTL_pointsize < 0.0) { @@ -1145,8 +1142,7 @@ MTLRenderPipelineStateInstance *MTLShader::bake_pipeline_state( /* Setup pixel format state */ for (int color_attachment = 0; color_attachment < GPU_FB_MAX_COLOR_ATTACHMENT; - color_attachment++) - { + color_attachment++) { /* Fetch color attachment pixel format in back-end pipeline state. */ MTLPixelFormat pixel_format = pipeline_descriptor.color_attachment_format[color_attachment]; /* Populate MTL API PSO attachment descriptor. */ @@ -1387,8 +1383,7 @@ bool MTLShader::bake_compute_pipeline_state(MTLContext *ctx) /* Only exit out if genuine error and not warning */ if ([[error localizedDescription] rangeOfString:@"Compilation succeeded"].location == - NSNotFound) - { + NSNotFound) { BLI_assert(false); return false; } diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.cc b/source/blender/modifiers/intern/MOD_weightvg_util.cc index 5dfc38ee095..eccb3330e06 100644 --- a/source/blender/modifiers/intern/MOD_weightvg_util.cc +++ b/source/blender/modifiers/intern/MOD_weightvg_util.cc @@ -48,15 +48,15 @@ void weightvg_do_map( /* Return immediately, if we have nothing to do! */ /* Also security checks... */ - if (!do_invert && - (((falloff_type == MOD_WVG_MAPPING_CURVE) && (cmap == nullptr)) || !ELEM(falloff_type, - MOD_WVG_MAPPING_CURVE, - MOD_WVG_MAPPING_SHARP, - MOD_WVG_MAPPING_SMOOTH, - MOD_WVG_MAPPING_ROOT, - MOD_WVG_MAPPING_SPHERE, - MOD_WVG_MAPPING_RANDOM, - MOD_WVG_MAPPING_STEP))) + if (!do_invert && (((falloff_type == MOD_WVG_MAPPING_CURVE) && (cmap == nullptr)) || + !ELEM(falloff_type, + MOD_WVG_MAPPING_CURVE, + MOD_WVG_MAPPING_SHARP, + MOD_WVG_MAPPING_SMOOTH, + MOD_WVG_MAPPING_ROOT, + MOD_WVG_MAPPING_SPHERE, + MOD_WVG_MAPPING_RANDOM, + MOD_WVG_MAPPING_STEP))) { return; } @@ -283,8 +283,9 @@ void weightvg_update_vg(MDeformVert *dvert, for (i = 0; i < num; i++) { float w = weights[i]; MDeformVert *dv = &dvert[indices ? indices[i] : i]; - MDeformWeight *dw = dws ? dws[i] : - ((defgrp_idx >= 0) ? BKE_defvert_find_index(dv, defgrp_idx) : nullptr); + MDeformWeight *dw = dws ? + dws[i] : + ((defgrp_idx >= 0) ? BKE_defvert_find_index(dv, defgrp_idx) : nullptr); if (do_normalize) { w = (w - min_w) * norm_fac; @@ -320,7 +321,8 @@ void weightvg_ui_common(const bContext *C, PointerRNA *ob_ptr, PointerRNA *ptr, uiItemR(layout, ptr, "mask_constant", UI_ITEM_R_SLIDER, IFACE_("Global Influence:"), ICON_NONE); if (!has_mask_texture) { - modifier_vgroup_ui(layout, ptr, ob_ptr, "mask_vertex_group", "invert_mask_vertex_group", nullptr); + modifier_vgroup_ui( + layout, ptr, ob_ptr, "mask_vertex_group", "invert_mask_vertex_group", nullptr); } if (!has_mask_vertex_group) { diff --git a/tests/python/bl_imbuf_load.py b/tests/python/bl_imbuf_load.py index 3c53acddb33..da0e6cd2856 100644 --- a/tests/python/bl_imbuf_load.py +++ b/tests/python/bl_imbuf_load.py @@ -174,6 +174,7 @@ class ImBufBrokenTest(AbstractImBufTest): bpy.ops.image.open(filepath=str(image_path)) + class ImBufLoadBrokenTest(ImBufBrokenTest): def test_load_exr(self): self.skip_if_format_missing("OPENEXR")