summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_pipeline.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-07-02 12:57:44 -0700
committerJason Ekstrand <[email protected]>2018-07-09 15:37:51 -0700
commit227dabc2664b886e621de03d9ba82073e2fd16aa (patch)
treea338644ff97a1aa5406f548c6c88f09f2b0bdbe5 /src/intel/vulkan/anv_pipeline.c
parent2caf6c039289de1c26ad55c68708edd51f0b8277 (diff)
anv: Implement VK_EXT_vertex_attribute_divisor
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_pipeline.c')
-rw-r--r--src/intel/vulkan/anv_pipeline.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index e8489e72394..95a686f7833 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -33,6 +33,7 @@
#include "compiler/brw_nir.h"
#include "anv_nir.h"
#include "spirv/nir_spirv.h"
+#include "vk_util.h"
/* Needed for SWIZZLE macros */
#include "program/prog_instruction.h"
@@ -1425,6 +1426,17 @@ anv_pipeline_init(struct anv_pipeline *pipeline,
pipeline->vb[desc->binding].instance_divisor = 1;
}
+ const VkPipelineVertexInputDivisorStateCreateInfoEXT *vi_div_state =
+ vk_find_struct_const(vi_info->pNext,
+ PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT);
+ if (vi_div_state) {
+ for (uint32_t i = 0; i < vi_div_state->vertexBindingDivisorCount; i++) {
+ const VkVertexInputBindingDivisorDescriptionEXT *desc =
+ &vi_div_state->pVertexBindingDivisors[i];
+
+ pipeline->vb[desc->binding].instance_divisor = desc->divisor;
+ }
+ }
/* Our implementation of VK_KHR_multiview uses instancing to draw the
* different views. If the client asks for instancing, we need to multiply