Avoid crash in Clyde if the GLSL compiler optimizes out uniforms.

This commit is contained in:
Pieter-Jan Briers
2019-12-06 02:29:58 +01:00
parent 31fb926127
commit 12787db8de

View File

@@ -799,6 +799,13 @@ namespace Robust.Client.Graphics.Clyde
// Assign shader parameters to uniform since they may be dirty.
foreach (var (name, value) in instance.Parameters)
{
if (!program.HasUniform(name))
{
// Can happen if the GLSL compiler removes uniforms due to them being unused.
// Safe to just ignore them then I'd say.
continue;
}
switch (value)
{
case float f: