This file is indexed.

/usr/include/osgEarth/Capabilities is in libosgearth-dev 2.5.0+dfsg-8build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
/* -*-c++-*- */
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
* Copyright 2008-2013 Pelican Mapping
* http://osgearth.org
*
* osgEarth is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>
*/

#ifndef OSGEARTH_CAPABILITIES_H
#define OSGEARTH_CAPABILITIES_H 1

#include <osgEarth/Common>
#include <osg/Uniform>

namespace osgEarth
{
    class VirtualProgram;

    /**
     * Stores information about the hardware and graphics system capbilities.
     * The osgEarth::Registry stores a singleton Capabilities object that you can 
     * use to determine what your system supports.
     */
    class OSGEARTH_EXPORT Capabilities : public osg::Referenced
    {
    public:
        /** maximum # of texture units exposed in the fixed-function pipeline */
        int getMaxFFPTextureUnits() const { return _maxFFPTextureUnits; }

        /** maximum # of texture image units exposed in a GPU fragment shader */
        int getMaxGPUTextureUnits() const { return _maxGPUTextureUnits; }

        /** maximum # of texture coordinate indices available in a GPU fragment shader */
        int getMaxGPUTextureCoordSets() const { return _maxGPUTextureCoordSets; }

        /** maximum # of vertex attributes available in a shader */
        int getMaxGPUAttribs() const { return _maxGPUAttribs; }

        /** maximum supported size (in pixels) of a texture */
        int getMaxTextureSize() const { return _maxTextureSize; }

        /** maximum texture size that doesn't cause a slowdown (vendor-specific) */
        int getMaxFastTextureSize() const { return _maxFastTextureSize; }

        /** maximum number of openGL lights */
        int getMaxLights() const { return _maxLights; }

        /** bits in depth buffer */
        int getDepthBufferBits() const { return _depthBits; }

        /** whether the GPU supports shaders */
        bool supportsGLSL(float minimumVersion =1.0f) const { 
            return _supportsGLSL && _GLSLversion >= minimumVersion; }

        /** the GLSL version */
        float getGLSLVersion() const { return _GLSLversion; }

        /** the GPU vendor */
        const std::string& getVendor() const { return _vendor;}

        /** the GPU renderer */
        const std::string& getRenderer() const { return _renderer;}

        /** the GPU driver version */
        const std::string& getVersion() const { return _version;}

        /** whether the GPU supports texture arrays */
        bool supportsTextureArrays() const { return _supportsTextureArrays; }

        /** whether the GPU supports OpenGL 3D textures */
        bool supportsTexture3D() const { return _supportsTexture3D; }

        /** whether the GPU supports OpenGL multi-texturing */
        bool supportsMultiTexture() const { return _supportsMultiTexture; }

        /** whether the GPU supports OpenGL stencil wrapping extensions */
        bool supportsStencilWrap() const { return _supportsStencilWrap; }

        /** whether the GPU supports OpenGL the two-sided stenciling extension */
        bool supportsTwoSidedStencil() const { return _supportsTwoSidedStencil; }

        /** whether the GPU support the texture2dLod() function */
        bool supportsTexture2DLod() const { return _supportsTexture2DLod; }

        /** whether the GPU properly supports updating an existing texture with a new mipmapped image */
        bool supportsMipmappedTextureUpdates() const { return _supportsMipmappedTextureUpdates; }

        /** whether the GPU supports DEPTH_PACKED_STENCIL buffer */
        bool supportsDepthPackedStencilBuffer() const { return _supportsDepthPackedStencilBuffer; }

        /** whether the GPU supporst occlusion query */
        bool supportsOcclusionQuery() const { return _supportsOcclusionQuery; }

        /** whether the GPU supports DrawInstanced rendering */
        bool supportsDrawInstanced() const { return _supportsDrawInstanced; }

        /** whether the GPU supports Uniform Buffer Objects */
        bool supportsUniformBufferObjects() const { return _supportsUniformBufferObjects; }

        /** whether the GPU can handle non-power-of-two textures. */
        bool supportsNonPowerOfTwoTextures() const { return _supportsNonPowerOfTwoTextures; }

        /** maximum size of a uniform buffer block, in bytes */
        int getMaxUniformBlockSize() const { return _maxUniformBlockSize; }

        /** whether to prefer display lists over VBOs for static geometry. */
        bool preferDisplayListsForStaticGeometry() const { return _preferDLforStaticGeom; }

        /** number of logical CPUs available. */
        int getNumProcessors() const { return _numProcessors; }

        /** whether the GPU supports writing to the depth fragment */
        bool supportsFragDepthWrite() const { return _supportsFragDepthWrite; }

    protected:
        Capabilities();

        /** dtor */
        virtual ~Capabilities() { }

    private:
        int  _maxFFPTextureUnits;
        int  _maxGPUTextureUnits;
        int  _maxGPUTextureCoordSets;
        int  _maxGPUAttribs;
        int  _maxTextureSize;
        int  _maxFastTextureSize;
        int  _maxLights;
        int  _depthBits;
        bool _supportsGLSL;
        float _GLSLversion;
        bool _supportsTextureArrays;
        bool _supportsTexture3D;
        bool _supportsMultiTexture;
        bool _supportsStencilWrap;
        bool _supportsTwoSidedStencil;
        bool _supportsTexture2DLod;
        bool _supportsMipmappedTextureUpdates;
        bool _supportsDepthPackedStencilBuffer;
        bool _supportsOcclusionQuery;
        bool _supportsDrawInstanced;
        bool _supportsUniformBufferObjects;
        bool _supportsNonPowerOfTwoTextures;
        int  _maxUniformBlockSize;
        bool _preferDLforStaticGeom;
        int  _numProcessors;
        bool _supportsFragDepthWrite;
        std::string _vendor;
        std::string _renderer;
        std::string _version;

    public:
        friend class Registry;
    };
}

#endif // OSGEARTH_CAPABILITIES_H