Module: Mesa
Branch: main
Commit: 64a256c66a520c55acb48deab309f5b984b02ba0
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=64a256c66a520c55acb48deab309f5b984b02ba0

Author: Mike Blumenkrantz <[email protected]>
Date:   Mon Mar 13 07:41:33 2023 -0400

aux/tc: fix initial rp info allocation

this value is -1 by default, which means the initial allocation yields
9 info structs instead of 10 (though this has no bearing on functionality)

Acked-by: Marek Olšák <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>

---

 src/gallium/auxiliary/util/u_threaded_context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/util/u_threaded_context.c 
b/src/gallium/auxiliary/util/u_threaded_context.c
index c5029c6126a..a6e16370d0c 100644
--- a/src/gallium/auxiliary/util/u_threaded_context.c
+++ b/src/gallium/auxiliary/util/u_threaded_context.c
@@ -121,7 +121,7 @@ static void
 tc_batch_renderpass_infos_resize(struct threaded_context *tc, struct tc_batch 
*batch)
 {
    unsigned size = batch->renderpass_infos.capacity;
-   unsigned cur_num = batch->renderpass_info_idx;
+   unsigned cur_num = MAX2(batch->renderpass_info_idx, 0);
 
    if (size / sizeof(struct tc_renderpass_info) > cur_num)
       return;

Reply via email to