15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    APPLE_client_storage
45bd8deadSopenharmony_ci	
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_APPLE_client_storage
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Geoff Stahl, Apple (gstahl 'at' apple.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciStatus
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Complete
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ciVersion
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ci    $Date: 2002/08/27 01:40:16 $ $Revision: 1.6 $
205bd8deadSopenharmony_ci
215bd8deadSopenharmony_ciNumber
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ci    270
245bd8deadSopenharmony_ci	
255bd8deadSopenharmony_ciDependencies
265bd8deadSopenharmony_ci
275bd8deadSopenharmony_ci    OpenGL 1.1 is required.
285bd8deadSopenharmony_ci    The extension is written against the OpenGL 1.2.1 Specification.
295bd8deadSopenharmony_ci	
305bd8deadSopenharmony_ciOverview
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ci	This extension provides a simple mechanism to optimize texture data handling
335bd8deadSopenharmony_ci	by clients.  GL implementations normally maintain a copy of texture image
345bd8deadSopenharmony_ci	data supplied clients when any of the various texturing commands, such as
355bd8deadSopenharmony_ci	TexImage2D, are invoked.  This extension eliminates GL's internal copy of
365bd8deadSopenharmony_ci	the texture image data and allows a client to maintain this data locally for
375bd8deadSopenharmony_ci	textures when the UNPACK_CLIENT_STORAGE_APPLE pixel storage parameter is
385bd8deadSopenharmony_ci	TRUE at the time of texture specification.  Local texture data storage is
395bd8deadSopenharmony_ci	especially useful in cases where clients maintain internal copies of
405bd8deadSopenharmony_ci	textures used in any case.  This results in what could be considered an
415bd8deadSopenharmony_ci	extra copy of the texture image data.  Assuming all operations are error
425bd8deadSopenharmony_ci	free, the use of client storage has no affect on the result of texturing
435bd8deadSopenharmony_ci	operations and will not affect rendering results. APPLE_client_storage
445bd8deadSopenharmony_ci	allows clients to optimize memory requirements and copy operations it also
455bd8deadSopenharmony_ci	requires adherence to specific rules in maintaining texture image data.
465bd8deadSopenharmony_ci
475bd8deadSopenharmony_ci	Clients using this extension are agreeing to preserve a texture's image data
485bd8deadSopenharmony_ci	for the life of the texture.  The life of the texture is defined, in this
495bd8deadSopenharmony_ci	case, as the time from first issuing the TexImage3D, TexImage2D or
505bd8deadSopenharmony_ci	TexImage1D command, for the specific texture object with the
515bd8deadSopenharmony_ci	UNPACK_CLIENT_STORAGE_APPLE pixel storage parameter set to TRUE, until the
525bd8deadSopenharmony_ci	DeleteTextures command or another TexImage command for that same object. 
535bd8deadSopenharmony_ci	Only after DeleteTextures has completed, or new texture is specified, can
545bd8deadSopenharmony_ci	the local texture memory be released, as it will no longer be utilized by
555bd8deadSopenharmony_ci	OpenGL.  Changing the UNPACK_CLIENT_STORAGE_APPLE pixel storage parameter
565bd8deadSopenharmony_ci	will have no additional effect once the texturing command has been issued
575bd8deadSopenharmony_ci	and specifically will not alleviate the client from maintaining the texture
585bd8deadSopenharmony_ci	data.
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ci	Client storage is implemented as a pixel storage parameter which affects
615bd8deadSopenharmony_ci	texture image storage at the time the texturing command is issued.  As with
625bd8deadSopenharmony_ci	other pixel storage parameters this state may differ from the time the
635bd8deadSopenharmony_ci	texturing command in executed if the command is placed in a display list. 
645bd8deadSopenharmony_ci	The PixelStore command is used to set the parameter
655bd8deadSopenharmony_ci	UNPACK_CLIENT_STORAGE_APPLE.  Values can either be TRUE or FALSE, with TRUE
665bd8deadSopenharmony_ci	representing the use of client local storage and FALSE indicating the OpenGL
675bd8deadSopenharmony_ci	engine and not the client will be responsible for maintaining texture
685bd8deadSopenharmony_ci	storage for future texturing commands issued per the OpenGL specification.
695bd8deadSopenharmony_ci	The default state for the UNPACK_CLIENT_STORAGE_APPLE parameter is FALSE
705bd8deadSopenharmony_ci
715bd8deadSopenharmony_ci	Client storage is only available for texture objects and not the default
725bd8deadSopenharmony_ci	texture (of any target type).  This means that a texture object has to
735bd8deadSopenharmony_ci	generated and bound to be used with client storage.  Setting
745bd8deadSopenharmony_ci	UNPACK_CLIENT_STORAGE_APPLE to TRUE and texturing with the default texture
755bd8deadSopenharmony_ci	will result in normally texturing with GL maintaining a copy of the texture
765bd8deadSopenharmony_ci	image data.
775bd8deadSopenharmony_ci
785bd8deadSopenharmony_ci	Normally, client storage will be used in conjunction with normal texturing
795bd8deadSopenharmony_ci	techniques.  An application would use GenTextures to generate texture
805bd8deadSopenharmony_ci	objects as needed.  BindTexture to the texture object name of interest. 
815bd8deadSopenharmony_ci	Enable client storage via the PixelStore command setting the
825bd8deadSopenharmony_ci	UNPACK_CLIENT_STORAGE_APPLE parameter to TRUE. Then use TexImage3D,
835bd8deadSopenharmony_ci	TexImage2D or TexImage1D to specify the texture image.  If no further use of
845bd8deadSopenharmony_ci	client storage is desired, it is recommended to again use the PixelStore
855bd8deadSopenharmony_ci	command, in this case setting the UNPACK_CLIENT_STORAGE_APPLE parameter to
865bd8deadSopenharmony_ci	FALSE to disable client storage, since this pixel state is maintained unless
875bd8deadSopenharmony_ci	explicitly set by the PixelStore command.
885bd8deadSopenharmony_ci
895bd8deadSopenharmony_ci	If an application needs to modify the texture, using TexSubImage for
905bd8deadSopenharmony_ci	example, it should be noted that the pointer passed to TexSubImage1D,
915bd8deadSopenharmony_ci	TexSubImage2D or TexSubImage3D does not have to the same, or within the
925bd8deadSopenharmony_ci	original texture memory.  It if is not, there is the likelihood of GL
935bd8deadSopenharmony_ci	copying the new data to the original texture memory owned by the client,
945bd8deadSopenharmony_ci	thus actually modifying this texture image data.  This does not affect
955bd8deadSopenharmony_ci	requirement to maintain the original texture memory but also does not add
965bd8deadSopenharmony_ci	the requirement to maintain the sub image data, due to the copy.
975bd8deadSopenharmony_ci
985bd8deadSopenharmony_ci	Once a client has completed use of the texture stored in client memory, it
995bd8deadSopenharmony_ci	should issue a DeleteTextures command to delete the texture object or issue
1005bd8deadSopenharmony_ci	a texture command, with the same target type, for the object, with either a
1015bd8deadSopenharmony_ci	different data pointer, or UNPACK_CLIENT_STORAGE_APPLE set to false, in any
1025bd8deadSopenharmony_ci	case, breaking the tie between GL and the texture buffer.  An implicit Flush
1035bd8deadSopenharmony_ci	command is issued in these cases, ensuring all access to the texture by
1045bd8deadSopenharmony_ci	OpenGL is complete.  Only at this point can the texture buffer be safely
1055bd8deadSopenharmony_ci	released.  Releasing the texture buffer prior has undefined results and will
1065bd8deadSopenharmony_ci	very possibly display texel anomalies at run time.  System level memory
1075bd8deadSopenharmony_ci	management and paging schemes should not affect the use of client storage. 
1085bd8deadSopenharmony_ci	Consider in any case, that GL has an alias of the base pointer for this
1095bd8deadSopenharmony_ci	block of texture memory which is maintained until GL is finished rendering
1105bd8deadSopenharmony_ci	with the texture and it has been deleted or reassigned to another set of
1115bd8deadSopenharmony_ci	texture data.  As long as this alias exists, applications must not
1125bd8deadSopenharmony_ci	de-allocate, move or purge this memory.
1135bd8deadSopenharmony_ci
1145bd8deadSopenharmony_ciNew Procedures and Functions
1155bd8deadSopenharmony_ci
1165bd8deadSopenharmony_ci	None
1175bd8deadSopenharmony_ci	
1185bd8deadSopenharmony_ciNew Tokens
1195bd8deadSopenharmony_ci
1205bd8deadSopenharmony_ci	Accepted by the <pname> parameters of PixelStore:
1215bd8deadSopenharmony_ci
1225bd8deadSopenharmony_ci	UNPACK_CLIENT_STORAGE_APPLE    0x85B2
1235bd8deadSopenharmony_ci
1245bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.2.1 Specification (Rasterization)
1255bd8deadSopenharmony_ci
1265bd8deadSopenharmony_ci	
1275bd8deadSopenharmony_ci    - (3.6.1, p. 75) Add new PixelStore parameter:
1285bd8deadSopenharmony_ci	
1295bd8deadSopenharmony_ci	Add to Table 3.1 (p. 76):
1305bd8deadSopenharmony_ci
1315bd8deadSopenharmony_ci      Parameter Name               Type     Initial Value    Valid Range
1325bd8deadSopenharmony_ci      --------------               ----     -------------    -----------
1335bd8deadSopenharmony_ci      UNPACK_CLIENT_STORAGE_APPLE  boolean  FALSE            TRUE/FALSE
1345bd8deadSopenharmony_ci    
1355bd8deadSopenharmony_ci    - (3.8.1, p. 117) Last paragraph first sentence changed to:
1365bd8deadSopenharmony_ci
1375bd8deadSopenharmony_ci	  "If the pixel storage parameter UNPACK_CLIENT_STORAGE_APPLE is false the
1385bd8deadSopenharmony_ci	  image indicated to the GL by the image pointer is decoded and copied into
1395bd8deadSopenharmony_ci	  the GL's internal memory."
1405bd8deadSopenharmony_ci    
1415bd8deadSopenharmony_ci    - (3.8.1, p. 118) Add paragraphs before to last paragraph in section:
1425bd8deadSopenharmony_ci
1435bd8deadSopenharmony_ci	  "If the pixel storage parameter UNPACK_CLIENT_STORAGE_APPLE is TRUE, GL
1445bd8deadSopenharmony_ci	  will not copy but instead will attempt to decode the texture image
1455bd8deadSopenharmony_ci	  data directly from client memory.  GL will fall back to the default copy
1465bd8deadSopenharmony_ci	  and decode behavior if modifications to the texture image data are
1475bd8deadSopenharmony_ci	  required to decode the texels.  This fall back may occur if ARB_imaging is
1485bd8deadSopenharmony_ci	  enabled, texture image data format or internal format indexed,
1495bd8deadSopenharmony_ci	  UNPACK_SWAP_BYTES is TRUE, or texturing from the default texture object. 
1505bd8deadSopenharmony_ci	  Otherwise, GL will attempt to use the client local memory directly to
1515bd8deadSopenharmony_ci	  decode the texels.
1525bd8deadSopenharmony_ci
1535bd8deadSopenharmony_ci	  Clients using the UNPACK_CLIENT_STORAGE_APPLE pixel storage parameter will
1545bd8deadSopenharmony_ci	  maintain a texture's image data for the life of the texture.  The life of
1555bd8deadSopenharmony_ci	  the texture in this case is the time from issuing this texture command,
1565bd8deadSopenharmony_ci	  for the specific texture object, until the DeleteTextures command or
1575bd8deadSopenharmony_ci	  another texture command for this same texture object. Only after
1585bd8deadSopenharmony_ci	  DeleteTextures has completed, or new texture image data is specified, can
1595bd8deadSopenharmony_ci	  the client local memory be released.  Releasing the texture buffer prior
1605bd8deadSopenharmony_ci	  has undefined results and will very possibly display texel anomalies at
1615bd8deadSopenharmony_ci	  run time.  System level memory management and paging schemes should not
1625bd8deadSopenharmony_ci	  affect the use of client local storage. Consider, that GL has an alias of
1635bd8deadSopenharmony_ci	  the base pointer for this block of client memory which is maintained until
1645bd8deadSopenharmony_ci	  GL is finished rendering with the texture and it has been deleted or
1655bd8deadSopenharmony_ci	  reassigned to other texture image data.  As long as this alias exists,
1665bd8deadSopenharmony_ci	  clients must not de-allocate, move or purge this memory.  Otherwise,
1675bd8deadSopenharmony_ci	  texturing from with client local storage is unchanged from the default
1685bd8deadSopenharmony_ci	  copy and decode behavior."
1695bd8deadSopenharmony_ci
1705bd8deadSopenharmony_ci    - (3.8.2, p. 123) Add final paragraph in section:
1715bd8deadSopenharmony_ci
1725bd8deadSopenharmony_ci	  "Note, if the existing target texture array has enabled client local
1735bd8deadSopenharmony_ci	  storage via the UNPACK_CLIENT_STORAGE_APPLE pixel storage parameter and if
1745bd8deadSopenharmony_ci	  client local storage is being used, TexSubImage and CopyTexImage may
1755bd8deadSopenharmony_ci	  directly modify the client memory being used as storage for a texture's
1765bd8deadSopenharmony_ci	  image data."
1775bd8deadSopenharmony_ci	  
1785bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.2.1 Specification (State and State Requests)
1795bd8deadSopenharmony_ci
1805bd8deadSopenharmony_ci	None
1815bd8deadSopenharmony_ci	
1825bd8deadSopenharmony_ciAdditions to the GLX Specification
1835bd8deadSopenharmony_ci
1845bd8deadSopenharmony_ci	None
1855bd8deadSopenharmony_ci	
1865bd8deadSopenharmony_ciGLX Protocol
1875bd8deadSopenharmony_ci
1885bd8deadSopenharmony_ci	None
1895bd8deadSopenharmony_ci	
1905bd8deadSopenharmony_ciErrors
1915bd8deadSopenharmony_ci
1925bd8deadSopenharmony_ci	None (Texturing using client local storage behaves as texturing with client
1935bd8deadSopenharmony_ci	local storage and no additional errors are generated)
1945bd8deadSopenharmony_ci
1955bd8deadSopenharmony_ciNew State
1965bd8deadSopenharmony_ci	(table 6.17, p. 207)
1975bd8deadSopenharmony_ci	Get Value                   Type  Get Command Initial Value Description                 Sec. Attribute
1985bd8deadSopenharmony_ci	---------                   ----  ----------- ------------- -----------                 ---- ---------
1995bd8deadSopenharmony_ci	UNPACK_CLIENT_STORAGE_APPLE B     GetBooleanv FALSE         Value of                    4.3  pixel-store
2005bd8deadSopenharmony_ci                                                                UNPACK_CLIENT_STORAGE_APPLE
2015bd8deadSopenharmony_ci
2025bd8deadSopenharmony_ciNew Implementation Dependent State
2035bd8deadSopenharmony_ci
2045bd8deadSopenharmony_ci	None
205