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

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

Issue 18246005: Add EXT_color_buffer_half_float extension support in GPU commandbuffer service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 5 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
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 70837bf1f9d083b092e9a0bd5bdb745561c2304c..8905210b9668880f6d391b86abcbf46d0cc8a88e 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -6808,6 +6808,14 @@ void GLES2DecoderImpl::FinishReadPixels(
}
+static inline GLenum GetTexType(GLenum type) {
+ if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) {
+ if (type == GL_HALF_FLOAT_OES)
+ return GL_HALF_FLOAT_ARB;
+ }
+ return type;
+}
+
error::Error GLES2DecoderImpl::HandleReadPixels(
uint32 immediate_data_size, const cmds::ReadPixels& c) {
if (ShouldDeferReads())
@@ -6913,7 +6921,8 @@ error::Error GLES2DecoderImpl::HandleReadPixels(
// If the row is in range, copy it.
if (ry >= 0 && ry < max_size.height() && read_width > 0) {
glReadPixels(
- read_x, ry, read_width, 1, format, type, dst + dest_row_offset);
+ read_x, ry, read_width, 1, format, GetTexType(type),
+ dst + dest_row_offset);
}
dst += padded_row_size;
}
@@ -6925,7 +6934,7 @@ error::Error GLES2DecoderImpl::HandleReadPixels(
glBufferData(GL_PIXEL_PACK_BUFFER_ARB, pixels_size, NULL, GL_STREAM_READ);
GLenum error = glGetError();
if (error == GL_NO_ERROR) {
- glReadPixels(x, y, width, height, format, type, 0);
+ glReadPixels(x, y, width, height, format, GetTexType(type), 0);
pending_readpixel_fences_.push(linked_ptr<FenceCallback>(
new FenceCallback()));
WaitForReadPixels(base::Bind(
@@ -6937,7 +6946,7 @@ error::Error GLES2DecoderImpl::HandleReadPixels(
return error::kNoError;
}
}
- glReadPixels(x, y, width, height, format, type, pixels);
+ glReadPixels(x, y, width, height, format, GetTexType(type), pixels);
}
GLenum error = LOCAL_PEEK_GL_ERROR("glReadPixels");
if (error == GL_NO_ERROR) {

Powered by Google App Engine
This is Rietveld 408576698