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

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

Issue 1536033003: Fold color attachment verification bit into GrGLCaps::ConfigInfo (Closed) Base URL: https://skia.googlesource.com/skia.git@mv2caps
Patch Set: delete more code Created 5 years 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 | « no previous file | src/gpu/gl/GrGLCaps.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLCaps.h
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index a54a10da52d6109ed725a076bf6335539711ca7d..4ca73bc3a4073db022b7b68aa06fbb18bcf853b1 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -181,7 +181,7 @@ public:
* using isConfigVerifiedColorAttachment().
*/
void markConfigAsValidColorAttachment(GrPixelConfig config) {
- fVerifiedColorConfigs.markVerified(config);
+ fConfigTable[config].fFlags |= ConfigInfo::kVerifiedColorAttachment_Flag;
}
/**
@@ -189,7 +189,7 @@ public:
* attachment.
*/
bool isConfigVerifiedColorAttachment(GrPixelConfig config) const {
- return fVerifiedColorConfigs.isVerified(config);
+ return SkToBool(fConfigTable[config].fFlags & ConfigInfo::kVerifiedColorAttachment_Flag);
}
/**
@@ -341,43 +341,6 @@ private:
void onApplyOptionsOverrides(const GrContextOptions& options) override;
- /**
- * Maintains a bit per GrPixelConfig. It is used to avoid redundantly
- * performing glCheckFrameBufferStatus for the same config.
- */
- struct VerifiedColorConfigs {
- VerifiedColorConfigs() {
- this->reset();
- }
-
- void reset() {
- for (int i = 0; i < kNumUints; ++i) {
- fVerifiedColorConfigs[i] = 0;
- }
- }
-
- static const int kNumUints = (kGrPixelConfigCnt + 31) / 32;
- uint32_t fVerifiedColorConfigs[kNumUints];
-
- void markVerified(GrPixelConfig config) {
-#if !GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT
- return;
-#endif
- int u32Idx = config / 32;
- int bitIdx = config % 32;
- fVerifiedColorConfigs[u32Idx] |= 1 << bitIdx;
- }
-
- bool isVerified(GrPixelConfig config) const {
-#if !GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT
- return false;
-#endif
- int u32Idx = config / 32;
- int bitIdx = config % 32;
- return SkToBool(fVerifiedColorConfigs[u32Idx] & (1 << bitIdx));
- }
- };
-
void initFSAASupport(const GrGLContextInfo&, const GrGLInterface*);
void initBlendEqationSupport(const GrGLContextInfo&);
void initStencilFormats(const GrGLContextInfo&);
@@ -395,10 +358,6 @@ private:
void initConfigTable(const GrGLContextInfo&);
- // tracks configs that have been verified to pass the FBO completeness when
- // used as a color attachment
- VerifiedColorConfigs fVerifiedColorConfigs;
-
SkTArray<StencilFormat, true> fStencilFormats;
int fMaxFragmentUniformVectors;
@@ -437,20 +396,24 @@ private:
bool fExternalTextureSupport : 1;
struct ConfigInfo {
- ConfigInfo() : fStencilFormatIndex(kUnknown_StencilIndex) {};
+ ConfigInfo() : fStencilFormatIndex(kUnknown_StencilIndex), fFlags(0) {};
ConfigFormats fFormats;
- // Index into GrGLCaps's list of stencil formats. Support is determined experimentally and
- // lazily.
- int fStencilFormatIndex;
-
enum {
// This indicates that a stencil format has not yet been determined for the config.
kUnknown_StencilIndex = -1,
// This indicates that there is no supported stencil format for the config.
kUnsupported_StencilFormatIndex = -2
};
+
+ // Index fStencilFormats.
+ int fStencilFormatIndex;
+
+ enum {
+ kVerifiedColorAttachment_Flag = 0x1
+ };
+ uint32_t fFlags;
};
ConfigInfo fConfigTable[kGrPixelConfigCnt];
« no previous file with comments | « no previous file | src/gpu/gl/GrGLCaps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698