Mesa (master): mesa: reset linked_stages bitmask when re-linking

Timothy Arceri tarceri at kemper.freedesktop.org
Wed Nov 30 23:25:30 UTC 2016


Module: Mesa
Branch: master
Commit: 966567aa1296f99b16baec1ce92d64a8b3533d25
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=966567aa1296f99b16baec1ce92d64a8b3533d25

Author: Timothy Arceri <timothy.arceri at collabora.com>
Date:   Thu Dec  1 08:52:20 2016 +1100

mesa: reset linked_stages bitmask when re-linking

34953f8907fdd added this bitmask but it wasn't being reset when
a program was relinked. If a stage was removed from the new
program then it could case a crash as we expect the linked shader
for that stage to not be null.

Fixes crashes in:
ESEXT-CTS.tessellation_shader.single.xfb_captures_data_from_correct_stage
ES31-CTS.core.tessellation_shader.single.xfb_captures_data_from_correct_stage

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Dave Airlie <airlied at redhat.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98917

---

 src/mesa/main/shaderobj.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index 998656a..6fcdf44 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -348,6 +348,8 @@ _mesa_clear_shader_program_data(struct gl_context *ctx,
       }
    }
 
+   shProg->data->linked_stages = 0;
+
    if (shProg->data->UniformStorage) {
       for (unsigned i = 0; i < shProg->data->NumUniformStorage; ++i)
          _mesa_uniform_detach_all_driver_storage(&shProg->data->




More information about the mesa-commit mailing list