Files
UnrealEngineUWP/Engine/Source/Programs/IncludeTool
Jeff Fisher e6c172fd1b Copying //UE4/Dev-VR to //UE4/Dev-Main (Source: //UE4/Dev-VR @ 3931840)
#lockdown Nick.Penwarden
#rb merge

============================
  MAJOR FEATURES & CHANGES
============================

Change 3754252 by Mike.Beach

	Mirroring CL 3723722 from 4.18.1

	Hotfix update from Oculus.

	  - Introduce dash support by adding an Oculus config setting (that is off by default)
	  - Move submission of the near plane╞s depth from a fixed one at texture allocation time to an every-frame one, which is needed for correct depth support in games that have a ⌠god mode÷ with a smaller worldtometersscale

	#jira UE-51728

Change 3775128 by Nick.Atamas

	Merging //UE4/Partner-Google-VR @ CL 3770408 to Dev-VR (//UE4/Dev-VR)

Change 3795928 by Joe.Conley

	PR #2514: make VR preview work with dedicated server mode in editor (Contributed by joelmcginnis)

	#github https://github.com/EpicGames/UnrealEngine/pull/2514


Change 3798048 by Mike.Beach

	[WIP] MR - Improving on the MR alignment calibration process.

	#jira UEVR-1047

Change 3798388 by Mike.Beach

	MR - Loading the OpenCv dll along with the calibration module. Adding a WITH_OPENCV define that we can wrap blocks with.

Change 3798396 by Mike.Beach

	MR - Making use of OpenCV's eigen solver for quaternion averaging, and wrapping my use of OpenCV with the new define.

Change 3798668 by Nick.Whiting

	Merging CL 3794238 from Partner-Valve (Fixes for uninitialized memory after vkGetPhysicalDeviceProperties2KHR)

Change 3800540 by Keli.Hlodversson

	Simplify loading of OpenCV dll by defining the dll name and relative path  in the third party build script  (OpenCV.Build.cs).
	Remove redefinition of WITH_OPENCV from MixedRealityCalibration.Build.cs.
	Add OpenCVHelper.h with macros that should be used to wrap opencv includes

Change 3801194 by Keli.Hlodversson

	Fix relative path in OpenCV.build.cs

Change 3801853 by Mike.Beach

	Fixing crash on nullptr.

Change 3802176 by Mike.Beach

	Switching out the wrong file that was submitted in CL 3801853 - fixing a crash in MotionControllerComponent.

Change 3802189 by Mike.Beach

	MR - Fix to rotation averaging (was not correctly populating quaternion matrix).

Change 3807785 by Douglas.Copeland

	Replacing deprecated nodes in QA_MoCoAll BP

Change 3810205 by Chance.Ivey

	Removing Old Moble AR Template

Change 3810482 by Nick.Whiting

	Updating to SteamVR 1.0.11

Change 3810488 by Nick.Whiting

	Adapting CL 379023 from Partner-Valve, SteamVR : fix lockup, improve performance , use PostPresentHandoff and SubmitExplicitTimingData APIs

Change 3810502 by Nick.Whiting

	Adding LUID detection on non-Mac platforms for SteamVR

Change 3811483 by Joe.Graf

	Fixed Mac compiling with SteamVR due to an initialized variable being used

Change 3811488 by Keli.Hlodversson

	Initial class for performing camera calibration via OpenCV
	#jira UE-52726

Change 3811496 by Mike.Beach

	CIS fix - pragma'ing out several OpenCV, ThirdParty warnings.

	#jira UE-53558

Change 3811560 by Mike.Beach

	CIS fixes - Initializing an unitialized var in SteamVR & pragma'ing out some more warnings for OpenCV.

	#jira UE-53557, UE-53558

Change 3812051 by Mike.Beach

	CIS fix - switching over to using new 'PublicDefinitions' member.

Change 3813131 by Jeff.Fisher

	Opacity mask gradient test content for msaa.
	#jira UEVR-1049

Change 3814154 by Douglas.Copeland

	Rebuilding lighting for TM-VRSmoke

Change 3814248 by Mike.Beach

	Adopting Occulus' SI1.21 changes...

	  Added Oculus Go controller meshes to UE4
	  Enable sched_fifo and RT/GT affinities back in UE4
	  Only activate the masking system for the translucent objects (only ones where masking is necessary)
	  Upgrade to OVRPlugin 1.21's new APIs for display frequency and integration into blueprint
	  Fixes the 10fps lock not being setup when an app is launched with the HMD not mounted
	  Add blueprint definition to get device name from ovrplugin
	  Add support for tiled multires and GPU % reporting

	Rejected changes in:
	  OculusFunctionLibrary.h
	  DefaultXRCamera.cpp
	  SceneRenderTargets.cpp

Change 3820224 by Mike.Beach

	[WIP] MR Calibration

	  - Correcting orientation estimation to average sampled forward/up vectors
	  - Converting functionality for intersecting approximate frustum rays to C++ (to better align with frustum far points)
	  - Switched alignment points' PlanarId to be 3D, so we know how they relate to each other
	  - Stubbing in new alignment tweak mode

Change 3820475 by Ryan.Vance

	#jira UEVR-1055

	We need to use 0 for a sentinel value on non-metal rhi's.

Change 3821771 by Mike.Beach

	CIS fixes

Change 3824637 by Mike.Beach

	[WIP] MR Calibration process - polishing alignment tweak step (only needing rendertarget/img processing functions from demo branch).

Change 3828925 by Mike.Beach

	CIS fix (was using deprecated IImageWrapperPtr)

Change 3830898 by Jeff.Fisher

	Improving ActorComponent.h include path somone on udn noticed wasn't quite right.

Change 3831597 by Mike.Beach

	[WIP] MR Calibration - Alignment tweaking now takes snapshots and presents a collage for you to align with.

	#jira UEVR-1042

Change 3837752 by Keli.Hlodversson

	Add option to pass UTextureRenderTarget2D directly to the OpenCVCalibrator instead of using temporary image files
	#jira UE-52728

Change 3839309 by Mike.Beach

	MotionController support for HMD tracking.

Change 3839314 by Mike.Beach

	Fixing a crash in MR calibration, where we were expecting a returned list to be ordered and it wasn't (caused indexing out of bounds).

Change 3839316 by Mike.Beach

	[WIP] MR Calibration - Stubbing in support for calibration using the HMD model (instead of controllers)

Change 3840711 by Mike.Beach

	[WIP] MR Calibration - Add final preview to alignment calibration step.

Change 3841667 by Mike.Beach

	[WIP] MR Calibration - Allowing users to toggle through different alignment techniques.

Change 3842631 by Mike.Beach

	[WIP] MR Calibration - Polishing alignment tweak step (adding preview with HMD visualization, enforcing trigger pull for snapshots, allow reseting of just adjustments).

Change 3842758 by Mike.Beach

	[WIP] MR Calibration - Cleaning up & reorganizing some cruft.

Change 3842943 by Mike.Beach

	[WIP] MR Calibration - More clean up & re-org

Change 3843004 by Mike.Beach

	[WIP] MR Calibration - Clearing old references to defunct calibration modes.

Change 3843063 by Mike.Beach

	[WIP] MR - Deleting old (unused) calibration steps.

Change 3844142 by Mike.Beach

	[WIP] MR Calibration - Cleaning out old cruft in CalibrationController (old alignment calibration that was moved to a separate BP).

Change 3845341 by Keli.Hlodversson

	Add lens distortion parameters to MRCaptureComponent
	#jira UEVR-1060

Change 3846174 by Mike.Beach

	[WIP] MR Calibration - Updating the compositing adjustment phase to run on the new modular calibration step system.
	  - Properties are now DataTable driven
	  - Split into base and sub-class (to facilitate easier property editing)
	  - Added HSV tweak mode for the color

	#jira UEVR-1048

Change 3847032 by Mike.Beach

	[WIP] MR Calibration - Misc. fixes
	  - Unique identification color for new alignment point
	  - Fixed compositing calibration so it shows the scene as it would appear in a full MR capture (no specialized calibration view)
	  - Fixed some of the language used in the on-screen instructions

Change 3849040 by Mike.Beach

	Fixing a assert/crash in MR calibration during the garbage matte phase - garbage matte actor was pointing to the wrong calibration component.

	#jira UE-54233

Change 3849778 by Mike.Beach

	Fixed so the loaded MR calibration position/orientation is properly applied and visualized in the MR calibration level.

	#jira UE-54251

Change 3850199 by Mike.Beach

	[MR] Saving, applying, and displaying TrackingLatency and DepthOffset properties in the MR calibration process.

	#jira UE-54254, UE-54235

Change 3850224 by Mike.Beach

	[MR] Adding a way to omit certain MotionController components from the forced delay.

	#jira UE-54255

Change 3851434 by Mike.Beach

	[MR] Fixing up the projection plane depth tracking (needs to be disabled for certain calibration steps)
	  - Cleans up MRBillboard API
	  - New method to enable/disable HMD depth tracking (helpful for integrating depth camera's in the future)
	  - DepthOffset should now work properly

	#jira UE-54321, UE-54235

Change 3853799 by Mike.Beach

	[MR] Making LensDistortion a public dependency since it is included from a public header.

Change 3854608 by Mike.Beach

	[MR] Fixing it so the MR capture view point is delayed by the same latency that motion controllers are when it is attached to a motions controller itself.

	#jira UE-54255

Change 3855721 by Keli.Hlodversson

	Implement Lens Calibration Step.
	#jira UEVR-1061  Integrate OpenCV calibration into MRFramwrok calibration process (through Blueprints)

Change 3855841 by Keli.Hlodversson

	Fix Linux build after cl 3855721

Change 3858718 by Mike.Beach

	Allowing async node factory methods to have other out parameters that get exposed in Blueprints.

Change 3861345 by Mike.Beach

	Making changes to the XRAsset API - better handling asynchronous resource loading

	  * Added OnLoadComplete callback & ForceSynchronous params
	  * Moved/Renamed related BP functions to new XRAssetFunctionLib (added redirectors)
	  * Added async BP versions of the (now) blocking functions
	  * Fixed MotionControllerComponents to now set custom materials with the load callback

	Fixed MR calibration process to better display alignment models

	  * Switched back to using controller models for alignment (UE-54476)
	  * Using custom depth buffer to reject inner triangles so models are easier to make out when using transparency
	  * Handling SteamVR controller models with multiple materials (overriding all)

	#jira UE-54455, UE-54476

Change 3863839 by Ryan.Vance

	Integrating 3836507 to fix oculus depth rt related crashes

	#jira UE-54595, UE-54596, UE-54618

Change 3864970 by Mike.Beach

	[WIP] MR Calibration - Trying to make the controller models more visable/helpful during the alignment process (adding a outline PP effect - currently disabled since PostProcessing/Tonemapping has ill-effects on the camera texture).

Change 3865290 by Mike.Beach

	[WIP] MR Calibration - Specializing alignment positioning based off VR system (Oculus vs. Vive). Adjusting initial Vive alignment model so it centers in the middle of the screen (easier to align).

Change 3865357 by Joe.Graf

	Initial merge of Andrew's BackChannel and RemoteSession plugins

Change 3865379 by Joe.Graf

	Change filetype since +x was accidentally added

Change 3865515 by Jules.Blok

	Use center interpolation on normals for curvature-to-roughness

	Reduces aliasing artifacts when using curvature-to-roughness with MSAA

	#jira UEVR-684

Change 3865622 by Joe.Graf

	Fixed non-unity compile errors

Change 3865716 by Joe.Graf

	Attempt to fix line endings

Change 3865749 by Joe.Graf

	Another non-unity file fix

Change 3865782 by Joe.Graf

	Attempt to fix line endings

Change 3865789 by Joe.Graf

	Another non-unity fix

Change 3865891 by Mike.Beach

	Oculus SI 1.22 changes...
	  - OVRPlugin update
	  - Change to how Vulkan extensions are enumerated

Change 3867433 by Douglas.Copeland

	Fixing up M_Parallax_Cheap_Inst Content

Change 3867486 by Mike.Beach

	[WIP] MR Calibration - Adjusting the first alignment model for Oculus, so that it isn't clipped by the camera.

	#jira UE-54684

Change 3868302 by Mike.Beach

	[WIP] MR Calibration - Adding controls to toggle post-processing on/off for the MR feed, and a way to hide/show just the alignment model (and leave an outline when post-processing).

Change 3868359 by Mike.Beach

	Adding licensed models for the Rift HMD and sensors.

Change 3868410 by Mike.Beach

	Hiding the controller models for the Compositing Calibration step, & fixing the right hand model so it shows.

	#jira UE-54744

Change 3869755 by Joe.Graf

	Fixed static analysis warnings

Change 3869790 by Joe.Graf

	Changed a Warning to a Log since it looks like a c&p error

Change 3869887 by Arciel.Rekman

	Copying //UE4/Partner-Valve@3869880 to Dev-VR (//UE4/Dev-VR)

Change 3872154 by Mike.Beach

	[WIP] MR Calibration - Adjusting Oculus alignhment samples so the model is easier to align with.

	#jira UE-54745

Change 3872426 by Mike.Beach

	[WIP] MR Calibration - Adjusting Vive alignment samples so the model is easier to align with.

	#jira UE-54745

Change 3873216 by Nick.Atamas

	Merging CL 3829164 using //UE4/Dev-VR=>//Tasks/UE4/Dev-VR-4.19a

	Fixed iOS app using FVector4 safe zones because that is possible in 4.19

Change 3873548 by Nick.Atamas

	Merging CL 3847181 using //UE4/Dev-VR=>//Tasks/UE4/Dev-VR-4.19a

	#jira UE-53726

Change 3873791 by Nick.Atamas

	Merging //UE4/Dev-Main@3866324 to Dev-VR (//UE4/Dev-VR) to get missing files and fixing CIS.

Change 3875678 by Mike.Beach

	MR Calibration - Fixing the alignment adjustment step so it doesn't get stuck after taking samples.

	#jira UE-54906

Change 3875900 by Nick.Atamas

	Fixed scenario where geometries were being updated once per pin, instead of just being updated once.
	Also fixes a scenario where there are no pins and geometries fail to update.

Change 3877035 by Mike.Beach

	MR - Subscribing the MR framework to the PostLoad world delegate so it can spawn the MRCaptureActor needed to broadcast MR.

	#jira UE-54933

Change 3877904 by Joe.Graf

	Added  XRTracking support to the RemoteSession plugin so that you can control the remote camera with XRTracking inputs

Change 3877955 by Joe.Graf

	Added the RemoteSessionApp sample

Change 3880570 by Mike.Beach

	Adopted direct-to-layer rendering API changes from Oculus

Change 3881307 by Keli.Hlodversson

	Implement lens undistortion using OpenCV's initUndistortRectifyMap and a material for remapping the camera UVs based on the generated texture.
	#jira UE-52781

	Also changes the default size of the calibration chessboard to 9x6 inner edges.
	#jira UE-54679

Change 3882054 by Mike.Beach

	CIS fix - excluding new Oculus android lib (vrintegrationloader) from architechtures that it isn't compatible with (following vrapi's example).

Change 3885220 by Joe.Graf

	Blacklisted the BackChannel and RemoteSession plugins on HTML5

Change 3885776 by Keli.Hlodversson

	Fix static analysis warning when including OpenCV headers

Change 3888197 by Jules.Blok

	Use the WorldVertexNormal for curvature-to-roughness instead of the WorldNormal.

	This fixes aliasing artifacts when using curvature-to-roughness with normal maps.
	Also fixes a compilation error in DistortAccumulatePS.usf

	#jira UEVR-684
	#jira UE-55102

Change 3891444 by Mike.Beach

	Using the save object's full class name path so we can load from BP sub-object types from plugins (and discern between likenamed types).

	#jira UE-54945

Change 3891447 by Mike.Beach

	Labeling the spectator screen render call so it is distinguishable in profiles.

Change 3891459 by Mike.Beach

	[WIP] MR - Adding a debug option to visualize the MR camera in-game.

Change 3891462 by Mike.Beach

	Adding a standalone project for MR calibration app generation and testing.

	#jira UEVR-1070

Change 3891696 by Mike.Beach

	[WIP] MR - Now calibrating with the tracking origin at floor level so that the calibrated alignment is relative to the proper place.

	#jira UE-54945

Change 3892899 by Ryan.Vance

	Multi-view requires the day dream compositor.

Change 3896052 by Nick.Whiting

	Duplicating fix for VR motion controller lock in CL 3889470 from 4.19 to Dev-VR

Change 3897244 by Mike.Beach

	MR - Subscribing to an editor delegate so we can hook into PIE when it launches (so MR behaves like it does in -game, auto broadcasting).

	#jira UE-54944

Change 3897283 by Mike.Beach

	[WIP] MR - Utility material functions for converting from linear to sRGB space (and de-tonemapping) for the image from the camera feed.

	#jira UE-54663

Change 3897357 by Mike.Beach

	MR Calibration - Removing my own personal settings from the MRCalibration project.

Change 3897376 by Mike.Beach

	MR Calibration - Initialiting the input controller's mirror var so it matches the DisplayController's (else they start out of sync).

	#jira UE-55281

Change 3897381 by Mike.Beach

	[WIP] MR Calibration - Deleting extra input controller actor that mistakenly got added to the scene (likely from bad CAC loading).

	#jira UE-55279

Change 3897401 by Mike.Beach

	MR - Using the newly added material functions (CL 3897283) to convert the camera feed from linear space to sRGB.

	#jira UE-54663

Change 3897419 by Mike.Beach

	MR Calibration - Updating gabage matte step initialization to use new broadcasting framework.

	#jira UE-55287

Change 3897420 by Mike.Beach

	MR Calibration - Followup to CL 3897357; removing more of my personal settings that accidently got checked in.

Change 3897467 by Mike.Beach

	MR - Material for the camera card should be unlit.

Change 3899508 by Joe.Graf

	Added SupportAR so that ARKit is used for tracking in the RemoteSessionApp

Change 3901656 by Zak.Parrish

	Adding 3Lateral's kite boy head to DevVR

Change 3901705 by Mike.Beach

	MR - Fixing the load/saving of the calibrated camera orientation. Using the look-at axis was not enough to reconstruct the same transform.

Change 3902026 by Mike.Beach

	MR - Force activating the attached MotionController to account for failed auto-activation during initialization.

Change 3902089 by Mike.Beach

	Mirroring CL 3902082 from 4.19.
	Fixing an issue with the fix from CL 3889470 - fully matching the old UEnum name check (checking both the value name and the typed name, for example: "Left" and "EControllerHand::Left").

	#jira UE-55153

Change 3902110 by Mike.Beach

	MR - Fixing it so a MR save doesn't have to be present on load for the editor to run MR mode on PIE (can drop a MR sav with the editor already open).

Change 3902631 by Joe.Graf

	Fixed a bunch of shutdown related issues for remote sessions

Change 3904885 by Mike.Beach

	MR Calibration - Fixing the gabage matting mode so it properly saves/loads without stomping on existing save data.

	  * Switching over GarbageMattePawn (the last hold out) to be part of the modular calibration step system
	  * New CalibrationStep API where the implementor can request a save (TODO: port all existing steps over to new function)
	  * Cleaned up a lot of dead code in CalibrationController
	  * Refactored how the GarbageMatteActor works - switched calibration BP to be sub-class (to get implicit matte data saving)
	  * Added MinStartingStep so the calibration will always boot up to the CompositingCalibration step when loading a full calibration save
	  * Now only spawning the GarbageMatteComponent when we have garbage matte data

Change 3904915 by Mike.Beach

	CIS static analysis fix.

Change 3906571 by Keli.Hlodversson

	Multiple interdependent MR Calibration changes:

	Move undistortion support into the UMixedRealityCaptureComponent. Update UV undistortion texture when changing lens parameters.
	Use our own struct to store lens duistortion settings, as we no longer depend on the LensDistortion/Composure plugin #jira UEVR-1073
	Change undistortion to happen at the right place (ie. on camera output only and not on the final composed image)
	Move OpenCVHelper into its own module, as both MixedRealityFramework and MixedRealityCalibration now depend on it.
	Use calculated FOV after uindistortion and apply it to capture component #jira UE-55194
	Display calculated FOV progressively during lens calibration #jira UE-55191

Change 3907398 by Mike.Beach

	MR Calibration - Fixing issue where the chroma key tweaks were not being applied to the preview.

Change 3908291 by Joe.Graf

	Merged over the clang warning suppression for unused lambda captures

Change 3908707 by Keli.Hlodversson

	Fix MR compilation on Linux. (OpenCVHelper is now enabled on that platform, even though OpenCV isn't)
	Remove dependency on LensDistortion plugin.

Change 3909229 by Mike.Beach

	MR Calibration - Adding debug ability to skip lens calibration (End/Backspace)

Change 3909889 by Mike.Beach

	[WIP] MR - Adjusting MR matierals and default CaptureSource to fight dark camera feed and to have scene rendering go through post-processing.

	#jira UE-54663, UE-55324

Change 3910454 by Mike.Beach

	[WIP] MR Calibration - Switching over all calibration steps to the new save API.

Change 3910942 by Mike.Beach

	[WIP] MR Calibration - Adding an accept/redo screen to the lens calibration step (and making it so you can debug skip through the initial snapshot phase).

	#jira UE-55190

Change 3910943 by Mike.Beach

	[WIP] MR - Removing some uneeded cruft in the MR util library.

Change 3913041 by Joe.Graf

	Xcode 9.3 clang warning fixes

Change 3913146 by Joe.Graf

	Changed the remote session app to default to 60 fps

Change 3914885 by Mike.Beach

	CIS fixes

Change 3919437 by Nick.Whiting

	UE-55674:  Fix for SteamVR on Mac causing crash.  SteamVR was picking the wrong texture format because we were testing against the supported ShaderModel before it was actually set.  It was asking for an OpenGL device context on Mac, which isn't supported

Change 3921833 by Joe.Graf

	Fixed bad defines that triggered errors when fixing the XCode 9.3 Beta errors

	#jira: UE-55752

Change 3926388 by Ryan.Vance

	#jira UE-55666

	Precision conversion nonsense

Change 3931840 by Mike.Beach

	Setting the new RemoteSession plugin to not auto-host.

	#jira UE-55841

Change 3626718 by Ryan.Vance

	Oculus changes for SI1.16 and SI1.17
	Adds Vulkan and D3D12 improvements/fixes for VR, depth target allocation for VR plugins, Android thread naming and a number of new Oculus features.

[CL 3932718 by Jeff Fisher in Main branch]
2018-03-07 17:03:49 -05:00
..

INCLUDE TOOL

The IncludeTool utility can be used to convert existing C++ projects into an include-what-you-use style. It does so by attempting to form self-contained translation units out of each header file.

While it can save a lot of time, it is based on a heuristic, and is highly unlikely to produce perfect output - rather, it may produce a starting point from which you can make manual edits to complete the transition. Even then, it operates by brute force (so is agnonizingly slow; in the order of taking several days to complete for large projects), is painful to iterate on, may require project-specific modifications, and can be obtuse to debug.

It has been used to convert a number of internal Epic projects and the engine itself, and while we provide it as a courtesy, the level of support we can provide for it will be limited.

OPERATION

IncludeTool operates in several phases:

  • UnrealBuildTool is invoked with a target to generate a list of build steps. The project's editor target is recommended, since it typically includes more code paths than any other target type. We also recommend compiling for Linux using the cross-compile toolchain from windows, so as to use the Clang toolchain. Using Clang is important, because Visual C++ doesn't do two phase name lookup. That fails to find dependencies from template classes on dependent classes until those templates are instantiated, which can make a real mess of the output.

  • The source files are partially preprocessed using an internal preprocessor. This does not transform the tokenized source file itself, but determines which blocks of code are active and inactive for the current target, and splits each file into a series of fragments. Each fragment defines a range of lines in the source file between #include directives, meaning that a single-file version of any source file can be assembled at any point by recursively following #include directives and concatenating the list of fragments encountered.

    This step is important, because it is the list of fragments which IncludeTool is going to optimize. There are several restrictions that IncludeTool validates during this phase and issues warnings about - some appear pedantic and stylistic, but are required to ensure that the output is valid. Particularly notable are:

    • There should be no circular includes between header files
    • Included source file must be preprocessed in the same way by every translation unit (ie. any macro must be defined the same way in every context that it is included).
  • Each fragment is written to the working folder. To preserve line numbers, each source file is output in its original layout, but with lines belonging to other fragments commented out.

  • Source files are tokenized and searched for patterns that look like symbols that can be forward declared. (eg. "class Foo { ...")

  • Each source file is brute-force compiled to determine which fragments it depends on to compile successfully. This is the most labor intensive part of the transformation, but the results from this analysis are stored in the working directory, and should be reusable if source files do not change. The tool also supports a "sharded" mode for using multiple PCs to compute the dependency data (see below).

    The search is structured as follows:

    • An input translation unit is expanded to be represented by a sequence of fragments (1...n).
    • A set of the required fragments (r) is initialized to only those fragments that were in the input file (ie. rather than being included by the input file).
    • A binary search is performed to find the longest sequence of fragments required for the source file to still successfully compile (1...m, with r).
    • The last fragment in the sequence (m), is added to the required set (r). If 'm' has already been optimized, its dependencies are also added to r.
    • The binary search is repeated for the sequence of fragments (1...m - 1).
  • Each output file is written with a minimal set of includes for it to compile in isolation. The heuristic used attempts to directly include the header for any dependency containing a symbol that is explicitly referenced by name, and only include other dependencies if they are not included recursively.

EXAMPLE USAGE

To just do the fragment analysis and output diagnostic information:

-Mode=Scan -Target=FooEditor -Platform=Linux -Configuration=Development -WorkingDir=D:\Working

To optimize a codebase:

-Mode=Optimize -Target=FooEditor -Platform=Linux -Configuration=Development -WorkingDir=D:\Working -OutputDir=D:\Output -SourceFiles=-/Engine/... -OptimizeFiles=-/Engine/... -OutputFiles=-/Engine/...

Several filter arguments may be passed to limit source files iteration (-SourceFiles, -OptimizeFiles, -OutputFiles). Each can take a semicolon list of P4-style wildcards to include (/Engine/...) or exclude (-/Engine/Foo.cpp) files, or may specify a response file with rules, one per line (@D:\Filter.txt). In general, you probably don't want to re-optimize engine code, so it makes sense to exclude all of those from analysis.

Since the program can take so long to run, it does have a facility for running in "sharded" mode. If you have several PCs all synced up to the same source tree, you can use the -Shard=N and -NumShards=M to configure a machine to only consider a portion of the input set. The working directories should be in the same location on each machine, and the resulting working directories can be copied together and used for a final run on a single machine to generate output files.

See comments in Program.cs for other modes (the ToolMode enum) and command-line options (the CommandLineOptions class).