Module: Mesa
Branch: main
Commit: 100c4dbd9ca9b03cf50eff4818a2582e12a2c3f4
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=100c4dbd9ca9b03cf50eff4818a2582e12a2c3f4

Author: Erik Faye-Lund <erik.faye-l...@collabora.com>
Date:   Mon May 10 17:46:28 2021 +0200

translate: reserve more vertex-shader outputs

It's not just position that's special here, we also need space for
other special vertex-shader outputs.

This fixes a crash with Zink on Lavapipe, because Zink always emits
psize to avoid some shader-keys. While this might not be ideal, it's not
illegal. So we need to handle it.

But it seems we're missing more, and this list is taken from
compute_vertex_info() in lp_state_derived.c.

Reviewed-by: Marek Olšák <marek.ol...@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10730>

---

 src/gallium/auxiliary/translate/translate.h           | 17 ++++++++++++-----
 src/gallium/drivers/zink/ci/piglit-zink-lvp-fails.txt |  2 --
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/gallium/auxiliary/translate/translate.h 
b/src/gallium/auxiliary/translate/translate.h
index d77561aa7ce..0b50020a693 100644
--- a/src/gallium/auxiliary/translate/translate.h
+++ b/src/gallium/auxiliary/translate/translate.h
@@ -45,12 +45,19 @@
 #include "pipe/p_state.h"
 
 /**
- * Translate has to work on one more attribute because
- * the draw module has to be able to pass the vertex
- * position even if the fragment shader already consumes
- * PIPE_MAX_ATTRIBS inputs.
+ * Translate has to work on two more attributes because
+ * the draw module has to be able to pass a few fixed
+ * function vertex shader outputs even if the fragment
+ * shader already consumes PIPE_MAX_ATTRIBS inputs.
+ *
+ * These vertex shader outputs include:
+ * - position
+ * - bcolor (up to two)
+ * - point-size
+ * - viewport index
+ * - layer
  */
-#define TRANSLATE_MAX_ATTRIBS (PIPE_MAX_ATTRIBS + 1)
+#define TRANSLATE_MAX_ATTRIBS (PIPE_MAX_ATTRIBS + 6)
 
 enum translate_element_type {
    TRANSLATE_ELEMENT_NORMAL,
diff --git a/src/gallium/drivers/zink/ci/piglit-zink-lvp-fails.txt 
b/src/gallium/drivers/zink/ci/piglit-zink-lvp-fails.txt
index 747d665e538..72794fc1e5e 100644
--- a/src/gallium/drivers/zink/ci/piglit-zink-lvp-fails.txt
+++ b/src/gallium/drivers/zink/ci/piglit-zink-lvp-fails.txt
@@ -85,7 +85,6 @@ spec@arb_sample_shading@samplemask 4 all,Fail
 spec@arb_seamless_cube_map@arb_seamless_cubemap,Fail
 spec@arb_shader_storage_buffer_object@array-ssbo-binding,Crash
 spec@arb_shader_texture_lod@execution@arb_shader_texture_lod-texgrad,Fail
-spec@arb_tessellation_shader@arb_tessellation_shader-tes-gs-max-output -small 
-scan 1 50,Crash
 spec@arb_texture_buffer_object@render-no-bo,Crash
 spec@arb_texture_buffer_range@ranges-2 compat,Fail
 
spec@arb_texture_cube_map_array@arb_texture_cube_map_array-sampler-cube-array-shadow,Fail
@@ -180,7 +179,6 @@ spec@glsl-1.50@execution@geometry@primitive-id-restart 
gl_triangles ffs,Fail
 spec@glsl-1.50@execution@geometry@primitive-id-restart gl_triangles other,Fail
 spec@glsl-1.50@execution@geometry@primitive-id-restart gl_triangles_adjacency 
ffs,Fail
 spec@glsl-1.50@execution@geometry@primitive-id-restart gl_triangles_adjacency 
other,Fail
-spec@glsl-1.50@gs-max-output,Crash
 spec@intel_performance_query@intel_performance_query-issue_2235,Fail
 spec@khr_texture_compression_astc@array-gl,Fail
 spec@khr_texture_compression_astc@miptree-gl ldr,Fail

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to