15 #include <vsg/state/BindDescriptorSet.h>
16 #include <vsg/state/ColorBlendState.h>
17 #include <vsg/state/DepthStencilState.h>
18 #include <vsg/state/DescriptorBuffer.h>
19 #include <vsg/state/DescriptorImage.h>
20 #include <vsg/state/DescriptorSetLayout.h>
21 #include <vsg/state/DynamicState.h>
22 #include <vsg/state/GraphicsPipeline.h>
23 #include <vsg/state/InputAssemblyState.h>
24 #include <vsg/state/MultisampleState.h>
25 #include <vsg/state/RasterizationState.h>
26 #include <vsg/state/TessellationState.h>
27 #include <vsg/state/VertexInputState.h>
28 #include <vsg/state/ViewportState.h>
29 #include <vsg/utils/ShaderSet.h>
30 #include <vsg/utils/SharedObjects.h>
42 bool blending =
false;
43 bool two_sided =
false;
49 bool enableTexture(
const std::string& name);
51 bool assignTexture(
const std::string& name,
const ImageInfoList& imageInfoList, uint32_t dstArrayElement = 0);
53 bool enableDescriptor(
const std::string& name);
54 bool assignDescriptor(
const std::string& name, ref_ptr<Data> data = {}, uint32_t dstArrayElement = 0);
55 bool assignDescriptor(
const std::string& name,
const BufferInfoList& bufferInfoList, uint32_t dstArrayElement = 0);
57 [[deprecated(
"use enableDescriptor(..)")]]
bool enableUniform(
const std::string& name) {
return enableDescriptor(name); }
59 [[deprecated(
"use assignDescriptor(..)")]]
bool assignUniform(
const std::string& name, ref_ptr<Data> data = {}, uint32_t dstArrayElement = 0) {
return assignDescriptor(name, data, dstArrayElement); }
61 [[deprecated(
"use assignDescriptor(..)")]]
bool assignUniform(
const std::string& name,
const BufferInfoList& bufferInfoList, uint32_t dstArrayElement = 0) {
return assignDescriptor(name, bufferInfoList, dstArrayElement); }
63 bool assignDescriptor(uint32_t set, uint32_t binding, VkDescriptorType descriptorType, uint32_t descriptorCount, VkShaderStageFlags stageFlags, ref_ptr<Descriptor> descriptor);
68 std::set<std::string> assigned;
69 std::set<std::string> defines;
70 std::vector<ref_ptr<DescriptorSet>> descriptorSets;
83 bool assignArray(
const std::string& name, VkVertexInputRate vertexInputRate,
ref_ptr<Data> array);
85 uint32_t baseAttributeBinding = 0;
86 std::set<std::string> assigned;
87 std::set<std::string> defines;
90 VertexInputState::Attributes vertexAttributeDescriptions;
102 void traverse(
Visitor& visitor)
override;
106 GraphicsPipelineStates pipelineStates;
108 uint32_t subpass = 0;
109 uint32_t baseAttributeBinding = 0;
114 bool enableArray(
const std::string& name, VkVertexInputRate vertexInputRate, uint32_t stride, VkFormat format = VK_FORMAT_UNDEFINED);
115 bool enableDescriptor(
const std::string& name);
116 bool enableTexture(
const std::string& name);
118 bool assignArray(DataList& arrays,
const std::string& name, VkVertexInputRate vertexInputRate,
ref_ptr<Data> array);
119 bool assignDescriptor(
const std::string& name,
ref_ptr<Data> data = {}, uint32_t dstArrayElement = 0);
120 bool assignDescriptor(
const std::string& name,
const BufferInfoList& bufferInfoList, uint32_t dstArrayElement = 0);
122 bool assignTexture(
const std::string& name,
const ImageInfoList& imageInfoList, uint32_t dstArrayElement = 0);
127 [[deprecated(
"use enableDescriptor(..)")]]
bool enableUniform(
const std::string& name) {
return enableDescriptor(name); }
129 [[deprecated(
"use assignDescriptor(..)")]]
bool assignUniform(
const std::string& name,
ref_ptr<Data> data = {}) {
return assignDescriptor(name, data); }
132 ref_ptr<ShaderCompileSettings> shaderHints;
133 ref_ptr<DescriptorConfigurator> descriptorConfigurator;
134 StateCommands inheritedState;
151 std::set<uint32_t> inheritedSets;
157 void _assignShaderSetSettings();
158 void _assignInheritedSets();
163 using GraphicsPipelineConfig = GraphicsPipelineConfigurator;
164 using DescriptorConfig = DescriptorConfigurator;
ArrayConfigurator utility provides a means of setting up arrays using ShaderSet as a guide for requir...
Definition: GraphicsPipelineConfigurator.h:76
VertexInputState::Bindings vertexBindingDescriptions
VkPipelineVertexInputStateCreateInfo settings.
Definition: GraphicsPipelineConfigurator.h:89
int compare(const Object &rhs) const override
compare two objects, return -1 if this object is less than rhs, return 0 if it's equal,...
Definition: ConstVisitor.h:147
DescriptorConfigurator utility provides a means of setting up descriptors using ShaderSet as a guide ...
Definition: GraphicsPipelineConfigurator.h:37
bool assignDefaults(const std::set< uint32_t > &inheritedSets={})
call after all the textures/uniforms have been explictly assigned to add in textures/uniforms descrip...
int compare(const Object &rhs) const override
compare two objects, return -1 if this object is less than rhs, return 0 if it's equal,...
GraphicsPipelineConfigurator utility provides a means of setting up state and geometry using ShaderSe...
Definition: GraphicsPipelineConfigurator.h:98
int compare(const Object &rhs) const override
compare two objects, return -1 if this object is less than rhs, return 0 if it's equal,...
virtual bool copyTo(ref_ptr< StateGroup > stateGroup, ref_ptr< SharedObjects > sharedObjects={})
copy state objects to StateGroup, return true if state is added.
virtual void init()
initialize state objects
virtual bool copyTo(StateCommands &stateCommands, ref_ptr< SharedObjects > sharedObjects={})
copy state objects to StateCommands list, return true if is add added.
void assignInheritedState(const StateCommands &stateCommands)
set the inherited state which if compatible can hint the the state setup and copying to avoid setting...
virtual ref_ptr< ArrayState > getSuitableArrayState() const
convinience function for calling shaderSet->getSuitableArrayState(shaderHints->defines) to return the...
Definition: Visitor.h:147