st/mesa: fix a crash due to passing a draw vertex shader into the driver
authorMarek Olšák <marek.olsak@amd.com>
Sat, 11 Apr 2020 22:06:27 +0000 (18:06 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 16 Apr 2020 13:31:46 +0000 (13:31 +0000)
Fixes: bc99b22a305be5e5a5f
Closes: #2754
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4527>

src/mesa/state_tracker/st_atom_shader.c

index fde2eb55f62feabcd89b3b2f7cbf47773ca14930..e09be71f59c82497631a58f4b732a8473127ec9c 100644 (file)
@@ -187,7 +187,8 @@ st_update_vp( struct st_context *st )
 
    if (st->shader_has_one_variant[MESA_SHADER_VERTEX] &&
        stvp->variants &&
-       st_common_variant(stvp->variants)->key.passthrough_edgeflags == st->vertdata_edgeflags) {
+       st_common_variant(stvp->variants)->key.passthrough_edgeflags == st->vertdata_edgeflags &&
+       !st_common_variant(stvp->variants)->key.is_draw_shader) {
       st->vp_variant = st_common_variant(stvp->variants);
    } else {
       struct st_common_variant_key key;