r300: skip draw if vertex shader does not write gl_Position

Fixes few more piglit crashes.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27006>
This commit is contained in:
Pavel Ondračka 2024-01-11 16:10:45 +01:00 committed by Marge Bot
parent 53c17d85ab
commit 9530ec9c07
2 changed files with 6 additions and 7 deletions

View file

@ -490,13 +490,6 @@ spec@arb_point_sprite@arb_point_sprite-mipmap,Fail
spec@arb_sampler_objects@sampler-incomplete,Fail
# The test accidentally assigns a varying output instead of an attribute input to
# gl_Position, then it gets optimized out and then set_vertex_inputs_outputs gets
# angry that nobody set gl_Position.
spec@arb_separate_shader_objects@getprogrampipelineiv,Crash
spec@glsl-1.20@linker@invariant-propagation-globals,Crash
spec@glsl-es-1.00@linker@glsl-no-glposition,Crash
spec@arb_shader_texture_lod@execution@arb_shader_texture_lod-texgrad,Fail
spec@arb_shader_texture_lod@execution@arb_shader_texture_lod-texgradcube,Fail
spec@arb_shader_texture_lod@execution@tex-miplevel-selection *gradarb 1d,Fail

View file

@ -199,6 +199,12 @@ void r300_translate_vertex_shader(struct r300_context *r300,
r300_init_vs_outputs(r300, shader);
/* Nothing to do if the shader does not write gl_Position. */
if (vs->outputs.pos == ATTR_UNUSED) {
vs->dummy = true;
return;
}
/* Setup the compiler */
memset(&compiler, 0, sizeof(compiler));
rc_init(&compiler.Base, &r300->vs_regalloc_state);