summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_pipeline.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-07-02 12:49:06 -0700
committerJason Ekstrand <[email protected]>2018-07-09 15:37:51 -0700
commit2caf6c039289de1c26ad55c68708edd51f0b8277 (patch)
treeea5e648e458e5d3cfc0ae754b3c18a4c553cc02b /src/intel/vulkan/anv_pipeline.c
parent32f4feb5a0d515c7ec1aaa774cefd8496414d53f (diff)
anv/pipeline: Add a per-VB instance 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.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index f0bf80a1cf0..e8489e72394 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -1421,6 +1421,22 @@ anv_pipeline_init(struct anv_pipeline *pipeline,
pipeline->vb[desc->binding].instanced = true;
break;
}
+
+ pipeline->vb[desc->binding].instance_divisor = 1;
+ }
+
+
+ /* Our implementation of VK_KHR_multiview uses instancing to draw the
+ * different views. If the client asks for instancing, we need to multiply
+ * the instance divisor by the number of views ensure that we repeat the
+ * client's per-instance data once for each view.
+ */
+ if (pipeline->subpass->view_mask) {
+ const uint32_t view_count = anv_subpass_view_count(pipeline->subpass);
+ for (uint32_t vb = 0; vb < MAX_VBS; vb++) {
+ if (pipeline->vb[vb].instanced)
+ pipeline->vb[vb].instance_divisor *= view_count;
+ }
}
const VkPipelineInputAssemblyStateCreateInfo *ia_info =