Mesa (master): anv: Always emit at least one vertex element

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jan 22 16:43:34 UTC 2019


Module: Mesa
Branch: master
Commit: b4eae8444e0a7c61bd7013e397e351e3b3965a49
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b4eae8444e0a7c61bd7013e397e351e3b3965a49

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Tue Jan  8 17:35:19 2019 -0600

anv: Always emit at least one vertex element

This seems to make the simulator happier.  The early return wasn't
really protecting anything and the code that follows will happily
initialize the dummy element to STORE_0 and emit it.

Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>

---

 src/intel/vulkan/genX_pipeline.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c
index 76766a8925..1bc445eae8 100644
--- a/src/intel/vulkan/genX_pipeline.c
+++ b/src/intel/vulkan/genX_pipeline.c
@@ -105,9 +105,7 @@ emit_vertex_input(struct anv_pipeline *pipeline,
       __builtin_popcount(elements_double) / 2;
 
    const uint32_t total_elems =
-      elem_count + needs_svgs_elem + vs_prog_data->uses_drawid;
-   if (total_elems == 0)
-      return;
+      MAX2(1, elem_count + needs_svgs_elem + vs_prog_data->uses_drawid);
 
    uint32_t *p;
 




More information about the mesa-commit mailing list