Fix gl error spam

- CrumblingProgram was trying to upload a uniform before the location was queried.
 - Adjust WorldProgram init to mitigate this in the future.
This commit is contained in:
Jozufozu 2021-07-14 15:47:44 -07:00
parent 1da67aaf1a
commit 28a3813652
2 changed files with 3 additions and 8 deletions

View file

@ -25,12 +25,6 @@ public class CrumblingProgram extends WorldProgram {
uTextureScale = getUniformLocation("uTextureScale");
}
@Override
public void bind() {
super.bind();
setDefaultAtlasSize();
}
@Override
protected void registerSamplers() {
super.registerSamplers();

View file

@ -5,6 +5,7 @@ import static org.lwjgl.opengl.GL20.glUniform3f;
import java.util.List;
import com.jozufozu.flywheel.backend.gl.shader.GlProgram;
import com.jozufozu.flywheel.backend.loading.Program;
import com.jozufozu.flywheel.core.shader.extension.IProgramExtension;
import com.jozufozu.flywheel.util.AnimationTickHolder;
@ -25,9 +26,9 @@ public class WorldProgram extends ExtensibleGlProgram {
uViewProjection = getUniformLocation("uViewProjection");
uCameraPos = getUniformLocation("uCameraPos");
bind();
super.bind();
registerSamplers();
unbind();
super.unbind();
}
protected void registerSamplers() {