[Mesa-dev] [RFC PATCH 09/26] glsl: add texture functions for bindless sampler types

Samuel Pitoiset samuel.pitoiset at gmail.com
Tue Apr 11 16:48:20 UTC 2017


A bunch of predicate helpers have to be duplicated for bindless.
Macros are used to declare builtin functions for both "bound" and
"bindless" sampler types.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/compiler/glsl/builtin_functions.cpp | 1727 ++++++++++++++++++-------------
 1 file changed, 998 insertions(+), 729 deletions(-)

diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp
index 5d62d9f8ee..62c9ac518b 100644
--- a/src/compiler/glsl/builtin_functions.cpp
+++ b/src/compiler/glsl/builtin_functions.cpp
@@ -614,6 +614,241 @@ integer_functions_supported(const _mesa_glsl_parse_state *state)
 {
    return state->extensions->MESA_shader_integer_functions;
 }
+
+static bool
+bindless(const _mesa_glsl_parse_state *state)
+{
+   return state->has_bindless();
+}
+
+static bool
+always_available_bindless(const _mesa_glsl_parse_state *state)
+{
+   return bindless(state);
+}
+
+static bool
+v130_bindless(const _mesa_glsl_parse_state *state)
+{
+   return v130(state) && bindless(state);
+}
+
+static bool
+texture_cube_map_array_bindless(const _mesa_glsl_parse_state *state)
+{
+   return texture_cube_map_array(state) && bindless(state);
+}
+
+static bool
+texture_buffer_bindless(const _mesa_glsl_parse_state *state)
+{
+   return texture_buffer(state) && bindless(state);
+}
+
+static bool
+texture_multisample_bindless(const _mesa_glsl_parse_state *state)
+{
+   return texture_multisample(state) && bindless(state);
+}
+
+static bool
+texture_multisample_array_bindless(const _mesa_glsl_parse_state *state)
+{
+   return texture_multisample_array(state) && bindless(state);
+}
+
+static bool
+shader_samples_bindless(const _mesa_glsl_parse_state *state)
+{
+   return shader_samples(state) && bindless(state);
+}
+
+static bool
+texture_query_lod_bindless(const _mesa_glsl_parse_state *state)
+{
+   return texture_query_lod(state) && bindless(state);
+}
+
+static bool
+v400_fs_only_bindless(const _mesa_glsl_parse_state *state)
+{
+   return v400_fs_only(state) && bindless(state);
+}
+
+static bool
+texture_query_levels_bindless(const _mesa_glsl_parse_state *state)
+{
+   return texture_query_levels(state) && bindless(state);
+}
+
+static bool
+texture_samples_identical_bindless(const _mesa_glsl_parse_state *state)
+{
+   return texture_samples_identical(state) && bindless(state);
+}
+
+static bool
+texture_samples_identical_array_bindless(const _mesa_glsl_parse_state *state)
+{
+   return texture_samples_identical_array(state) && bindless(state);
+}
+
+static bool
+gpu_shader5_bindless(const _mesa_glsl_parse_state *state)
+{
+   return gpu_shader5(state) && bindless(state);
+}
+
+static bool
+gpu_shader5_es_bindless(const _mesa_glsl_parse_state *state)
+{
+   return gpu_shader5_es(state) && bindless(state);
+}
+
+static bool
+texture_gather_only_or_es31_bindless(const _mesa_glsl_parse_state *state)
+{
+   return texture_gather_only_or_es31(state) && bindless(state);
+}
+
+static bool
+es31_not_gs5_bindless(const _mesa_glsl_parse_state *state)
+{
+   return es31_not_gs5(state) && bindless(state);
+}
+
+static bool
+texture_gather_or_es31_bindless(const _mesa_glsl_parse_state *state)
+{
+   return texture_gather_or_es31(state) && bindless(state);
+}
+
+static bool
+texture_gather_cube_map_array_bindless(const _mesa_glsl_parse_state *state)
+{
+   return texture_gather_cube_map_array(state) && bindless(state);
+}
+
+static bool
+gpu_shader5_or_es31_bindless(const _mesa_glsl_parse_state *state)
+{
+   return gpu_shader5_or_es31(state) && bindless(state);
+}
+
+static bool
+gpu_shader5_or_OES_texture_cube_map_array_bindless(const _mesa_glsl_parse_state *state)
+{
+   return gpu_shader5_or_OES_texture_cube_map_array(state) && bindless(state);
+}
+
+static bool
+v110_bindless(const _mesa_glsl_parse_state *state)
+{
+   return v110(state) && bindless(state);
+}
+
+static bool
+v110_fs_only_bindless(const _mesa_glsl_parse_state *state)
+{
+   return v110_fs_only(state) && bindless(state);
+}
+
+static bool
+texture_array_lod_bindless(const _mesa_glsl_parse_state *state)
+{
+   return texture_array_lod(state) && bindless(state);
+}
+
+static bool
+fs_texture_array_bindless(const _mesa_glsl_parse_state *state)
+{
+   return fs_texture_array(state) && bindless(state);
+}
+
+static bool
+texture_array_bindless(const _mesa_glsl_parse_state *state)
+{
+   return texture_array(state) && bindless(state);
+}
+
+static bool
+tex1d_lod_bindless(const _mesa_glsl_parse_state *state)
+{
+   return tex1d_lod(state) && bindless(state);
+}
+
+static bool
+fs_only_bindless(const _mesa_glsl_parse_state *state)
+{
+   return fs_only(state) && bindless(state);
+}
+
+static bool
+lod_exists_in_stage_bindless(const _mesa_glsl_parse_state *state)
+{
+   return lod_exists_in_stage(state) && bindless(state);
+}
+
+static bool
+tex3d_bindless(const _mesa_glsl_parse_state *state)
+{
+   return tex3d(state) && bindless(state);
+}
+
+static bool
+fs_tex3d_bindless(const _mesa_glsl_parse_state *state)
+{
+   return fs_tex3d(state) && bindless(state);
+}
+
+static bool
+tex3d_lod_bindless(const _mesa_glsl_parse_state *state)
+{
+   return tex3d_lod(state) && bindless(state);
+}
+
+static bool
+texture_rectangle_bindless(const _mesa_glsl_parse_state *state)
+{
+   return texture_rectangle(state) && bindless(state);
+}
+
+static bool
+v110_lod_bindless(const _mesa_glsl_parse_state *state)
+{
+   return v110_lod(state) && bindless(state);
+}
+
+static bool
+v130_fs_only_bindless(const _mesa_glsl_parse_state *state)
+{
+   return v130_fs_only(state) && bindless(state);
+}
+
+static bool
+shader_texture_lod_bindless(const _mesa_glsl_parse_state *state)
+{
+   return shader_texture_lod(state) && bindless(state);
+}
+
+static bool
+shader_texture_lod_and_rect_bindless(const _mesa_glsl_parse_state *state)
+{
+   return shader_texture_lod_and_rect(state) && bindless(state);
+}
+
+static bool
+fs_texture_cube_map_array_bindless(const _mesa_glsl_parse_state *state)
+{
+   return fs_texture_cube_map_array(state) && bindless(state);
+}
+
+static bool
+v130_desktop_bindless(const _mesa_glsl_parse_state *state)
+{
+   return v130_desktop(state) && bindless(state);
+}
+
 /** @} */
 
 /******************************************************************************/
@@ -1399,6 +1634,38 @@ builtin_builder::create_builtins()
                 _##NAME(int64, glsl_type::u64vec4_type, glsl_type::u64vec4_type),           \
                 NULL);
 
+#define TEXTURE(OPCODE, AVAIL, RETURN_TYPE, SAMPLER_TYPE, COORD_TYPE, FLAGS) \
+   _texture(OPCODE, AVAIL, glsl_type::RETURN_TYPE##_type, glsl_type::SAMPLER_TYPE##_type, glsl_type::COORD_TYPE##_type, FLAGS), \
+   _texture(OPCODE, AVAIL##_bindless, glsl_type::RETURN_TYPE##_type, glsl_type::SAMPLER_TYPE##Bindless_type, glsl_type::COORD_TYPE##_type, FLAGS)
+
+#define TEXTURE_SIZE(AVAIL, RETURN_TYPE, SAMPLER_TYPE) \
+   _textureSize(AVAIL, glsl_type::RETURN_TYPE##_type, glsl_type::SAMPLER_TYPE##_type), \
+   _textureSize(AVAIL##_bindless, glsl_type::RETURN_TYPE##_type, glsl_type::SAMPLER_TYPE##Bindless_type)
+
+#define TEXTURE_SAMPLES(AVAIL, TYPE) \
+   _textureSamples(AVAIL, glsl_type::TYPE##_type), \
+   _textureSamples(AVAIL##_bindless, glsl_type::TYPE##Bindless_type)
+
+#define TEXEL_FETCH(AVAIL, RETURN_TYPE, SAMPLER_TYPE, COORD_TYPE) \
+   _texelFetch(AVAIL, glsl_type::RETURN_TYPE##_type, glsl_type::SAMPLER_TYPE##_type, glsl_type::COORD_TYPE##_type), \
+   _texelFetch(AVAIL##_bindless, glsl_type::RETURN_TYPE##_type, glsl_type::SAMPLER_TYPE##Bindless_type, glsl_type::COORD_TYPE##_type)
+
+#define TEXEL_FETCH_OFFSET(AVAIL, RETURN_TYPE, SAMPLER_TYPE, COORD_TYPE, OFFSET_TYPE) \
+   _texelFetch(AVAIL, glsl_type::RETURN_TYPE##_type, glsl_type::SAMPLER_TYPE##_type, glsl_type::COORD_TYPE##_type, glsl_type::OFFSET_TYPE##_type), \
+   _texelFetch(AVAIL##_bindless, glsl_type::RETURN_TYPE##_type, glsl_type::SAMPLER_TYPE##Bindless_type, glsl_type::COORD_TYPE##_type, glsl_type::OFFSET_TYPE##_type)
+
+#define TEXTURE_QUERY_LOD(AVAIL, SAMPLER_TYPE, COORD_TYPE) \
+   _textureQueryLod(AVAIL, glsl_type::SAMPLER_TYPE##_type, glsl_type::COORD_TYPE##_type), \
+   _textureQueryLod(AVAIL##_bindless, glsl_type::SAMPLER_TYPE##Bindless_type, glsl_type::COORD_TYPE##_type)
+
+#define TEXTURE_QUERY_LEVELS(AVAIL, SAMPLER_TYPE) \
+   _textureQueryLevels(AVAIL, glsl_type::SAMPLER_TYPE##_type), \
+   _textureQueryLevels(AVAIL##_bindless, glsl_type::SAMPLER_TYPE##Bindless_type)
+
+#define TEXTURE_SAMPLES_IDENTICAL(AVAIL, SAMPLER_TYPE, COORD_TYPE) \
+   _textureSamplesIdentical(AVAIL, glsl_type::SAMPLER_TYPE##_type, glsl_type::COORD_TYPE##_type), \
+   _textureSamplesIdentical(AVAIL##_bindless, glsl_type::SAMPLER_TYPE##Bindless_type, glsl_type::COORD_TYPE##_type)
+
    F(radians)
    F(degrees)
    F(sin)
@@ -1739,632 +2006,633 @@ builtin_builder::create_builtins()
                 NULL);
 
    add_function("textureSize",
-                _textureSize(v130, glsl_type::int_type,   glsl_type::sampler1D_type),
-                _textureSize(v130, glsl_type::int_type,   glsl_type::isampler1D_type),
-                _textureSize(v130, glsl_type::int_type,   glsl_type::usampler1D_type),
-
-                _textureSize(v130, glsl_type::ivec2_type, glsl_type::sampler2D_type),
-                _textureSize(v130, glsl_type::ivec2_type, glsl_type::isampler2D_type),
-                _textureSize(v130, glsl_type::ivec2_type, glsl_type::usampler2D_type),
-
-                _textureSize(v130, glsl_type::ivec3_type, glsl_type::sampler3D_type),
-                _textureSize(v130, glsl_type::ivec3_type, glsl_type::isampler3D_type),
-                _textureSize(v130, glsl_type::ivec3_type, glsl_type::usampler3D_type),
-
-                _textureSize(v130, glsl_type::ivec2_type, glsl_type::samplerCube_type),
-                _textureSize(v130, glsl_type::ivec2_type, glsl_type::isamplerCube_type),
-                _textureSize(v130, glsl_type::ivec2_type, glsl_type::usamplerCube_type),
-
-                _textureSize(v130, glsl_type::int_type,   glsl_type::sampler1DShadow_type),
-                _textureSize(v130, glsl_type::ivec2_type, glsl_type::sampler2DShadow_type),
-                _textureSize(v130, glsl_type::ivec2_type, glsl_type::samplerCubeShadow_type),
-
-                _textureSize(v130, glsl_type::ivec2_type, glsl_type::sampler1DArray_type),
-                _textureSize(v130, glsl_type::ivec2_type, glsl_type::isampler1DArray_type),
-                _textureSize(v130, glsl_type::ivec2_type, glsl_type::usampler1DArray_type),
-                _textureSize(v130, glsl_type::ivec3_type, glsl_type::sampler2DArray_type),
-                _textureSize(v130, glsl_type::ivec3_type, glsl_type::isampler2DArray_type),
-                _textureSize(v130, glsl_type::ivec3_type, glsl_type::usampler2DArray_type),
-
-                _textureSize(v130, glsl_type::ivec2_type, glsl_type::sampler1DArrayShadow_type),
-                _textureSize(v130, glsl_type::ivec3_type, glsl_type::sampler2DArrayShadow_type),
-
-                _textureSize(texture_cube_map_array, glsl_type::ivec3_type, glsl_type::samplerCubeArray_type),
-                _textureSize(texture_cube_map_array, glsl_type::ivec3_type, glsl_type::isamplerCubeArray_type),
-                _textureSize(texture_cube_map_array, glsl_type::ivec3_type, glsl_type::usamplerCubeArray_type),
-                _textureSize(texture_cube_map_array, glsl_type::ivec3_type, glsl_type::samplerCubeArrayShadow_type),
-
-                _textureSize(v130, glsl_type::ivec2_type, glsl_type::sampler2DRect_type),
-                _textureSize(v130, glsl_type::ivec2_type, glsl_type::isampler2DRect_type),
-                _textureSize(v130, glsl_type::ivec2_type, glsl_type::usampler2DRect_type),
-                _textureSize(v130, glsl_type::ivec2_type, glsl_type::sampler2DRectShadow_type),
-
-                _textureSize(texture_buffer, glsl_type::int_type,   glsl_type::samplerBuffer_type),
-                _textureSize(texture_buffer, glsl_type::int_type,   glsl_type::isamplerBuffer_type),
-                _textureSize(texture_buffer, glsl_type::int_type,   glsl_type::usamplerBuffer_type),
-                _textureSize(texture_multisample, glsl_type::ivec2_type, glsl_type::sampler2DMS_type),
-                _textureSize(texture_multisample, glsl_type::ivec2_type, glsl_type::isampler2DMS_type),
-                _textureSize(texture_multisample, glsl_type::ivec2_type, glsl_type::usampler2DMS_type),
-
-                _textureSize(texture_multisample_array, glsl_type::ivec3_type, glsl_type::sampler2DMSArray_type),
-                _textureSize(texture_multisample_array, glsl_type::ivec3_type, glsl_type::isampler2DMSArray_type),
-                _textureSize(texture_multisample_array, glsl_type::ivec3_type, glsl_type::usampler2DMSArray_type),
+                TEXTURE_SIZE(v130, int,   sampler1D),
+                TEXTURE_SIZE(v130, int,   isampler1D),
+                TEXTURE_SIZE(v130, int,   usampler1D),
+
+                TEXTURE_SIZE(v130, ivec2, sampler2D),
+                TEXTURE_SIZE(v130, ivec2, isampler2D),
+                TEXTURE_SIZE(v130, ivec2, usampler2D),
+
+                TEXTURE_SIZE(v130, ivec3, sampler3D),
+                TEXTURE_SIZE(v130, ivec3, isampler3D),
+                TEXTURE_SIZE(v130, ivec3, usampler3D),
+
+                TEXTURE_SIZE(v130, ivec2, samplerCube),
+                TEXTURE_SIZE(v130, ivec2, isamplerCube),
+                TEXTURE_SIZE(v130, ivec2, usamplerCube),
+
+                TEXTURE_SIZE(v130, int,   sampler1DShadow),
+                TEXTURE_SIZE(v130, ivec2, sampler2DShadow),
+                TEXTURE_SIZE(v130, ivec2, samplerCubeShadow),
+
+                TEXTURE_SIZE(v130, ivec2, sampler1DArray),
+                TEXTURE_SIZE(v130, ivec2, isampler1DArray),
+                TEXTURE_SIZE(v130, ivec2, usampler1DArray),
+                TEXTURE_SIZE(v130, ivec3, sampler2DArray),
+                TEXTURE_SIZE(v130, ivec3, isampler2DArray),
+                TEXTURE_SIZE(v130, ivec3, usampler2DArray),
+
+                TEXTURE_SIZE(v130, ivec2, sampler1DArrayShadow),
+                TEXTURE_SIZE(v130, ivec3, sampler2DArrayShadow),
+
+                TEXTURE_SIZE(texture_cube_map_array, ivec3, samplerCubeArray),
+                TEXTURE_SIZE(texture_cube_map_array, ivec3, isamplerCubeArray),
+                TEXTURE_SIZE(texture_cube_map_array, ivec3, usamplerCubeArray),
+                TEXTURE_SIZE(texture_cube_map_array, ivec3, samplerCubeArrayShadow),
+
+                TEXTURE_SIZE(v130, ivec2, sampler2DRect),
+                TEXTURE_SIZE(v130, ivec2, isampler2DRect),
+                TEXTURE_SIZE(v130, ivec2, usampler2DRect),
+                TEXTURE_SIZE(v130, ivec2, sampler2DRectShadow),
+
+                TEXTURE_SIZE(texture_buffer, int,   samplerBuffer),
+                TEXTURE_SIZE(texture_buffer, int,   isamplerBuffer),
+                TEXTURE_SIZE(texture_buffer, int,   usamplerBuffer),
+                TEXTURE_SIZE(texture_multisample, ivec2, sampler2DMS),
+                TEXTURE_SIZE(texture_multisample, ivec2, isampler2DMS),
+                TEXTURE_SIZE(texture_multisample, ivec2, usampler2DMS),
+
+                TEXTURE_SIZE(texture_multisample_array, ivec3, sampler2DMSArray),
+                TEXTURE_SIZE(texture_multisample_array, ivec3, isampler2DMSArray),
+                TEXTURE_SIZE(texture_multisample_array, ivec3, usampler2DMSArray),
                 NULL);
 
    add_function("textureSamples",
-                _textureSamples(shader_samples, glsl_type::sampler2DMS_type),
-                _textureSamples(shader_samples, glsl_type::isampler2DMS_type),
-                _textureSamples(shader_samples, glsl_type::usampler2DMS_type),
+                TEXTURE_SAMPLES(shader_samples, sampler2DMS),
+                TEXTURE_SAMPLES(shader_samples, isampler2DMS),
+                TEXTURE_SAMPLES(shader_samples, usampler2DMS),
 
-                _textureSamples(shader_samples, glsl_type::sampler2DMSArray_type),
-                _textureSamples(shader_samples, glsl_type::isampler2DMSArray_type),
-                _textureSamples(shader_samples, glsl_type::usampler2DMSArray_type),
+                TEXTURE_SAMPLES(shader_samples, sampler2DMSArray),
+                TEXTURE_SAMPLES(shader_samples, isampler2DMSArray),
+                TEXTURE_SAMPLES(shader_samples, usampler2DMSArray),
                 NULL);
 
    add_function("texture",
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::float_type),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::float_type),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::float_type),
+                TEXTURE(ir_tex, v130, vec4,  sampler1D,  float, 0),
+                TEXTURE(ir_tex, v130, ivec4, isampler1D, float, 0),
+                TEXTURE(ir_tex, v130, uvec4, usampler1D, float, 0),
 
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec2_type),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type),
+                TEXTURE(ir_tex, v130, vec4,  sampler2D,  vec2, 0),
+                TEXTURE(ir_tex, v130, ivec4, isampler2D, vec2, 0),
+                TEXTURE(ir_tex, v130, uvec4, usampler2D, vec2, 0),
 
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler3D_type,  glsl_type::vec3_type),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type),
+                TEXTURE(ir_tex, v130, vec4,  sampler3D,  vec3, 0),
+                TEXTURE(ir_tex, v130, ivec4, isampler3D, vec3, 0),
+                TEXTURE(ir_tex, v130, uvec4, usampler3D, vec3, 0),
 
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::samplerCube_type,  glsl_type::vec3_type),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isamplerCube_type, glsl_type::vec3_type),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usamplerCube_type, glsl_type::vec3_type),
+                TEXTURE(ir_tex, v130, vec4,  samplerCube,  vec3, 0),
+                TEXTURE(ir_tex, v130, ivec4, isamplerCube, vec3, 0),
+                TEXTURE(ir_tex, v130, uvec4, usamplerCube, vec3, 0),
 
-                _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type,   glsl_type::vec3_type),
-                _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type,   glsl_type::vec3_type),
-                _texture(ir_tex, v130, glsl_type::float_type, glsl_type::samplerCubeShadow_type, glsl_type::vec4_type),
+                TEXTURE(ir_tex, v130, float, sampler1DShadow,   vec3, 0),
+                TEXTURE(ir_tex, v130, float, sampler2DShadow,   vec3, 0),
+                TEXTURE(ir_tex, v130, float, samplerCubeShadow, vec4, 0),
 
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler1DArray_type,  glsl_type::vec2_type),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::vec2_type),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::vec2_type),
+                TEXTURE(ir_tex, v130, vec4,  sampler1DArray,  vec2, 0),
+                TEXTURE(ir_tex, v130, ivec4, isampler1DArray, vec2, 0),
+                TEXTURE(ir_tex, v130, uvec4, usampler1DArray, vec2, 0),
 
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler2DArray_type,  glsl_type::vec3_type),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type),
+                TEXTURE(ir_tex, v130, vec4,  sampler2DArray,  vec3, 0),
+                TEXTURE(ir_tex, v130, ivec4, isampler2DArray, vec3, 0),
+                TEXTURE(ir_tex, v130, uvec4, usampler2DArray, vec3, 0),
 
-                _texture(ir_tex, texture_cube_map_array, glsl_type::vec4_type,  glsl_type::samplerCubeArray_type,  glsl_type::vec4_type),
-                _texture(ir_tex, texture_cube_map_array, glsl_type::ivec4_type, glsl_type::isamplerCubeArray_type, glsl_type::vec4_type),
-                _texture(ir_tex, texture_cube_map_array, glsl_type::uvec4_type, glsl_type::usamplerCubeArray_type, glsl_type::vec4_type),
+                TEXTURE(ir_tex, texture_cube_map_array, vec4,  samplerCubeArray,  vec4, 0),
+                TEXTURE(ir_tex, texture_cube_map_array, ivec4, isamplerCubeArray, vec4, 0),
+                TEXTURE(ir_tex, texture_cube_map_array, uvec4, usamplerCubeArray, vec4, 0),
 
-                _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type),
-                _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec4_type),
+                TEXTURE(ir_tex, v130, float, sampler1DArrayShadow, vec3, 0),
+                TEXTURE(ir_tex, v130, float, sampler2DArrayShadow, vec4, 0),
                 /* samplerCubeArrayShadow is special; it has an extra parameter
                  * for the shadow comparator since there is no vec5 type.
                  */
                 _textureCubeArrayShadow(texture_cube_map_array, glsl_type::samplerCubeArrayShadow_type),
+                _textureCubeArrayShadow(texture_cube_map_array_bindless, glsl_type::samplerCubeArrayShadowBindless_type),
 
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler2DRect_type,  glsl_type::vec2_type),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec2_type),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec2_type),
+                TEXTURE(ir_tex, v130, vec4,  sampler2DRect,  vec2, 0),
+                TEXTURE(ir_tex, v130, ivec4, isampler2DRect, vec2, 0),
+                TEXTURE(ir_tex, v130, uvec4, usampler2DRect, vec2, 0),
 
-                _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec3_type),
+                TEXTURE(ir_tex, v130, float, sampler2DRectShadow, vec3, 0),
 
-                _texture(ir_txb, v130_fs_only, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::float_type),
-                _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::float_type),
-                _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::float_type),
+                TEXTURE(ir_txb, v130_fs_only, vec4,  sampler1D,  float, 0),
+                TEXTURE(ir_txb, v130_fs_only, ivec4, isampler1D, float, 0),
+                TEXTURE(ir_txb, v130_fs_only, uvec4, usampler1D, float, 0),
 
-                _texture(ir_txb, v130_fs_only, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec2_type),
-                _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type),
-                _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type),
+                TEXTURE(ir_txb, v130_fs_only, vec4,  sampler2D,  vec2, 0),
+                TEXTURE(ir_txb, v130_fs_only, ivec4, isampler2D, vec2, 0),
+                TEXTURE(ir_txb, v130_fs_only, uvec4, usampler2D, vec2, 0),
 
-                _texture(ir_txb, v130_fs_only, glsl_type::vec4_type,  glsl_type::sampler3D_type,  glsl_type::vec3_type),
-                _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type),
-                _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type),
+                TEXTURE(ir_txb, v130_fs_only, vec4,  sampler3D,  vec3, 0),
+                TEXTURE(ir_txb, v130_fs_only, ivec4, isampler3D, vec3, 0),
+                TEXTURE(ir_txb, v130_fs_only, uvec4, usampler3D, vec3, 0),
 
-                _texture(ir_txb, v130_fs_only, glsl_type::vec4_type,  glsl_type::samplerCube_type,  glsl_type::vec3_type),
-                _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isamplerCube_type, glsl_type::vec3_type),
-                _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usamplerCube_type, glsl_type::vec3_type),
+                TEXTURE(ir_txb, v130_fs_only, vec4,  samplerCube,  vec3, 0),
+                TEXTURE(ir_txb, v130_fs_only, ivec4, isamplerCube, vec3, 0),
+                TEXTURE(ir_txb, v130_fs_only, uvec4, usamplerCube, vec3, 0),
 
-                _texture(ir_txb, v130_fs_only, glsl_type::float_type, glsl_type::sampler1DShadow_type,   glsl_type::vec3_type),
-                _texture(ir_txb, v130_fs_only, glsl_type::float_type, glsl_type::sampler2DShadow_type,   glsl_type::vec3_type),
-                _texture(ir_txb, v130_fs_only, glsl_type::float_type, glsl_type::samplerCubeShadow_type, glsl_type::vec4_type),
+                TEXTURE(ir_txb, v130_fs_only, float, sampler1DShadow,   vec3, 0),
+                TEXTURE(ir_txb, v130_fs_only, float, sampler2DShadow,   vec3, 0),
+                TEXTURE(ir_txb, v130_fs_only, float, samplerCubeShadow, vec4, 0),
 
-                _texture(ir_txb, v130_fs_only, glsl_type::vec4_type,  glsl_type::sampler1DArray_type,  glsl_type::vec2_type),
-                _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::vec2_type),
-                _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::vec2_type),
+                TEXTURE(ir_txb, v130_fs_only, vec4,  sampler1DArray,  vec2, 0),
+                TEXTURE(ir_txb, v130_fs_only, ivec4, isampler1DArray, vec2, 0),
+                TEXTURE(ir_txb, v130_fs_only, uvec4, usampler1DArray, vec2, 0),
 
-                _texture(ir_txb, v130_fs_only, glsl_type::vec4_type,  glsl_type::sampler2DArray_type,  glsl_type::vec3_type),
-                _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type),
-                _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type),
+                TEXTURE(ir_txb, v130_fs_only, vec4,  sampler2DArray,  vec3, 0),
+                TEXTURE(ir_txb, v130_fs_only, ivec4, isampler2DArray, vec3, 0),
+                TEXTURE(ir_txb, v130_fs_only, uvec4, usampler2DArray, vec3, 0),
 
-                _texture(ir_txb, fs_texture_cube_map_array, glsl_type::vec4_type,  glsl_type::samplerCubeArray_type,  glsl_type::vec4_type),
-                _texture(ir_txb, fs_texture_cube_map_array, glsl_type::ivec4_type, glsl_type::isamplerCubeArray_type, glsl_type::vec4_type),
-                _texture(ir_txb, fs_texture_cube_map_array, glsl_type::uvec4_type, glsl_type::usamplerCubeArray_type, glsl_type::vec4_type),
+                TEXTURE(ir_txb, fs_texture_cube_map_array, vec4,  samplerCubeArray,  vec4, 0),
+                TEXTURE(ir_txb, fs_texture_cube_map_array, ivec4, isamplerCubeArray, vec4, 0),
+                TEXTURE(ir_txb, fs_texture_cube_map_array, uvec4, usamplerCubeArray, vec4, 0),
 
-                _texture(ir_txb, v130_fs_only, glsl_type::float_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type),
+                TEXTURE(ir_txb, v130_fs_only, float, sampler1DArrayShadow, vec3, 0),
                 NULL);
 
    add_function("textureLod",
-                _texture(ir_txl, v130, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::float_type),
-                _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::float_type),
-                _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::float_type),
+                TEXTURE(ir_txl, v130, vec4,  sampler1D,  float, 0),
+                TEXTURE(ir_txl, v130, ivec4, isampler1D, float, 0),
+                TEXTURE(ir_txl, v130, uvec4, usampler1D, float, 0),
 
-                _texture(ir_txl, v130, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec2_type),
-                _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type),
-                _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type),
+                TEXTURE(ir_txl, v130, vec4,  sampler2D,  vec2, 0),
+                TEXTURE(ir_txl, v130, ivec4, isampler2D, vec2, 0),
+                TEXTURE(ir_txl, v130, uvec4, usampler2D, vec2, 0),
 
-                _texture(ir_txl, v130, glsl_type::vec4_type,  glsl_type::sampler3D_type,  glsl_type::vec3_type),
-                _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type),
-                _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type),
+                TEXTURE(ir_txl, v130, vec4,  sampler3D,  vec3, 0),
+                TEXTURE(ir_txl, v130, ivec4, isampler3D, vec3, 0),
+                TEXTURE(ir_txl, v130, uvec4, usampler3D, vec3, 0),
 
-                _texture(ir_txl, v130, glsl_type::vec4_type,  glsl_type::samplerCube_type,  glsl_type::vec3_type),
-                _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isamplerCube_type, glsl_type::vec3_type),
-                _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usamplerCube_type, glsl_type::vec3_type),
+                TEXTURE(ir_txl, v130, vec4,  samplerCube,  vec3, 0),
+                TEXTURE(ir_txl, v130, ivec4, isamplerCube, vec3, 0),
+                TEXTURE(ir_txl, v130, uvec4, usamplerCube, vec3, 0),
 
-                _texture(ir_txl, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec3_type),
-                _texture(ir_txl, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type),
+                TEXTURE(ir_txl, v130, float, sampler1DShadow, vec3, 0),
+                TEXTURE(ir_txl, v130, float, sampler2DShadow, vec3, 0),
 
-                _texture(ir_txl, v130, glsl_type::vec4_type,  glsl_type::sampler1DArray_type,  glsl_type::vec2_type),
-                _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::vec2_type),
-                _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::vec2_type),
+                TEXTURE(ir_txl, v130, vec4,  sampler1DArray,  vec2, 0),
+                TEXTURE(ir_txl, v130, ivec4, isampler1DArray, vec2, 0),
+                TEXTURE(ir_txl, v130, uvec4, usampler1DArray, vec2, 0),
 
-                _texture(ir_txl, v130, glsl_type::vec4_type,  glsl_type::sampler2DArray_type,  glsl_type::vec3_type),
-                _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type),
-                _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type),
+                TEXTURE(ir_txl, v130, vec4,  sampler2DArray,  vec3, 0),
+                TEXTURE(ir_txl, v130, ivec4, isampler2DArray, vec3, 0),
+                TEXTURE(ir_txl, v130, uvec4, usampler2DArray, vec3, 0),
 
-                _texture(ir_txl, texture_cube_map_array, glsl_type::vec4_type,  glsl_type::samplerCubeArray_type,  glsl_type::vec4_type),
-                _texture(ir_txl, texture_cube_map_array, glsl_type::ivec4_type, glsl_type::isamplerCubeArray_type, glsl_type::vec4_type),
-                _texture(ir_txl, texture_cube_map_array, glsl_type::uvec4_type, glsl_type::usamplerCubeArray_type, glsl_type::vec4_type),
+                TEXTURE(ir_txl, texture_cube_map_array, vec4,  samplerCubeArray,  vec4, 0),
+                TEXTURE(ir_txl, texture_cube_map_array, ivec4, isamplerCubeArray, vec4, 0),
+                TEXTURE(ir_txl, texture_cube_map_array, uvec4, usamplerCubeArray, vec4, 0),
 
-                _texture(ir_txl, v130, glsl_type::float_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type),
+                TEXTURE(ir_txl, v130, float, sampler1DArrayShadow, vec3, 0),
                 NULL);
 
    add_function("textureOffset",
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::float_type, TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::float_type, TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::float_type, TEX_OFFSET),
+                TEXTURE(ir_tex, v130, vec4,  sampler1D,  float, TEX_OFFSET),
+                TEXTURE(ir_tex, v130, ivec4, isampler1D, float, TEX_OFFSET),
+                TEXTURE(ir_tex, v130, uvec4, usampler1D, float, TEX_OFFSET),
 
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec2_type, TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET),
+                TEXTURE(ir_tex, v130, vec4,  sampler2D,  vec2, TEX_OFFSET),
+                TEXTURE(ir_tex, v130, ivec4, isampler2D, vec2, TEX_OFFSET),
+                TEXTURE(ir_tex, v130, uvec4, usampler2D, vec2, TEX_OFFSET),
 
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler3D_type,  glsl_type::vec3_type, TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_OFFSET),
+                TEXTURE(ir_tex, v130, vec4,  sampler3D,  vec3, TEX_OFFSET),
+                TEXTURE(ir_tex, v130, ivec4, isampler3D, vec3, TEX_OFFSET),
+                TEXTURE(ir_tex, v130, uvec4, usampler3D, vec3, TEX_OFFSET),
 
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler2DRect_type,  glsl_type::vec2_type, TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET),
+                TEXTURE(ir_tex, v130, vec4,  sampler2DRect,  vec2, TEX_OFFSET),
+                TEXTURE(ir_tex, v130, ivec4, isampler2DRect, vec2, TEX_OFFSET),
+                TEXTURE(ir_tex, v130, uvec4, usampler2DRect, vec2, TEX_OFFSET),
 
-                _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec3_type, TEX_OFFSET),
+                TEXTURE(ir_tex, v130, float, sampler2DRectShadow, vec3, TEX_OFFSET),
 
-                _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec3_type, TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_OFFSET),
+                TEXTURE(ir_tex, v130, float, sampler1DShadow, vec3, TEX_OFFSET),
+                TEXTURE(ir_tex, v130, float, sampler2DShadow, vec3, TEX_OFFSET),
 
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler1DArray_type,  glsl_type::vec2_type, TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET),
+                TEXTURE(ir_tex, v130, vec4,  sampler1DArray,  vec2, TEX_OFFSET),
+                TEXTURE(ir_tex, v130, ivec4, isampler1DArray, vec2, TEX_OFFSET),
+                TEXTURE(ir_tex, v130, uvec4, usampler1DArray, vec2, TEX_OFFSET),
 
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler2DArray_type,  glsl_type::vec3_type, TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET),
+                TEXTURE(ir_tex, v130, vec4,  sampler2DArray,  vec3, TEX_OFFSET),
+                TEXTURE(ir_tex, v130, ivec4, isampler2DArray, vec3, TEX_OFFSET),
+                TEXTURE(ir_tex, v130, uvec4, usampler2DArray, vec3, TEX_OFFSET),
 
-                _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type, TEX_OFFSET),
+                TEXTURE(ir_tex, v130, float, sampler1DArrayShadow, vec3, TEX_OFFSET),
                 /* The next one was forgotten in GLSL 1.30 spec. It's from
                  * EXT_gpu_shader4 originally. It was added in 4.30 with the
                  * wrong syntax. This was corrected in 4.40. 4.30 indicates
                  * that it was intended to be included previously, so allow it
                  * in 1.30.
                  */
-                _texture(ir_tex, v130_desktop, glsl_type::float_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec4_type, TEX_OFFSET),
+                TEXTURE(ir_tex, v130_desktop, float, sampler2DArrayShadow, vec4, TEX_OFFSET),
 
-                _texture(ir_txb, v130_fs_only, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::float_type, TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::float_type, TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::float_type, TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, vec4,  sampler1D,  float, TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, ivec4, isampler1D, float, TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, uvec4, usampler1D, float, TEX_OFFSET),
 
-                _texture(ir_txb, v130_fs_only, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec2_type, TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, vec4,  sampler2D,  vec2, TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, ivec4, isampler2D, vec2, TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, uvec4, usampler2D, vec2, TEX_OFFSET),
 
-                _texture(ir_txb, v130_fs_only, glsl_type::vec4_type,  glsl_type::sampler3D_type,  glsl_type::vec3_type, TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, vec4,  sampler3D,  vec3, TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, ivec4, isampler3D, vec3, TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, uvec4, usampler3D, vec3, TEX_OFFSET),
 
-                _texture(ir_txb, v130_fs_only, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec3_type, TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, float, sampler1DShadow, vec3, TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, float, sampler2DShadow, vec3, TEX_OFFSET),
 
-                _texture(ir_txb, v130_fs_only, glsl_type::vec4_type,  glsl_type::sampler1DArray_type,  glsl_type::vec2_type, TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, vec4,  sampler1DArray,  vec2, TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, ivec4, isampler1DArray, vec2, TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, uvec4, usampler1DArray, vec2, TEX_OFFSET),
 
-                _texture(ir_txb, v130_fs_only, glsl_type::vec4_type,  glsl_type::sampler2DArray_type,  glsl_type::vec3_type, TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, vec4,  sampler2DArray,  vec3, TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, ivec4, isampler2DArray, vec3, TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, uvec4, usampler2DArray, vec3, TEX_OFFSET),
 
-                _texture(ir_txb, v130_fs_only, glsl_type::float_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type, TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, float, sampler1DArrayShadow, vec3, TEX_OFFSET),
                 NULL);
 
    add_function("textureProj",
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::vec2_type, TEX_PROJECT),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT),
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec4_type, TEX_PROJECT),
-
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec4_type, TEX_PROJECT),
-
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler3D_type,  glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec4_type, TEX_PROJECT),
-
-                _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT),
-
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler2DRect_type,  glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler2DRect_type,  glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT),
-
-                _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec4_type, TEX_PROJECT),
-
-                _texture(ir_txb, v130_fs_only, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::vec2_type, TEX_PROJECT),
-                _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT),
-                _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT),
-                _texture(ir_txb, v130_fs_only, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec4_type, TEX_PROJECT),
-
-                _texture(ir_txb, v130_fs_only, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_txb, v130_fs_only, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec4_type, TEX_PROJECT),
-
-                _texture(ir_txb, v130_fs_only, glsl_type::vec4_type,  glsl_type::sampler3D_type,  glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec4_type, TEX_PROJECT),
-
-                _texture(ir_txb, v130_fs_only, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txb, v130_fs_only, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_tex, v130, vec4,  sampler1D,  vec2, TEX_PROJECT),
+                TEXTURE(ir_tex, v130, ivec4, isampler1D, vec2, TEX_PROJECT),
+                TEXTURE(ir_tex, v130, uvec4, usampler1D, vec2, TEX_PROJECT),
+                TEXTURE(ir_tex, v130, vec4,  sampler1D,  vec4, TEX_PROJECT),
+                TEXTURE(ir_tex, v130, ivec4, isampler1D, vec4, TEX_PROJECT),
+                TEXTURE(ir_tex, v130, uvec4, usampler1D, vec4, TEX_PROJECT),
+
+                TEXTURE(ir_tex, v130, vec4,  sampler2D,  vec3, TEX_PROJECT),
+                TEXTURE(ir_tex, v130, ivec4, isampler2D, vec3, TEX_PROJECT),
+                TEXTURE(ir_tex, v130, uvec4, usampler2D, vec3, TEX_PROJECT),
+                TEXTURE(ir_tex, v130, vec4,  sampler2D,  vec4, TEX_PROJECT),
+                TEXTURE(ir_tex, v130, ivec4, isampler2D, vec4, TEX_PROJECT),
+                TEXTURE(ir_tex, v130, uvec4, usampler2D, vec4, TEX_PROJECT),
+
+                TEXTURE(ir_tex, v130, vec4,  sampler3D,  vec4, TEX_PROJECT),
+                TEXTURE(ir_tex, v130, ivec4, isampler3D, vec4, TEX_PROJECT),
+                TEXTURE(ir_tex, v130, uvec4, usampler3D, vec4, TEX_PROJECT),
+
+                TEXTURE(ir_tex, v130, float, sampler1DShadow, vec4, TEX_PROJECT),
+                TEXTURE(ir_tex, v130, float, sampler2DShadow, vec4, TEX_PROJECT),
+
+                TEXTURE(ir_tex, v130, vec4,  sampler2DRect,  vec3, TEX_PROJECT),
+                TEXTURE(ir_tex, v130, ivec4, isampler2DRect, vec3, TEX_PROJECT),
+                TEXTURE(ir_tex, v130, uvec4, usampler2DRect, vec3, TEX_PROJECT),
+                TEXTURE(ir_tex, v130, vec4,  sampler2DRect,  vec4, TEX_PROJECT),
+                TEXTURE(ir_tex, v130, ivec4, isampler2DRect, vec4, TEX_PROJECT),
+                TEXTURE(ir_tex, v130, uvec4, usampler2DRect, vec4, TEX_PROJECT),
+
+                TEXTURE(ir_tex, v130, float, sampler2DRectShadow, vec4, TEX_PROJECT),
+
+                TEXTURE(ir_txb, v130_fs_only, vec4,  sampler1D,  vec2, TEX_PROJECT),
+                TEXTURE(ir_txb, v130_fs_only, ivec4, isampler1D, vec2, TEX_PROJECT),
+                TEXTURE(ir_txb, v130_fs_only, uvec4, usampler1D, vec2, TEX_PROJECT),
+                TEXTURE(ir_txb, v130_fs_only, vec4,  sampler1D,  vec4, TEX_PROJECT),
+                TEXTURE(ir_txb, v130_fs_only, ivec4, isampler1D, vec4, TEX_PROJECT),
+                TEXTURE(ir_txb, v130_fs_only, uvec4, usampler1D, vec4, TEX_PROJECT),
+
+                TEXTURE(ir_txb, v130_fs_only, vec4,  sampler2D,  vec3, TEX_PROJECT),
+                TEXTURE(ir_txb, v130_fs_only, ivec4, isampler2D, vec3, TEX_PROJECT),
+                TEXTURE(ir_txb, v130_fs_only, uvec4, usampler2D, vec3, TEX_PROJECT),
+                TEXTURE(ir_txb, v130_fs_only, vec4,  sampler2D,  vec4, TEX_PROJECT),
+                TEXTURE(ir_txb, v130_fs_only, ivec4, isampler2D, vec4, TEX_PROJECT),
+                TEXTURE(ir_txb, v130_fs_only, uvec4, usampler2D, vec4, TEX_PROJECT),
+
+                TEXTURE(ir_txb, v130_fs_only, vec4,  sampler3D,  vec4, TEX_PROJECT),
+                TEXTURE(ir_txb, v130_fs_only, ivec4, isampler3D, vec4, TEX_PROJECT),
+                TEXTURE(ir_txb, v130_fs_only, uvec4, usampler3D, vec4, TEX_PROJECT),
+
+                TEXTURE(ir_txb, v130_fs_only, float, sampler1DShadow, vec4, TEX_PROJECT),
+                TEXTURE(ir_txb, v130_fs_only, float, sampler2DShadow, vec4, TEX_PROJECT),
                 NULL);
 
    add_function("texelFetch",
-                _texelFetch(v130, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::int_type),
-                _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::int_type),
-                _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::int_type),
+                TEXEL_FETCH(v130, vec4,  sampler1D,  int),
+                TEXEL_FETCH(v130, ivec4, isampler1D, int),
+                TEXEL_FETCH(v130, uvec4, usampler1D, int),
 
-                _texelFetch(v130, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::ivec2_type),
-                _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::ivec2_type),
-                _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::ivec2_type),
+                TEXEL_FETCH(v130, vec4,  sampler2D,  ivec2),
+                TEXEL_FETCH(v130, ivec4, isampler2D, ivec2),
+                TEXEL_FETCH(v130, uvec4, usampler2D, ivec2),
 
-                _texelFetch(v130, glsl_type::vec4_type,  glsl_type::sampler3D_type,  glsl_type::ivec3_type),
-                _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::ivec3_type),
-                _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::ivec3_type),
+                TEXEL_FETCH(v130, vec4,  sampler3D,  ivec3),
+                TEXEL_FETCH(v130, ivec4, isampler3D, ivec3),
+                TEXEL_FETCH(v130, uvec4, usampler3D, ivec3),
 
-                _texelFetch(v130, glsl_type::vec4_type,  glsl_type::sampler2DRect_type,  glsl_type::ivec2_type),
-                _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::ivec2_type),
-                _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::ivec2_type),
+                TEXEL_FETCH(v130, vec4,  sampler2DRect,  ivec2),
+                TEXEL_FETCH(v130, ivec4, isampler2DRect, ivec2),
+                TEXEL_FETCH(v130, uvec4, usampler2DRect, ivec2),
 
-                _texelFetch(v130, glsl_type::vec4_type,  glsl_type::sampler1DArray_type,  glsl_type::ivec2_type),
-                _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::ivec2_type),
-                _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::ivec2_type),
+                TEXEL_FETCH(v130, vec4,  sampler1DArray,  ivec2),
+                TEXEL_FETCH(v130, ivec4, isampler1DArray, ivec2),
+                TEXEL_FETCH(v130, uvec4, usampler1DArray, ivec2),
 
-                _texelFetch(v130, glsl_type::vec4_type,  glsl_type::sampler2DArray_type,  glsl_type::ivec3_type),
-                _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::ivec3_type),
-                _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::ivec3_type),
+                TEXEL_FETCH(v130, vec4,  sampler2DArray,  ivec3),
+                TEXEL_FETCH(v130, ivec4, isampler2DArray, ivec3),
+                TEXEL_FETCH(v130, uvec4, usampler2DArray, ivec3),
 
-                _texelFetch(texture_buffer, glsl_type::vec4_type,  glsl_type::samplerBuffer_type,  glsl_type::int_type),
-                _texelFetch(texture_buffer, glsl_type::ivec4_type, glsl_type::isamplerBuffer_type, glsl_type::int_type),
-                _texelFetch(texture_buffer, glsl_type::uvec4_type, glsl_type::usamplerBuffer_type, glsl_type::int_type),
+                TEXEL_FETCH(texture_buffer, vec4,  samplerBuffer,  int),
+                TEXEL_FETCH(texture_buffer, ivec4, isamplerBuffer, int),
+                TEXEL_FETCH(texture_buffer, uvec4, usamplerBuffer, int),
 
-                _texelFetch(texture_multisample, glsl_type::vec4_type,  glsl_type::sampler2DMS_type,  glsl_type::ivec2_type),
-                _texelFetch(texture_multisample, glsl_type::ivec4_type, glsl_type::isampler2DMS_type, glsl_type::ivec2_type),
-                _texelFetch(texture_multisample, glsl_type::uvec4_type, glsl_type::usampler2DMS_type, glsl_type::ivec2_type),
+                TEXEL_FETCH(texture_multisample, vec4,  sampler2DMS,  ivec2),
+                TEXEL_FETCH(texture_multisample, ivec4, isampler2DMS, ivec2),
+                TEXEL_FETCH(texture_multisample, uvec4, usampler2DMS, ivec2),
 
-                _texelFetch(texture_multisample_array, glsl_type::vec4_type,  glsl_type::sampler2DMSArray_type,  glsl_type::ivec3_type),
-                _texelFetch(texture_multisample_array, glsl_type::ivec4_type, glsl_type::isampler2DMSArray_type, glsl_type::ivec3_type),
-                _texelFetch(texture_multisample_array, glsl_type::uvec4_type, glsl_type::usampler2DMSArray_type, glsl_type::ivec3_type),
+                TEXEL_FETCH(texture_multisample_array, vec4,  sampler2DMSArray,  ivec3),
+                TEXEL_FETCH(texture_multisample_array, ivec4, isampler2DMSArray, ivec3),
+                TEXEL_FETCH(texture_multisample_array, uvec4, usampler2DMSArray, ivec3),
                 NULL);
 
    add_function("texelFetchOffset",
-                _texelFetch(v130, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::int_type, glsl_type::int_type),
-                _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::int_type, glsl_type::int_type),
-                _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::int_type, glsl_type::int_type),
+                TEXEL_FETCH_OFFSET(v130, vec4,  sampler1D,  int, int),
+                TEXEL_FETCH_OFFSET(v130, ivec4, isampler1D, int, int),
+                TEXEL_FETCH_OFFSET(v130, uvec4, usampler1D, int, int),
 
-                _texelFetch(v130, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::ivec2_type, glsl_type::ivec2_type),
-                _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::ivec2_type, glsl_type::ivec2_type),
-                _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::ivec2_type, glsl_type::ivec2_type),
+                TEXEL_FETCH_OFFSET(v130, vec4,  sampler2D,  ivec2, ivec2),
+                TEXEL_FETCH_OFFSET(v130, ivec4, isampler2D, ivec2, ivec2),
+                TEXEL_FETCH_OFFSET(v130, uvec4, usampler2D, ivec2, ivec2),
 
-                _texelFetch(v130, glsl_type::vec4_type,  glsl_type::sampler3D_type,  glsl_type::ivec3_type, glsl_type::ivec3_type),
-                _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::ivec3_type, glsl_type::ivec3_type),
-                _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::ivec3_type, glsl_type::ivec3_type),
+                TEXEL_FETCH_OFFSET(v130, vec4,  sampler3D,  ivec3, ivec3),
+                TEXEL_FETCH_OFFSET(v130, ivec4, isampler3D, ivec3, ivec3),
+                TEXEL_FETCH_OFFSET(v130, uvec4, usampler3D, ivec3, ivec3),
 
-                _texelFetch(v130, glsl_type::vec4_type,  glsl_type::sampler2DRect_type,  glsl_type::ivec2_type, glsl_type::ivec2_type),
-                _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::ivec2_type, glsl_type::ivec2_type),
-                _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::ivec2_type, glsl_type::ivec2_type),
+                TEXEL_FETCH_OFFSET(v130, vec4,  sampler2DRect,  ivec2, ivec2),
+                TEXEL_FETCH_OFFSET(v130, ivec4, isampler2DRect, ivec2, ivec2),
+                TEXEL_FETCH_OFFSET(v130, uvec4, usampler2DRect, ivec2, ivec2),
 
-                _texelFetch(v130, glsl_type::vec4_type,  glsl_type::sampler1DArray_type,  glsl_type::ivec2_type, glsl_type::int_type),
-                _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::ivec2_type, glsl_type::int_type),
-                _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::ivec2_type, glsl_type::int_type),
+                TEXEL_FETCH_OFFSET(v130, vec4,  sampler1DArray,  ivec2, int),
+                TEXEL_FETCH_OFFSET(v130, ivec4, isampler1DArray, ivec2, int),
+                TEXEL_FETCH_OFFSET(v130, uvec4, usampler1DArray, ivec2, int),
 
-                _texelFetch(v130, glsl_type::vec4_type,  glsl_type::sampler2DArray_type,  glsl_type::ivec3_type, glsl_type::ivec2_type),
-                _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::ivec3_type, glsl_type::ivec2_type),
-                _texelFetch(v130, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::ivec3_type, glsl_type::ivec2_type),
+                TEXEL_FETCH_OFFSET(v130, vec4,  sampler2DArray,  ivec3, ivec2),
+                TEXEL_FETCH_OFFSET(v130, ivec4, isampler2DArray, ivec3, ivec2),
+                TEXEL_FETCH_OFFSET(v130, uvec4, usampler2DArray, ivec3, ivec2),
 
                 NULL);
 
    add_function("textureProjOffset",
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler3D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-
-                _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler2DRect_type,  glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::vec4_type,  glsl_type::sampler2DRect_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-
-                _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-
-                _texture(ir_txb, v130_fs_only, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-
-                _texture(ir_txb, v130_fs_only, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-
-                _texture(ir_txb, v130_fs_only, glsl_type::vec4_type,  glsl_type::sampler3D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-
-                _texture(ir_txb, v130_fs_only, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txb, v130_fs_only, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_tex, v130, vec4,  sampler1D,  vec2, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_tex, v130, ivec4, isampler1D, vec2, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_tex, v130, uvec4, usampler1D, vec2, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_tex, v130, vec4,  sampler1D,  vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_tex, v130, ivec4, isampler1D, vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_tex, v130, uvec4, usampler1D, vec4, TEX_PROJECT | TEX_OFFSET),
+
+                TEXTURE(ir_tex, v130, vec4,  sampler2D,  vec3, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_tex, v130, ivec4, isampler2D, vec3, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_tex, v130, uvec4, usampler2D, vec3, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_tex, v130, vec4,  sampler2D,  vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_tex, v130, ivec4, isampler2D, vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_tex, v130, uvec4, usampler2D, vec4, TEX_PROJECT | TEX_OFFSET),
+
+                TEXTURE(ir_tex, v130, vec4,  sampler3D,  vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_tex, v130, ivec4, isampler3D, vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_tex, v130, uvec4, usampler3D, vec4, TEX_PROJECT | TEX_OFFSET),
+
+                TEXTURE(ir_tex, v130, float, sampler1DShadow, vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_tex, v130, float, sampler2DShadow, vec4, TEX_PROJECT | TEX_OFFSET),
+
+                TEXTURE(ir_tex, v130, vec4,  sampler2DRect,  vec3, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_tex, v130, ivec4, isampler2DRect, vec3, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_tex, v130, uvec4, usampler2DRect, vec3, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_tex, v130, vec4,  sampler2DRect,  vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_tex, v130, ivec4, isampler2DRect, vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_tex, v130, uvec4, usampler2DRect, vec4, TEX_PROJECT | TEX_OFFSET),
+
+                TEXTURE(ir_tex, v130, float, sampler2DRectShadow, vec4, TEX_PROJECT | TEX_OFFSET),
+
+                TEXTURE(ir_txb, v130_fs_only, vec4,  sampler1D,  vec2, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, ivec4, isampler1D, vec2, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, uvec4, usampler1D, vec2, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, vec4,  sampler1D,  vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, ivec4, isampler1D, vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, uvec4, usampler1D, vec4, TEX_PROJECT | TEX_OFFSET),
+
+                TEXTURE(ir_txb, v130_fs_only, vec4,  sampler2D,  vec3, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, ivec4, isampler2D, vec3, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, uvec4, usampler2D, vec3, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, vec4,  sampler2D,  vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, ivec4, isampler2D, vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, uvec4, usampler2D, vec4, TEX_PROJECT | TEX_OFFSET),
+
+                TEXTURE(ir_txb, v130_fs_only, vec4,  sampler3D,  vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, ivec4, isampler3D, vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, uvec4, usampler3D, vec4, TEX_PROJECT | TEX_OFFSET),
+
+                TEXTURE(ir_txb, v130_fs_only, float, sampler1DShadow, vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txb, v130_fs_only, float, sampler2DShadow, vec4, TEX_PROJECT | TEX_OFFSET),
                 NULL);
 
    add_function("textureLodOffset",
-                _texture(ir_txl, v130, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::float_type, TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::float_type, TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::float_type, TEX_OFFSET),
+                TEXTURE(ir_txl, v130, vec4,  sampler1D,  float, TEX_OFFSET),
+                TEXTURE(ir_txl, v130, ivec4, isampler1D, float, TEX_OFFSET),
+                TEXTURE(ir_txl, v130, uvec4, usampler1D, float, TEX_OFFSET),
 
-                _texture(ir_txl, v130, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec2_type, TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET),
+                TEXTURE(ir_txl, v130, vec4,  sampler2D,  vec2, TEX_OFFSET),
+                TEXTURE(ir_txl, v130, ivec4, isampler2D, vec2, TEX_OFFSET),
+                TEXTURE(ir_txl, v130, uvec4, usampler2D, vec2, TEX_OFFSET),
 
-                _texture(ir_txl, v130, glsl_type::vec4_type,  glsl_type::sampler3D_type,  glsl_type::vec3_type, TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_OFFSET),
+                TEXTURE(ir_txl, v130, vec4,  sampler3D,  vec3, TEX_OFFSET),
+                TEXTURE(ir_txl, v130, ivec4, isampler3D, vec3, TEX_OFFSET),
+                TEXTURE(ir_txl, v130, uvec4, usampler3D, vec3, TEX_OFFSET),
 
-                _texture(ir_txl, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec3_type, TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_OFFSET),
+                TEXTURE(ir_txl, v130, float, sampler1DShadow, vec3, TEX_OFFSET),
+                TEXTURE(ir_txl, v130, float, sampler2DShadow, vec3, TEX_OFFSET),
 
-                _texture(ir_txl, v130, glsl_type::vec4_type,  glsl_type::sampler1DArray_type,  glsl_type::vec2_type, TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET),
+                TEXTURE(ir_txl, v130, vec4,  sampler1DArray,  vec2, TEX_OFFSET),
+                TEXTURE(ir_txl, v130, ivec4, isampler1DArray, vec2, TEX_OFFSET),
+                TEXTURE(ir_txl, v130, uvec4, usampler1DArray, vec2, TEX_OFFSET),
 
-                _texture(ir_txl, v130, glsl_type::vec4_type,  glsl_type::sampler2DArray_type,  glsl_type::vec3_type, TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET),
+                TEXTURE(ir_txl, v130, vec4,  sampler2DArray,  vec3, TEX_OFFSET),
+                TEXTURE(ir_txl, v130, ivec4, isampler2DArray, vec3, TEX_OFFSET),
+                TEXTURE(ir_txl, v130, uvec4, usampler2DArray, vec3, TEX_OFFSET),
 
-                _texture(ir_txl, v130, glsl_type::float_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type, TEX_OFFSET),
+                TEXTURE(ir_txl, v130, float, sampler1DArrayShadow, vec3, TEX_OFFSET),
                 NULL);
 
    add_function("textureProjLod",
-                _texture(ir_txl, v130, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::vec2_type, TEX_PROJECT),
-                _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT),
-                _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT),
-                _texture(ir_txl, v130, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_txl, v130, vec4,  sampler1D,  vec2, TEX_PROJECT),
+                TEXTURE(ir_txl, v130, ivec4, isampler1D, vec2, TEX_PROJECT),
+                TEXTURE(ir_txl, v130, uvec4, usampler1D, vec2, TEX_PROJECT),
+                TEXTURE(ir_txl, v130, vec4,  sampler1D,  vec4, TEX_PROJECT),
+                TEXTURE(ir_txl, v130, ivec4, isampler1D, vec4, TEX_PROJECT),
+                TEXTURE(ir_txl, v130, uvec4, usampler1D, vec4, TEX_PROJECT),
 
-                _texture(ir_txl, v130, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_txl, v130, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_txl, v130, vec4,  sampler2D,  vec3, TEX_PROJECT),
+                TEXTURE(ir_txl, v130, ivec4, isampler2D, vec3, TEX_PROJECT),
+                TEXTURE(ir_txl, v130, uvec4, usampler2D, vec3, TEX_PROJECT),
+                TEXTURE(ir_txl, v130, vec4,  sampler2D,  vec4, TEX_PROJECT),
+                TEXTURE(ir_txl, v130, ivec4, isampler2D, vec4, TEX_PROJECT),
+                TEXTURE(ir_txl, v130, uvec4, usampler2D, vec4, TEX_PROJECT),
 
-                _texture(ir_txl, v130, glsl_type::vec4_type,  glsl_type::sampler3D_type,  glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_txl, v130, vec4,  sampler3D,  vec4, TEX_PROJECT),
+                TEXTURE(ir_txl, v130, ivec4, isampler3D, vec4, TEX_PROJECT),
+                TEXTURE(ir_txl, v130, uvec4, usampler3D, vec4, TEX_PROJECT),
 
-                _texture(ir_txl, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txl, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_txl, v130, float, sampler1DShadow, vec4, TEX_PROJECT),
+                TEXTURE(ir_txl, v130, float, sampler2DShadow, vec4, TEX_PROJECT),
                 NULL);
 
    add_function("textureProjLodOffset",
-                _texture(ir_txl, v130, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txl, v130, vec4,  sampler1D,  vec2, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txl, v130, ivec4, isampler1D, vec2, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txl, v130, uvec4, usampler1D, vec2, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txl, v130, vec4,  sampler1D,  vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txl, v130, ivec4, isampler1D, vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txl, v130, uvec4, usampler1D, vec4, TEX_PROJECT | TEX_OFFSET),
 
-                _texture(ir_txl, v130, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txl, v130, vec4,  sampler2D,  vec3, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txl, v130, ivec4, isampler2D, vec3, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txl, v130, uvec4, usampler2D, vec3, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txl, v130, vec4,  sampler2D,  vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txl, v130, ivec4, isampler2D, vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txl, v130, uvec4, usampler2D, vec4, TEX_PROJECT | TEX_OFFSET),
 
-                _texture(ir_txl, v130, glsl_type::vec4_type,  glsl_type::sampler3D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txl, v130, vec4,  sampler3D,  vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txl, v130, ivec4, isampler3D, vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txl, v130, uvec4, usampler3D, vec4, TEX_PROJECT | TEX_OFFSET),
 
-                _texture(ir_txl, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txl, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txl, v130, float, sampler1DShadow, vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txl, v130, float, sampler2DShadow, vec4, TEX_PROJECT | TEX_OFFSET),
                 NULL);
 
    add_function("textureGrad",
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::float_type),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::float_type),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::float_type),
+                TEXTURE(ir_txd, v130, vec4,  sampler1D,  float, 0),
+                TEXTURE(ir_txd, v130, ivec4, isampler1D, float, 0),
+                TEXTURE(ir_txd, v130, uvec4, usampler1D, float, 0),
 
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec2_type),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type),
+                TEXTURE(ir_txd, v130, vec4,  sampler2D,  vec2, 0),
+                TEXTURE(ir_txd, v130, ivec4, isampler2D, vec2, 0),
+                TEXTURE(ir_txd, v130, uvec4, usampler2D, vec2, 0),
 
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler3D_type,  glsl_type::vec3_type),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type),
+                TEXTURE(ir_txd, v130, vec4,  sampler3D,  vec3, 0),
+                TEXTURE(ir_txd, v130, ivec4, isampler3D, vec3, 0),
+                TEXTURE(ir_txd, v130, uvec4, usampler3D, vec3, 0),
 
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::samplerCube_type,  glsl_type::vec3_type),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isamplerCube_type, glsl_type::vec3_type),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usamplerCube_type, glsl_type::vec3_type),
+                TEXTURE(ir_txd, v130, vec4,  samplerCube,  vec3, 0),
+                TEXTURE(ir_txd, v130, ivec4, isamplerCube, vec3, 0),
+                TEXTURE(ir_txd, v130, uvec4, usamplerCube, vec3, 0),
 
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler2DRect_type,  glsl_type::vec2_type),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec2_type),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec2_type),
+                TEXTURE(ir_txd, v130, vec4,  sampler2DRect,  vec2, 0),
+                TEXTURE(ir_txd, v130, ivec4, isampler2DRect, vec2, 0),
+                TEXTURE(ir_txd, v130, uvec4, usampler2DRect, vec2, 0),
 
-                _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec3_type),
+                TEXTURE(ir_txd, v130, float, sampler2DRectShadow, vec3, 0),
 
-                _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type,   glsl_type::vec3_type),
-                _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type,   glsl_type::vec3_type),
-                _texture(ir_txd, v130, glsl_type::float_type, glsl_type::samplerCubeShadow_type, glsl_type::vec4_type),
+                TEXTURE(ir_txd, v130, float, sampler1DShadow,   vec3, 0),
+                TEXTURE(ir_txd, v130, float, sampler2DShadow,   vec3, 0),
+                TEXTURE(ir_txd, v130, float, samplerCubeShadow, vec4, 0),
 
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler1DArray_type,  glsl_type::vec2_type),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::vec2_type),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::vec2_type),
+                TEXTURE(ir_txd, v130, vec4,  sampler1DArray,  vec2, 0),
+                TEXTURE(ir_txd, v130, ivec4, isampler1DArray, vec2, 0),
+                TEXTURE(ir_txd, v130, uvec4, usampler1DArray, vec2, 0),
 
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler2DArray_type,  glsl_type::vec3_type),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type),
+                TEXTURE(ir_txd, v130, vec4,  sampler2DArray,  vec3, 0),
+                TEXTURE(ir_txd, v130, ivec4, isampler2DArray, vec3, 0),
+                TEXTURE(ir_txd, v130, uvec4, usampler2DArray, vec3, 0),
 
-                _texture(ir_txd, texture_cube_map_array, glsl_type::vec4_type,  glsl_type::samplerCubeArray_type,  glsl_type::vec4_type),
-                _texture(ir_txd, texture_cube_map_array, glsl_type::ivec4_type, glsl_type::isamplerCubeArray_type, glsl_type::vec4_type),
-                _texture(ir_txd, texture_cube_map_array, glsl_type::uvec4_type, glsl_type::usamplerCubeArray_type, glsl_type::vec4_type),
+                TEXTURE(ir_txd, texture_cube_map_array, vec4,  samplerCubeArray,  vec4, 0),
+                TEXTURE(ir_txd, texture_cube_map_array, ivec4, isamplerCubeArray, vec4, 0),
+                TEXTURE(ir_txd, texture_cube_map_array, uvec4, usamplerCubeArray, vec4, 0),
 
-                _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type),
-                _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec4_type),
+                TEXTURE(ir_txd, v130, float, sampler1DArrayShadow, vec3, 0),
+                TEXTURE(ir_txd, v130, float, sampler2DArrayShadow, vec4, 0),
                 NULL);
 
    add_function("textureGradOffset",
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::float_type, TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::float_type, TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::float_type, TEX_OFFSET),
+                TEXTURE(ir_txd, v130, vec4,  sampler1D,  float, TEX_OFFSET),
+                TEXTURE(ir_txd, v130, ivec4, isampler1D, float, TEX_OFFSET),
+                TEXTURE(ir_txd, v130, uvec4, usampler1D, float, TEX_OFFSET),
 
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec2_type, TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET),
+                TEXTURE(ir_txd, v130, vec4,  sampler2D,  vec2, TEX_OFFSET),
+                TEXTURE(ir_txd, v130, ivec4, isampler2D, vec2, TEX_OFFSET),
+                TEXTURE(ir_txd, v130, uvec4, usampler2D, vec2, TEX_OFFSET),
 
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler3D_type,  glsl_type::vec3_type, TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_OFFSET),
+                TEXTURE(ir_txd, v130, vec4,  sampler3D,  vec3, TEX_OFFSET),
+                TEXTURE(ir_txd, v130, ivec4, isampler3D, vec3, TEX_OFFSET),
+                TEXTURE(ir_txd, v130, uvec4, usampler3D, vec3, TEX_OFFSET),
 
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler2DRect_type,  glsl_type::vec2_type, TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET),
+                TEXTURE(ir_txd, v130, vec4,  sampler2DRect,  vec2, TEX_OFFSET),
+                TEXTURE(ir_txd, v130, ivec4, isampler2DRect, vec2, TEX_OFFSET),
+                TEXTURE(ir_txd, v130, uvec4, usampler2DRect, vec2, TEX_OFFSET),
 
-                _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec3_type, TEX_OFFSET),
+                TEXTURE(ir_txd, v130, float, sampler2DRectShadow, vec3, TEX_OFFSET),
 
-                _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec3_type, TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_OFFSET),
+                TEXTURE(ir_txd, v130, float, sampler1DShadow, vec3, TEX_OFFSET),
+                TEXTURE(ir_txd, v130, float, sampler2DShadow, vec3, TEX_OFFSET),
 
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler1DArray_type,  glsl_type::vec2_type, TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET),
+                TEXTURE(ir_txd, v130, vec4,  sampler1DArray,  vec2, TEX_OFFSET),
+                TEXTURE(ir_txd, v130, ivec4, isampler1DArray, vec2, TEX_OFFSET),
+                TEXTURE(ir_txd, v130, uvec4, usampler1DArray, vec2, TEX_OFFSET),
 
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler2DArray_type,  glsl_type::vec3_type, TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET),
+                TEXTURE(ir_txd, v130, vec4,  sampler2DArray,  vec3, TEX_OFFSET),
+                TEXTURE(ir_txd, v130, ivec4, isampler2DArray, vec3, TEX_OFFSET),
+                TEXTURE(ir_txd, v130, uvec4, usampler2DArray, vec3, TEX_OFFSET),
 
-                _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type, TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec4_type, TEX_OFFSET),
+                TEXTURE(ir_txd, v130, float, sampler1DArrayShadow, vec3, TEX_OFFSET),
+                TEXTURE(ir_txd, v130, float, sampler2DArrayShadow, vec4, TEX_OFFSET),
                 NULL);
 
    add_function("textureProjGrad",
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::vec2_type, TEX_PROJECT),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT),
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, vec4,  sampler1D,  vec2, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, ivec4, isampler1D, vec2, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, uvec4, usampler1D, vec2, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, vec4,  sampler1D,  vec4, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, ivec4, isampler1D, vec4, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, uvec4, usampler1D, vec4, TEX_PROJECT),
 
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, vec4,  sampler2D,  vec3, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, ivec4, isampler2D, vec3, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, uvec4, usampler2D, vec3, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, vec4,  sampler2D,  vec4, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, ivec4, isampler2D, vec4, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, uvec4, usampler2D, vec4, TEX_PROJECT),
 
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler3D_type,  glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, vec4,  sampler3D,  vec4, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, ivec4, isampler3D, vec4, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, uvec4, usampler3D, vec4, TEX_PROJECT),
 
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler2DRect_type,  glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler2DRect_type,  glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, vec4,  sampler2DRect,  vec3, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, ivec4, isampler2DRect, vec3, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, uvec4, usampler2DRect, vec3, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, vec4,  sampler2DRect,  vec4, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, ivec4, isampler2DRect, vec4, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, uvec4, usampler2DRect, vec4, TEX_PROJECT),
 
-                _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, float, sampler2DRectShadow, vec4, TEX_PROJECT),
 
-                _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, float, sampler1DShadow, vec4, TEX_PROJECT),
+                TEXTURE(ir_txd, v130, float, sampler2DShadow, vec4, TEX_PROJECT),
                 NULL);
 
    add_function("textureProjGradOffset",
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler1D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, vec4,  sampler1D,  vec2, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, ivec4, isampler1D, vec2, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, uvec4, usampler1D, vec2, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, vec4,  sampler1D,  vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, ivec4, isampler1D, vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, uvec4, usampler1D, vec4, TEX_PROJECT | TEX_OFFSET),
 
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler2D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, vec4,  sampler2D,  vec3, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, ivec4, isampler2D, vec3, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, uvec4, usampler2D, vec3, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, vec4,  sampler2D,  vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, ivec4, isampler2D, vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, uvec4, usampler2D, vec4, TEX_PROJECT | TEX_OFFSET),
 
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler3D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, vec4,  sampler3D,  vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, ivec4, isampler3D, vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, uvec4, usampler3D, vec4, TEX_PROJECT | TEX_OFFSET),
 
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler2DRect_type,  glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::vec4_type,  glsl_type::sampler2DRect_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, vec4,  sampler2DRect,  vec3, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, ivec4, isampler2DRect, vec3, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, uvec4, usampler2DRect, vec3, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, vec4,  sampler2DRect,  vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, ivec4, isampler2DRect, vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, uvec4, usampler2DRect, vec4, TEX_PROJECT | TEX_OFFSET),
 
-                _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, float, sampler2DRectShadow, vec4, TEX_PROJECT | TEX_OFFSET),
 
-                _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
-                _texture(ir_txd, v130, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, float, sampler1DShadow, vec4, TEX_PROJECT | TEX_OFFSET),
+                TEXTURE(ir_txd, v130, float, sampler2DShadow, vec4, TEX_PROJECT | TEX_OFFSET),
                 NULL);
 
    add_function("EmitVertex",   _EmitVertex(),   NULL);
@@ -2380,467 +2648,468 @@ builtin_builder::create_builtins()
    add_function("barrier", _barrier(), NULL);
 
    add_function("textureQueryLOD",
-                _textureQueryLod(texture_query_lod, glsl_type::sampler1D_type,  glsl_type::float_type),
-                _textureQueryLod(texture_query_lod, glsl_type::isampler1D_type, glsl_type::float_type),
-                _textureQueryLod(texture_query_lod, glsl_type::usampler1D_type, glsl_type::float_type),
+                TEXTURE_QUERY_LOD(texture_query_lod, sampler1D,  float),
+                TEXTURE_QUERY_LOD(texture_query_lod, isampler1D, float),
+                TEXTURE_QUERY_LOD(texture_query_lod, usampler1D, float),
 
-                _textureQueryLod(texture_query_lod, glsl_type::sampler2D_type,  glsl_type::vec2_type),
-                _textureQueryLod(texture_query_lod, glsl_type::isampler2D_type, glsl_type::vec2_type),
-                _textureQueryLod(texture_query_lod, glsl_type::usampler2D_type, glsl_type::vec2_type),
+                TEXTURE_QUERY_LOD(texture_query_lod, sampler2D,  vec2),
+                TEXTURE_QUERY_LOD(texture_query_lod, isampler2D, vec2),
+                TEXTURE_QUERY_LOD(texture_query_lod, usampler2D, vec2),
 
-                _textureQueryLod(texture_query_lod, glsl_type::sampler3D_type,  glsl_type::vec3_type),
-                _textureQueryLod(texture_query_lod, glsl_type::isampler3D_type, glsl_type::vec3_type),
-                _textureQueryLod(texture_query_lod, glsl_type::usampler3D_type, glsl_type::vec3_type),
+                TEXTURE_QUERY_LOD(texture_query_lod, sampler3D,  vec3),
+                TEXTURE_QUERY_LOD(texture_query_lod, isampler3D, vec3),
+                TEXTURE_QUERY_LOD(texture_query_lod, usampler3D, vec3),
 
-                _textureQueryLod(texture_query_lod, glsl_type::samplerCube_type,  glsl_type::vec3_type),
-                _textureQueryLod(texture_query_lod, glsl_type::isamplerCube_type, glsl_type::vec3_type),
-                _textureQueryLod(texture_query_lod, glsl_type::usamplerCube_type, glsl_type::vec3_type),
+                TEXTURE_QUERY_LOD(texture_query_lod, samplerCube,  vec3),
+                TEXTURE_QUERY_LOD(texture_query_lod, isamplerCube, vec3),
+                TEXTURE_QUERY_LOD(texture_query_lod, usamplerCube, vec3),
 
-                _textureQueryLod(texture_query_lod, glsl_type::sampler1DArray_type,  glsl_type::float_type),
-                _textureQueryLod(texture_query_lod, glsl_type::isampler1DArray_type, glsl_type::float_type),
-                _textureQueryLod(texture_query_lod, glsl_type::usampler1DArray_type, glsl_type::float_type),
+                TEXTURE_QUERY_LOD(texture_query_lod, sampler1DArray,  float),
+                TEXTURE_QUERY_LOD(texture_query_lod, isampler1DArray, float),
+                TEXTURE_QUERY_LOD(texture_query_lod, usampler1DArray, float),
 
-                _textureQueryLod(texture_query_lod, glsl_type::sampler2DArray_type,  glsl_type::vec2_type),
-                _textureQueryLod(texture_query_lod, glsl_type::isampler2DArray_type, glsl_type::vec2_type),
-                _textureQueryLod(texture_query_lod, glsl_type::usampler2DArray_type, glsl_type::vec2_type),
+                TEXTURE_QUERY_LOD(texture_query_lod, sampler2DArray,  vec2),
+                TEXTURE_QUERY_LOD(texture_query_lod, isampler2DArray, vec2),
+                TEXTURE_QUERY_LOD(texture_query_lod, usampler2DArray, vec2),
 
-                _textureQueryLod(texture_query_lod, glsl_type::samplerCubeArray_type,  glsl_type::vec3_type),
-                _textureQueryLod(texture_query_lod, glsl_type::isamplerCubeArray_type, glsl_type::vec3_type),
-                _textureQueryLod(texture_query_lod, glsl_type::usamplerCubeArray_type, glsl_type::vec3_type),
+                TEXTURE_QUERY_LOD(texture_query_lod, samplerCubeArray,  vec3),
+                TEXTURE_QUERY_LOD(texture_query_lod, isamplerCubeArray, vec3),
+                TEXTURE_QUERY_LOD(texture_query_lod, usamplerCubeArray, vec3),
 
-                _textureQueryLod(texture_query_lod, glsl_type::sampler1DShadow_type, glsl_type::float_type),
-                _textureQueryLod(texture_query_lod, glsl_type::sampler2DShadow_type, glsl_type::vec2_type),
-                _textureQueryLod(texture_query_lod, glsl_type::samplerCubeShadow_type, glsl_type::vec3_type),
-                _textureQueryLod(texture_query_lod, glsl_type::sampler1DArrayShadow_type, glsl_type::float_type),
-                _textureQueryLod(texture_query_lod, glsl_type::sampler2DArrayShadow_type, glsl_type::vec2_type),
-                _textureQueryLod(texture_query_lod, glsl_type::samplerCubeArrayShadow_type, glsl_type::vec3_type),
+                TEXTURE_QUERY_LOD(texture_query_lod, sampler1DShadow, float),
+                TEXTURE_QUERY_LOD(texture_query_lod, sampler2DShadow, vec2),
+                TEXTURE_QUERY_LOD(texture_query_lod, samplerCubeShadow, vec3),
+                TEXTURE_QUERY_LOD(texture_query_lod, sampler1DArrayShadow, float),
+                TEXTURE_QUERY_LOD(texture_query_lod, sampler2DArrayShadow, vec2),
+                TEXTURE_QUERY_LOD(texture_query_lod, samplerCubeArrayShadow, vec3),
                 NULL);
 
    add_function("textureQueryLod",
-                _textureQueryLod(v400_fs_only, glsl_type::sampler1D_type,  glsl_type::float_type),
-                _textureQueryLod(v400_fs_only, glsl_type::isampler1D_type, glsl_type::float_type),
-                _textureQueryLod(v400_fs_only, glsl_type::usampler1D_type, glsl_type::float_type),
+                TEXTURE_QUERY_LOD(v400_fs_only, sampler1D,  float),
+                TEXTURE_QUERY_LOD(v400_fs_only, isampler1D, float),
+                TEXTURE_QUERY_LOD(v400_fs_only, usampler1D, float),
 
-                _textureQueryLod(v400_fs_only, glsl_type::sampler2D_type,  glsl_type::vec2_type),
-                _textureQueryLod(v400_fs_only, glsl_type::isampler2D_type, glsl_type::vec2_type),
-                _textureQueryLod(v400_fs_only, glsl_type::usampler2D_type, glsl_type::vec2_type),
+                TEXTURE_QUERY_LOD(v400_fs_only, sampler2D,  vec2),
+                TEXTURE_QUERY_LOD(v400_fs_only, isampler2D, vec2),
+                TEXTURE_QUERY_LOD(v400_fs_only, usampler2D, vec2),
 
-                _textureQueryLod(v400_fs_only, glsl_type::sampler3D_type,  glsl_type::vec3_type),
-                _textureQueryLod(v400_fs_only, glsl_type::isampler3D_type, glsl_type::vec3_type),
-                _textureQueryLod(v400_fs_only, glsl_type::usampler3D_type, glsl_type::vec3_type),
+                TEXTURE_QUERY_LOD(v400_fs_only, sampler3D,  vec3),
+                TEXTURE_QUERY_LOD(v400_fs_only, isampler3D, vec3),
+                TEXTURE_QUERY_LOD(v400_fs_only, usampler3D, vec3),
 
-                _textureQueryLod(v400_fs_only, glsl_type::samplerCube_type,  glsl_type::vec3_type),
-                _textureQueryLod(v400_fs_only, glsl_type::isamplerCube_type, glsl_type::vec3_type),
-                _textureQueryLod(v400_fs_only, glsl_type::usamplerCube_type, glsl_type::vec3_type),
+                TEXTURE_QUERY_LOD(v400_fs_only, samplerCube,  vec3),
+                TEXTURE_QUERY_LOD(v400_fs_only, isamplerCube, vec3),
+                TEXTURE_QUERY_LOD(v400_fs_only, usamplerCube, vec3),
 
-                _textureQueryLod(v400_fs_only, glsl_type::sampler1DArray_type,  glsl_type::float_type),
-                _textureQueryLod(v400_fs_only, glsl_type::isampler1DArray_type, glsl_type::float_type),
-                _textureQueryLod(v400_fs_only, glsl_type::usampler1DArray_type, glsl_type::float_type),
+                TEXTURE_QUERY_LOD(v400_fs_only, sampler1DArray,  float),
+                TEXTURE_QUERY_LOD(v400_fs_only, isampler1DArray, float),
+                TEXTURE_QUERY_LOD(v400_fs_only, usampler1DArray, float),
 
-                _textureQueryLod(v400_fs_only, glsl_type::sampler2DArray_type,  glsl_type::vec2_type),
-                _textureQueryLod(v400_fs_only, glsl_type::isampler2DArray_type, glsl_type::vec2_type),
-                _textureQueryLod(v400_fs_only, glsl_type::usampler2DArray_type, glsl_type::vec2_type),
+                TEXTURE_QUERY_LOD(v400_fs_only, sampler2DArray,  vec2),
+                TEXTURE_QUERY_LOD(v400_fs_only, isampler2DArray, vec2),
+                TEXTURE_QUERY_LOD(v400_fs_only, usampler2DArray, vec2),
 
-                _textureQueryLod(v400_fs_only, glsl_type::samplerCubeArray_type,  glsl_type::vec3_type),
-                _textureQueryLod(v400_fs_only, glsl_type::isamplerCubeArray_type, glsl_type::vec3_type),
-                _textureQueryLod(v400_fs_only, glsl_type::usamplerCubeArray_type, glsl_type::vec3_type),
+                TEXTURE_QUERY_LOD(v400_fs_only, samplerCubeArray,  vec3),
+                TEXTURE_QUERY_LOD(v400_fs_only, isamplerCubeArray, vec3),
+                TEXTURE_QUERY_LOD(v400_fs_only, usamplerCubeArray, vec3),
 
-                _textureQueryLod(v400_fs_only, glsl_type::sampler1DShadow_type, glsl_type::float_type),
-                _textureQueryLod(v400_fs_only, glsl_type::sampler2DShadow_type, glsl_type::vec2_type),
-                _textureQueryLod(v400_fs_only, glsl_type::samplerCubeShadow_type, glsl_type::vec3_type),
-                _textureQueryLod(v400_fs_only, glsl_type::sampler1DArrayShadow_type, glsl_type::float_type),
-                _textureQueryLod(v400_fs_only, glsl_type::sampler2DArrayShadow_type, glsl_type::vec2_type),
-                _textureQueryLod(v400_fs_only, glsl_type::samplerCubeArrayShadow_type, glsl_type::vec3_type),
+                TEXTURE_QUERY_LOD(v400_fs_only, sampler1DShadow, float),
+                TEXTURE_QUERY_LOD(v400_fs_only, sampler2DShadow, vec2),
+                TEXTURE_QUERY_LOD(v400_fs_only, samplerCubeShadow, vec3),
+                TEXTURE_QUERY_LOD(v400_fs_only, sampler1DArrayShadow, float),
+                TEXTURE_QUERY_LOD(v400_fs_only, sampler2DArrayShadow, vec2),
+                TEXTURE_QUERY_LOD(v400_fs_only, samplerCubeArrayShadow, vec3),
                 NULL);
 
    add_function("textureQueryLevels",
-                _textureQueryLevels(texture_query_levels, glsl_type::sampler1D_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::sampler2D_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::sampler3D_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::samplerCube_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::sampler1DArray_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::sampler2DArray_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::samplerCubeArray_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::sampler1DShadow_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::sampler2DShadow_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::samplerCubeShadow_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::sampler1DArrayShadow_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::sampler2DArrayShadow_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::samplerCubeArrayShadow_type),
-
-                _textureQueryLevels(texture_query_levels, glsl_type::isampler1D_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::isampler2D_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::isampler3D_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::isamplerCube_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::isampler1DArray_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::isampler2DArray_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::isamplerCubeArray_type),
-
-                _textureQueryLevels(texture_query_levels, glsl_type::usampler1D_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::usampler2D_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::usampler3D_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::usamplerCube_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::usampler1DArray_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::usampler2DArray_type),
-                _textureQueryLevels(texture_query_levels, glsl_type::usamplerCubeArray_type),
-
+                TEXTURE_QUERY_LEVELS(texture_query_levels, sampler1D),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, sampler2D),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, sampler3D),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, samplerCube),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, sampler1DArray),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, sampler2DArray),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, samplerCubeArray),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, sampler1DShadow),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, sampler2DShadow),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, samplerCubeShadow),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, sampler1DArrayShadow),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, sampler2DArrayShadow),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, samplerCubeArrayShadow),
+
+                TEXTURE_QUERY_LEVELS(texture_query_levels, isampler1D),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, isampler2D),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, isampler3D),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, isamplerCube),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, isampler1DArray),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, isampler2DArray),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, isamplerCubeArray),
+
+                TEXTURE_QUERY_LEVELS(texture_query_levels, usampler1D),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, usampler2D),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, usampler3D),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, usamplerCube),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, usampler1DArray),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, usampler2DArray),
+                TEXTURE_QUERY_LEVELS(texture_query_levels, usamplerCubeArray),
                 NULL);
 
    add_function("textureSamplesIdenticalEXT",
-                _textureSamplesIdentical(texture_samples_identical, glsl_type::sampler2DMS_type,  glsl_type::ivec2_type),
-                _textureSamplesIdentical(texture_samples_identical, glsl_type::isampler2DMS_type, glsl_type::ivec2_type),
-                _textureSamplesIdentical(texture_samples_identical, glsl_type::usampler2DMS_type, glsl_type::ivec2_type),
+                TEXTURE_SAMPLES_IDENTICAL(texture_samples_identical, sampler2DMS,  ivec2),
+                TEXTURE_SAMPLES_IDENTICAL(texture_samples_identical, isampler2DMS, ivec2),
+                TEXTURE_SAMPLES_IDENTICAL(texture_samples_identical, usampler2DMS, ivec2),
 
-                _textureSamplesIdentical(texture_samples_identical_array, glsl_type::sampler2DMSArray_type,  glsl_type::ivec3_type),
-                _textureSamplesIdentical(texture_samples_identical_array, glsl_type::isampler2DMSArray_type, glsl_type::ivec3_type),
-                _textureSamplesIdentical(texture_samples_identical_array, glsl_type::usampler2DMSArray_type, glsl_type::ivec3_type),
+                TEXTURE_SAMPLES_IDENTICAL(texture_samples_identical_array, sampler2DMSArray,  ivec3),
+                TEXTURE_SAMPLES_IDENTICAL(texture_samples_identical_array, isampler2DMSArray, ivec3),
+                TEXTURE_SAMPLES_IDENTICAL(texture_samples_identical_array, usampler2DMSArray, ivec3),
                 NULL);
 
    add_function("texture1D",
-                _texture(ir_tex, v110,         glsl_type::vec4_type,  glsl_type::sampler1D_type, glsl_type::float_type),
-                _texture(ir_txb, v110_fs_only, glsl_type::vec4_type,  glsl_type::sampler1D_type, glsl_type::float_type),
+                TEXTURE(ir_tex, v110,         vec4,  sampler1D, float, 0),
+                TEXTURE(ir_txb, v110_fs_only, vec4,  sampler1D, float, 0),
                 NULL);
 
    add_function("texture1DArray",
-                _texture(ir_tex, texture_array,    glsl_type::vec4_type, glsl_type::sampler1DArray_type, glsl_type::vec2_type),
-                _texture(ir_txb, fs_texture_array, glsl_type::vec4_type, glsl_type::sampler1DArray_type, glsl_type::vec2_type),
+                TEXTURE(ir_tex, texture_array,    vec4, sampler1DArray, vec2, 0),
+                TEXTURE(ir_txb, fs_texture_array, vec4, sampler1DArray, vec2, 0),
                 NULL);
 
    add_function("texture1DProj",
-                _texture(ir_tex, v110,         glsl_type::vec4_type,  glsl_type::sampler1D_type, glsl_type::vec2_type, TEX_PROJECT),
-                _texture(ir_tex, v110,         glsl_type::vec4_type,  glsl_type::sampler1D_type, glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txb, v110_fs_only, glsl_type::vec4_type,  glsl_type::sampler1D_type, glsl_type::vec2_type, TEX_PROJECT),
-                _texture(ir_txb, v110_fs_only, glsl_type::vec4_type,  glsl_type::sampler1D_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_tex, v110,         vec4,  sampler1D, vec2, TEX_PROJECT),
+                TEXTURE(ir_tex, v110,         vec4,  sampler1D, vec4, TEX_PROJECT),
+                TEXTURE(ir_txb, v110_fs_only, vec4,  sampler1D, vec2, TEX_PROJECT),
+                TEXTURE(ir_txb, v110_fs_only, vec4,  sampler1D, vec4, TEX_PROJECT),
                 NULL);
 
    add_function("texture1DLod",
-                _texture(ir_txl, tex1d_lod, glsl_type::vec4_type,  glsl_type::sampler1D_type, glsl_type::float_type),
+                TEXTURE(ir_txl, tex1d_lod, vec4,  sampler1D, float, 0),
                 NULL);
 
    add_function("texture1DArrayLod",
-                _texture(ir_txl, texture_array_lod, glsl_type::vec4_type, glsl_type::sampler1DArray_type, glsl_type::vec2_type),
+                TEXTURE(ir_txl, texture_array_lod, vec4, sampler1DArray, vec2, 0),
                 NULL);
 
    add_function("texture1DProjLod",
-                _texture(ir_txl, tex1d_lod, glsl_type::vec4_type,  glsl_type::sampler1D_type, glsl_type::vec2_type, TEX_PROJECT),
-                _texture(ir_txl, tex1d_lod, glsl_type::vec4_type,  glsl_type::sampler1D_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_txl, tex1d_lod, vec4,  sampler1D, vec2, TEX_PROJECT),
+                TEXTURE(ir_txl, tex1d_lod, vec4,  sampler1D, vec4, TEX_PROJECT),
                 NULL);
 
    add_function("texture2D",
-                _texture(ir_tex, always_available, glsl_type::vec4_type,  glsl_type::sampler2D_type, glsl_type::vec2_type),
-                _texture(ir_txb, fs_only,          glsl_type::vec4_type,  glsl_type::sampler2D_type, glsl_type::vec2_type),
-                _texture(ir_tex, texture_external, glsl_type::vec4_type,  glsl_type::samplerExternalOES_type, glsl_type::vec2_type),
+                TEXTURE(ir_tex, always_available, vec4,  sampler2D, vec2, 0),
+                TEXTURE(ir_txb, fs_only,          vec4,  sampler2D, vec2, 0),
+
+                _texture(ir_tex, texture_external, glsl_type::vec4_type,  glsl_type::samplerExternalOES_type, glsl_type::vec2_type, 0),
                 NULL);
 
    add_function("texture2DArray",
-                _texture(ir_tex, texture_array,    glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type),
-                _texture(ir_txb, fs_texture_array, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type),
+                TEXTURE(ir_tex, texture_array,    vec4, sampler2DArray, vec3, 0),
+                TEXTURE(ir_txb, fs_texture_array, vec4, sampler2DArray, vec3, 0),
                 NULL);
 
    add_function("texture2DProj",
-                _texture(ir_tex, always_available, glsl_type::vec4_type,  glsl_type::sampler2D_type, glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_tex, always_available, glsl_type::vec4_type,  glsl_type::sampler2D_type, glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txb, fs_only,          glsl_type::vec4_type,  glsl_type::sampler2D_type, glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_txb, fs_only,          glsl_type::vec4_type,  glsl_type::sampler2D_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_tex, always_available, vec4,  sampler2D, vec3, TEX_PROJECT),
+                TEXTURE(ir_tex, always_available, vec4,  sampler2D, vec4, TEX_PROJECT),
+                TEXTURE(ir_txb, fs_only,          vec4,  sampler2D, vec3, TEX_PROJECT),
+                TEXTURE(ir_txb, fs_only,          vec4,  sampler2D, vec4, TEX_PROJECT),
+
                 _texture(ir_tex, texture_external, glsl_type::vec4_type,  glsl_type::samplerExternalOES_type, glsl_type::vec3_type, TEX_PROJECT),
                 _texture(ir_tex, texture_external, glsl_type::vec4_type,  glsl_type::samplerExternalOES_type, glsl_type::vec4_type, TEX_PROJECT),
                 NULL);
 
    add_function("texture2DLod",
-                _texture(ir_txl, lod_exists_in_stage, glsl_type::vec4_type,  glsl_type::sampler2D_type, glsl_type::vec2_type),
+                TEXTURE(ir_txl, lod_exists_in_stage, vec4,  sampler2D, vec2, 0),
                 NULL);
 
    add_function("texture2DArrayLod",
-                _texture(ir_txl, texture_array_lod, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type),
+                TEXTURE(ir_txl, texture_array_lod, vec4, sampler2DArray, vec3, 0),
                 NULL);
 
    add_function("texture2DProjLod",
-                _texture(ir_txl, lod_exists_in_stage, glsl_type::vec4_type,  glsl_type::sampler2D_type, glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_txl, lod_exists_in_stage, glsl_type::vec4_type,  glsl_type::sampler2D_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_txl, lod_exists_in_stage, vec4,  sampler2D, vec3, TEX_PROJECT),
+                TEXTURE(ir_txl, lod_exists_in_stage, vec4,  sampler2D, vec4, TEX_PROJECT),
                 NULL);
 
    add_function("texture3D",
-                _texture(ir_tex, tex3d,    glsl_type::vec4_type,  glsl_type::sampler3D_type, glsl_type::vec3_type),
-                _texture(ir_txb, fs_tex3d, glsl_type::vec4_type,  glsl_type::sampler3D_type, glsl_type::vec3_type),
+                TEXTURE(ir_tex, tex3d,    vec4,  sampler3D, vec3, 0),
+                TEXTURE(ir_txb, fs_tex3d, vec4,  sampler3D, vec3, 0),
                 NULL);
 
    add_function("texture3DProj",
-                _texture(ir_tex, tex3d,    glsl_type::vec4_type,  glsl_type::sampler3D_type, glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txb, fs_tex3d, glsl_type::vec4_type,  glsl_type::sampler3D_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_tex, tex3d,    vec4,  sampler3D, vec4, TEX_PROJECT),
+                TEXTURE(ir_txb, fs_tex3d, vec4,  sampler3D, vec4, TEX_PROJECT),
                 NULL);
 
    add_function("texture3DLod",
-                _texture(ir_txl, tex3d_lod, glsl_type::vec4_type,  glsl_type::sampler3D_type, glsl_type::vec3_type),
+                TEXTURE(ir_txl, tex3d_lod, vec4,  sampler3D, vec3, 0),
                 NULL);
 
    add_function("texture3DProjLod",
-                _texture(ir_txl, tex3d_lod, glsl_type::vec4_type,  glsl_type::sampler3D_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_txl, tex3d_lod, vec4,  sampler3D, vec4, TEX_PROJECT),
                 NULL);
 
    add_function("textureCube",
-                _texture(ir_tex, always_available, glsl_type::vec4_type,  glsl_type::samplerCube_type, glsl_type::vec3_type),
-                _texture(ir_txb, fs_only,          glsl_type::vec4_type,  glsl_type::samplerCube_type, glsl_type::vec3_type),
+                TEXTURE(ir_tex, always_available, vec4,  samplerCube, vec3, 0),
+                TEXTURE(ir_txb, fs_only,          vec4,  samplerCube, vec3, 0),
                 NULL);
 
    add_function("textureCubeLod",
-                _texture(ir_txl, lod_exists_in_stage, glsl_type::vec4_type,  glsl_type::samplerCube_type, glsl_type::vec3_type),
+                TEXTURE(ir_txl, lod_exists_in_stage, vec4,  samplerCube, vec3, 0),
                 NULL);
 
    add_function("texture2DRect",
-                _texture(ir_tex, texture_rectangle, glsl_type::vec4_type,  glsl_type::sampler2DRect_type, glsl_type::vec2_type),
+                TEXTURE(ir_tex, texture_rectangle, vec4,  sampler2DRect, vec2, 0),
                 NULL);
 
    add_function("texture2DRectProj",
-                _texture(ir_tex, texture_rectangle, glsl_type::vec4_type,  glsl_type::sampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_tex, texture_rectangle, glsl_type::vec4_type,  glsl_type::sampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_tex, texture_rectangle, vec4,  sampler2DRect, vec3, TEX_PROJECT),
+                TEXTURE(ir_tex, texture_rectangle, vec4,  sampler2DRect, vec4, TEX_PROJECT),
                 NULL);
 
    add_function("shadow1D",
-                _texture(ir_tex, v110,         glsl_type::vec4_type,  glsl_type::sampler1DShadow_type, glsl_type::vec3_type),
-                _texture(ir_txb, v110_fs_only, glsl_type::vec4_type,  glsl_type::sampler1DShadow_type, glsl_type::vec3_type),
+                TEXTURE(ir_tex, v110,         vec4,  sampler1DShadow, vec3, 0),
+                TEXTURE(ir_txb, v110_fs_only, vec4,  sampler1DShadow, vec3, 0),
                 NULL);
 
    add_function("shadow1DArray",
-                _texture(ir_tex, texture_array,    glsl_type::vec4_type,  glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type),
-                _texture(ir_txb, fs_texture_array, glsl_type::vec4_type,  glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type),
+                TEXTURE(ir_tex, texture_array,    vec4,  sampler1DArrayShadow, vec3, 0),
+                TEXTURE(ir_txb, fs_texture_array, vec4,  sampler1DArrayShadow, vec3, 0),
                 NULL);
 
    add_function("shadow2D",
-                _texture(ir_tex, v110,         glsl_type::vec4_type,  glsl_type::sampler2DShadow_type, glsl_type::vec3_type),
-                _texture(ir_txb, v110_fs_only, glsl_type::vec4_type,  glsl_type::sampler2DShadow_type, glsl_type::vec3_type),
+                TEXTURE(ir_tex, v110,         vec4,  sampler2DShadow, vec3, 0),
+                TEXTURE(ir_txb, v110_fs_only, vec4,  sampler2DShadow, vec3, 0),
                 NULL);
 
    add_function("shadow2DArray",
-                _texture(ir_tex, texture_array,    glsl_type::vec4_type,  glsl_type::sampler2DArrayShadow_type, glsl_type::vec4_type),
-                _texture(ir_txb, fs_texture_array, glsl_type::vec4_type,  glsl_type::sampler2DArrayShadow_type, glsl_type::vec4_type),
+                TEXTURE(ir_tex, texture_array,    vec4,  sampler2DArrayShadow, vec4, 0),
+                TEXTURE(ir_txb, fs_texture_array, vec4,  sampler2DArrayShadow, vec4, 0),
                 NULL);
 
    add_function("shadow1DProj",
-                _texture(ir_tex, v110,         glsl_type::vec4_type,  glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txb, v110_fs_only, glsl_type::vec4_type,  glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_tex, v110,         vec4,  sampler1DShadow, vec4, TEX_PROJECT),
+                TEXTURE(ir_txb, v110_fs_only, vec4,  sampler1DShadow, vec4, TEX_PROJECT),
                 NULL);
 
    add_function("shadow2DProj",
-                _texture(ir_tex, v110,         glsl_type::vec4_type,  glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT),
-                _texture(ir_txb, v110_fs_only, glsl_type::vec4_type,  glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_tex, v110,         vec4,  sampler2DShadow, vec4, TEX_PROJECT),
+                TEXTURE(ir_txb, v110_fs_only, vec4,  sampler2DShadow, vec4, TEX_PROJECT),
                 NULL);
 
    add_function("shadow1DLod",
-                _texture(ir_txl, v110_lod, glsl_type::vec4_type,  glsl_type::sampler1DShadow_type, glsl_type::vec3_type),
+                TEXTURE(ir_txl, v110_lod, vec4,  sampler1DShadow, vec3, 0),
                 NULL);
 
    add_function("shadow2DLod",
-                _texture(ir_txl, v110_lod, glsl_type::vec4_type,  glsl_type::sampler2DShadow_type, glsl_type::vec3_type),
+                TEXTURE(ir_txl, v110_lod, vec4,  sampler2DShadow, vec3, 0),
                 NULL);
 
    add_function("shadow1DArrayLod",
-                _texture(ir_txl, texture_array_lod, glsl_type::vec4_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type),
+                TEXTURE(ir_txl, texture_array_lod, vec4, sampler1DArrayShadow, vec3, 0),
                 NULL);
 
    add_function("shadow1DProjLod",
-                _texture(ir_txl, v110_lod, glsl_type::vec4_type,  glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_txl, v110_lod, vec4,  sampler1DShadow, vec4, TEX_PROJECT),
                 NULL);
 
    add_function("shadow2DProjLod",
-                _texture(ir_txl, v110_lod, glsl_type::vec4_type,  glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_txl, v110_lod, vec4,  sampler2DShadow, vec4, TEX_PROJECT),
                 NULL);
 
    add_function("shadow2DRect",
-                _texture(ir_tex, texture_rectangle, glsl_type::vec4_type,  glsl_type::sampler2DRectShadow_type, glsl_type::vec3_type),
+                TEXTURE(ir_tex, texture_rectangle, vec4,  sampler2DRectShadow, vec3, 0),
                 NULL);
 
    add_function("shadow2DRectProj",
-                _texture(ir_tex, texture_rectangle, glsl_type::vec4_type,  glsl_type::sampler2DRectShadow_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_tex, texture_rectangle, vec4,  sampler2DRectShadow, vec4, TEX_PROJECT),
                 NULL);
 
    add_function("texture1DGradARB",
-                _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type,  glsl_type::sampler1D_type, glsl_type::float_type),
+                TEXTURE(ir_txd, shader_texture_lod, vec4,  sampler1D, float, 0),
                 NULL);
 
    add_function("texture1DProjGradARB",
-                _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type,  glsl_type::sampler1D_type, glsl_type::vec2_type, TEX_PROJECT),
-                _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type,  glsl_type::sampler1D_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_txd, shader_texture_lod, vec4,  sampler1D, vec2, TEX_PROJECT),
+                TEXTURE(ir_txd, shader_texture_lod, vec4,  sampler1D, vec4, TEX_PROJECT),
                 NULL);
 
    add_function("texture2DGradARB",
-                _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type,  glsl_type::sampler2D_type, glsl_type::vec2_type),
+                TEXTURE(ir_txd, shader_texture_lod, vec4,  sampler2D, vec2, 0),
                 NULL);
 
    add_function("texture2DProjGradARB",
-                _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type,  glsl_type::sampler2D_type, glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type,  glsl_type::sampler2D_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_txd, shader_texture_lod, vec4,  sampler2D, vec3, TEX_PROJECT),
+                TEXTURE(ir_txd, shader_texture_lod, vec4,  sampler2D, vec4, TEX_PROJECT),
                 NULL);
 
    add_function("texture3DGradARB",
-                _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type,  glsl_type::sampler3D_type, glsl_type::vec3_type),
+                TEXTURE(ir_txd, shader_texture_lod, vec4,  sampler3D, vec3, 0),
                 NULL);
 
    add_function("texture3DProjGradARB",
-                _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type,  glsl_type::sampler3D_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_txd, shader_texture_lod, vec4,  sampler3D, vec4, TEX_PROJECT),
                 NULL);
 
    add_function("textureCubeGradARB",
-                _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type,  glsl_type::samplerCube_type, glsl_type::vec3_type),
+                TEXTURE(ir_txd, shader_texture_lod, vec4,  samplerCube, vec3, 0),
                 NULL);
 
    add_function("shadow1DGradARB",
-                _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type,  glsl_type::sampler1DShadow_type, glsl_type::vec3_type),
+                TEXTURE(ir_txd, shader_texture_lod, vec4,  sampler1DShadow, vec3, 0),
                 NULL);
 
    add_function("shadow1DProjGradARB",
-                _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type,  glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_txd, shader_texture_lod, vec4,  sampler1DShadow, vec4, TEX_PROJECT),
                 NULL);
 
    add_function("shadow2DGradARB",
-                _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type,  glsl_type::sampler2DShadow_type, glsl_type::vec3_type),
+                TEXTURE(ir_txd, shader_texture_lod, vec4,  sampler2DShadow, vec3, 0),
                 NULL);
 
    add_function("shadow2DProjGradARB",
-                _texture(ir_txd, shader_texture_lod, glsl_type::vec4_type,  glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_txd, shader_texture_lod, vec4,  sampler2DShadow, vec4, TEX_PROJECT),
                 NULL);
 
    add_function("texture2DRectGradARB",
-                _texture(ir_txd, shader_texture_lod_and_rect, glsl_type::vec4_type,  glsl_type::sampler2DRect_type, glsl_type::vec2_type),
+                TEXTURE(ir_txd, shader_texture_lod_and_rect, vec4,  sampler2DRect, vec2, 0),
                 NULL);
 
    add_function("texture2DRectProjGradARB",
-                _texture(ir_txd, shader_texture_lod_and_rect, glsl_type::vec4_type,  glsl_type::sampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT),
-                _texture(ir_txd, shader_texture_lod_and_rect, glsl_type::vec4_type,  glsl_type::sampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_txd, shader_texture_lod_and_rect, vec4,  sampler2DRect, vec3, TEX_PROJECT),
+                TEXTURE(ir_txd, shader_texture_lod_and_rect, vec4,  sampler2DRect, vec4, TEX_PROJECT),
                 NULL);
 
    add_function("shadow2DRectGradARB",
-                _texture(ir_txd, shader_texture_lod_and_rect, glsl_type::vec4_type,  glsl_type::sampler2DRectShadow_type, glsl_type::vec3_type),
+                TEXTURE(ir_txd, shader_texture_lod_and_rect, vec4,  sampler2DRectShadow, vec3, 0),
                 NULL);
 
    add_function("shadow2DRectProjGradARB",
-                _texture(ir_txd, shader_texture_lod_and_rect, glsl_type::vec4_type,  glsl_type::sampler2DRectShadow_type, glsl_type::vec4_type, TEX_PROJECT),
+                TEXTURE(ir_txd, shader_texture_lod_and_rect, vec4,  sampler2DRectShadow, vec4, TEX_PROJECT),
                 NULL);
 
    add_function("textureGather",
-                _texture(ir_tg4, texture_gather_or_es31, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type),
-                _texture(ir_tg4, texture_gather_or_es31, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type),
-                _texture(ir_tg4, texture_gather_or_es31, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type),
+                TEXTURE(ir_tg4, texture_gather_or_es31, vec4, sampler2D, vec2, 0),
+                TEXTURE(ir_tg4, texture_gather_or_es31, ivec4, isampler2D, vec2, 0),
+                TEXTURE(ir_tg4, texture_gather_or_es31, uvec4, usampler2D, vec2, 0),
 
-                _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec2_type),
-                _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec2_type),
-                _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec2_type),
+                TEXTURE(ir_tg4, gpu_shader5, vec4, sampler2DRect, vec2, 0),
+                TEXTURE(ir_tg4, gpu_shader5, ivec4, isampler2DRect, vec2, 0),
+                TEXTURE(ir_tg4, gpu_shader5, uvec4, usampler2DRect, vec2, 0),
 
-                _texture(ir_tg4, texture_gather_or_es31, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type),
-                _texture(ir_tg4, texture_gather_or_es31, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type),
-                _texture(ir_tg4, texture_gather_or_es31, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type),
+                TEXTURE(ir_tg4, texture_gather_or_es31, vec4, sampler2DArray, vec3, 0),
+                TEXTURE(ir_tg4, texture_gather_or_es31, ivec4, isampler2DArray, vec3, 0),
+                TEXTURE(ir_tg4, texture_gather_or_es31, uvec4, usampler2DArray, vec3, 0),
 
-                _texture(ir_tg4, texture_gather_or_es31, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type),
-                _texture(ir_tg4, texture_gather_or_es31, glsl_type::ivec4_type, glsl_type::isamplerCube_type, glsl_type::vec3_type),
-                _texture(ir_tg4, texture_gather_or_es31, glsl_type::uvec4_type, glsl_type::usamplerCube_type, glsl_type::vec3_type),
+                TEXTURE(ir_tg4, texture_gather_or_es31, vec4, samplerCube, vec3, 0),
+                TEXTURE(ir_tg4, texture_gather_or_es31, ivec4, isamplerCube, vec3, 0),
+                TEXTURE(ir_tg4, texture_gather_or_es31, uvec4, usamplerCube, vec3, 0),
 
-                _texture(ir_tg4, texture_gather_cube_map_array, glsl_type::vec4_type, glsl_type::samplerCubeArray_type, glsl_type::vec4_type),
-                _texture(ir_tg4, texture_gather_cube_map_array, glsl_type::ivec4_type, glsl_type::isamplerCubeArray_type, glsl_type::vec4_type),
-                _texture(ir_tg4, texture_gather_cube_map_array, glsl_type::uvec4_type, glsl_type::usamplerCubeArray_type, glsl_type::vec4_type),
+                TEXTURE(ir_tg4, texture_gather_cube_map_array, vec4, samplerCubeArray, vec4, 0),
+                TEXTURE(ir_tg4, texture_gather_cube_map_array, ivec4, isamplerCubeArray, vec4, 0),
+                TEXTURE(ir_tg4, texture_gather_cube_map_array, uvec4, usamplerCubeArray, vec4, 0),
 
-                _texture(ir_tg4, gpu_shader5_or_es31, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_COMPONENT),
-                _texture(ir_tg4, gpu_shader5_or_es31, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_COMPONENT),
-                _texture(ir_tg4, gpu_shader5_or_es31, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_or_es31, vec4, sampler2D, vec2, TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_or_es31, ivec4, isampler2D, vec2, TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_or_es31, uvec4, usampler2D, vec2, TEX_COMPONENT),
 
-                _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec2_type, TEX_COMPONENT),
-                _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec2_type, TEX_COMPONENT),
-                _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec2_type, TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5, vec4, sampler2DRect, vec2, TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5, ivec4, isampler2DRect, vec2, TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5, uvec4, usampler2DRect, vec2, TEX_COMPONENT),
 
-                _texture(ir_tg4, gpu_shader5_or_es31, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_COMPONENT),
-                _texture(ir_tg4, gpu_shader5_or_es31, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_COMPONENT),
-                _texture(ir_tg4, gpu_shader5_or_es31, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_or_es31, vec4, sampler2DArray, vec3, TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_or_es31, ivec4, isampler2DArray, vec3, TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_or_es31, uvec4, usampler2DArray, vec3, TEX_COMPONENT),
 
-                _texture(ir_tg4, gpu_shader5_or_es31, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type, TEX_COMPONENT),
-                _texture(ir_tg4, gpu_shader5_or_es31, glsl_type::ivec4_type, glsl_type::isamplerCube_type, glsl_type::vec3_type, TEX_COMPONENT),
-                _texture(ir_tg4, gpu_shader5_or_es31, glsl_type::uvec4_type, glsl_type::usamplerCube_type, glsl_type::vec3_type, TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_or_es31, vec4, samplerCube, vec3, TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_or_es31, ivec4, isamplerCube, vec3, TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_or_es31, uvec4, usamplerCube, vec3, TEX_COMPONENT),
 
-                _texture(ir_tg4, gpu_shader5_or_OES_texture_cube_map_array, glsl_type::vec4_type, glsl_type::samplerCubeArray_type, glsl_type::vec4_type, TEX_COMPONENT),
-                _texture(ir_tg4, gpu_shader5_or_OES_texture_cube_map_array, glsl_type::ivec4_type, glsl_type::isamplerCubeArray_type, glsl_type::vec4_type, TEX_COMPONENT),
-                _texture(ir_tg4, gpu_shader5_or_OES_texture_cube_map_array, glsl_type::uvec4_type, glsl_type::usamplerCubeArray_type, glsl_type::vec4_type, TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_or_OES_texture_cube_map_array, vec4, samplerCubeArray, vec4, TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_or_OES_texture_cube_map_array, ivec4, isamplerCubeArray, vec4, TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_or_OES_texture_cube_map_array, uvec4, usamplerCubeArray, vec4, TEX_COMPONENT),
 
-                _texture(ir_tg4, gpu_shader5_or_es31, glsl_type::vec4_type, glsl_type::sampler2DShadow_type, glsl_type::vec2_type),
-                _texture(ir_tg4, gpu_shader5_or_es31, glsl_type::vec4_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec3_type),
-                _texture(ir_tg4, gpu_shader5_or_es31, glsl_type::vec4_type, glsl_type::samplerCubeShadow_type, glsl_type::vec3_type),
-                _texture(ir_tg4, gpu_shader5_or_OES_texture_cube_map_array, glsl_type::vec4_type, glsl_type::samplerCubeArrayShadow_type, glsl_type::vec4_type),
-                _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec2_type),
+                TEXTURE(ir_tg4, gpu_shader5_or_es31, vec4, sampler2DShadow, vec2, 0),
+                TEXTURE(ir_tg4, gpu_shader5_or_es31, vec4, sampler2DArrayShadow, vec3, 0),
+                TEXTURE(ir_tg4, gpu_shader5_or_es31, vec4, samplerCubeShadow, vec3, 0),
+                TEXTURE(ir_tg4, gpu_shader5_or_OES_texture_cube_map_array, vec4, samplerCubeArrayShadow, vec4, 0),
+                TEXTURE(ir_tg4, gpu_shader5, vec4, sampler2DRectShadow, vec2, 0),
                 NULL);
 
    add_function("textureGatherOffset",
-                _texture(ir_tg4, texture_gather_only_or_es31, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET),
-                _texture(ir_tg4, texture_gather_only_or_es31, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET),
-                _texture(ir_tg4, texture_gather_only_or_es31, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET),
+                TEXTURE(ir_tg4, texture_gather_only_or_es31, vec4, sampler2D, vec2, TEX_OFFSET),
+                TEXTURE(ir_tg4, texture_gather_only_or_es31, ivec4, isampler2D, vec2, TEX_OFFSET),
+                TEXTURE(ir_tg4, texture_gather_only_or_es31, uvec4, usampler2D, vec2, TEX_OFFSET),
 
-                _texture(ir_tg4, texture_gather_only_or_es31, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET),
-                _texture(ir_tg4, texture_gather_only_or_es31, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET),
-                _texture(ir_tg4, texture_gather_only_or_es31, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET),
+                TEXTURE(ir_tg4, texture_gather_only_or_es31, vec4, sampler2DArray, vec3, TEX_OFFSET),
+                TEXTURE(ir_tg4, texture_gather_only_or_es31, ivec4, isampler2DArray, vec3, TEX_OFFSET),
+                TEXTURE(ir_tg4, texture_gather_only_or_es31, uvec4, usampler2DArray, vec3, TEX_OFFSET),
 
-                _texture(ir_tg4, es31_not_gs5, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET | TEX_COMPONENT),
-                _texture(ir_tg4, es31_not_gs5, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET | TEX_COMPONENT),
-                _texture(ir_tg4, es31_not_gs5, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET | TEX_COMPONENT),
+                TEXTURE(ir_tg4, es31_not_gs5, vec4, sampler2D, vec2, TEX_OFFSET | TEX_COMPONENT),
+                TEXTURE(ir_tg4, es31_not_gs5, ivec4, isampler2D, vec2, TEX_OFFSET | TEX_COMPONENT),
+                TEXTURE(ir_tg4, es31_not_gs5, uvec4, usampler2D, vec2, TEX_OFFSET | TEX_COMPONENT),
 
-                _texture(ir_tg4, es31_not_gs5, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET | TEX_COMPONENT),
-                _texture(ir_tg4, es31_not_gs5, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET | TEX_COMPONENT),
-                _texture(ir_tg4, es31_not_gs5, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET | TEX_COMPONENT),
+                TEXTURE(ir_tg4, es31_not_gs5, vec4, sampler2DArray, vec3, TEX_OFFSET | TEX_COMPONENT),
+                TEXTURE(ir_tg4, es31_not_gs5, ivec4, isampler2DArray, vec3, TEX_OFFSET | TEX_COMPONENT),
+                TEXTURE(ir_tg4, es31_not_gs5, uvec4, usampler2DArray, vec3, TEX_OFFSET | TEX_COMPONENT),
 
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST),
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST),
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST),
+                TEXTURE(ir_tg4, gpu_shader5_es, vec4, sampler2D, vec2, TEX_OFFSET_NONCONST),
+                TEXTURE(ir_tg4, gpu_shader5_es, ivec4, isampler2D, vec2, TEX_OFFSET_NONCONST),
+                TEXTURE(ir_tg4, gpu_shader5_es, uvec4, usampler2D, vec2, TEX_OFFSET_NONCONST),
 
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_NONCONST),
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_NONCONST),
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_NONCONST),
+                TEXTURE(ir_tg4, gpu_shader5_es, vec4, sampler2DArray, vec3, TEX_OFFSET_NONCONST),
+                TEXTURE(ir_tg4, gpu_shader5_es, ivec4, isampler2DArray, vec3, TEX_OFFSET_NONCONST),
+                TEXTURE(ir_tg4, gpu_shader5_es, uvec4, usampler2DArray, vec3, TEX_OFFSET_NONCONST),
 
-                _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST),
-                _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST),
-                _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST),
+                TEXTURE(ir_tg4, gpu_shader5, vec4, sampler2DRect, vec2, TEX_OFFSET_NONCONST),
+                TEXTURE(ir_tg4, gpu_shader5, ivec4, isampler2DRect, vec2, TEX_OFFSET_NONCONST),
+                TEXTURE(ir_tg4, gpu_shader5, uvec4, usampler2DRect, vec2, TEX_OFFSET_NONCONST),
 
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST | TEX_COMPONENT),
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST | TEX_COMPONENT),
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST | TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_es, vec4, sampler2D, vec2, TEX_OFFSET_NONCONST | TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_es, ivec4, isampler2D, vec2, TEX_OFFSET_NONCONST | TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_es, uvec4, usampler2D, vec2, TEX_OFFSET_NONCONST | TEX_COMPONENT),
 
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_NONCONST | TEX_COMPONENT),
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_NONCONST | TEX_COMPONENT),
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_NONCONST | TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_es, vec4, sampler2DArray, vec3, TEX_OFFSET_NONCONST | TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_es, ivec4, isampler2DArray, vec3, TEX_OFFSET_NONCONST | TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_es, uvec4, usampler2DArray, vec3, TEX_OFFSET_NONCONST | TEX_COMPONENT),
 
-                _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST | TEX_COMPONENT),
-                _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST | TEX_COMPONENT),
-                _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST | TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5, vec4, sampler2DRect, vec2, TEX_OFFSET_NONCONST | TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5, ivec4, isampler2DRect, vec2, TEX_OFFSET_NONCONST | TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5, uvec4, usampler2DRect, vec2, TEX_OFFSET_NONCONST | TEX_COMPONENT),
 
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::vec4_type, glsl_type::sampler2DShadow_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST),
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::vec4_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec3_type, TEX_OFFSET_NONCONST),
-                _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST),
+                TEXTURE(ir_tg4, gpu_shader5_es, vec4, sampler2DShadow, vec2, TEX_OFFSET_NONCONST),
+                TEXTURE(ir_tg4, gpu_shader5_es, vec4, sampler2DArrayShadow, vec3, TEX_OFFSET_NONCONST),
+                TEXTURE(ir_tg4, gpu_shader5, vec4, sampler2DRectShadow, vec2, TEX_OFFSET_NONCONST),
 
-                _texture(ir_tg4, es31_not_gs5, glsl_type::vec4_type, glsl_type::sampler2DShadow_type, glsl_type::vec2_type, TEX_OFFSET),
-                _texture(ir_tg4, es31_not_gs5, glsl_type::vec4_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec3_type, TEX_OFFSET),
+                TEXTURE(ir_tg4, es31_not_gs5, vec4, sampler2DShadow, vec2, TEX_OFFSET),
+                TEXTURE(ir_tg4, es31_not_gs5, vec4, sampler2DArrayShadow, vec3, TEX_OFFSET),
                 NULL);
 
    add_function("textureGatherOffsets",
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY),
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY),
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY),
+                TEXTURE(ir_tg4, gpu_shader5_es, vec4, sampler2D, vec2, TEX_OFFSET_ARRAY),
+                TEXTURE(ir_tg4, gpu_shader5_es, ivec4, isampler2D, vec2, TEX_OFFSET_ARRAY),
+                TEXTURE(ir_tg4, gpu_shader5_es, uvec4, usampler2D, vec2, TEX_OFFSET_ARRAY),
 
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY | TEX_COMPONENT),
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY | TEX_COMPONENT),
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY | TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_es, vec4, sampler2D, vec2, TEX_OFFSET_ARRAY | TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_es, ivec4, isampler2D, vec2, TEX_OFFSET_ARRAY | TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_es, uvec4, usampler2D, vec2, TEX_OFFSET_ARRAY | TEX_COMPONENT),
 
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_ARRAY),
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_ARRAY),
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_ARRAY),
+                TEXTURE(ir_tg4, gpu_shader5_es, vec4, sampler2DArray, vec3, TEX_OFFSET_ARRAY),
+                TEXTURE(ir_tg4, gpu_shader5_es, ivec4, isampler2DArray, vec3, TEX_OFFSET_ARRAY),
+                TEXTURE(ir_tg4, gpu_shader5_es, uvec4, usampler2DArray, vec3, TEX_OFFSET_ARRAY),
 
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_ARRAY | TEX_COMPONENT),
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_ARRAY | TEX_COMPONENT),
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET_ARRAY | TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_es, vec4, sampler2DArray, vec3, TEX_OFFSET_ARRAY | TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_es, ivec4, isampler2DArray, vec3, TEX_OFFSET_ARRAY | TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5_es, uvec4, usampler2DArray, vec3, TEX_OFFSET_ARRAY | TEX_COMPONENT),
 
-                _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY),
-                _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY),
-                _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY),
+                TEXTURE(ir_tg4, gpu_shader5, vec4, sampler2DRect, vec2, TEX_OFFSET_ARRAY),
+                TEXTURE(ir_tg4, gpu_shader5, ivec4, isampler2DRect, vec2, TEX_OFFSET_ARRAY),
+                TEXTURE(ir_tg4, gpu_shader5, uvec4, usampler2DRect, vec2, TEX_OFFSET_ARRAY),
 
-                _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY | TEX_COMPONENT),
-                _texture(ir_tg4, gpu_shader5, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY | TEX_COMPONENT),
-                _texture(ir_tg4, gpu_shader5, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY | TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5, vec4, sampler2DRect, vec2, TEX_OFFSET_ARRAY | TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5, ivec4, isampler2DRect, vec2, TEX_OFFSET_ARRAY | TEX_COMPONENT),
+                TEXTURE(ir_tg4, gpu_shader5, uvec4, usampler2DRect, vec2, TEX_OFFSET_ARRAY | TEX_COMPONENT),
 
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::vec4_type, glsl_type::sampler2DShadow_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY),
-                _texture(ir_tg4, gpu_shader5_es, glsl_type::vec4_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec3_type, TEX_OFFSET_ARRAY),
-                _texture(ir_tg4, gpu_shader5, glsl_type::vec4_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec2_type, TEX_OFFSET_ARRAY),
+                TEXTURE(ir_tg4, gpu_shader5_es, vec4, sampler2DShadow, vec2, TEX_OFFSET_ARRAY),
+                TEXTURE(ir_tg4, gpu_shader5_es, vec4, sampler2DArrayShadow, vec3, TEX_OFFSET_ARRAY),
+                TEXTURE(ir_tg4, gpu_shader5, vec4, sampler2DRectShadow, vec2, TEX_OFFSET_ARRAY),
                 NULL);
 
    F(dFdx)
-- 
2.12.2



More information about the mesa-dev mailing list