ShaderManagementConsoleDocumentRequestBus.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 <Atom/RPI.Edit/Shader/ShaderSourceData.h>
  10. #include <Atom/RPI.Edit/Shader/ShaderVariantListSourceData.h>
  11. #include <Atom/RPI.Reflect/Shader/ShaderOptionGroupLayout.h>
  12. #include <AzCore/Asset/AssetCommon.h>
  13. namespace ShaderManagementConsole
  14. {
  15. class ShaderManagementConsoleDocumentRequests : public AZ::EBusTraits
  16. {
  17. public:
  18. static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple;
  19. static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById;
  20. typedef AZ::Uuid BusIdType;
  21. //! Set the shader variant list source data on the document.
  22. //! This function can be used to edit and update the data contained within the document.
  23. //! Functions can be added to this bus for more fine grained editing of shader variant list data.
  24. virtual void SetShaderVariantListSourceData(const AZ::RPI::ShaderVariantListSourceData& shaderVariantListSourceData) = 0;
  25. //! Get the shader variant list source data from the document.
  26. virtual const AZ::RPI::ShaderVariantListSourceData& GetShaderVariantListSourceData() const = 0;
  27. //! Get the number of shader options stored in the shader asset.
  28. //! Note that the shader asset can contain more descriptors than are stored in the shader variant list source data.
  29. virtual size_t GetShaderOptionDescriptorCount() const = 0;
  30. //! Get the shader option descriptor from the shader asset.
  31. //! Note that the shader asset can contain more descriptors than are stored in the shader variant list source data.
  32. virtual const AZ::RPI::ShaderOptionDescriptor& GetShaderOptionDescriptor(size_t index) const = 0;
  33. };
  34. using ShaderManagementConsoleDocumentRequestBus = AZ::EBus<ShaderManagementConsoleDocumentRequests>;
  35. } // namespace ShaderManagementConsole