Skip to content

Prevent shared RenderState mutation during face-cull flipping - #2918

Closed
riccardobl with Copilot wants to merge 2 commits into
masterfrom
copilot/fix-flipfacecull-issue
Closed

Prevent shared RenderState mutation during face-cull flipping#2918
riccardobl with Copilot wants to merge 2 commits into
masterfrom
copilot/fix-flipfacecull-issue

Conversation

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Mirrored geometry can require reversed face culling, but materials without additional render state currently alias shared technique or default RenderState instances. Flipping that alias permanently corrupts culling for other geometries.

  • Ownership-safe flipping
    • Copy aliased render state into the material-owned mergedRenderState before mutation.
    • Preserve existing behavior when the merged state is already owned.
  • Regression coverage
    • Verify mirrored geometry receives flipped culling while the shared technique state remains unchanged.
if (finalRenderState != mergedRenderState) {
    finalRenderState = mergedRenderState.copyFrom(finalRenderState);
}
finalRenderState.flipFaceCull();

Copilot AI changed the title [WIP] Fix FlipFaceCull corrupting shared RenderState for backward-normal geometry Prevent shared RenderState mutation during face-cull flipping Jul 27, 2026
Copilot AI requested a review from riccardobl July 27, 2026 08:07
@riccardobl riccardobl closed this Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FlipFaceCull corrupts shared RenderState for backward-normal geometry

2 participants