Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(624)

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 2823193002: Add supported formats by EXT_color_buffer_float for CopyTexImage2D (Closed)
Patch Set: pure rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
index bfbd9eafc0cb7b42657e30190bfafef065cbe1b2..bfc7d8cb75ef144f4af82d9ba59a16eaa2f36c96 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -912,6 +912,11 @@ static const GLenum kSupportedInternalFormatsTexImageES3[] = {
GL_DEPTH32F_STENCIL8,
};
+// Exposed by EXT_color_buffer_float
+static const GLenum kSupportedInternalFormatsFloat[] = {
Ken Russell (switch to Gerrit) 2017/04/20 01:06:48 These are ES3-specific, so could you name this kSu
qiankun 2017/04/20 16:45:55 Done.
+ GL_R16F, GL_R32F, GL_RG16F, GL_RG32F,
+ GL_RGBA16F, GL_RGBA32F, GL_R11F_G11F_B10F};
+
// ES3 enums supported by TexImageSource
static const GLenum kSupportedInternalFormatsTexImageSourceES3[] = {
GL_R8, GL_R16F, GL_R32F, GL_R8UI, GL_RG8,
@@ -1061,6 +1066,7 @@ WebGLRenderingContextBase::WebGLRenderingContextBase(
is_oes_texture_half_float_formats_types_added_(false),
is_web_gl_depth_texture_formats_types_added_(false),
is_ext_srgb_formats_types_added_(false),
+ is_ext_color_buffer_float_formats_added_(false),
version_(version) {
ASSERT(context_provider);
@@ -1255,6 +1261,7 @@ void WebGLRenderingContextBase::InitializeNewContext() {
is_oes_texture_half_float_formats_types_added_ = false;
is_web_gl_depth_texture_formats_types_added_ = false;
is_ext_srgb_formats_types_added_ = false;
+ is_ext_color_buffer_float_formats_added_ = false;
supported_internal_formats_.clear();
ADD_VALUES_TO_SET(supported_internal_formats_, kSupportedFormatsES2);
@@ -2139,6 +2146,12 @@ bool WebGLRenderingContextBase::ValidateCopyTexFormat(const char* function_name,
kSupportedInternalFormatsES3);
is_web_gl2_internal_formats_copy_tex_image_added_ = true;
}
+ if (!is_ext_color_buffer_float_formats_added_ &&
+ ExtensionEnabled(kEXTColorBufferFloatName)) {
+ ADD_VALUES_TO_SET(supported_internal_formats_copy_tex_image_,
+ kSupportedInternalFormatsFloat);
+ is_ext_color_buffer_float_formats_added_ = true;
+ }
if (supported_internal_formats_copy_tex_image_.find(internalformat) ==
supported_internal_formats_copy_tex_image_.end()) {
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698