aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLCaps.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-05-03 13:35:14 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-05-03 13:35:14 +0000
commit6b0cf0273fdffbbdf69235b57b5b5a311e7f1ca6 (patch)
tree150ff50876434a33bb0d2ccfd299e8bc710d2531 /src/gpu/gl/GrGLCaps.cpp
parentdfa1ce027f0b56de40d0ccfefbc30955a50a7350 (diff)
Add support for GL_*_shader__framebuffer_fetch
R=robertphillips@google.com Review URL: https://codereview.chromium.org/14875002 git-svn-id: http://skia.googlecode.com/svn/trunk@8980 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/gl/GrGLCaps.cpp')
-rw-r--r--src/gpu/gl/GrGLCaps.cpp38
1 files changed, 32 insertions, 6 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 8ec76a85ab..5568c48123 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -24,6 +24,7 @@ void GrGLCaps::reset() {
fStencilVerifiedColorConfigs.reset();
fMSFBOType = kNone_MSFBOType;
fCoverageAAType = kNone_CoverageAAType;
+ fFBFetchType = kNone_FBFetchType;
fMaxFragmentUniformVectors = 0;
fMaxVertexAttributes = 0;
fRGBA8RenderbufferSupport = false;
@@ -60,6 +61,7 @@ GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) {
fMSFBOType = caps.fMSFBOType;
fCoverageAAType = caps.fCoverageAAType;
fMSAACoverageModes = caps.fMSAACoverageModes;
+ fFBFetchType = caps.fFBFetchType;
fRGBA8RenderbufferSupport = caps.fRGBA8RenderbufferSupport;
fBGRAFormatSupport = caps.fBGRAFormatSupport;
fBGRAIsInternalFormat = caps.fBGRAIsInternalFormat;
@@ -205,6 +207,14 @@ void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
fVertexArrayObjectSupport = ctxInfo.hasExtension("GL_OES_vertex_array_object");
}
+ if (kES2_GrGLBinding == binding) {
+ if (ctxInfo.hasExtension("GL_EXT_shader_framebuffer_fetch")) {
+ fFBFetchType = kEXT_FBFetchType;
+ } else if (ctxInfo.hasExtension("GL_NV_shader_framebuffer_fetch")) {
+ fFBFetchType = kNV_FBFetchType;
+ }
+ }
+
this->initFSAASupport(ctxInfo, gli);
this->initStencilFormats(ctxInfo);
@@ -274,6 +284,8 @@ void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
fPathStencilingSupport = GR_GL_USE_NV_PATH_RENDERING &&
ctxInfo.hasExtension("GL_NV_path_rendering");
+ fDstReadInShaderSupport = kNone_FBFetchType != fFBFetchType;
+
// Enable supported shader-related caps
if (kDesktop_GrGLBinding == binding) {
fDualSourceBlendingSupport = ctxInfo.version() >= GR_GL_VER(3,3) ||
@@ -521,21 +533,35 @@ void GrGLCaps::print() const {
fStencilFormats[i].fTotalBits);
}
+ static const char* kMSFBOExtStr[] = {
+ "None",
+ "ARB",
+ "EXT",
+ "Apple",
+ "IMG MS To Texture",
+ "EXT MS To Texture",
+ };
GR_STATIC_ASSERT(0 == kNone_MSFBOType);
GR_STATIC_ASSERT(1 == kDesktop_ARB_MSFBOType);
GR_STATIC_ASSERT(2 == kDesktop_EXT_MSFBOType);
GR_STATIC_ASSERT(3 == kES_Apple_MSFBOType);
GR_STATIC_ASSERT(4 == kES_IMG_MsToTexture_MSFBOType);
GR_STATIC_ASSERT(5 == kES_EXT_MsToTexture_MSFBOType);
- static const char* gMSFBOExtStr[] = {
+ GR_STATIC_ASSERT(GR_ARRAY_COUNT(kMSFBOExtStr) == kLast_MSFBOType + 1);
+
+ static const char* kFBFetchTypeStr[] = {
"None",
- "ARB",
"EXT",
- "Apple",
- "IMG MS To Texture",
- "EXT MS To Texture",
+ "NV",
};
- GrPrintf("MSAA Type: %s\n", gMSFBOExtStr[fMSFBOType]);
+ GR_STATIC_ASSERT(0 == kNone_FBFetchType);
+ GR_STATIC_ASSERT(1 == kEXT_FBFetchType);
+ GR_STATIC_ASSERT(2 == kNV_FBFetchType);
+ GR_STATIC_ASSERT(GR_ARRAY_COUNT(kFBFetchTypeStr) == kLast_FBFetchType + 1);
+
+
+ GrPrintf("MSAA Type: %s\n", kMSFBOExtStr[fMSFBOType]);
+ GrPrintf("FB Fetch Type: %s\n", kFBFetchTypeStr[fFBFetchType]);
GrPrintf("Max FS Uniform Vectors: %d\n", fMaxFragmentUniformVectors);
GrPrintf("Max Vertex Attributes: %d\n", fMaxVertexAttributes);
GrPrintf("Support RGBA8 Render Buffer: %s\n", (fRGBA8RenderbufferSupport ? "YES": "NO"));