forked from bartvdbraak/blender
Fix Cycles CUDA adaptive kernel not working correctly after recent closure changes.
This commit is contained in:
parent
d1b9306cd5
commit
040fa75d7b
@ -47,6 +47,7 @@
|
|||||||
#define ccl_may_alias
|
#define ccl_may_alias
|
||||||
#define ccl_addr_space
|
#define ccl_addr_space
|
||||||
#define ccl_restrict __restrict__
|
#define ccl_restrict __restrict__
|
||||||
|
#define ccl_align(n) __align__(n)
|
||||||
|
|
||||||
/* No assert supported for CUDA */
|
/* No assert supported for CUDA */
|
||||||
|
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
#define ccl_local __local
|
#define ccl_local __local
|
||||||
#define ccl_private __private
|
#define ccl_private __private
|
||||||
#define ccl_restrict restrict
|
#define ccl_restrict restrict
|
||||||
|
#define ccl_align(n) __attribute__((aligned(n)))
|
||||||
|
|
||||||
#ifdef __SPLIT_KERNEL__
|
#ifdef __SPLIT_KERNEL__
|
||||||
# define ccl_addr_space __global
|
# define ccl_addr_space __global
|
||||||
|
@ -656,23 +656,18 @@ typedef struct AttributeDescriptor {
|
|||||||
* ShaderClosure has a fixed size, and any extra space must be allocated
|
* ShaderClosure has a fixed size, and any extra space must be allocated
|
||||||
* with closure_alloc_extra().
|
* with closure_alloc_extra().
|
||||||
*
|
*
|
||||||
* float3 is 12 bytes on CUDA and 16 bytes on CPU/OpenCL, we set the data
|
* We pad the struct to 80 bytes and ensure it is aligned to 16 bytes, which
|
||||||
* size to ensure ShaderClosure is 80 bytes total everywhere. */
|
* we assume to be the maximum required alignment for any struct. */
|
||||||
|
|
||||||
#define SHADER_CLOSURE_BASE \
|
#define SHADER_CLOSURE_BASE \
|
||||||
float3 weight; \
|
float3 weight; \
|
||||||
ClosureType type; \
|
ClosureType type; \
|
||||||
float sample_weight \
|
float sample_weight \
|
||||||
|
|
||||||
typedef ccl_addr_space struct ShaderClosure {
|
typedef ccl_addr_space struct ccl_align(16) ShaderClosure {
|
||||||
SHADER_CLOSURE_BASE;
|
SHADER_CLOSURE_BASE;
|
||||||
|
|
||||||
/* pad to 80 bytes, data types are aligned to own size */
|
float data[14]; /* pad to 80 bytes */
|
||||||
#ifdef __KERNEL_CUDA__
|
|
||||||
float data[15];
|
|
||||||
#else
|
|
||||||
float data[14];
|
|
||||||
#endif
|
|
||||||
} ShaderClosure;
|
} ShaderClosure;
|
||||||
|
|
||||||
/* Shader Context
|
/* Shader Context
|
||||||
|
Loading…
Reference in New Issue
Block a user