Skip to content

Editor: fallback effects draw the untessellated mesh - #3475

Merged
xen2 merged 2 commits into
stride3d:masterfrom
xen2:fix/tessellation-fallback
Sep 24, 2026
Merged

xen2 merged 2 commits into
stride3d:masterfrom
xen2:fix/tessellation-fallback

Conversation

@xen2

@xen2 xen2 commented Sep 23, 2026

Copy link
Copy Markdown
Member

PR details

Fixes the GPU hang reported on Discord when switching a material to tessellation in Game Studio ("The GPU device instance has been suspended", DriverInternalError).

While the new effect compiles, the editor draws with a fallback effect that has no hull shader, but the mesh has already switched to the tessellated patch list. That draw is invalid (D3D11 debug layer: "input topology is Patch Control Points... You need either a Hull Shader and Domain Shader") and hangs the driver on real hardware.

  • MeshRenderFeature: a render node whose effect is compiling or errored draws the original mesh instead of the tessellated draw. The fallback stays a plain, shared permutation that never depends on user shaders.
  • MeshFallbackEffects: the fallback material and parameter setup moved from the editor into Stride.Rendering, so the engine test runs the real thing. The editor only adds its compiling/error glow flags.
  • EffectFallbackTest: a gated compiler holds back the tessellated permutation for one frame, so the fallback path runs on every GPU lane. It crashes without the fix.
  • Effect: found by the test on a warm effect cache. Deserialized bytecode holds a resource group's cbuffer and the matching ConstantBuffers entry as two instances, and only the second one was hashed. All cached effects with the same descriptor layout then shared one PerView/PerFrame layout, with the size and member offsets of whichever effect came first. Both instances are hashed now. 4.4 only, and invisible on CI because CI always runs cold.

@xen2 xen2 added the ci-editor Run the GameStudio editor screenshot suite on this PR label Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-editor Run the GameStudio editor screenshot suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant