| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/command_buffer/service/test_helper.h" | 5 #include "gpu/command_buffer/service/test_helper.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 .RetiresOnSaturation(); | 531 .RetiresOnSaturation(); |
| 532 | 532 |
| 533 if (enable_es3) { | 533 if (enable_es3) { |
| 534 EXPECT_CALL(*gl, GetIntegerv(GL_PIXEL_UNPACK_BUFFER_BINDING, _)) | 534 EXPECT_CALL(*gl, GetIntegerv(GL_PIXEL_UNPACK_BUFFER_BINDING, _)) |
| 535 .WillOnce(SetArgPointee<1>(0)) | 535 .WillOnce(SetArgPointee<1>(0)) |
| 536 .RetiresOnSaturation(); | 536 .RetiresOnSaturation(); |
| 537 } | 537 } |
| 538 | 538 |
| 539 if ((strstr(extensions, "GL_ARB_texture_float") || | 539 if ((strstr(extensions, "GL_ARB_texture_float") || |
| 540 gl_info.is_desktop_core_profile) || | 540 gl_info.is_desktop_core_profile) || |
| 541 (gl_info.is_es3 && strstr(extensions, "GL_EXT_color_buffer_float"))) { | 541 (gl_info.is_es3 && strstr(extensions, "GL_OES_texture_float") && |
| 542 strstr(extensions, "GL_EXT_color_buffer_float"))) { |
| 542 static const GLuint tx_ids[] = {101, 102}; | 543 static const GLuint tx_ids[] = {101, 102}; |
| 543 static const GLuint fb_ids[] = {103, 104}; | 544 static const GLuint fb_ids[] = {103, 104}; |
| 544 const GLsizei width = 16; | 545 const GLsizei width = 16; |
| 545 EXPECT_CALL(*gl, GetIntegerv(GL_FRAMEBUFFER_BINDING, _)) | 546 EXPECT_CALL(*gl, GetIntegerv(GL_FRAMEBUFFER_BINDING, _)) |
| 546 .WillOnce(SetArgumentPointee<1>(fb_ids[0])) | 547 .WillOnce(SetArgumentPointee<1>(fb_ids[0])) |
| 547 .RetiresOnSaturation(); | 548 .RetiresOnSaturation(); |
| 548 EXPECT_CALL(*gl, GetIntegerv(GL_TEXTURE_BINDING_2D, _)) | 549 EXPECT_CALL(*gl, GetIntegerv(GL_TEXTURE_BINDING_2D, _)) |
| 549 .WillOnce(SetArgumentPointee<1>(tx_ids[0])) | 550 .WillOnce(SetArgumentPointee<1>(tx_ids[0])) |
| 550 .RetiresOnSaturation(); | 551 .RetiresOnSaturation(); |
| 551 EXPECT_CALL(*gl, GenTextures(1, _)) | 552 EXPECT_CALL(*gl, GenTextures(1, _)) |
| (...skipping 16 matching lines...) Expand all Loading... |
| 568 EXPECT_CALL(*gl, BindFramebufferEXT(GL_FRAMEBUFFER, fb_ids[1])) | 569 EXPECT_CALL(*gl, BindFramebufferEXT(GL_FRAMEBUFFER, fb_ids[1])) |
| 569 .Times(1) | 570 .Times(1) |
| 570 .RetiresOnSaturation(); | 571 .RetiresOnSaturation(); |
| 571 EXPECT_CALL(*gl, FramebufferTexture2DEXT(GL_FRAMEBUFFER, | 572 EXPECT_CALL(*gl, FramebufferTexture2DEXT(GL_FRAMEBUFFER, |
| 572 GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tx_ids[1], 0)) | 573 GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tx_ids[1], 0)) |
| 573 .Times(1) | 574 .Times(1) |
| 574 .RetiresOnSaturation(); | 575 .RetiresOnSaturation(); |
| 575 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) | 576 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) |
| 576 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) | 577 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) |
| 577 .RetiresOnSaturation(); | 578 .RetiresOnSaturation(); |
| 579 GLenum status_rgba = GL_FRAMEBUFFER_COMPLETE; |
| 578 EXPECT_CALL(*gl, TexImage2D(GL_TEXTURE_2D, 0, GL_RGB32F, width, width, 0, | 580 EXPECT_CALL(*gl, TexImage2D(GL_TEXTURE_2D, 0, GL_RGB32F, width, width, 0, |
| 579 GL_RGB, GL_FLOAT, _)) | 581 GL_RGB, GL_FLOAT, _)) |
| 580 .Times(1) | 582 .Times(1) |
| 581 .RetiresOnSaturation(); | 583 .RetiresOnSaturation(); |
| 582 if (gl_info.is_es3) { | 584 if (gl_info.is_es3) { |
| 583 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) | 585 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) |
| 584 .WillOnce(Return(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT)) | 586 .WillOnce(Return(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT)) |
| 585 .RetiresOnSaturation(); | 587 .RetiresOnSaturation(); |
| 586 } else { | 588 } else { |
| 587 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) | 589 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) |
| 588 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) | 590 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) |
| 589 .RetiresOnSaturation(); | 591 .RetiresOnSaturation(); |
| 590 } | 592 } |
| 591 | 593 |
| 592 if (enable_es3) { | 594 if (status_rgba == GL_FRAMEBUFFER_COMPLETE && enable_es3) { |
| 593 EXPECT_CALL(*gl, TexImage2D(GL_TEXTURE_2D, 0, GL_R16F, width, width, | 595 EXPECT_CALL(*gl, TexImage2D(GL_TEXTURE_2D, 0, GL_R16F, width, width, |
| 594 0, GL_RED, GL_FLOAT, _)) | 596 0, GL_RED, GL_FLOAT, _)) |
| 595 .Times(1) | 597 .Times(1) |
| 596 .RetiresOnSaturation(); | 598 .RetiresOnSaturation(); |
| 597 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) | 599 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) |
| 598 .Times(1) | 600 .Times(1) |
| 599 .RetiresOnSaturation(); | 601 .RetiresOnSaturation(); |
| 600 EXPECT_CALL(*gl, TexImage2D(GL_TEXTURE_2D, 0, GL_RG16F, width, width, | 602 EXPECT_CALL(*gl, TexImage2D(GL_TEXTURE_2D, 0, GL_RG16F, width, width, |
| 601 0, GL_RG, GL_FLOAT, _)) | 603 0, GL_RG, GL_FLOAT, _)) |
| 602 .Times(1) | 604 .Times(1) |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1202 GLenum precision, | 1204 GLenum precision, |
| 1203 bool static_use, | 1205 bool static_use, |
| 1204 const std::string& name) { | 1206 const std::string& name) { |
| 1205 return ConstructShaderVariable<sh::OutputVariable>( | 1207 return ConstructShaderVariable<sh::OutputVariable>( |
| 1206 type, array_size, precision, static_use, name); | 1208 type, array_size, precision, static_use, name); |
| 1207 } | 1209 } |
| 1208 | 1210 |
| 1209 } // namespace gles2 | 1211 } // namespace gles2 |
| 1210 } // namespace gpu | 1212 } // namespace gpu |
| 1211 | 1213 |
| OLD | NEW |