MCPcopy Create free account
hub / github.com/blender/cycles / TEST_F

Function TEST_F

src/test/render_graph_finalize_test.cpp:247–273  ·  view source on GitHub ↗

* Test deduplication of nodes that have inputs, some of them folded. */

Source from the content-addressed store, hash-verified

245 * Test deduplication of nodes that have inputs, some of them folded.
246 */
247TEST_F(RenderGraph, deduplicate_deep)
248{
249 builder.add_node(ShaderNodeBuilder<GeometryNode>(graph, "Geometry1"))
250 .add_node(ShaderNodeBuilder<GeometryNode>(graph, "Geometry2"))
251 .add_node(ShaderNodeBuilder<ValueNode>(graph, "Value1").set_param("value", 0.8f))
252 .add_node(ShaderNodeBuilder<ValueNode>(graph, "Value2").set_param("value", 0.8f))
253 .add_node(ShaderNodeBuilder<NoiseTextureNode>(graph, "Noise1"))
254 .add_node(ShaderNodeBuilder<NoiseTextureNode>(graph, "Noise2"))
255 .add_node(ShaderNodeBuilder<MixNode>(graph, "Mix")
256 .set_param("mix_type", NODE_MIX_BLEND)
257 .set("Fac", 0.5f))
258 .add_connection("Geometry1::Parametric", "Noise1::Vector")
259 .add_connection("Value1::Value", "Noise1::Scale")
260 .add_connection("Noise1::Color", "Mix::Color1")
261 .add_connection("Geometry2::Parametric", "Noise2::Vector")
262 .add_connection("Value2::Value", "Noise2::Scale")
263 .add_connection("Noise2::Color", "Mix::Color2")
264 .output_color("Mix::Color");
265
266 graph.finalize(scene.get());
267
268 EXPECT_EQ(graph.nodes.size(), 5);
269
270 log.correct_info_message("XFolding Value1::Value to constant (0.8).");
271 log.correct_info_message("Folding Value2::Value to constant (0.8).");
272 log.correct_info_message("Deduplicated 2 nodes.");
273}
274
275/*
276 * Test RGB to BW node.

Callers

nothing calls this directly

Calls 13

zero_float3Function · 0.85
one_float3Function · 0.85
init_test_curveFunction · 0.85
correct_info_messageMethod · 0.80
invalid_info_messageMethod · 0.80
make_float3Function · 0.50
add_nodeMethod · 0.45
setMethod · 0.45
finalizeMethod · 0.45

Tested by

no test coverage detected