Blender V4.3
render_graph_finalize_test.cpp File Reference
#include "testing/mock_log.h"
#include "testing/testing.h"
#include "device/device.h"
#include "scene/colorspace.h"
#include "scene/scene.h"
#include "scene/shader_graph.h"
#include "scene/shader_nodes.h"
#include "util/array.h"
#include "util/log.h"
#include "util/stats.h"
#include "util/string.h"
#include "util/vector.h"

Go to the source code of this file.

Classes

class  CCL_NAMESPACE_BEGIN::ShaderNodeBuilder< T >
 
class  CCL_NAMESPACE_BEGIN::ShaderGraphBuilder
 
class  RenderGraph
 

Namespaces

namespace  CCL_NAMESPACE_BEGIN
 

Macros

#define EXPECT_ANY_MESSAGE(log)   EXPECT_CALL(log, Log(_, _, _)).Times(AnyNumber());
 
#define CORRECT_INFO_MESSAGE(log, message)    EXPECT_CALL(log, Log(google::INFO, _, HasSubstr(message)));
 
#define INVALID_INFO_MESSAGE(log, message)    EXPECT_CALL(log, Log(google::INFO, _, HasSubstr(message))).Times(0);
 

Functions

 TEST_F (RenderGraph, deduplicate_deep)
 
 TEST_F (RenderGraph, constant_fold_rgb_to_bw)
 
 TEST_F (RenderGraph, constant_fold_emission1)
 
 TEST_F (RenderGraph, constant_fold_emission2)
 
 TEST_F (RenderGraph, constant_fold_background1)
 
 TEST_F (RenderGraph, constant_fold_background2)
 
 TEST_F (RenderGraph, constant_fold_shader_add)
 
 TEST_F (RenderGraph, constant_fold_shader_mix)
 
 TEST_F (RenderGraph, constant_fold_invert)
 
 TEST_F (RenderGraph, constant_fold_invert_fac_0)
 
 TEST_F (RenderGraph, constant_fold_invert_fac_0_const)
 
 TEST_F (RenderGraph, constant_fold_mix_add)
 
 TEST_F (RenderGraph, constant_fold_mix_add_clamp)
 
 TEST_F (RenderGraph, constant_fold_part_mix_dodge_no_fac_0)
 
 TEST_F (RenderGraph, constant_fold_part_mix_light_no_fac_0)
 
 TEST_F (RenderGraph, constant_fold_part_mix_burn_no_fac_0)
 
 TEST_F (RenderGraph, constant_fold_part_mix_blend_clamped_no_fac_0)
 
 TEST_F (RenderGraph, constant_fold_part_mix_blend)
 
 TEST_F (RenderGraph, constant_fold_part_mix_sub_same_fac_bad)
 
 TEST_F (RenderGraph, constant_fold_part_mix_sub_same_fac_1)
 
static void build_mix_partial_test_graph (ShaderGraphBuilder &builder, NodeMix type, float3 constval)
 
 TEST_F (RenderGraph, constant_fold_part_mix_add_0)
 
 TEST_F (RenderGraph, constant_fold_part_mix_sub_0)
 
 TEST_F (RenderGraph, constant_fold_part_mix_mul_1)
 
 TEST_F (RenderGraph, constant_fold_part_mix_div_1)
 
 TEST_F (RenderGraph, constant_fold_part_mix_mul_0)
 
 TEST_F (RenderGraph, constant_fold_part_mix_div_0)
 
 TEST_F (RenderGraph, constant_fold_separate_combine_rgb)
 
 TEST_F (RenderGraph, constant_fold_separate_combine_xyz)
 
 TEST_F (RenderGraph, constant_fold_separate_combine_hsv)
 
 TEST_F (RenderGraph, constant_fold_gamma)
 
 TEST_F (RenderGraph, constant_fold_gamma_part_0)
 
 TEST_F (RenderGraph, constant_fold_gamma_part_1)
 
 TEST_F (RenderGraph, constant_fold_bright_contrast)
 
 TEST_F (RenderGraph, constant_fold_blackbody)
 
 TEST_F (RenderGraph, constant_fold_math)
 
 TEST_F (RenderGraph, constant_fold_math_clamp)
 
static void build_math_partial_test_graph (ShaderGraphBuilder &builder, NodeMathType type, float constval)
 
 TEST_F (RenderGraph, constant_fold_part_math_add_0)
 
 TEST_F (RenderGraph, constant_fold_part_math_sub_0)
 
 TEST_F (RenderGraph, constant_fold_part_math_mul_1)
 
 TEST_F (RenderGraph, constant_fold_part_math_div_1)
 
 TEST_F (RenderGraph, constant_fold_part_math_mul_0)
 
 TEST_F (RenderGraph, constant_fold_part_math_div_0)
 
 TEST_F (RenderGraph, constant_fold_part_math_pow_0)
 
 TEST_F (RenderGraph, constant_fold_part_math_pow_1)
 
 TEST_F (RenderGraph, constant_fold_vector_math)
 
static void build_vecmath_partial_test_graph (ShaderGraphBuilder &builder, NodeVectorMathType type, float3 constval)
 
 TEST_F (RenderGraph, constant_fold_part_vecmath_add_0)
 
 TEST_F (RenderGraph, constant_fold_part_vecmath_sub_0)
 
 TEST_F (RenderGraph, constant_fold_part_vecmath_cross_0)
 
 TEST_F (RenderGraph, constant_fold_bump)
 
 TEST_F (RenderGraph, constant_fold_bump_no_input)
 
template<class T >
void init_test_curve (array< T > &buffer, T start, T end, int steps)
 
 TEST_F (RenderGraph, constant_fold_rgb_curves)
 
 TEST_F (RenderGraph, constant_fold_rgb_curves_fac_0)
 
 TEST_F (RenderGraph, constant_fold_rgb_curves_fac_0_const)
 
 TEST_F (RenderGraph, constant_fold_vector_curves)
 
 TEST_F (RenderGraph, constant_fold_vector_curves_fac_0)
 
 TEST_F (RenderGraph, constant_fold_rgb_ramp)
 
 TEST_F (RenderGraph, constant_fold_rgb_ramp_flat)
 
 TEST_F (RenderGraph, constant_fold_convert_float_color_float)
 
 TEST_F (RenderGraph, constant_fold_convert_color_vector_color)
 
 TEST_F (RenderGraph, constant_fold_convert_color_float_color)
 

Macro Definition Documentation

◆ CORRECT_INFO_MESSAGE

◆ EXPECT_ANY_MESSAGE

◆ INVALID_INFO_MESSAGE

#define INVALID_INFO_MESSAGE ( log,
message )    EXPECT_CALL(log, Log(google::INFO, _, HasSubstr(message))).Times(0);

Function Documentation

◆ build_math_partial_test_graph()

static void build_math_partial_test_graph ( ShaderGraphBuilder & builder,
NodeMathType type,
float constval )
static

Definition at line 1021 of file render_graph_finalize_test.cpp.

References NODE_MATH_ADD.

Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().

◆ build_mix_partial_test_graph()

static void build_mix_partial_test_graph ( ShaderGraphBuilder & builder,
NodeMix type,
float3 constval )
static

Definition at line 630 of file render_graph_finalize_test.cpp.

References NODE_MIX_ADD.

Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().

◆ build_vecmath_partial_test_graph()

static void build_vecmath_partial_test_graph ( ShaderGraphBuilder & builder,
NodeVectorMathType type,
float3 constval )
static

Definition at line 1191 of file render_graph_finalize_test.cpp.

References NODE_VECTOR_MATH_ADD.

Referenced by TEST_F(), TEST_F(), and TEST_F().

◆ init_test_curve()

template<class T >
void init_test_curve ( array< T > & buffer,
T start,
T end,
int steps )

◆ TEST_F() [1/60]

TEST_F ( RenderGraph ,
constant_fold_background1  )

◆ TEST_F() [2/60]

TEST_F ( RenderGraph ,
constant_fold_background2  )

Definition at line 296 of file render_graph_finalize_test.cpp.

References CORRECT_INFO_MESSAGE, EXPECT_ANY_MESSAGE, log(), and set().

◆ TEST_F() [3/60]

TEST_F ( RenderGraph ,
constant_fold_blackbody  )

Definition at line 960 of file render_graph_finalize_test.cpp.

References CORRECT_INFO_MESSAGE, EXPECT_ANY_MESSAGE, log(), and set().

◆ TEST_F() [4/60]

TEST_F ( RenderGraph ,
constant_fold_bright_contrast  )

◆ TEST_F() [5/60]

TEST_F ( RenderGraph ,
constant_fold_bump  )

Definition at line 1264 of file render_graph_finalize_test.cpp.

References CORRECT_INFO_MESSAGE, EXPECT_ANY_MESSAGE, and log().

◆ TEST_F() [6/60]

TEST_F ( RenderGraph ,
constant_fold_bump_no_input  )

Definition at line 1280 of file render_graph_finalize_test.cpp.

References CORRECT_INFO_MESSAGE, EXPECT_ANY_MESSAGE, and log().

◆ TEST_F() [7/60]

TEST_F ( RenderGraph ,
constant_fold_convert_color_float_color  )

◆ TEST_F() [8/60]

TEST_F ( RenderGraph ,
constant_fold_convert_color_vector_color  )

◆ TEST_F() [9/60]

TEST_F ( RenderGraph ,
constant_fold_convert_float_color_float  )

◆ TEST_F() [10/60]

TEST_F ( RenderGraph ,
constant_fold_emission1  )

◆ TEST_F() [11/60]

TEST_F ( RenderGraph ,
constant_fold_emission2  )

Definition at line 269 of file render_graph_finalize_test.cpp.

References CORRECT_INFO_MESSAGE, EXPECT_ANY_MESSAGE, log(), and set().

◆ TEST_F() [12/60]

TEST_F ( RenderGraph ,
constant_fold_gamma  )

◆ TEST_F() [13/60]

TEST_F ( RenderGraph ,
constant_fold_gamma_part_0  )

◆ TEST_F() [14/60]

TEST_F ( RenderGraph ,
constant_fold_gamma_part_1  )

◆ TEST_F() [15/60]

TEST_F ( RenderGraph ,
constant_fold_invert  )

◆ TEST_F() [16/60]

TEST_F ( RenderGraph ,
constant_fold_invert_fac_0  )

Definition at line 383 of file render_graph_finalize_test.cpp.

References CORRECT_INFO_MESSAGE, EXPECT_ANY_MESSAGE, log(), and set().

◆ TEST_F() [17/60]

TEST_F ( RenderGraph ,
constant_fold_invert_fac_0_const  )

◆ TEST_F() [18/60]

TEST_F ( RenderGraph ,
constant_fold_math  )

◆ TEST_F() [19/60]

TEST_F ( RenderGraph ,
constant_fold_math_clamp  )

◆ TEST_F() [20/60]

TEST_F ( RenderGraph ,
constant_fold_mix_add  )

◆ TEST_F() [21/60]

TEST_F ( RenderGraph ,
constant_fold_mix_add_clamp  )

◆ TEST_F() [22/60]

TEST_F ( RenderGraph ,
constant_fold_part_math_add_0  )

◆ TEST_F() [23/60]

TEST_F ( RenderGraph ,
constant_fold_part_math_div_0  )

◆ TEST_F() [24/60]

TEST_F ( RenderGraph ,
constant_fold_part_math_div_1  )

◆ TEST_F() [25/60]

TEST_F ( RenderGraph ,
constant_fold_part_math_mul_0  )

◆ TEST_F() [26/60]

◆ TEST_F() [27/60]

TEST_F ( RenderGraph ,
constant_fold_part_math_pow_0  )

◆ TEST_F() [28/60]

TEST_F ( RenderGraph ,
constant_fold_part_math_pow_1  )

◆ TEST_F() [29/60]

◆ TEST_F() [30/60]

◆ TEST_F() [31/60]

TEST_F ( RenderGraph ,
constant_fold_part_mix_blend  )

◆ TEST_F() [32/60]

TEST_F ( RenderGraph ,
constant_fold_part_mix_blend_clamped_no_fac_0  )

◆ TEST_F() [33/60]

TEST_F ( RenderGraph ,
constant_fold_part_mix_burn_no_fac_0  )

◆ TEST_F() [34/60]

◆ TEST_F() [35/60]

◆ TEST_F() [36/60]

TEST_F ( RenderGraph ,
constant_fold_part_mix_dodge_no_fac_0  )

◆ TEST_F() [37/60]

TEST_F ( RenderGraph ,
constant_fold_part_mix_light_no_fac_0  )

◆ TEST_F() [38/60]

◆ TEST_F() [39/60]

◆ TEST_F() [40/60]

◆ TEST_F() [41/60]

TEST_F ( RenderGraph ,
constant_fold_part_mix_sub_same_fac_1  )

◆ TEST_F() [42/60]

TEST_F ( RenderGraph ,
constant_fold_part_mix_sub_same_fac_bad  )

◆ TEST_F() [43/60]

◆ TEST_F() [44/60]

◆ TEST_F() [45/60]

◆ TEST_F() [46/60]

TEST_F ( RenderGraph ,
constant_fold_rgb_curves  )

◆ TEST_F() [47/60]

TEST_F ( RenderGraph ,
constant_fold_rgb_curves_fac_0  )

◆ TEST_F() [48/60]

TEST_F ( RenderGraph ,
constant_fold_rgb_curves_fac_0_const  )

◆ TEST_F() [49/60]

TEST_F ( RenderGraph ,
constant_fold_rgb_ramp  )

◆ TEST_F() [50/60]

TEST_F ( RenderGraph ,
constant_fold_rgb_ramp_flat  )

◆ TEST_F() [51/60]

TEST_F ( RenderGraph ,
constant_fold_rgb_to_bw  )

◆ TEST_F() [52/60]

TEST_F ( RenderGraph ,
constant_fold_separate_combine_hsv  )

◆ TEST_F() [53/60]

TEST_F ( RenderGraph ,
constant_fold_separate_combine_rgb  )

◆ TEST_F() [54/60]

TEST_F ( RenderGraph ,
constant_fold_separate_combine_xyz  )

◆ TEST_F() [55/60]

TEST_F ( RenderGraph ,
constant_fold_shader_add  )

◆ TEST_F() [56/60]

TEST_F ( RenderGraph ,
constant_fold_shader_mix  )

Definition at line 336 of file render_graph_finalize_test.cpp.

References CORRECT_INFO_MESSAGE, EXPECT_ANY_MESSAGE, log(), and set().

◆ TEST_F() [57/60]

TEST_F ( RenderGraph ,
constant_fold_vector_curves  )

◆ TEST_F() [58/60]

TEST_F ( RenderGraph ,
constant_fold_vector_curves_fac_0  )

◆ TEST_F() [59/60]

TEST_F ( RenderGraph ,
constant_fold_vector_math  )

◆ TEST_F() [60/60]

TEST_F ( RenderGraph ,
deduplicate_deep  )