#pragma once #include #include #include #include #include #include #include #include #include #include #include #include #include namespace XCEngine { namespace Editor { class SceneViewportSelectionOutlinePass { public: ~SceneViewportSelectionOutlinePass() = default; static constexpr uint32_t kMaxSelectedObjectCount = 256u; void Shutdown(); bool Render( const Rendering::RenderContext& renderContext, const Rendering::RenderSurface& surface, RHI::RHIResourceView* objectIdTextureView, const std::vector& selectedObjectIds, bool debugSelectionMask = false); private: struct OutlineConstants { Math::Vector4 viewportSizeAndTexelSize = Math::Vector4::Zero(); Math::Vector4 outlineColorAndWidth = Math::Vector4::Zero(); Math::Vector4 selectedInfo = Math::Vector4::Zero(); std::array selectedObjectColors = {}; }; bool EnsureInitialized(const Rendering::RenderContext& renderContext); bool CreateResources(const Rendering::RenderContext& renderContext); void DestroyResources(); RHI::RHIDevice* m_device = nullptr; RHI::RHIType m_backendType = RHI::RHIType::D3D12; RHI::RHIPipelineLayout* m_pipelineLayout = nullptr; RHI::RHIPipelineState* m_pipelineState = nullptr; RHI::RHIDescriptorPool* m_constantPool = nullptr; RHI::RHIDescriptorSet* m_constantSet = nullptr; RHI::RHIDescriptorPool* m_texturePool = nullptr; RHI::RHIDescriptorSet* m_textureSet = nullptr; }; } // namespace Editor } // namespace XCEngine