From 10a71c610656826ad4179b34cb64cac05dd6b7d7 Mon Sep 17 00:00:00 2001 From: Qiang Yu Date: Thu, 6 Jan 2022 17:24:00 +0800 Subject: [PATCH] glsl: add ARB_sparse_texture_clamp builtin functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Signed-off-by: Qiang Yu Part-of: --- src/compiler/glsl/builtin_functions.cpp | 340 ++++++++++++++++++++++++++++++++ 1 file changed, 340 insertions(+) diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp index 8b6447d..d41516a 100644 --- a/src/compiler/glsl/builtin_functions.cpp +++ b/src/compiler/glsl/builtin_functions.cpp @@ -949,6 +949,30 @@ shader_image_load_store_and_sparse(const _mesa_glsl_parse_state *state) state->ARB_sparse_texture2_enable; } +static bool +v130_desktop_and_clamp(const _mesa_glsl_parse_state *state) +{ + return v130_desktop(state) && state->ARB_sparse_texture_clamp_enable; +} + +static bool +texture_cube_map_array_and_clamp(const _mesa_glsl_parse_state *state) +{ + return texture_cube_map_array(state) && state->ARB_sparse_texture_clamp_enable; +} + +static bool +v130_derivatives_only_and_clamp(const _mesa_glsl_parse_state *state) +{ + return v130_derivatives_only(state) && state->ARB_sparse_texture_clamp_enable; +} + +static bool +derivatives_texture_cube_map_array_and_clamp(const _mesa_glsl_parse_state *state) +{ + return derivatives_texture_cube_map_array(state) && state->ARB_sparse_texture_clamp_enable; +} + /** @} */ /******************************************************************************/ @@ -4379,6 +4403,322 @@ builtin_builder::create_builtins() add_function("sparseTexelsResidentARB", _is_sparse_texels_resident(), NULL); + add_function("sparseTextureClampARB", + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_SPARSE|TEX_CLAMP), + + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isamplerCube_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usamplerCube_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::samplerCubeShadow_type, glsl_type::vec4_type, TEX_SPARSE|TEX_CLAMP), + + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + + _texture(ir_tex, texture_cube_map_array_and_clamp, glsl_type::vec4_type, glsl_type::samplerCubeArray_type, glsl_type::vec4_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_tex, texture_cube_map_array_and_clamp, glsl_type::ivec4_type, glsl_type::isamplerCubeArray_type, glsl_type::vec4_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_tex, texture_cube_map_array_and_clamp, glsl_type::uvec4_type, glsl_type::usamplerCubeArray_type, glsl_type::vec4_type, TEX_SPARSE|TEX_CLAMP), + + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec4_type, TEX_SPARSE|TEX_CLAMP), + + _textureCubeArrayShadow(ir_tex, texture_cube_map_array_and_clamp, glsl_type::samplerCubeArrayShadow_type, TEX_SPARSE|TEX_CLAMP), + + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_SPARSE|TEX_CLAMP), + + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::ivec4_type, glsl_type::isamplerCube_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::uvec4_type, glsl_type::usamplerCube_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::float_type, glsl_type::samplerCubeShadow_type, glsl_type::vec4_type, TEX_SPARSE|TEX_CLAMP), + + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + + _texture(ir_txb, derivatives_texture_cube_map_array_and_clamp, glsl_type::vec4_type, glsl_type::samplerCubeArray_type, glsl_type::vec4_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_txb, derivatives_texture_cube_map_array_and_clamp, glsl_type::ivec4_type, glsl_type::isamplerCubeArray_type, glsl_type::vec4_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_txb, derivatives_texture_cube_map_array_and_clamp, glsl_type::uvec4_type, glsl_type::usamplerCubeArray_type, glsl_type::vec4_type, TEX_SPARSE|TEX_CLAMP), + NULL); + + add_function("textureClampARB", + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::float_type, TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::float_type, TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::float_type, TEX_CLAMP), + + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_CLAMP), + + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_CLAMP), + + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isamplerCube_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usamplerCube_type, glsl_type::vec3_type, TEX_CLAMP), + + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::samplerCubeShadow_type, glsl_type::vec4_type, TEX_CLAMP), + + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler1DArray_type, glsl_type::vec2_type, TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::vec2_type, TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::vec2_type, TEX_CLAMP), + + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_CLAMP), + + _texture(ir_tex, texture_cube_map_array_and_clamp, glsl_type::vec4_type, glsl_type::samplerCubeArray_type, glsl_type::vec4_type, TEX_CLAMP), + _texture(ir_tex, texture_cube_map_array_and_clamp, glsl_type::ivec4_type, glsl_type::isamplerCubeArray_type, glsl_type::vec4_type, TEX_CLAMP), + _texture(ir_tex, texture_cube_map_array_and_clamp, glsl_type::uvec4_type, glsl_type::usamplerCubeArray_type, glsl_type::vec4_type, TEX_CLAMP), + + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec4_type, TEX_CLAMP), + + _textureCubeArrayShadow(ir_tex, texture_cube_map_array_and_clamp, glsl_type::samplerCubeArrayShadow_type, TEX_CLAMP), + + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::float_type, TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::float_type, TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::float_type, TEX_CLAMP), + + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_CLAMP), + + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_CLAMP), + + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::ivec4_type, glsl_type::isamplerCube_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::uvec4_type, glsl_type::usamplerCube_type, glsl_type::vec3_type, TEX_CLAMP), + + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::float_type, glsl_type::samplerCubeShadow_type, glsl_type::vec4_type, TEX_CLAMP), + + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::vec4_type, glsl_type::sampler1DArray_type, glsl_type::vec2_type, TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::vec2_type, TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::vec2_type, TEX_CLAMP), + + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_CLAMP), + + _texture(ir_txb, derivatives_texture_cube_map_array_and_clamp, glsl_type::vec4_type, glsl_type::samplerCubeArray_type, glsl_type::vec4_type, TEX_CLAMP), + _texture(ir_txb, derivatives_texture_cube_map_array_and_clamp, glsl_type::ivec4_type, glsl_type::isamplerCubeArray_type, glsl_type::vec4_type, TEX_CLAMP), + _texture(ir_txb, derivatives_texture_cube_map_array_and_clamp, glsl_type::uvec4_type, glsl_type::usamplerCubeArray_type, glsl_type::vec4_type, TEX_CLAMP), + + _texture(ir_txb, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type, TEX_CLAMP), + NULL); + + add_function("sparseTextureOffsetClampARB", + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec4_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + NULL); + + add_function("textureOffsetClampARB", + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::float_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::float_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::float_type, TEX_OFFSET|TEX_CLAMP), + + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET|TEX_CLAMP), + + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET|TEX_CLAMP), + + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_tex, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec4_type, TEX_OFFSET|TEX_CLAMP), + + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::float_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::float_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::float_type, TEX_OFFSET|TEX_CLAMP), + + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET|TEX_CLAMP), + + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_txb, v130_derivatives_only_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + + _texture(ir_txb, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + NULL); + + add_function("sparseTextureGradClampARB", + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_SPARSE|TEX_CLAMP), + + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isamplerCube_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usamplerCube_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::samplerCubeShadow_type, glsl_type::vec4_type, TEX_SPARSE|TEX_CLAMP), + + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_SPARSE|TEX_CLAMP), + + _texture(ir_txd, texture_cube_map_array_and_clamp, glsl_type::vec4_type, glsl_type::samplerCubeArray_type, glsl_type::vec4_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_txd, texture_cube_map_array_and_clamp, glsl_type::ivec4_type, glsl_type::isamplerCubeArray_type, glsl_type::vec4_type, TEX_SPARSE|TEX_CLAMP), + _texture(ir_txd, texture_cube_map_array_and_clamp, glsl_type::uvec4_type, glsl_type::usamplerCubeArray_type, glsl_type::vec4_type, TEX_SPARSE|TEX_CLAMP), + + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec4_type, TEX_SPARSE|TEX_CLAMP), + NULL); + + add_function("textureGradClampARB", + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::float_type, TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::float_type, TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::float_type, TEX_CLAMP), + + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_CLAMP), + + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_CLAMP), + + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isamplerCube_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usamplerCube_type, glsl_type::vec3_type, TEX_CLAMP), + + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::samplerCubeShadow_type, glsl_type::vec4_type, TEX_CLAMP), + + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler1DArray_type, glsl_type::vec2_type, TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::vec2_type, TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::vec2_type, TEX_CLAMP), + + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_CLAMP), + + _texture(ir_txd, texture_cube_map_array_and_clamp, glsl_type::vec4_type, glsl_type::samplerCubeArray_type, glsl_type::vec4_type, TEX_CLAMP), + _texture(ir_txd, texture_cube_map_array_and_clamp, glsl_type::ivec4_type, glsl_type::isamplerCubeArray_type, glsl_type::vec4_type, TEX_CLAMP), + _texture(ir_txd, texture_cube_map_array_and_clamp, glsl_type::uvec4_type, glsl_type::usamplerCubeArray_type, glsl_type::vec4_type, TEX_CLAMP), + + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type, TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec4_type, TEX_CLAMP), + NULL); + + add_function("sparseTextureGradOffsetClampARB", + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec4_type, TEX_OFFSET|TEX_SPARSE|TEX_CLAMP), + NULL); + + add_function("textureGradOffsetClampARB", + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::float_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::float_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::float_type, TEX_OFFSET|TEX_CLAMP), + + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET|TEX_CLAMP), + + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler3D_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler3D_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler3D_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler1DShadow_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler2DShadow_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler1DArray_type, glsl_type::vec2_type, TEX_OFFSET|TEX_CLAMP), + + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler1DArrayShadow_type, glsl_type::vec3_type, TEX_OFFSET|TEX_CLAMP), + _texture(ir_txd, v130_desktop_and_clamp, glsl_type::float_type, glsl_type::sampler2DArrayShadow_type, glsl_type::vec4_type, TEX_OFFSET|TEX_CLAMP), + NULL); + F(dFdx) F(dFdy) F(fwidth) -- 2.7.4