iris: Minor code restyling in iris_bind_vs_state
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 27 Jan 2021 02:26:31 +0000 (18:26 -0800)
committerMarge Bot <eric+marge@anholt.net>
Fri, 29 Jan 2021 01:24:14 +0000 (01:24 +0000)
We'll be adding more code here shortly, this will make it easier.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8759>

src/gallium/drivers/iris/iris_program.c

index f5b7d79..fe597b5 100644 (file)
@@ -2514,17 +2514,17 @@ static void
 iris_bind_vs_state(struct pipe_context *ctx, void *state)
 {
    struct iris_context *ice = (struct iris_context *)ctx;
-   struct iris_uncompiled_shader *new_ish = state;
+   struct iris_uncompiled_shader *ish = state;
 
-   if (new_ish &&
-       ice->state.window_space_position !=
-       new_ish->nir->info.vs.window_space_position) {
-      ice->state.window_space_position =
-         new_ish->nir->info.vs.window_space_position;
+   if (ish) {
+      const struct shader_info *info = &ish->nir->info;
+      if (ice->state.window_space_position != info->vs.window_space_position) {
+         ice->state.window_space_position = info->vs.window_space_position;
 
-      ice->state.dirty |= IRIS_DIRTY_CLIP |
-                          IRIS_DIRTY_RASTER |
-                          IRIS_DIRTY_CC_VIEWPORT;
+         ice->state.dirty |= IRIS_DIRTY_CLIP |
+                             IRIS_DIRTY_RASTER |
+                             IRIS_DIRTY_CC_VIEWPORT;
+      }
    }
 
    bind_shader_state((void *) ctx, state, MESA_SHADER_VERTEX);