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:
authorLukas Toenne <lukas.toenne@googlemail.com>2012-09-05 21:08:56 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2012-09-05 21:08:56 +0400
commit674d295df3931f3ebbfa5bca549bf000c1abe362 (patch)
tree91ef3ac7c934c19a219560d542c4de69aa06587b /intern/cycles/kernel/kernel_types.h
parentc1dc3753790038d94dd088923f0bb7f97e5ed6f9 (diff)
Fix for attribute lookup in OSL. This uses a map in the OSL globals instead of the device texture.
Diffstat (limited to 'intern/cycles/kernel/kernel_types.h')
-rw-r--r--intern/cycles/kernel/kernel_types.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index 39e088583c4..738d459df30 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -22,6 +22,8 @@
#include "kernel_math.h"
#include "svm/svm_types.h"
+#include "util_param.h"
+
#ifndef __KERNEL_GPU__
#define __KERNEL_CPU__
#endif
@@ -368,6 +370,30 @@ typedef enum AttributeStandard {
ATTR_STD_NOT_FOUND = ~0
} AttributeStandard;
+__device ustring attribute_standard_name(AttributeStandard std)
+{
+ if(std == ATTR_STD_VERTEX_NORMAL)
+ return ustring("N");
+ else if(std == ATTR_STD_FACE_NORMAL)
+ return ustring("Ng");
+ else if(std == ATTR_STD_UV)
+ return ustring("uv");
+ else if(std == ATTR_STD_GENERATED)
+ return ustring("generated");
+ else if(std == ATTR_STD_POSITION_UNDEFORMED)
+ return ustring("undeformed");
+ else if(std == ATTR_STD_POSITION_UNDISPLACED)
+ return ustring("undisplaced");
+ else if(std == ATTR_STD_MOTION_PRE)
+ return ustring("motion_pre");
+ else if(std == ATTR_STD_MOTION_POST)
+ return ustring("motion_post");
+ else if(std == ATTR_STD_PARTICLE)
+ return ustring("particle");
+
+ return ustring();
+}
+
/* Closure data */
#define MAX_CLOSURE 8