1f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* 2f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Copyright © 2009 Intel Corporation 3f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 4f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Permission is hereby granted, free of charge, to any person obtaining a 5f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * copy of this software and associated documentation files (the "Software"), 6f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * to deal in the Software without restriction, including without limitation 7f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * and/or sell copies of the Software, and to permit persons to whom the 9f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Software is furnished to do so, subject to the following conditions: 10f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 11f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * The above copyright notice and this permission notice (including the next 12f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * paragraph) shall be included in all copies or substantial portions of the 13f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Software. 14f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 15f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * DEALINGS IN THE SOFTWARE. 22f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 23f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 24f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type glsl_type::_error_type = 25f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_INVALID_ENUM, GLSL_TYPE_ERROR, 0, 0, ""); 26f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 27f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type glsl_type::_void_type = 28f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_INVALID_ENUM, GLSL_TYPE_VOID, 0, 0, "void"); 29f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 30f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type glsl_type::_sampler3D_type = 31f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_SAMPLER_3D, GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_FLOAT, 32f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org "sampler3D"); 33f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 34f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::error_type = & glsl_type::_error_type; 35f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::void_type = & glsl_type::_void_type; 36f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 37f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/** \name Core built-in types 38f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 39f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * These types exist in all versions of GLSL. 40f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 41f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@{*/ 42f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 43f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type glsl_type::builtin_core_types[] = { 44f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_BOOL, GLSL_TYPE_BOOL, 1, 1, "bool"), 45f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_BOOL_VEC2, GLSL_TYPE_BOOL, 2, 1, "bvec2"), 46f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_BOOL_VEC3, GLSL_TYPE_BOOL, 3, 1, "bvec3"), 47f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_BOOL_VEC4, GLSL_TYPE_BOOL, 4, 1, "bvec4"), 48f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_INT, GLSL_TYPE_INT, 1, 1, "int"), 49f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_INT_VEC2, GLSL_TYPE_INT, 2, 1, "ivec2"), 50f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_INT_VEC3, GLSL_TYPE_INT, 3, 1, "ivec3"), 51f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_INT_VEC4, GLSL_TYPE_INT, 4, 1, "ivec4"), 52f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_FLOAT, GLSL_TYPE_FLOAT, 1, 1, "float"), 53f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_FLOAT_VEC2, GLSL_TYPE_FLOAT, 2, 1, "vec2"), 54f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_FLOAT_VEC3, GLSL_TYPE_FLOAT, 3, 1, "vec3"), 55f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_FLOAT_VEC4, GLSL_TYPE_FLOAT, 4, 1, "vec4"), 56f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_FLOAT_MAT2, GLSL_TYPE_FLOAT, 2, 2, "mat2"), 57f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_FLOAT_MAT3, GLSL_TYPE_FLOAT, 3, 3, "mat3"), 58f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_FLOAT_MAT4, GLSL_TYPE_FLOAT, 4, 4, "mat4"), 59f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_SAMPLER_2D, GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_FLOAT, 60f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org "sampler2D"), 61f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_SAMPLER_CUBE, GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_FLOAT, 62f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org "samplerCube"), 63f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 64f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 65f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::bool_type = & builtin_core_types[0]; 66f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::bvec2_type = & builtin_core_types[1]; 67f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::bvec3_type = & builtin_core_types[2]; 68f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::bvec4_type = & builtin_core_types[3]; 69f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::int_type = & builtin_core_types[4]; 70f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::ivec2_type = & builtin_core_types[5]; 71f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::ivec3_type = & builtin_core_types[6]; 72f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::ivec4_type = & builtin_core_types[7]; 73f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::float_type = & builtin_core_types[8]; 74f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::vec2_type = & builtin_core_types[9]; 75f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::vec3_type = & builtin_core_types[10]; 76f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::vec4_type = & builtin_core_types[11]; 77f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::mat2_type = & builtin_core_types[12]; 78f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::mat3_type = & builtin_core_types[13]; 79f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::mat4_type = & builtin_core_types[14]; 80f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@}*/ 81f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 82f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/** \name GLSL structures that have not been deprecated. 83f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 84f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@{*/ 85f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 86f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic const struct glsl_struct_field gl_DepthRangeParameters_fields[] = { 87f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::float_type, "near" }, 88f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::float_type, "far" }, 89f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::float_type, "diff" }, 90f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 91f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 92f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type glsl_type::builtin_structure_types[] = { 93f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(gl_DepthRangeParameters_fields, 94f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org Elements(gl_DepthRangeParameters_fields), 95f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org "gl_DepthRangeParameters"), 96f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 97f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@}*/ 98f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 99f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/** \name GLSL 1.00 / 1.10 structures that are deprecated in GLSL 1.30 100f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 101f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@{*/ 102f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 103f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic const struct glsl_struct_field gl_PointParameters_fields[] = { 104f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::float_type, "size" }, 105f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::float_type, "sizeMin" }, 106f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::float_type, "sizeMax" }, 107f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::float_type, "fadeThresholdSize" }, 108f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::float_type, "distanceConstantAttenuation" }, 109f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::float_type, "distanceLinearAttenuation" }, 110f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::float_type, "distanceQuadraticAttenuation" }, 111f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 112f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 113f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic const struct glsl_struct_field gl_MaterialParameters_fields[] = { 114f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::vec4_type, "emission" }, 115f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::vec4_type, "ambient" }, 116f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::vec4_type, "diffuse" }, 117f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::vec4_type, "specular" }, 118f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::float_type, "shininess" }, 119f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 120f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 121f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic const struct glsl_struct_field gl_LightSourceParameters_fields[] = { 122f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::vec4_type, "ambient" }, 123f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::vec4_type, "diffuse" }, 124f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::vec4_type, "specular" }, 125f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::vec4_type, "position" }, 126f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::vec4_type, "halfVector" }, 127f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::vec3_type, "spotDirection" }, 128f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::float_type, "spotExponent" }, 129f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::float_type, "spotCutoff" }, 130f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::float_type, "spotCosCutoff" }, 131f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::float_type, "constantAttenuation" }, 132f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::float_type, "linearAttenuation" }, 133f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::float_type, "quadraticAttenuation" }, 134f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 135f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 136f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic const struct glsl_struct_field gl_LightModelParameters_fields[] = { 137f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::vec4_type, "ambient" }, 138f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 139f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 140f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic const struct glsl_struct_field gl_LightModelProducts_fields[] = { 141f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::vec4_type, "sceneColor" }, 142f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 143f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 144f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic const struct glsl_struct_field gl_LightProducts_fields[] = { 145f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::vec4_type, "ambient" }, 146f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::vec4_type, "diffuse" }, 147f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::vec4_type, "specular" }, 148f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 149f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 150f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic const struct glsl_struct_field gl_FogParameters_fields[] = { 151f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::vec4_type, "color" }, 152f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::float_type, "density" }, 153f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::float_type, "start" }, 154f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::float_type, "end" }, 155f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org { glsl_type::float_type, "scale" }, 156f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 157f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 158f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type glsl_type::builtin_110_deprecated_structure_types[] = { 159f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(gl_PointParameters_fields, 160f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org Elements(gl_PointParameters_fields), 161f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org "gl_PointParameters"), 162f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(gl_MaterialParameters_fields, 163f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org Elements(gl_MaterialParameters_fields), 164f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org "gl_MaterialParameters"), 165f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(gl_LightSourceParameters_fields, 166f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org Elements(gl_LightSourceParameters_fields), 167f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org "gl_LightSourceParameters"), 168f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(gl_LightModelParameters_fields, 169f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org Elements(gl_LightModelParameters_fields), 170f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org "gl_LightModelParameters"), 171f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(gl_LightModelProducts_fields, 172f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org Elements(gl_LightModelProducts_fields), 173f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org "gl_LightModelProducts"), 174f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(gl_LightProducts_fields, 175f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org Elements(gl_LightProducts_fields), 176f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org "gl_LightProducts"), 177f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(gl_FogParameters_fields, 178f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org Elements(gl_FogParameters_fields), 179f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org "gl_FogParameters"), 180f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 181f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@}*/ 182f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 183f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/** \name Types in GLSL 1.10 (but not GLSL ES 1.00) 184f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 185f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@{*/ 186f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type glsl_type::builtin_110_types[] = { 187f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_SAMPLER_1D, GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_FLOAT, 188f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org "sampler1D"), 189f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_SAMPLER_1D_SHADOW, GLSL_SAMPLER_DIM_1D, 1, 0, GLSL_TYPE_FLOAT, 190f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org "sampler1DShadow"), 191f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_SAMPLER_2D_SHADOW, GLSL_SAMPLER_DIM_2D, 1, 0, GLSL_TYPE_FLOAT, 192f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org "sampler2DShadow"), 193f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 194f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@}*/ 195f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 196f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/** \name Types added in GLSL 1.20 197f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 198f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@{*/ 199f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 200f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type glsl_type::builtin_120_types[] = { 201f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_FLOAT_MAT2x3, GLSL_TYPE_FLOAT, 3, 2, "mat2x3"), 202f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_FLOAT_MAT2x4, GLSL_TYPE_FLOAT, 4, 2, "mat2x4"), 203f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_FLOAT_MAT3x2, GLSL_TYPE_FLOAT, 2, 3, "mat3x2"), 204f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_FLOAT_MAT3x4, GLSL_TYPE_FLOAT, 4, 3, "mat3x4"), 205f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_FLOAT_MAT4x2, GLSL_TYPE_FLOAT, 2, 4, "mat4x2"), 206f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_FLOAT_MAT4x3, GLSL_TYPE_FLOAT, 3, 4, "mat4x3"), 207f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 208f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::mat2x3_type = & builtin_120_types[0]; 209f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::mat2x4_type = & builtin_120_types[1]; 210f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::mat3x2_type = & builtin_120_types[2]; 211f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::mat3x4_type = & builtin_120_types[3]; 212f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::mat4x2_type = & builtin_120_types[4]; 213f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::mat4x3_type = & builtin_120_types[5]; 214f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@}*/ 215f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 216f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/** \name Types added in GLSL 1.30 217f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 218f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@{*/ 219f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 220f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type glsl_type::builtin_130_types[] = { 221f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_UNSIGNED_INT, GLSL_TYPE_UINT, 1, 1, "uint"), 222f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_UNSIGNED_INT_VEC2, GLSL_TYPE_UINT, 2, 1, "uvec2"), 223f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_UNSIGNED_INT_VEC3, GLSL_TYPE_UINT, 3, 1, "uvec3"), 224f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_UNSIGNED_INT_VEC4, GLSL_TYPE_UINT, 4, 1, "uvec4"), 225f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 226f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org /* 1D and 2D texture arrays - several of these are included only in 227f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * builtin_EXT_texture_array_types. 228f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 229f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_INT_SAMPLER_1D_ARRAY, 230f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_INT, "isampler1DArray"), 231f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_UNSIGNED_INT_SAMPLER_1D_ARRAY, 232f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_UINT, "usampler1DArray"), 233f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_INT_SAMPLER_2D_ARRAY, 234f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_INT, "isampler2DArray"), 235f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_UNSIGNED_INT_SAMPLER_2D_ARRAY, 236f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_UINT, "usampler2DArray"), 237f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 238f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org /* cube shadow samplers */ 239f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_SAMPLER_CUBE_SHADOW, 240f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_CUBE, 1, 0, GLSL_TYPE_FLOAT, "samplerCubeShadow"), 241f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 242f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org /* signed and unsigned integer samplers */ 243f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_INT_SAMPLER_1D, 244f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_INT, "isampler1D"), 245f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_UNSIGNED_INT_SAMPLER_1D, 246f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_1D, 0, 0, GLSL_TYPE_UINT, "usampler1D"), 247f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_INT_SAMPLER_2D, 248f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_INT, "isampler2D"), 249f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_UNSIGNED_INT_SAMPLER_2D, 250f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_2D, 0, 0, GLSL_TYPE_UINT, "usampler2D"), 251f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_INT_SAMPLER_3D, 252f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_INT, "isampler3D"), 253f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_UNSIGNED_INT_SAMPLER_3D, 254f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_3D, 0, 0, GLSL_TYPE_UINT, "usampler3D"), 255f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_INT_SAMPLER_CUBE, 256f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_INT, "isamplerCube"), 257f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_INT_SAMPLER_CUBE, 258f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_CUBE, 0, 0, GLSL_TYPE_UINT, "usamplerCube"), 259f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 260f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 261f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::uint_type = & builtin_130_types[0]; 262f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::uvec2_type = & builtin_130_types[1]; 263f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::uvec3_type = & builtin_130_types[2]; 264f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type *const glsl_type::uvec4_type = & builtin_130_types[3]; 265f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@}*/ 266f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 267f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 268f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/** \name Types added in GLSL 1.40 269f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 270f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@{*/ 271f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type glsl_type::builtin_140_types[] = { 272f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_INT_SAMPLER_2D_RECT, 273f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_RECT, 0, 0, GLSL_TYPE_INT, "isampler2DRect"), 274f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_UNSIGNED_INT_SAMPLER_2D_RECT, 275f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_RECT, 0, 0, GLSL_TYPE_UINT, "usampler2DRect"), 276f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 277f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@}*/ 278f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 279f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/** \name Sampler types added by GL_ARB_texture_rectangle 280f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 281f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@{*/ 282f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 283f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type glsl_type::builtin_ARB_texture_rectangle_types[] = { 284f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_SAMPLER_2D_RECT, 285f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_RECT, 0, 0, GLSL_TYPE_FLOAT, "sampler2DRect"), 286f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_SAMPLER_2D_RECT_SHADOW, 287f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_RECT, 1, 0, GLSL_TYPE_FLOAT, "sampler2DRectShadow"), 288f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 289f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@}*/ 290f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 291f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/** \name Sampler types added by GL_EXT_texture_array 292f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 293f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@{*/ 294f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 295f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type glsl_type::builtin_EXT_texture_array_types[] = { 296f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_SAMPLER_1D_ARRAY, 297f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_1D, 0, 1, GLSL_TYPE_FLOAT, "sampler1DArray"), 298f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_SAMPLER_2D_ARRAY, 299f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_2D, 0, 1, GLSL_TYPE_FLOAT, "sampler2DArray"), 300f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_SAMPLER_1D_ARRAY_SHADOW, 301f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_1D, 1, 1, GLSL_TYPE_FLOAT, "sampler1DArrayShadow"), 302f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_SAMPLER_2D_ARRAY_SHADOW, 303f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_2D, 1, 1, GLSL_TYPE_FLOAT, "sampler2DArrayShadow"), 304f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 305f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@}*/ 306f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 307f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/** \name Sampler types added by GL_EXT_texture_buffer_object 308f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 309f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@{*/ 310f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 311f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type glsl_type::builtin_EXT_texture_buffer_object_types[] = { 312f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_SAMPLER_BUFFER, 313f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_FLOAT, "samplerBuffer"), 314f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_INT_SAMPLER_BUFFER, 315f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_INT, "isamplerBuffer"), 316f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_UNSIGNED_INT_SAMPLER_BUFFER, 317f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_BUF, 0, 0, GLSL_TYPE_UINT, "usamplerBuffer"), 318f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 319f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@}*/ 320f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 321f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/** \name Sampler types added by GL_OES_EGL_image_external 322f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 323f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@{*/ 324f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 325f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgconst glsl_type glsl_type::builtin_OES_EGL_image_external_types[] = { 326f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org glsl_type(GL_SAMPLER_EXTERNAL_OES, 327f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org GLSL_SAMPLER_DIM_EXTERNAL, 0, 0, GLSL_TYPE_FLOAT, "samplerExternalOES"), 328f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 329f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@}*/ 330