Skip to content

Commit 5426001

Browse files
committed
graphics: transition font atlas back to ShaderResource after UpdateSubResource
Mirrors 4ca5734 (lightClusters). UpdateSubResource leaves the atlas in CopyDest; with auto-transitions removed in 21741f8, the next sprite-batch sample reads a CopyDest-state texture. On D3D12 with Enhanced Barriers this doesn't trip a hard validation error — just returns undefined content — so glyphs uploaded later in the frame (CJK rows in TestDynamicSpriteFontVarious) render blank.
1 parent 66b29bd commit 5426001

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

sources/engine/Stride.Graphics/Font/FontCacheManager.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ public void UploadCharacterBitmap(CommandList commandList, CharacterSpecificatio
125125
}
126126
}
127127
ArrayPool<byte>.Shared.Return(expandedBuffer);
128+
129+
// UpdateSubResource leaves the atlas in CopyDest; transition back so the next
130+
// sprite-batch sample sees ShaderResource without relying on a lazy transition.
131+
commandList.ResourceBarrierTransition(cacheTextures[0], BarrierLayout.ShaderResource);
128132
}
129133

130134
// update the glyph data

0 commit comments

Comments
 (0)