15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci EXT_win32_keyed_mutex 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_EXT_win32_keyed_mutex 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContributors 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Carsten Rohde, NVIDIA 125bd8deadSopenharmony_ci James Jones, NVIDIA 135bd8deadSopenharmony_ci 145bd8deadSopenharmony_ciContact 155bd8deadSopenharmony_ci 165bd8deadSopenharmony_ci James Jones, NVIDIA (jajones 'at' nvidia.com) 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ciStatus 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ci Complete 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ciVersion 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ci Last Modified Date: June 6, 2017 255bd8deadSopenharmony_ci Revision: 2 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ciNumber 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ci 506 305bd8deadSopenharmony_ci OpenGL ES Extension #283 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ciDependencies 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ci Written against the OpenGL 4.5 and OpenGL ES 3.2 specifications. 355bd8deadSopenharmony_ci 365bd8deadSopenharmony_ci Requires GL_EXT_memory_object. 375bd8deadSopenharmony_ci 385bd8deadSopenharmony_ciOverview 395bd8deadSopenharmony_ci 405bd8deadSopenharmony_ci Direct3D image objects may have a built-in synchronization primitive 415bd8deadSopenharmony_ci associated with them that can be used to synchronize access to their 425bd8deadSopenharmony_ci contents across process and API boundaries. This extension provides 435bd8deadSopenharmony_ci access to that synchronization primitive via two new commands that 445bd8deadSopenharmony_ci operate on GL memory objects. 455bd8deadSopenharmony_ci 465bd8deadSopenharmony_ciNew Procedures and Functions 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ci boolean AcquireKeyedMutexWin32EXT(uint memory, 495bd8deadSopenharmony_ci uint64 key, 505bd8deadSopenharmony_ci uint timeout); 515bd8deadSopenharmony_ci 525bd8deadSopenharmony_ci boolean ReleaseKeyedMutexWin32EXT(uint memory, 535bd8deadSopenharmony_ci uint64 key); 545bd8deadSopenharmony_ci 555bd8deadSopenharmony_ciNew Tokens 565bd8deadSopenharmony_ci 575bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 4.5 Specification (Event Model) 585bd8deadSopenharmony_ci 595bd8deadSopenharmony_ci Add a new section between sections 4.1, "Sync Objects and Fences" 605bd8deadSopenharmony_ci and section 4.2, "Query Objects and Asynchronous Queries" 615bd8deadSopenharmony_ci 625bd8deadSopenharmony_ci 4.2 Memory Object Keyed Mutexes 635bd8deadSopenharmony_ci 645bd8deadSopenharmony_ci Memory objects imported with the handle types 655bd8deadSopenharmony_ci HANDLE_TYPE_D3D11_IMAGE_EXT and HANDLE_TYPE_D3D11_KMT_IMAGE_EXT may 665bd8deadSopenharmony_ci have a synchronization object known as a keyed mutex associated with 675bd8deadSopenharmony_ci them. The exact behavior and conditions governing availability of 685bd8deadSopenharmony_ci these objects is beyond the scope of this specification, but their 695bd8deadSopenharmony_ci state can be manipulated by performing operations on the memory 705bd8deadSopenharmony_ci object with which they are associated. 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ci To block GL command processing until a keyed mutex is acquired, call 735bd8deadSopenharmony_ci 745bd8deadSopenharmony_ci boolean AcquireKeyedMutexWin32EXT(uint memory, 755bd8deadSopenharmony_ci uint64 key, 765bd8deadSopenharmony_ci uint timeout); 775bd8deadSopenharmony_ci 785bd8deadSopenharmony_ci where <memory> identifies which keyed mutex to acquire, <key> is the 795bd8deadSopenharmony_ci mutex value to wait for, and <timeout> is the time, in milliseconds, 805bd8deadSopenharmony_ci to wait before failing the acquire operation. 815bd8deadSopenharmony_ci 825bd8deadSopenharmony_ci FALSE is returned if the acquire operation timed out or failed. No 835bd8deadSopenharmony_ci error is generated if the operation failed because it timed out. 845bd8deadSopenharmony_ci TRUE is returned if the wait succeeded. 855bd8deadSopenharmony_ci 865bd8deadSopenharmony_ci To release a keyed mutex after all prior GL command processing has 875bd8deadSopenharmony_ci completed, call 885bd8deadSopenharmony_ci 895bd8deadSopenharmony_ci boolean ReleaseKeyedMutexWin32EXT(uint memory, 905bd8deadSopenharmony_ci uint64 key); 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ci where <memory> identifies the keyed mutex to release, and <key> is 935bd8deadSopenharmony_ci the mutex value set by the release operation. 945bd8deadSopenharmony_ci 955bd8deadSopenharmony_ci FALSE is returned if the release operation failed. TRUE is returned 965bd8deadSopenharmony_ci if the release operation succeeded. 975bd8deadSopenharmony_ci 985bd8deadSopenharmony_ciErrors 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci INVALID_VALUE is generated by AcquireKeyedMutexWin32EXT and 1015bd8deadSopenharmony_ci ReleaseKeyedMutexWin32EXT if <memory> is not a valid memory object 1025bd8deadSopenharmony_ci associated memory. 1035bd8deadSopenharmony_ci 1045bd8deadSopenharmony_ci INVALID_VALUE is generated by AcquireKeyedMutexWin32EXT and 1055bd8deadSopenharmony_ci ReleaseKeyedMutexWin32EXT if the memory resource referred to by 1065bd8deadSopenharmony_ci <memory> has no associated keyed mutex. 1075bd8deadSopenharmony_ci 1085bd8deadSopenharmony_ci INVALID_OPERATION is generated by AcquireKeyedMutexWin32EXT and 1095bd8deadSopenharmony_ci ReleaseKeyedMutexWin32EXT if the acquire or release operation failed 1105bd8deadSopenharmony_ci for operating-system-specific reasons. 1115bd8deadSopenharmony_ci 1125bd8deadSopenharmony_ciNew State 1135bd8deadSopenharmony_ci 1145bd8deadSopenharmony_ciIssues 1155bd8deadSopenharmony_ci 1165bd8deadSopenharmony_ci None. 1175bd8deadSopenharmony_ci 1185bd8deadSopenharmony_ciRevision History 1195bd8deadSopenharmony_ci 1205bd8deadSopenharmony_ci Revision 2, 2016-06-06 (James Jones) 1215bd8deadSopenharmony_ci - Added extension numbers. 1225bd8deadSopenharmony_ci - Marked complete. 1235bd8deadSopenharmony_ci 1245bd8deadSopenharmony_ci Revision 1, 2017-03-31 (James Jones) 1255bd8deadSopenharmony_ci - Initial draft. 126