summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-20 21:56:10 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-20 21:56:10 +0000
commita3798fd35441409ca379f2a86025980f5d5cf3fb (patch)
treee6d48ae588d938b6d5361299edbf00eb1d54838a /gpu
parent461cf16b14991baedc8ce8ca1478ccbaaf4c5330 (diff)
downloadchromium_src-a3798fd35441409ca379f2a86025980f5d5cf3fb.zip
chromium_src-a3798fd35441409ca379f2a86025980f5d5cf3fb.tar.gz
chromium_src-a3798fd35441409ca379f2a86025980f5d5cf3fb.tar.bz2
Revert 258402 "GLHelper: Use preferred BGRA read pixels for YUV ..."
This broke GLReadbackTest.ReadPixelsFloat http://build.chromium.org/p/tryserver.chromium.gpu/builders/linux_gpu_triggered_tests/builds/552/steps/gl_tests/logs/stdio Also failed on tries on this patch on the linux gpu bot. > GLHelper: Use preferred BGRA read pixels for YUV read back > > When copying to the PBO the driver can use a blit if the requested > format matches the underlying format of the data. Mesa on Intel is > storing the data internally as BGRA (byte order). > > This change moves the choice of format to the caller of the > ReadbackAsync and ReadbackPlane functions. > > We then use GL_BGRA to read in the plane data for the YUV readback > object. However since the format is now swizzled we must swizzle the > pixel data back. This is done using the existing mechanism for swizzling > the result in the scaling shaders. > > The activation of the use of GL_BGRA and swizzling is controlled by > querying the GL implementation for it's preferred format and type. In > the GPU code we pass this request onto the underlying GL implementation > if it supports the GL_OES_read_format extension. > > As a result of this change glReadPixels can return immediately after > setting up the blit to the PBO and as such the asynchronous glReadPixels > works as expected when reading back YUV data for Tab Casting. > > TEST=With the change observe that the time spent in the > HandleReadPixels tracepoint is reduced. > BUG=348015 > > Review URL: https://codereview.chromium.org/178583008 TBR=robert.bradford@intel.com Review URL: https://codereview.chromium.org/206993002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258428 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc9
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc128
2 files changed, 0 insertions, 137 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 73d8362..d6f9fc8 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -4165,12 +4165,6 @@ bool GLES2DecoderImpl::GetHelper(
switch (pname) {
case GL_IMPLEMENTATION_COLOR_READ_FORMAT:
*num_written = 1;
- // Trigger the passthrough for _COLOR_READ_FORMAT and (see below) for
- // _COLOR_READ_TYPE if we have the GL extension that exposes this.
- // This allows the GPU client to use the implementation's preferred
- // format for glReadPixels.
- if (context_->HasExtension("GL_OES_read_format"))
- return false;
if (params) {
*params = GLES2Util::GetPreferredGLReadPixelsFormat(
GetBoundReadFrameBufferInternalFormat());
@@ -4178,8 +4172,6 @@ bool GLES2DecoderImpl::GetHelper(
return true;
case GL_IMPLEMENTATION_COLOR_READ_TYPE:
*num_written = 1;
- if (context_->HasExtension("GL_OES_read_format"))
- return false;
if (params) {
*params = GLES2Util::GetPreferredGLReadPixelsType(
GetBoundReadFrameBufferInternalFormat(),
@@ -7230,7 +7222,6 @@ void GLES2DecoderImpl::FinishReadPixels(
error::Error GLES2DecoderImpl::HandleReadPixels(
uint32 immediate_data_size, const cmds::ReadPixels& c) {
- TRACE_EVENT0("gpu", "GLES2DecoderImpl::HandleReadPixels");
error::Error fbo_error = WillAccessBoundFramebufferForRead();
if (fbo_error != error::kNoError)
return fbo_error;
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
index 6f17e66..15fd1d1 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
@@ -9204,134 +9204,6 @@ TEST_F(GLES2DecoderManualInitTest, TexImage2DFloatConvertsFormatDesktop) {
GL_LUMINANCE_ALPHA32F_ARB);
}
-TEST_F(GLES2DecoderManualInitTest, ReadFormatExtension) {
- InitDecoder(
- "GL_OES_read_format", // extensions
- "2.1", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
-
- EXPECT_CALL(*gl_, GetError())
- .WillOnce(Return(GL_NO_ERROR))
- .WillOnce(Return(GL_NO_ERROR))
- .WillOnce(Return(GL_NO_ERROR))
- .WillOnce(Return(GL_NO_ERROR))
- .RetiresOnSaturation();
-
- typedef GetIntegerv::Result Result;
- Result* result = static_cast<Result*>(shared_memory_address_);
- GetIntegerv cmd;
- const GLuint kFBOClientTextureId = 4100;
- const GLuint kFBOServiceTextureId = 4101;
-
- // Register a texture id.
- EXPECT_CALL(*gl_, GenTextures(_, _))
- .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId))
- .RetiresOnSaturation();
- GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
-
- // Setup "render to" texture.
- DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId);
- DoTexImage2D(
- GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
- DoBindFramebuffer(
- GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
- DoFramebufferTexture2D(
- GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
- kFBOClientTextureId, kFBOServiceTextureId, 0, GL_NO_ERROR);
-
- result->size = 0;
- EXPECT_CALL(*gl_, GetIntegerv(_, _))
- .Times(1)
- .RetiresOnSaturation();
- cmd.Init(
- GL_IMPLEMENTATION_COLOR_READ_FORMAT,
- shared_memory_id_, shared_memory_offset_);
- EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
- EXPECT_EQ(1, result->GetNumResults());
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
-
- result->size = 0;
- EXPECT_CALL(*gl_, GetIntegerv(_, _))
- .Times(1)
- .RetiresOnSaturation();
- cmd.Init(
- GL_IMPLEMENTATION_COLOR_READ_TYPE,
- shared_memory_id_, shared_memory_offset_);
- EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
- EXPECT_EQ(1, result->GetNumResults());
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
-}
-
-TEST_F(GLES2DecoderManualInitTest, NoReadFormatExtension) {
- InitDecoder(
- "", // extensions
- "2.1", // gl version
- false, // has alpha
- false, // has depth
- false, // has stencil
- false, // request alpha
- false, // request depth
- false, // request stencil
- true); // bind generates resource
-
- EXPECT_CALL(*gl_, GetError())
- .WillOnce(Return(GL_NO_ERROR))
- .WillOnce(Return(GL_NO_ERROR))
- .WillOnce(Return(GL_NO_ERROR))
- .WillOnce(Return(GL_NO_ERROR))
- .RetiresOnSaturation();
-
- typedef GetIntegerv::Result Result;
- Result* result = static_cast<Result*>(shared_memory_address_);
- GetIntegerv cmd;
- const GLuint kFBOClientTextureId = 4100;
- const GLuint kFBOServiceTextureId = 4101;
-
- // Register a texture id.
- EXPECT_CALL(*gl_, GenTextures(_, _))
- .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId))
- .RetiresOnSaturation();
- GenHelper<GenTexturesImmediate>(kFBOClientTextureId);
-
- // Setup "render to" texture.
- DoBindTexture(GL_TEXTURE_2D, kFBOClientTextureId, kFBOServiceTextureId);
- DoTexImage2D(
- GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0);
- DoBindFramebuffer(
- GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
- DoFramebufferTexture2D(
- GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
- kFBOClientTextureId, kFBOServiceTextureId, 0, GL_NO_ERROR);
-
- result->size = 0;
- EXPECT_CALL(*gl_, GetIntegerv(_, _))
- .Times(0)
- .RetiresOnSaturation();
- cmd.Init(
- GL_IMPLEMENTATION_COLOR_READ_FORMAT,
- shared_memory_id_, shared_memory_offset_);
- EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
- EXPECT_EQ(1, result->GetNumResults());
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
-
- result->size = 0;
- EXPECT_CALL(*gl_, GetIntegerv(_, _))
- .Times(0)
- .RetiresOnSaturation();
- cmd.Init(
- GL_IMPLEMENTATION_COLOR_READ_TYPE,
- shared_memory_id_, shared_memory_offset_);
- EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
- EXPECT_EQ(1, result->GetNumResults());
- EXPECT_EQ(GL_NO_ERROR, GetGLError());
-}
-
// TODO(gman): Complete this test.
// TEST_F(GLES2DecoderTest, CompressedTexImage2DGLError) {
// }