Fix issues with unsigned types in GL ES 3 shader class

This commit is contained in:
Pedro J. Estébanez 2022-06-14 11:43:58 +02:00
parent a0f70c5819
commit 1d01acb486

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) {