OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #include "GrGLCaps.h" | 9 #include "GrGLCaps.h" |
10 #include "GrGLContext.h" | 10 #include "GrGLContext.h" |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
437 // configs that are color-renderable and can be passed to glRenderBuffer StorageMultisample. | 437 // configs that are color-renderable and can be passed to glRenderBuffer StorageMultisample. |
438 // Chromium may have an extension to allow BGRA renderbuffers to work on desktop platforms. | 438 // Chromium may have an extension to allow BGRA renderbuffers to work on desktop platforms. |
439 if (ctxInfo.hasExtension("GL_CHROMIUM_renderbuffer_format_BGRA8888")) { | 439 if (ctxInfo.hasExtension("GL_CHROMIUM_renderbuffer_format_BGRA8888")) { |
440 fConfigRenderSupport[kBGRA_8888_GrPixelConfig][kYes_MSAA] = true; | 440 fConfigRenderSupport[kBGRA_8888_GrPixelConfig][kYes_MSAA] = true; |
441 } else { | 441 } else { |
442 fConfigRenderSupport[kBGRA_8888_GrPixelConfig][kYes_MSAA] = | 442 fConfigRenderSupport[kBGRA_8888_GrPixelConfig][kYes_MSAA] = |
443 !fBGRAIsInternalFormat || !this->usesMSAARenderBuffers(); | 443 !fBGRAIsInternalFormat || !this->usesMSAARenderBuffers(); |
444 } | 444 } |
445 } | 445 } |
446 | 446 |
447 if (this->isConfigTexturable(kRGBA_float_GrPixelConfig)) { | |
448 fConfigRenderSupport[kRGBA_float_GrPixelConfig][kNo_MSAA] = true; | |
449 } | |
450 | |
447 // If we don't support MSAA then undo any places above where we set a config as renderable with | 451 // If we don't support MSAA then undo any places above where we set a config as renderable with |
448 // msaa. | 452 // msaa. |
449 if (kNone_MSFBOType == fMSFBOType) { | 453 if (kNone_MSFBOType == fMSFBOType) { |
450 for (int i = 0; i < kGrPixelConfigCnt; ++i) { | 454 for (int i = 0; i < kGrPixelConfigCnt; ++i) { |
451 fConfigRenderSupport[i][kYes_MSAA] = false; | 455 fConfigRenderSupport[i][kYes_MSAA] = false; |
452 } | 456 } |
453 } | 457 } |
454 } | 458 } |
455 | 459 |
456 void GrGLCaps::initConfigTexturableTable(const GrGLContextInfo& ctxInfo, const G rGLInterface* gli) { | 460 void GrGLCaps::initConfigTexturableTable(const GrGLContextInfo& ctxInfo, const G rGLInterface* gli) { |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
551 fConfigTextureSupport[kLATC_GrPixelConfig] = hasLATC; | 555 fConfigTextureSupport[kLATC_GrPixelConfig] = hasLATC; |
552 fLATCAlias = alias; | 556 fLATCAlias = alias; |
553 | 557 |
554 // Check for R11_EAC | 558 // Check for R11_EAC |
555 if (kGL_GrGLStandard == standard) { | 559 if (kGL_GrGLStandard == standard) { |
556 fConfigTextureSupport[kR11_EAC_GrPixelConfig] = | 560 fConfigTextureSupport[kR11_EAC_GrPixelConfig] = |
557 version >= GR_GL_VER(4, 3) || ctxInfo.hasExtension("GL_ARB_ES3_compa tibility"); | 561 version >= GR_GL_VER(4, 3) || ctxInfo.hasExtension("GL_ARB_ES3_compa tibility"); |
558 } else { | 562 } else { |
559 fConfigTextureSupport[kR11_EAC_GrPixelConfig] = version >= GR_GL_VER(3, 0); | 563 fConfigTextureSupport[kR11_EAC_GrPixelConfig] = version >= GR_GL_VER(3, 0); |
560 } | 564 } |
565 | |
566 // Check for floating point texture support | |
567 bool hasFPTexture = (kGL_GrGLStandard == standard); | |
bsalomon
2014/07/09 14:06:42
It wasn't required in GL until 3.1 but is availabl
| |
568 if (!hasFPTexture) { | |
569 hasFPTexture = ctxInfo.hasExtension("GL_OES_texture_float"); | |
bsalomon
2014/07/09 14:06:42
RGBA32F is required as of ES3.1, we should check t
| |
570 } | |
571 fConfigTextureSupport[kRGBA_float_GrPixelConfig] = hasFPTexture; | |
561 } | 572 } |
562 | 573 |
563 bool GrGLCaps::readPixelsSupported(const GrGLInterface* intf, | 574 bool GrGLCaps::readPixelsSupported(const GrGLInterface* intf, |
564 GrGLenum format, | 575 GrGLenum format, |
565 GrGLenum type) const { | 576 GrGLenum type) const { |
566 if (GR_GL_RGBA == format && GR_GL_UNSIGNED_BYTE == type) { | 577 if (GR_GL_RGBA == format && GR_GL_UNSIGNED_BYTE == type) { |
567 // ES 2 guarantees this format is supported | 578 // ES 2 guarantees this format is supported |
568 return true; | 579 return true; |
569 } | 580 } |
570 | 581 |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
810 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); | 821 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); |
811 r.appendf("Fragment coord conventions support: %s\n", | 822 r.appendf("Fragment coord conventions support: %s\n", |
812 (fFragCoordsConventionSupport ? "YES": "NO")); | 823 (fFragCoordsConventionSupport ? "YES": "NO")); |
813 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO")); | 824 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO")); |
814 r.appendf("Use non-VBO for dynamic data: %s\n", | 825 r.appendf("Use non-VBO for dynamic data: %s\n", |
815 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); | 826 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); |
816 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO ")); | 827 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO ")); |
817 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES" : "NO")); | 828 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES" : "NO")); |
818 return r; | 829 return r; |
819 } | 830 } |
OLD | NEW |