diff options
author | Campbell Barton <campbell@blender.org> | 2022-11-04 10:37:25 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-11-05 05:47:01 +0300 |
commit | ae3073323e92a1773fb253bd1c5d6c92b826e1e0 (patch) | |
tree | 0c2c63d40bbb0b83c6604f8b4e40e8f46ab0047e /source/blender/draw/engines/eevee | |
parent | 4a313b82529b95aa267086ca0c4f113e65bb79c8 (diff) |
Cleanup: use bool instead of short for job stop & do_update arguments
Since these values are only ever 0/1, use bool type.
Diffstat (limited to 'source/blender/draw/engines/eevee')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_lightcache.c | 12 | ||||
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_lightcache.h | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lightcache.c b/source/blender/draw/engines/eevee/eevee_lightcache.c index 9bf0cce2af2..26a264c1716 100644 --- a/source/blender/draw/engines/eevee/eevee_lightcache.c +++ b/source/blender/draw/engines/eevee/eevee_lightcache.c @@ -142,7 +142,7 @@ typedef struct EEVEE_LightBake { struct GPUTexture *dummy_layer_color; int total, done; /* to compute progress */ - short *stop, *do_update; + bool *stop, *do_update; float *progress; /** For only handling the resources. */ @@ -778,7 +778,7 @@ wmJob *EEVEE_lightbake_job_create(struct wmWindowManager *wm, } if (old_lbake->stop != NULL) { - *old_lbake->stop = 1; + *old_lbake->stop = true; } BLI_mutex_unlock(old_lbake->mutex); } @@ -1359,13 +1359,13 @@ static bool lightbake_do_sample(EEVEE_LightBake *lbake, DRW_custom_pipeline(&draw_engine_eevee_type, depsgraph, render_callback, lbake); lbake->done += 1; *lbake->progress = lbake->done / (float)lbake->total; - *lbake->do_update = 1; + *lbake->do_update = true; eevee_lightbake_context_disable(lbake); return true; } -void EEVEE_lightbake_job(void *custom_data, short *stop, short *do_update, float *progress) +void EEVEE_lightbake_job(void *custom_data, bool *stop, bool *do_update, float *progress) { EEVEE_LightBake *lbake = (EEVEE_LightBake *)custom_data; Depsgraph *depsgraph = lbake->depsgraph; @@ -1394,8 +1394,8 @@ void EEVEE_lightbake_job(void *custom_data, short *stop, short *do_update, float /* Resource allocation can fail. Early exit in this case. */ if (lbake->lcache->flag & LIGHTCACHE_INVALID) { - *lbake->stop = 1; - *lbake->do_update = 1; + *lbake->stop = true; + *lbake->do_update = true; lbake->lcache->flag &= ~LIGHTCACHE_BAKING; eevee_lightbake_context_disable(lbake); eevee_lightbake_delete_resources(lbake); diff --git a/source/blender/draw/engines/eevee/eevee_lightcache.h b/source/blender/draw/engines/eevee/eevee_lightcache.h index 4e94e1914a7..73961f1919d 100644 --- a/source/blender/draw/engines/eevee/eevee_lightcache.h +++ b/source/blender/draw/engines/eevee/eevee_lightcache.h @@ -42,7 +42,7 @@ void *EEVEE_lightbake_job_data_alloc(struct Main *bmain, int frame); void EEVEE_lightbake_job_data_free(void *custom_data); void EEVEE_lightbake_update(void *custom_data); -void EEVEE_lightbake_job(void *custom_data, short *stop, short *do_update, float *progress); +void EEVEE_lightbake_job(void *custom_data, bool *stop, bool *do_update, float *progress); /** * This is to update the world irradiance and reflection contribution from |