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

Side by Side Diff: gpu/command_buffer/common/gles2_cmd_utils.cc

Issue 1925093002: Handle compressed textures allocated via TexStorage2D. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed obsolete method and fixed tests. Created 4 years, 7 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 // This file is here so other GLES2 related files can have a common set of 5 // This file is here so other GLES2 related files can have a common set of
6 // includes where appropriate. 6 // includes where appropriate.
7 7
8 #include <sstream> 8 #include <sstream>
9 #include <GLES2/gl2.h> 9 #include <GLES2/gl2.h>
10 #include <GLES2/gl2ext.h> 10 #include <GLES2/gl2ext.h>
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 *opt_padded_row_size = padded_row_size; 646 *opt_padded_row_size = padded_row_size;
647 } 647 }
648 if (opt_unpadded_row_size) { 648 if (opt_unpadded_row_size) {
649 *opt_unpadded_row_size = unpadded_row_size; 649 *opt_unpadded_row_size = unpadded_row_size;
650 } 650 }
651 if (opt_skip_size) 651 if (opt_skip_size)
652 *opt_skip_size = skip_size; 652 *opt_skip_size = skip_size;
653 return true; 653 return true;
654 } 654 }
655 655
656 bool GLES2Util::IsCompressedTextureFormat(int internal_format) {
657 switch (internal_format) {
658 // AMD formats
659 case GL_ATC_RGB_AMD:
660 case GL_ATC_RGBA_EXPLICIT_ALPHA_AMD:
661 case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD:
662
663 // ASTC formats
664 case GL_COMPRESSED_RGBA_ASTC_4x4_KHR:
665 case GL_COMPRESSED_RGBA_ASTC_5x4_KHR:
666 case GL_COMPRESSED_RGBA_ASTC_5x5_KHR:
667 case GL_COMPRESSED_RGBA_ASTC_6x5_KHR:
668 case GL_COMPRESSED_RGBA_ASTC_6x6_KHR:
669 case GL_COMPRESSED_RGBA_ASTC_8x5_KHR:
670 case GL_COMPRESSED_RGBA_ASTC_8x6_KHR:
671 case GL_COMPRESSED_RGBA_ASTC_8x8_KHR:
672 case GL_COMPRESSED_RGBA_ASTC_10x5_KHR:
673 case GL_COMPRESSED_RGBA_ASTC_10x6_KHR:
674 case GL_COMPRESSED_RGBA_ASTC_10x8_KHR:
675 case GL_COMPRESSED_RGBA_ASTC_10x10_KHR:
676 case GL_COMPRESSED_RGBA_ASTC_12x10_KHR:
677 case GL_COMPRESSED_RGBA_ASTC_12x12_KHR:
678 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:
679 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:
680 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:
681 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:
682 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:
683 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:
684 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:
685 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:
686 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:
687 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:
688 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:
689 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:
690 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:
691 case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:
692
693 // DXT formats
694 case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
695 case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
696 case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
697 case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
698
699 // PVTRC formats
700 case GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG:
701 case GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:
702 case GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG:
703 case GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:
704
705 // ES3 formats
706 case GL_COMPRESSED_R11_EAC:
707 case GL_COMPRESSED_SIGNED_R11_EAC:
708 case GL_COMPRESSED_RG11_EAC:
709 case GL_COMPRESSED_SIGNED_RG11_EAC:
710 case GL_COMPRESSED_RGB8_ETC2:
711 case GL_COMPRESSED_SRGB8_ETC2:
712 case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:
713 case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
714 case GL_COMPRESSED_RGBA8_ETC2_EAC:
715 case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:
716 return true;
717 }
718 return false;
719 }
720
656 size_t GLES2Util::RenderbufferBytesPerPixel(int format) { 721 size_t GLES2Util::RenderbufferBytesPerPixel(int format) {
657 switch (format) { 722 switch (format) {
658 case GL_STENCIL_INDEX8: 723 case GL_STENCIL_INDEX8:
659 return 1; 724 return 1;
660 case GL_RGBA4: 725 case GL_RGBA4:
661 case GL_RGB565: 726 case GL_RGB565:
662 case GL_RGB5_A1: 727 case GL_RGB5_A1:
663 case GL_DEPTH_COMPONENT16: 728 case GL_DEPTH_COMPONENT16:
664 return 2; 729 return 2;
665 case GL_RGB: 730 case GL_RGB:
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after
1544 } 1609 }
1545 1610
1546 return true; 1611 return true;
1547 } 1612 }
1548 1613
1549 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h" 1614 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h"
1550 1615
1551 } // namespace gles2 1616 } // namespace gles2
1552 } // namespace gpu 1617 } // namespace gpu
1553 1618
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698