From 8b7a7ddea344eed96f095652359c5c86349f86d0 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Tue, 29 Nov 2016 15:29:41 -0500 Subject: [PATCH] Remove caps image storage caps hack. 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 Commit-Queue: Brian Salomon --- src/gpu/gl/GrGLCaps.cpp | 6 ------ src/gpu/gl/GrGLGpu.cpp | 1 + tests/ImageStorageTest.cpp | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index f961a4b..ec0f628 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -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; - } } /************************************************************************** diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index 81fb835..67414a4 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -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(); } } diff --git a/tests/ImageStorageTest.cpp b/tests/ImageStorageTest.cpp index 4068174..835aec5 100644 --- a/tests/ImageStorageTest.cpp +++ b/tests/ImageStorageTest.cpp @@ -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; } -- 2.7.4