perf(post-processing): don't rebuild the pipeline on hover + temp paint debug logs
- post-processing: hoverHighlightMode was a dependency of the pipeline-build effect, so every hover rebuilt the entire pipeline. The hover style is already pushed to uniforms in a separate effect, so the rebuild was pure waste — removed it from the deps (and the build log). - selection-manager: temporary [paint-debug] logs for window/door hover to trace why their paint dispatch drops (to be removed once diagnosed). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
cebb29460d
commit
531dbb6e68
@@ -871,6 +871,14 @@ export const SelectionManager = () => {
|
|||||||
const activePaintMaterial = resolveActivePaintMaterial()
|
const activePaintMaterial = resolveActivePaintMaterial()
|
||||||
const node = event.node
|
const node = event.node
|
||||||
|
|
||||||
|
// TEMP paint debug
|
||||||
|
if (node.type === 'window' || node.type === 'door') {
|
||||||
|
// biome-ignore lint/suspicious/noConsole: temporary paint diagnostics
|
||||||
|
console.log('[paint-debug] event arrived', node.type, {
|
||||||
|
inLevel: isNodeInCurrentLevel(node),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
if (!isNodeInCurrentLevel(node)) return null
|
if (!isNodeInCurrentLevel(node)) return null
|
||||||
|
|
||||||
// The eraser clears a surface back to its default by painting with an
|
// The eraser clears a surface back to its default by painting with an
|
||||||
@@ -898,6 +906,18 @@ export const SelectionManager = () => {
|
|||||||
// roof / stair / single-surface arms below stay until they
|
// roof / stair / single-surface arms below stay until they
|
||||||
// migrate too.
|
// migrate too.
|
||||||
const paintCap = nodeRegistry.get(node.type)?.capabilities?.paint
|
const paintCap = nodeRegistry.get(node.type)?.capabilities?.paint
|
||||||
|
// TEMP paint debug
|
||||||
|
if (node.type === 'window' || node.type === 'door') {
|
||||||
|
const ho = getEventObject(event)
|
||||||
|
// biome-ignore lint/suspicious/noConsole: temporary paint diagnostics
|
||||||
|
console.log('[paint-debug] getPaintInteraction', node.type, {
|
||||||
|
hasPaintCap: !!paintCap,
|
||||||
|
hitObjName: ho?.name,
|
||||||
|
hitSlotId: (ho?.userData as { slotId?: string } | undefined)?.slotId,
|
||||||
|
eventObjName: event.nativeEvent.object?.name,
|
||||||
|
paintEnabled,
|
||||||
|
})
|
||||||
|
}
|
||||||
if (paintCap) {
|
if (paintCap) {
|
||||||
const materialIndex = getIntersectionMaterialIndex(getEventObject(event), event.faceIndex)
|
const materialIndex = getIntersectionMaterialIndex(getEventObject(event), event.faceIndex)
|
||||||
const role = paintCap.resolveRole({
|
const role = paintCap.resolveRole({
|
||||||
@@ -908,6 +928,10 @@ export const SelectionManager = () => {
|
|||||||
hitObjectName: event.nativeEvent.object?.name,
|
hitObjectName: event.nativeEvent.object?.name,
|
||||||
hitObject: getEventObject(event),
|
hitObject: getEventObject(event),
|
||||||
})
|
})
|
||||||
|
if (node.type === 'window' || node.type === 'door') {
|
||||||
|
// biome-ignore lint/suspicious/noConsole: temporary paint diagnostics
|
||||||
|
console.log('[paint-debug] resolved role', node.type, role)
|
||||||
|
}
|
||||||
const compatible = role !== null && paintEnabled
|
const compatible = role !== null && paintEnabled
|
||||||
return {
|
return {
|
||||||
key: `${node.type}:${node.id}:${role ?? 'unsupported'}:${eraser ? 'erase' : 'paint'}`,
|
key: `${node.type}:${node.id}:${role ?? 'unsupported'}:${eraser ? 'erase' : 'paint'}`,
|
||||||
|
|||||||
@@ -280,7 +280,6 @@ const PostProcessingPasses = ({
|
|||||||
denoise: denoiseEnabled,
|
denoise: denoiseEnabled,
|
||||||
outline: outlineEnabled,
|
outline: outlineEnabled,
|
||||||
perfDisable,
|
perfDisable,
|
||||||
hoverHighlightMode,
|
|
||||||
projectId,
|
projectId,
|
||||||
shading,
|
shading,
|
||||||
rendererCtor: (renderer as any).constructor?.name,
|
rendererCtor: (renderer as any).constructor?.name,
|
||||||
@@ -487,9 +486,12 @@ const PostProcessingPasses = ({
|
|||||||
renderPipelineRef.current = null
|
renderPipelineRef.current = null
|
||||||
}
|
}
|
||||||
}, [
|
}, [
|
||||||
|
// NOTE: hoverHighlightMode intentionally excluded — the hover style is
|
||||||
|
// pushed to uniforms in a separate effect, so a hover must NOT rebuild the
|
||||||
|
// whole pipeline. The uniform refs below are stable (useMemo), so they
|
||||||
|
// never trigger a rebuild either.
|
||||||
camera,
|
camera,
|
||||||
hoverHiddenColor,
|
hoverHiddenColor,
|
||||||
hoverHighlightMode,
|
|
||||||
hoverPulseMix,
|
hoverPulseMix,
|
||||||
hoverStrength,
|
hoverStrength,
|
||||||
hoverVisibleColor,
|
hoverVisibleColor,
|
||||||
|
|||||||
Reference in New Issue
Block a user