Extract editor-owned scene viewport pass specs

This commit is contained in:
2026-04-04 16:29:06 +08:00
parent 1a236b866d
commit 9f8ab921bc
8 changed files with 87 additions and 24 deletions

View File

@@ -1,3 +1,5 @@
#include <XCEngine/Core/Asset/ResourceManager.h>
#include "Passes/SceneViewportSelectionOutlinePass.h"
#include "Viewport/SceneViewportShaderPaths.h"
@@ -13,7 +15,7 @@ public:
SceneViewportSelectionOutlinePassRenderer& renderer,
RHI::RHIResourceView* objectIdTextureView,
std::vector<uint64_t> selectedObjectIds,
const Rendering::Passes::ObjectIdOutlineStyle& style)
const SceneViewportSelectionOutlineStyle& style)
: m_renderer(renderer)
, m_objectIdTextureView(objectIdTextureView)
, m_selectedObjectIds(std::move(selectedObjectIds))
@@ -37,7 +39,7 @@ private:
SceneViewportSelectionOutlinePassRenderer& m_renderer;
RHI::RHIResourceView* m_objectIdTextureView = nullptr;
std::vector<uint64_t> m_selectedObjectIds = {};
Rendering::Passes::ObjectIdOutlineStyle m_style = {};
SceneViewportSelectionOutlineStyle m_style = {};
};
} // namespace
@@ -55,20 +57,20 @@ bool SceneViewportSelectionOutlinePassRenderer::Render(
const Rendering::RenderSurface& surface,
RHI::RHIResourceView* objectIdTextureView,
const std::vector<uint64_t>& selectedObjectIds,
const Rendering::Passes::ObjectIdOutlineStyle& style) {
const SceneViewportSelectionOutlineStyle& style) {
return m_outlinePass.Render(
renderContext,
surface,
objectIdTextureView,
selectedObjectIds,
style);
ToBuiltinSceneViewportSelectionOutlineStyle(style));
}
std::unique_ptr<Rendering::RenderPass> CreateSceneViewportSelectionOutlinePass(
SceneViewportSelectionOutlinePassRenderer& renderer,
RHI::RHIResourceView* objectIdTextureView,
const std::vector<uint64_t>& selectedObjectIds,
const Rendering::Passes::ObjectIdOutlineStyle& style) {
const SceneViewportSelectionOutlineStyle& style) {
return std::make_unique<SceneViewportSelectionOutlinePass>(
renderer,
objectIdTextureView,