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 // 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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 *v32_0 = static_cast<uint32_t>(v64 & 0xFFFFFFFF); | 863 *v32_0 = static_cast<uint32_t>(v64 & 0xFFFFFFFF); |
864 *v32_1 = static_cast<uint32_t>((v64 & 0xFFFFFFFF00000000) >> 32); | 864 *v32_1 = static_cast<uint32_t>((v64 & 0xFFFFFFFF00000000) >> 32); |
865 } | 865 } |
866 | 866 |
867 // static | 867 // static |
868 uint64_t GLES2Util::MapTwoUint32ToUint64(uint32_t v32_0, uint32_t v32_1) { | 868 uint64_t GLES2Util::MapTwoUint32ToUint64(uint32_t v32_0, uint32_t v32_1) { |
869 uint64_t v64 = v32_1; | 869 uint64_t v64 = v32_1; |
870 return (v64 << 32) | v32_0; | 870 return (v64 << 32) | v32_0; |
871 } | 871 } |
872 | 872 |
| 873 // static |
| 874 uint32_t GLES2Util::MapBufferTargetToBindingEnum(uint32_t target) { |
| 875 switch (target) { |
| 876 case GL_ARRAY_BUFFER: |
| 877 return GL_ARRAY_BUFFER_BINDING; |
| 878 case GL_COPY_READ_BUFFER: |
| 879 return GL_COPY_READ_BUFFER_BINDING; |
| 880 case GL_COPY_WRITE_BUFFER: |
| 881 return GL_COPY_WRITE_BUFFER_BINDING; |
| 882 case GL_ELEMENT_ARRAY_BUFFER: |
| 883 return GL_ELEMENT_ARRAY_BUFFER_BINDING; |
| 884 case GL_PIXEL_PACK_BUFFER: |
| 885 return GL_PIXEL_PACK_BUFFER_BINDING; |
| 886 case GL_PIXEL_UNPACK_BUFFER: |
| 887 return GL_PIXEL_UNPACK_BUFFER_BINDING; |
| 888 case GL_TRANSFORM_FEEDBACK_BUFFER: |
| 889 return GL_TRANSFORM_FEEDBACK_BUFFER_BINDING; |
| 890 case GL_UNIFORM_BUFFER: |
| 891 return GL_UNIFORM_BUFFER_BINDING; |
| 892 default: |
| 893 return 0; |
| 894 } |
| 895 } |
| 896 |
| 897 |
873 namespace { | 898 namespace { |
874 | 899 |
875 // WebGraphicsContext3DCommandBufferImpl configuration attributes. Those in | 900 // WebGraphicsContext3DCommandBufferImpl configuration attributes. Those in |
876 // the 16-bit range are the same as used by EGL. Those outside the 16-bit range | 901 // the 16-bit range are the same as used by EGL. Those outside the 16-bit range |
877 // are unique to Chromium. Attributes are matched using a closest fit algorithm. | 902 // are unique to Chromium. Attributes are matched using a closest fit algorithm. |
878 | 903 |
879 // From <EGL/egl.h>. | 904 // From <EGL/egl.h>. |
880 const int32 kAlphaSize = 0x3021; // EGL_ALPHA_SIZE | 905 const int32 kAlphaSize = 0x3021; // EGL_ALPHA_SIZE |
881 const int32 kBlueSize = 0x3022; // EGL_BLUE_SIZE | 906 const int32 kBlueSize = 0x3022; // EGL_BLUE_SIZE |
882 const int32 kGreenSize = 0x3023; // EGL_GREEN_SIZE | 907 const int32 kGreenSize = 0x3023; // EGL_GREEN_SIZE |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1023 } | 1048 } |
1024 | 1049 |
1025 return true; | 1050 return true; |
1026 } | 1051 } |
1027 | 1052 |
1028 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h" | 1053 #include "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h" |
1029 | 1054 |
1030 } // namespace gles2 | 1055 } // namespace gles2 |
1031 } // namespace gpu | 1056 } // namespace gpu |
1032 | 1057 |
OLD | NEW |