projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0f80175
)
nir/spirv/glsl450: Add a helper for doing fclamp().
author
Kenneth Graunke
<kenneth@whitecape.org>
Tue, 29 Dec 2015 23:18:05 +0000
(15:18 -0800)
committer
Kenneth Graunke
<kenneth@whitecape.org>
Tue, 29 Dec 2015 23:27:03 +0000
(15:27 -0800)
src/glsl/nir/spirv/vtn_glsl450.c
patch
|
blob
|
history
diff --git
a/src/glsl/nir/spirv/vtn_glsl450.c
b/src/glsl/nir/spirv/vtn_glsl450.c
index d4cb1bb9f3c218272f969ada6dabe1777f129f08..f4550baaf93f49f33c7896f32c16c17285a8f466 100644
(file)
--- a/
src/glsl/nir/spirv/vtn_glsl450.c
+++ b/
src/glsl/nir/spirv/vtn_glsl450.c
@@
-41,6
+41,13
@@
build_length(nir_builder *b, nir_ssa_def *vec)
}
}
+static inline nir_ssa_def *
+build_fclamp(nir_builder *b,
+ nir_ssa_def *x, nir_ssa_def *min_val, nir_ssa_def *max_val)
+{
+ return nir_fmin(b, nir_fmax(b, x, min_val), max_val);
+}
+
/**
* Return e^x.
*/