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

Side by Side Diff: Source/modules/webgl/WebGLTexture.cpp

Issue 1257823006: Fixing issues using TexStorage2D with compressed textures (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 case GL_DEPTH_COMPONENT16: 576 case GL_DEPTH_COMPONENT16:
577 return GL_UNSIGNED_SHORT; 577 return GL_UNSIGNED_SHORT;
578 case GL_DEPTH_COMPONENT24: 578 case GL_DEPTH_COMPONENT24:
579 return GL_UNSIGNED_INT; 579 return GL_UNSIGNED_INT;
580 case GL_DEPTH_COMPONENT32F: 580 case GL_DEPTH_COMPONENT32F:
581 return GL_FLOAT; 581 return GL_FLOAT;
582 case GL_DEPTH24_STENCIL8: 582 case GL_DEPTH24_STENCIL8:
583 return GL_UNSIGNED_INT_24_8; 583 return GL_UNSIGNED_INT_24_8;
584 case GL_DEPTH32F_STENCIL8: 584 case GL_DEPTH32F_STENCIL8:
585 return GL_FLOAT_32_UNSIGNED_INT_24_8_REV; 585 return GL_FLOAT_32_UNSIGNED_INT_24_8_REV;
586 // Compressed types.
587 case GL_ATC_RGB_AMD:
588 case GL_ATC_RGBA_EXPLICIT_ALPHA_AMD:
589 case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD:
590 case GL_ETC1_RGB8_OES:
591 case GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG:
592 case GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG:
593 case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
594 case GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:
595 case GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:
596 case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
597 case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
598 case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
599 return GL_UNSIGNED_BYTE;
586 default: 600 default:
587 return GL_NONE; 601 return GL_NONE;
588 } 602 }
589 }
590
591 GLenum WebGLTexture::getValidFormatForInternalFormat(GLenum internalFormat)
bajones 2015/07/29 20:11:03 Turns out this table wasn't being used in Blink. I
592 {
593 switch (internalFormat) {
594 case GL_R8:
595 case GL_R8_SNORM:
596 case GL_R16F:
597 case GL_R32F:
598 return GL_RED;
599 case GL_R8UI:
600 case GL_R8I:
601 case GL_R16UI:
602 case GL_R16I:
603 case GL_R32UI:
604 case GL_R32I:
605 return GL_RED_INTEGER;
606 case GL_RG8:
607 case GL_RG8_SNORM:
608 case GL_RG16F:
609 case GL_RG32F:
610 return GL_RG;
611 case GL_RG8UI:
612 case GL_RG8I:
613 case GL_RG16UI:
614 case GL_RG16I:
615 case GL_RG32UI:
616 case GL_RG32I:
617 return GL_RG_INTEGER;
618 case GL_RGB8:
619 case GL_SRGB8:
620 case GL_RGB565:
621 case GL_RGB8_SNORM:
622 case GL_R11F_G11F_B10F:
623 case GL_RGB9_E5:
624 case GL_RGB16F:
625 case GL_RGB32F:
626 return GL_RGB;
627 case GL_RGB8UI:
628 case GL_RGB8I:
629 case GL_RGB16UI:
630 case GL_RGB16I:
631 case GL_RGB32UI:
632 case GL_RGB32I:
633 return GL_RGB_INTEGER;
634 case GL_RGBA8:
635 case GL_SRGB8_ALPHA8:
636 case GL_RGBA8_SNORM:
637 case GL_RGB5_A1:
638 case GL_RGBA4:
639 case GL_RGB10_A2:
640 case GL_RGBA16F:
641 case GL_RGBA32F:
642 return GL_RGBA;
643 case GL_RGBA8UI:
644 case GL_RGBA8I:
645 case GL_RGB10_A2UI:
646 case GL_RGBA16UI:
647 case GL_RGBA16I:
648 case GL_RGBA32I:
649 case GL_RGBA32UI:
650 return GL_RGBA_INTEGER;
651 case GL_DEPTH_COMPONENT16:
652 case GL_DEPTH_COMPONENT24:
653 case GL_DEPTH_COMPONENT32F:
654 return GL_DEPTH_COMPONENT;
655 case GL_DEPTH24_STENCIL8:
656 case GL_DEPTH32F_STENCIL8:
657 return GL_DEPTH_STENCIL;
658 default:
659 return GL_NONE;
660 }
661 } 603 }
662 604
663 } // namespace blink 605 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698