diff options
author | Brian Salomon <bsalomon@google.com> | 2016-11-15 14:05:01 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-11-15 20:29:07 +0000 |
commit | f26f7a063aae6eb29f526a54c7886538ac1e817b (patch) | |
tree | b92781d1546f756e3c6ecb27aa040aba21044e2f /src/gpu/glsl | |
parent | c0115e4cf3b32e05ef587b4166a17afbcffca137 (diff) |
Add detection of image load/store to caps
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4861
Change-Id: Ibf70cce9f61553e830b62339551c1541dc054e8b
Reviewed-on: https://skia-review.googlesource.com/4861
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/glsl')
-rw-r--r-- | src/gpu/glsl/GrGLSLCaps.cpp | 9 | ||||
-rw-r--r-- | src/gpu/glsl/GrGLSLCaps.h | 19 |
2 files changed, 28 insertions, 0 deletions
diff --git a/src/gpu/glsl/GrGLSLCaps.cpp b/src/gpu/glsl/GrGLSLCaps.cpp index 8e464b07e4..5bb22b3974 100644 --- a/src/gpu/glsl/GrGLSLCaps.cpp +++ b/src/gpu/glsl/GrGLSLCaps.cpp @@ -42,10 +42,15 @@ GrGLSLCaps::GrGLSLCaps(const GrContextOptions& options) { fSampleVariablesExtensionString = nullptr; fFBFetchColorName = nullptr; fFBFetchExtensionString = nullptr; + fImageLoadStoreExtensionString = nullptr; fMaxVertexSamplers = 0; fMaxGeometrySamplers = 0; fMaxFragmentSamplers = 0; fMaxCombinedSamplers = 0; + fMaxVertexImages = 0; + fMaxGeometryImages = 0; + fMaxFragmentImages = 0; + fMaxCombinedImages = 0; fAdvBlendEqInteraction = kNotSupported_AdvBlendEqInteraction; } @@ -90,6 +95,10 @@ SkString GrGLSLCaps::dump() const { r.appendf("Max GS Samplers: %d\n", fMaxGeometrySamplers); r.appendf("Max FS Samplers: %d\n", fMaxFragmentSamplers); r.appendf("Max Combined Samplers: %d\n", fMaxFragmentSamplers); + r.appendf("Max VS Images: %d\n", fMaxVertexImages); + r.appendf("Max GS Images: %d\n", fMaxGeometryImages); + r.appendf("Max FS Images: %d\n", fMaxFragmentImages); + r.appendf("Max Combined Images: %d\n", fMaxFragmentImages); r.appendf("Advanced blend equation interaction: %s\n", kAdvBlendEqInteractionStr[fAdvBlendEqInteraction]); return r; diff --git a/src/gpu/glsl/GrGLSLCaps.h b/src/gpu/glsl/GrGLSLCaps.h index 137c9b76b7..4c53ad02fd 100644 --- a/src/gpu/glsl/GrGLSLCaps.h +++ b/src/gpu/glsl/GrGLSLCaps.h @@ -144,6 +144,11 @@ public: return fSampleVariablesExtensionString; } + const char* imageLoadStoreExtensionString() const { + SkASSERT(this->imageLoadStoreSupport()); + return fImageLoadStoreExtensionString; + } + int maxVertexSamplers() const { return fMaxVertexSamplers; } int maxGeometrySamplers() const { return fMaxGeometrySamplers; } @@ -152,6 +157,14 @@ public: int maxCombinedSamplers() const { return fMaxCombinedSamplers; } + int maxVertexImages() const { return fMaxVertexImages; } + + int maxGeometryImages() const { return fMaxGeometryImages; } + + int maxFragmentImages() const { return fMaxFragmentImages; } + + int maxCombinedImages() const { return fMaxCombinedImages; } + /** * Given a texture's config, this determines what swizzle must be appended to accesses to the * texture in generated shader code. Swizzling may be implemented in texture parameters or a @@ -215,6 +228,7 @@ private: const char* fNoPerspectiveInterpolationExtensionString; const char* fMultisampleInterpolationExtensionString; const char* fSampleVariablesExtensionString; + const char* fImageLoadStoreExtensionString; const char* fFBFetchColorName; const char* fFBFetchExtensionString; @@ -224,6 +238,11 @@ private: int fMaxFragmentSamplers; int fMaxCombinedSamplers; + int fMaxVertexImages; + int fMaxGeometryImages; + int fMaxFragmentImages; + int fMaxCombinedImages; + AdvBlendEqInteraction fAdvBlendEqInteraction; GrSwizzle fConfigTextureSwizzle[kGrPixelConfigCnt]; |