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/kernel_types.h')
-rw-r--r--intern/cycles/kernel/kernel_types.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index 18d2a216f72..08c0c199af6 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -804,8 +804,9 @@ typedef struct AttributeDescriptor {
* ShaderClosure has a fixed size, and any extra space must be allocated
* with closure_alloc_extra().
*
- * We pad the struct to 80 bytes and ensure it is aligned to 16 bytes, which
- * we assume to be the maximum required alignment for any struct. */
+ * We pad the struct to align to 16 bytes. All shader closures are assumed
+ * to fit in this struct size. CPU sizes are a bit larger because float3 is
+ * padded to be 16 bytes, while it's only 12 bytes on the GPU. */
#define SHADER_CLOSURE_BASE \
float3 weight; \
@@ -817,7 +818,10 @@ typedef ccl_addr_space struct ccl_align(16) ShaderClosure
{
SHADER_CLOSURE_BASE;
- float data[10]; /* pad to 80 bytes */
+#ifdef __KERNEL_CPU__
+ float pad[2];
+#endif
+ float data[10];
}
ShaderClosure;