From 255166a349c643dfbc3a77cc250d061180a7d2fd Mon Sep 17 00:00:00 2001 From: irql-notlessorequal Date: Mon, 31 Mar 2025 17:45:50 +0200 Subject: [PATCH] elk: always write the VUE header ELK equivalent of !34211, also required to avoid potential rendering errors with hasvk. Part-of: --- src/intel/compiler/elk/elk_fs_visitor.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/intel/compiler/elk/elk_fs_visitor.cpp b/src/intel/compiler/elk/elk_fs_visitor.cpp index 286e3fa2955..1c42fc6d686 100644 --- a/src/intel/compiler/elk/elk_fs_visitor.cpp +++ b/src/intel/compiler/elk/elk_fs_visitor.cpp @@ -563,8 +563,6 @@ elk_fs_visitor::emit_urb_writes(const elk_fs_reg &gs_vertex_count) elk_vue_prog_data(this->prog_data); const struct elk_vs_prog_key *vs_key = (const struct elk_vs_prog_key *) this->key; - const GLbitfield64 psiz_mask = - VARYING_BIT_LAYER | VARYING_BIT_VIEWPORT | VARYING_BIT_PSIZ | VARYING_BIT_PRIMITIVE_SHADING_RATE; const struct intel_vue_map *vue_map = &vue_prog_data->vue_map; bool flush; elk_fs_reg sources[8]; @@ -634,12 +632,12 @@ elk_fs_visitor::emit_urb_writes(const elk_fs_reg &gs_vertex_count) switch (varying) { case VARYING_SLOT_PSIZ: { /* The point size varying slot is the vue header and is always in the - * vue map. But often none of the special varyings that live there - * are written and for the vertex shaders we can skip writing to the - * VUE header because it is setup by the VF fixed function. All other - * pre-rasterization stages should setup the VUE header properly as - * describe in the SKL PRMs, Volume 7: 3D-Media-GPGPU, Vertex URB - * Entry (VUE) Formats: + * vue map. If anything in the header is going to be read back by HW, + * we need to initialize it, in particular the viewport & layer + * values. + * + * SKL PRMs, Volume 7: 3D-Media-GPGPU, Vertex URB Entry (VUE) + * Formats: * * "VUEs are written in two ways: * @@ -668,12 +666,6 @@ elk_fs_visitor::emit_urb_writes(const elk_fs_reg &gs_vertex_count) * - If Rendering is disabled, VertexHeaders are not required * anywhere." */ - if ((vue_map->slots_valid & psiz_mask) == 0 && - stage == MESA_SHADER_VERTEX) { - assert(length == 0); - urb_offset++; - break; - } elk_fs_reg zero(VGRF, alloc.allocate(dispatch_width / 8), ELK_REGISTER_TYPE_UD);