diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /intern/cycles/render/scene.h | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'intern/cycles/render/scene.h')
-rw-r--r-- | intern/cycles/render/scene.h | 396 |
1 files changed, 198 insertions, 198 deletions
diff --git a/intern/cycles/render/scene.h b/intern/cycles/render/scene.h index e43800fe5c4..45997bccf5d 100644 --- a/intern/cycles/render/scene.h +++ b/intern/cycles/render/scene.h @@ -61,215 +61,215 @@ class RenderStats; /* Scene Device Data */ class DeviceScene { -public: - /* BVH */ - device_vector<int4> bvh_nodes; - device_vector<int4> bvh_leaf_nodes; - device_vector<int> object_node; - device_vector<uint> prim_tri_index; - device_vector<float4> prim_tri_verts; - device_vector<int> prim_type; - device_vector<uint> prim_visibility; - device_vector<int> prim_index; - device_vector<int> prim_object; - device_vector<float2> prim_time; - - /* mesh */ - device_vector<uint> tri_shader; - device_vector<float4> tri_vnormal; - device_vector<uint4> tri_vindex; - device_vector<uint> tri_patch; - device_vector<float2> tri_patch_uv; - - device_vector<float4> curves; - device_vector<float4> curve_keys; - - device_vector<uint> patches; - - /* objects */ - device_vector<KernelObject> objects; - device_vector<Transform> object_motion_pass; - device_vector<DecomposedTransform> object_motion; - device_vector<uint> object_flag; - - /* cameras */ - device_vector<DecomposedTransform> camera_motion; - - /* attributes */ - device_vector<uint4> attributes_map; - device_vector<float> attributes_float; - device_vector<float2> attributes_float2; - device_vector<float4> attributes_float3; - device_vector<uchar4> attributes_uchar4; - - /* lights */ - device_vector<KernelLightDistribution> light_distribution; - device_vector<KernelLight> lights; - device_vector<float2> light_background_marginal_cdf; - device_vector<float2> light_background_conditional_cdf; - - /* particles */ - device_vector<KernelParticle> particles; - - /* shaders */ - device_vector<int4> svm_nodes; - device_vector<KernelShader> shaders; - - /* lookup tables */ - device_vector<float> lookup_table; - - /* integrator */ - device_vector<uint> sobol_directions; - - /* ies lights */ - device_vector<float> ies_lights; - - KernelData data; - - DeviceScene(Device *device); + public: + /* BVH */ + device_vector<int4> bvh_nodes; + device_vector<int4> bvh_leaf_nodes; + device_vector<int> object_node; + device_vector<uint> prim_tri_index; + device_vector<float4> prim_tri_verts; + device_vector<int> prim_type; + device_vector<uint> prim_visibility; + device_vector<int> prim_index; + device_vector<int> prim_object; + device_vector<float2> prim_time; + + /* mesh */ + device_vector<uint> tri_shader; + device_vector<float4> tri_vnormal; + device_vector<uint4> tri_vindex; + device_vector<uint> tri_patch; + device_vector<float2> tri_patch_uv; + + device_vector<float4> curves; + device_vector<float4> curve_keys; + + device_vector<uint> patches; + + /* objects */ + device_vector<KernelObject> objects; + device_vector<Transform> object_motion_pass; + device_vector<DecomposedTransform> object_motion; + device_vector<uint> object_flag; + + /* cameras */ + device_vector<DecomposedTransform> camera_motion; + + /* attributes */ + device_vector<uint4> attributes_map; + device_vector<float> attributes_float; + device_vector<float2> attributes_float2; + device_vector<float4> attributes_float3; + device_vector<uchar4> attributes_uchar4; + + /* lights */ + device_vector<KernelLightDistribution> light_distribution; + device_vector<KernelLight> lights; + device_vector<float2> light_background_marginal_cdf; + device_vector<float2> light_background_conditional_cdf; + + /* particles */ + device_vector<KernelParticle> particles; + + /* shaders */ + device_vector<int4> svm_nodes; + device_vector<KernelShader> shaders; + + /* lookup tables */ + device_vector<float> lookup_table; + + /* integrator */ + device_vector<uint> sobol_directions; + + /* ies lights */ + device_vector<float> ies_lights; + + KernelData data; + + DeviceScene(Device *device); }; /* Scene Parameters */ class SceneParams { -public: - /* Type of BVH, in terms whether it is supported dynamic updates of meshes - * or whether modifying geometry requires full BVH rebuild. - */ - enum BVHType { - /* BVH supports dynamic updates of geometry. - * - * Faster for updating BVH tree when doing modifications in viewport, - * but slower for rendering. - */ - BVH_DYNAMIC = 0, - /* BVH tree is calculated for specific scene, updates in geometry - * requires full tree rebuild. - * - * Slower to update BVH tree when modifying objects in viewport, also - * slower to build final BVH tree but gives best possible render speed. - */ - BVH_STATIC = 1, - - BVH_NUM_TYPES, - }; - - ShadingSystem shadingsystem; - - /* Requested BVH layout. - * - * If it's not supported by the device, the widest one from supported ones - * will be used, but BVH wider than this one will never be used. - */ - BVHLayout bvh_layout; - - BVHType bvh_type; - bool use_bvh_spatial_split; - bool use_bvh_unaligned_nodes; - int num_bvh_time_steps; - bool persistent_data; - int texture_limit; - - SceneParams() - { - shadingsystem = SHADINGSYSTEM_SVM; - bvh_layout = BVH_LAYOUT_BVH2; - bvh_type = BVH_DYNAMIC; - use_bvh_spatial_split = false; - use_bvh_unaligned_nodes = true; - num_bvh_time_steps = 0; - persistent_data = false; - texture_limit = 0; - } - - bool modified(const SceneParams& params) - { return !(shadingsystem == params.shadingsystem - && bvh_layout == params.bvh_layout - && bvh_type == params.bvh_type - && use_bvh_spatial_split == params.use_bvh_spatial_split - && use_bvh_unaligned_nodes == params.use_bvh_unaligned_nodes - && num_bvh_time_steps == params.num_bvh_time_steps - && persistent_data == params.persistent_data - && texture_limit == params.texture_limit); } + public: + /* Type of BVH, in terms whether it is supported dynamic updates of meshes + * or whether modifying geometry requires full BVH rebuild. + */ + enum BVHType { + /* BVH supports dynamic updates of geometry. + * + * Faster for updating BVH tree when doing modifications in viewport, + * but slower for rendering. + */ + BVH_DYNAMIC = 0, + /* BVH tree is calculated for specific scene, updates in geometry + * requires full tree rebuild. + * + * Slower to update BVH tree when modifying objects in viewport, also + * slower to build final BVH tree but gives best possible render speed. + */ + BVH_STATIC = 1, + + BVH_NUM_TYPES, + }; + + ShadingSystem shadingsystem; + + /* Requested BVH layout. + * + * If it's not supported by the device, the widest one from supported ones + * will be used, but BVH wider than this one will never be used. + */ + BVHLayout bvh_layout; + + BVHType bvh_type; + bool use_bvh_spatial_split; + bool use_bvh_unaligned_nodes; + int num_bvh_time_steps; + bool persistent_data; + int texture_limit; + + SceneParams() + { + shadingsystem = SHADINGSYSTEM_SVM; + bvh_layout = BVH_LAYOUT_BVH2; + bvh_type = BVH_DYNAMIC; + use_bvh_spatial_split = false; + use_bvh_unaligned_nodes = true; + num_bvh_time_steps = 0; + persistent_data = false; + texture_limit = 0; + } + + bool modified(const SceneParams ¶ms) + { + return !(shadingsystem == params.shadingsystem && bvh_layout == params.bvh_layout && + bvh_type == params.bvh_type && + use_bvh_spatial_split == params.use_bvh_spatial_split && + use_bvh_unaligned_nodes == params.use_bvh_unaligned_nodes && + num_bvh_time_steps == params.num_bvh_time_steps && + persistent_data == params.persistent_data && texture_limit == params.texture_limit); + } }; /* Scene */ class Scene { -public: - /* Optional name. Is used for logging and reporting. */ - string name; - - /* data */ - Camera *camera; - Camera *dicing_camera; - LookupTables *lookup_tables; - Film *film; - Background *background; - Integrator *integrator; - - /* data lists */ - vector<Object*> objects; - vector<Mesh*> meshes; - vector<Shader*> shaders; - vector<Light*> lights; - vector<ParticleSystem*> particle_systems; - - /* data managers */ - ImageManager *image_manager; - LightManager *light_manager; - ShaderManager *shader_manager; - MeshManager *mesh_manager; - ObjectManager *object_manager; - ParticleSystemManager *particle_system_manager; - CurveSystemManager *curve_system_manager; - BakeManager *bake_manager; - - /* default shaders */ - Shader *default_surface; - Shader *default_light; - Shader *default_background; - Shader *default_empty; - - /* device */ - Device *device; - DeviceScene dscene; - - /* parameters */ - SceneParams params; - - /* mutex must be locked manually by callers */ - thread_mutex mutex; - - Scene(const SceneParams& params, Device *device); - ~Scene(); - - void device_update(Device *device, Progress& progress); - - bool need_global_attribute(AttributeStandard std); - void need_global_attributes(AttributeRequestSet& attributes); - - enum MotionType { MOTION_NONE = 0, MOTION_PASS, MOTION_BLUR }; - MotionType need_motion(); - float motion_shutter_time(); - - bool need_update(); - bool need_reset(); - - void reset(); - void device_free(); - - void collect_statistics(RenderStats *stats); - -protected: - /* Check if some heavy data worth logging was updated. - * Mainly used to suppress extra annoying logging. - */ - bool need_data_update(); - - void free_memory(bool final); + public: + /* Optional name. Is used for logging and reporting. */ + string name; + + /* data */ + Camera *camera; + Camera *dicing_camera; + LookupTables *lookup_tables; + Film *film; + Background *background; + Integrator *integrator; + + /* data lists */ + vector<Object *> objects; + vector<Mesh *> meshes; + vector<Shader *> shaders; + vector<Light *> lights; + vector<ParticleSystem *> particle_systems; + + /* data managers */ + ImageManager *image_manager; + LightManager *light_manager; + ShaderManager *shader_manager; + MeshManager *mesh_manager; + ObjectManager *object_manager; + ParticleSystemManager *particle_system_manager; + CurveSystemManager *curve_system_manager; + BakeManager *bake_manager; + + /* default shaders */ + Shader *default_surface; + Shader *default_light; + Shader *default_background; + Shader *default_empty; + + /* device */ + Device *device; + DeviceScene dscene; + + /* parameters */ + SceneParams params; + + /* mutex must be locked manually by callers */ + thread_mutex mutex; + + Scene(const SceneParams ¶ms, Device *device); + ~Scene(); + + void device_update(Device *device, Progress &progress); + + bool need_global_attribute(AttributeStandard std); + void need_global_attributes(AttributeRequestSet &attributes); + + enum MotionType { MOTION_NONE = 0, MOTION_PASS, MOTION_BLUR }; + MotionType need_motion(); + float motion_shutter_time(); + + bool need_update(); + bool need_reset(); + + void reset(); + void device_free(); + + void collect_statistics(RenderStats *stats); + + protected: + /* Check if some heavy data worth logging was updated. + * Mainly used to suppress extra annoying logging. + */ + bool need_data_update(); + + void free_memory(bool final); }; CCL_NAMESPACE_END -#endif /* __SCENE_H__ */ +#endif /* __SCENE_H__ */ |