iris: fix crash
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 16 Jul 2018 23:45:22 +0000 (16:45 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:07 +0000 (10:26 -0800)
src/gallium/drivers/iris/iris_program.c

index eba97450c6e323750e0b9b04dd92ddb815f51bc6..26c40efe4403fba5be26217919bcebfdb04b97d9 100644 (file)
@@ -117,12 +117,13 @@ bind_state(struct iris_context *ice,
            gl_shader_stage stage)
 {
    uint64_t dirty_bit = IRIS_DIRTY_UNCOMPILED_VS << stage;
+   const uint64_t nos = ish ? ish->nos : 0;
 
    ice->shaders.uncompiled[stage] = ish;
    ice->state.dirty |= dirty_bit;
 
    for (int i = 0; i < IRIS_NOS_COUNT; i++) {
-      if (ish->nos & (1 << i))
+      if (nos & (1 << i))
          ice->state.dirty_for_nos[i] |= dirty_bit;
       else
          ice->state.dirty_for_nos[i] &= ~dirty_bit;