/* * Copyright (c) Contributors to the Open 3D Engine Project. * For complete copyright and license terms please see the LICENSE at the root of this distribution. * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #pragma once #include #include #include #include #include #include #include #include #include #include namespace AtomSampleViewer { class TriangleExampleComponent final : public BasicRHIComponent { public: AZ_COMPONENT(TriangleExampleComponent, "{4807DFB6-4530-4D37-AF26-E8A4C130F7DC}", AZ::Component); AZ_DISABLE_COPY(TriangleExampleComponent); static void Reflect(AZ::ReflectContext* context); TriangleExampleComponent(); ~TriangleExampleComponent() override = default; protected: // AZ::Component void Activate() override; void Deactivate() override; // RHISystemNotificationBus::Handler void OnFramePrepare(AZ::RHI::FrameGraphBuilder& frameGraphBuilder) override; AZ::RHI::Ptr m_inputAssemblyBufferPool; AZ::RHI::Ptr m_inputAssemblyBuffer; AZ::RHI::ConstPtr m_pipelineState; AZ::Data::Instance m_shaderResourceGroup; AZ::RHI::ShaderInputConstantIndex m_objectMatrixConstantIndex; struct BufferData { AZStd::array m_positions; AZStd::array m_colors; AZStd::array m_indices; }; AZStd::array m_streamBufferViews; AZ::RHI::DrawItem m_drawItem; }; } // namespace AtomSampleViewer