()
| 2687 | if ( |
| 2688 | allDirtyNodeIds.some( |
| 2689 | (candidate) => |
| 2690 | candidate !== nodeId && |
| 2691 | (candidate.startsWith(`${nodeId}.`) || |
| 2692 | candidate.startsWith(`${nodeId}[`)), |
| 2693 | ) |
| 2694 | ) { |
| 2695 | return null; |
| 2696 | } |
| 2697 | const previous = findSerializedNode(previousTree, nodeId); |
| 2698 | const next = findSerializedNode(nextTree, nodeId); |
| 2699 | const nodePatches = collectNodeShaderUniformPatches(previous, next); |
| 2700 | if (nodePatches === null) { |
| 2701 | return null; |
| 2702 | } |
| 2703 | patches.push(...nodePatches); |
| 2704 | } |
| 2705 | return patches; |
| 2706 | } |
| 2707 | |
| 2708 | function collectNodeShaderUniformPatches( |
| 2709 | previousValue: unknown, |
| 2710 | nextValue: unknown, |
| 2711 | ): NativeShaderUniformPatch[] | null { |
| 2712 | const previous = asRecord(previousValue); |
| 2713 | const next = asRecord(nextValue); |
| 2714 | if ( |
| 2715 | !previous || |
| 2716 | !next || |
| 2717 | previous.kind !== "ShaderEffect" || |
| 2718 | next.kind !== "ShaderEffect" || |
| 2719 | typeof previous.nodeId !== "string" || |
| 2720 | previous.nodeId !== next.nodeId |
| 2721 | ) { |
| 2722 | return null; |
| 2723 | } |
| 2724 | const previousProps = asRecord(previous.props); |
| 2725 | const nextProps = asRecord(next.props); |
| 2726 | if ( |
| 2727 | !previousProps || |
| 2728 | !nextProps || |
| 2729 | !recordsEqualExcept(previousProps, nextProps, "shader") |
| 2730 | ) { |
| 2731 | return null; |
| 2732 | } |
| 2733 | const previousShader = asRecord(previousProps.shader); |
| 2734 | const nextShader = asRecord(nextProps.shader); |
| 2735 | if ( |
| 2736 | !previousShader || |
| 2737 | !nextShader || |
| 2738 | !recordsEqualExcept(previousShader, nextShader, "pipeline") || |
| 2739 | !Array.isArray(previousShader.pipeline) || |
| 2740 | !Array.isArray(nextShader.pipeline) || |
| 2741 | previousShader.pipeline.length !== nextShader.pipeline.length |
| 2742 | ) { |
| 2743 | return null; |
| 2744 | } |
| 2745 | |
| 2746 | const patches: NativeShaderUniformPatch[] = []; |
no test coverage detected