const VkVertexInputBindingDescription *desc =
&vi_info->pVertexBindingDescriptions[i];
- pipeline->binding_stride[desc->binding] = desc->stride;
+ pipeline->vb[desc->binding].stride = desc->stride;
/* Step rate is programmed per vertex element (attribute), not
* binding. Set up a map of which bindings step per instance, for
switch (desc->inputRate) {
default:
case VK_VERTEX_INPUT_RATE_VERTEX:
- pipeline->instancing_enable[desc->binding] = false;
+ pipeline->vb[desc->binding].instanced = false;
break;
case VK_VERTEX_INPUT_RATE_INSTANCE:
- pipeline->instancing_enable[desc->binding] = true;
+ pipeline->vb[desc->binding].instanced = true;
break;
}
}
struct anv_state blend_state;
uint32_t vb_used;
- uint32_t binding_stride[MAX_VBS];
- bool instancing_enable[MAX_VBS];
+ struct anv_pipeline_vertex_binding {
+ uint32_t stride;
+ bool instanced;
+ } vb[MAX_VBS];
+
bool primitive_restart;
uint32_t topology;
#if GEN_GEN >= 8
.MemoryObjectControlState = GENX(MOCS),
#else
- .BufferAccessType = pipeline->instancing_enable[vb] ? INSTANCEDATA : VERTEXDATA,
+ .BufferAccessType = pipeline->vb[vb].instanced ? INSTANCEDATA : VERTEXDATA,
/* Our implementation of VK_KHR_multiview uses instancing to draw
* the different views. If the client asks for instancing, we
* need to use the Instance Data Step Rate to ensure that we
#endif
.AddressModifyEnable = true,
- .BufferPitch = pipeline->binding_stride[vb],
+ .BufferPitch = pipeline->vb[vb].stride,
.BufferStartingAddress = anv_address_add(buffer->address, offset),
#if GEN_GEN >= 8
* VERTEX_BUFFER_STATE which we emit later.
*/
anv_batch_emit(&pipeline->batch, GENX(3DSTATE_VF_INSTANCING), vfi) {
- vfi.InstancingEnable = pipeline->instancing_enable[desc->binding];
+ vfi.InstancingEnable = pipeline->vb[desc->binding].instanced;
vfi.VertexElementIndex = slot;
/* Our implementation of VK_KHR_multiview uses instancing to draw
* the different views. If the client asks for instancing, we