|
| 1 | +Name |
| 2 | + |
| 3 | + MESA_map_buffer_client_pointer |
| 4 | + |
| 5 | +Name Strings |
| 6 | + |
| 7 | + GL_MESA_map_buffer_client_pointer |
| 8 | + |
| 9 | +Contact |
| 10 | + |
| 11 | + Derek Lesho <dlesho@codeweavers.com> |
| 12 | + |
| 13 | +Contributors |
| 14 | + |
| 15 | + Derek Lesho, Codeweavers |
| 16 | + |
| 17 | +Status |
| 18 | + |
| 19 | + Proposal |
| 20 | + |
| 21 | +Version |
| 22 | + |
| 23 | + Version 1, February, 2026 |
| 24 | + |
| 25 | +Number |
| 26 | + |
| 27 | + OpenGL Extension 562 |
| 28 | + |
| 29 | +Dependencies |
| 30 | + |
| 31 | + OpenGL 3.0 or ARB_map_buffer_ranged is required. |
| 32 | + |
| 33 | + This extension is written against the OpenGL 4.6 (Core Profile) |
| 34 | + Specification. |
| 35 | + |
| 36 | +Overview |
| 37 | + |
| 38 | + This extension allows the application to specify pointer ranges within |
| 39 | + which buffers should be mapped. |
| 40 | + |
| 41 | + This extension is proposed to help the WINE project [https://winehq.org], |
| 42 | + which implements the 32-bit Windows OpenGL ABI on top of 64-bit Linux, |
| 43 | + return an address in 32-bit range from Map(Named)Buffer(Range). |
| 44 | + |
| 45 | +IP Status |
| 46 | + |
| 47 | + None |
| 48 | + |
| 49 | +Issues |
| 50 | + |
| 51 | + None |
| 52 | + |
| 53 | +New Procedures and Functions |
| 54 | + |
| 55 | + void AddClientPointerRangeMESA( void *addr, sizeiptr size ); |
| 56 | + |
| 57 | + void *ReleaseClientPointerRangeMESA( sizeiptr *size ); |
| 58 | + |
| 59 | + |
| 60 | +New Types |
| 61 | + |
| 62 | + None |
| 63 | + |
| 64 | +New Tokens |
| 65 | + |
| 66 | + Accepted by the <access> parameter of MapBufferRange: |
| 67 | + |
| 68 | + MAP_CLIENT_POINTER_BIT_MESA 0x4000 |
| 69 | + |
| 70 | + Accepted by the <pname> parameter of GetBufferParameter{i|i64}v: |
| 71 | + |
| 72 | + BUFFER_CLIENT_POINTER_SIZE_MESA 0x9790 |
| 73 | + |
| 74 | + |
| 75 | +Additions to Chapter 6 of the OpenGL Core Profile Specification, Version 4.6, |
| 76 | +"Buffer Objects" |
| 77 | + |
| 78 | + Modify Section 6.3, "Mapping and Unmapping Buffer Data" |
| 79 | + |
| 80 | + Add to the bulleted list describing flags that modify buffer mappings, |
| 81 | + p.73. |
| 82 | + |
| 83 | + * MAP_CLIENT_POINTER_BIT_MESA indicates the mapped buffer pointer must |
| 84 | + be in an address range provided by in AddClientPointerRangeMESA. If |
| 85 | + no space is found, OUT_OF_MEMORY is returned. |
| 86 | + |
| 87 | + Append to Section 6.3 "Mapping and Unmapping Buffer Data", p.78. |
| 88 | + |
| 89 | + If a buffer is mapped with the MAP_CLIENT_POINTER_BIT_MESA flag, the |
| 90 | + returned pointer will be in a range provided by the application through |
| 91 | + |
| 92 | + void AddClientPointerRangeMESA( void *addr, sizeiptr size ); |
| 93 | + |
| 94 | + with <addr> set to the start of a page-aligned address range of size |
| 95 | + <size> with read and write permissions. The driver will hold this |
| 96 | + address range for as long as it contains any buffer mappings. While the |
| 97 | + driver holds the address range, memory access to it in in any manner |
| 98 | + other than as defined by Map(Named)BufferRange is undefined. To |
| 99 | + reaquire the pages, first unmap any buffers in the range, call Flush, |
| 100 | + and thence |
| 101 | + |
| 102 | + void *ReleaseClientPointerRangeMESA( sizeiptr *size ); |
| 103 | + |
| 104 | + will return the range back to the application, with <size> |
| 105 | + relaying back the size of the returned range. |
| 106 | + |
| 107 | + |
| 108 | +Errors |
| 109 | + |
| 110 | + OUT_OF_MEMORY is generated by Map(Named)Buffer if |
| 111 | + MAP_CLIENT_POINTER_BIT_MESA is included in <access> but no space can be |
| 112 | + found for a mapping in the ranges provided by AddClientPointerRangeMESA. In |
| 113 | + this case, the buffer object state value BUFFER_CLIENT_POINTER_SIZE_MESA is |
| 114 | + set to the size required of a new client pointer range to enable mapping |
| 115 | + the buffer with MAP_CLIENT_POINTER_BIT_MESA. |
| 116 | + |
| 117 | +Revision History |
| 118 | + |
| 119 | + Version 1, 2026-2-25 (Derek Lesho) |
| 120 | + Initial draft. |
0 commit comments