Add extension specifications

git-svn-id: https://angleproject.googlecode.com/svn/trunk@878 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 43911ec8
Name
ANGLE_texture_usage
Name Strings
GL_ANGLE_texture_usage
Contributors
Nicolas Capens, TransGaming
Daniel Koch, TransGaming
Contact
Daniel Koch, TransGaming (daniel 'at' transgaming.com)
Status
Complete
Version
Last Modified Date: November 10, 2011
Version: 2
Number
TBD
Dependencies
This extension is written against the OpenGL ES 2.0 Specification.
Overview
In some implementations it is advantageous to know the expected
usage of a texture before the backing storage for it is allocated.
This can help to inform the implementation's choice of format
and type of memory used for the allocation. If the usage is not
known in advance, the implementation essentially has to make a
guess as to how it will be used. If it is later proven wrong,
it may need to perform costly re-allocations and/or reformatting
of the texture data, resulting in reduced performance.
This extension adds a texture usage flag that is specified via
the TEXTURE_USAGE_ANGLE TexParameter. This can be used to
indicate that the application knows that this texture will be
used for rendering.
IP Status
No known IP claims.
New Procedures and Functions
None
New Tokens
Accepted as a value for <pname> for the TexParameter{if} and
TexParameter{if}v commands and for the <value> parameter of
GetTexParameter{if}v:
TEXTURE_USAGE_ANGLE 0x93A2
Accepted as a value to <param> for the TexParameter{if} and
to <params> for the TexParameter{if}v commands with a <pname> of
TEXTURE_USAGE_ANGLE; returned as possible values for <data> when
GetTexParameter{if}v is queried with a <value> of TEXTURE_USAGE_ANGLE:
NONE 0x0000
FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3
Additions to Chapter 2 of the OpenGL ES 2.0 Specification (OpenGL ES Operation)
None
Additions to Chapter 3 of the OpenGL ES 2.0 Specification (Rasterization)
Add a new row to Table 3.10 (Texture parameters and their values):
Name | Type | Legal Values
------------------------------------------------------------
TEXTURE_USAGE_ANGLE | enum | NONE, FRAMEBUFFER_ATTACHMENT_ANGLE
Add a new section 3.7.x (Texture Usage) before section 3.7.12 and
renumber the subsequent sections:
"3.7.x Texture Usage
Texture usage can be specified via the TEXTURE_USAGE_ANGLE value
for the <pname> argument to TexParameter{if}[v]. In order to take effect,
the texture usage must be specified before the texture contents are
defined either via TexImage2D or TexStorage2DEXT.
The usage values can impact the layout and type of memory used for the
texture data. Specifying incorrect usage values may result in reduced
functionality and/or significantly degraded performance.
Possible values for <params> when <pname> is TEXTURE_USAGE_ANGLE are:
NONE - the default. No particular usage has been specified and it is
up to the implementation to determine the usage of the texture.
Leaving the usage unspecified means that the implementation may
have to reallocate the texture data as the texture is used in
various ways.
FRAMEBUFFER_ATTACHMENT_ANGLE - this texture will be attached to a
framebuffer object and used as a desination for rendering or blits."
Modify section 3.7.12 (Texture State) and place the last 3 sentences
with the following:
"Next, there are the three sets of texture properties; each consists of
the selected minification and magnification filters, the wrap modes for
<s> and <t>, and the usage flags. In the initial state, the value assigned
to TEXTURE_MIN_FILTER is NEAREST_MIPMAP_LINEAR, and the value for
TEXTURE_MAG_FILTER is LINEAR. <s> and <t> wrap modes are both set to
REPEAT. The initial value for TEXTURE_USAGE_ANGLE is NONE."
Additions to Chapter 4 of the OpenGL ES 2.0 Specification (Per-Fragment
Operations and the Framebuffer)
None
Additions to Chapter 5 of the OpenGL ES 2.0 Specification (Special
Functions):
None
Additions to Chapter 6 of the OpenGL ES 2.0 Specification (State and
State Requests)
None
Dependencies on EXT_texture_storage
If EXT_texture_storage is not supported, omit any references to
TexStorage2DEXT.
Errors
If TexParameter{if} or TexParamter{if}v is called with a <pname>
of TEXTURE_USAGE_ANGLE and the value of <param> or <params> is not
NONE or FRAMEBUFFER_ATTACHMENT_ANGLE the error INVALID_VALUE is
generated.
Usage Example
/* create and bind texture */
glGenTextures(1, &texture);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, texture);
/* specify texture parameters */
glTexParameteri(GL_TEXTURE_2D, GL_*, ...); /* as before */
/* specify that we'll be rendering to the texture */
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_USAGE_ANGLE, GL_FRAMEBUFFER_ATTACHMENT_ANGLE);
glTexStorage2DEXT(GL_TEXTURE_2D, levels, ...); // Allocation
for(int level = 0; level < levels; ++level)
glTexSubImage2D(GL_TEXTURE_2D, level, ...); // Initialisation
Issues
1. Should there be a dynamic usage value?
DISCUSSION: We could accept a dynamic flag to indicate that a texture will
be updated frequently. We could map this to D3D9 dynamic textures. This would
allow us to avoid creating temporary surfaces when updating the texture.
However renderable textures cannot be dynamic in D3D9, which eliminates the
primary use case for this. Furthermore, the memory usage of dynamic textures
typically increases threefold when you lock it.
2. Should the texture usage be an enum or a bitfield?
UNRESOLVED. Using a bitfield would allow combination of values to be specified.
On the other hand, if combinations are really required, additional <pnames>
could be added as necessary. Querying a bitfield via the GetTexParameter command
feels a bit odd.
3. What should happen if TEXTURE_USAGE_ANGLE is set/changed after the texture
contents have been specified?
RESOLVED: It will have no effect. However, if the texture is redefined (for
example by TexImage2D) the new allocation will use the updated usage.
GetTexParameter is used to query the value of the TEXTURE_USAGE_ANGLE
state that was last set by TexParameter for the currently bound texture, or
the default value if it has never been set. There is no way to determine the
usage that was in effect at the time the texture was defined.
Revision History
Rev. Date Author Changes
---- ----------- --------- ----------------------------------------
1 10 Nov 2011 dgkoch Initial revision
2 10 Nov 2011 dgkoch Add overview
Name
EXT_create_context_robustness
Name Strings
EGL_EXT_create_context_robustness
Contributors
Daniel Koch, TransGaming
Contributors to EGL_KHR_create_context
Contact
Greg Roth (groth 'at' nvidia.com)
Status
Complete.
Version
Version 3, 2011/10/31
Number
TBD
Dependencies
Requires EGL 1.4
Written against the EGL 1.4 specification.
An OpenGL implementation supporting GL_ARB_robustness, an OpenGL ES
implementation supporting GL_EXT_robustness, or an implementation
supporting equivalent functionality is required.
Overview
This extension allows creating an OpenGL or OpenGL ES context
supporting robust buffer access behavior and a specified graphics
reset notification behavior.
New Procedures and Functions
None
New Tokens
Accepted as an attribute name in the <*attrib_list> argument to
eglCreateContext:
EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF
EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138
Accepted as an attribute value for EGL_CONTEXT_RESET_NOTIFICATION_-
STRATEGY_EXT in the <*attrib_list> argument to eglCreateContext:
EGL_NO_RESET_NOTIFICATION_EXT 0x31BE
EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF
Additions to the EGL 1.4 Specification
Replace section 3.7.1 "Creating Rendering Contexts" from the
fifth paragraph through the seventh paragraph:
<attrib_list> specifies a list of attributes for the context. The
list has the same structure as described for eglChooseConfig. If an
attribute is not specified in <attrib_list>, then the default value
specified below is used instead. <attrib_list> may be NULL or empty
(first attribute is EGL_NONE), in which case attributes assume their
default values as described below. Most attributes are only meaningful
for specific client APIs, and will generate an EGL_BAD_ATTRIBUTE
error when specified to create for another client API context.
Context Versions
----------------
EGL_CONTEXT_CLIENT_VERSION determines which version of an OpenGL ES
context to create. This attribute may only be specified when creating
an OpenGL ES context (e.g. when the current rendering API is
EGL_OPENGL_ES_API). An attribute value of 1 specifies creation of an
OpenGL ES 1.x context. An attribute value of 2 specifies creation of an
Open GL ES 2.x context. The default value for EGL_CONTEXT_CLIENT_VERSION
is 1.
Context Robust Access
-------------
EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT indicates whether <robust buffer
access> should be enabled for the OpenGL ES context. Robust buffer
access is defined in the GL_EXT_robustness extension specification,
and the resulting context must support GL_EXT_robustness and robust
buffer access as described therein. The default value of
EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT is EGL_FALSE.
Context Reset Notification
--------------------------
The attribute name EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_-
EXT specifies the <reset notification behavior> of the rendering
context. This attribute is only meaningful for OpenGL ES contexts,
and specifying it for other types of contexts will generate an
EGL_BAD_ATTRIBUTE error.
Reset notification behavior is defined in the GL_EXT_robustness
extension for OpenGL ES, and the resulting context must support
GL_EXT_robustness and the specified reset strategy. The attribute
value may be either EGL_NO_RESET_NOTIFICATION_EXT or EGL_LOSE_-
CONTEXT_ON_RESET_EXT, which respectively result in disabling
delivery of reset notifications or the loss of all context state
upon reset notification as described by the GL_EXT_robustness. The
default value for EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT
is EGL_NO_RESET_NOTIFICATION_EXT.
Add to the eglCreateContext context creation errors:
* If <config> does not support a client API context compatible
with the requested context flags and context reset notification
behavior (for client API types where these attributes are
supported), then an EGL_BAD_CONFIG error is generated.
* If the reset notification behavior of <share_context> and the
newly created context are different then an EGL_BAD_MATCH error is
generated.
Errors
EGL_BAD_CONFIG is generated if EGL_CONTEXT_OPENGL_ROBUST_ACCESS_-
EXT is set to EGL_TRUE and no GL context supporting the GL_EXT_-
robustness extension and robust access as described therein can be
created.
EGL_BAD_CONFIG is generated if no GL context supporting the
GL_EXT_robustness extension and the specified reset notification
behavior (the value of attribute EGL_CONTEXT_RESET_NOTIFICATION_-
STRATEGY_EXT) can be created.
BAD_MATCH is generated if the reset notification behavior of
<share_context> does not match the reset notification behavior of
the context being created.
New State
None
Conformance Tests
TBD
Sample Code
TBD
Issues
None
Revision History
Rev. Date Author Changes
---- ------------ --------- ----------------------------------------
3 31 Oct 2011 groth Reverted to attribute for robust access. Now it's a
companion to rather than subset of KHR_create_context
2 11 Oct 2011 groth Merged ANGLE and NV extensions.
1 15 July 2011 groth Initial version
#define MAJOR_VERSION 0
#define MINOR_VERSION 0
#define BUILD_VERSION 0
#define BUILD_REVISION 877
#define BUILD_REVISION 878
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment