1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
gpu / GLES2 / extensions / CHROMIUM / CHROMIUM_discardable_texture.txt [blame]
Name
CHROMIUM_discardable_texture
Name Strings
GL_CHROMIUM_discardable_texture
Version
Last Modified Date: April 11, 2017
Dependencies
OpenGL ES 2.0 is required.
Overview
This extension defines a way to mark textures as "unlocked" or "not
currently in use", giving GL the opportunity to delete these textures as
needed (potentially in cases of memory pressure). Clients may try to
re-lock such a texture, and if successful may continue to use the texture
as normal.
This allows a client to opportunistically cache data for future use,
without worrying about exact memory limits.
New Procedures and Functions
void glInitializeDiscardableTextureCHROMIUM (GLuint texture_id);
Notifies GL that a texture may be unlocked in the future. Must be called
once on a texture, before any uses of glUnlockTextureCHROMIUM. Will set
GL_INVALID_VALUE if called with a texture ID that does not exist, or if
called with a texture ID that has already been initialized.
void glUnlockTextureCHROMIUM (GLuint texture_id);
Notifies GL that a texture is no longer in use. Once a client calls
glUnlockTextureCHROMIUM, they may not use the indicated texture in any
future GL calls. This includes using the texture indirectly, via objects
(FBOs, etc...) that the texture is bound to. Using a texture once it has
been unlocked will behave as though the texture is deleted. Will
set GL_INVALID_VALUE if called with a texture ID that has not been
initialized via glInitializeDiscardableTextureCHROMIUM.
bool glLockTextureCHROMIUM (GLuint texture_id);
Requests that GL re-lock the indicated texture, allowing it to be used in
future operations. If this function returns true, the client may continue
to use the indicated texture. The client should assume that unlocking a
texture clears all bindings (FBOs, etc...), so the client must re-bind the
texture as necessary. If this function returns false, the client may not
use texture again, and should behave as if the texture was deleted via
glDeleteTextures. Will set GL_INVALID_VALUE if called with a texture ID
that has not been initialized via glInitializeDiscardableTextureCHROMIUM.
New Tokens
None.
Errors
None.
New State
None.
Revision History
3/11/2017 Documented the extension