Adopt binding plan for builtin object-id pass
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <XCEngine/Rendering/ObjectIdPass.h>
|
||||
#include <XCEngine/Rendering/ObjectIdEncoding.h>
|
||||
#include <XCEngine/Rendering/RenderMaterialUtility.h>
|
||||
#include <XCEngine/Rendering/RenderResourceCache.h>
|
||||
#include <XCEngine/Core/Asset/ResourceHandle.h>
|
||||
#include <XCEngine/RHI/RHIPipelineState.h>
|
||||
@@ -54,6 +55,8 @@ private:
|
||||
RHI::RHIType m_backendType = RHI::RHIType::D3D12;
|
||||
RHI::RHIPipelineLayout* m_pipelineLayout = nullptr;
|
||||
RHI::RHIPipelineState* m_pipelineState = nullptr;
|
||||
PassResourceBindingLocation m_perObjectBinding = {};
|
||||
Core::uint32 m_firstDescriptorSet = 0;
|
||||
Resources::ResourceHandle<Resources::Shader> m_builtinObjectIdShader;
|
||||
RenderResourceCache m_resourceCache;
|
||||
std::unordered_map<uint64_t, OwnedDescriptorSet> m_perObjectSets;
|
||||
|
||||
@@ -229,6 +229,19 @@ inline Containers::Array<Resources::ShaderResourceBindingDesc> BuildLegacyBuilti
|
||||
return bindings;
|
||||
}
|
||||
|
||||
inline Containers::Array<Resources::ShaderResourceBindingDesc> BuildLegacyBuiltinObjectIdPassResourceBindings() {
|
||||
Containers::Array<Resources::ShaderResourceBindingDesc> bindings;
|
||||
bindings.Resize(1);
|
||||
|
||||
bindings[0].name = "PerObjectConstants";
|
||||
bindings[0].type = Resources::ShaderResourceType::ConstantBuffer;
|
||||
bindings[0].set = 0;
|
||||
bindings[0].binding = 0;
|
||||
bindings[0].semantic = "PerObject";
|
||||
|
||||
return bindings;
|
||||
}
|
||||
|
||||
inline bool IsBuiltinPassResourceTypeCompatible(
|
||||
BuiltinPassResourceSemantic semantic,
|
||||
Resources::ShaderResourceType type) {
|
||||
|
||||
Reference in New Issue
Block a user