Fix Intel "Failed to map buffer for frame" during playback#274
Merged
tedwaine merged 1 commit intoJun 18, 2026
Merged
Conversation
The Mac (__OPENGL_4_1__) path assigned the glMapBuffer result to mapped_address_, so the cache check at the top of map_buffer_for_upload (if (!resize(buffer_size) && mapped_address_) return mapped_address_;) short-circuited on subsequent calls. The non-Mac path returned the glMapNamedBuffer result directly without storing it, so mapped_address_ stayed null and the check never fired. Every prepare-for-upload re-ran glNamedBufferData + glMapNamedBuffer on the same PBO. NVIDIA accepts this re-orphan-and-map pattern. Intel doesn't: the remap returns NULL once the buffer has been used as a GL_PIXEL_UNPACK_BUFFER source, which logs 'Failed to map buffer for frame' during normal playback. Fix: assign the map result to mapped_address_ so the cache check fires. Clear it after glUnmapNamedBuffer in __bind, and after the buffer deletion in resize(), so we don't return a stale pointer. Signed-off-by: Ben de Luca <bdeluca@gmail.com>
113864f
into
AcademySoftwareFoundation:develop
2 of 3 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Mac (
__OPENGL_4_1__) path ofGLBlindRGBA8bitTex::map_buffer_for_uploadstores theglMapBufferresult inmapped_address_, so the cache check at the top short-circuits subsequent calls. The non-Mac path returnedglMapNamedBufferdirectly without storing it, so the cache never fired and every prepare-for-upload re-ranglNamedBufferData+glMapNamedBufferon the same PBO.NVIDIA accepts the re-orphan-and-map; Intel returns NULL once the buffer has been used as a
GL_PIXEL_UNPACK_BUFFERsource, which spams "Failed to map buffer for frame" during normal playback. Store the map result, clear it afterglUnmapNamedBufferin__bind, and after buffer deletion inresize()so we don't return a stale pointer.Tested on Windows with both Intel and NVIDIA GPUs, and on Linux with NVIDIA. If it's really necessary to test the Linux/Intel combination I can do it, but it won't be until next week.