From: Marek Olšák <marek.ol...@amd.com>

---
 src/compiler/glsl/builtin_functions.cpp | 642 +++++++++++++++++++++++-
 1 file changed, 638 insertions(+), 4 deletions(-)

diff --git a/src/compiler/glsl/builtin_functions.cpp 
b/src/compiler/glsl/builtin_functions.cpp
index 1370245ff91..6ac9f377a03 100644
--- a/src/compiler/glsl/builtin_functions.cpp
+++ b/src/compiler/glsl/builtin_functions.cpp
@@ -203,21 +203,22 @@ lod_exists_in_stage(const _mesa_glsl_parse_state *state)
    /* Texturing functions with "Lod" in their name exist:
     * - In the vertex shader stage (for all languages)
     * - In any stage for GLSL 1.30+ or GLSL ES 3.00
     * - In any stage for desktop GLSL with ARB_shader_texture_lod enabled.
     *
     * Since ARB_shader_texture_lod can only be enabled on desktop GLSL, we
     * don't need to explicitly check state->es_shader.
     */
    return state->stage == MESA_SHADER_VERTEX ||
           state->is_version(130, 300) ||
-          state->ARB_shader_texture_lod_enable;
+          state->ARB_shader_texture_lod_enable ||
+          state->EXT_gpu_shader4_enable;
 }
 
 static bool
 v110_lod(const _mesa_glsl_parse_state *state)
 {
    return !state->es_shader && lod_exists_in_stage(state);
 }
 
 static bool
 texture_buffer(const _mesa_glsl_parse_state *state)
@@ -270,20 +271,27 @@ shader_packing_or_es3_or_gpu_shader5(const 
_mesa_glsl_parse_state *state)
           state->ARB_gpu_shader5_enable ||
           state->is_version(400, 300);
 }
 
 static bool
 gpu_shader4(const _mesa_glsl_parse_state *state)
 {
    return state->EXT_gpu_shader4_enable;
 }
 
+static bool
+gpu_shader4_fs_only(const _mesa_glsl_parse_state *state)
+{
+   return state->EXT_gpu_shader4_enable &&
+          state->stage == MESA_SHADER_FRAGMENT;
+}
+
 static bool
 v130_gpu_shader4(const _mesa_glsl_parse_state *state)
 {
    return state->is_version(130, 300) || state->EXT_gpu_shader4_enable;
 }
 
 static bool
 gpu_shader5(const _mesa_glsl_parse_state *state)
 {
    return state->is_version(400, 0) || state->ARB_gpu_shader5_enable;
@@ -341,34 +349,37 @@ fs_interpolate_at(const _mesa_glsl_parse_state *state)
           (state->is_version(400, 320) ||
            state->ARB_gpu_shader5_enable ||
            state->OES_shader_multisample_interpolation_enable);
 }
 
 
 static bool
 texture_array_lod(const _mesa_glsl_parse_state *state)
 {
    return lod_exists_in_stage(state) &&
-          state->EXT_texture_array_enable;
+          (state->EXT_texture_array_enable ||
+           state->EXT_gpu_shader4_enable);
 }
 
 static bool
 fs_texture_array(const _mesa_glsl_parse_state *state)
 {
    return state->stage == MESA_SHADER_FRAGMENT &&
-          state->EXT_texture_array_enable;
+          (state->EXT_texture_array_enable ||
+           state->EXT_gpu_shader4_enable);
 }
 
 static bool
 texture_array(const _mesa_glsl_parse_state *state)
 {
-   return state->EXT_texture_array_enable;
+   return state->EXT_texture_array_enable ||
+          state->EXT_gpu_shader4_enable;
 }
 
 static bool
 texture_multisample(const _mesa_glsl_parse_state *state)
 {
    return state->is_version(150, 310) ||
           state->ARB_texture_multisample_enable;
 }
 
 static bool
@@ -1910,20 +1921,68 @@ builtin_builder::create_builtins()
                 _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),
                 NULL);
 
+   add_function("textureSize1D",
+                _textureSize(gpu_shader4, glsl_type::int_type,   
glsl_type::sampler1D_type),
+                _textureSize(gpu_shader4, glsl_type::int_type,   
glsl_type::isampler1D_type),
+                _textureSize(gpu_shader4, glsl_type::int_type,   
glsl_type::usampler1D_type),
+                NULL);
+
+   add_function("textureSize2D",
+                _textureSize(gpu_shader4, glsl_type::ivec2_type, 
glsl_type::sampler2D_type),
+                _textureSize(gpu_shader4, glsl_type::ivec2_type, 
glsl_type::isampler2D_type),
+                _textureSize(gpu_shader4, glsl_type::ivec2_type, 
glsl_type::usampler2D_type),
+                NULL);
+
+   add_function("textureSize3D",
+                _textureSize(gpu_shader4, glsl_type::ivec3_type, 
glsl_type::sampler3D_type),
+                _textureSize(gpu_shader4, glsl_type::ivec3_type, 
glsl_type::isampler3D_type),
+                _textureSize(gpu_shader4, glsl_type::ivec3_type, 
glsl_type::usampler3D_type),
+                NULL);
+
+   add_function("textureSizeCube",
+                _textureSize(gpu_shader4, glsl_type::ivec2_type, 
glsl_type::samplerCube_type),
+                _textureSize(gpu_shader4, glsl_type::ivec2_type, 
glsl_type::isamplerCube_type),
+                _textureSize(gpu_shader4, glsl_type::ivec2_type, 
glsl_type::usamplerCube_type),
+                NULL);
+
+   add_function("textureSize1DArray",
+                _textureSize(gpu_shader4, glsl_type::ivec2_type, 
glsl_type::sampler1DArray_type),
+                _textureSize(gpu_shader4, glsl_type::ivec2_type, 
glsl_type::isampler1DArray_type),
+                _textureSize(gpu_shader4, glsl_type::ivec2_type, 
glsl_type::usampler1DArray_type),
+                NULL);
+
+   add_function("textureSize2DArray",
+                _textureSize(gpu_shader4, glsl_type::ivec3_type, 
glsl_type::sampler2DArray_type),
+                _textureSize(gpu_shader4, glsl_type::ivec3_type, 
glsl_type::isampler2DArray_type),
+                _textureSize(gpu_shader4, glsl_type::ivec3_type, 
glsl_type::usampler2DArray_type),
+                NULL);
+
+   add_function("textureSize2DRect",
+                _textureSize(gpu_shader4, glsl_type::ivec2_type, 
glsl_type::sampler2DRect_type),
+                _textureSize(gpu_shader4, glsl_type::ivec2_type, 
glsl_type::isampler2DRect_type),
+                _textureSize(gpu_shader4, glsl_type::ivec2_type, 
glsl_type::usampler2DRect_type),
+                NULL);
+
+   add_function("textureSizeBuffer",
+                _textureSize(gpu_shader4, glsl_type::int_type,   
glsl_type::samplerBuffer_type),
+                _textureSize(gpu_shader4, glsl_type::int_type,   
glsl_type::isamplerBuffer_type),
+                _textureSize(gpu_shader4, glsl_type::int_type,   
glsl_type::usamplerBuffer_type),
+                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),
 
                 _textureSamples(shader_samples, 
glsl_type::sampler2DMSArray_type),
                 _textureSamples(shader_samples, 
glsl_type::isampler2DMSArray_type),
                 _textureSamples(shader_samples, 
glsl_type::usampler2DMSArray_type),
                 NULL);
 
@@ -2103,20 +2162,94 @@ builtin_builder::create_builtins()
                 _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, 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, glsl_type::float_type, 
glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type, TEX_OFFSET),
                 NULL);
 
+   add_function("texture1DOffset",
+                _texture(ir_tex, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler1D_type,  glsl_type::float_type, TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler1D_type, glsl_type::float_type, TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler1D_type, glsl_type::float_type, TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::vec4_type,  
glsl_type::sampler1D_type,  glsl_type::float_type, TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::ivec4_type, 
glsl_type::isampler1D_type, glsl_type::float_type, TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::uvec4_type, 
glsl_type::usampler1D_type, glsl_type::float_type, TEX_OFFSET),
+                NULL);
+
+   add_function("texture2DOffset",
+                _texture(ir_tex, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2D_type,  glsl_type::vec2_type, TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::vec4_type,  
glsl_type::sampler2D_type,  glsl_type::vec2_type, TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::ivec4_type, 
glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::uvec4_type, 
glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET),
+                NULL);
+
+   add_function("texture3DOffset",
+                _texture(ir_tex, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler3D_type,  glsl_type::vec3_type, TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::vec4_type,  
glsl_type::sampler3D_type,  glsl_type::vec3_type, TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::ivec4_type, 
glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::uvec4_type, 
glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_OFFSET),
+                NULL);
+
+   add_function("texture2DRectOffset",
+                _texture(ir_tex, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2DRect_type,  glsl_type::vec2_type, TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET),
+                NULL);
+
+   add_function("shadow2DRectOffset",
+                _texture(ir_tex, gpu_shader4, glsl_type::float_type, 
glsl_type::sampler2DRectShadow_type, glsl_type::vec3_type, TEX_OFFSET),
+                NULL);
+
+   add_function("shadow1DOffset",
+                _texture(ir_tex, gpu_shader4, glsl_type::float_type, 
glsl_type::sampler1DShadow_type, glsl_type::vec3_type, TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::float_type, 
glsl_type::sampler1DShadow_type, glsl_type::vec3_type, TEX_OFFSET),
+                NULL);
+
+   add_function("shadow2DOffset",
+                _texture(ir_tex, gpu_shader4, glsl_type::float_type, 
glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::float_type, 
glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_OFFSET),
+                NULL);
+
+   add_function("texture1DArrayOffset",
+                _texture(ir_tex, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler1DArray_type,  glsl_type::vec2_type, TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::vec4_type,  
glsl_type::sampler1DArray_type,  glsl_type::vec2_type, TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::ivec4_type, 
glsl_type::isampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::uvec4_type, 
glsl_type::usampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET),
+                NULL);
+
+   add_function("texture2DArrayOffset",
+                _texture(ir_tex, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2DArray_type,  glsl_type::vec3_type, TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::vec4_type,  
glsl_type::sampler2DArray_type,  glsl_type::vec3_type, TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::ivec4_type, 
glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::uvec4_type, 
glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET),
+                NULL);
+
+   add_function("shadow1DArrayOffset",
+                _texture(ir_tex, gpu_shader4, glsl_type::float_type, 
glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type, TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::float_type, 
glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type, TEX_OFFSET),
+                NULL);
+
+   add_function("shadow2DArrayOffset",
+                _texture(ir_tex, gpu_shader4, glsl_type::float_type, 
glsl_type::sampler2DArrayShadow_type, glsl_type::vec4_type, 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),
@@ -2200,20 +2333,61 @@ builtin_builder::create_builtins()
                 _texelFetch(texture_multisample, glsl_type::uvec4_type, 
glsl_type::usampler2DMS_type, glsl_type::ivec2_type),
 
                 _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),
 
                 _texelFetch(texture_external_es3, glsl_type::vec4_type,  
glsl_type::samplerExternalOES_type, glsl_type::ivec2_type),
 
                 NULL);
 
+   add_function("texelFetch1D",
+                _texelFetch(gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler1D_type,  glsl_type::int_type),
+                _texelFetch(gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler1D_type, glsl_type::int_type),
+                _texelFetch(gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler1D_type, glsl_type::int_type),
+                NULL);
+
+   add_function("texelFetch2D",
+                _texelFetch(gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2D_type,  glsl_type::ivec2_type),
+                _texelFetch(gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2D_type, glsl_type::ivec2_type),
+                _texelFetch(gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2D_type, glsl_type::ivec2_type),
+                NULL);
+
+   add_function("texelFetch3D",
+                _texelFetch(gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler3D_type,  glsl_type::ivec3_type),
+                _texelFetch(gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler3D_type, glsl_type::ivec3_type),
+                _texelFetch(gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler3D_type, glsl_type::ivec3_type),
+                NULL);
+
+   add_function("texelFetch2DRect",
+                _texelFetch(gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2DRect_type,  glsl_type::ivec2_type),
+                _texelFetch(gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2DRect_type, glsl_type::ivec2_type),
+                _texelFetch(gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2DRect_type, glsl_type::ivec2_type),
+                NULL);
+
+   add_function("texelFetch1DArray",
+                _texelFetch(gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler1DArray_type,  glsl_type::ivec2_type),
+                _texelFetch(gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler1DArray_type, glsl_type::ivec2_type),
+                _texelFetch(gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler1DArray_type, glsl_type::ivec2_type),
+                NULL);
+
+   add_function("texelFetch2DArray",
+                _texelFetch(gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2DArray_type,  glsl_type::ivec3_type),
+                _texelFetch(gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2DArray_type, glsl_type::ivec3_type),
+                _texelFetch(gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2DArray_type, glsl_type::ivec3_type),
+                NULL);
+
+   add_function("texelFetchBuffer",
+                _texelFetch(gpu_shader4, glsl_type::vec4_type,  
glsl_type::samplerBuffer_type,  glsl_type::int_type),
+                _texelFetch(gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isamplerBuffer_type, glsl_type::int_type),
+                _texelFetch(gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usamplerBuffer_type, glsl_type::int_type),
+                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),
 
                 _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),
 
@@ -2228,20 +2402,56 @@ builtin_builder::create_builtins()
                 _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),
 
                 _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),
 
                 NULL);
 
+   add_function("texelFetch1DOffset",
+                _texelFetch(gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler1D_type,  glsl_type::int_type, glsl_type::int_type),
+                _texelFetch(gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler1D_type, glsl_type::int_type, glsl_type::int_type),
+                _texelFetch(gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler1D_type, glsl_type::int_type, glsl_type::int_type),
+                NULL);
+
+   add_function("texelFetch2DOffset",
+                _texelFetch(gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2D_type,  glsl_type::ivec2_type, glsl_type::ivec2_type),
+                _texelFetch(gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2D_type, glsl_type::ivec2_type, glsl_type::ivec2_type),
+                _texelFetch(gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2D_type, glsl_type::ivec2_type, glsl_type::ivec2_type),
+                NULL);
+
+   add_function("texelFetch3DOffset",
+                _texelFetch(gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler3D_type,  glsl_type::ivec3_type, glsl_type::ivec3_type),
+                _texelFetch(gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler3D_type, glsl_type::ivec3_type, glsl_type::ivec3_type),
+                _texelFetch(gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler3D_type, glsl_type::ivec3_type, glsl_type::ivec3_type),
+                NULL);
+
+   add_function("texelFetch2DRectOffset",
+                _texelFetch(gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2DRect_type,  glsl_type::ivec2_type, glsl_type::ivec2_type),
+                _texelFetch(gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2DRect_type, glsl_type::ivec2_type, glsl_type::ivec2_type),
+                _texelFetch(gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2DRect_type, glsl_type::ivec2_type, glsl_type::ivec2_type),
+                NULL);
+
+   add_function("texelFetch1DArrayOffset",
+                _texelFetch(gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler1DArray_type,  glsl_type::ivec2_type, glsl_type::int_type),
+                _texelFetch(gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler1DArray_type, glsl_type::ivec2_type, glsl_type::int_type),
+                _texelFetch(gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler1DArray_type, glsl_type::ivec2_type, glsl_type::int_type),
+                NULL);
+
+   add_function("texelFetch2DArrayOffset",
+                _texelFetch(gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2DArray_type,  glsl_type::ivec3_type, glsl_type::ivec2_type),
+                _texelFetch(gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2DArray_type, glsl_type::ivec3_type, glsl_type::ivec2_type),
+                _texelFetch(gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2DArray_type, glsl_type::ivec3_type, glsl_type::ivec2_type),
+                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),
@@ -2281,20 +2491,82 @@ builtin_builder::create_builtins()
                 _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),
                 NULL);
 
+   add_function("texture1DProjOffset",
+                _texture(ir_tex, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler1D_type,  glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler1D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::vec4_type,  
glsl_type::sampler1D_type,  glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::ivec4_type, 
glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::uvec4_type, 
glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::vec4_type,  
glsl_type::sampler1D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::ivec4_type, 
glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::uvec4_type, 
glsl_type::usampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                NULL);
+
+   add_function("texture2DProjOffset",
+                _texture(ir_tex, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2D_type,  glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::vec4_type,  
glsl_type::sampler2D_type,  glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::ivec4_type, 
glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::uvec4_type, 
glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::vec4_type,  
glsl_type::sampler2D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::ivec4_type, 
glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::uvec4_type, 
glsl_type::usampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                NULL);
+
+   add_function("texture3DProjOffset",
+                _texture(ir_tex, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler3D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::vec4_type,  
glsl_type::sampler3D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::ivec4_type, 
glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::uvec4_type, 
glsl_type::usampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                NULL);
+
+   add_function("shadow1DProjOffset",
+                _texture(ir_tex, gpu_shader4, glsl_type::float_type, 
glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT | 
TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::float_type, 
glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT | 
TEX_OFFSET),
+                NULL);
+
+   add_function("shadow2DProjOffset",
+                _texture(ir_tex, gpu_shader4, glsl_type::float_type, 
glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT | 
TEX_OFFSET),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::float_type, 
glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT | 
TEX_OFFSET),
+                NULL);
+
+   add_function("texture2DRectProjOffset",
+                _texture(ir_tex, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2DRect_type,  glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2DRect_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_tex, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                NULL);
+
+   add_function("shadow2DRectProjOffset",
+                _texture(ir_tex, gpu_shader4, glsl_type::float_type, 
glsl_type::sampler2DRectShadow_type, glsl_type::vec4_type, 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, 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, glsl_type::vec4_type,  
glsl_type::sampler3D_type,  glsl_type::vec3_type, TEX_OFFSET),
@@ -2308,20 +2580,62 @@ builtin_builder::create_builtins()
                 _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, 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, glsl_type::float_type, 
glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type, TEX_OFFSET),
                 NULL);
 
+   add_function("texture1DLodOffset",
+                _texture(ir_txl, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler1D_type,  glsl_type::float_type, TEX_OFFSET),
+                _texture(ir_txl, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler1D_type, glsl_type::float_type, TEX_OFFSET),
+                _texture(ir_txl, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler1D_type, glsl_type::float_type, TEX_OFFSET),
+                NULL);
+
+   add_function("texture2DLodOffset",
+                _texture(ir_txl, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2D_type,  glsl_type::vec2_type, TEX_OFFSET),
+                _texture(ir_txl, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET),
+                _texture(ir_txl, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET),
+                NULL);
+
+   add_function("texture3DLodOffset",
+                _texture(ir_txl, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler3D_type,  glsl_type::vec3_type, TEX_OFFSET),
+                _texture(ir_txl, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_OFFSET),
+                _texture(ir_txl, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_OFFSET),
+                NULL);
+
+   add_function("shadow1DLodOffset",
+                _texture(ir_txl, gpu_shader4, glsl_type::float_type, 
glsl_type::sampler1DShadow_type, glsl_type::vec3_type, TEX_OFFSET),
+                NULL);
+
+   add_function("shadow2DLodOffset",
+                _texture(ir_txl, gpu_shader4, glsl_type::float_type, 
glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_OFFSET),
+                NULL);
+
+   add_function("texture1DArrayLodOffset",
+                _texture(ir_txl, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler1DArray_type,  glsl_type::vec2_type, TEX_OFFSET),
+                _texture(ir_txl, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET),
+                _texture(ir_txl, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET),
+                NULL);
+
+   add_function("texture2DArrayLodOffset",
+                _texture(ir_txl, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2DArray_type,  glsl_type::vec3_type, TEX_OFFSET),
+                _texture(ir_txl, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET),
+                _texture(ir_txl, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET),
+                NULL);
+
+   add_function("shadow1DArrayLodOffset",
+                _texture(ir_txl, gpu_shader4, glsl_type::float_type, 
glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type, 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, 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),
@@ -2354,20 +2668,52 @@ builtin_builder::create_builtins()
                 _texture(ir_txl, v130, glsl_type::uvec4_type, 
glsl_type::usampler2D_type, glsl_type::vec4_type, 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, 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),
                 NULL);
 
+   add_function("texture1DProjLodOffset",
+                _texture(ir_txl, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler1D_type,  glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txl, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txl, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txl, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler1D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txl, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txl, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                NULL);
+
+   add_function("texture2DProjLodOffset",
+                _texture(ir_txl, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2D_type,  glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txl, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txl, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txl, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txl, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txl, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                NULL);
+
+   add_function("texture3DProjLodOffset",
+                _texture(ir_txl, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler3D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txl, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txl, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                NULL);
+
+   add_function("shadow1DProjLodOffset",
+                _texture(ir_txl, gpu_shader4, glsl_type::float_type, 
glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT | 
TEX_OFFSET),
+                NULL);
+
+   add_function("shadow2DProjLodOffset",
+                _texture(ir_txl, gpu_shader4, glsl_type::float_type, 
glsl_type::sampler2DShadow_type, glsl_type::vec4_type, 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, 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, glsl_type::vec4_type,  
glsl_type::sampler3D_type,  glsl_type::vec3_type),
@@ -2431,20 +2777,76 @@ builtin_builder::create_builtins()
                 _texture(ir_txd, v130, glsl_type::uvec4_type, 
glsl_type::usampler1DArray_type, glsl_type::vec2_type, 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, 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),
                 NULL);
 
+   add_function("texture1DGradOffset",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler1D_type,  glsl_type::float_type, TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler1D_type, glsl_type::float_type, TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler1D_type, glsl_type::float_type, TEX_OFFSET),
+                NULL);
+
+   add_function("texture2DGradOffset",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2D_type,  glsl_type::vec2_type, TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET),
+                NULL);
+
+   add_function("texture3DGradOffset",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler3D_type,  glsl_type::vec3_type, TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_OFFSET),
+                NULL);
+
+   add_function("texture2DRectGradOffset",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2DRect_type,  glsl_type::vec2_type, TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2DRect_type, glsl_type::vec2_type, TEX_OFFSET),
+                NULL);
+
+   add_function("shadow2DRectGradOffset",
+                _texture(ir_txd, gpu_shader4, glsl_type::float_type, 
glsl_type::sampler2DRectShadow_type, glsl_type::vec3_type, TEX_OFFSET),
+                NULL);
+
+   add_function("shadow1DGradOffset",
+                _texture(ir_txd, gpu_shader4, glsl_type::float_type, 
glsl_type::sampler1DShadow_type, glsl_type::vec3_type, TEX_OFFSET),
+                NULL);
+
+   add_function("shadow2DGradOffset",
+                _texture(ir_txd, gpu_shader4, glsl_type::float_type, 
glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_OFFSET),
+                NULL);
+
+   add_function("texture1DArrayGradOffset",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler1DArray_type,  glsl_type::vec2_type, TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET),
+                NULL);
+
+   add_function("texture2DArrayGradOffset",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2DArray_type,  glsl_type::vec3_type, TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET),
+                NULL);
+
+   add_function("shadow1DArrayGradOffset",
+                _texture(ir_txd, gpu_shader4, glsl_type::float_type, 
glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type, TEX_OFFSET),
+                NULL);
+
+   add_function("shadow2DArrayGradOffset",
+                _texture(ir_txd, gpu_shader4, glsl_type::float_type, 
glsl_type::sampler2DArrayShadow_type, glsl_type::vec4_type, 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, 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),
@@ -2495,20 +2897,65 @@ builtin_builder::create_builtins()
                 _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, glsl_type::float_type, 
glsl_type::sampler2DRectShadow_type, glsl_type::vec4_type, 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),
                 NULL);
 
+   add_function("texture1DProjGradOffset",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler1D_type,  glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler1D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler1D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                NULL);
+
+   add_function("texture2DProjGradOffset",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2D_type,  glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                NULL);
+
+   add_function("texture3DProjGradOffset",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler3D_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler3D_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                NULL);
+
+   add_function("texture2DRectProjGradOffset",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2DRect_type,  glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2DRect_type,  glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT | TEX_OFFSET),
+                NULL);
+
+   add_function("shadow2DRectProjGradOffset",
+                _texture(ir_txd, gpu_shader4, glsl_type::float_type, 
glsl_type::sampler2DRectShadow_type, glsl_type::vec4_type, TEX_PROJECT | 
TEX_OFFSET),
+                NULL);
+
+   add_function("shadow1DProjGradOffset",
+                _texture(ir_txd, gpu_shader4, glsl_type::float_type, 
glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT | 
TEX_OFFSET),
+                NULL);
+
+   add_function("shadow2DProjGradOffset",
+                _texture(ir_txd, gpu_shader4, glsl_type::float_type, 
glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT | 
TEX_OFFSET),
+                NULL);
+
    add_function("EmitVertex",   _EmitVertex(),   NULL);
    add_function("EndPrimitive", _EndPrimitive(), NULL);
    add_function("EmitStreamVertex",
                 _EmitStreamVertex(gs_streams, glsl_type::uint_type),
                 _EmitStreamVertex(gs_streams, glsl_type::int_type),
                 NULL);
    add_function("EndStreamPrimitive",
                 _EndStreamPrimitive(gs_streams, glsl_type::uint_type),
                 _EndStreamPrimitive(gs_streams, glsl_type::int_type),
                 NULL);
@@ -2627,114 +3074,186 @@ builtin_builder::create_builtins()
                 _textureSamplesIdentical(texture_samples_identical, 
glsl_type::usampler2DMS_type, glsl_type::ivec2_type),
 
                 _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),
                 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, gpu_shader4,         glsl_type::ivec4_type,  
glsl_type::isampler1D_type, glsl_type::float_type),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::ivec4_type,  
glsl_type::isampler1D_type, glsl_type::float_type),
+                _texture(ir_tex, gpu_shader4,         glsl_type::uvec4_type,  
glsl_type::usampler1D_type, glsl_type::float_type),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::uvec4_type,  
glsl_type::usampler1D_type, glsl_type::float_type),
                 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, gpu_shader4,         glsl_type::ivec4_type, 
glsl_type::isampler1DArray_type, glsl_type::vec2_type),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::ivec4_type, 
glsl_type::isampler1DArray_type, glsl_type::vec2_type),
+                _texture(ir_tex, gpu_shader4,         glsl_type::uvec4_type, 
glsl_type::usampler1DArray_type, glsl_type::vec2_type),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::uvec4_type, 
glsl_type::usampler1DArray_type, glsl_type::vec2_type),
                 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, gpu_shader4,         glsl_type::ivec4_type,  
glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT),
+                _texture(ir_tex, gpu_shader4,         glsl_type::ivec4_type,  
glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::ivec4_type,  
glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::ivec4_type,  
glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT),
+                _texture(ir_tex, gpu_shader4,         glsl_type::uvec4_type,  
glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT),
+                _texture(ir_tex, gpu_shader4,         glsl_type::uvec4_type,  
glsl_type::usampler1D_type, glsl_type::vec4_type, TEX_PROJECT),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::uvec4_type,  
glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::uvec4_type,  
glsl_type::usampler1D_type, glsl_type::vec4_type, 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, gpu_shader4, glsl_type::ivec4_type,  
glsl_type::isampler1D_type, glsl_type::float_type),
+                _texture(ir_txl, gpu_shader4, glsl_type::uvec4_type,  
glsl_type::usampler1D_type, glsl_type::float_type),
                 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, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler1DArray_type, glsl_type::vec2_type),
+                _texture(ir_txl, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler1DArray_type, glsl_type::vec2_type),
                 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, gpu_shader4, glsl_type::ivec4_type,  
glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT),
+                _texture(ir_txl, gpu_shader4, glsl_type::ivec4_type,  
glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT),
+                _texture(ir_txl, gpu_shader4, glsl_type::uvec4_type,  
glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT),
+                _texture(ir_txl, gpu_shader4, glsl_type::uvec4_type,  
glsl_type::usampler1D_type, glsl_type::vec4_type, 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, gpu_shader4,         glsl_type::ivec4_type,  
glsl_type::isampler2D_type, glsl_type::vec2_type),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::ivec4_type,  
glsl_type::isampler2D_type, glsl_type::vec2_type),
+                _texture(ir_tex, gpu_shader4,         glsl_type::uvec4_type,  
glsl_type::usampler2D_type, glsl_type::vec2_type),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::uvec4_type,  
glsl_type::usampler2D_type, glsl_type::vec2_type),
                 _texture(ir_tex, texture_external, glsl_type::vec4_type,  
glsl_type::samplerExternalOES_type, glsl_type::vec2_type),
                 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, gpu_shader4,         glsl_type::ivec4_type, 
glsl_type::isampler2DArray_type, glsl_type::vec3_type),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::ivec4_type, 
glsl_type::isampler2DArray_type, glsl_type::vec3_type),
+                _texture(ir_tex, gpu_shader4,         glsl_type::uvec4_type, 
glsl_type::usampler2DArray_type, glsl_type::vec3_type),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::uvec4_type, 
glsl_type::usampler2DArray_type, glsl_type::vec3_type),
                 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, gpu_shader4,         glsl_type::ivec4_type,  
glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT),
+                _texture(ir_tex, gpu_shader4,         glsl_type::ivec4_type,  
glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::ivec4_type,  
glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::ivec4_type,  
glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT),
+                _texture(ir_tex, gpu_shader4,         glsl_type::uvec4_type,  
glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT),
+                _texture(ir_tex, gpu_shader4,         glsl_type::uvec4_type,  
glsl_type::usampler2D_type, glsl_type::vec4_type, TEX_PROJECT),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::uvec4_type,  
glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::uvec4_type,  
glsl_type::usampler2D_type, glsl_type::vec4_type, 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, gpu_shader4, glsl_type::ivec4_type,  
glsl_type::isampler2D_type, glsl_type::vec2_type),
+                _texture(ir_txl, gpu_shader4, glsl_type::uvec4_type,  
glsl_type::usampler2D_type, glsl_type::vec2_type),
                 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, gpu_shader4, glsl_type::ivec4_type, 
glsl_type::isampler2DArray_type, glsl_type::vec3_type),
+                _texture(ir_txl, gpu_shader4, glsl_type::uvec4_type, 
glsl_type::usampler2DArray_type, glsl_type::vec3_type),
                 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, gpu_shader4, glsl_type::ivec4_type,  
glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT),
+                _texture(ir_txl, gpu_shader4, glsl_type::ivec4_type,  
glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT),
+                _texture(ir_txl, gpu_shader4, glsl_type::uvec4_type,  
glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT),
+                _texture(ir_txl, gpu_shader4, glsl_type::uvec4_type,  
glsl_type::usampler2D_type, glsl_type::vec4_type, 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, gpu_shader4,         glsl_type::ivec4_type, 
glsl_type::isampler3D_type, glsl_type::vec3_type),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::ivec4_type, 
glsl_type::isampler3D_type, glsl_type::vec3_type),
+                _texture(ir_tex, gpu_shader4,         glsl_type::uvec4_type, 
glsl_type::usampler3D_type, glsl_type::vec3_type),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::uvec4_type, 
glsl_type::usampler3D_type, glsl_type::vec3_type),
                 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, gpu_shader4,         glsl_type::ivec4_type, 
glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::ivec4_type, 
glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT),
+                _texture(ir_tex, gpu_shader4,         glsl_type::uvec4_type, 
glsl_type::usampler3D_type, glsl_type::vec4_type, TEX_PROJECT),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::uvec4_type, 
glsl_type::usampler3D_type, glsl_type::vec4_type, 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, gpu_shader4, glsl_type::ivec4_type,  
glsl_type::isampler3D_type, glsl_type::vec3_type),
+                _texture(ir_txl, gpu_shader4, glsl_type::uvec4_type,  
glsl_type::usampler3D_type, glsl_type::vec3_type),
                 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, gpu_shader4, glsl_type::ivec4_type,  
glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT),
+                _texture(ir_txl, gpu_shader4, glsl_type::uvec4_type,  
glsl_type::usampler3D_type, glsl_type::vec4_type, 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, gpu_shader4,         glsl_type::ivec4_type,  
glsl_type::isamplerCube_type, glsl_type::vec3_type),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::ivec4_type,  
glsl_type::isamplerCube_type, glsl_type::vec3_type),
+                _texture(ir_tex, gpu_shader4,         glsl_type::uvec4_type,  
glsl_type::usamplerCube_type, glsl_type::vec3_type),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::uvec4_type,  
glsl_type::usamplerCube_type, glsl_type::vec3_type),
                 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, gpu_shader4, glsl_type::ivec4_type,  
glsl_type::isamplerCube_type, glsl_type::vec3_type),
+                _texture(ir_txl, gpu_shader4, glsl_type::uvec4_type,  
glsl_type::usamplerCube_type, glsl_type::vec3_type),
                 NULL);
 
    add_function("texture2DRect",
                 _texture(ir_tex, texture_rectangle, glsl_type::vec4_type,  
glsl_type::sampler2DRect_type, glsl_type::vec2_type),
+                _texture(ir_tex, gpu_shader4, glsl_type::ivec4_type,  
glsl_type::isampler2DRect_type, glsl_type::vec2_type),
+                _texture(ir_tex, gpu_shader4, glsl_type::uvec4_type,  
glsl_type::usampler2DRect_type, glsl_type::vec2_type),
                 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, gpu_shader4, glsl_type::ivec4_type,  
glsl_type::isampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT),
+                _texture(ir_tex, gpu_shader4, glsl_type::ivec4_type,  
glsl_type::isampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT),
+                _texture(ir_tex, gpu_shader4, glsl_type::uvec4_type,  
glsl_type::usampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT),
+                _texture(ir_tex, gpu_shader4, glsl_type::uvec4_type,  
glsl_type::usampler2DRect_type, glsl_type::vec4_type, 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),
                 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),
@@ -2748,20 +3267,30 @@ builtin_builder::create_builtins()
    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),
                 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),
                 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),
+                NULL);
+
+   add_function("shadowCube",
+                _texture(ir_tex, gpu_shader4,         glsl_type::vec4_type, 
glsl_type::samplerCubeShadow_type, glsl_type::vec4_type),
+                _texture(ir_txb, gpu_shader4_fs_only, glsl_type::vec4_type, 
glsl_type::samplerCubeShadow_type, glsl_type::vec4_type),
+                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),
                 NULL);
 
    add_function("shadow1DLod",
                 _texture(ir_txl, v110_lod, glsl_type::vec4_type,  
glsl_type::sampler1DShadow_type, glsl_type::vec3_type),
                 NULL);
 
    add_function("shadow2DLod",
@@ -2844,20 +3373,125 @@ builtin_builder::create_builtins()
                 NULL);
 
    add_function("shadow2DRectGradARB",
                 _texture(ir_txd, shader_texture_lod_and_rect, 
glsl_type::vec4_type,  glsl_type::sampler2DRectShadow_type, 
glsl_type::vec3_type),
                 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),
                 NULL);
 
+   add_function("texture1DGrad",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler1D_type, glsl_type::float_type),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type,  
glsl_type::isampler1D_type, glsl_type::float_type),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type,  
glsl_type::usampler1D_type, glsl_type::float_type),
+                NULL);
+
+   add_function("texture1DProjGrad",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler1D_type, glsl_type::vec2_type, TEX_PROJECT),
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler1D_type, glsl_type::vec4_type, TEX_PROJECT),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type,  
glsl_type::isampler1D_type, glsl_type::vec2_type, TEX_PROJECT),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type,  
glsl_type::isampler1D_type, glsl_type::vec4_type, TEX_PROJECT),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type,  
glsl_type::usampler1D_type, glsl_type::vec2_type, TEX_PROJECT),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type,  
glsl_type::usampler1D_type, glsl_type::vec4_type, TEX_PROJECT),
+                NULL);
+
+   add_function("texture1DArrayGrad",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler1DArray_type, glsl_type::vec2_type),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type,  
glsl_type::isampler1DArray_type, glsl_type::vec2_type),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type,  
glsl_type::usampler1DArray_type, glsl_type::vec2_type),
+                NULL);
+
+   add_function("texture2DGrad",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2D_type, glsl_type::vec2_type),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type,  
glsl_type::isampler2D_type, glsl_type::vec2_type),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type,  
glsl_type::usampler2D_type, glsl_type::vec2_type),
+                NULL);
+
+   add_function("texture2DProjGrad",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2D_type, glsl_type::vec3_type, TEX_PROJECT),
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2D_type, glsl_type::vec4_type, TEX_PROJECT),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type,  
glsl_type::isampler2D_type, glsl_type::vec3_type, TEX_PROJECT),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type,  
glsl_type::isampler2D_type, glsl_type::vec4_type, TEX_PROJECT),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type,  
glsl_type::usampler2D_type, glsl_type::vec3_type, TEX_PROJECT),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type,  
glsl_type::usampler2D_type, glsl_type::vec4_type, TEX_PROJECT),
+                NULL);
+
+   add_function("texture2DArrayGrad",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2DArray_type, glsl_type::vec3_type),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type,  
glsl_type::isampler2DArray_type, glsl_type::vec3_type),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type,  
glsl_type::usampler2DArray_type, glsl_type::vec3_type),
+                NULL);
+
+   add_function("texture3DGrad",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler3D_type, glsl_type::vec3_type),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type,  
glsl_type::isampler3D_type, glsl_type::vec3_type),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type,  
glsl_type::usampler3D_type, glsl_type::vec3_type),
+                NULL);
+
+   add_function("texture3DProjGrad",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler3D_type, glsl_type::vec4_type, TEX_PROJECT),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type,  
glsl_type::isampler3D_type, glsl_type::vec4_type, TEX_PROJECT),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type,  
glsl_type::usampler3D_type, glsl_type::vec4_type, TEX_PROJECT),
+                NULL);
+
+   add_function("textureCubeGrad",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::samplerCube_type, glsl_type::vec3_type),
+                _texture(ir_txd, gpu_shader4, glsl_type::ivec4_type,  
glsl_type::isamplerCube_type, glsl_type::vec3_type),
+                _texture(ir_txd, gpu_shader4, glsl_type::uvec4_type,  
glsl_type::usamplerCube_type, glsl_type::vec3_type),
+                NULL);
+
+   add_function("shadow1DGrad",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler1DShadow_type, glsl_type::vec3_type),
+                NULL);
+
+   add_function("shadow1DProjGrad",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler1DShadow_type, glsl_type::vec4_type, TEX_PROJECT),
+                NULL);
+
+   add_function("shadow1DArrayGrad",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type),
+                NULL);
+
+   add_function("shadow2DGrad",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2DShadow_type, glsl_type::vec3_type),
+                NULL);
+
+   add_function("shadow2DProjGrad",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2DShadow_type, glsl_type::vec4_type, TEX_PROJECT),
+                NULL);
+
+   add_function("shadow2DArrayGrad",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2DArrayShadow_type, glsl_type::vec4_type),
+                NULL);
+
+   add_function("texture2DRectGrad",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2DRect_type, glsl_type::vec2_type),
+                NULL);
+
+   add_function("texture2DRectProjGrad",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT),
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT),
+                NULL);
+
+   add_function("shadow2DRectGrad",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2DRectShadow_type, glsl_type::vec3_type),
+                NULL);
+
+   add_function("shadow2DRectProjGrad",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::sampler2DRectShadow_type, glsl_type::vec4_type, TEX_PROJECT),
+                NULL);
+
+   add_function("shadowCubeGrad",
+                _texture(ir_txd, gpu_shader4, glsl_type::vec4_type,  
glsl_type::samplerCubeShadow_type, glsl_type::vec4_type),
+                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, 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, texture_gather_or_es31, glsl_type::vec4_type, 
glsl_type::sampler2DArray_type, glsl_type::vec3_type),
-- 
2.17.1

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to