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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h

Issue 2354713004: Implement WEBGL_compressed_texture_es3_0 extension for WebGL 1/2 (Closed)
Patch Set: fixup Created 4 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 auto-generated from 5 // This file is auto-generated from
6 // gpu/command_buffer/build_gles2_cmd_buffer.py 6 // gpu/command_buffer/build_gles2_cmd_buffer.py
7 // It's formatted by clang-format using chromium coding style: 7 // It's formatted by clang-format using chromium coding style:
8 // clang-format -i -style=chromium filename 8 // clang-format -i -style=chromium filename
9 // DO NOT EDIT! 9 // DO NOT EDIT!
10 10
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 case GL_LEQUAL: 159 case GL_LEQUAL:
160 case GL_GREATER: 160 case GL_GREATER:
161 case GL_NOTEQUAL: 161 case GL_NOTEQUAL:
162 case GL_GEQUAL: 162 case GL_GEQUAL:
163 case GL_ALWAYS: 163 case GL_ALWAYS:
164 return true; 164 return true;
165 } 165 }
166 return false; 166 return false;
167 }; 167 };
168 168
169 static const GLenum valid_compressed_texture_format_table_es3[] = {
170 GL_COMPRESSED_R11_EAC,
171 GL_COMPRESSED_SIGNED_R11_EAC,
172 GL_COMPRESSED_RG11_EAC,
173 GL_COMPRESSED_SIGNED_RG11_EAC,
174 GL_COMPRESSED_RGB8_ETC2,
175 GL_COMPRESSED_SRGB8_ETC2,
176 GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
177 GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,
178 GL_COMPRESSED_RGBA8_ETC2_EAC,
179 GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,
180 };
181
182 static const GLenum valid_coverage_modulation_components_table[] = { 169 static const GLenum valid_coverage_modulation_components_table[] = {
183 GL_RGB, GL_RGBA, GL_ALPHA, GL_NONE, 170 GL_RGB, GL_RGBA, GL_ALPHA, GL_NONE,
184 }; 171 };
185 172
186 bool Validators::DrawModeValidator::IsValid(const GLenum value) const { 173 bool Validators::DrawModeValidator::IsValid(const GLenum value) const {
187 switch (value) { 174 switch (value) {
188 case GL_POINTS: 175 case GL_POINTS:
189 case GL_LINE_STRIP: 176 case GL_LINE_STRIP:
190 case GL_LINE_LOOP: 177 case GL_LINE_LOOP:
191 case GL_LINES: 178 case GL_LINES:
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
1140 GL_RGB10_A2UI, 1127 GL_RGB10_A2UI,
1141 GL_RGBA16UI, 1128 GL_RGBA16UI,
1142 GL_RGBA16I, 1129 GL_RGBA16I,
1143 GL_RGBA32UI, 1130 GL_RGBA32UI,
1144 GL_RGBA32I, 1131 GL_RGBA32I,
1145 GL_DEPTH_COMPONENT16, 1132 GL_DEPTH_COMPONENT16,
1146 GL_DEPTH_COMPONENT24, 1133 GL_DEPTH_COMPONENT24,
1147 GL_DEPTH_COMPONENT32F, 1134 GL_DEPTH_COMPONENT32F,
1148 GL_DEPTH24_STENCIL8, 1135 GL_DEPTH24_STENCIL8,
1149 GL_DEPTH32F_STENCIL8, 1136 GL_DEPTH32F_STENCIL8,
1150 GL_COMPRESSED_R11_EAC,
1151 GL_COMPRESSED_SIGNED_R11_EAC,
1152 GL_COMPRESSED_RG11_EAC,
1153 GL_COMPRESSED_SIGNED_RG11_EAC,
1154 GL_COMPRESSED_RGB8_ETC2,
1155 GL_COMPRESSED_SRGB8_ETC2,
1156 GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
1157 GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,
1158 GL_COMPRESSED_RGBA8_ETC2_EAC,
1159 GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,
1160 }; 1137 };
1161 1138
1162 static const GLenum deprecated_texture_internal_format_storage_table_es3[] = { 1139 static const GLenum deprecated_texture_internal_format_storage_table_es3[] = {
1163 GL_ALPHA8_EXT, GL_LUMINANCE8_EXT, GL_LUMINANCE8_ALPHA8_EXT, 1140 GL_ALPHA8_EXT, GL_LUMINANCE8_EXT, GL_LUMINANCE8_ALPHA8_EXT,
1164 GL_ALPHA16F_EXT, GL_LUMINANCE16F_EXT, GL_LUMINANCE_ALPHA16F_EXT, 1141 GL_ALPHA16F_EXT, GL_LUMINANCE16F_EXT, GL_LUMINANCE_ALPHA16F_EXT,
1165 GL_ALPHA32F_EXT, GL_LUMINANCE32F_EXT, GL_LUMINANCE_ALPHA32F_EXT, 1142 GL_ALPHA32F_EXT, GL_LUMINANCE32F_EXT, GL_LUMINANCE_ALPHA32F_EXT,
1166 }; 1143 };
1167 1144
1168 bool Validators::TextureMagFilterModeValidator::IsValid( 1145 bool Validators::TextureMagFilterModeValidator::IsValid(
1169 const GLenum value) const { 1146 const GLenum value) const {
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
1460 void Validators::UpdateValuesES3() { 1437 void Validators::UpdateValuesES3() {
1461 attachment.AddValues(valid_attachment_table_es3, 1438 attachment.AddValues(valid_attachment_table_es3,
1462 arraysize(valid_attachment_table_es3)); 1439 arraysize(valid_attachment_table_es3));
1463 attachment_query.AddValues(valid_attachment_query_table_es3, 1440 attachment_query.AddValues(valid_attachment_query_table_es3,
1464 arraysize(valid_attachment_query_table_es3)); 1441 arraysize(valid_attachment_query_table_es3));
1465 buffer_parameter.SetIsES3(true); 1442 buffer_parameter.SetIsES3(true);
1466 buffer_target.SetIsES3(true); 1443 buffer_target.SetIsES3(true);
1467 buffer_usage.SetIsES3(true); 1444 buffer_usage.SetIsES3(true);
1468 capability.AddValues(valid_capability_table_es3, 1445 capability.AddValues(valid_capability_table_es3,
1469 arraysize(valid_capability_table_es3)); 1446 arraysize(valid_capability_table_es3));
1470 compressed_texture_format.AddValues(
1471 valid_compressed_texture_format_table_es3,
1472 arraysize(valid_compressed_texture_format_table_es3));
1473 dst_blend_factor.AddValues(valid_dst_blend_factor_table_es3, 1447 dst_blend_factor.AddValues(valid_dst_blend_factor_table_es3,
1474 arraysize(valid_dst_blend_factor_table_es3)); 1448 arraysize(valid_dst_blend_factor_table_es3));
1475 equation.AddValues(valid_equation_table_es3, 1449 equation.AddValues(valid_equation_table_es3,
1476 arraysize(valid_equation_table_es3)); 1450 arraysize(valid_equation_table_es3));
1477 framebuffer_parameter.AddValues( 1451 framebuffer_parameter.AddValues(
1478 valid_framebuffer_parameter_table_es3, 1452 valid_framebuffer_parameter_table_es3,
1479 arraysize(valid_framebuffer_parameter_table_es3)); 1453 arraysize(valid_framebuffer_parameter_table_es3));
1480 framebuffer_target.AddValues(valid_framebuffer_target_table_es3, 1454 framebuffer_target.AddValues(valid_framebuffer_target_table_es3,
1481 arraysize(valid_framebuffer_target_table_es3)); 1455 arraysize(valid_framebuffer_target_table_es3));
1482 g_l_state.AddValues(valid_g_l_state_table_es3, 1456 g_l_state.AddValues(valid_g_l_state_table_es3,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 arraysize(valid_texture_internal_format_storage_table_es3)); 1495 arraysize(valid_texture_internal_format_storage_table_es3));
1522 texture_parameter.AddValues(valid_texture_parameter_table_es3, 1496 texture_parameter.AddValues(valid_texture_parameter_table_es3,
1523 arraysize(valid_texture_parameter_table_es3)); 1497 arraysize(valid_texture_parameter_table_es3));
1524 texture_stencil_renderable_internal_format.AddValues( 1498 texture_stencil_renderable_internal_format.AddValues(
1525 valid_texture_stencil_renderable_internal_format_table_es3, 1499 valid_texture_stencil_renderable_internal_format_table_es3,
1526 arraysize(valid_texture_stencil_renderable_internal_format_table_es3)); 1500 arraysize(valid_texture_stencil_renderable_internal_format_table_es3));
1527 vertex_attrib_type.AddValues(valid_vertex_attrib_type_table_es3, 1501 vertex_attrib_type.AddValues(valid_vertex_attrib_type_table_es3,
1528 arraysize(valid_vertex_attrib_type_table_es3)); 1502 arraysize(valid_vertex_attrib_type_table_es3));
1529 vertex_attribute.AddValues(valid_vertex_attribute_table_es3, 1503 vertex_attribute.AddValues(valid_vertex_attribute_table_es3,
1530 arraysize(valid_vertex_attribute_table_es3)); 1504 arraysize(valid_vertex_attribute_table_es3));
1505 UpdateES30CompressedTextureFormats();
1506 }
1507
1508 void Validators::UpdateES30CompressedTextureFormats() {
1509 compressed_texture_format.AddValue(GL_COMPRESSED_R11_EAC);
1510 compressed_texture_format.AddValue(GL_COMPRESSED_SIGNED_R11_EAC);
1511 compressed_texture_format.AddValue(GL_COMPRESSED_RG11_EAC);
1512 compressed_texture_format.AddValue(GL_COMPRESSED_SIGNED_RG11_EAC);
1513 compressed_texture_format.AddValue(GL_COMPRESSED_RGB8_ETC2);
1514 compressed_texture_format.AddValue(GL_COMPRESSED_SRGB8_ETC2);
1515 compressed_texture_format.AddValue(
1516 GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2);
1517 compressed_texture_format.AddValue(
1518 GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2);
1519 compressed_texture_format.AddValue(GL_COMPRESSED_RGBA8_ETC2_EAC);
1520 compressed_texture_format.AddValue(GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC);
1521 texture_internal_format_storage.AddValue(GL_COMPRESSED_R11_EAC);
1522 texture_internal_format_storage.AddValue(GL_COMPRESSED_SIGNED_R11_EAC);
1523 texture_internal_format_storage.AddValue(GL_COMPRESSED_RG11_EAC);
1524 texture_internal_format_storage.AddValue(GL_COMPRESSED_SIGNED_RG11_EAC);
1525 texture_internal_format_storage.AddValue(GL_COMPRESSED_RGB8_ETC2);
1526 texture_internal_format_storage.AddValue(GL_COMPRESSED_SRGB8_ETC2);
1527 texture_internal_format_storage.AddValue(
1528 GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2);
1529 texture_internal_format_storage.AddValue(
1530 GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2);
1531 texture_internal_format_storage.AddValue(GL_COMPRESSED_RGBA8_ETC2_EAC);
1532 texture_internal_format_storage.AddValue(GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC);
1531 } 1533 }
1532 1534
1533 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_VALIDATION_IMPLEMENTATION_AUTOGE N_H_ 1535 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_VALIDATION_IMPLEMENTATION_AUTOGE N_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_validation.h ('k') | gpu/command_buffer/service/texture_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698