diff options
Diffstat (limited to 'chapters/fxvertex.adoc')
-rw-r--r-- | chapters/fxvertex.adoc | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/chapters/fxvertex.adoc b/chapters/fxvertex.adoc index 82b91efa..0ee3b109 100644 --- a/chapters/fxvertex.adoc +++ b/chapters/fxvertex.adoc @@ -934,22 +934,33 @@ ifdef::VK_EXT_vertex_input_dynamic_state,VK_EXT_shader_object[] code:attribDesc.binding. endif::VK_EXT_vertex_input_dynamic_state,VK_EXT_shader_object[] endif::VK_EXT_vertex_attribute_divisor,VK_KHR_vertex_attribute_divisor[] + * Let code:stride be the member of + slink:VkPipelineVertexInputStateCreateInfo::pname:pVertexBindingDescriptions->stride + unless there is dynamic state causing the value to be ignored. + In this case the value is set from the last value from one of the + following +ifdef::VK_EXT_vertex_input_dynamic_state,VK_EXT_shader_object[] + ** flink:vkCmdSetVertexInputEXT::pname:pVertexBindingDescriptions->stride +endif::VK_EXT_vertex_input_dynamic_state,VK_EXT_shader_object[] +ifdef::VK_VERSION_1_3,VK_EXT_extended_dynamic_state,VK_EXT_shader_object[] + ** flink:vkCmdBindVertexBuffers2EXT::pname:pStride, if not code:NULL +endif::VK_VERSION_1_3,VK_EXT_extended_dynamic_state,VK_EXT_shader_object[] [source,c] ---- bufferBindingAddress = buffer[binding].baseAddress + offset[binding]; if (bindingDesc.inputRate == VK_VERTEX_INPUT_RATE_VERTEX) - effectiveVertexOffset = vertexIndex * bindingDesc.stride; + effectiveVertexOffset = vertexIndex * stride; else ifndef::VK_EXT_vertex_attribute_divisor,VK_KHR_vertex_attribute_divisor[] - effectiveVertexOffset = instanceIndex * bindingDesc.stride; + effectiveVertexOffset = instanceIndex * stride; endif::VK_EXT_vertex_attribute_divisor,VK_KHR_vertex_attribute_divisor[] ifdef::VK_EXT_vertex_attribute_divisor,VK_KHR_vertex_attribute_divisor[] if (divisor == 0) - effectiveVertexOffset = firstInstance * bindingDesc.stride; + effectiveVertexOffset = firstInstance * stride; else - effectiveVertexOffset = (firstInstance + ((instanceIndex - firstInstance) / divisor)) * bindingDesc.stride; + effectiveVertexOffset = (firstInstance + ((instanceIndex - firstInstance) / divisor)) * stride; endif::VK_EXT_vertex_attribute_divisor,VK_KHR_vertex_attribute_divisor[] attribAddress = bufferBindingAddress + effectiveVertexOffset + attribDesc.offset; |