89 {
90 int vaCount = vertexAttribs.
count();
91 int iaCount = instanceAttribs.
count();
92
93 uint32_t vertexBinding = 0, instanceBinding = 0;
94
95 int nextBinding = bindingDescs->
size();
96 if (vaCount) {
97 vertexBinding = nextBinding++;
98 }
99
100 if (iaCount) {
101 instanceBinding = nextBinding;
102 }
103
104
105 int attribIndex = 0;
106 for (auto attrib : vertexAttribs) {
109 vkAttrib.
binding = vertexBinding;
111 vkAttrib.
offset = *attrib.offset();
112 }
113
114 for (auto attrib : instanceAttribs) {
117 vkAttrib.
binding = instanceBinding;
119 vkAttrib.
offset = *attrib.offset();
120 }
121
122 if (vaCount) {
124 vertexBinding,
125 (uint32_t) vertexAttribs.stride(),
127 };
128 }
129 if (iaCount) {
131 instanceBinding,
132 (uint32_t) instanceAttribs.stride(),
134 };
135 }
136
139 vertexInputInfo->
pNext =
nullptr;
140 vertexInputInfo->
flags = 0;
145}
static VkFormat attrib_type_to_vkformat(GrVertexAttribType type)
@ VK_VERTEX_INPUT_RATE_VERTEX
@ VK_VERTEX_INPUT_RATE_INSTANCE
@ VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO