Clone of mesa.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

builtin_variables.h 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. #include "main/mtypes.h"
  24. struct builtin_variable {
  25. enum ir_variable_mode mode;
  26. int slot;
  27. const char *type;
  28. const char *name;
  29. };
  30. static const builtin_variable builtin_core_vs_variables[] = {
  31. { ir_var_out, VERT_RESULT_HPOS, "vec4", "gl_Position" },
  32. { ir_var_out, VERT_RESULT_PSIZ, "float", "gl_PointSize" },
  33. };
  34. static const builtin_variable builtin_core_fs_variables[] = {
  35. { ir_var_in, FRAG_ATTRIB_WPOS, "vec4", "gl_FragCoord" },
  36. { ir_var_in, FRAG_ATTRIB_FACE, "bool", "gl_FrontFacing" },
  37. { ir_var_out, FRAG_RESULT_COLOR, "vec4", "gl_FragColor" },
  38. { ir_var_out, FRAG_RESULT_DEPTH, "float", "gl_FragDepth" },
  39. };
  40. static const builtin_variable builtin_110_deprecated_fs_variables[] = {
  41. { ir_var_in, FRAG_ATTRIB_COL0, "vec4", "gl_Color" },
  42. { ir_var_in, FRAG_ATTRIB_COL1, "vec4", "gl_SecondaryColor" },
  43. { ir_var_in, FRAG_ATTRIB_FOGC, "float", "gl_FogFragCoord" },
  44. };
  45. static const builtin_variable builtin_110_deprecated_vs_variables[] = {
  46. { ir_var_in, VERT_ATTRIB_POS, "vec4", "gl_Vertex" },
  47. { ir_var_in, VERT_ATTRIB_NORMAL, "vec3", "gl_Normal" },
  48. { ir_var_in, VERT_ATTRIB_COLOR0, "vec4", "gl_Color" },
  49. { ir_var_in, VERT_ATTRIB_COLOR1, "vec4", "gl_SecondaryColor" },
  50. { ir_var_in, VERT_ATTRIB_TEX0, "vec4", "gl_MultiTexCoord0" },
  51. { ir_var_in, VERT_ATTRIB_TEX1, "vec4", "gl_MultiTexCoord1" },
  52. { ir_var_in, VERT_ATTRIB_TEX2, "vec4", "gl_MultiTexCoord2" },
  53. { ir_var_in, VERT_ATTRIB_TEX3, "vec4", "gl_MultiTexCoord3" },
  54. { ir_var_in, VERT_ATTRIB_TEX4, "vec4", "gl_MultiTexCoord4" },
  55. { ir_var_in, VERT_ATTRIB_TEX5, "vec4", "gl_MultiTexCoord5" },
  56. { ir_var_in, VERT_ATTRIB_TEX6, "vec4", "gl_MultiTexCoord6" },
  57. { ir_var_in, VERT_ATTRIB_TEX7, "vec4", "gl_MultiTexCoord7" },
  58. { ir_var_in, VERT_ATTRIB_FOG, "float", "gl_FogCoord" },
  59. { ir_var_out, VERT_RESULT_HPOS, "vec4", "gl_ClipVertex" },
  60. { ir_var_out, VERT_RESULT_COL0, "vec4", "gl_FrontColor" },
  61. { ir_var_out, VERT_RESULT_BFC0, "vec4", "gl_BackColor" },
  62. { ir_var_out, VERT_RESULT_COL1, "vec4", "gl_FrontSecondaryColor" },
  63. { ir_var_out, VERT_RESULT_BFC1, "vec4", "gl_BackSecondaryColor" },
  64. { ir_var_out, VERT_RESULT_FOGC, "float", "gl_FogFragCoord" },
  65. };
  66. static const builtin_variable builtin_130_vs_variables[] = {
  67. { ir_var_in, -1, "int", "gl_VertexID" },
  68. };
  69. static const builtin_variable builtin_110_deprecated_uniforms[] = {
  70. { ir_var_uniform, -1, "mat4", "gl_ModelViewMatrix" },
  71. { ir_var_uniform, -1, "mat4", "gl_ProjectionMatrix" },
  72. { ir_var_uniform, -1, "mat4", "gl_ModelViewProjectionMatrix" },
  73. { ir_var_uniform, -1, "mat3", "gl_NormalMatrix" },
  74. { ir_var_uniform, -1, "mat4", "gl_ModelViewMatrixInverse" },
  75. { ir_var_uniform, -1, "mat4", "gl_ProjectionMatrixInverse" },
  76. { ir_var_uniform, -1, "mat4", "gl_ModelViewProjectionMatrixInverse" },
  77. { ir_var_uniform, -1, "mat4", "gl_ModelViewMatrixTranspose" },
  78. { ir_var_uniform, -1, "mat4", "gl_ProjectionMatrixTranspose" },
  79. { ir_var_uniform, -1, "mat4", "gl_ModelViewProjectionMatrixTranspose" },
  80. { ir_var_uniform, -1, "mat4", "gl_ModelViewMatrixInverseTranspose" },
  81. { ir_var_uniform, -1, "mat4", "gl_ProjectionMatrixInverseTranspose" },
  82. { ir_var_uniform, -1, "mat4", "gl_ModelViewProjectionMatrixInverseTranspose" },
  83. { ir_var_uniform, -1, "float", "gl_NormalScale" },
  84. };