Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/cycles/kernel/svm/svm_convert.h')
-rw-r--r--intern/cycles/kernel/svm/svm_convert.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/intern/cycles/kernel/svm/svm_convert.h b/intern/cycles/kernel/svm/svm_convert.h
index 188b0489d9e..f74915a4bc9 100644
--- a/intern/cycles/kernel/svm/svm_convert.h
+++ b/intern/cycles/kernel/svm/svm_convert.h
@@ -23,6 +23,11 @@ CCL_NAMESPACE_BEGIN
__device void svm_node_convert(ShaderData *sd, float *stack, uint type, uint from, uint to)
{
switch(type) {
+ case NODE_CONVERT_FI: {
+ float f = stack_load_float(stack, from);
+ stack_store_int(stack, to, (int)f);
+ break;
+ }
case NODE_CONVERT_FV: {
float f = stack_load_float(stack, from);
stack_store_float3(stack, to, make_float3(f, f, f));
@@ -34,13 +39,34 @@ __device void svm_node_convert(ShaderData *sd, float *stack, uint type, uint fro
stack_store_float(stack, to, g);
break;
}
+ case NODE_CONVERT_CI: {
+ float3 f = stack_load_float3(stack, from);
+ int i = (int)linear_rgb_to_gray(f);
+ stack_store_int(stack, to, i);
+ break;
+ }
case NODE_CONVERT_VF: {
float3 f = stack_load_float3(stack, from);
float g = (f.x + f.y + f.z)*(1.0f/3.0f);
stack_store_float(stack, to, g);
break;
}
-
+ case NODE_CONVERT_VI: {
+ float3 f = stack_load_float3(stack, from);
+ int i = (f.x + f.y + f.z)*(1.0f/3.0f);
+ stack_store_int(stack, to, i);
+ break;
+ }
+ case NODE_CONVERT_IF: {
+ float f = (float)stack_load_int(stack, from);
+ stack_store_float(stack, to, f);
+ break;
+ }
+ case NODE_CONVERT_IV: {
+ float f = (float)stack_load_int(stack, from);
+ stack_store_float3(stack, to, make_float3(f, f, f));
+ break;
+ }
}
}