public void onShaderUse(Shader shader, boolean wasSwitched) {
        assert shader.getId() >= 1;

        if (!enabled) {
            return;
        }

        // Reduces unnecessary hashmap lookups if
        // we already considered this shader.
        if (lastShader != shader.getId()) {
            lastShader = shader.getId();
            if (!shadersUsed.containsKey(shader.getId())) {
                shadersUsed.put(shader.getId(), null);
            }
        }

        if (wasSwitched) {
            numShaderSwitches++;
        }
    }
Called by the Renderer when a shader has been utilized.

@param shader The shader that was used
@param wasSwitched If true, the shader has required a state switch
jme3-core/src/main/java/com/jme3/renderer/Statistics.java