aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-07-12 14:53:49 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-13 00:45:54 +0000
commit662ea4baba570d2f21a7b33d268204e9bdfa7fb9 (patch)
tree71da861d0d9b8f014e7f09f89b122480e067e8c0 /tests
parent13ac194dbf9968d356e580b85420f1314f453a10 (diff)
Remove texel buffer support.
Change-Id: Ia6f21afe714208979a5bc384e436b28ea2b9a297 Reviewed-on: https://skia-review.googlesource.com/141051 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/ProcessorTest.cpp55
-rw-r--r--tests/SkSLGLSLTest.cpp4
2 files changed, 5 insertions, 54 deletions
diff --git a/tests/ProcessorTest.cpp b/tests/ProcessorTest.cpp
index 4eb735f325..8263615115 100644
--- a/tests/ProcessorTest.cpp
+++ b/tests/ProcessorTest.cpp
@@ -95,30 +95,23 @@ public:
private:
TestFP(const SkTArray<sk_sp<GrTextureProxy>>& proxies, const SkTArray<sk_sp<GrBuffer>>& buffers)
- : INHERITED(kTestFP_ClassID, kNone_OptimizationFlags), fSamplers(4), fBuffers(4) {
+ : INHERITED(kTestFP_ClassID, kNone_OptimizationFlags), fSamplers(4) {
for (const auto& proxy : proxies) {
this->addTextureSampler(&fSamplers.emplace_back(proxy));
}
- for (const auto& buffer : buffers) {
- this->addBufferAccess(&fBuffers.emplace_back(kRGBA_8888_GrPixelConfig, buffer.get()));
- }
}
TestFP(std::unique_ptr<GrFragmentProcessor> child)
- : INHERITED(kTestFP_ClassID, kNone_OptimizationFlags), fSamplers(4), fBuffers(4) {
+ : INHERITED(kTestFP_ClassID, kNone_OptimizationFlags), fSamplers(4) {
this->registerChildProcessor(std::move(child));
}
explicit TestFP(const TestFP& that)
- : INHERITED(kTestFP_ClassID, that.optimizationFlags()), fSamplers(4), fBuffers(4) {
+ : INHERITED(kTestFP_ClassID, that.optimizationFlags()), fSamplers(4) {
for (int i = 0; i < that.fSamplers.count(); ++i) {
fSamplers.emplace_back(that.fSamplers[i]);
this->addTextureSampler(&fSamplers.back());
}
- for (int i = 0; i < that.fBuffers.count(); ++i) {
- fBuffers.emplace_back(that.fBuffers[i]);
- this->addBufferAccess(&fBuffers.back());
- }
for (int i = 0; i < that.numChildProcessors(); ++i) {
this->registerChildProcessor(that.childProcessor(i).clone());
}
@@ -141,7 +134,6 @@ private:
bool onIsEqual(const GrFragmentProcessor&) const override { return false; }
GrTAllocator<TextureSampler> fSamplers;
- GrTAllocator<BufferAccess> fBuffers;
typedef GrFragmentProcessor INHERITED;
};
}
@@ -162,7 +154,6 @@ void testingOnly_getIORefCnts(GrTextureProxy* proxy, int* refCnt, int* readCnt,
DEF_GPUTEST_FOR_ALL_CONTEXTS(ProcessorRefTest, reporter, ctxInfo) {
GrContext* context = ctxInfo.grContext();
GrProxyProvider* proxyProvider = context->contextPriv().proxyProvider();
- GrResourceProvider* resourceProvider = context->contextPriv().resourceProvider();
GrSurfaceDesc desc;
desc.fWidth = 10;
@@ -176,8 +167,6 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(ProcessorRefTest, reporter, ctxInfo) {
SkBackingFit::kApprox, 1, 1,
kRGBA_8888_GrPixelConfig, nullptr));
{
- bool texelBufferSupport =
- context->contextPriv().caps()->shaderCaps()->texelBufferSupport();
sk_sp<GrTextureProxy> proxy1 = proxyProvider->createProxy(
desc, kTopLeft_GrSurfaceOrigin, SkBackingFit::kExact, SkBudgeted::kYes);
sk_sp<GrTextureProxy> proxy2 = proxyProvider->createProxy(
@@ -186,18 +175,10 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(ProcessorRefTest, reporter, ctxInfo) {
desc, kTopLeft_GrSurfaceOrigin, SkBackingFit::kExact, SkBudgeted::kYes);
sk_sp<GrTextureProxy> proxy4 = proxyProvider->createProxy(
desc, kTopLeft_GrSurfaceOrigin, SkBackingFit::kExact, SkBudgeted::kYes);
- sk_sp<GrBuffer> buffer(texelBufferSupport
- ? resourceProvider->createBuffer(
- 1024, GrBufferType::kTexel_GrBufferType,
- GrAccessPattern::kStatic_GrAccessPattern, 0)
- : nullptr);
{
SkTArray<sk_sp<GrTextureProxy>> proxies;
SkTArray<sk_sp<GrBuffer>> buffers;
proxies.push_back(proxy1);
- if (texelBufferSupport) {
- buffers.push_back(buffer);
- }
auto fp = TestFP::Make(std::move(proxies), std::move(buffers));
for (int i = 0; i < parentCnt; ++i) {
fp = TestFP::Make(std::move(fp));
@@ -222,13 +203,6 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(ProcessorRefTest, reporter, ctxInfo) {
REPORTER_ASSERT(reporter, ioRefMul * 1 == readCnt);
REPORTER_ASSERT(reporter, ioRefMul * 0 == writeCnt);
- if (texelBufferSupport) {
- testingOnly_getIORefCnts(buffer.get(), &refCnt, &readCnt, &writeCnt);
- REPORTER_ASSERT(reporter, 1 == refCnt);
- REPORTER_ASSERT(reporter, ioRefMul * 1 == readCnt);
- REPORTER_ASSERT(reporter, ioRefMul * 0 == writeCnt);
- }
-
context->flush();
testingOnly_getIORefCnts(proxy1.get(), &refCnt, &readCnt, &writeCnt);
@@ -236,29 +210,6 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(ProcessorRefTest, reporter, ctxInfo) {
REPORTER_ASSERT(reporter, ioRefMul * 0 == readCnt);
REPORTER_ASSERT(reporter, ioRefMul * 0 == writeCnt);
- if (texelBufferSupport) {
- testingOnly_getIORefCnts(buffer.get(), &refCnt, &readCnt, &writeCnt);
- REPORTER_ASSERT(reporter, 1 == refCnt);
- REPORTER_ASSERT(reporter, ioRefMul * 0 == readCnt);
- REPORTER_ASSERT(reporter, ioRefMul * 0 == writeCnt);
- }
-
- if (texelBufferSupport) {
- testingOnly_getIORefCnts(proxy2.get(), &refCnt, &readCnt, &writeCnt);
- REPORTER_ASSERT(reporter, 1 == refCnt);
- REPORTER_ASSERT(reporter, ioRefMul * 0 == readCnt);
- REPORTER_ASSERT(reporter, ioRefMul * 0 == writeCnt);
-
- testingOnly_getIORefCnts(proxy3.get(), &refCnt, &readCnt, &writeCnt);
- REPORTER_ASSERT(reporter, 1 == refCnt);
- REPORTER_ASSERT(reporter, ioRefMul * 0 == readCnt);
- REPORTER_ASSERT(reporter, ioRefMul * 0 == writeCnt);
-
- testingOnly_getIORefCnts(proxy4.get(), &refCnt, &readCnt, &writeCnt);
- REPORTER_ASSERT(reporter, 1 == refCnt);
- REPORTER_ASSERT(reporter, ioRefMul * 0 == readCnt);
- REPORTER_ASSERT(reporter, ioRefMul * 0 == writeCnt);
- }
}
}
}
diff --git a/tests/SkSLGLSLTest.cpp b/tests/SkSLGLSLTest.cpp
index c3577e0c3c..275fb2b017 100644
--- a/tests/SkSLGLSLTest.cpp
+++ b/tests/SkSLGLSLTest.cpp
@@ -923,8 +923,8 @@ DEF_TEST(SkSLCaps, r) {
"int w = 0;"
"if (sk_Caps.externalTextureSupport) x = 1;"
"if (sk_Caps.fbFetchSupport) y = 1;"
- "if (sk_Caps.dropsTileOnZeroDivide && sk_Caps.texelFetchSupport) z = 1;"
- "if (sk_Caps.dropsTileOnZeroDivide && sk_Caps.canUseAnyFunctionInShader) w = 1;"
+ "if (sk_Caps.dropsTileOnZeroDivide) z = 1;"
+ "if (sk_Caps.canUseAnyFunctionInShader) w = 1;"
"sk_FragColor = half4(x, y, z, w);"
"}",
*SkSL::ShaderCapsFactory::VariousCaps(),