diff options
author | oetuaho@nvidia.com <oetuaho@nvidia.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-14 15:20:52 +0000 |
---|---|---|
committer | oetuaho@nvidia.com <oetuaho@nvidia.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-14 15:20:52 +0000 |
commit | 17a96119afdf3e468e0174d14c12a4686295bab1 (patch) | |
tree | 4bccf2a3a3003d062be60dab33daf9fae6042e3f /gpu/GLES2 | |
parent | 768b8dc9a21c920a81e0c00c8aff3447c84130b2 (diff) | |
download | chromium_src-17a96119afdf3e468e0174d14c12a4686295bab1.zip chromium_src-17a96119afdf3e468e0174d14c12a4686295bab1.tar.gz chromium_src-17a96119afdf3e468e0174d14c12a4686295bab1.tar.bz2 |
Implement support for rendering to 32-bit float textures on ES3
On ES2 with OES_texture_float/OES_texture_half_float support, it is only possible to render to 16-bit half float textures using EXT_color_buffer_half_float. There's no support for rendering to 32-bit float textures in ES2 extensions. On ES3, rendering to some 32-bit float texture formats is exposed with EXT_color_buffer_float, but one must use the sized internal formats specified in ES3 core to do that. To expose this, a new command buffer extension is added which enables clients to directly use the sized internal format GL_RGBA32F.
A similar extension is also added to expose GL_RGB32F on desktop GL platforms for the sake of consistency.
These extensions are available whenever rendering to float textures is available. To support the current version of ANGLE, format conversions back to unsized internal formats are added to ui/gl.
Tests are added to cover this functionality. The new tests also add coverage for the handling of 32-bit float formats on ES2 and on desktop GL that existed before this patch.
BUG=329605
TEST=gpu_unittests, WebGL conformance tests
Review URL: https://codereview.chromium.org/139013008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251329 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/GLES2')
-rw-r--r-- | gpu/GLES2/extensions/CHROMIUM/CHROMIUM_color_buffer_float_rgb.txt | 64 | ||||
-rw-r--r-- | gpu/GLES2/extensions/CHROMIUM/CHROMIUM_color_buffer_float_rgba.txt | 64 | ||||
-rw-r--r-- | gpu/GLES2/gl2extchromium.h | 14 |
3 files changed, 142 insertions, 0 deletions
diff --git a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_color_buffer_float_rgb.txt b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_color_buffer_float_rgb.txt new file mode 100644 index 0000000..7f22008 --- /dev/null +++ b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_color_buffer_float_rgb.txt @@ -0,0 +1,64 @@ +Name + + CHROMIUM_color_buffer_float_rgb + +Name Strings + + GL_CHROMIUM_color_buffer_float_rgb + +Version + + Last Modifed Date: February 7, 2014 + +Dependencies + + This extension is written against the OpenGL ES 2.0 specification. + + OpenGL ES 2.0 is required. + + OES_texture_float is required. + +Overview + + This extension implements a subset of ARB_color_buffer_float on top of + OpenGL ES 2.0. + + This extension enables rendering to floating point RGB textures. When + this extension is enabled: + + * The 32-bit floating point type GL_RGB32F becomes available as a + color-renderable internal format. Textures created with type = FLOAT, + and internal format GL_RGB32F, can be attached to framebuffer object + color attachments for rendering. + + * GL_RGB / GL_RGB32F becomes an allowable format / internalformat parameter + pair for TexImage2D. The restriction in section 3.7.1 of the OpenGL ES + 2.0 spec that the internalformat parameter and format parameter of + TexImage2D must match is lifted for this case. + + Floating point RGB textures may still be created also with the unsized + GL_RGB internal format, but whether such textures are renderable is not + guaranteed. + +New Tokens + + Accepted by the <internalformat> parameter of TexImage2D: + + GL_RGB32F 0x8815 + +New Procedures and Functions + + None. + +Errors + + None. + +New State + + None. + +Revision History + + 2/7/2014 Documented the extension + diff --git a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_color_buffer_float_rgba.txt b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_color_buffer_float_rgba.txt new file mode 100644 index 0000000..d52bab851 --- /dev/null +++ b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_color_buffer_float_rgba.txt @@ -0,0 +1,64 @@ +Name + + CHROMIUM_color_buffer_float_rgba + +Name Strings + + GL_CHROMIUM_color_buffer_float_rgba + +Version + + Last Modifed Date: February 7, 2014 + +Dependencies + + This extension is written against the OpenGL ES 2.0 specification. + + OpenGL ES 2.0 is required. + + OES_texture_float is required. + +Overview + + This extension implements a subset of EXT_color_buffer_float on top of + OpenGL ES 2.0. + + This extension enables rendering to floating point RGBA textures. When + this extension is enabled: + + * The 32-bit floating point type GL_RGBA32F becomes available as a + color-renderable internal format. Textures created with type = FLOAT, + and internal format GL_RGBA32F, can be attached to framebuffer object + color attachments for rendering. + + * GL_RGBA / GL_RGBA32F becomes an allowable format / internalformat + parameter pair for TexImage2D. The restriction in section 3.7.1 of the + OpenGL ES 2.0 spec that the internalformat parameter and format parameter + of TexImage2D must match is lifted for this case. + + Floating point RGBA textures may still be created also with the unsized + GL_RGBA internal format, but whether such textures are renderable is not + guaranteed. + +New Tokens + + Accepted by the <internalformat> parameter of TexImage2D: + + GL_RGBA32F 0x8814 + +New Procedures and Functions + + None. + +Errors + + None. + +New State + + None. + +Revision History + + 2/7/2014 Documented the extension + diff --git a/gpu/GLES2/gl2extchromium.h b/gpu/GLES2/gl2extchromium.h index 11db4b7..50a6247 100644 --- a/gpu/GLES2/gl2extchromium.h +++ b/gpu/GLES2/gl2extchromium.h @@ -618,6 +618,20 @@ typedef GLuint (GL_APIENTRYP PFNGLINSERTSYNCPOINTCHROMIUMPROC) (); typedef void (GL_APIENTRYP PFNGLWAITSYNCPOINTCHROMIUMPROC) (GLuint sync_point); #endif /* GL_CHROMIUM_sync_point */ +#ifndef GL_CHROMIUM_color_buffer_float_rgba +#define GL_CHROMIUM_color_buffer_float_rgba 1 +#ifndef GL_RGBA32F +#define GL_RGBA32F 0x8814 +#endif +#endif /* GL_CHROMIUM_color_buffer_float_rgba */ + +#ifndef GL_CHROMIUM_color_buffer_float_rgb +#define GL_CHROMIUM_color_buffer_float_rgb 1 +#ifndef GL_RGB32F +#define GL_RGB32F 0x8815 +#endif +#endif /* GL_CHROMIUM_color_buffer_float_rgb */ + #ifdef __cplusplus } #endif |