@Override
    public void deleteShader(Shader shader) {
        if (shader.getId() == -1) {
            logger.warning("Shader is not uploaded to GPU, cannot delete.");
            return;
        }

        for (ShaderSource source : shader.getSources()) {
            if (source.getId() != -1) {
                gl.glDetachShader(shader.getId(), source.getId());
                deleteShaderSource(source);
            }
        }

        gl.glDeleteProgram(shader.getId());
        statistics.onDeleteShader();
        shader.resetObject();
    }
Updates all shader's buffer blocks.

@param shader the shader.
jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java