Cleanup: fewer iostreams related includes in Cycles #111063

Merged
Aras Pranckevicius merged 1 commits from aras_p/blender:fewer_includes_cycles into main 2023-08-15 13:55:45 +02:00

In the commonly used cycles headers, it's enough to include much smaller <iosfwd> than the full <iostream>. While looking at it,
removed inclusion of some other headers from commonly used headers, that seemed to not be needed.

In the overall Blender build this does not save much time or inclusion amount, but was trivial to do so why not.

In the commonly used cycles headers, it's enough to include much smaller `<iosfwd>` than the full `<iostream>`. While looking at it, removed inclusion of some other headers from commonly used headers, that seemed to not be needed. In the overall Blender build this does not save much time or inclusion amount, but was trivial to do so why not.
Aras Pranckevicius changed title from Cleanup: fewer iostreams related includes in Cycles to WIP: Cleanup: fewer iostreams related includes in Cycles 2023-08-12 10:11:47 +02:00
Aras Pranckevicius force-pushed fewer_includes_cycles from 862ec5e2c4 to 34b0f74177 2023-08-12 10:17:13 +02:00 Compare
Aras Pranckevicius changed title from WIP: Cleanup: fewer iostreams related includes in Cycles to Cleanup: fewer iostreams related includes in Cycles 2023-08-12 11:42:17 +02:00
Aras Pranckevicius requested review from Brecht Van Lommel 2023-08-12 11:42:26 +02:00
Jesse Yurkovich reviewed 2023-08-12 20:10:41 +02:00
@ -321,3 +327,3 @@
struct BVHSpatialStorage {
/* Accumulated bounds when sweeping from right to left. */
vector<BoundBox> right_bounds;
std::vector<BoundBox> right_bounds;

I think these are supposed to be ccl::vector types defined in cycles/util/vector.h.

I think these are supposed to be `ccl::vector` types defined in `cycles/util/vector.h`.
aras_p marked this conversation as resolved
Aras Pranckevicius force-pushed fewer_includes_cycles from 34b0f74177 to 69bb111b75 2023-08-13 09:55:12 +02:00 Compare
Aras Pranckevicius force-pushed fewer_includes_cycles from 69bb111b75 to ef62c06682 2023-08-13 10:15:00 +02:00 Compare
Author
Member

@blender-bot build

@blender-bot build
Sergey Sharybin approved these changes 2023-08-15 09:51:35 +02:00
Sergey Sharybin left a comment
Owner

Think the majority of the modified areas are actually originated from me, and to me it seems all reasonable.

Even if the current impact is not easy to measure it seems like a good rule to include iosfwd whenever possible.

Think the majority of the modified areas are actually originated from me, and to me it seems all reasonable. Even if the current impact is not easy to measure it seems like a good rule to include `iosfwd` whenever possible.
Aras Pranckevicius merged commit 7875074532 into main 2023-08-15 13:55:45 +02:00
Aras Pranckevicius deleted branch fewer_includes_cycles 2023-08-15 13:55:46 +02:00
Contributor

@aras_p this commit breaks build for me.

FreeBSD 13.2/clang 15.0.7 (using LLVM libc++)

changing tile.h back to include ostream builds.

using iosfwd in tile.h gives me

.../blender_master/blender/intern/cycles/integrator/tile.cpp:14:6: error: invalid operands to binary expression ('std::ostream' (aka 'basic_ostream<char>') and 'const char[8]')
os << "size: (" << tile_size.width << ", " << tile_size.height << ")";
...
...
.../blender_master/blender/intern/cycles/integrator/tile.cpp:15:6: error: invalid operands to binary expression ('std::ostream' (aka 'basic_ostream<char>') and 'const char[16]')
os << ", num_samples: " << tile_size.num_samples;
@aras_p this commit breaks build for me. FreeBSD 13.2/clang 15.0.7 (using LLVM libc++) changing tile.h back to include ostream builds. using iosfwd in tile.h gives me ``` .../blender_master/blender/intern/cycles/integrator/tile.cpp:14:6: error: invalid operands to binary expression ('std::ostream' (aka 'basic_ostream<char>') and 'const char[8]') os << "size: (" << tile_size.width << ", " << tile_size.height << ")"; ... ... .../blender_master/blender/intern/cycles/integrator/tile.cpp:15:6: error: invalid operands to binary expression ('std::ostream' (aka 'basic_ostream<char>') and 'const char[16]') os << ", num_samples: " << tile_size.num_samples; ```
Author
Member

@ShaneAmbler does adding #include <ostream> to that tile.cpp file that produces the error fix the build for you?

@ShaneAmbler does adding `#include <ostream>` to that `tile.cpp` file that produces the error fix the build for you?
Contributor

yes, iosfwd in tile.h and ostream in tile.cpp builds

yes, iosfwd in tile.h and ostream in tile.cpp builds
Author
Member

tile.h already contains <iosfwd> include though?

tile.h already contains `<iosfwd>` include though?
Contributor

yeah, I first mentioned changing tile.h back to include <ostream> to fix build.

If I leave tile.h with include <iosfwd> and add include <ostream> to tile.cpp that also builds.

yeah, I first mentioned changing `tile.h` back to `include <ostream>` to fix build. If I leave `tile.h` with `include <iosfwd>` and add `include <ostream>` to `tile.cpp` that also builds.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#111063
No description provided.