45 bool updateIfNeeded(
bool force =
false);
47 void addDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout);
48 void setDescriptorSetLayouts(std::initializer_list<VkDescriptorSetLayout> descriptorSetLayouts);
49 void setDescriptorSetLayouts(std::vector<VkDescriptorSetLayout>
const& descriptorSetLayouts);
50 [[nodiscard]] std::vector<VkDescriptorSetLayout>
const& getDescriptorSetLayouts()
const;
52 void addPushConstantRanges(std::vector<VkPushConstantRange>
const& pushConstantRanges);
53 void setPushConstantRanges(std::initializer_list<VkPushConstantRange> pushConstantRanges);
54 void setPushConstantRanges(std::vector<VkPushConstantRange>
const& pushConstantRanges);
55 [[nodiscard]] std::vector<VkPushConstantRange>
const& getPushConstantRanges()
const;
57 [[nodiscard]] VkPipelineLayout get()
const;
63 VkShaderModule _vertexShader;
64 VkShaderModule _geometryShader;
65 VkShaderModule _fragmentShader;
69 [[nodiscard]] std::size_t operator()(
Key const& r)
const;
74 [[nodiscard]]
bool operator()(
Key const& lhs,
Key const& rhs)
const;
81 mutable bool g_needUpdate;
83 mutable VkPipelineLayout g_pipeline;
85 std::vector<VkPushConstantRange> g_pushConstantRanges;
86 std::vector<VkDescriptorSetLayout> g_descriptorSetLayouts;
100 bool updateIfNeeded(VkRenderPass renderPass,
bool force =
false);
102 void clearShader(Shader::Type type = Shader::Type::SHADER_NONE);
103 void setShader(
Shader const& shader);
104 [[nodiscard]]
Shader const* getShader(Shader::Type type = Shader::Type::SHADER_NONE)
const;
106 void setBlendMode(
BlendMode const& blendMode);
107 [[nodiscard]]
BlendMode const& getBlendMode()
const;
109 void setPrimitiveTopology(VkPrimitiveTopology topology)
const;
110 [[nodiscard]] VkPrimitiveTopology getPrimitiveTopology()
const;
114 VkRect2D
const& scissor,
118 void setPipelineLayout(
LayoutPipeline const& layoutPipeline)
const;
119 [[nodiscard]] VkPipelineLayout getPipelineLayout()
const;
120 [[nodiscard]] VkPipeline getPipeline()
const;
122 void destroy()
final;
126 VkShaderModule _shaderCompute;
127 VkShaderModule _shaderVertex;
128 VkShaderModule _shaderFragment;
129 VkShaderModule _shaderGeometry;
131 VkPrimitiveTopology _primitiveTopology;
135 VkPipelineLayout _pipelineLayout;
139 [[nodiscard]] std::size_t operator()(
Key const& r)
const;
144 [[nodiscard]]
bool operator()(
Key const& lhs,
Key const& rhs)
const;
151 mutable bool g_needUpdate;
153 Shader const* g_shaderCompute;
154 Shader const* g_shaderVertex;
155 Shader const* g_shaderFragment;
156 Shader const* g_shaderGeometry;
158 mutable VkPrimitiveTopology g_primitiveTopology;
162 mutable VkPipelineLayout g_pipelineLayout;
163 mutable VkPipeline g_graphicsPipeline;
Definition C_contextAware.hpp:28
Vulkan context.
Definition C_context.hpp:70