1Name 2 3 EXT_win32_keyed_mutex 4 5Name Strings 6 7 GL_EXT_win32_keyed_mutex 8 9Contributors 10 11 Carsten Rohde, NVIDIA 12 James Jones, NVIDIA 13 14Contact 15 16 James Jones, NVIDIA (jajones 'at' nvidia.com) 17 18Status 19 20 Complete 21 22Version 23 24 Last Modified Date: June 6, 2017 25 Revision: 2 26 27Number 28 29 506 30 OpenGL ES Extension #283 31 32Dependencies 33 34 Written against the OpenGL 4.5 and OpenGL ES 3.2 specifications. 35 36 Requires GL_EXT_memory_object. 37 38Overview 39 40 Direct3D image objects may have a built-in synchronization primitive 41 associated with them that can be used to synchronize access to their 42 contents across process and API boundaries. This extension provides 43 access to that synchronization primitive via two new commands that 44 operate on GL memory objects. 45 46New Procedures and Functions 47 48 boolean AcquireKeyedMutexWin32EXT(uint memory, 49 uint64 key, 50 uint timeout); 51 52 boolean ReleaseKeyedMutexWin32EXT(uint memory, 53 uint64 key); 54 55New Tokens 56 57Additions to Chapter 4 of the OpenGL 4.5 Specification (Event Model) 58 59 Add a new section between sections 4.1, "Sync Objects and Fences" 60 and section 4.2, "Query Objects and Asynchronous Queries" 61 62 4.2 Memory Object Keyed Mutexes 63 64 Memory objects imported with the handle types 65 HANDLE_TYPE_D3D11_IMAGE_EXT and HANDLE_TYPE_D3D11_KMT_IMAGE_EXT may 66 have a synchronization object known as a keyed mutex associated with 67 them. The exact behavior and conditions governing availability of 68 these objects is beyond the scope of this specification, but their 69 state can be manipulated by performing operations on the memory 70 object with which they are associated. 71 72 To block GL command processing until a keyed mutex is acquired, call 73 74 boolean AcquireKeyedMutexWin32EXT(uint memory, 75 uint64 key, 76 uint timeout); 77 78 where <memory> identifies which keyed mutex to acquire, <key> is the 79 mutex value to wait for, and <timeout> is the time, in milliseconds, 80 to wait before failing the acquire operation. 81 82 FALSE is returned if the acquire operation timed out or failed. No 83 error is generated if the operation failed because it timed out. 84 TRUE is returned if the wait succeeded. 85 86 To release a keyed mutex after all prior GL command processing has 87 completed, call 88 89 boolean ReleaseKeyedMutexWin32EXT(uint memory, 90 uint64 key); 91 92 where <memory> identifies the keyed mutex to release, and <key> is 93 the mutex value set by the release operation. 94 95 FALSE is returned if the release operation failed. TRUE is returned 96 if the release operation succeeded. 97 98Errors 99 100 INVALID_VALUE is generated by AcquireKeyedMutexWin32EXT and 101 ReleaseKeyedMutexWin32EXT if <memory> is not a valid memory object 102 associated memory. 103 104 INVALID_VALUE is generated by AcquireKeyedMutexWin32EXT and 105 ReleaseKeyedMutexWin32EXT if the memory resource referred to by 106 <memory> has no associated keyed mutex. 107 108 INVALID_OPERATION is generated by AcquireKeyedMutexWin32EXT and 109 ReleaseKeyedMutexWin32EXT if the acquire or release operation failed 110 for operating-system-specific reasons. 111 112New State 113 114Issues 115 116 None. 117 118Revision History 119 120 Revision 2, 2016-06-06 (James Jones) 121 - Added extension numbers. 122 - Marked complete. 123 124 Revision 1, 2017-03-31 (James Jones) 125 - Initial draft. 126