aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/builtin_functions.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-08-22 21:55:11 +0200
committermarha <marha@users.sourceforge.net>2014-08-22 21:55:11 +0200
commit6c0c95d6045d2d2b4e6a3a2f11457850031c57bc (patch)
tree32dfc45d688fa198bf0d41597e82589890012cf1 /mesalib/src/glsl/builtin_functions.cpp
parentfdbedba4d50e1b28b0249c83ba11c029f096e400 (diff)
downloadvcxsrv-6c0c95d6045d2d2b4e6a3a2f11457850031c57bc.tar.gz
vcxsrv-6c0c95d6045d2d2b4e6a3a2f11457850031c57bc.tar.bz2
vcxsrv-6c0c95d6045d2d2b4e6a3a2f11457850031c57bc.zip
fontconfig libxcb/xcb-proto mesa xkeyboard-config git update 22 Aug 2014
libxcb/xcb-proto commit 8e3db42d67a0035bb16d16da28bd5eea7a269178 xkeyboard-config commit 10fce2c2baae471795d069f3a5f1307eedb9ff0a fontconfig commit 286cdc9c10b0453c25950103b6a1f7170d15bfdc mesa commit 97d03b9366bfa55b27feb92aa5afacd9c5f6f421
Diffstat (limited to 'mesalib/src/glsl/builtin_functions.cpp')
-rw-r--r--mesalib/src/glsl/builtin_functions.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/mesalib/src/glsl/builtin_functions.cpp b/mesalib/src/glsl/builtin_functions.cpp
index 185fe98b3..c882ec8dd 100644
--- a/mesalib/src/glsl/builtin_functions.cpp
+++ b/mesalib/src/glsl/builtin_functions.cpp
@@ -318,6 +318,14 @@ fs_oes_derivatives(const _mesa_glsl_parse_state *state)
}
static bool
+fs_derivative_control(const _mesa_glsl_parse_state *state)
+{
+ return state->stage == MESA_SHADER_FRAGMENT &&
+ (state->is_version(450, 0) ||
+ state->ARB_derivative_control_enable);
+}
+
+static bool
tex1d_lod(const _mesa_glsl_parse_state *state)
{
return !state->es_shader && lod_exists_in_stage(state);
@@ -618,6 +626,12 @@ private:
B1(dFdx);
B1(dFdy);
B1(fwidth);
+ B1(dFdxCoarse);
+ B1(dFdyCoarse);
+ B1(fwidthCoarse);
+ B1(dFdxFine);
+ B1(dFdyFine);
+ B1(fwidthFine);
B1(noise1);
B1(noise2);
B1(noise3);
@@ -2148,6 +2162,12 @@ builtin_builder::create_builtins()
F(dFdx)
F(dFdy)
F(fwidth)
+ F(dFdxCoarse)
+ F(dFdyCoarse)
+ F(fwidthCoarse)
+ F(dFdxFine)
+ F(dFdyFine)
+ F(fwidthFine)
F(noise1)
F(noise2)
F(noise3)
@@ -4010,7 +4030,11 @@ builtin_builder::_textureQueryLevels(const glsl_type *sampler_type)
}
UNOP(dFdx, ir_unop_dFdx, fs_oes_derivatives)
+UNOP(dFdxCoarse, ir_unop_dFdx_coarse, fs_derivative_control)
+UNOP(dFdxFine, ir_unop_dFdx_fine, fs_derivative_control)
UNOP(dFdy, ir_unop_dFdy, fs_oes_derivatives)
+UNOP(dFdyCoarse, ir_unop_dFdy_coarse, fs_derivative_control)
+UNOP(dFdyFine, ir_unop_dFdy_fine, fs_derivative_control)
ir_function_signature *
builtin_builder::_fwidth(const glsl_type *type)
@@ -4024,6 +4048,30 @@ builtin_builder::_fwidth(const glsl_type *type)
}
ir_function_signature *
+builtin_builder::_fwidthCoarse(const glsl_type *type)
+{
+ ir_variable *p = in_var(type, "p");
+ MAKE_SIG(type, fs_derivative_control, 1, p);
+
+ body.emit(ret(add(abs(expr(ir_unop_dFdx_coarse, p)),
+ abs(expr(ir_unop_dFdy_coarse, p)))));
+
+ return sig;
+}
+
+ir_function_signature *
+builtin_builder::_fwidthFine(const glsl_type *type)
+{
+ ir_variable *p = in_var(type, "p");
+ MAKE_SIG(type, fs_derivative_control, 1, p);
+
+ body.emit(ret(add(abs(expr(ir_unop_dFdx_fine, p)),
+ abs(expr(ir_unop_dFdy_fine, p)))));
+
+ return sig;
+}
+
+ir_function_signature *
builtin_builder::_noise1(const glsl_type *type)
{
return unop(v110, ir_unop_noise, glsl_type::float_type, type);