projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
659a362
)
nir/spirv/glsl450: implement Reflect built-in.
author
Kenneth Graunke
<kenneth@whitecape.org>
Tue, 29 Dec 2015 08:10:39 +0000
(
00:10
-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 f81f16789beff109cf33aaf588e000aba7f1172e..38dea8caa4d5e6b08cfd3426f8421e8a0ae35f2a 100644
(file)
--- a/
src/glsl/nir/spirv/vtn_glsl450.c
+++ b/
src/glsl/nir/spirv/vtn_glsl450.c
@@
-197,6
+197,14
@@
handle_glsl450_alu(struct vtn_builder *b, enum GLSLstd450 entrypoint,
src[0], nir_fneg(nb, src[0]));
return;
+ case GLSLstd450Reflect:
+ /* I - 2 * dot(N, I) * N */
+ val->ssa->def =
+ nir_fsub(nb, src[0], nir_fmul(nb, nir_imm_float(nb, 2.0),
+ nir_fmul(nb, nir_fdot(nb, src[0], src[1]),
+ src[1])));
+ return;
+
case GLSLstd450Asin:
case GLSLstd450Acos:
case GLSLstd450Atan:
@@
-210,7
+218,6
@@
handle_glsl450_alu(struct vtn_builder *b, enum GLSLstd450 entrypoint,
case GLSLstd450Frexp:
case GLSLstd450PackDouble2x32:
case GLSLstd450UnpackDouble2x32:
- case GLSLstd450Reflect:
case GLSLstd450Refract:
case GLSLstd450IMix:
default: