mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 14:42:30 +00:00
Merge pull request #9409 from torarnv/explicitly-invalidate-font-atlas-buffer
Explicitly invalidate atlas buffer when rendering text with Metal
This commit is contained in:
commit
2997c26069
@ -80,6 +80,12 @@
|
|||||||
_buffer = [_context.device newBufferWithBytes:_atlas->buffer
|
_buffer = [_context.device newBufferWithBytes:_atlas->buffer
|
||||||
length:(NSUInteger)(_stride * _atlas->height)
|
length:(NSUInteger)(_stride * _atlas->height)
|
||||||
options:MTLResourceStorageModeManaged];
|
options:MTLResourceStorageModeManaged];
|
||||||
|
|
||||||
|
// Even though newBufferWithBytes will copy the initial contents
|
||||||
|
// from our atlas, it doesn't seem to invalidate the buffer when
|
||||||
|
// doing so, causing corrupted text rendering if we hit this code
|
||||||
|
// path. To work around it we manually invalidate the buffer.
|
||||||
|
[_buffer didModifyRange:NSMakeRange(0, _buffer.length)];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user