Remove caps image storage caps hack.
authorBrian Salomon <bsalomon@google.com>
Tue, 29 Nov 2016 20:29:41 +0000 (15:29 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Tue, 29 Nov 2016 21:17:42 +0000 (21:17 +0000)
This was necessary because the number of fragment image storages couldn't be queried in shading language neutral code. We are no longer shading language neutral and this can be queried.

Change-Id: I065a38688919e7cdb1482877a232cb004c8f1511
Reviewed-on: https://skia-review.googlesource.com/5315
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

src/gpu/gl/GrGLCaps.cpp
src/gpu/gl/GrGLGpu.cpp
tests/ImageStorageTest.cpp

index f961a4b..ec0f628 100644 (file)
@@ -343,12 +343,6 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
                                                        shaderCaps->fMaxGeometryImageStorages);
         shaderCaps->fMaxFragmentImageStorages =  SkTMin(maxUnits,
                                                         shaderCaps->fMaxFragmentImageStorages);
-        // HACK: Currently we only use images in a unit test in the fragment shader. The individual
-        // stage image limits aren't exposed through GrShaderCaps. Soon GrShaderCaps and GrGLSLCaps
-        // will merge and the test can look for fragment support.
-        if (!shaderCaps->fMaxFragmentImageStorages) {
-            shaderCaps->fImageLoadStoreSupport = false;
-        }
     }
 
     /**************************************************************************
index 81fb835..67414a4 100644 (file)
@@ -561,6 +561,7 @@ void GrGLGpu::onResetContext(uint32_t resetBits) {
             fHWBufferTextures[b].fKnownBound = false;
         }
         for (int i = 0; i < fHWBoundImageStorages.count(); ++i) {
+            SkASSERT(this->caps()->shaderCaps()->imageLoadStoreSupport());
             fHWBoundImageStorages[i].fTextureUniqueID.makeInvalid();
         }
     }
index 4068174..835aec5 100644 (file)
@@ -79,7 +79,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageStorageLoad, reporter, ctxInfo) {
 
     static constexpr int kS = 256;
     GrContext* context = ctxInfo.grContext();
-    if (!context->caps()->shaderCaps()->imageLoadStoreSupport()) {
+    if (context->caps()->shaderCaps()->maxFragmentImageStorages() < 1) {
         return;
     }