Add gaussian splat asset caching groundwork
This commit is contained in:
@@ -112,6 +112,10 @@ public:
|
||||
|
||||
private:
|
||||
static constexpr Core::uint32 kBaseImporterVersion = 7;
|
||||
enum class SourceHashPolicy : Core::uint8 {
|
||||
PreserveOrClear = 0,
|
||||
EnsureCurrent = 1
|
||||
};
|
||||
|
||||
void EnsureProjectLayout();
|
||||
void LoadSourceAssetDB();
|
||||
@@ -126,6 +130,7 @@ private:
|
||||
|
||||
bool EnsureMetaForPath(const std::filesystem::path& sourcePath,
|
||||
bool isFolder,
|
||||
SourceHashPolicy sourceHashPolicy,
|
||||
SourceAssetRecord& outRecord);
|
||||
bool ReadMetaFile(const std::filesystem::path& metaPath,
|
||||
SourceAssetRecord& inOutRecord) const;
|
||||
|
||||
@@ -70,6 +70,16 @@ private:
|
||||
RHI::RHIDescriptorSet* set = nullptr;
|
||||
};
|
||||
|
||||
struct CompositePipelineResources {
|
||||
RHI::RHIPipelineLayout* pipelineLayout = nullptr;
|
||||
RHI::RHIPipelineState* pipelineState = nullptr;
|
||||
OwnedDescriptorSet textureSet = {};
|
||||
RHI::RHIResourceView* boundAccumulationView = nullptr;
|
||||
RHI::Format renderTargetFormat = RHI::Format::Unknown;
|
||||
Core::uint32 sampleCount = 1u;
|
||||
Core::uint32 sampleQuality = 0u;
|
||||
};
|
||||
|
||||
struct PassLayoutKey {
|
||||
const Resources::Shader* shader = nullptr;
|
||||
Containers::String passName;
|
||||
@@ -285,10 +295,21 @@ private:
|
||||
const RenderSurface& surface,
|
||||
const RenderSceneData& sceneData,
|
||||
const VisibleGaussianSplatItem& visibleGaussianSplat);
|
||||
bool EnsureCompositeResources(
|
||||
const RenderContext& context,
|
||||
const RenderSurface& surface);
|
||||
bool CreateCompositeResources(
|
||||
const RenderContext& context,
|
||||
const RenderSurface& surface);
|
||||
void DestroyCompositeResources();
|
||||
bool CompositeAccumulationSurface(
|
||||
const RenderPassContext& context,
|
||||
RHI::RHIResourceView* accumulationTextureView);
|
||||
|
||||
RHI::RHIDevice* m_device = nullptr;
|
||||
RHI::RHIType m_backendType = RHI::RHIType::D3D12;
|
||||
Resources::ResourceHandle<Resources::Shader> m_builtinGaussianSplatShader;
|
||||
Resources::ResourceHandle<Resources::Shader> m_builtinGaussianSplatCompositeShader;
|
||||
Resources::ResourceHandle<Resources::Shader> m_builtinGaussianSplatUtilitiesShader;
|
||||
std::unique_ptr<Resources::Material> m_builtinGaussianSplatMaterial;
|
||||
RenderResourceCache m_resourceCache;
|
||||
@@ -298,6 +319,7 @@ private:
|
||||
std::unordered_map<PipelineStateKey, RHI::RHIPipelineState*, PipelineStateKeyHash> m_pipelineStates;
|
||||
std::unordered_map<ComputePipelineKey, RHI::RHIPipelineState*, ComputePipelineKeyHash> m_computePipelineStates;
|
||||
std::unordered_map<DynamicDescriptorSetKey, CachedDescriptorSet, DynamicDescriptorSetKeyHash> m_dynamicDescriptorSets;
|
||||
CompositePipelineResources m_compositeResources = {};
|
||||
};
|
||||
|
||||
} // namespace Passes
|
||||
|
||||
@@ -39,6 +39,7 @@ Containers::String GetBuiltinSelectionMaskShaderPath();
|
||||
Containers::String GetBuiltinSelectionOutlineShaderPath();
|
||||
Containers::String GetBuiltinSkyboxShaderPath();
|
||||
Containers::String GetBuiltinGaussianSplatShaderPath();
|
||||
Containers::String GetBuiltinGaussianSplatCompositeShaderPath();
|
||||
Containers::String GetBuiltinGaussianSplatUtilitiesShaderPath();
|
||||
Containers::String GetBuiltinVolumetricShaderPath();
|
||||
Containers::String GetBuiltinColorScalePostProcessShaderPath();
|
||||
|
||||
Reference in New Issue
Block a user