Tests: Simple automated sculpt brush stroke performance test

As an initial step to creating automated regression tests for sculpt brushes,
make our existing performance test script into an automated performance
test. The test uses the brush active in each file and runs the brush stroke
operator on a large generated grid. The time is just for the brush evaluation,
it doesn't include building the PBVH, drawing, etc.

I'm not sure about the consequences of conditionally disabling
`view3d_operator_needs_opengl`, but it was needed to make the test
work in background mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/123148
This commit is contained in:
Hans Goudey
2024-07-01 16:12:02 +02:00
committed by Hans Goudey
parent 057fdf4224
commit bec350ba6e
2 changed files with 159 additions and 1 deletions

View File

@@ -46,6 +46,7 @@
#include "BKE_colortools.hh"
#include "BKE_context.hh"
#include "BKE_customdata.hh"
#include "BKE_global.hh"
#include "BKE_image.h"
#include "BKE_key.hh"
#include "BKE_layer.hh"
@@ -5567,7 +5568,9 @@ static void sculpt_brush_stroke_init(bContext *C)
SculptSession &ss = *CTX_data_active_object(C)->sculpt;
const Brush *brush = BKE_paint_brush_for_read(&sd.paint);
view3d_operator_needs_opengl(C);
if (!G.background) {
view3d_operator_needs_opengl(C);
}
sculpt_brush_init_tex(sd, ss);
const bool needs_colors = SCULPT_tool_is_paint(brush->sculpt_tool) &&