bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | |
| 9 | #ifndef GrGLCaps_DEFINED |
| 10 | #define GrGLCaps_DEFINED |
| 11 | |
bsalomon@google.com | c26d94f | 2013-03-25 18:19:00 +0000 | [diff] [blame] | 12 | #include "GrDrawTargetCaps.h" |
| 13 | #include "GrGLStencilBuffer.h" |
robertphillips@google.com | a2d7148 | 2012-08-01 20:08:47 +0000 | [diff] [blame] | 14 | #include "SkTArray.h" |
| 15 | #include "SkTDArray.h" |
bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 16 | |
| 17 | class GrGLContextInfo; |
| 18 | |
| 19 | /** |
| 20 | * Stores some capabilities of a GL context. Most are determined by the GL |
| 21 | * version and the extensions string. It also tracks formats that have passed |
| 22 | * the FBO completeness test. |
| 23 | */ |
bsalomon@google.com | c26d94f | 2013-03-25 18:19:00 +0000 | [diff] [blame] | 24 | class GrGLCaps : public GrDrawTargetCaps { |
bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 25 | public: |
bsalomon@google.com | bcce892 | 2013-03-25 15:38:39 +0000 | [diff] [blame] | 26 | SK_DECLARE_INST_COUNT(GrGLCaps) |
| 27 | |
bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 28 | typedef GrGLStencilBuffer::Format StencilFormat; |
| 29 | |
| 30 | /** |
| 31 | * The type of MSAA for FBOs supported. Different extensions have different |
| 32 | * semantics of how / when a resolve is performed. |
| 33 | */ |
| 34 | enum MSFBOType { |
| 35 | /** |
| 36 | * no support for MSAA FBOs |
| 37 | */ |
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 38 | kNone_MSFBOType = 0, |
bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 39 | /** |
skia.committer@gmail.com | 6fc1b49 | 2013-09-06 07:01:45 +0000 | [diff] [blame] | 40 | * GL3.0-style MSAA FBO (GL_ARB_framebuffer_object). |
bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 41 | */ |
bsalomon@google.com | 347c382 | 2013-05-01 20:10:01 +0000 | [diff] [blame] | 42 | kDesktop_ARB_MSFBOType, |
bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 43 | /** |
| 44 | * earlier GL_EXT_framebuffer* extensions |
| 45 | */ |
bsalomon@google.com | 347c382 | 2013-05-01 20:10:01 +0000 | [diff] [blame] | 46 | kDesktop_EXT_MSFBOType, |
bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 47 | /** |
commit-bot@chromium.org | a8e5a06 | 2013-09-05 23:44:09 +0000 | [diff] [blame] | 48 | * Similar to kDesktop_ARB but with additional restrictions on glBlitFramebuffer. |
| 49 | */ |
| 50 | kES_3_0_MSFBOType, |
| 51 | /** |
bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 52 | * GL_APPLE_framebuffer_multisample ES extension |
| 53 | */ |
bsalomon@google.com | 347c382 | 2013-05-01 20:10:01 +0000 | [diff] [blame] | 54 | kES_Apple_MSFBOType, |
bsalomon@google.com | f3a60c0 | 2013-03-19 19:06:09 +0000 | [diff] [blame] | 55 | /** |
bsalomon@google.com | 347c382 | 2013-05-01 20:10:01 +0000 | [diff] [blame] | 56 | * GL_IMG_multisampled_render_to_texture. This variation does not have MSAA renderbuffers. |
| 57 | * Instead the texture is multisampled when bound to the FBO and then resolved automatically |
| 58 | * when read. It also defines an alternate value for GL_MAX_SAMPLES (which we call |
| 59 | * GR_GL_MAX_SAMPLES_IMG). |
bsalomon@google.com | f3a60c0 | 2013-03-19 19:06:09 +0000 | [diff] [blame] | 60 | */ |
bsalomon@google.com | 347c382 | 2013-05-01 20:10:01 +0000 | [diff] [blame] | 61 | kES_IMG_MsToTexture_MSFBOType, |
| 62 | /** |
| 63 | * GL_EXT_multisampled_render_to_texture. Same as the IMG one above but uses the standard |
| 64 | * GL_MAX_SAMPLES value. |
| 65 | */ |
| 66 | kES_EXT_MsToTexture_MSFBOType, |
bsalomon@google.com | 6b0cf02 | 2013-05-03 13:35:14 +0000 | [diff] [blame] | 67 | |
skia.committer@gmail.com | ecc9d28 | 2013-05-04 07:01:15 +0000 | [diff] [blame] | 68 | kLast_MSFBOType = kES_EXT_MsToTexture_MSFBOType |
bsalomon@google.com | 6b0cf02 | 2013-05-03 13:35:14 +0000 | [diff] [blame] | 69 | }; |
| 70 | |
| 71 | enum FBFetchType { |
| 72 | kNone_FBFetchType, |
| 73 | /** GL_EXT_shader_framebuffer_fetch */ |
| 74 | kEXT_FBFetchType, |
| 75 | /** GL_NV_shader_framebuffer_fetch */ |
| 76 | kNV_FBFetchType, |
| 77 | |
| 78 | kLast_FBFetchType = kNV_FBFetchType, |
bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 79 | }; |
| 80 | |
| 81 | /** |
| 82 | * Creates a GrGLCaps that advertises no support for any extensions, |
| 83 | * formats, etc. Call init to initialize from a GrGLContextInfo. |
| 84 | */ |
| 85 | GrGLCaps(); |
| 86 | |
| 87 | GrGLCaps(const GrGLCaps& caps); |
| 88 | |
| 89 | GrGLCaps& operator = (const GrGLCaps& caps); |
| 90 | |
| 91 | /** |
| 92 | * Resets the caps such that nothing is supported. |
| 93 | */ |
bsalomon@google.com | bcce892 | 2013-03-25 15:38:39 +0000 | [diff] [blame] | 94 | virtual void reset() SK_OVERRIDE; |
bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 95 | |
| 96 | /** |
| 97 | * Initializes the GrGLCaps to the set of features supported in the current |
| 98 | * OpenGL context accessible via ctxInfo. |
| 99 | */ |
robertphillips@google.com | 6177e69 | 2013-02-28 20:16:25 +0000 | [diff] [blame] | 100 | void init(const GrGLContextInfo& ctxInfo, const GrGLInterface* interface); |
bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 101 | |
| 102 | /** |
| 103 | * Call to note that a color config has been verified as a valid color |
| 104 | * attachment. This may save future calls to glCheckFramebufferStatus |
| 105 | * using isConfigVerifiedColorAttachment(). |
| 106 | */ |
| 107 | void markConfigAsValidColorAttachment(GrPixelConfig config) { |
| 108 | fVerifiedColorConfigs.markVerified(config); |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * Call to check whether a config has been verified as a valid color |
| 113 | * attachment. |
| 114 | */ |
| 115 | bool isConfigVerifiedColorAttachment(GrPixelConfig config) const { |
| 116 | return fVerifiedColorConfigs.isVerified(config); |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * Call to note that a color config / stencil format pair passed |
| 121 | * FBO status check. We may skip calling glCheckFramebufferStatus for |
| 122 | * this combination in the future using |
| 123 | * isColorConfigAndStencilFormatVerified(). |
| 124 | */ |
| 125 | void markColorConfigAndStencilFormatAsVerified( |
| 126 | GrPixelConfig config, |
| 127 | const GrGLStencilBuffer::Format& format); |
| 128 | |
| 129 | /** |
| 130 | * Call to check whether color config / stencil format pair has already |
| 131 | * passed FBO status check. |
| 132 | */ |
| 133 | bool isColorConfigAndStencilFormatVerified( |
| 134 | GrPixelConfig config, |
| 135 | const GrGLStencilBuffer::Format& format) const; |
| 136 | |
| 137 | /** |
| 138 | * Reports the type of MSAA FBO support. |
| 139 | */ |
| 140 | MSFBOType msFBOType() const { return fMSFBOType; } |
| 141 | |
| 142 | /** |
bsalomon@google.com | 347c382 | 2013-05-01 20:10:01 +0000 | [diff] [blame] | 143 | * Does the supported MSAA FBO extension have MSAA renderbuffers? |
| 144 | */ |
| 145 | bool usesMSAARenderBuffers() const { |
| 146 | return kNone_MSFBOType != fMSFBOType && |
| 147 | kES_IMG_MsToTexture_MSFBOType != fMSFBOType && |
| 148 | kES_EXT_MsToTexture_MSFBOType != fMSFBOType; |
| 149 | } |
| 150 | |
| 151 | /** |
| 152 | * Is the MSAA FBO extension one where the texture is multisampled when bound to an FBO and |
| 153 | * then implicitly resolved when read. |
| 154 | */ |
| 155 | bool usesImplicitMSAAResolve() const { |
| 156 | return kES_IMG_MsToTexture_MSFBOType == fMSFBOType || |
| 157 | kES_EXT_MsToTexture_MSFBOType == fMSFBOType; |
| 158 | } |
| 159 | |
bsalomon@google.com | 6b0cf02 | 2013-05-03 13:35:14 +0000 | [diff] [blame] | 160 | FBFetchType fbFetchType() const { return fFBFetchType; } |
| 161 | |
bsalomon@google.com | c9668ec | 2012-04-11 18:16:41 +0000 | [diff] [blame] | 162 | /** |
bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 163 | * Prints the caps info using GrPrintf. |
| 164 | */ |
bsalomon@google.com | bcce892 | 2013-03-25 15:38:39 +0000 | [diff] [blame] | 165 | virtual void print() const SK_OVERRIDE; |
bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 166 | |
| 167 | /** |
| 168 | * Gets an array of legal stencil formats. These formats are not guaranteed |
| 169 | * to be supported by the driver but are legal GLenum names given the GL |
| 170 | * version and extensions supported. |
| 171 | */ |
| 172 | const SkTArray<StencilFormat, true>& stencilFormats() const { |
| 173 | return fStencilFormats; |
| 174 | } |
| 175 | |
| 176 | /// The maximum number of fragment uniform vectors (GLES has min. 16). |
| 177 | int maxFragmentUniformVectors() const { return fMaxFragmentUniformVectors; } |
| 178 | |
commit-bot@chromium.org | a15f7e5 | 2013-06-05 23:29:25 +0000 | [diff] [blame] | 179 | /// maximum number of attribute values per vertex |
bsalomon@google.com | 60da417 | 2012-06-01 19:25:00 +0000 | [diff] [blame] | 180 | int maxVertexAttributes() const { return fMaxVertexAttributes; } |
| 181 | |
commit-bot@chromium.org | a15f7e5 | 2013-06-05 23:29:25 +0000 | [diff] [blame] | 182 | /// maximum number of texture units accessible in the fragment shader. |
| 183 | int maxFragmentTextureUnits() const { return fMaxFragmentTextureUnits; } |
| 184 | |
commit-bot@chromium.org | 46fbfe0 | 2013-08-30 15:52:12 +0000 | [diff] [blame] | 185 | /// maximum number of fixed-function texture coords, or zero if no fixed-function. |
| 186 | int maxFixedFunctionTextureCoords() const { return fMaxFixedFunctionTextureCoords; } |
| 187 | |
bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 188 | /// ES requires an extension to support RGBA8 in RenderBufferStorage |
| 189 | bool rgba8RenderbufferSupport() const { return fRGBA8RenderbufferSupport; } |
| 190 | |
| 191 | /// Is GL_BGRA supported |
| 192 | bool bgraFormatSupport() const { return fBGRAFormatSupport; } |
| 193 | |
| 194 | /** |
| 195 | * Depending on the ES extensions present the BGRA external format may |
| 196 | * correspond either a BGRA or RGBA internalFormat. On desktop GL it is |
| 197 | * RGBA. |
| 198 | */ |
| 199 | bool bgraIsInternalFormat() const { return fBGRAIsInternalFormat; } |
| 200 | |
| 201 | /// GL_ARB_texture_swizzle support |
| 202 | bool textureSwizzleSupport() const { return fTextureSwizzleSupport; } |
| 203 | |
| 204 | /// Is there support for GL_UNPACK_ROW_LENGTH |
| 205 | bool unpackRowLengthSupport() const { return fUnpackRowLengthSupport; } |
| 206 | |
| 207 | /// Is there support for GL_UNPACK_FLIP_Y |
| 208 | bool unpackFlipYSupport() const { return fUnpackFlipYSupport; } |
| 209 | |
| 210 | /// Is there support for GL_PACK_ROW_LENGTH |
| 211 | bool packRowLengthSupport() const { return fPackRowLengthSupport; } |
| 212 | |
| 213 | /// Is there support for GL_PACK_REVERSE_ROW_ORDER |
| 214 | bool packFlipYSupport() const { return fPackFlipYSupport; } |
| 215 | |
| 216 | /// Is there support for texture parameter GL_TEXTURE_USAGE |
| 217 | bool textureUsageSupport() const { return fTextureUsageSupport; } |
| 218 | |
| 219 | /// Is there support for glTexStorage |
| 220 | bool texStorageSupport() const { return fTexStorageSupport; } |
| 221 | |
robertphillips@google.com | 443e5a5 | 2012-04-30 20:01:21 +0000 | [diff] [blame] | 222 | /// Is there support for GL_RED and GL_R8 |
| 223 | bool textureRedSupport() const { return fTextureRedSupport; } |
| 224 | |
bsalomon@google.com | e76b7cc | 2012-06-18 12:47:06 +0000 | [diff] [blame] | 225 | /// Is GL_ARB_IMAGING supported |
| 226 | bool imagingSupport() const { return fImagingSupport; } |
| 227 | |
bsalomon@google.com | 706f668 | 2012-10-23 14:53:55 +0000 | [diff] [blame] | 228 | /// Is GL_ARB_fragment_coord_conventions supported? |
| 229 | bool fragCoordConventionsSupport() const { return fFragCoordsConventionSupport; } |
| 230 | |
bsalomon@google.com | 07631cf | 2013-03-05 14:14:58 +0000 | [diff] [blame] | 231 | /// Is there support for Vertex Array Objects? |
| 232 | bool vertexArrayObjectSupport() const { return fVertexArrayObjectSupport; } |
| 233 | |
| 234 | /// Use indices or vertices in CPU arrays rather than VBOs for dynamic content. |
bsalomon@google.com | 96966a5 | 2013-02-21 16:34:21 +0000 | [diff] [blame] | 235 | bool useNonVBOVertexAndIndexDynamicData() const { |
| 236 | return fUseNonVBOVertexAndIndexDynamicData; |
| 237 | } |
| 238 | |
bsalomon@google.com | 07631cf | 2013-03-05 14:14:58 +0000 | [diff] [blame] | 239 | /// Does ReadPixels support the provided format/type combo? |
robertphillips@google.com | 1d89c93 | 2012-06-27 19:31:41 +0000 | [diff] [blame] | 240 | bool readPixelsSupported(const GrGLInterface* intf, |
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 241 | GrGLenum format, |
robertphillips@google.com | 1d89c93 | 2012-06-27 19:31:41 +0000 | [diff] [blame] | 242 | GrGLenum type) const; |
skia.committer@gmail.com | 631cdcb | 2013-03-01 12:12:55 +0000 | [diff] [blame] | 243 | |
bsalomon@google.com | 2b1b8c0 | 2013-02-28 22:06:02 +0000 | [diff] [blame] | 244 | bool isCoreProfile() const { return fIsCoreProfile; } |
robertphillips@google.com | 1d89c93 | 2012-06-27 19:31:41 +0000 | [diff] [blame] | 245 | |
commit-bot@chromium.org | 3628ad9 | 2013-08-30 19:43:47 +0000 | [diff] [blame] | 246 | bool fixedFunctionSupport() const { return fFixedFunctionSupport; } |
| 247 | |
robertphillips@google.com | a6ffb58 | 2013-04-29 16:50:17 +0000 | [diff] [blame] | 248 | /// Is there support for discarding the frame buffer |
| 249 | bool discardFBSupport() const { return fDiscardFBSupport; } |
| 250 | |
bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 251 | private: |
| 252 | /** |
| 253 | * Maintains a bit per GrPixelConfig. It is used to avoid redundantly |
| 254 | * performing glCheckFrameBufferStatus for the same config. |
| 255 | */ |
| 256 | struct VerifiedColorConfigs { |
| 257 | VerifiedColorConfigs() { |
| 258 | this->reset(); |
| 259 | } |
| 260 | |
| 261 | void reset() { |
| 262 | for (int i = 0; i < kNumUints; ++i) { |
| 263 | fVerifiedColorConfigs[i] = 0; |
| 264 | } |
| 265 | } |
| 266 | |
bsalomon@google.com | b8eb2e8 | 2013-03-28 13:46:42 +0000 | [diff] [blame] | 267 | static const int kNumUints = (kGrPixelConfigCnt + 31) / 32; |
bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 268 | uint32_t fVerifiedColorConfigs[kNumUints]; |
| 269 | |
| 270 | void markVerified(GrPixelConfig config) { |
| 271 | #if !GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT |
| 272 | return; |
| 273 | #endif |
| 274 | int u32Idx = config / 32; |
| 275 | int bitIdx = config % 32; |
| 276 | fVerifiedColorConfigs[u32Idx] |= 1 << bitIdx; |
| 277 | } |
| 278 | |
| 279 | bool isVerified(GrPixelConfig config) const { |
| 280 | #if !GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT |
| 281 | return false; |
| 282 | #endif |
| 283 | int u32Idx = config / 32; |
| 284 | int bitIdx = config % 32; |
| 285 | return SkToBool(fVerifiedColorConfigs[u32Idx] & (1 << bitIdx)); |
| 286 | } |
| 287 | }; |
| 288 | |
commit-bot@chromium.org | 7388051 | 2013-10-14 15:33:45 +0000 | [diff] [blame^] | 289 | void initFSAASupport(const GrGLContextInfo&, const GrGLInterface*); |
| 290 | void initStencilFormats(const GrGLContextInfo&); |
| 291 | void initConfigRenderableTable(const GrGLContextInfo&); |
bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 292 | |
| 293 | // tracks configs that have been verified to pass the FBO completeness when |
| 294 | // used as a color attachment |
| 295 | VerifiedColorConfigs fVerifiedColorConfigs; |
| 296 | |
| 297 | SkTArray<StencilFormat, true> fStencilFormats; |
| 298 | // tracks configs that have been verified to pass the FBO completeness when |
| 299 | // used as a color attachment when a particular stencil format is used |
| 300 | // as a stencil attachment. |
| 301 | SkTArray<VerifiedColorConfigs, true> fStencilVerifiedColorConfigs; |
| 302 | |
| 303 | int fMaxFragmentUniformVectors; |
bsalomon@google.com | 60da417 | 2012-06-01 19:25:00 +0000 | [diff] [blame] | 304 | int fMaxVertexAttributes; |
commit-bot@chromium.org | a15f7e5 | 2013-06-05 23:29:25 +0000 | [diff] [blame] | 305 | int fMaxFragmentTextureUnits; |
commit-bot@chromium.org | 46fbfe0 | 2013-08-30 15:52:12 +0000 | [diff] [blame] | 306 | int fMaxFixedFunctionTextureCoords; |
bsalomon@google.com | 60da417 | 2012-06-01 19:25:00 +0000 | [diff] [blame] | 307 | |
bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 308 | MSFBOType fMSFBOType; |
bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 309 | |
bsalomon@google.com | 6b0cf02 | 2013-05-03 13:35:14 +0000 | [diff] [blame] | 310 | FBFetchType fFBFetchType; |
| 311 | |
bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 312 | bool fRGBA8RenderbufferSupport : 1; |
| 313 | bool fBGRAFormatSupport : 1; |
| 314 | bool fBGRAIsInternalFormat : 1; |
| 315 | bool fTextureSwizzleSupport : 1; |
| 316 | bool fUnpackRowLengthSupport : 1; |
| 317 | bool fUnpackFlipYSupport : 1; |
| 318 | bool fPackRowLengthSupport : 1; |
| 319 | bool fPackFlipYSupport : 1; |
| 320 | bool fTextureUsageSupport : 1; |
| 321 | bool fTexStorageSupport : 1; |
robertphillips@google.com | 443e5a5 | 2012-04-30 20:01:21 +0000 | [diff] [blame] | 322 | bool fTextureRedSupport : 1; |
bsalomon@google.com | e76b7cc | 2012-06-18 12:47:06 +0000 | [diff] [blame] | 323 | bool fImagingSupport : 1; |
robertphillips@google.com | 1d89c93 | 2012-06-27 19:31:41 +0000 | [diff] [blame] | 324 | bool fTwoFormatLimit : 1; |
bsalomon@google.com | 706f668 | 2012-10-23 14:53:55 +0000 | [diff] [blame] | 325 | bool fFragCoordsConventionSupport : 1; |
bsalomon@google.com | 07631cf | 2013-03-05 14:14:58 +0000 | [diff] [blame] | 326 | bool fVertexArrayObjectSupport : 1; |
bsalomon@google.com | 96966a5 | 2013-02-21 16:34:21 +0000 | [diff] [blame] | 327 | bool fUseNonVBOVertexAndIndexDynamicData : 1; |
bsalomon@google.com | 2b1b8c0 | 2013-02-28 22:06:02 +0000 | [diff] [blame] | 328 | bool fIsCoreProfile : 1; |
commit-bot@chromium.org | 3628ad9 | 2013-08-30 19:43:47 +0000 | [diff] [blame] | 329 | bool fFixedFunctionSupport : 1; |
robertphillips@google.com | a6ffb58 | 2013-04-29 16:50:17 +0000 | [diff] [blame] | 330 | bool fDiscardFBSupport : 1; |
bsalomon@google.com | bcce892 | 2013-03-25 15:38:39 +0000 | [diff] [blame] | 331 | |
bsalomon@google.com | c26d94f | 2013-03-25 18:19:00 +0000 | [diff] [blame] | 332 | typedef GrDrawTargetCaps INHERITED; |
bsalomon@google.com | f7fa806 | 2012-02-14 14:09:57 +0000 | [diff] [blame] | 333 | }; |
| 334 | |
| 335 | #endif |