<div dir="ltr"><div>Added to the commit message:</div><div><br></div><div>This fixes a GPU hang in DOOM 2016 running under wine.<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Aug 25, 2018 at 5:17 PM Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Cc: <a href="mailto:mesa-stable@lists.freedesktop.org" target="_blank">mesa-stable@lists.freedesktop.org</a><br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=104809" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=104809</a><br>
---<br>
src/intel/vulkan/genX_pipeline.c | 29 ++++++++++++++++++++++++++++-<br>
1 file changed, 28 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c<br>
index 022f324606e..b531205508c 100644<br>
--- a/src/intel/vulkan/genX_pipeline.c<br>
+++ b/src/intel/vulkan/genX_pipeline.c<br>
@@ -115,7 +115,34 @@ emit_vertex_input(struct anv_pipeline *pipeline,<br>
GENX(3DSTATE_VERTEX_ELEMENTS));<br>
if (!p)<br>
return;<br>
- memset(p + 1, 0, (num_dwords - 1) * 4);<br>
+<br>
+ for (uint32_t i = 0; i < total_elems; i++) {<br>
+ /* The SKL docs for VERTEX_ELEMENT_STATE say:<br>
+ *<br>
+ * "All elements must be valid from Element[0] to the last valid<br>
+ * element. (I.e. if Element[2] is valid then Element[1] and<br>
+ * Element[0] must also be valid)."<br>
+ *<br>
+ * The SKL docs for 3D_Vertex_Component_Control say:<br>
+ *<br>
+ * "Don't store this component. (Not valid for Component 0, but can<br>
+ * be used for Component 1-3)."<br>
+ *<br>
+ * So we can't just leave a vertex element blank and hope for the best.<br>
+ * We have to tell the VF hardware to put something in it; so we just<br>
+ * store a bunch of zero.<br>
+ *<br>
+ * TODO: Compact vertex elements so we never end up with holes.<br>
+ */<br>
+ struct GENX(VERTEX_ELEMENT_STATE) element = {<br>
+ .Valid = true,<br>
+ .Component0Control = VFCOMP_STORE_0,<br>
+ .Component1Control = VFCOMP_STORE_0,<br>
+ .Component2Control = VFCOMP_STORE_0,<br>
+ .Component3Control = VFCOMP_STORE_0,<br>
+ };<br>
+ GENX(VERTEX_ELEMENT_STATE_pack)(NULL, &p[1 + i * 2], &element);<br>
+ }<br>
<br>
for (uint32_t i = 0; i < info->vertexAttributeDescriptionCount; i++) {<br>
const VkVertexInputAttributeDescription *desc =<br>
-- <br>
2.17.1<br>
<br>
</blockquote></div>