15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci EXT_external_objects 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_EXT_memory_object 85bd8deadSopenharmony_ci GL_EXT_semaphore 95bd8deadSopenharmony_ci 105bd8deadSopenharmony_ciContributors 115bd8deadSopenharmony_ci 125bd8deadSopenharmony_ci Carsten Rohde, NVIDIA 135bd8deadSopenharmony_ci Dave Airlie, Red Hat 145bd8deadSopenharmony_ci James Jones, NVIDIA 155bd8deadSopenharmony_ci Jan-Harald Fredriksen, ARM 165bd8deadSopenharmony_ci Jeff Juliano, NVIDIA 175bd8deadSopenharmony_ci Michael Worcester, Imagination Technologies 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ciContact 205bd8deadSopenharmony_ci 215bd8deadSopenharmony_ci James Jones, NVIDIA (jajones 'at' nvidia.com) 225bd8deadSopenharmony_ci 235bd8deadSopenharmony_ciStatus 245bd8deadSopenharmony_ci 255bd8deadSopenharmony_ci Complete 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ciVersion 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ci Last Modified Date: July 18, 2018 305bd8deadSopenharmony_ci Revision: 14 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ciNumber 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ci 503 355bd8deadSopenharmony_ci OpenGL ES Extension #280 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ciDependencies 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ci Written against the OpenGL 4.5 and OpenGL ES 3.2 specifications. 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ci GL_EXT_memory_object requires ARB_texture_storage or a version of 425bd8deadSopenharmony_ci OpenGL or OpenGL ES that incorporates it. 435bd8deadSopenharmony_ci 445bd8deadSopenharmony_ci GL_EXT_semaphore requires OpenGL 1.0. 455bd8deadSopenharmony_ci 465bd8deadSopenharmony_ci ARB_direct_state_access (OpenGL) interacts with GL_EXT_memory_object 475bd8deadSopenharmony_ci when OpenGL < 4.5 is used. 485bd8deadSopenharmony_ci 495bd8deadSopenharmony_ci ARB_sparse_texture (OpenGL) interacts with GL_EXT_memory_object 505bd8deadSopenharmony_ci 515bd8deadSopenharmony_ci EXT_sparse_texture (OpenGL ES) interacts with GL_EXT_memory_object 525bd8deadSopenharmony_ci 535bd8deadSopenharmony_ci EXT_protected_textures (OpenGL ES) interacts with GL_EXT_memory_object 545bd8deadSopenharmony_ci 555bd8deadSopenharmony_ciOverview 565bd8deadSopenharmony_ci 575bd8deadSopenharmony_ci The Vulkan API introduces the concept of explicit memory objects and 585bd8deadSopenharmony_ci reusable synchronization objects. This extension brings those 595bd8deadSopenharmony_ci concepts to the OpenGL API via two new object types: 605bd8deadSopenharmony_ci 615bd8deadSopenharmony_ci Memory objects 625bd8deadSopenharmony_ci Semaphores 635bd8deadSopenharmony_ci 645bd8deadSopenharmony_ci Rather than allocating memory as a response to object allocation, 655bd8deadSopenharmony_ci memory allocation and binding are two separate operations in Vulkan. 665bd8deadSopenharmony_ci This extension allows an OpenGL application to import a Vulkan 675bd8deadSopenharmony_ci memory object, and to bind textures and/or buffer objects to it. 685bd8deadSopenharmony_ci 695bd8deadSopenharmony_ci No methods to import memory objects are defined here. Separate 705bd8deadSopenharmony_ci platform-specific extensions are defined for this purpose. 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ci Semaphores are synchronization primitives that can be waited on and 735bd8deadSopenharmony_ci signaled only by the GPU, or in GL terms, in the GL server. They 745bd8deadSopenharmony_ci are similar in concept to GL's "sync" objects and EGL's "EGLSync" 755bd8deadSopenharmony_ci objects, but different enough that compatibilities between the two 765bd8deadSopenharmony_ci are difficult to derive. 775bd8deadSopenharmony_ci 785bd8deadSopenharmony_ci Rather than attempt to map Vulkan semaphores on to GL/EGL sync 795bd8deadSopenharmony_ci objects to achieve interoperability, this extension introduces a new 805bd8deadSopenharmony_ci object, GL semaphores, that map directly to the semantics of Vulkan 815bd8deadSopenharmony_ci semaphores. To achieve full image and buffer memory coherence with 825bd8deadSopenharmony_ci a Vulkan driver, the commands that manipulate semaphores also allow 835bd8deadSopenharmony_ci external usage information to be imported and exported. 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ciNew Procedures and Functions 865bd8deadSopenharmony_ci 875bd8deadSopenharmony_ci The following commands are added if either of the GL_EXT_memory_object 885bd8deadSopenharmony_ci or GL_EXT_semaphore strings are reported: 895bd8deadSopenharmony_ci 905bd8deadSopenharmony_ci void GetUnsignedBytevEXT(enum pname, 915bd8deadSopenharmony_ci ubyte *data); 925bd8deadSopenharmony_ci 935bd8deadSopenharmony_ci void GetUnsignedBytei_vEXT(enum target, 945bd8deadSopenharmony_ci uint index, 955bd8deadSopenharmony_ci ubyte *data); 965bd8deadSopenharmony_ci 975bd8deadSopenharmony_ci If the GL_EXT_memory_object string is reported, the following 985bd8deadSopenharmony_ci commands are added: 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci void DeleteMemoryObjectsEXT(sizei n, 1015bd8deadSopenharmony_ci const uint *memoryObjects); 1025bd8deadSopenharmony_ci 1035bd8deadSopenharmony_ci boolean IsMemoryObjectEXT(uint memoryObject); 1045bd8deadSopenharmony_ci 1055bd8deadSopenharmony_ci void CreateMemoryObjectsEXT(sizei n, 1065bd8deadSopenharmony_ci uint *memoryObjects); 1075bd8deadSopenharmony_ci 1085bd8deadSopenharmony_ci void MemoryObjectParameterivEXT(uint memoryObject, 1095bd8deadSopenharmony_ci enum pname, 1105bd8deadSopenharmony_ci const int *params); 1115bd8deadSopenharmony_ci 1125bd8deadSopenharmony_ci void GetMemoryObjectParameterivEXT(uint memoryObject 1135bd8deadSopenharmony_ci enum pname, 1145bd8deadSopenharmony_ci int *params); 1155bd8deadSopenharmony_ci 1165bd8deadSopenharmony_ci void TexStorageMem2DEXT(enum target, 1175bd8deadSopenharmony_ci sizei levels, 1185bd8deadSopenharmony_ci enum internalFormat, 1195bd8deadSopenharmony_ci sizei width, 1205bd8deadSopenharmony_ci sizei height, 1215bd8deadSopenharmony_ci uint memory, 1225bd8deadSopenharmony_ci uint64 offset); 1235bd8deadSopenharmony_ci 1245bd8deadSopenharmony_ci void TexStorageMem2DMultisampleEXT(enum target, 1255bd8deadSopenharmony_ci sizei samples, 1265bd8deadSopenharmony_ci enum internalFormat, 1275bd8deadSopenharmony_ci sizei width, 1285bd8deadSopenharmony_ci sizei height, 1295bd8deadSopenharmony_ci boolean fixedSampleLocations, 1305bd8deadSopenharmony_ci uint memory, 1315bd8deadSopenharmony_ci uint64 offset); 1325bd8deadSopenharmony_ci 1335bd8deadSopenharmony_ci void TexStorageMem3DEXT(enum target, 1345bd8deadSopenharmony_ci sizei levels, 1355bd8deadSopenharmony_ci enum internalFormat, 1365bd8deadSopenharmony_ci sizei width, 1375bd8deadSopenharmony_ci sizei height, 1385bd8deadSopenharmony_ci sizei depth, 1395bd8deadSopenharmony_ci uint memory, 1405bd8deadSopenharmony_ci uint64 offset); 1415bd8deadSopenharmony_ci 1425bd8deadSopenharmony_ci void TexStorageMem3DMultisampleEXT(enum target, 1435bd8deadSopenharmony_ci sizei samples, 1445bd8deadSopenharmony_ci enum internalFormat, 1455bd8deadSopenharmony_ci sizei width, 1465bd8deadSopenharmony_ci sizei height, 1475bd8deadSopenharmony_ci sizei depth, 1485bd8deadSopenharmony_ci boolean fixedSampleLocations, 1495bd8deadSopenharmony_ci uint memory, 1505bd8deadSopenharmony_ci uint64 offset); 1515bd8deadSopenharmony_ci 1525bd8deadSopenharmony_ci void BufferStorageMemEXT(enum target, 1535bd8deadSopenharmony_ci sizeiptr size, 1545bd8deadSopenharmony_ci uint memory, 1555bd8deadSopenharmony_ci uint64 offset); 1565bd8deadSopenharmony_ci 1575bd8deadSopenharmony_ci [[ The following are added if direct state access is supported ]] 1585bd8deadSopenharmony_ci 1595bd8deadSopenharmony_ci void TextureStorageMem2DEXT(uint texture, 1605bd8deadSopenharmony_ci sizei levels, 1615bd8deadSopenharmony_ci enum internalFormat, 1625bd8deadSopenharmony_ci sizei width, 1635bd8deadSopenharmony_ci sizei height, 1645bd8deadSopenharmony_ci uint memory, 1655bd8deadSopenharmony_ci uint64 offset); 1665bd8deadSopenharmony_ci 1675bd8deadSopenharmony_ci void TextureStorageMem2DMultisampleEXT(uint texture, 1685bd8deadSopenharmony_ci sizei samples, 1695bd8deadSopenharmony_ci enum internalFormat, 1705bd8deadSopenharmony_ci sizei width, 1715bd8deadSopenharmony_ci sizei height, 1725bd8deadSopenharmony_ci boolean fixedSampleLocations, 1735bd8deadSopenharmony_ci uint memory, 1745bd8deadSopenharmony_ci uint64 offset); 1755bd8deadSopenharmony_ci 1765bd8deadSopenharmony_ci void TextureStorageMem3DEXT(uint texture, 1775bd8deadSopenharmony_ci sizei levels, 1785bd8deadSopenharmony_ci enum internalFormat, 1795bd8deadSopenharmony_ci sizei width, 1805bd8deadSopenharmony_ci sizei height, 1815bd8deadSopenharmony_ci sizei depth, 1825bd8deadSopenharmony_ci uint memory, 1835bd8deadSopenharmony_ci uint64 offset); 1845bd8deadSopenharmony_ci 1855bd8deadSopenharmony_ci void TextureStorageMem3DMultisampleEXT(uint texture, 1865bd8deadSopenharmony_ci sizei samples, 1875bd8deadSopenharmony_ci enum internalFormat, 1885bd8deadSopenharmony_ci sizei width, 1895bd8deadSopenharmony_ci sizei height, 1905bd8deadSopenharmony_ci sizei depth, 1915bd8deadSopenharmony_ci boolean fixedSampleLocations, 1925bd8deadSopenharmony_ci uint memory, 1935bd8deadSopenharmony_ci uint64 offset); 1945bd8deadSopenharmony_ci 1955bd8deadSopenharmony_ci void NamedBufferStorageMemEXT(uint buffer, 1965bd8deadSopenharmony_ci sizeiptr size, 1975bd8deadSopenharmony_ci uint memory, 1985bd8deadSopenharmony_ci uint64 offset); 1995bd8deadSopenharmony_ci 2005bd8deadSopenharmony_ci [[ The following are available in OpenGL only ]] 2015bd8deadSopenharmony_ci 2025bd8deadSopenharmony_ci void TexStorageMem1DEXT(enum target, 2035bd8deadSopenharmony_ci sizei levels, 2045bd8deadSopenharmony_ci enum internalFormat, 2055bd8deadSopenharmony_ci sizei width, 2065bd8deadSopenharmony_ci uint memory, 2075bd8deadSopenharmony_ci uint64 offset); 2085bd8deadSopenharmony_ci 2095bd8deadSopenharmony_ci [[ The following are availble in OpenGL only, and only when 2105bd8deadSopenharmony_ci direct state access is available ]] 2115bd8deadSopenharmony_ci 2125bd8deadSopenharmony_ci void TextureStorageMem1DEXT(uint texture, 2135bd8deadSopenharmony_ci sizei levels, 2145bd8deadSopenharmony_ci enum internalFormat, 2155bd8deadSopenharmony_ci sizei width, 2165bd8deadSopenharmony_ci uint memory, 2175bd8deadSopenharmony_ci uint64 offset); 2185bd8deadSopenharmony_ci 2195bd8deadSopenharmony_ci If the GL_EXT_semaphore string is reported, the following 2205bd8deadSopenharmony_ci commands are added: 2215bd8deadSopenharmony_ci 2225bd8deadSopenharmony_ci void GenSemaphoresEXT(sizei n, 2235bd8deadSopenharmony_ci uint *semaphores); 2245bd8deadSopenharmony_ci 2255bd8deadSopenharmony_ci void DeleteSemaphoresEXT(sizei n, 2265bd8deadSopenharmony_ci const uint *semaphores); 2275bd8deadSopenharmony_ci 2285bd8deadSopenharmony_ci boolean IsSemaphoreEXT(uint semaphore); 2295bd8deadSopenharmony_ci 2305bd8deadSopenharmony_ci void SemaphoreParameterui64vEXT(uint semaphore, 2315bd8deadSopenharmony_ci enum pname, 2325bd8deadSopenharmony_ci const uint64 *params); 2335bd8deadSopenharmony_ci 2345bd8deadSopenharmony_ci void GetSemaphoreParameterui64vEXT(uint semaphore, 2355bd8deadSopenharmony_ci enum pname, 2365bd8deadSopenharmony_ci uint64 *params); 2375bd8deadSopenharmony_ci 2385bd8deadSopenharmony_ci void WaitSemaphoreEXT(uint semaphore, 2395bd8deadSopenharmony_ci uint numBufferBarriers, 2405bd8deadSopenharmony_ci const uint *buffers, 2415bd8deadSopenharmony_ci uint numTextureBarriers, 2425bd8deadSopenharmony_ci const uint *textures, 2435bd8deadSopenharmony_ci const GLenum *srcLayouts); 2445bd8deadSopenharmony_ci 2455bd8deadSopenharmony_ci void SignalSemaphoreEXT(uint semaphore, 2465bd8deadSopenharmony_ci uint numBufferBarriers, 2475bd8deadSopenharmony_ci const uint *buffers, 2485bd8deadSopenharmony_ci uint numTextureBarriers, 2495bd8deadSopenharmony_ci const uint *textures, 2505bd8deadSopenharmony_ci const GLenum *dstLayouts); 2515bd8deadSopenharmony_ci 2525bd8deadSopenharmony_ciNew Tokens 2535bd8deadSopenharmony_ci 2545bd8deadSopenharmony_ci If the GL_EXT_memory_object string is reported, the following tokens are 2555bd8deadSopenharmony_ci added: 2565bd8deadSopenharmony_ci 2575bd8deadSopenharmony_ci Accepted by the <pname> parameter of TexParameter{ifx}{v}, 2585bd8deadSopenharmony_ci TexParameterI{i ui}v, TextureParameter{if}{v}, TextureParameterI{i ui}v, 2595bd8deadSopenharmony_ci GetTexParameter{if}v, GetTexParameterI{i ui}v, GetTextureParameter{if}v, 2605bd8deadSopenharmony_ci and GetTextureParameterI{i ui}v: 2615bd8deadSopenharmony_ci 2625bd8deadSopenharmony_ci TEXTURE_TILING_EXT 0x9580 2635bd8deadSopenharmony_ci 2645bd8deadSopenharmony_ci Accepted by the <pname> parameter of MemoryObjectParameterivEXT, and 2655bd8deadSopenharmony_ci GetMemoryObjectParameterivEXT: 2665bd8deadSopenharmony_ci 2675bd8deadSopenharmony_ci DEDICATED_MEMORY_OBJECT_EXT 0x9581 2685bd8deadSopenharmony_ci 2695bd8deadSopenharmony_ci [[ The following are available when GL_EXT_protected_textures is 2705bd8deadSopenharmony_ci available ]] 2715bd8deadSopenharmony_ci 2725bd8deadSopenharmony_ci PROTECTED_MEMORY_OBJECT_EXT 0x959B 2735bd8deadSopenharmony_ci 2745bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetInternalFormativ or 2755bd8deadSopenharmony_ci GetInternalFormati64v: 2765bd8deadSopenharmony_ci 2775bd8deadSopenharmony_ci NUM_TILING_TYPES_EXT 0x9582 2785bd8deadSopenharmony_ci TILING_TYPES_EXT 0x9583 2795bd8deadSopenharmony_ci 2805bd8deadSopenharmony_ci Returned in the <params> parameter of GetInternalFormativ or 2815bd8deadSopenharmony_ci GetInternalFormati64v when the <pname> parameter is TILING_TYPES_EXT, 2825bd8deadSopenharmony_ci returned in the <params> parameter of GetTexParameter{if}v, 2835bd8deadSopenharmony_ci GetTexParameterI{i ui}v, GetTextureParameter{if}v, and 2845bd8deadSopenharmony_ci GetTextureParameterI{i ui}v when the <pname> parameter is 2855bd8deadSopenharmony_ci TEXTURE_TILING_EXT, and accepted by the <params> parameter of 2865bd8deadSopenharmony_ci TexParameter{ifx}{v}, TexParameterI{i ui}v, TextureParameter{if}{v}, 2875bd8deadSopenharmony_ci TextureParameterI{i ui}v when the <pname> parameter is 2885bd8deadSopenharmony_ci TEXTURE_TILING_EXT: 2895bd8deadSopenharmony_ci 2905bd8deadSopenharmony_ci OPTIMAL_TILING_EXT 0x9584 2915bd8deadSopenharmony_ci LINEAR_TILING_EXT 0x9585 2925bd8deadSopenharmony_ci 2935bd8deadSopenharmony_ci The following tokens are added if either of the GL_EXT_memory_object or 2945bd8deadSopenharmony_ci GL_EXT_semaphore strings are reported: 2955bd8deadSopenharmony_ci 2965bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetFloatv, 2975bd8deadSopenharmony_ci GetIntegerv, GetInteger64v, GetUnsignedBytevEXT, and the <target> 2985bd8deadSopenharmony_ci parameter of GetBooleani_v, GetIntegeri_v,GetFloati_v, GetDoublei_v, 2995bd8deadSopenharmony_ci GetInteger64i_v, and GetUnsignedBytei_vEXT: 3005bd8deadSopenharmony_ci 3015bd8deadSopenharmony_ci NUM_DEVICE_UUIDS_EXT 0x9596 3025bd8deadSopenharmony_ci DEVICE_UUID_EXT 0x9597 3035bd8deadSopenharmony_ci DRIVER_UUID_EXT 0x9598 3045bd8deadSopenharmony_ci 3055bd8deadSopenharmony_ci Constant values: 3065bd8deadSopenharmony_ci 3075bd8deadSopenharmony_ci UUID_SIZE_EXT 16 3085bd8deadSopenharmony_ci 3095bd8deadSopenharmony_ci If the GL_EXT_semaphore string is reported, the following tokens are 3105bd8deadSopenharmony_ci added: 3115bd8deadSopenharmony_ci 3125bd8deadSopenharmony_ci Accepted by the <dstLayouts> parameter of SignalSemaphoreEXT and the 3135bd8deadSopenharmony_ci <srcLayouts> parameter of WaitSemaphoreEXT: 3145bd8deadSopenharmony_ci 3155bd8deadSopenharmony_ci LAYOUT_GENERAL_EXT 0x958D 3165bd8deadSopenharmony_ci LAYOUT_COLOR_ATTACHMENT_EXT 0x958E 3175bd8deadSopenharmony_ci LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT 0x958F 3185bd8deadSopenharmony_ci LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT 0x9590 3195bd8deadSopenharmony_ci LAYOUT_SHADER_READ_ONLY_EXT 0x9591 3205bd8deadSopenharmony_ci LAYOUT_TRANSFER_SRC_EXT 0x9592 3215bd8deadSopenharmony_ci LAYOUT_TRANSFER_DST_EXT 0x9593 3225bd8deadSopenharmony_ci LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT 0x9530 3235bd8deadSopenharmony_ci LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT 0x9531 3245bd8deadSopenharmony_ci 3255bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 4.5 Specification (OpenGL 3265bd8deadSopenharmony_ciFundamentals) 3275bd8deadSopenharmony_ci 3285bd8deadSopenharmony_ci Add two new sections after 2.6.13 (Sync Objects) 3295bd8deadSopenharmony_ci 3305bd8deadSopenharmony_ci 2.6.14 Semaphore Objects 3315bd8deadSopenharmony_ci 3325bd8deadSopenharmony_ci A /semaphore object/ is a synchronization primitive similar to a 3335bd8deadSopenharmony_ci /sync object/, but with semantics based on Vulkan semaphores. 3345bd8deadSopenharmony_ci 3355bd8deadSopenharmony_ci Semaphore objects may be shared. They are described in detail in 3365bd8deadSopenharmony_ci section 4.2. 3375bd8deadSopenharmony_ci 3385bd8deadSopenharmony_ci 2.6.15 Memory Objects 3395bd8deadSopenharmony_ci 3405bd8deadSopenharmony_ci Many GL objects have some associated data stored in GL server 3415bd8deadSopenharmony_ci memory. /Memory objects/ are an abstract representation of GL 3425bd8deadSopenharmony_ci server memory suitable for use as the backing store of a 3435bd8deadSopenharmony_ci /buffer object/, a /texture object/, or both, depending on how 3445bd8deadSopenharmony_ci the memory referred to by the object was allocated. Memory 3455bd8deadSopenharmony_ci objects can not be created directly within the GL. They must be 3465bd8deadSopenharmony_ci imported from an API capable of allocating abstract memory, such 3475bd8deadSopenharmony_ci as Vulkan. 3485bd8deadSopenharmony_ci 3495bd8deadSopenharmony_ci Memory objects may be shared. They are described in detail in 3505bd8deadSopenharmony_ci Chapter 6 (Memory Objects). 3515bd8deadSopenharmony_ci 3525bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 4.5 Specification (Event Model) 3535bd8deadSopenharmony_ci 3545bd8deadSopenharmony_ci Add a new section between sections 4.1, "Sync Objects and Fences" 3555bd8deadSopenharmony_ci and section 4.2, "Query Objects and Asynchronous Queries" 3565bd8deadSopenharmony_ci 3575bd8deadSopenharmony_ci 4.2 Semaphore Objects 3585bd8deadSopenharmony_ci 3595bd8deadSopenharmony_ci Like sync objects, a semaphore object acts as a /synchronization 3605bd8deadSopenharmony_ci primitive/. However, semaphore objects differ from sync objects 3615bd8deadSopenharmony_ci in several ways: 3625bd8deadSopenharmony_ci 3635bd8deadSopenharmony_ci * They may only be created by importing an external semaphore 3645bd8deadSopenharmony_ci handle into the GL. 3655bd8deadSopenharmony_ci 3665bd8deadSopenharmony_ci * They are reusable. 3675bd8deadSopenharmony_ci 3685bd8deadSopenharmony_ci * As a corollary to the above behavior, separate commands are 3695bd8deadSopenharmony_ci provided to create and signal semaphore objects. 3705bd8deadSopenharmony_ci 3715bd8deadSopenharmony_ci * Their state is reset upon completion of a wait operation. 3725bd8deadSopenharmony_ci 3735bd8deadSopenharmony_ci * As a corollary to the above behavior, only a single waiter may 3745bd8deadSopenharmony_ci be associated with a unique signal command. 3755bd8deadSopenharmony_ci 3765bd8deadSopenharmony_ci * There is no way to wait for a semaphore to become signaled in 3775bd8deadSopenharmony_ci the GL client. All waits operations execute in the GL server, 3785bd8deadSopenharmony_ci and semaphores have no queryable state. 3795bd8deadSopenharmony_ci 3805bd8deadSopenharmony_ci The command 3815bd8deadSopenharmony_ci 3825bd8deadSopenharmony_ci void GenSemaphoresEXT(sizei n, 3835bd8deadSopenharmony_ci uint *semaphores); 3845bd8deadSopenharmony_ci 3855bd8deadSopenharmony_ci returns <n> previous unused semaphore names in <semaphores>. 3865bd8deadSopenharmony_ci These names are marked as used, for the purposes of 3875bd8deadSopenharmony_ci GenSemaphoresEXT only, but they are associated with semaphore 3885bd8deadSopenharmony_ci state only when an external semaphore handle is imported to 3895bd8deadSopenharmony_ci them. 3905bd8deadSopenharmony_ci 3915bd8deadSopenharmony_ci Semaphore objects are deleted by calling 3925bd8deadSopenharmony_ci 3935bd8deadSopenharmony_ci void DeleteSemaphoresEXT(sizei n, 3945bd8deadSopenharmony_ci const uint *semaphores); 3955bd8deadSopenharmony_ci 3965bd8deadSopenharmony_ci <semaphores> contains <n> names of semaphores to be deleted. 3975bd8deadSopenharmony_ci After a semaphore is deleted, it unreferences any external 3985bd8deadSopenharmony_ci semaphore state it referenced, and its name is again unused. 3995bd8deadSopenharmony_ci Unused names in <semaphores> are silently ignored, as is the 4005bd8deadSopenharmony_ci value zero. 4015bd8deadSopenharmony_ci 4025bd8deadSopenharmony_ci The command 4035bd8deadSopenharmony_ci 4045bd8deadSopenharmony_ci boolean IsSemaphoreEXT(uint semaphore); 4055bd8deadSopenharmony_ci 4065bd8deadSopenharmony_ci returns TRUE if <semaphore> is the name of a semaphore. If 4075bd8deadSopenharmony_ci <semaphore> is zero, or if <semaphore> is a non-zero value that 4085bd8deadSopenharmony_ci is not the name of a semaphore, IsSemaphore returns FALSE. 4095bd8deadSopenharmony_ci 4105bd8deadSopenharmony_ci 4.2.1 Importing External Semaphore Handles into Semaphores 4115bd8deadSopenharmony_ci 4125bd8deadSopenharmony_ci A semaphore is created by importing an external semaphore object 4135bd8deadSopenharmony_ci via a reference to its associated external handle. The 4145bd8deadSopenharmony_ci supported set of external handle types and associated import 4155bd8deadSopenharmony_ci functions are listed in table 4.2. 4165bd8deadSopenharmony_ci 4175bd8deadSopenharmony_ci Table 4.2: Commands for importing external semaphore handles. 4185bd8deadSopenharmony_ci 4195bd8deadSopenharmony_ci | Handle Type | Import command | 4205bd8deadSopenharmony_ci +-------------+----------------+ 4215bd8deadSopenharmony_ci +-------------+----------------+ 4225bd8deadSopenharmony_ci 4235bd8deadSopenharmony_ci Applications must only import external semaphore handles exported 4245bd8deadSopenharmony_ci from the same device or set of devices used by the current context, 4255bd8deadSopenharmony_ci and from compatible driver versions. To determine which devices are 4265bd8deadSopenharmony_ci used by the current context, first call GetIntegerv with <pname> set 4275bd8deadSopenharmony_ci to NUM_DEVICE_UUIDS_EXT, then call GetUnsignedBytei_vEXT with <target> 4285bd8deadSopenharmony_ci set to DEVICE_UUID_EXT, <index> set to a value in the range [0, 4295bd8deadSopenharmony_ci <number of device UUIDs>), and <data> set to point to an array of 4305bd8deadSopenharmony_ci UUID_SIZE_EXT unsigned bytes. To determine the driver ID of the 4315bd8deadSopenharmony_ci current context, call GetUnsignedBytevEXT with <pname> set to 4325bd8deadSopenharmony_ci DRIVER_UUID_EXT and <data> set to point to an array of UUID_SIZE_EXT 4335bd8deadSopenharmony_ci unsigned bytes. 4345bd8deadSopenharmony_ci 4355bd8deadSopenharmony_ci These device and driver ID values can be used to correlate devices 4365bd8deadSopenharmony_ci and determine driver compatibility across process and API boundaries. 4375bd8deadSopenharmony_ci 4385bd8deadSopenharmony_ci External handles are often defined using platform-specific 4395bd8deadSopenharmony_ci types. Therefore, the base GL specification defines no methods 4405bd8deadSopenharmony_ci to import an external handle. 4415bd8deadSopenharmony_ci 4425bd8deadSopenharmony_ci 4.2.2 Semaphore Parameters 4435bd8deadSopenharmony_ci 4445bd8deadSopenharmony_ci Semaphore parameters control how semaphore wait and signal 4455bd8deadSopenharmony_ci operations behave. Table 4.3 defines which parameters are available 4465bd8deadSopenharmony_ci for a semaphore based on the external handle type from which it was 4475bd8deadSopenharmony_ci imported. Semaphore parameters are set using the command 4485bd8deadSopenharmony_ci 4495bd8deadSopenharmony_ci void SemaphoreParameterui64vEXT(uint semaphore, 4505bd8deadSopenharmony_ci enum pname, 4515bd8deadSopenharmony_ci const uint64 *params); 4525bd8deadSopenharmony_ci 4535bd8deadSopenharmony_ci <semaphore> is the name of the semaphore object on which the 4545bd8deadSopenharmony_ci parameter <pname> will be set to the value(s) in <pname>. 4555bd8deadSopenharmony_ci 4565bd8deadSopenharmony_ci Table 4.3: Semaphore parameters 4575bd8deadSopenharmony_ci 4585bd8deadSopenharmony_ci | Name | External Handle Types | Legal Values | 4595bd8deadSopenharmony_ci +------+-----------------------+--------------+ 4605bd8deadSopenharmony_ci +------+-----------------------+--------------+ 4615bd8deadSopenharmony_ci 4625bd8deadSopenharmony_ci Parameters of a semaphore object may be queried with the command 4635bd8deadSopenharmony_ci 4645bd8deadSopenharmony_ci void GetSemaphoreParameterui64EXT(uint semaphore, 4655bd8deadSopenharmony_ci enum pname, 4665bd8deadSopenharmony_ci uint64 *params); 4675bd8deadSopenharmony_ci 4685bd8deadSopenharmony_ci <semaphore> is the semaphore object from with the parameter <pname> 4695bd8deadSopenharmony_ci is queried. The value(s) of the parameter are returned in <params>. 4705bd8deadSopenharmony_ci <pname> may be any value in table 4.3. 4715bd8deadSopenharmony_ci 4725bd8deadSopenharmony_ci 4.2.3 Waiting for Semaphores 4735bd8deadSopenharmony_ci 4745bd8deadSopenharmony_ci The command 4755bd8deadSopenharmony_ci 4765bd8deadSopenharmony_ci void WaitSemaphoreEXT(uint semaphore, 4775bd8deadSopenharmony_ci uint numBufferBarriers, 4785bd8deadSopenharmony_ci const uint *buffers, 4795bd8deadSopenharmony_ci uint numTextureBarriers, 4805bd8deadSopenharmony_ci const uint *textures, 4815bd8deadSopenharmony_ci const GLenum *srcLayouts); 4825bd8deadSopenharmony_ci 4835bd8deadSopenharmony_ci Returns immediately but causes GL server to block until 4845bd8deadSopenharmony_ci <semaphore> is signaled. If an error occurs, WaitSemaphore 4855bd8deadSopenharmony_ci generates a GL error as specified below, and does not cause the 4865bd8deadSopenharmony_ci GL server to block. 4875bd8deadSopenharmony_ci 4885bd8deadSopenharmony_ci After completion of the semaphore wait operation, the semaphore 4895bd8deadSopenharmony_ci will be returned to the unsignaled state. Calling WaitSemaphore on 4905bd8deadSopenharmony_ci a semaphore that has not previously had a signal operation flushed 4915bd8deadSopenharmony_ci to the GL server or submitted by an external semaphore signaler 4925bd8deadSopenharmony_ci since the semaphore was created or last waited on results in 4935bd8deadSopenharmony_ci undefined behavior. 4945bd8deadSopenharmony_ci 4955bd8deadSopenharmony_ci Following completion of the semaphore wait operation, memory will 4965bd8deadSopenharmony_ci also be made visible in the specified buffer and texture objects. 4975bd8deadSopenharmony_ci Since texture layout state is managed internally by the GL, but may 4985bd8deadSopenharmony_ci have been modified by an external API, the current layout of the 4995bd8deadSopenharmony_ci textures must be specified to initialize internal GL state prior to 5005bd8deadSopenharmony_ci using the textures after an external access. The valid layouts 5015bd8deadSopenharmony_ci correspond to those specified by the Vulkan API, as described in 5025bd8deadSopenharmony_ci table 4.4. However, the layouts do not necessarily correspond to an 5035bd8deadSopenharmony_ci optimal state for any particular GL operation. The GL will simply 5045bd8deadSopenharmony_ci perform appropriate transitions internally as necessary based on the 5055bd8deadSopenharmony_ci specified current layout of the texture. 5065bd8deadSopenharmony_ci 5075bd8deadSopenharmony_ci Table 4.4: Texture layouts and corresponding Vulkan Image Layouts 5085bd8deadSopenharmony_ci 5095bd8deadSopenharmony_ci | Texture Layout | Equivalent Vulkan Image Layout | 5105bd8deadSopenharmony_ci +--------------------------------------------------+----------------------------------------------------------------+ 5115bd8deadSopenharmony_ci | GL_NONE | VK_IMAGE_LAYOUT_UNDEFINED | 5125bd8deadSopenharmony_ci | GL_LAYOUT_GENERAL_EXT | VK_IMAGE_LAYOUT_GENERAL | 5135bd8deadSopenharmony_ci | GL_LAYOUT_COLOR_ATTACHMENT_EXT | VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL | 5145bd8deadSopenharmony_ci | GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT | VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT | 5155bd8deadSopenharmony_ci | GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT | VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL | 5165bd8deadSopenharmony_ci | GL_LAYOUT_SHADER_READ_ONLY_EXT | VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL | 5175bd8deadSopenharmony_ci | GL_LAYOUT_TRANSFER_SRC_EXT | VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL | 5185bd8deadSopenharmony_ci | GL_LAYOUT_TRANSFER_DST_EXT | VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL | 5195bd8deadSopenharmony_ci | GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT | VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR | 5205bd8deadSopenharmony_ci | GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT | VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR | 5215bd8deadSopenharmony_ci +-------------------------------------------------------------------------------------------------------------------+ 5225bd8deadSopenharmony_ci 5235bd8deadSopenharmony_ci 4.2.4 Signaling Semaphores 5245bd8deadSopenharmony_ci 5255bd8deadSopenharmony_ci The command 5265bd8deadSopenharmony_ci 5275bd8deadSopenharmony_ci void SignalSemaphoreEXT(uint semaphore, 5285bd8deadSopenharmony_ci uint numBufferBarriers, 5295bd8deadSopenharmony_ci const uint *buffers, 5305bd8deadSopenharmony_ci uint numTextureBarriers, 5315bd8deadSopenharmony_ci const uint *textures, 5325bd8deadSopenharmony_ci const GLenum *dstLayouts); 5335bd8deadSopenharmony_ci 5345bd8deadSopenharmony_ci will insert a semaphore signaling operation in the GL command 5355bd8deadSopenharmony_ci stream, and flush the command stream as if /Flush/ were inserted 5365bd8deadSopenharmony_ci immediately after the semaphore operation. 5375bd8deadSopenharmony_ci 5385bd8deadSopenharmony_ci Prior to signaling the semaphore, memory used by the specified 5395bd8deadSopenharmony_ci buffer objects and textures will be made visible, and textures 5405bd8deadSopenharmony_ci can be transitioned to a specified internal layout to allow 5415bd8deadSopenharmony_ci applications to access the textures using a consistent layout in 5425bd8deadSopenharmony_ci an external API or process. Possible layouts are specified in 5435bd8deadSopenharmony_ci table 4.3, along with their corresponding layout in the Vulkan 5445bd8deadSopenharmony_ci API. 5455bd8deadSopenharmony_ci 5465bd8deadSopenharmony_ciAdd a new Chapter, "Memory Objects", between Chapter 5 (Shared Objects 5475bd8deadSopenharmony_ciand Multiple Contexts) and Chapter 6 (Buffer Objects) 5485bd8deadSopenharmony_ci 5495bd8deadSopenharmony_ci Memory objects reference a fixed-size allocation of abstract server 5505bd8deadSopenharmony_ci memory. The memory may not be accessed directly, but may be bound 5515bd8deadSopenharmony_ci to other objects that require a data store in server memory. The 5525bd8deadSopenharmony_ci memory itself is allocated outside the scope of the GL, and is 5535bd8deadSopenharmony_ci merely referenced by a memory object. 5545bd8deadSopenharmony_ci 5555bd8deadSopenharmony_ci The command 5565bd8deadSopenharmony_ci 5575bd8deadSopenharmony_ci void CreateMemoryObjectsEXT(sizei n, uint *memoryObjects); 5585bd8deadSopenharmony_ci 5595bd8deadSopenharmony_ci returns <n> previously unused memory object names in <memoryObjects>. 5605bd8deadSopenharmony_ci The memory objects named contain default state, but initially have no 5615bd8deadSopenharmony_ci external memory associated with them. 5625bd8deadSopenharmony_ci 5635bd8deadSopenharmony_ci Memory objects are deleted by calling 5645bd8deadSopenharmony_ci 5655bd8deadSopenharmony_ci void DeleteMemoryObjectsEXT(sizei n, const uint *memoryObjects); 5665bd8deadSopenharmony_ci 5675bd8deadSopenharmony_ci <memoryObjects> contains <n> names of memory objects to be deleted. 5685bd8deadSopenharmony_ci After a memory object is deleted, it references no server memory, 5695bd8deadSopenharmony_ci and its name is again unused. 5705bd8deadSopenharmony_ci 5715bd8deadSopenharmony_ci Unused names in <memoryObjects> are silently ignored, as is the 5725bd8deadSopenharmony_ci value zero. 5735bd8deadSopenharmony_ci 5745bd8deadSopenharmony_ci The command 5755bd8deadSopenharmony_ci 5765bd8deadSopenharmony_ci boolean IsMemoryObjectEXT(uint memoryObject); 5775bd8deadSopenharmony_ci 5785bd8deadSopenharmony_ci returns TRUE if <memoryObject> is the name of a memory object. If 5795bd8deadSopenharmony_ci <memoryObject> is zero, or if <memoryObject> is a non-zero value 5805bd8deadSopenharmony_ci that is not the name of a memory object, IsMemoryObjectEXT returns 5815bd8deadSopenharmony_ci FALSE. 5825bd8deadSopenharmony_ci 5835bd8deadSopenharmony_ci 6.1 Importing Abstract Memory into a Memory Object 5845bd8deadSopenharmony_ci 5855bd8deadSopenharmony_ci A memory object is associated with external memory by importing an 5865bd8deadSopenharmony_ci externally-allocated abstract memory region via a reference to an 5875bd8deadSopenharmony_ci associated external handle. The supported set of external handle types 5885bd8deadSopenharmony_ci and their corresponding import functions are listed in table 6.1. 5895bd8deadSopenharmony_ci 5905bd8deadSopenharmony_ci Table 6.1: Commands for importing external memory handles. 5915bd8deadSopenharmony_ci 5925bd8deadSopenharmony_ci | Handle Type | Import command | 5935bd8deadSopenharmony_ci +-------------+----------------+ 5945bd8deadSopenharmony_ci +-------------+----------------+ 5955bd8deadSopenharmony_ci 5965bd8deadSopenharmony_ci Applications must only import external memory handles exported 5975bd8deadSopenharmony_ci from the same device or set of devices used by the current context. 5985bd8deadSopenharmony_ci Refer to section 4.2.1 for methods to determine which devices are 5995bd8deadSopenharmony_ci used by the current context. 6005bd8deadSopenharmony_ci 6015bd8deadSopenharmony_ci External handles are often defined using platform-specific types. 6025bd8deadSopenharmony_ci Therefore, the base GL specification defines no methods to import an 6035bd8deadSopenharmony_ci external handle. 6045bd8deadSopenharmony_ci 6055bd8deadSopenharmony_ci 6.2 Memory object parameters 6065bd8deadSopenharmony_ci 6075bd8deadSopenharmony_ci Memory object parameters are set using the command 6085bd8deadSopenharmony_ci 6095bd8deadSopenharmony_ci void MemoryObjectParameterivEXT(uint memoryObject, 6105bd8deadSopenharmony_ci enum pname, 6115bd8deadSopenharmony_ci const int *params); 6125bd8deadSopenharmony_ci 6135bd8deadSopenharmony_ci <memoryObject> is the name of the memory object on which the parameter 6145bd8deadSopenharmony_ci <pname> will be set to the value(s) in <params>. The possible values for 6155bd8deadSopenharmony_ci <pname> are specified in table 6.2. 6165bd8deadSopenharmony_ci 6175bd8deadSopenharmony_ci Table 6.2: Memory Object Parameters. 6185bd8deadSopenharmony_ci 6195bd8deadSopenharmony_ci | Name | Legal Values | 6205bd8deadSopenharmony_ci +-----------------------------+--------------+ 6215bd8deadSopenharmony_ci | DEDICATED_MEMORY_OBJECT_EXT | FALSE, TRUE | 6225bd8deadSopenharmony_ci | PROTECTED_MEMORY_OBJECT_EXT | FALSE, TRUE | 6235bd8deadSopenharmony_ci +-----------------------------+--------------+ 6245bd8deadSopenharmony_ci 6255bd8deadSopenharmony_ci The parameter DEDICATED_MEMORY_OBJECT_EXT must be set to TRUE when the 6265bd8deadSopenharmony_ci external memory handle from which the object's memory will be imported 6275bd8deadSopenharmony_ci was created as a dedicated allocation. 6285bd8deadSopenharmony_ci 6295bd8deadSopenharmony_ci The parameter PROTECTED_MEMORY_OBJECT_EXT must be set to TRUE when the 6305bd8deadSopenharmony_ci external memory handle from which the object's memory will be imported 6315bd8deadSopenharmony_ci refers to a protected resource. The definition of a protected resource 6325bd8deadSopenharmony_ci is outside the scope of this extension. 6335bd8deadSopenharmony_ci 6345bd8deadSopenharmony_ci Memory object parameters become immutable once the object is associated 6355bd8deadSopenharmony_ci with external memory by an import operation. An INVALID_OPERATION error 6365bd8deadSopenharmony_ci is generated if <memoryObject> is immutable. 6375bd8deadSopenharmony_ci 6385bd8deadSopenharmony_ci The parameters of a memory object may be queried with the command: 6395bd8deadSopenharmony_ci 6405bd8deadSopenharmony_ci void GetMemoryObjectParameterivEXT(uint memoryObject 6415bd8deadSopenharmony_ci enum pname, 6425bd8deadSopenharmony_ci int *params); 6435bd8deadSopenharmony_ci 6445bd8deadSopenharmony_ci The value(s) of the parameter <pname> from the memory object 6455bd8deadSopenharmony_ci <memoryObject> are returned in <params>. 6465bd8deadSopenharmony_ci 6475bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 4.5 Specification (Buffer Objects) 6485bd8deadSopenharmony_ci 6495bd8deadSopenharmony_ci Modify the list of commands described in 6.2 "Creating and Modifying 6505bd8deadSopenharmony_ci Buffer Object Data Stores" to add the following: 6515bd8deadSopenharmony_ci 6525bd8deadSopenharmony_ci void BufferStorageMemEXT(enum target, 6535bd8deadSopenharmony_ci sizeiptr size, 6545bd8deadSopenharmony_ci uint memory, 6555bd8deadSopenharmony_ci uint64 offset); 6565bd8deadSopenharmony_ci 6575bd8deadSopenharmony_ci void NamedBufferStorageMemEXT(uint buffer, 6585bd8deadSopenharmony_ci sizeiptr size, 6595bd8deadSopenharmony_ci uint memory, 6605bd8deadSopenharmony_ci uint64 offset); 6615bd8deadSopenharmony_ci 6625bd8deadSopenharmony_ci Replace the two paragraphs after the above list of commands with the 6635bd8deadSopenharmony_ci following: 6645bd8deadSopenharmony_ci 6655bd8deadSopenharmony_ci "For BufferStorage and BufferStorageMemEXT, the buffer object is 6665bd8deadSopenharmony_ci that bound to <target>, which must be one of the values listed 6675bd8deadSopenharmony_ci in table 6.1. For NamedBufferStorage and 6685bd8deadSopenharmony_ci NamedBufferStorageMemEXT, <buffer> is the name of the buffer 6695bd8deadSopenharmony_ci object. For all the above commands, <size> is the size of the 6705bd8deadSopenharmony_ci data store in basic machine units. For BufferStorageMemEXT and 6715bd8deadSopenharmony_ci NamedBufferStorageMemEXT, <memory> and <offset> define a region 6725bd8deadSopenharmony_ci of abstract memory that will be used as the data store for 6735bd8deadSopenharmony_ci <buffer>. The implementation may restrict which values of 6745bd8deadSopenharmony_ci <offset> are valid for a given memory object and buffer 6755bd8deadSopenharmony_ci parameter combination. These restrictions are outside the scope 6765bd8deadSopenharmony_ci of this extension and must be determined by querying the API or 6775bd8deadSopenharmony_ci mechanism which created the resource which <memory> refers to. 6785bd8deadSopenharmony_ci If an invalid offset is specified an INVALID_VALUE error is 6795bd8deadSopenharmony_ci generated. 6805bd8deadSopenharmony_ci 6815bd8deadSopenharmony_ci "The data store of the buffer object is allocated or referenced 6825bd8deadSopenharmony_ci as a result of these commands, and cannot be de-allocated or 6835bd8deadSopenharmony_ci unreferenced until the buffer is deleted with a call to 6845bd8deadSopenharmony_ci DeleteBuffers." 6855bd8deadSopenharmony_ci 6865bd8deadSopenharmony_ci Replace the paragraph that beings "BufferStorage and 6875bd8deadSopenharmony_ci NamedBufferStorage delete..." with the following: 6885bd8deadSopenharmony_ci 6895bd8deadSopenharmony_ci "BufferStorage, BufferStorageMemEXT, NamedBufferStorage, and 6905bd8deadSopenharmony_ci NamedBufferStorageMemEXT delete any existing data store, and set 6915bd8deadSopenharmony_ci the values of the buffer object's state variables as shown in 6925bd8deadSopenharmony_ci table 6.3." 6935bd8deadSopenharmony_ci 6945bd8deadSopenharmony_ci Add the following to the list of errors for the BufferStorage 6955bd8deadSopenharmony_ci functions" 6965bd8deadSopenharmony_ci 6975bd8deadSopenharmony_ci "An INVALID_VALUE error is generated by BufferStorageMemEXT and 6985bd8deadSopenharmony_ci NamedBufferStorageMemEXT if <memory> is 0, or if <offset> + 6995bd8deadSopenharmony_ci <size> is greater than the size of the specified 7005bd8deadSopenharmony_ci memory object. 7015bd8deadSopenharmony_ci 7025bd8deadSopenharmony_ci "An INVALID_VALUE error is generated if <offset> is not a valid 7035bd8deadSopenharmony_ci value for <memory> or the texture." 7045bd8deadSopenharmony_ci 7055bd8deadSopenharmony_ci "An INVALID_OPERATION error is generated if <memory> names a valid 7065bd8deadSopenharmony_ci memory object which has no associated memory." 7075bd8deadSopenharmony_ci 7085bd8deadSopenharmony_ci Modify the header for the third column in table 6.2 to read 7095bd8deadSopenharmony_ci "Value for *BufferStorage*", and update the table description to 7105bd8deadSopenharmony_ci include the new memory object buffer storage commands. 7115bd8deadSopenharmony_ci 7125bd8deadSopenharmony_ci Modify the first sentence of section 6.3, "Mapping and Unmapping 7135bd8deadSopenharmony_ci Buffer Data", to read as follows: 7145bd8deadSopenharmony_ci 7155bd8deadSopenharmony_ci "If the data store for a buffer object is not a reference to a 7165bd8deadSopenharmony_ci memory object, all or part of the data store may be mapped into 7175bd8deadSopenharmony_ci the client's address space with the commands:" 7185bd8deadSopenharmony_ci 7195bd8deadSopenharmony_ci Add the following to the list of errors for the MapBufferRange and 7205bd8deadSopenharmony_ci MapNamedBufferRange commands: 7215bd8deadSopenharmony_ci 7225bd8deadSopenharmony_ci An INVALID_OPERATION error is generated by Map*BufferRange if 7235bd8deadSopenharmony_ci the specified buffer is referencing a memory object as its data 7245bd8deadSopenharmony_ci store. 7255bd8deadSopenharmony_ci 7265bd8deadSopenharmony_ciAdditions to Chapter 8 of the OpenGL 4.5 Specification (Textures and 7275bd8deadSopenharmony_ciSamplers) 7285bd8deadSopenharmony_ci 7295bd8deadSopenharmony_ci For each list of TexStorage* commands in the 1D, 2D, 3D, 7305bd8deadSopenharmony_ci 2DMultisample, and 3DMultisample families, add the following 7315bd8deadSopenharmony_ci variants: 7325bd8deadSopenharmony_ci 7335bd8deadSopenharmony_ci void TexStorageMem*EXT(<existing parameters>, 7345bd8deadSopenharmony_ci uint memory, 7355bd8deadSopenharmony_ci uint64 offset); 7365bd8deadSopenharmony_ci 7375bd8deadSopenharmony_ci void TextureStorageMem*EXT(<existing parameters>, 7385bd8deadSopenharmony_ci uint memory, 7395bd8deadSopenharmony_ci uint64 offset); 7405bd8deadSopenharmony_ci 7415bd8deadSopenharmony_ci For each family of TexStorage* commands, add appropriate language to 7425bd8deadSopenharmony_ci the description based on the following template: 7435bd8deadSopenharmony_ci 7445bd8deadSopenharmony_ci "Calling TexStorageMem*EXT or TextureStorageMem*EXT is 7455bd8deadSopenharmony_ci equivalent to calling TexStorage* or TextureStorage* 7465bd8deadSopenharmony_ci except that rather than allocating new memory for the texture's 7475bd8deadSopenharmony_ci image data, the memory at <offset> in the memory object 7485bd8deadSopenharmony_ci specified by <memory> will be used. The implementation may 7495bd8deadSopenharmony_ci restrict which values of <offset> are valid for a given memory 7505bd8deadSopenharmony_ci object and texture parameter combination. These restrictions are 7515bd8deadSopenharmony_ci outside the scope of this extension and must be determined by 7525bd8deadSopenharmony_ci querying the API or mechanism which created the resource which 7535bd8deadSopenharmony_ci <memory> refers to. If an invalid offset is specified an 7545bd8deadSopenharmony_ci INVALID_VALUE error is generated." 7555bd8deadSopenharmony_ci 7565bd8deadSopenharmony_ci Add errors based on the following template for each family of 7575bd8deadSopenharmony_ci TexStorage* commands: 7585bd8deadSopenharmony_ci 7595bd8deadSopenharmony_ci "An INVALID_VALUE error is generated if <memory> is 0, or if 7605bd8deadSopenharmony_ci the memory object is not large enough to contain the specified 7615bd8deadSopenharmony_ci texture's image data." 7625bd8deadSopenharmony_ci 7635bd8deadSopenharmony_ci "An INVALID_VALUE error is generated if <offset> is not a valid 7645bd8deadSopenharmony_ci value for <memory> or the texture." 7655bd8deadSopenharmony_ci 7665bd8deadSopenharmony_ci "An INVALID_OPERATION error is generated if <memory> names a valid 7675bd8deadSopenharmony_ci memory object which has no associated memory." 7685bd8deadSopenharmony_ci 7695bd8deadSopenharmony_ci "An INVALID_OPERATION error is generated if <memory> is a protected 7705bd8deadSopenharmony_ci memory object and the texture parameter TEXTURE_PROTECTED_EXT is not 7715bd8deadSopenharmony_ci TRUE." 7725bd8deadSopenharmony_ci 7735bd8deadSopenharmony_ci Insert the following before Table 8.17: 7745bd8deadSopenharmony_ci 7755bd8deadSopenharmony_ci "If <pname> is TEXTURE_TILING_EXT then the state is stored in the 7765bd8deadSopenharmony_ci texture, but only takes effect the next time storage is allocated 7775bd8deadSopenharmony_ci from a memory object for the texture object using TexStorageMem*EXT 7785bd8deadSopenharmony_ci or TextureStorageMem*EXT. If the value of TEXTURE_IMMUTABLE_FORMAT 7795bd8deadSopenharmony_ci is TRUE, then TEXTURE_TILING_EXT cannot be changed and an 7805bd8deadSopenharmony_ci INVALID_OPERATION error is generated." 7815bd8deadSopenharmony_ci 7825bd8deadSopenharmony_ci Add the following to table 8.17: Texture parameters and their values. 7835bd8deadSopenharmony_ci 7845bd8deadSopenharmony_ci | Name | Type | Legal values | 7855bd8deadSopenharmony_ci +--------------------+---------+---------------------------------------+ 7865bd8deadSopenharmony_ci | TEXTURE_TILING_EXT | enum | OPTIMAL_TILING_EXT, LINEAR_TILING_EXT | 7875bd8deadSopenharmony_ci +--------------------+---------+---------------------------------------+ 7885bd8deadSopenharmony_ci 7895bd8deadSopenharmony_ciAdditions to Chapter 21 of the OpenGL 4.5 Specification (Special Functions) 7905bd8deadSopenharmony_ci 7915bd8deadSopenharmony_ci Add the following to section 21.4.1, Commands Not Usable in Display 7925bd8deadSopenharmony_ci Lists. 7935bd8deadSopenharmony_ci 7945bd8deadSopenharmony_ci Under the "Memory objects" section: 7955bd8deadSopenharmony_ci 7965bd8deadSopenharmony_ci DeleteMemoryObjectsEXT, CreateMemoryObjectsEXT, 7975bd8deadSopenharmony_ci MemoryObjectParameterivEXT 7985bd8deadSopenharmony_ci 7995bd8deadSopenharmony_ci Under the "Pixels and textures" section: 8005bd8deadSopenharmony_ci 8015bd8deadSopenharmony_ci TexStorageMem2DEXT, TexStorageMem2DMultisampleEXT, 8025bd8deadSopenharmony_ci TexStorageMem3DEXT, TexStorageMem3DMultisampleEXT, 8035bd8deadSopenharmony_ci TextureStorageMem2DEXT, TextureStorageMem2DMultisampleEXT, 8045bd8deadSopenharmony_ci TextureStorageMem3DEXT, TextureStorageMem3DMultisampleEXT, 8055bd8deadSopenharmony_ci TexStorageMem1DEXT, TextureStorageMem1DEXT 8065bd8deadSopenharmony_ci 8075bd8deadSopenharmony_ci Under the "Buffer objects" section: 8085bd8deadSopenharmony_ci 8095bd8deadSopenharmony_ci BufferStorageMemEXT, NamedBufferStorageMemEXT 8105bd8deadSopenharmony_ci 8115bd8deadSopenharmony_ci Under the "GL command stream management" section: 8125bd8deadSopenharmony_ci 8135bd8deadSopenharmony_ci GenSemaphoresEXT, DeleteSemaphoresEXT, SemaphoreParameterui64vEXT, 8145bd8deadSopenharmony_ci WaitSemaphoreEXT, SignalSemaphoreEXT 8155bd8deadSopenharmony_ci 8165bd8deadSopenharmony_ciAdditions to Chapter 22 of the OpenGL 4.5 Specification (Context state 8175bd8deadSopenharmony_ciQueries) 8185bd8deadSopenharmony_ci 8195bd8deadSopenharmony_ci Add the following to the end of the first list of functions in section 8205bd8deadSopenharmony_ci 22.1, Simple Queries: 8215bd8deadSopenharmony_ci 8225bd8deadSopenharmony_ci void GetUnsignedBytevEXT(enum pname, 8235bd8deadSopenharmony_ci ubyte *data); 8245bd8deadSopenharmony_ci 8255bd8deadSopenharmony_ci Replace the sentence following that list with: 8265bd8deadSopenharmony_ci 8275bd8deadSopenharmony_ci The commands obtain boolean, integer, 64-bit integer, floating- 8285bd8deadSopenharmony_ci point, double-precision, or unsigned byte state variables. 8295bd8deadSopenharmony_ci 8305bd8deadSopenharmony_ci Add the following to the end of the list of indexed simple state query 8315bd8deadSopenharmony_ci commands: 8325bd8deadSopenharmony_ci 8335bd8deadSopenharmony_ci void GetUnsignedBytei_vEXT(enum target, 8345bd8deadSopenharmony_ci uint index, 8355bd8deadSopenharmony_ci ubyte *data); 8365bd8deadSopenharmony_ci 8375bd8deadSopenharmony_ci 8385bd8deadSopenharmony_ci 8395bd8deadSopenharmony_ci Add the following to section 22.3.2, Other Internal Format Queries: 8405bd8deadSopenharmony_ci 8415bd8deadSopenharmony_ci NUM_TILING_TYPES_EXT: The number of tiling types that would be 8425bd8deadSopenharmony_ci returned by querying TILING_TYPES_EXT is returned in <params>. 8435bd8deadSopenharmony_ci 8445bd8deadSopenharmony_ci TILING_TYPES_EXT: The tiling type supported when using memory 8455bd8deadSopenharmony_ci objects to create textures with <internalFormat> and <target> 8465bd8deadSopenharmony_ci are written to <params>, in the order in which they occur in 8475bd8deadSopenharmony_ci table 22.3. Possible values are those listed in table 22.3. 8485bd8deadSopenharmony_ci 8495bd8deadSopenharmony_ci Table 22.3: Possible tiling types supported by textures using 8505bd8deadSopenharmony_ci memory objects. 8515bd8deadSopenharmony_ci 8525bd8deadSopenharmony_ci | Tiling Type | 8535bd8deadSopenharmony_ci +--------------------+ 8545bd8deadSopenharmony_ci | OPTIMAL_TILING_EXT | 8555bd8deadSopenharmony_ci | LINEAR_TILING_EXT | 8565bd8deadSopenharmony_ci +--------------------+ 8575bd8deadSopenharmony_ci 8585bd8deadSopenharmony_ciErrors 8595bd8deadSopenharmony_ci 8605bd8deadSopenharmony_ciNew State 8615bd8deadSopenharmony_ci 8625bd8deadSopenharmony_ciIssues 8635bd8deadSopenharmony_ci 8645bd8deadSopenharmony_ci 1) Should only DSA-style texture and buffer object binding 8655bd8deadSopenharmony_ci functions be added to keep the number of new functions 8665bd8deadSopenharmony_ci to a minimum? 8675bd8deadSopenharmony_ci 8685bd8deadSopenharmony_ci RESOLVED: No. Both DSA and traditional entry points will be added. 8695bd8deadSopenharmony_ci 8705bd8deadSopenharmony_ci 2) Should the type of the memory <size> and <offset> parameters be 8715bd8deadSopenharmony_ci GLsizeiptr, GLintptr, GLint64, or GLuint64? 8725bd8deadSopenharmony_ci 8735bd8deadSopenharmony_ci RESOLVED: GLuint64. This matches the VkDeviceSize semantics. 8745bd8deadSopenharmony_ci 8755bd8deadSopenharmony_ci 3) Should there be a way to allocate memory within OpenGL in 8765bd8deadSopenharmony_ci addition to importing it? 8775bd8deadSopenharmony_ci 8785bd8deadSopenharmony_ci RESOLVED: No. This could be covered in a separate extension, but 8795bd8deadSopenharmony_ci this would involve building up all the memory property 8805bd8deadSopenharmony_ci infrastructure Vulkan already has. Applications wishing to use 8815bd8deadSopenharmony_ci memory objects in OpenGL will need to leverage the allocation and 8825bd8deadSopenharmony_ci memory capability querying mechanisms present in Vulkan to perform 8835bd8deadSopenharmony_ci the actual allocations, and then map the capabilities to GL 8845bd8deadSopenharmony_ci equivalents when using them. 8855bd8deadSopenharmony_ci 8865bd8deadSopenharmony_ci 4) How are sparse textures handled? 8875bd8deadSopenharmony_ci 8885bd8deadSopenharmony_ci RESOLVED: Sparse texture support is deferred to a later extension. 8895bd8deadSopenharmony_ci Late in the development of this specification, it was discovered 8905bd8deadSopenharmony_ci that naively extending TexPageCommitmentARB to accept an offset 8915bd8deadSopenharmony_ci and memory object parameter results in a subtly awkward interface 8925bd8deadSopenharmony_ci when used to build GL sparse textures equivalent to those of Vulkan 8935bd8deadSopenharmony_ci sparse images, due to the lack of a defined memory layout ordering 8945bd8deadSopenharmony_ci for array textures. Developing a better interface would have 8955bd8deadSopenharmony_ci further delayed release of the basic functionality defined here, 8965bd8deadSopenharmony_ci which is in higher demand. 8975bd8deadSopenharmony_ci 8985bd8deadSopenharmony_ci 5) Do memory objects created as dedicated allocations need special 8995bd8deadSopenharmony_ci handling? 9005bd8deadSopenharmony_ci 9015bd8deadSopenharmony_ci RESOLVED: No. Like other memory regions, these allocations must be 9025bd8deadSopenharmony_ci bound to GL objects compatible with those they are bound to in 9035bd8deadSopenharmony_ci Vulkan to avoid aliasing issues, but otherwise no special handling 9045bd8deadSopenharmony_ci is required. 9055bd8deadSopenharmony_ci 9065bd8deadSopenharmony_ci 6) Should the BufferStorage functions still take a flags parameter? 9075bd8deadSopenharmony_ci 9085bd8deadSopenharmony_ci RESOLVED: No. The flags are not relevant when the memory has 9095bd8deadSopenharmony_ci already been allocated externally. 9105bd8deadSopenharmony_ci 9115bd8deadSopenharmony_ci 7) Should the Buffer commands be called BufferStorage or BufferData? 9125bd8deadSopenharmony_ci 9135bd8deadSopenharmony_ci RESOLVED: BufferStorage. GL has both commands, while GL ES has only 9145bd8deadSopenharmony_ci BufferData. The difference between the two GL commands is 9155bd8deadSopenharmony_ci immutability. The naming of the BufferStorage seems more consistent 9165bd8deadSopenharmony_ci with the usage, since data is not specified with these commands, but 9175bd8deadSopenharmony_ci a backing store is, and immutability for Vulkan memory-backed buffer 9185bd8deadSopenharmony_ci objects seems desirable. However, if GLES implementations can not 9195bd8deadSopenharmony_ci support immutable buffers, BufferData() support can be added in a 9205bd8deadSopenharmony_ci future extension with some added driver complexity. 9215bd8deadSopenharmony_ci 9225bd8deadSopenharmony_ci 8) Can semaphore commands be issued inside of Begin/End, or be 9235bd8deadSopenharmony_ci included in display lists? 9245bd8deadSopenharmony_ci 9255bd8deadSopenharmony_ci RESOLVED: No. 9265bd8deadSopenharmony_ci 9275bd8deadSopenharmony_ci 9) Do ownership transfer and memory barrier commands need to be 9285bd8deadSopenharmony_ci included in the semaphore operations? 9295bd8deadSopenharmony_ci 9305bd8deadSopenharmony_ci RESOLVED: Yes, these are needed for proper synchronization on some 9315bd8deadSopenharmony_ci implementations. Presumably only the source side of the barriers 9325bd8deadSopenharmony_ci needs to be specified when transitioning from external to GL usage, 9335bd8deadSopenharmony_ci and only the destination side needs to be specified when 9345bd8deadSopenharmony_ci transitioning from GL to external usage. That should give the 9355bd8deadSopenharmony_ci OpenGL driver sufficient knowledge to perform any needed automatic 9365bd8deadSopenharmony_ci transitions based on subsequent usage within the GL API. 9375bd8deadSopenharmony_ci 9385bd8deadSopenharmony_ci Still, it is unclear how much of the Vulkan pipeline barrier API 9395bd8deadSopenharmony_ci should be explicitly exposed in the GL API: 9405bd8deadSopenharmony_ci 9415bd8deadSopenharmony_ci * Should queue ownership be included? There is no equivalent 9425bd8deadSopenharmony_ci idiom to define this on top of in GL. However, since the 9435bd8deadSopenharmony_ci external side is the only portion specified by the 9445bd8deadSopenharmony_ci application, it could be described in Vulkan terms. 9455bd8deadSopenharmony_ci 9465bd8deadSopenharmony_ci * Should image layout be included? Similar to the above, there 9475bd8deadSopenharmony_ci is no GL concept of this, but Vulkan terms could be leveraged. 9485bd8deadSopenharmony_ci 9495bd8deadSopenharmony_ci * Should access type be included? This maps relatively well to 9505bd8deadSopenharmony_ci OpenGL memory barrier bits, but there is not a 1-1 9515bd8deadSopenharmony_ci correspondence. 9525bd8deadSopenharmony_ci 9535bd8deadSopenharmony_ci * Should the pipeline stage be included? This could be mapped 9545bd8deadSopenharmony_ci to stages defined in the GL state machine, but such explicit 9555bd8deadSopenharmony_ci references to the stages are not thus far included in GL 9565bd8deadSopenharmony_ci language or tokens. 9575bd8deadSopenharmony_ci 9585bd8deadSopenharmony_ci Another option is to require the Vulkan driver to put images, 9595bd8deadSopenharmony_ci buffers, and their memory in a particular state before sharing 9605bd8deadSopenharmony_ci them with OpenGL. For example, require applications to 9615bd8deadSopenharmony_ci transition to the GENERAL image layout, dstStageMask of 9625bd8deadSopenharmony_ci TOP_OF_PIPE or ALL_COMMANDS, dstAccessMask will include 9635bd8deadSopenharmony_ci MEMORY_WRITE_BIT | MEMORY_READ_BIT or some new "more external" 9645bd8deadSopenharmony_ci version of these, and the dstQueueFamilyIndex must be IGNORED 9655bd8deadSopenharmony_ci while srcQueueFamilyIndex must be a valid queue family (a 9665bd8deadSopenharmony_ci currently illegal situation). 9675bd8deadSopenharmony_ci 9685bd8deadSopenharmony_ci 10) Should the barrier functionality be included in the semaphore 9695bd8deadSopenharmony_ci operation commands? 9705bd8deadSopenharmony_ci 9715bd8deadSopenharmony_ci RESOLVED: Yes. The only time such barriers are required in GL is 9725bd8deadSopenharmony_ci when synchronizing with external memory accesses, which is also the 9735bd8deadSopenharmony_ci only time semaphores should be used. For internal synchronization, 9745bd8deadSopenharmony_ci existing GL and EGL commands should be used. Since the use cases 9755bd8deadSopenharmony_ci align, it makes sense to make them a single command to cut down on 9765bd8deadSopenharmony_ci the potential for misuse and keep the API footprint as small as 9775bd8deadSopenharmony_ci possible. 9785bd8deadSopenharmony_ci 9795bd8deadSopenharmony_ci 11) Must both Gen[MemoryObjects,Semaphores]EXT commands and 9805bd8deadSopenharmony_ci Create[MemoryObjects,Semaphores]EXT commands be defined, or is 9815bd8deadSopenharmony_ci one or the other sufficient? 9825bd8deadSopenharmony_ci 9835bd8deadSopenharmony_ci RESOLVED: One variant is sufficient for each object type. 9845bd8deadSopenharmony_ci 9855bd8deadSopenharmony_ci 12) Should buffer objects backed by memory objects be mappable? 9865bd8deadSopenharmony_ci 9875bd8deadSopenharmony_ci RESOLVED: No. This would complicate the API as interactions between 9885bd8deadSopenharmony_ci GL and Vulkan cache flushing semantics would need to be defined. 9895bd8deadSopenharmony_ci 9905bd8deadSopenharmony_ci 13) Does the usage information provided when creating Vulkan images 9915bd8deadSopenharmony_ci need to be specified when creating textures on memory objects? 9925bd8deadSopenharmony_ci If so, how is it specified? 9935bd8deadSopenharmony_ci 9945bd8deadSopenharmony_ci RESOLVED: There are a few options for specifying the usage in 9955bd8deadSopenharmony_ci OpenGL: 9965bd8deadSopenharmony_ci 9975bd8deadSopenharmony_ci * Have some sort of GLX/EGL-like attrib list that allows users 9985bd8deadSopenharmony_ci to specify an arbitrary set of usage parameters. 9995bd8deadSopenharmony_ci 10005bd8deadSopenharmony_ci * Allow applications to re-use the Vulkan usage flags directly 10015bd8deadSopenharmony_ci in GL. 10025bd8deadSopenharmony_ci 10035bd8deadSopenharmony_ci * Re-define all the Vulkan image usage flags in GL, and update 10045bd8deadSopenharmony_ci the list via new GL interop extensions as new Vulkan usage 10055bd8deadSopenharmony_ci flags are added by Vulkan extensions. 10065bd8deadSopenharmony_ci 10075bd8deadSopenharmony_ci None of these are very compelling. They all complicate the OpenGL 10085bd8deadSopenharmony_ci API significantly and have a high spec maintenance burden as new 10095bd8deadSopenharmony_ci extensions are added. 10105bd8deadSopenharmony_ci 10115bd8deadSopenharmony_ci Other options for resolving the overall issue of GL knowing the 10125bd8deadSopenharmony_ci usage include: 10135bd8deadSopenharmony_ci 10145bd8deadSopenharmony_ci * Disallow Vulkan implementations from utilizing the usage 10155bd8deadSopenharmony_ci information as input when determining the internal parameters of a 10165bd8deadSopenharmony_ci Vulkan image used with external memory. 10175bd8deadSopenharmony_ci 10185bd8deadSopenharmony_ci * Only allow Vulkan implementations to utilize the usage information 10195bd8deadSopenharmony_ci when using the dedicated allocation path where it can be stored as 10205bd8deadSopenharmony_ci a form of metadata along with the memory. 10215bd8deadSopenharmony_ci 10225bd8deadSopenharmony_ci * Require applications to specify all supported usage flags at image 10235bd8deadSopenharmony_ci creation time on the Vulkan side for images that are intended to 10245bd8deadSopenharmony_ci alias with OpenGL textures. 10255bd8deadSopenharmony_ci 10265bd8deadSopenharmony_ci The first two options have the downside of potentially limiting the 10275bd8deadSopenharmony_ci ability of implementations to fully optimize external images 10285bd8deadSopenharmony_ci regardless of their use case. The last option constrains the 10295bd8deadSopenharmony_ci limitations to the case of interoperation with OpenGL, making it a 10305bd8deadSopenharmony_ci less onerous requirement for implementations while still keeping the 10315bd8deadSopenharmony_ci OpenGL side of the API relatively simple compared to the options 10325bd8deadSopenharmony_ci involving re-specification of image usage on the OpenGL side. 10335bd8deadSopenharmony_ci 10345bd8deadSopenharmony_ci The agreed resolution is to use the final option: Require all 10355bd8deadSopenharmony_ci supported usage flags be specified by the application on the Vulkan 10365bd8deadSopenharmony_ci side if the image is intended to alias with an OpenGL texture. 10375bd8deadSopenharmony_ci 10385bd8deadSopenharmony_ci 14) Are memory barriers for textures and buffer objects needed with 10395bd8deadSopenharmony_ci semaphore signal/wait operations, or should a blanket availability/ 10405bd8deadSopenharmony_ci visibility rule be applied like in Vulkan<->Vulkan semaphore 10415bd8deadSopenharmony_ci synchronization? 10425bd8deadSopenharmony_ci 10435bd8deadSopenharmony_ci RESOLVED: Perhaps extra availability/visibility operations need to 10445bd8deadSopenharmony_ci be performed to enable external accesses, so it is safest to require 10455bd8deadSopenharmony_ci explicit specification of the resources that need to be made 10465bd8deadSopenharmony_ci available and visible as part of a semaphore synchronization 10475bd8deadSopenharmony_ci operation. 10485bd8deadSopenharmony_ci 10495bd8deadSopenharmony_ci 15) Are OpenGL equivalents of the Vulkan image creation flags related to 10505bd8deadSopenharmony_ci sparse properties needed? 10515bd8deadSopenharmony_ci 10525bd8deadSopenharmony_ci RESOLVED: Sparse support is not included in this extension. 10535bd8deadSopenharmony_ci 10545bd8deadSopenharmony_ci Prior to this resolution, the proposed resolution was as follows: 10555bd8deadSopenharmony_ci 10565bd8deadSopenharmony_ci No. For the purposes of OpenGL, the functionality of all the Vulkan 10575bd8deadSopenharmony_ci sparse image creation flags is contained in the existing 10585bd8deadSopenharmony_ci TEXTURE_SPARSE texture parameter. Because OpenGL does not have the 10595bd8deadSopenharmony_ci same sparse feature granularity as Vulkan, applications wishing to 10605bd8deadSopenharmony_ci create a sparse image that will alias with an OpenGL sparse texture 10615bd8deadSopenharmony_ci will be required to set all of the sparse bits. Images not intended 10625bd8deadSopenharmony_ci to alias with an OpenGL texture without the TEXTURE_SPARSE flag set 10635bd8deadSopenharmony_ci must have none of the Vulkan sparse bits set. 10645bd8deadSopenharmony_ci 10655bd8deadSopenharmony_ci 16) How do Vulkan sparse block sizes and OpenGL virtual page sizes 10665bd8deadSopenharmony_ci interact? 10675bd8deadSopenharmony_ci 10685bd8deadSopenharmony_ci RESOLVED: Sparse support is not included in this extension. 10695bd8deadSopenharmony_ci 10705bd8deadSopenharmony_ci Prior to this resolution, the proposed resolution was as follows: 10715bd8deadSopenharmony_ci 10725bd8deadSopenharmony_ci The application must use an OpenGL virtual page size with dimensions 10735bd8deadSopenharmony_ci matching those of the Vulkan sparse block size for any Vulkan images 10745bd8deadSopenharmony_ci aliasing OpenGL sparse textures. If no such virtual page size exists, 10755bd8deadSopenharmony_ci such aliasing is not supported. 10765bd8deadSopenharmony_ci 10775bd8deadSopenharmony_ci 17) Is an OpenGL equivalent of the mutable format Vulkan image creation 10785bd8deadSopenharmony_ci parameter needed? 10795bd8deadSopenharmony_ci 10805bd8deadSopenharmony_ci RESOLVED: No. However, Vulkan applications will be required to set 10815bd8deadSopenharmony_ci the mutable format bit when creating an image that will alias with 10825bd8deadSopenharmony_ci an OpenGL texture on an OpenGL implementation that supports 10835bd8deadSopenharmony_ci ARB_texture_view, OES_texture_view, EXT_texture_view, or OpenGL 4.3 10845bd8deadSopenharmony_ci and above. 10855bd8deadSopenharmony_ci 10865bd8deadSopenharmony_ci 18) Is an OpenGL equivalent of the tiling Vulkan image creation 10875bd8deadSopenharmony_ci parameter needed? 10885bd8deadSopenharmony_ci 10895bd8deadSopenharmony_ci RESOLVED: Yes. Further, OpenGL implementations may not support 10905bd8deadSopenharmony_ci creating textures from Vulkan images using certain tiling types, so 10915bd8deadSopenharmony_ci a query is needed to determine the types supported. 10925bd8deadSopenharmony_ci 10935bd8deadSopenharmony_ci 19) Is a way to specify dedicated allocation semantics needed? 10945bd8deadSopenharmony_ci 10955bd8deadSopenharmony_ci RESOLVED: Yes. Importing dedicated allocation-style memory may 10965bd8deadSopenharmony_ci require the driver to use different paths than importing purely 10975bd8deadSopenharmony_ci abstract memory. Additionally, textures and buffer objects may need to derive meta-data from their associated memory object if 10985bd8deadSopenharmony_ci it is a dedicated allocation. Therefore, a dedicated allocation 10995bd8deadSopenharmony_ci parameter should be added to the memory objects. Additional 11005bd8deadSopenharmony_ci parameters for textures and buffer objects are not required because 11015bd8deadSopenharmony_ci unlike Vulkan, OpenGL exposes no application-visible texture or 11025bd8deadSopenharmony_ci buffer state that would vary depending on whether a dedicated 11035bd8deadSopenharmony_ci allocation will be used for their storage. Therefore, they can 11045bd8deadSopenharmony_ci inherit the state from the memory object associated with them at 11055bd8deadSopenharmony_ci storage specification time. Note that allowing parameters to be 11065bd8deadSopenharmony_ci specified on a memory object prior to the import operation requires 11075bd8deadSopenharmony_ci separate memory import from memory object instantiation commands. 11085bd8deadSopenharmony_ci 11095bd8deadSopenharmony_ci 20) How should devices be correlated between OpenGL Vulkan, and other 11105bd8deadSopenharmony_ci APIs? 11115bd8deadSopenharmony_ci 11125bd8deadSopenharmony_ci RESOLVED: Device UUID, LUID, and node mask queries are introduced, 11135bd8deadSopenharmony_ci corresponding to those added to the Vulkan API for external memory/ 11145bd8deadSopenharmony_ci semaphore purposes. Because contexts may be associated with 11155bd8deadSopenharmony_ci multiple physical GPUs in some cases, multiple values are returned 11165bd8deadSopenharmony_ci for device UUIDs and multiple bits are set in the device node masks. 11175bd8deadSopenharmony_ci It is not expected that a single context will be associated with 11185bd8deadSopenharmony_ci multiple DXGI adapters, so only one LUID is returned. 11195bd8deadSopenharmony_ci 11205bd8deadSopenharmony_ci When sharing with Vulkan device groups, the device UUIDs used by the 11215bd8deadSopenharmony_ci context must match those of the Vulkan physical devices in the 11225bd8deadSopenharmony_ci Vulkan device group. Future extensions could relax this 11235bd8deadSopenharmony_ci requirement. 11245bd8deadSopenharmony_ci 11255bd8deadSopenharmony_ci 21) How do applications determine valid values for the <offset> 11265bd8deadSopenharmony_ci parameter of the new storage allocation/binding functions? 11275bd8deadSopenharmony_ci 11285bd8deadSopenharmony_ci RESOLVED: This is outside the scope of this extension. The API or 11295bd8deadSopenharmony_ci mechanism which allocated the memory must provide this information. 11305bd8deadSopenharmony_ci However, the GL will generate an error if an invalid offset is used. 11315bd8deadSopenharmony_ci 11325bd8deadSopenharmony_ci 22) Are there any interactions with the EXT_protected_textures 11335bd8deadSopenharmony_ci extension? 11345bd8deadSopenharmony_ci 11355bd8deadSopenharmony_ci RESOLVED: Yes. Memory objects can be marked as protected or not 11365bd8deadSopenharmony_ci protected before import. This state must match that of the 11375bd8deadSopenharmony_ci imported resource. For all textures bound to a given memory object, 11385bd8deadSopenharmony_ci the value of the TEXTURE_PROTECTED_EXT parameter of the textures 11395bd8deadSopenharmony_ci must match the PROTECTED_MEMORY_OBJECT_EXT parameter of the memory 11405bd8deadSopenharmony_ci object. 11415bd8deadSopenharmony_ci 11425bd8deadSopenharmony_ci 23) How do applications detect when the new texture layouts 11435bd8deadSopenharmony_ci corresponding to the image layouts in VK_KHR_maintenance2 are 11445bd8deadSopenharmony_ci supported in OpenGL? 11455bd8deadSopenharmony_ci 11465bd8deadSopenharmony_ci RESOLVED: OpenGL contexts that report the GL_EXT_semaphore extension 11475bd8deadSopenharmony_ci string and have a DRIVER_UUID_EXT and DEVICE_UUID_EXT corresponding 11485bd8deadSopenharmony_ci to a Vulkan driver that supports VK_KHR_maintenance2 must support 11495bd8deadSopenharmony_ci the new OpenGL texture layouts. 11505bd8deadSopenharmony_ci 11515bd8deadSopenharmony_ciRevision History 11525bd8deadSopenharmony_ci 11535bd8deadSopenharmony_ci Revision 15, 2022-07-15 (James Jones) 11545bd8deadSopenharmony_ci - Noted SignalSemaphoreEXT implicitly flushes the command stream 11555bd8deadSopenharmony_ci - Added commands to the list of commands not permitted in display 11565bd8deadSopenharmony_ci lists. 11575bd8deadSopenharmony_ci 11585bd8deadSopenharmony_ci Revision 14, 2018-07-18 (James Jones) 11595bd8deadSopenharmony_ci - Fixed a typo: Replace NamedBufferStroage with NamedBufferStorage 11605bd8deadSopenharmony_ci 11615bd8deadSopenharmony_ci Revision 13, 2017-09-26 (James Jones) 11625bd8deadSopenharmony_ci - Added new image layouts corresponding to those from 11635bd8deadSopenharmony_ci VK_KHR_maintenance2. 11645bd8deadSopenharmony_ci - Added issue 23 and resolution. 11655bd8deadSopenharmony_ci 11665bd8deadSopenharmony_ci Revision 12, 2017-06-08 (Andres Rodriguez) 11675bd8deadSopenharmony_ci - Fixed parameter name in MemoryObjectParameterivEXT's description. 11685bd8deadSopenharmony_ci - Fixed missing EXT suffix in some mentions of GetUnsignedByte* 11695bd8deadSopenharmony_ci 11705bd8deadSopenharmony_ci Revision 11, 2017-06-02 (James Jones) 11715bd8deadSopenharmony_ci - Added extension numbers. 11725bd8deadSopenharmony_ci - Fixed the name of GetSemaphoreParameterui64vEXT. 11735bd8deadSopenharmony_ci - Clarified which extensions each command and token belongs to. 11745bd8deadSopenharmony_ci - Marked complete. 11755bd8deadSopenharmony_ci 11765bd8deadSopenharmony_ci Revision 10, 2017-05-24 (James Jones) 11775bd8deadSopenharmony_ci - Added issue 21 and resolution. 11785bd8deadSopenharmony_ci - Added issue 22 and resolution. 11795bd8deadSopenharmony_ci - Removed sparse texture support. 11805bd8deadSopenharmony_ci - Filled in real token values 11815bd8deadSopenharmony_ci - Further documented the new LAYOUT tokens. 11825bd8deadSopenharmony_ci 11835bd8deadSopenharmony_ci Revision 9, 2017-04-05 (James Jones) 11845bd8deadSopenharmony_ci - Added context device UUID queries. 11855bd8deadSopenharmony_ci 11865bd8deadSopenharmony_ci Revision 8, 2017-04-04 (James Jones) 11875bd8deadSopenharmony_ci - Clarified semaphore semantics 11885bd8deadSopenharmony_ci 11895bd8deadSopenharmony_ci Revision 7, 2017-03-28 (James Jones) 11905bd8deadSopenharmony_ci - Fixed various typos. 11915bd8deadSopenharmony_ci 11925bd8deadSopenharmony_ci Revision 6, 2017-03-17 (James Jones) 11935bd8deadSopenharmony_ci - Renamed from KHR to EXT. 11945bd8deadSopenharmony_ci - Added texture tiling parameters. 11955bd8deadSopenharmony_ci - Added semaphore parameter manipulation functions. 11965bd8deadSopenharmony_ci - Replaced GenMemoryObjectsEXT with CreateMemoryObjectsEXT 11975bd8deadSopenharmony_ci - Added memory object parameter manipulation functions. 11985bd8deadSopenharmony_ci - Updated issue 13 with a proposed resolution. 11995bd8deadSopenharmony_ci - Added issues 15-19 and proposed resolutions. 12005bd8deadSopenharmony_ci 12015bd8deadSopenharmony_ci Revision 5, 2016-10-22 (James Jones) 12025bd8deadSopenharmony_ci - Added proposed memory barrier semantics to the semaphore commands. 12035bd8deadSopenharmony_ci - Added issue 14. 12045bd8deadSopenharmony_ci - Added some clarifications to issue 13 12055bd8deadSopenharmony_ci 12065bd8deadSopenharmony_ci Revision 4, 2016-09-28 (James Jones) 12075bd8deadSopenharmony_ci - Merged in GL_KHR_semaphore to reduce number of specs. 12085bd8deadSopenharmony_ci - Added spec body describing the new commands. 12095bd8deadSopenharmony_ci - Added issues 9-13. 12105bd8deadSopenharmony_ci 12115bd8deadSopenharmony_ci Revision 3, 2016-08-15 (James Jones and Jeff Juliano) 12125bd8deadSopenharmony_ci - Clarified overview text. 12135bd8deadSopenharmony_ci 12145bd8deadSopenharmony_ci Revision 2, 2016-08-07 (James Jones) 12155bd8deadSopenharmony_ci - Added non-contiguous sparse binding support via 12165bd8deadSopenharmony_ci TexPageCommitmentMemKHR(). 12175bd8deadSopenharmony_ci 12185bd8deadSopenharmony_ci Revision 1, 2016-08-05 (James Jones) 12195bd8deadSopenharmony_ci - Initial draft. 1220