iris: fix overhead regression from flushing for storage images
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 3 Dec 2018 07:03:08 +0000 (23:03 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:10 +0000 (10:26 -0800)
st calls us with count = 32 but a NULL pointer...we only really care
about the highest non-NULL image...

src/gallium/drivers/iris/iris_state.c

index 88a109ad3caef63d5b520b9ca3bcaa2b1b5e3fd4..a595e37751ac722b9d816320584fe82a121ba86c 100644 (file)
@@ -1678,7 +1678,8 @@ iris_set_shader_images(struct pipe_context *ctx,
    gl_shader_stage stage = stage_from_pipe(p_stage);
    struct iris_shader_state *shs = &ice->state.shaders[stage];
 
-   shs->num_images = MAX2(shs->num_images, start_slot + count);
+   if (p_images)
+      shs->num_images = MAX2(shs->num_images, start_slot + count);
 
    for (unsigned i = 0; i < count; i++) {
       if (p_images && p_images[i].resource) {