diff --git a/include/PICA/shader.hpp b/include/PICA/shader.hpp index 5b05e0b7..a9216b17 100644 --- a/include/PICA/shader.hpp +++ b/include/PICA/shader.hpp @@ -256,8 +256,10 @@ class PICAShader { void uploadFloatUniform(u32 word) { floatUniformBuffer[floatUniformWordCount++] = word; - if (floatUniformIndex >= 96) { - Helpers::panic("[PICA] Tried to write float uniform %d", floatUniformIndex); + // Check if the program tries to upload to a non-existent uniform, and empty the queue without writing in that case + if (floatUniformIndex >= 96) [[unlikely]] { + floatUniformWordCount = 0; + return; } if ((f32UniformTransfer && floatUniformWordCount >= 4) || (!f32UniformTransfer && floatUniformWordCount >= 3)) {