panfrost: Unify bind_vs/fs_state
[mesa.git] / src / compiler / glsl / builtin_types.cpp
index d2bcdd681383a90fc6b1654356510d8cf140ad1a..b29d71fa0a502f79614e01838fc3d53c9244887b 100644 (file)
@@ -37,6 +37,7 @@
 #include "compiler/glsl_types.h"
 #include "glsl_parser_extras.h"
 #include "util/macros.h"
+#include "main/mtypes.h"
 
 /**
  * Declarations of type flyweights (glsl_type::_foo_type) and
@@ -324,6 +325,52 @@ _mesa_glsl_initialize_types(struct _mesa_glsl_parse_state *state)
       add_type(symbols, glsl_type::sampler2DRectShadow_type);
    }
 
+   if (state->EXT_gpu_shader4_enable) {
+      add_type(symbols, glsl_type::uint_type);
+      add_type(symbols, glsl_type::uvec2_type);
+      add_type(symbols, glsl_type::uvec3_type);
+      add_type(symbols, glsl_type::uvec4_type);
+
+      add_type(symbols, glsl_type::samplerCubeShadow_type);
+
+      if (state->ctx->Extensions.EXT_texture_array) {
+         add_type(symbols, glsl_type::sampler1DArray_type);
+         add_type(symbols, glsl_type::sampler2DArray_type);
+         add_type(symbols, glsl_type::sampler1DArrayShadow_type);
+         add_type(symbols, glsl_type::sampler2DArrayShadow_type);
+      }
+      if (state->ctx->Extensions.EXT_texture_buffer_object) {
+         add_type(symbols, glsl_type::samplerBuffer_type);
+      }
+
+      if (state->ctx->Extensions.EXT_texture_integer) {
+         add_type(symbols, glsl_type::isampler1D_type);
+         add_type(symbols, glsl_type::isampler2D_type);
+         add_type(symbols, glsl_type::isampler3D_type);
+         add_type(symbols, glsl_type::isamplerCube_type);
+
+         add_type(symbols, glsl_type::usampler1D_type);
+         add_type(symbols, glsl_type::usampler2D_type);
+         add_type(symbols, glsl_type::usampler3D_type);
+         add_type(symbols, glsl_type::usamplerCube_type);
+
+         if (state->ctx->Extensions.NV_texture_rectangle) {
+            add_type(symbols, glsl_type::isampler2DRect_type);
+            add_type(symbols, glsl_type::usampler2DRect_type);
+         }
+         if (state->ctx->Extensions.EXT_texture_array) {
+            add_type(symbols, glsl_type::isampler1DArray_type);
+            add_type(symbols, glsl_type::isampler2DArray_type);
+            add_type(symbols, glsl_type::usampler1DArray_type);
+            add_type(symbols, glsl_type::usampler2DArray_type);
+         }
+         if (state->ctx->Extensions.EXT_texture_buffer_object) {
+            add_type(symbols, glsl_type::isamplerBuffer_type);
+            add_type(symbols, glsl_type::usamplerBuffer_type);
+         }
+      }
+   }
+
    if (state->EXT_texture_array_enable) {
       add_type(symbols, glsl_type::sampler1DArray_type);
       add_type(symbols, glsl_type::sampler2DArray_type);