Nameless Engine
Loading...
Searching...
No Matches
HlslGlobalShaderResourceBinding.h
1#pragma once
2
3// Standard.
4#include <optional>
5#include <functional>
6
7// Custom.
8#include "shader/general/resource/binding/global/GlobalShaderResourceBinding.h"
9#include "render/directx/descriptors/DirectXDescriptorType.hpp"
10
11// External.
12#include "vulkan/vulkan_core.h"
13
14namespace ne {
15 class PipelineManager;
16 class GpuResource;
17 class Pipeline;
18 class DirectXResource;
19
25 // Only base class is allowed to create such objects.
26 friend class GlobalShaderResourceBinding;
27
28 public:
30
31 virtual ~HlslGlobalShaderResourceBinding() override;
32
33 protected:
46 const std::string& sShaderResourceName,
47 const std::array<GpuResource*, FrameResourceManager::getFrameResourceCount()>& vResourcesToBind);
48
57 [[nodiscard]] virtual std::optional<Error> bindToPipelines(Pipeline* pSpecificPipeline) override;
58
59 private:
68 [[nodiscard]] static std::optional<Error> bindResourceToGraphicsPipelines(
69 PipelineManager* pPipelineManager,
70 const std::function<std::optional<Error>(Pipeline* pPipeline)>& onBind);
71
82 [[nodiscard]] static std::optional<Error> bindResourcesToPipeline(
84 vResourcesToBind,
85 DirectXDescriptorType bindingType,
86 Pipeline* pPipeline,
87 const std::string& sShaderResourceName);
88 };
89}
Definition: DirectXResource.h:32
static constexpr unsigned int getFrameResourceCount()
Definition: FrameResourceManager.h:74
Definition: GlobalShaderResourceBindingManager.h:21
Definition: GlobalShaderResourceBinding.h:27
GlobalShaderResourceBindingManager *const pManager
Definition: GlobalShaderResourceBinding.h:121
const std::string sShaderResourceName
Definition: GlobalShaderResourceBinding.h:110
Definition: GpuResource.h:16
Definition: HlslGlobalShaderResourceBinding.h:24
static std::optional< Error > bindResourceToGraphicsPipelines(PipelineManager *pPipelineManager, const std::function< std::optional< Error >(Pipeline *pPipeline)> &onBind)
Definition: HlslGlobalShaderResourceBinding.cpp:98
static std::optional< Error > bindResourcesToPipeline(const std::array< DirectXResource *, FrameResourceManager::getFrameResourceCount()> &vResourcesToBind, DirectXDescriptorType bindingType, Pipeline *pPipeline, const std::string &sShaderResourceName)
Definition: HlslGlobalShaderResourceBinding.cpp:125
virtual std::optional< Error > bindToPipelines(Pipeline *pSpecificPipeline) override
Definition: HlslGlobalShaderResourceBinding.cpp:20
Definition: PipelineManager.h:54
Definition: Pipeline.h:20