diff options
author | Stefan Werner <stefan.werner@tangent-animation.com> | 2018-03-08 02:35:24 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-03-10 06:54:04 +0300 |
commit | f3010e98c343a83e07ff6c2a5437d0043122b083 (patch) | |
tree | 5b65da3162727bf00c88babcb216d8dbb4c5a269 /intern/cycles/kernel/kernel_types.h | |
parent | fa9175ff02acffd02679398e17732f3832d3fc28 (diff) |
Code refactor: use KernelShader and KernelParticle instead of float arrays.
Original patch by Stefan with modifications by Brecht.
Diffstat (limited to 'intern/cycles/kernel/kernel_types.h')
-rw-r--r-- | intern/cycles/kernel/kernel_types.h | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h index 198ce39c63f..2cab63cdc6a 100644 --- a/intern/cycles/kernel/kernel_types.h +++ b/intern/cycles/kernel/kernel_types.h @@ -39,8 +39,6 @@ CCL_NAMESPACE_BEGIN #define FILTER_TABLE_SIZE 1024 #define RAMP_TABLE_SIZE 256 #define SHUTTER_TABLE_SIZE 256 -#define PARTICLE_SIZE 5 -#define SHADER_SIZE 5 #define BSSRDF_MIN_RADIUS 1e-8f #define BSSRDF_MAX_HITS 4 @@ -923,7 +921,7 @@ enum ShaderDataFlag { SD_HAS_BUMP = (1 << 25), /* Has true displacement. */ SD_HAS_DISPLACEMENT = (1 << 26), - /* Has constant emission (value stored in __shader_flag) */ + /* Has constant emission (value stored in __shaders) */ SD_HAS_CONSTANT_EMISSION = (1 << 27), /* Needs to access attributes */ SD_NEED_ATTRIBUTES = (1 << 28), @@ -1511,6 +1509,29 @@ typedef struct KernelLightDistribution { } KernelLightDistribution; static_assert_align(KernelLightDistribution, 16); +typedef struct KernelParticle { + int index; + float age; + float lifetime; + float size; + float4 rotation; + /* Only xyz are used of the following. float4 instead of float3 are used + * to ensure consistent padding/alignment across devices. */ + float4 location; + float4 velocity; + float4 angular_velocity; +} KernelParticle; +static_assert_align(KernelParticle, 16); + +typedef struct KernelShader { + float constant_emission[3]; + float pad1; + int flags; + int pass_id; + int pad2, pad3; +} KernelShader; +static_assert_align(KernelShader, 16); + /* Declarations required for split kernel */ /* Macro for queues */ |