Hash :
f0e89be6
Author :
Date :
2017-11-08T14:00:32
Use packed enums for the texture types and targets, part 1 In OpenGL there are two enum "sets" used by the API that are very similar: texture types (or bind point) and texture targets. They only differ in that texture types have GL_TEXTURE_CUBEMAP and target have GL_TEXTURE_CUBEMAP_[POSITIVE|NEGATIVE]_[X|Y|Z]. This is a problem because in ANGLE we use GLenum to pass around both types of data, making it difficult to know which of type and target a variable is. In addition these enums are placed somewhat randomly in the space of OpenGL enums, making it slow to have a mapping from texture types to some data. Such a mapping is in hot-code with gl::State::mTextures. This commit stack makes the texture types and target enums be translated to internal packed enums right at the OpenGL entry point and used throughout ANGLE to have type safety and performance gains. This is the first of two commit which does the refactor for all of the validation and stops inside gl::Context. This was the best place to split patches without having many conversions from packed enums to GL enums. BUG=angleproject:2169 Change-Id: Ib43da7e71c253bd9fe210fb0ec0de61bc286e6d3 Reviewed-on: https://chromium-review.googlesource.com/758835 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
{
"glBindBuffer": {
"target": "BufferBinding"
},
"glBindBufferBase": {
"target": "BufferBinding"
},
"glBindBufferRange": {
"target": "BufferBinding"
},
"glBindTexture": {
"target": "TextureType"
},
"glBufferData": {
"target": "BufferBinding",
"usage": "BufferUsage"
},
"glBufferSubData": {
"target": "BufferBinding"
},
"glCompressedTexImage2D": {
"target": "TextureTarget"
},
"glCompressedTexImage2DRobustANGLE": {
"target": "TextureTarget"
},
"glCompressedTexImage3D": {
"target": "TextureType"
},
"glCompressedTexImage3DRobustANGLE": {
"target": "TextureType"
},
"glCompressedTexSubImage2D": {
"target": "TextureTarget"
},
"glCompressedTexSubImage2DRobustANGLE": {
"target": "TextureTarget"
},
"glCompressedTexSubImage3D": {
"target": "TextureType"
},
"glCompressedTexSubImage3DRobustANGLE": {
"target": "TextureType"
},
"glCopyTexImage2D": {
"target": "TextureTarget"
},
"glCopyTextureCHROMIUM": {
"destTarget": "TextureTarget"
},
"glCopyTexSubImage2D": {
"target": "TextureTarget"
},
"glCopyTexSubImage3D": {
"target": "TextureType"
},
"glCopySubTextureCHROMIUM": {
"destTarget": "TextureTarget"
},
"glCopyBufferSubData": {
"readTarget": "BufferBinding",
"writeTarget": "BufferBinding"
},
"glCullFace": {
"mode": "CullFaceMode"
},
"glEGLImageTargetTexture2DOES": {
"target": "TextureType"
},
"glFlushMappedBufferRange": {
"target": "BufferBinding"
},
"glFlushMappedBufferRangeEXT": {
"target": "BufferBinding"
},
"glFramebufferTexture2D": {
"textarget": "TextureTarget"
},
"glGenerateMipmap": {
"target": "TextureType"
},
"glGetBufferParameteriv": {
"target": "BufferBinding"
},
"glGetBufferParameterivRobustANGLE": {
"target": "BufferBinding"
},
"glGetBufferParameteri64v": {
"target": "BufferBinding"
},
"glGetBufferParameteri64vRobustANGLE": {
"target": "BufferBinding"
},
"glGetBufferPointerv": {
"target": "BufferBinding"
},
"glGetBufferPointervOES": {
"target": "BufferBinding"
},
"glGetBufferPointervRobustANGLE": {
"target": "BufferBinding"
},
"glGetTexLevelParameterfv": {
"target": "TextureTarget"
},
"glGetTexLevelParameterfvRobustANGLE": {
"target": "TextureTarget"
},
"glGetTexLevelParameteriv": {
"target": "TextureTarget"
},
"glGetTexLevelParameterivRobustANGLE": {
"target": "TextureTarget"
},
"glGetTexParameterfv": {
"target": "TextureType"
},
"glGetTexParameterfvRobustANGLE": {
"target": "TextureType"
},
"glGetTexParameteriv": {
"target": "TextureType"
},
"glGetTexParameterivRobustANGLE": {
"target": "TextureType"
},
"glGetTexParameterIivRobustANGLE": {
"target": "TextureType"
},
"glGetTexParameterIuivRobustANGLE": {
"target": "TextureType"
},
"glGetTexParameterxv": {
"target": "TextureType"
},
"glMapBuffer": {
"target": "BufferBinding"
},
"glMapBufferOES": {
"target": "BufferBinding"
},
"glMapBufferRange": {
"target": "BufferBinding"
},
"glMapBufferRangeEXT": {
"target": "BufferBinding"
},
"glTexImage2D": {
"target": "TextureTarget"
},
"glTexImage2DRobustANGLE": {
"target": "TextureTarget"
},
"glTexImage3D": {
"target": "TextureType"
},
"glTexImage3DRobustANGLE": {
"target": "TextureType"
},
"glTexParameterf": {
"target": "TextureType"
},
"glTexParameterfv": {
"target": "TextureType"
},
"glTexParameterfvRobustANGLE": {
"target": "TextureType"
},
"glTexParameteri": {
"target": "TextureType"
},
"glTexParameteriv": {
"target": "TextureType"
},
"glTexParameterivRobustANGLE": {
"target": "TextureType"
},
"glTexParameterIivRobustANGLE": {
"target": "TextureType"
},
"glTexParameterIuivRobustANGLE": {
"target": "TextureType"
},
"glTexParameterx": {
"target": "TextureType"
},
"glTexParameterxv": {
"target": "TextureType"
},
"glTexStorage2D": {
"target": "TextureType"
},
"glTexStorage2DEXT": {
"target": "TextureType"
},
"glTexStorage2DMultisample": {
"target": "TextureType"
},
"glTexStorage3D": {
"target": "TextureType"
},
"glTexStorage3DEXT": {
"target": "TextureType"
},
"glTexSubImage2D": {
"target": "TextureTarget"
},
"glTexSubImage2DRobustANGLE": {
"target": "TextureTarget"
},
"glTexSubImage3D": {
"target": "TextureType"
},
"glTexSubImage3DRobustANGLE": {
"target": "TextureType"
},
"glUnmapBuffer": {
"target": "BufferBinding"
},
"glUnmapBufferOES": {
"target": "BufferBinding"
}
}