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

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

Issue 2678483003: Fix EXT_draw_buffers detection on some GL ES 3 contexts (Closed)
Patch Set: remove nv_draw_buffers entirely Created 3 years, 10 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 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 gl_info.is_es3 || gl_info.is_desktop_core_profile) { 358 gl_info.is_es3 || gl_info.is_desktop_core_profile) {
359 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_SAMPLES, _)) 359 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_SAMPLES, _))
360 .WillOnce(SetArgumentPointee<1>(kMaxSamples)) 360 .WillOnce(SetArgumentPointee<1>(kMaxSamples))
361 .RetiresOnSaturation(); 361 .RetiresOnSaturation();
362 } else if (strstr(extensions, "GL_IMG_multisampled_render_to_texture")) { 362 } else if (strstr(extensions, "GL_IMG_multisampled_render_to_texture")) {
363 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_SAMPLES_IMG, _)) 363 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_SAMPLES_IMG, _))
364 .WillOnce(SetArgumentPointee<1>(kMaxSamples)) 364 .WillOnce(SetArgumentPointee<1>(kMaxSamples))
365 .RetiresOnSaturation(); 365 .RetiresOnSaturation();
366 } 366 }
367 367
368 if (strstr(extensions, "GL_EXT_draw_buffers") || 368 if (enable_es3 || strstr(extensions, "GL_ARB_draw_buffers") ||
369 strstr(extensions, "GL_ARB_draw_buffers") || 369 strstr(extensions, "GL_EXT_draw_buffers") || gl_info.is_es3 ||
370 (gl_info.is_es3 && strstr(extensions, "GL_NV_draw_buffers")) ||
371 gl_info.is_desktop_core_profile) { 370 gl_info.is_desktop_core_profile) {
372 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, _)) 371 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, _))
373 .WillOnce(SetArgumentPointee<1>(8)) 372 .WillOnce(SetArgumentPointee<1>(8))
374 .RetiresOnSaturation(); 373 .RetiresOnSaturation();
375 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, _)) 374 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, _))
376 .WillOnce(SetArgumentPointee<1>(8)) 375 .WillOnce(SetArgumentPointee<1>(8))
377 .RetiresOnSaturation(); 376 .RetiresOnSaturation();
378 } 377 }
379 378
380 if (gl_info.IsAtLeastGL(3, 3) || 379 if (gl_info.IsAtLeastGL(3, 3) ||
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 EXPECT_CALL(*gl, BindTexture(GL_TEXTURE_2D, tx_ids[0])) 648 EXPECT_CALL(*gl, BindTexture(GL_TEXTURE_2D, tx_ids[0]))
650 .Times(1) 649 .Times(1)
651 .RetiresOnSaturation(); 650 .RetiresOnSaturation();
652 #if DCHECK_IS_ON() 651 #if DCHECK_IS_ON()
653 EXPECT_CALL(*gl, GetError()) 652 EXPECT_CALL(*gl, GetError())
654 .WillOnce(Return(GL_NO_ERROR)) 653 .WillOnce(Return(GL_NO_ERROR))
655 .RetiresOnSaturation(); 654 .RetiresOnSaturation();
656 #endif 655 #endif
657 } 656 }
658 657
659 if (strstr(extensions, "GL_EXT_draw_buffers") || 658 if (enable_es3 || strstr(extensions, "GL_ARB_draw_buffers") ||
660 strstr(extensions, "GL_ARB_draw_buffers") || 659 strstr(extensions, "GL_EXT_draw_buffers") || gl_info.is_es3 ||
661 (gl_info.is_es3 && strstr(extensions, "GL_NV_draw_buffers")) ||
662 gl_info.is_desktop_core_profile) { 660 gl_info.is_desktop_core_profile) {
663 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, _)) 661 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, _))
664 .WillOnce(SetArgumentPointee<1>(8)) 662 .WillOnce(SetArgumentPointee<1>(8))
665 .RetiresOnSaturation(); 663 .RetiresOnSaturation();
666 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, _)) 664 EXPECT_CALL(*gl, GetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, _))
667 .WillOnce(SetArgumentPointee<1>(8)) 665 .WillOnce(SetArgumentPointee<1>(8))
668 .RetiresOnSaturation(); 666 .RetiresOnSaturation();
669 } 667 }
670 668
671 if (gl_info.is_es3 || gl_info.is_desktop_core_profile || 669 if (gl_info.is_es3 || gl_info.is_desktop_core_profile ||
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 GLenum precision, 1202 GLenum precision,
1205 bool static_use, 1203 bool static_use,
1206 const std::string& name) { 1204 const std::string& name) {
1207 return ConstructShaderVariable<sh::OutputVariable>( 1205 return ConstructShaderVariable<sh::OutputVariable>(
1208 type, array_size, precision, static_use, name); 1206 type, array_size, precision, static_use, name);
1209 } 1207 }
1210 1208
1211 } // namespace gles2 1209 } // namespace gles2
1212 } // namespace gpu 1210 } // namespace gpu
1213 1211
OLDNEW
« gpu/command_buffer/service/feature_info.cc ('K') | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698