Skip to content

Finalize MESA_map_buffer_client_pointer - #680

Merged
oddhack merged 3 commits into
KhronosGroup:mainfrom
Guy1524:client_pointer_release_all
Aug 3, 2026
Merged

Finalize MESA_map_buffer_client_pointer#680
oddhack merged 3 commits into
KhronosGroup:mainfrom
Guy1524:client_pointer_release_all

Conversation

@Guy1524

@Guy1524 Guy1524 commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Changes the ABI, as #678 was accidentally merged before ready, and there are no users of this extension yet.

  1. Add RELEASE_ALL flag previously discussed (Add MESA_map_buffer_client_pointer. #678 (comment))

  2. Require a storage flag for MAP_CLIENT_POINTER_MESA usage, so that sub-allocated buffers with backing BOs on client pointer ranges are possible without remapping.

  3. Specify shared state properties of client pointer ranges. This is important since Wine is moving towards sharing all GL contexts, and the client pointer ranges shouldn't be locked to only one of these contexts.

I've done this by specifying that an incoming client pointer range is at first client state, which can then be consumed by MapRange, (if a mapping isn't provided for the backing BO by another thread first). But the semantics around when a range is consumed are wishy washy.

Alternatively, we could make all added ranges server side state, which would be easier to spec, but on the driver side introduces some needless code.

@Guy1524

Guy1524 commented Apr 13, 2026

Copy link
Copy Markdown
Contributor Author

It probably makes most sense to introduce a usage/flag to glBufferData/glBufferStorage to enable client pointer mapping for the buffer. I'll work on implementing this in Zink, where we can't remap.

Guy1524 added 3 commits July 29, 2026 15:07
As discussed in PR (KhronosGroup#678), introduce a flag to specifiy whether all possibly client pointer ranges
should be released, or just the one the driver isn't holding onto anymore, as releasing everything
is slow and should be reserved for OOM situations.

This changes the ABI, as PR (KhronosGroup#678) was merged before it was ready, and we don't yet have any consumers.
…tores.

Enables the driver to pool resources with shared client range space into one BO.
Otherwise implementations may have to either reshuffle memory at map-time, or support
concurrent mappings for the same memory.
@Guy1524
Guy1524 force-pushed the client_pointer_release_all branch from 6a1e65c to c6e7072 Compare July 29, 2026 13:10
@Guy1524
Guy1524 marked this pull request as ready for review July 29, 2026 13:24
@Guy1524

Guy1524 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Mesa/Zink implementation: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/43297

@Guy1524

Guy1524 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

@zmike @marekolsak @cjacek

@marekolsak

Copy link
Copy Markdown

Looks good to me.

@zmike zmike added this to the Approved to Merge milestone Aug 3, 2026
@zmike

zmike commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@oddhack please merge

@oddhack
oddhack merged commit 0eab18f into KhronosGroup:main Aug 3, 2026
oddhack added a commit that referenced this pull request Aug 3, 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.

4 participants