Merge pull request #62021 from RandomShaper/fix_signedness_mess_3.5

This commit is contained in:
Rémi Verschelde 2022-06-14 12:33:49 +02:00 committed by GitHub
commit eda10e3a89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -242,7 +242,8 @@ bool ShaderGLES3::_process_program_state(Version *p_version, bool p_async_forbid
case Version::COMPILE_STATUS_SOURCE_PROVIDED: { case Version::COMPILE_STATUS_SOURCE_PROVIDED: {
uint32_t start_compiles_count = p_async_forbidden ? 2 : 0; uint32_t start_compiles_count = p_async_forbidden ? 2 : 0;
if (!start_compiles_count) { if (!start_compiles_count) {
uint32_t free_async_slots = MAX(0, MIN(max_simultaneous_compiles - active_compiles_count, max_simultaneous_compiles - *compiles_started_this_frame)); uint32_t used_async_slots = MAX(active_compiles_count, *compiles_started_this_frame);
uint32_t free_async_slots = used_async_slots < active_compiles_count ? active_compiles_count - used_async_slots : 0;
start_compiles_count = MIN(2, free_async_slots); start_compiles_count = MIN(2, free_async_slots);
} }
if (start_compiles_count >= 1) { if (start_compiles_count >= 1) {