aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/builtin_functions.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-03-21 22:50:26 +0100
committermarha <marha@users.sourceforge.net>2014-03-21 22:56:24 +0100
commiteb71c0f23999d1cc156e1821d73634ec79621fc2 (patch)
treed45d551ada10b1bfb3d57517c892770734a77817 /mesalib/src/glsl/builtin_functions.cpp
parentab3d257d88f67e169a314ad0fac851fc2fc6cb05 (diff)
parent41fea4472dec859ddec76bdfa7108ebec71de1e3 (diff)
downloadvcxsrv-eb71c0f23999d1cc156e1821d73634ec79621fc2.tar.gz
vcxsrv-eb71c0f23999d1cc156e1821d73634ec79621fc2.tar.bz2
vcxsrv-eb71c0f23999d1cc156e1821d73634ec79621fc2.zip
Merge remote-tracking branch 'origin/released'
* origin/released: xserver fontconfig libX11 libXext libxcb mesa git update 21 Mar 2014 Conflicts: libxcb/src/xcb_auth.c libxcb/src/xcb_conn.c libxcb/src/xcb_util.c libxcb/src/xcb_windefs.h mesalib/src/mapi/glapi/glapi.h
Diffstat (limited to 'mesalib/src/glsl/builtin_functions.cpp')
-rwxr-xr-xmesalib/src/glsl/builtin_functions.cpp42
1 files changed, 25 insertions, 17 deletions
diff --git a/mesalib/src/glsl/builtin_functions.cpp b/mesalib/src/glsl/builtin_functions.cpp
index c4f39abb7..43746f055 100755
--- a/mesalib/src/glsl/builtin_functions.cpp
+++ b/mesalib/src/glsl/builtin_functions.cpp
@@ -194,16 +194,17 @@ shader_integer_mix(const _mesa_glsl_parse_state *state)
}
static bool
-shader_packing(const _mesa_glsl_parse_state *state)
+shader_packing_or_es3(const _mesa_glsl_parse_state *state)
{
return state->ARB_shading_language_packing_enable ||
- state->is_version(400, 0);
+ state->is_version(400, 300);
}
static bool
-shader_packing_or_es3(const _mesa_glsl_parse_state *state)
+shader_packing_or_es3_or_gpu_shader5(const _mesa_glsl_parse_state *state)
{
return state->ARB_shading_language_packing_enable ||
+ state->ARB_gpu_shader5_enable ||
state->is_version(400, 300);
}
@@ -214,6 +215,13 @@ gpu_shader5(const _mesa_glsl_parse_state *state)
}
static bool
+shader_packing_or_gpu_shader5(const _mesa_glsl_parse_state *state)
+{
+ return state->ARB_shading_language_packing_enable ||
+ gpu_shader5(state);
+}
+
+static bool
texture_array_lod(const _mesa_glsl_parse_state *state)
{
return lod_exists_in_stage(state) &&
@@ -991,16 +999,16 @@ builtin_builder::create_builtins()
_uintBitsToFloat(glsl_type::uvec4_type),
NULL);
- add_function("packUnorm2x16", _packUnorm2x16(shader_packing_or_es3), NULL);
- add_function("packSnorm2x16", _packSnorm2x16(shader_packing_or_es3), NULL);
- add_function("packUnorm4x8", _packUnorm4x8(shader_packing), NULL);
- add_function("packSnorm4x8", _packSnorm4x8(shader_packing), NULL);
- add_function("unpackUnorm2x16", _unpackUnorm2x16(shader_packing_or_es3), NULL);
- add_function("unpackSnorm2x16", _unpackSnorm2x16(shader_packing_or_es3), NULL);
- add_function("unpackUnorm4x8", _unpackUnorm4x8(shader_packing), NULL);
- add_function("unpackSnorm4x8", _unpackSnorm4x8(shader_packing), NULL);
- add_function("packHalf2x16", _packHalf2x16(shader_packing_or_es3), NULL);
- add_function("unpackHalf2x16", _unpackHalf2x16(shader_packing_or_es3), NULL);
+ add_function("packUnorm2x16", _packUnorm2x16(shader_packing_or_es3_or_gpu_shader5), NULL);
+ add_function("packSnorm2x16", _packSnorm2x16(shader_packing_or_es3), NULL);
+ add_function("packUnorm4x8", _packUnorm4x8(shader_packing_or_gpu_shader5), NULL);
+ add_function("packSnorm4x8", _packSnorm4x8(shader_packing_or_gpu_shader5), NULL);
+ add_function("unpackUnorm2x16", _unpackUnorm2x16(shader_packing_or_es3_or_gpu_shader5), NULL);
+ add_function("unpackSnorm2x16", _unpackSnorm2x16(shader_packing_or_es3), NULL);
+ add_function("unpackUnorm4x8", _unpackUnorm4x8(shader_packing_or_gpu_shader5), NULL);
+ add_function("unpackSnorm4x8", _unpackSnorm4x8(shader_packing_or_gpu_shader5), NULL);
+ add_function("packHalf2x16", _packHalf2x16(shader_packing_or_es3), NULL);
+ add_function("unpackHalf2x16", _unpackHalf2x16(shader_packing_or_es3), NULL);
F(length)
F(distance)
@@ -3041,7 +3049,7 @@ builtin_builder::_length(const glsl_type *type)
ir_variable *x = in_var(type, "x");
MAKE_SIG(glsl_type::float_type, always_available, 1, x);
- body.emit(ret(sqrt(dotlike(x, x))));
+ body.emit(ret(sqrt(dot(x, x))));
return sig;
}
@@ -3131,7 +3139,7 @@ builtin_builder::_faceforward(const glsl_type *type)
ir_variable *Nref = in_var(type, "Nref");
MAKE_SIG(type, always_available, 3, N, I, Nref);
- body.emit(if_tree(less(dotlike(Nref, I), imm(0.0f)),
+ body.emit(if_tree(less(dot(Nref, I), imm(0.0f)),
ret(N), ret(neg(N))));
return sig;
@@ -3145,7 +3153,7 @@ builtin_builder::_reflect(const glsl_type *type)
MAKE_SIG(type, always_available, 2, I, N);
/* I - 2 * dot(N, I) * N */
- body.emit(ret(sub(I, mul(imm(2.0f), mul(dotlike(N, I), N)))));
+ body.emit(ret(sub(I, mul(imm(2.0f), mul(dot(N, I), N)))));
return sig;
}
@@ -3159,7 +3167,7 @@ builtin_builder::_refract(const glsl_type *type)
MAKE_SIG(type, always_available, 3, I, N, eta);
ir_variable *n_dot_i = body.make_temp(glsl_type::float_type, "n_dot_i");
- body.emit(assign(n_dot_i, dotlike(N, I)));
+ body.emit(assign(n_dot_i, dot(N, I)));
/* From the GLSL 1.10 specification:
* k = 1.0 - eta * eta * (1.0 - dot(N, I) * dot(N, I))