MaterialBuilderUtils.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AssetBuilderSDK/AssetBuilderSDK.h>
  10. namespace AZ
  11. {
  12. namespace RPI
  13. {
  14. namespace MaterialBuilderUtils
  15. {
  16. //! @brief configure and register a job dependency with the job descriptor
  17. //! @param jobDescriptor job descriptor to which dependency will be added
  18. //! @param path path to the source file for the dependency
  19. //! @param jobKey job key for the builder processing the dependency
  20. //! @param platformId list of platform IDs to monitor for the job dependency
  21. //! @param subIds list of sub IDs that should be monitored for assets created by the job dependency
  22. //! @param updateFingerprint flag specifying if the job descriptor fingerprint should be updated with information from the
  23. //! dependency file
  24. //! @return reference to the new job dependency added to the job descriptor dependency container
  25. AssetBuilderSDK::JobDependency& AddJobDependency(
  26. AssetBuilderSDK::JobDescriptor& jobDescriptor,
  27. const AZStd::string& path,
  28. const AZStd::string& jobKey,
  29. const AZStd::string& platformId = {},
  30. const AZStd::vector<AZ::u32>& subIds = {},
  31. const bool updateFingerprint = true);
  32. //! Resolve potential paths and add source and job dependencies for image assets
  33. //! @param originatingSourceFilePath The path of the .material or .materialtype file being processed
  34. //! @param referencedSourceFilePath The path to the referenced file as it appears in the current file
  35. //! @param jobDescriptor Used to update job dependencies
  36. void AddPossibleImageDependencies(
  37. const AZStd::string& originatingSourceFilePath,
  38. const AZStd::string& referencedSourceFilePath,
  39. AssetBuilderSDK::JobDescriptor& jobDescriptor);
  40. //! Append a fingerprint value to the job descriptor using the file modification time of the specified file path
  41. void AddFingerprintForDependency(const AZStd::string& path, AssetBuilderSDK::JobDescriptor& jobDescriptor);
  42. } // namespace MaterialBuilderUtils
  43. } // namespace RPI
  44. } // namespace AZ