Why is the shader support determined each Frame?

Well while doing a bit of browsing around in sourcecode i came uppon this.

public void render(final float tpf, final boolean mainFrameBufferActive) { if (this.renderer instanceof NullRenderer) { return; } this.shader = this.renderer.getCaps().contains(Caps.GLSL100);

Now th question is (more out of curiosity, i higly doubt any performance change from this) why is the shader support determined each frame? Since the renderer is final and set up in constructor, wouldnt it make more sense to init this variable there as well.

Also it makes this setter useless

public void setUsingShaders(final boolean usingShaders) { this.shader = usingShaders; }

1 Like