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

Unified Diff: gpu/command_buffer/service/gles2_cmd_srgb_converter.cc

Issue 2419153003: Use high precision texture format during srgb conversion emulation for blitFramebuffer (Closed)
Patch Set: addressed zmo@'s feedback Created 4 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_srgb_converter.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_srgb_converter.cc b/gpu/command_buffer/service/gles2_cmd_srgb_converter.cc
index 5ffbb47de31545874f7b9c2a2b5ac981c4a40b7d..8300d6190f3f9068868984d02274fd5b37f95b21 100644
--- a/gpu/command_buffer/service/gles2_cmd_srgb_converter.cc
+++ b/gpu/command_buffer/service/gles2_cmd_srgb_converter.cc
@@ -198,6 +198,10 @@ void SRGBConverter::Blit(
// If we need to blit from linear to srgb or vice versa, some steps will be
// skipped.
DCHECK(srgb_converter_initialized_);
+ // Use RGBA32F as the temp texture's internalformat to prevent precision
+ // loss during srgb conversion. But it is not color-renderable and
+ // texture-filterable in ES context.
+ DCHECK(!feature_info_->gl_version_info().is_es);
// Set the states
glActiveTexture(GL_TEXTURE0);
@@ -239,7 +243,7 @@ void SRGBConverter::Blit(
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
glBindTexture(GL_TEXTURE_2D, srgb_converter_textures_[1]);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F,
c.width(), c.height(),
0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
glBindFramebufferEXT(GL_FRAMEBUFFER, srgb_decoder_fbo_);
@@ -272,7 +276,7 @@ void SRGBConverter::Blit(
height_draw = dstY1 > dstY0 ? dstY1 - dstY0 : dstY0 - dstY1;
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
glTexImage2D(
- GL_TEXTURE_2D, 0, decode ? GL_RGBA : src_framebuffer_internal_format,
+ GL_TEXTURE_2D, 0, decode ? GL_RGBA32F : src_framebuffer_internal_format,
width_draw, height_draw, 0,
decode ? GL_RGBA : src_framebuffer_format,
decode ? GL_UNSIGNED_BYTE : src_framebuffer_type,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698