7#include <unordered_set>
10#include "shader/general/resource/binding/ShaderResourceBinding.h"
11#include "render/general/pipeline/PipelineShaderConstantsManager.hpp"
12#include "shader/general/resource/ShaderArrayIndexManager.h"
15#include "vulkan/vulkan.h"
85 Error error(std::format(
86 "shader resource \"{}\" was requested to set its push constant "
87 "index but this shader resource does not reference the specified pipeline",
96 it->second.iPushConstantIndex, it->second.pShaderArrayIndex->getActualIndex());
110 [[nodiscard]]
virtual std::optional<Error>
111 useNewTexture(std::unique_ptr<TextureHandle> pTextureToUse)
override;
129 [[nodiscard]]
virtual std::optional<Error>
145 const std::string& sResourceName,
146 std::unique_ptr<TextureHandle> pTextureToUse,
147 std::unordered_map<VulkanPipeline*, PushConstantIndices> pushConstantIndices);
171 static std::variant<std::unique_ptr<ShaderTextureResourceBinding>,
Error>
create(
173 const std::unordered_set<Pipeline*>& pipelinesToUse,
174 std::unique_ptr<TextureHandle> pTextureToUse);
202 VkImageView pTextureView,
203 unsigned int iIndexIntoShaderArray);
209 std::pair<std::recursive_mutex, std::unordered_map<VulkanPipeline*, PushConstantIndices>>
std::string getFullErrorMessage() const
Definition: Error.cpp:84
void showError() const
Definition: Error.cpp:102
Definition: GlslShaderTextureResourceBinding.h:23
std::string getPathToTextureResource()
Definition: GlslShaderTextureResourceBinding.cpp:235
void copyResourceIndexToPushConstants(PipelineShaderConstantsManager *pPushConstantsManager, VulkanPipeline *pUsedPipeline)
Definition: GlslShaderTextureResourceBinding.h:77
static std::variant< std::unique_ptr< ShaderTextureResourceBinding >, Error > create(const std::string &sShaderResourceName, const std::unordered_set< Pipeline * > &pipelinesToUse, std::unique_ptr< TextureHandle > pTextureToUse)
Definition: GlslShaderTextureResourceBinding.cpp:16
virtual std::optional< Error > changeUsedPipelines(const std::unordered_set< Pipeline * > &pipelinesToUse) override
Definition: GlslShaderTextureResourceBinding.cpp:274
std::pair< std::recursive_mutex, std::unordered_map< VulkanPipeline *, PushConstantIndices > > mtxPushConstantIndices
Definition: GlslShaderTextureResourceBinding.h:210
virtual std::optional< Error > onAfterAllPipelinesRefreshedResources() override
Definition: GlslShaderTextureResourceBinding.cpp:189
std::pair< std::mutex, std::unique_ptr< TextureHandle > > mtxUsedTexture
Definition: GlslShaderTextureResourceBinding.h:206
static std::optional< Error > bindTextureToShaderDescriptorArray(const std::string &sShaderResourceName, VulkanPipeline *pPipelineWithDescriptors, VkImageView pTextureView, unsigned int iIndexIntoShaderArray)
Definition: GlslShaderTextureResourceBinding.cpp:125
virtual std::optional< Error > useNewTexture(std::unique_ptr< TextureHandle > pTextureToUse) override
Definition: GlslShaderTextureResourceBinding.cpp:242
static std::variant< std::unique_ptr< ShaderArrayIndex >, Error > getTextureIndexInShaderArray(const std::string &sShaderResourceName, VulkanPipeline *pPipelineToLookIn)
Definition: GlslShaderTextureResourceBinding.cpp:96
Definition: PipelineShaderConstantsManager.hpp:14
void copyValueToShaderConstant(size_t iShaderConstantIndex, unsigned int iValueToCopy)
Definition: PipelineShaderConstantsManager.hpp:75
std::string getShaderResourceName() const
Definition: ShaderResourceBinding.cpp:11
const std::string sShaderResourceName
Definition: ShaderResourceBinding.h:82
Definition: ShaderTextureResourceBindingManager.h:27
Definition: ShaderResourceBinding.h:86
Definition: VulkanPipeline.h:21
Definition: GlslShaderTextureResourceBinding.h:28
size_t iPushConstantIndex
Definition: GlslShaderTextureResourceBinding.h:55
PushConstantIndices(PushConstantIndices &&)=default
PushConstantIndices & operator=(PushConstantIndices &&)=default
PushConstantIndices()=default
std::unique_ptr< ShaderArrayIndex > pShaderArrayIndex
Definition: GlslShaderTextureResourceBinding.h:58
PushConstantIndices(size_t iPushConstantIndex, std::unique_ptr< ShaderArrayIndex > pShaderArrayIndex)
Definition: GlslShaderTextureResourceBinding.h:38