Fix Cycles CUDA adaptive kernel not working correctly after recent closure changes.

This commit is contained in:
Brecht Van Lommel 2016-08-09 01:00:57 +02:00
parent d1b9306cd5
commit 040fa75d7b
Notes: blender-bot 2023-02-14 11:21:43 +01:00
Referenced by issue #49089, GL error GL_INVALID_OPERATION
3 changed files with 6 additions and 9 deletions

View File

@ -47,6 +47,7 @@
#define ccl_may_alias
#define ccl_addr_space
#define ccl_restrict __restrict__
#define ccl_align(n) __align__(n)
/* No assert supported for CUDA */

View File

@ -40,6 +40,7 @@
#define ccl_local __local
#define ccl_private __private
#define ccl_restrict restrict
#define ccl_align(n) __attribute__((aligned(n)))
#ifdef __SPLIT_KERNEL__
# define ccl_addr_space __global

View File

@ -656,23 +656,18 @@ typedef struct AttributeDescriptor {
* ShaderClosure has a fixed size, and any extra space must be allocated
* with closure_alloc_extra().
*
* float3 is 12 bytes on CUDA and 16 bytes on CPU/OpenCL, we set the data
* size to ensure ShaderClosure is 80 bytes total everywhere. */
* 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. */
#define SHADER_CLOSURE_BASE \
float3 weight; \
ClosureType type; \
float sample_weight \
typedef ccl_addr_space struct ShaderClosure {
typedef ccl_addr_space struct ccl_align(16) ShaderClosure {
SHADER_CLOSURE_BASE;
/* pad to 80 bytes, data types are aligned to own size */
#ifdef __KERNEL_CUDA__
float data[15];
#else
float data[14];
#endif
float data[14]; /* pad to 80 bytes */
} ShaderClosure;
/* Shader Context