11591693c7b415e9869157c711fe11263c95d74eDavid Li/* 21591693c7b415e9869157c711fe11263c95d74eDavid Li * Copyright © 2009 Intel Corporation 31591693c7b415e9869157c711fe11263c95d74eDavid Li * 41591693c7b415e9869157c711fe11263c95d74eDavid Li * Permission is hereby granted, free of charge, to any person obtaining a 51591693c7b415e9869157c711fe11263c95d74eDavid Li * copy of this software and associated documentation files (the "Software"), 61591693c7b415e9869157c711fe11263c95d74eDavid Li * to deal in the Software without restriction, including without limitation 71591693c7b415e9869157c711fe11263c95d74eDavid Li * the rights to use, copy, modify, merge, publish, distribute, sublicense, 81591693c7b415e9869157c711fe11263c95d74eDavid Li * and/or sell copies of the Software, and to permit persons to whom the 91591693c7b415e9869157c711fe11263c95d74eDavid Li * Software is furnished to do so, subject to the following conditions: 101591693c7b415e9869157c711fe11263c95d74eDavid Li * 111591693c7b415e9869157c711fe11263c95d74eDavid Li * The above copyright notice and this permission notice (including the next 121591693c7b415e9869157c711fe11263c95d74eDavid Li * paragraph) shall be included in all copies or substantial portions of the 131591693c7b415e9869157c711fe11263c95d74eDavid Li * Software. 141591693c7b415e9869157c711fe11263c95d74eDavid Li * 151591693c7b415e9869157c711fe11263c95d74eDavid Li * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 161591693c7b415e9869157c711fe11263c95d74eDavid Li * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 171591693c7b415e9869157c711fe11263c95d74eDavid Li * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 181591693c7b415e9869157c711fe11263c95d74eDavid Li * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 191591693c7b415e9869157c711fe11263c95d74eDavid Li * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 201591693c7b415e9869157c711fe11263c95d74eDavid Li * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 211591693c7b415e9869157c711fe11263c95d74eDavid Li * DEALINGS IN THE SOFTWARE. 221591693c7b415e9869157c711fe11263c95d74eDavid Li */ 231591693c7b415e9869157c711fe11263c95d74eDavid Li 241591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type glsl_type::_error_type = 251591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_INVALID_ENUM, GLSL_TYPE_ERROR, 0, 0, ""); 261591693c7b415e9869157c711fe11263c95d74eDavid Li 271591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type glsl_type::void_type = 281591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_INVALID_ENUM, GLSL_TYPE_VOID, 0, 0, "void"); 291591693c7b415e9869157c711fe11263c95d74eDavid Li 301591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type *const glsl_type::error_type = & glsl_type::_error_type; 311591693c7b415e9869157c711fe11263c95d74eDavid Li 321591693c7b415e9869157c711fe11263c95d74eDavid Li/** \name Core built-in types 331591693c7b415e9869157c711fe11263c95d74eDavid Li * 341591693c7b415e9869157c711fe11263c95d74eDavid Li * These types exist in all versions of GLSL. 351591693c7b415e9869157c711fe11263c95d74eDavid Li */ 361591693c7b415e9869157c711fe11263c95d74eDavid Li/*@{*/ 371591693c7b415e9869157c711fe11263c95d74eDavid Li 381591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type glsl_type::builtin_core_types[] = { 391591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_BOOL, GLSL_TYPE_BOOL, 1, 1, "bool"), 401591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_BOOL_VEC2, GLSL_TYPE_BOOL, 2, 1, "bvec2"), 411591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_BOOL_VEC3, GLSL_TYPE_BOOL, 3, 1, "bvec3"), 421591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_BOOL_VEC4, GLSL_TYPE_BOOL, 4, 1, "bvec4"), 431591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_INT, GLSL_TYPE_INT, 1, 1, "int"), 441591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_INT_VEC2, GLSL_TYPE_INT, 2, 1, "ivec2"), 451591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_INT_VEC3, GLSL_TYPE_INT, 3, 1, "ivec3"), 461591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_INT_VEC4, GLSL_TYPE_INT, 4, 1, "ivec4"), 471591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_FLOAT, GLSL_TYPE_FLOAT, 1, 1, "float"), 481591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_FLOAT_VEC2, GLSL_TYPE_FLOAT, 2, 1, "vec2"), 491591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_FLOAT_VEC3, GLSL_TYPE_FLOAT, 3, 1, "vec3"), 501591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_FLOAT_VEC4, GLSL_TYPE_FLOAT, 4, 1, "vec4"), 511591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_FLOAT_MAT2, GLSL_TYPE_FLOAT, 2, 2, "mat2"), 521591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_FLOAT_MAT3, GLSL_TYPE_FLOAT, 3, 3, "mat3"), 531591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_FLOAT_MAT4, GLSL_TYPE_FLOAT, 4, 4, "mat4"), 541591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_SAMPLER_2D, GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_FLOAT, 551591693c7b415e9869157c711fe11263c95d74eDavid Li "sampler2D"), 561591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_SAMPLER_CUBE, GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_FLOAT, 571591693c7b415e9869157c711fe11263c95d74eDavid Li "samplerCube"), 581591693c7b415e9869157c711fe11263c95d74eDavid Li}; 591591693c7b415e9869157c711fe11263c95d74eDavid Li 601591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type *const glsl_type::bool_type = & builtin_core_types[0]; 611591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type *const glsl_type::int_type = & builtin_core_types[4]; 621591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type *const glsl_type::ivec4_type = & builtin_core_types[7]; 631591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type *const glsl_type::float_type = & builtin_core_types[8]; 641591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type *const glsl_type::vec2_type = & builtin_core_types[9]; 651591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type *const glsl_type::vec3_type = & builtin_core_types[10]; 661591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type *const glsl_type::vec4_type = & builtin_core_types[11]; 671591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type *const glsl_type::mat2_type = & builtin_core_types[12]; 681591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type *const glsl_type::mat3_type = & builtin_core_types[13]; 691591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type *const glsl_type::mat4_type = & builtin_core_types[14]; 701591693c7b415e9869157c711fe11263c95d74eDavid Li/*@}*/ 711591693c7b415e9869157c711fe11263c95d74eDavid Li 721591693c7b415e9869157c711fe11263c95d74eDavid Li/** \name GLSL structures that have not been deprecated. 731591693c7b415e9869157c711fe11263c95d74eDavid Li */ 741591693c7b415e9869157c711fe11263c95d74eDavid Li/*@{*/ 751591693c7b415e9869157c711fe11263c95d74eDavid Li 761591693c7b415e9869157c711fe11263c95d74eDavid Listatic const struct glsl_struct_field gl_DepthRangeParameters_fields[] = { 771591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::float_type, "near" }, 781591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::float_type, "far" }, 791591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::float_type, "diff" }, 801591693c7b415e9869157c711fe11263c95d74eDavid Li}; 811591693c7b415e9869157c711fe11263c95d74eDavid Li 821591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type glsl_type::builtin_structure_types[] = { 831591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(gl_DepthRangeParameters_fields, 841591693c7b415e9869157c711fe11263c95d74eDavid Li Elements(gl_DepthRangeParameters_fields), 851591693c7b415e9869157c711fe11263c95d74eDavid Li "gl_DepthRangeParameters"), 861591693c7b415e9869157c711fe11263c95d74eDavid Li}; 871591693c7b415e9869157c711fe11263c95d74eDavid Li/*@}*/ 881591693c7b415e9869157c711fe11263c95d74eDavid Li 891591693c7b415e9869157c711fe11263c95d74eDavid Li/** \name GLSL 1.00 / 1.10 structures that are deprecated in GLSL 1.30 901591693c7b415e9869157c711fe11263c95d74eDavid Li */ 911591693c7b415e9869157c711fe11263c95d74eDavid Li/*@{*/ 921591693c7b415e9869157c711fe11263c95d74eDavid Li 931591693c7b415e9869157c711fe11263c95d74eDavid Listatic const struct glsl_struct_field gl_PointParameters_fields[] = { 941591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::float_type, "size" }, 951591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::float_type, "sizeMin" }, 961591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::float_type, "sizeMax" }, 971591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::float_type, "fadeThresholdSize" }, 981591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::float_type, "distanceConstantAttenuation" }, 991591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::float_type, "distanceLinearAttenuation" }, 1001591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::float_type, "distanceQuadraticAttenuation" }, 1011591693c7b415e9869157c711fe11263c95d74eDavid Li}; 1021591693c7b415e9869157c711fe11263c95d74eDavid Li 1031591693c7b415e9869157c711fe11263c95d74eDavid Listatic const struct glsl_struct_field gl_MaterialParameters_fields[] = { 1041591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::vec4_type, "emission" }, 1051591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::vec4_type, "ambient" }, 1061591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::vec4_type, "diffuse" }, 1071591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::vec4_type, "specular" }, 1081591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::float_type, "shininess" }, 1091591693c7b415e9869157c711fe11263c95d74eDavid Li}; 1101591693c7b415e9869157c711fe11263c95d74eDavid Li 1111591693c7b415e9869157c711fe11263c95d74eDavid Listatic const struct glsl_struct_field gl_LightSourceParameters_fields[] = { 1121591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::vec4_type, "ambient" }, 1131591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::vec4_type, "diffuse" }, 1141591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::vec4_type, "specular" }, 1151591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::vec4_type, "position" }, 1161591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::vec4_type, "halfVector" }, 1171591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::vec3_type, "spotDirection" }, 1181591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::float_type, "spotExponent" }, 1191591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::float_type, "spotCutoff" }, 1201591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::float_type, "spotCosCutoff" }, 1211591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::float_type, "constantAttenuation" }, 1221591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::float_type, "linearAttenuation" }, 1231591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::float_type, "quadraticAttenuation" }, 1241591693c7b415e9869157c711fe11263c95d74eDavid Li}; 1251591693c7b415e9869157c711fe11263c95d74eDavid Li 1261591693c7b415e9869157c711fe11263c95d74eDavid Listatic const struct glsl_struct_field gl_LightModelParameters_fields[] = { 1271591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::vec4_type, "ambient" }, 1281591693c7b415e9869157c711fe11263c95d74eDavid Li}; 1291591693c7b415e9869157c711fe11263c95d74eDavid Li 1301591693c7b415e9869157c711fe11263c95d74eDavid Listatic const struct glsl_struct_field gl_LightModelProducts_fields[] = { 1311591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::vec4_type, "sceneColor" }, 1321591693c7b415e9869157c711fe11263c95d74eDavid Li}; 1331591693c7b415e9869157c711fe11263c95d74eDavid Li 1341591693c7b415e9869157c711fe11263c95d74eDavid Listatic const struct glsl_struct_field gl_LightProducts_fields[] = { 1351591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::vec4_type, "ambient" }, 1361591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::vec4_type, "diffuse" }, 1371591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::vec4_type, "specular" }, 1381591693c7b415e9869157c711fe11263c95d74eDavid Li}; 1391591693c7b415e9869157c711fe11263c95d74eDavid Li 1401591693c7b415e9869157c711fe11263c95d74eDavid Listatic const struct glsl_struct_field gl_FogParameters_fields[] = { 1411591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::vec4_type, "color" }, 1421591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::float_type, "density" }, 1431591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::float_type, "start" }, 1441591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::float_type, "end" }, 1451591693c7b415e9869157c711fe11263c95d74eDavid Li { glsl_type::float_type, "scale" }, 1461591693c7b415e9869157c711fe11263c95d74eDavid Li}; 1471591693c7b415e9869157c711fe11263c95d74eDavid Li 1481591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type glsl_type::builtin_110_deprecated_structure_types[] = { 1491591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(gl_PointParameters_fields, 1501591693c7b415e9869157c711fe11263c95d74eDavid Li Elements(gl_PointParameters_fields), 1511591693c7b415e9869157c711fe11263c95d74eDavid Li "gl_PointParameters"), 1521591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(gl_MaterialParameters_fields, 1531591693c7b415e9869157c711fe11263c95d74eDavid Li Elements(gl_MaterialParameters_fields), 1541591693c7b415e9869157c711fe11263c95d74eDavid Li "gl_MaterialParameters"), 1551591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(gl_LightSourceParameters_fields, 1561591693c7b415e9869157c711fe11263c95d74eDavid Li Elements(gl_LightSourceParameters_fields), 1571591693c7b415e9869157c711fe11263c95d74eDavid Li "gl_LightSourceParameters"), 1581591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(gl_LightModelParameters_fields, 1591591693c7b415e9869157c711fe11263c95d74eDavid Li Elements(gl_LightModelParameters_fields), 1601591693c7b415e9869157c711fe11263c95d74eDavid Li "gl_LightModelParameters"), 1611591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(gl_LightModelProducts_fields, 1621591693c7b415e9869157c711fe11263c95d74eDavid Li Elements(gl_LightModelProducts_fields), 1631591693c7b415e9869157c711fe11263c95d74eDavid Li "gl_LightModelProducts"), 1641591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(gl_LightProducts_fields, 1651591693c7b415e9869157c711fe11263c95d74eDavid Li Elements(gl_LightProducts_fields), 1661591693c7b415e9869157c711fe11263c95d74eDavid Li "gl_LightProducts"), 1671591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(gl_FogParameters_fields, 1681591693c7b415e9869157c711fe11263c95d74eDavid Li Elements(gl_FogParameters_fields), 1691591693c7b415e9869157c711fe11263c95d74eDavid Li "gl_FogParameters"), 1701591693c7b415e9869157c711fe11263c95d74eDavid Li}; 1711591693c7b415e9869157c711fe11263c95d74eDavid Li/*@}*/ 1721591693c7b415e9869157c711fe11263c95d74eDavid Li 1731591693c7b415e9869157c711fe11263c95d74eDavid Li/** \name Types in GLSL 1.10 (but not GLSL ES 1.00) 1741591693c7b415e9869157c711fe11263c95d74eDavid Li */ 1751591693c7b415e9869157c711fe11263c95d74eDavid Li/*@{*/ 1761591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type glsl_type::builtin_110_types[] = { 1771591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_SAMPLER_1D, GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_FLOAT, 1781591693c7b415e9869157c711fe11263c95d74eDavid Li "sampler1D"), 1791591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_SAMPLER_1D_SHADOW, GLSL_SAMPLER_DIM_1D, 1, 0, GLSL_TYPE_FLOAT, 1801591693c7b415e9869157c711fe11263c95d74eDavid Li "sampler1DShadow"), 1811591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_SAMPLER_2D_SHADOW, GLSL_SAMPLER_DIM_2D, 1, 0, GLSL_TYPE_FLOAT, 1821591693c7b415e9869157c711fe11263c95d74eDavid Li "sampler2DShadow"), 1831591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_SAMPLER_3D, GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_FLOAT, 1841591693c7b415e9869157c711fe11263c95d74eDavid Li "sampler3D"), 1851591693c7b415e9869157c711fe11263c95d74eDavid Li}; 1861591693c7b415e9869157c711fe11263c95d74eDavid Li/*@}*/ 1871591693c7b415e9869157c711fe11263c95d74eDavid Li 1881591693c7b415e9869157c711fe11263c95d74eDavid Li/** \name Types added in GLSL 1.20 1891591693c7b415e9869157c711fe11263c95d74eDavid Li */ 1901591693c7b415e9869157c711fe11263c95d74eDavid Li/*@{*/ 1911591693c7b415e9869157c711fe11263c95d74eDavid Li 1921591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type glsl_type::builtin_120_types[] = { 1931591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_FLOAT_MAT2x3, GLSL_TYPE_FLOAT, 3, 2, "mat2x3"), 1941591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_FLOAT_MAT2x4, GLSL_TYPE_FLOAT, 4, 2, "mat2x4"), 1951591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_FLOAT_MAT3x2, GLSL_TYPE_FLOAT, 2, 3, "mat3x2"), 1961591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_FLOAT_MAT3x4, GLSL_TYPE_FLOAT, 4, 3, "mat3x4"), 1971591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_FLOAT_MAT4x2, GLSL_TYPE_FLOAT, 2, 4, "mat4x2"), 1981591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_FLOAT_MAT4x3, GLSL_TYPE_FLOAT, 3, 4, "mat4x3"), 1991591693c7b415e9869157c711fe11263c95d74eDavid Li}; 2001591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type *const glsl_type::mat2x3_type = & builtin_120_types[0]; 2011591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type *const glsl_type::mat2x4_type = & builtin_120_types[1]; 2021591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type *const glsl_type::mat3x2_type = & builtin_120_types[2]; 2031591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type *const glsl_type::mat3x4_type = & builtin_120_types[3]; 2041591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type *const glsl_type::mat4x2_type = & builtin_120_types[4]; 2051591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type *const glsl_type::mat4x3_type = & builtin_120_types[5]; 2061591693c7b415e9869157c711fe11263c95d74eDavid Li/*@}*/ 2071591693c7b415e9869157c711fe11263c95d74eDavid Li 2081591693c7b415e9869157c711fe11263c95d74eDavid Li/** \name Types added in GLSL 1.30 2091591693c7b415e9869157c711fe11263c95d74eDavid Li */ 2101591693c7b415e9869157c711fe11263c95d74eDavid Li/*@{*/ 2111591693c7b415e9869157c711fe11263c95d74eDavid Li 2121591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type glsl_type::builtin_130_types[] = { 2131591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_UNSIGNED_INT, GLSL_TYPE_UINT, 1, 1, "uint"), 2141591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_UNSIGNED_INT_VEC2, GLSL_TYPE_UINT, 2, 1, "uvec2"), 2151591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_UNSIGNED_INT_VEC3, GLSL_TYPE_UINT, 3, 1, "uvec3"), 2161591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_UNSIGNED_INT_VEC4, GLSL_TYPE_UINT, 4, 1, "uvec4"), 2171591693c7b415e9869157c711fe11263c95d74eDavid Li 2181591693c7b415e9869157c711fe11263c95d74eDavid Li /* 1D and 2D texture arrays - several of these are included only in 2191591693c7b415e9869157c711fe11263c95d74eDavid Li * builtin_EXT_texture_array_types. 2201591693c7b415e9869157c711fe11263c95d74eDavid Li */ 2211591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_INT_SAMPLER_1D_ARRAY, 2221591693c7b415e9869157c711fe11263c95d74eDavid Li GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_INT, "isampler1DArray"), 2231591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_UNSIGNED_INT_SAMPLER_1D_ARRAY, 2241591693c7b415e9869157c711fe11263c95d74eDavid Li GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_UINT, "usampler1DArray"), 2251591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_INT_SAMPLER_2D_ARRAY, 2261591693c7b415e9869157c711fe11263c95d74eDavid Li GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_INT, "isampler2DArray"), 2271591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_UNSIGNED_INT_SAMPLER_2D_ARRAY, 2281591693c7b415e9869157c711fe11263c95d74eDavid Li GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_UINT, "usampler2DArray"), 2291591693c7b415e9869157c711fe11263c95d74eDavid Li 2301591693c7b415e9869157c711fe11263c95d74eDavid Li /* cube shadow samplers */ 2311591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_SAMPLER_CUBE_SHADOW, 2321591693c7b415e9869157c711fe11263c95d74eDavid Li GLSL_SAMPLER_DIM_CUBE, 1, 0, GLSL_TYPE_FLOAT, "samplerCubeShadow"), 2331591693c7b415e9869157c711fe11263c95d74eDavid Li 2341591693c7b415e9869157c711fe11263c95d74eDavid Li /* signed and unsigned integer samplers */ 2351591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_INT_SAMPLER_1D, 2361591693c7b415e9869157c711fe11263c95d74eDavid Li GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_INT, "isampler1D"), 2371591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_UNSIGNED_INT_SAMPLER_1D, 2381591693c7b415e9869157c711fe11263c95d74eDavid Li GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_UINT, "usampler1D"), 2391591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_INT_SAMPLER_2D, 2401591693c7b415e9869157c711fe11263c95d74eDavid Li GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_INT, "isampler2D"), 2411591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_UNSIGNED_INT_SAMPLER_2D, 2421591693c7b415e9869157c711fe11263c95d74eDavid Li GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_UINT, "usampler2D"), 2431591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_INT_SAMPLER_3D, 2441591693c7b415e9869157c711fe11263c95d74eDavid Li GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_INT, "isampler3D"), 2451591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_UNSIGNED_INT_SAMPLER_3D, 2461591693c7b415e9869157c711fe11263c95d74eDavid Li GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_UINT, "usampler3D"), 2471591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_INT_SAMPLER_CUBE, 2481591693c7b415e9869157c711fe11263c95d74eDavid Li GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_INT, "isamplerCube"), 2491591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_INT_SAMPLER_CUBE, 2501591693c7b415e9869157c711fe11263c95d74eDavid Li GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_UINT, "usamplerCube"), 2511591693c7b415e9869157c711fe11263c95d74eDavid Li}; 2521591693c7b415e9869157c711fe11263c95d74eDavid Li 2531591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type *const glsl_type::uint_type = & builtin_130_types[0]; 2541591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type *const glsl_type::uvec2_type = & builtin_130_types[1]; 2551591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type *const glsl_type::uvec3_type = & builtin_130_types[2]; 2561591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type *const glsl_type::uvec4_type = & builtin_130_types[3]; 2571591693c7b415e9869157c711fe11263c95d74eDavid Li/*@}*/ 2581591693c7b415e9869157c711fe11263c95d74eDavid Li 2591591693c7b415e9869157c711fe11263c95d74eDavid Li/** \name Sampler types added by GL_ARB_texture_rectangle 2601591693c7b415e9869157c711fe11263c95d74eDavid Li */ 2611591693c7b415e9869157c711fe11263c95d74eDavid Li/*@{*/ 2621591693c7b415e9869157c711fe11263c95d74eDavid Li 2631591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type glsl_type::builtin_ARB_texture_rectangle_types[] = { 2641591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_SAMPLER_2D_RECT, 2651591693c7b415e9869157c711fe11263c95d74eDavid Li GLSL_SAMPLER_DIM_RECT, 0, 0, GLSL_TYPE_FLOAT, "sampler2DRect"), 2661591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_SAMPLER_2D_RECT_SHADOW, 2671591693c7b415e9869157c711fe11263c95d74eDavid Li GLSL_SAMPLER_DIM_RECT, 1, 0, GLSL_TYPE_FLOAT, "sampler2DRectShadow"), 2681591693c7b415e9869157c711fe11263c95d74eDavid Li}; 2691591693c7b415e9869157c711fe11263c95d74eDavid Li/*@}*/ 2701591693c7b415e9869157c711fe11263c95d74eDavid Li 2711591693c7b415e9869157c711fe11263c95d74eDavid Li/** \name Sampler types added by GL_EXT_texture_array 2721591693c7b415e9869157c711fe11263c95d74eDavid Li */ 2731591693c7b415e9869157c711fe11263c95d74eDavid Li/*@{*/ 2741591693c7b415e9869157c711fe11263c95d74eDavid Li 2751591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type glsl_type::builtin_EXT_texture_array_types[] = { 2761591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_SAMPLER_1D_ARRAY, 2771591693c7b415e9869157c711fe11263c95d74eDavid Li GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_FLOAT, "sampler1DArray"), 2781591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_SAMPLER_2D_ARRAY, 2791591693c7b415e9869157c711fe11263c95d74eDavid Li GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_FLOAT, "sampler2DArray"), 2801591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_SAMPLER_1D_ARRAY_SHADOW, 2811591693c7b415e9869157c711fe11263c95d74eDavid Li GLSL_SAMPLER_DIM_1D, 1, 1, GLSL_TYPE_FLOAT, "sampler1DArrayShadow"), 2821591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_SAMPLER_2D_ARRAY_SHADOW, 2831591693c7b415e9869157c711fe11263c95d74eDavid Li GLSL_SAMPLER_DIM_2D, 1, 1, GLSL_TYPE_FLOAT, "sampler2DArrayShadow"), 2841591693c7b415e9869157c711fe11263c95d74eDavid Li}; 2851591693c7b415e9869157c711fe11263c95d74eDavid Li/*@}*/ 2861591693c7b415e9869157c711fe11263c95d74eDavid Li 2871591693c7b415e9869157c711fe11263c95d74eDavid Li/** \name Sampler types added by GL_EXT_texture_buffer_object 2881591693c7b415e9869157c711fe11263c95d74eDavid Li */ 2891591693c7b415e9869157c711fe11263c95d74eDavid Li/*@{*/ 2901591693c7b415e9869157c711fe11263c95d74eDavid Li 2911591693c7b415e9869157c711fe11263c95d74eDavid Liconst glsl_type glsl_type::builtin_EXT_texture_buffer_object_types[] = { 2921591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_SAMPLER_BUFFER, 2931591693c7b415e9869157c711fe11263c95d74eDavid Li GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_FLOAT, "samplerBuffer"), 2941591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_INT_SAMPLER_BUFFER, 2951591693c7b415e9869157c711fe11263c95d74eDavid Li GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_INT, "isamplerBuffer"), 2961591693c7b415e9869157c711fe11263c95d74eDavid Li glsl_type(GL_UNSIGNED_INT_SAMPLER_BUFFER, 2971591693c7b415e9869157c711fe11263c95d74eDavid Li GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_UINT, "usamplerBuffer"), 2981591693c7b415e9869157c711fe11263c95d74eDavid Li}; 2991591693c7b415e9869157c711fe11263c95d74eDavid Li/*@}*/ 300