diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-06-10 20:07:07 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-06-22 14:28:01 +0300 |
commit | 2c41c8e94fa8740f67dc39150dd1ab66b506adc9 (patch) | |
tree | 3a83a02217946feb89b5cc0a77cc3ed088eb1aad /intern/cycles/kernel/kernel_types.h | |
parent | 207338bb58b1a44c531e6d78fad68672c6d3b2e1 (diff) |
Cycles: internal refactoring to make thick/ribbon curve separate primitives
Also removing the curve system manager which only stored a few curve intersection
settings. These are all changes towards making shape and subdivision settings
per-object instead of per-scene, but there is more work to do here.
Ref T73778
Depends on D8013
Maniphest Tasks: T73778
Differential Revision: https://developer.blender.org/D8014
Diffstat (limited to 'intern/cycles/kernel/kernel_types.h')
-rw-r--r-- | intern/cycles/kernel/kernel_types.h | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h index 02de2db8bd2..ff0f6bd1fbe 100644 --- a/intern/cycles/kernel/kernel_types.h +++ b/intern/cycles/kernel/kernel_types.h @@ -691,27 +691,38 @@ typedef enum PrimitiveType { PRIMITIVE_NONE = 0, PRIMITIVE_TRIANGLE = (1 << 0), PRIMITIVE_MOTION_TRIANGLE = (1 << 1), - PRIMITIVE_CURVE = (1 << 2), - PRIMITIVE_MOTION_CURVE = (1 << 3), + PRIMITIVE_CURVE_THICK = (1 << 2), + PRIMITIVE_MOTION_CURVE_THICK = (1 << 3), + PRIMITIVE_CURVE_RIBBON = (1 << 4), + PRIMITIVE_MOTION_CURVE_RIBBON = (1 << 5), /* Lamp primitive is not included below on purpose, * since it is no real traceable primitive. */ - PRIMITIVE_LAMP = (1 << 4), + PRIMITIVE_LAMP = (1 << 6), PRIMITIVE_ALL_TRIANGLE = (PRIMITIVE_TRIANGLE | PRIMITIVE_MOTION_TRIANGLE), - PRIMITIVE_ALL_CURVE = (PRIMITIVE_CURVE | PRIMITIVE_MOTION_CURVE), - PRIMITIVE_ALL_MOTION = (PRIMITIVE_MOTION_TRIANGLE | PRIMITIVE_MOTION_CURVE), + PRIMITIVE_ALL_CURVE = (PRIMITIVE_CURVE_THICK | PRIMITIVE_MOTION_CURVE_THICK | + PRIMITIVE_CURVE_RIBBON | PRIMITIVE_MOTION_CURVE_RIBBON), + PRIMITIVE_ALL_MOTION = (PRIMITIVE_MOTION_TRIANGLE | PRIMITIVE_MOTION_CURVE_THICK | + PRIMITIVE_MOTION_CURVE_RIBBON), PRIMITIVE_ALL = (PRIMITIVE_ALL_TRIANGLE | PRIMITIVE_ALL_CURVE), /* Total number of different traceable primitives. * NOTE: This is an actual value, not a bitflag. */ - PRIMITIVE_NUM_TOTAL = 4, + PRIMITIVE_NUM_TOTAL = 6, } PrimitiveType; #define PRIMITIVE_PACK_SEGMENT(type, segment) ((segment << PRIMITIVE_NUM_TOTAL) | (type)) #define PRIMITIVE_UNPACK_SEGMENT(type) (type >> PRIMITIVE_NUM_TOTAL) +typedef enum CurveShapeType { + CURVE_RIBBON = 0, + CURVE_THICK = 1, + + CURVE_NUM_SHAPE_TYPES, +} CurveShapeType; + /* Attributes */ typedef enum AttributePrimitive { @@ -1400,7 +1411,7 @@ typedef struct KernelBVH { int have_curves; int bvh_layout; int use_bvh_steps; - int pad; + int curve_subdivisions; /* Custom BVH */ #ifdef __KERNEL_OPTIX__ @@ -1418,19 +1429,6 @@ typedef struct KernelBVH { } KernelBVH; static_assert_align(KernelBVH, 16); -typedef enum CurveFlag { - /* runtime flags */ - CURVE_KN_RIBBONS = 1, /* use flat curve ribbons */ -} CurveFlag; - -typedef struct KernelCurves { - int curveflags; - int subdivisions; - - int pad1, pad2; -} KernelCurves; -static_assert_align(KernelCurves, 16); - typedef struct KernelTables { int beckmann_offset; int pad1, pad2, pad3; @@ -1451,7 +1449,6 @@ typedef struct KernelData { KernelBackground background; KernelIntegrator integrator; KernelBVH bvh; - KernelCurves curve; KernelTables tables; KernelBake bake; } KernelData; |