aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/builtin_functions.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-10-03 13:53:39 +0200
committermarha <marha@users.sourceforge.net>2013-10-03 13:53:39 +0200
commit7d29f4054380e7f42722c280b9caedce9fa4ace9 (patch)
tree4b8d3a482e5905f6efb32f5843f1c6fc75d4fe19 /mesalib/src/glsl/builtin_functions.cpp
parentc3594c6c050a987fb891a1c7cf0c83102fbbec46 (diff)
parent5593a3d2f370e3e12a043110bf2e395c938980d6 (diff)
downloadvcxsrv-7d29f4054380e7f42722c280b9caedce9fa4ace9.tar.gz
vcxsrv-7d29f4054380e7f42722c280b9caedce9fa4ace9.tar.bz2
vcxsrv-7d29f4054380e7f42722c280b9caedce9fa4ace9.zip
Merge remote-tracking branch 'origin/released'
* origin/released: mesa xkeyboard-config git update 3 Oct 2003 Conflicts: xorg-server/xkeyboard-config/symbols/level3 xorg-server/xkeyboard-config/symbols/level5
Diffstat (limited to 'mesalib/src/glsl/builtin_functions.cpp')
-rw-r--r--mesalib/src/glsl/builtin_functions.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/mesalib/src/glsl/builtin_functions.cpp b/mesalib/src/glsl/builtin_functions.cpp
index 72054e0fe..df735ef31 100644
--- a/mesalib/src/glsl/builtin_functions.cpp
+++ b/mesalib/src/glsl/builtin_functions.cpp
@@ -262,6 +262,13 @@ texture_query_lod(const _mesa_glsl_parse_state *state)
state->ARB_texture_query_lod_enable;
}
+static bool
+texture_gather(const _mesa_glsl_parse_state *state)
+{
+ return state->is_version(400, 0) ||
+ state->ARB_texture_gather_enable;
+}
+
/* Desktop GL or OES_standard_derivatives + fragment shader only */
static bool
fs_oes_derivatives(const _mesa_glsl_parse_state *state)
@@ -1816,6 +1823,34 @@ builtin_builder::create_builtins()
_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("textureGather",
+ _texture(ir_tg4, texture_gather, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type),
+ _texture(ir_tg4, texture_gather, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type),
+ _texture(ir_tg4, texture_gather, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type),
+
+ _texture(ir_tg4, texture_gather, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type),
+ _texture(ir_tg4, texture_gather, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type),
+ _texture(ir_tg4, texture_gather, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type),
+
+ _texture(ir_tg4, texture_gather, glsl_type::vec4_type, glsl_type::samplerCube_type, glsl_type::vec3_type),
+ _texture(ir_tg4, texture_gather, glsl_type::ivec4_type, glsl_type::isamplerCube_type, glsl_type::vec3_type),
+ _texture(ir_tg4, texture_gather, glsl_type::uvec4_type, glsl_type::usamplerCube_type, glsl_type::vec3_type),
+
+ _texture(ir_tg4, texture_gather, glsl_type::vec4_type, glsl_type::samplerCubeArray_type, glsl_type::vec4_type),
+ _texture(ir_tg4, texture_gather, glsl_type::ivec4_type, glsl_type::isamplerCubeArray_type, glsl_type::vec4_type),
+ _texture(ir_tg4, texture_gather, glsl_type::uvec4_type, glsl_type::usamplerCubeArray_type, glsl_type::vec4_type),
+ NULL);
+
+ add_function("textureGatherOffset",
+ _texture(ir_tg4, texture_gather, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET),
+ _texture(ir_tg4, texture_gather, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type, TEX_OFFSET),
+ _texture(ir_tg4, texture_gather, glsl_type::uvec4_type, glsl_type::usampler2D_type, glsl_type::vec2_type, TEX_OFFSET),
+
+ _texture(ir_tg4, texture_gather, glsl_type::vec4_type, glsl_type::sampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET),
+ _texture(ir_tg4, texture_gather, glsl_type::ivec4_type, glsl_type::isampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET),
+ _texture(ir_tg4, texture_gather, glsl_type::uvec4_type, glsl_type::usampler2DArray_type, glsl_type::vec3_type, TEX_OFFSET),
+ NULL);
+
F(dFdx)
F(dFdy)
F(fwidth)