Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

builtin_variables.h 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * Copyright © 2010 Intel Corporation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice (including the next
  12. * paragraph) shall be included in all copies or substantial portions of the
  13. * Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  18. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  20. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  21. * DEALINGS IN THE SOFTWARE.
  22. */
  23. struct builtin_variable {
  24. enum ir_variable_mode mode;
  25. const char *type;
  26. const char *name;
  27. };
  28. static const builtin_variable builtin_core_vs_variables[] = {
  29. { ir_var_out, "vec4", "gl_Position" },
  30. { ir_var_out, "float", "gl_PointSize" },
  31. };
  32. static const builtin_variable builtin_core_fs_variables[] = {
  33. { ir_var_in, "vec4", "gl_FragCoord" },
  34. { ir_var_in, "bool", "gl_FrontFacing" },
  35. { ir_var_out, "vec4", "gl_FragColor" },
  36. { ir_var_out, "float", "gl_FragDepth" },
  37. };
  38. static const builtin_variable builtin_110_deprecated_fs_variables[] = {
  39. { ir_var_in, "vec4", "gl_Color" },
  40. { ir_var_in, "vec4", "gl_SecondaryColor" },
  41. { ir_var_in, "float", "gl_FogFragCoord" },
  42. };
  43. static const builtin_variable builtin_110_deprecated_vs_variables[] = {
  44. { ir_var_in, "vec4", "gl_Vertex" },
  45. { ir_var_in, "vec3", "gl_Normal" },
  46. { ir_var_in, "vec4", "gl_Color" },
  47. { ir_var_in, "vec4", "gl_SecondaryColor" },
  48. { ir_var_in, "vec4", "gl_MultiTexCoord0" },
  49. { ir_var_in, "vec4", "gl_MultiTexCoord1" },
  50. { ir_var_in, "vec4", "gl_MultiTexCoord2" },
  51. { ir_var_in, "vec4", "gl_MultiTexCoord3" },
  52. { ir_var_in, "vec4", "gl_MultiTexCoord4" },
  53. { ir_var_in, "vec4", "gl_MultiTexCoord5" },
  54. { ir_var_in, "vec4", "gl_MultiTexCoord6" },
  55. { ir_var_in, "vec4", "gl_MultiTexCoord7" },
  56. { ir_var_in, "float", "gl_FogCoord" },
  57. { ir_var_out, "vec4", "gl_ClipVertex" },
  58. { ir_var_out, "vec4", "gl_FrontColor" },
  59. { ir_var_out, "vec4", "gl_BackColor" },
  60. { ir_var_out, "vec4", "gl_FrontSecondaryColor" },
  61. { ir_var_out, "vec4", "gl_BackSecondaryColor" },
  62. { ir_var_out, "float", "gl_FogFragCoord" },
  63. };
  64. static const builtin_variable builtin_130_vs_variables[] = {
  65. { ir_var_in, "int", "gl_VertexID" },
  66. };
  67. static const builtin_variable builtin_110_deprecated_uniforms[] = {
  68. { ir_var_uniform, "mat4", "gl_ModelViewMatrix" },
  69. { ir_var_uniform, "mat4", "gl_ProjectionMatrix" },
  70. { ir_var_uniform, "mat4", "gl_ModelViewProjectionMatrix" },
  71. { ir_var_uniform, "mat3", "gl_NormalMatrix" },
  72. { ir_var_uniform, "mat4", "gl_ModelViewMatrixInverse" },
  73. { ir_var_uniform, "mat4", "gl_ProjectionMatrixInverse" },
  74. { ir_var_uniform, "mat4", "gl_ModelViewProjectionMatrixInverse" },
  75. { ir_var_uniform, "mat4", "gl_ModelViewMatrixTranspose" },
  76. { ir_var_uniform, "mat4", "gl_ProjectionMatrixTranspose" },
  77. { ir_var_uniform, "mat4", "gl_ModelViewProjectionMatrixTranspose" },
  78. { ir_var_uniform, "mat4", "gl_ModelViewMatrixInverseTranspose" },
  79. { ir_var_uniform, "mat4", "gl_ProjectionMatrixInverseTranspose" },
  80. { ir_var_uniform, "mat4", "gl_ModelViewProjectionMatrixInverseTranspose" },
  81. { ir_var_uniform, "float", "gl_NormalScale" },
  82. };