refactor: route builtin object-id pass through shader assets
This commit is contained in:
@@ -3,6 +3,9 @@
|
||||
#include <XCEngine/Rendering/ObjectIdPass.h>
|
||||
#include <XCEngine/Rendering/ObjectIdEncoding.h>
|
||||
#include <XCEngine/Rendering/RenderResourceCache.h>
|
||||
#include <XCEngine/Core/Asset/ResourceHandle.h>
|
||||
#include <XCEngine/RHI/RHIPipelineState.h>
|
||||
#include <XCEngine/Resources/Shader/Shader.h>
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
@@ -14,6 +17,8 @@ class BuiltinObjectIdPass final : public ObjectIdPass {
|
||||
public:
|
||||
~BuiltinObjectIdPass() override;
|
||||
|
||||
static RHI::InputLayoutDesc BuildInputLayout();
|
||||
|
||||
bool Render(
|
||||
const RenderContext& context,
|
||||
const RenderSurface& surface,
|
||||
@@ -49,6 +54,7 @@ private:
|
||||
RHI::RHIType m_backendType = RHI::RHIType::D3D12;
|
||||
RHI::RHIPipelineLayout* m_pipelineLayout = nullptr;
|
||||
RHI::RHIPipelineState* m_pipelineState = nullptr;
|
||||
Resources::ResourceHandle<Resources::Shader> m_builtinObjectIdShader;
|
||||
RenderResourceCache m_resourceCache;
|
||||
std::unordered_map<uint64_t, OwnedDescriptorSet> m_perObjectSets;
|
||||
};
|
||||
|
||||
@@ -24,6 +24,7 @@ const char* GetBuiltinPrimitiveDisplayName(BuiltinPrimitiveType primitiveType);
|
||||
Containers::String GetBuiltinPrimitiveMeshPath(BuiltinPrimitiveType primitiveType);
|
||||
Containers::String GetBuiltinDefaultPrimitiveMaterialPath();
|
||||
Containers::String GetBuiltinForwardLitShaderPath();
|
||||
Containers::String GetBuiltinObjectIdShaderPath();
|
||||
Containers::String GetBuiltinDefaultPrimitiveTexturePath();
|
||||
|
||||
bool TryParseBuiltinPrimitiveType(const Containers::String& path, BuiltinPrimitiveType& outPrimitiveType);
|
||||
|
||||
Reference in New Issue
Block a user