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

Side by Side Diff: gpu/command_buffer/service/test_helper.cc

Issue 2474593002: Float formats are allowed for CopyTexImage with EXT_color_buffer_float (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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
531 if (!(context_type == CONTEXT_TYPE_WEBGL1 || 531 if (!(context_type == CONTEXT_TYPE_WEBGL1 ||
532 context_type == CONTEXT_TYPE_OPENGLES2) && 532 context_type == CONTEXT_TYPE_OPENGLES2) &&
533 gl_info.is_es3_capable && enable_es3) { 533 gl_info.is_es3_capable && 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") &&
qiankun 2016/11/02 10:30:05 GL_OES_texture_float is needed for this condition,
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
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();
592 }
590 593
594 if (status_rgba == GL_FRAMEBUFFER_COMPLETE) {
qiankun 2016/11/02 10:30:05 see discussion in https://codereview.chromium.org/
591 if (enable_es3 && gl_info.is_es3_capable) { 595 if (enable_es3 && gl_info.is_es3_capable) {
592 EXPECT_CALL(*gl, TexImage2D(GL_TEXTURE_2D, 0, GL_R16F, width, width, 596 EXPECT_CALL(*gl, TexImage2D(GL_TEXTURE_2D, 0, GL_R16F, width, width,
593 0, GL_RED, GL_FLOAT, _)) 597 0, GL_RED, GL_FLOAT, _))
594 .Times(1) 598 .Times(1)
595 .RetiresOnSaturation(); 599 .RetiresOnSaturation();
596 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) 600 EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER))
597 .Times(1) 601 .Times(1)
598 .RetiresOnSaturation(); 602 .RetiresOnSaturation();
599 EXPECT_CALL(*gl, TexImage2D(GL_TEXTURE_2D, 0, GL_RG16F, width, width, 603 EXPECT_CALL(*gl, TexImage2D(GL_TEXTURE_2D, 0, GL_RG16F, width, width,
600 0, GL_RG, GL_FLOAT, _)) 604 0, GL_RG, GL_FLOAT, _))
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
1202 GLenum precision, 1206 GLenum precision,
1203 bool static_use, 1207 bool static_use,
1204 const std::string& name) { 1208 const std::string& name) {
1205 return ConstructShaderVariable<sh::OutputVariable>( 1209 return ConstructShaderVariable<sh::OutputVariable>(
1206 type, array_size, precision, static_use, name); 1210 type, array_size, precision, static_use, name);
1207 } 1211 }
1208 1212
1209 } // namespace gles2 1213 } // namespace gles2
1210 } // namespace gpu 1214 } // namespace gpu
1211 1215
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698