Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(643)

Unified Diff: src/gpu/gl/GrGLCaps.cpp

Issue 14875002: Add support for GL_*_shader_framebuffer_fetch (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLCaps.h ('k') | src/gpu/gl/GrGLProgramDesc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLCaps.cpp
===================================================================
--- src/gpu/gl/GrGLCaps.cpp (revision 8966)
+++ src/gpu/gl/GrGLCaps.cpp (working copy)
@@ -24,6 +24,7 @@
fStencilVerifiedColorConfigs.reset();
fMSFBOType = kNone_MSFBOType;
fCoverageAAType = kNone_CoverageAAType;
+ fFBFetchType = kNone_FBFetchType;
fMaxFragmentUniformVectors = 0;
fMaxVertexAttributes = 0;
fRGBA8RenderbufferSupport = false;
@@ -60,6 +61,7 @@
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 @@
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 @@
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 @@
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"));
« no previous file with comments | « src/gpu/gl/GrGLCaps.h ('k') | src/gpu/gl/GrGLProgramDesc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698