freedreno: initialize max_scissor
authorRob Clark <robdclark@chromium.org>
Sat, 9 May 2020 19:31:20 +0000 (12:31 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 12 May 2020 18:16:48 +0000 (18:16 +0000)
Somehow the initialization of this got lost somewhere along the way,
resulting in assuming minx/miny are always zero.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4976>

src/gallium/drivers/freedreno/freedreno_batch_cache.c

index 9edca679449a36c04883d502029d854641a122da..253b16e93d893a67fcf120643cba0f08c94d128a 100644 (file)
@@ -377,6 +377,14 @@ batch_from_key(struct fd_batch_cache *cache, struct key *key,
        if (!batch)
                return NULL;
 
+       /* reset max_scissor, which will be adjusted on draws
+        * according to the actual scissor.
+        */
+       batch->max_scissor.minx = ~0;
+       batch->max_scissor.miny = ~0;
+       batch->max_scissor.maxx = 0;
+       batch->max_scissor.maxy = 0;
+
        fd_screen_lock(ctx->screen);
 
        _mesa_hash_table_insert_pre_hashed(cache->ht, hash, key, batch);