ShaderCache: theoretical loading speedup by first checking to see if a shader later in the queue is already compiled

This commit is contained in:
goeiecool9999 2025-07-24 09:43:46 +02:00
parent 55d2ac0e43
commit a96435a5dd

View file

@ -102,6 +102,18 @@ void LatteShaderCache_removeFromCompileQueue(sint32 index)
*/
void LatteShaderCache_updateCompileQueue(sint32 maxRemainingEntries)
{
// remove any shaders that are already done
for (size_t i = 0; i < shaderCompileQueue.count; i++)
{
auto shaderEntry = shaderCompileQueue.entry[i].shader;
if (!shaderEntry)
continue;
if (shaderEntry->shader->IsCompiled())
{
LatteShader_prepareSeparableUniforms(shaderEntry);
LatteShaderCache_removeFromCompileQueue(i);
}
}
while (true)
{
if (shaderCompileQueue.count <= maxRemainingEntries)