aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/gpu/GrContext.cpp3
-rw-r--r--src/gpu/effects/GrConfigConversionEffect.fp8
-rw-r--r--src/gpu/effects/GrConfigConversionEffect.h8
-rw-r--r--tests/PrimitiveProcessorTest.cpp3
-rw-r--r--tests/TessellatingPathRendererTests.cpp3
5 files changed, 25 insertions, 0 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index cc311b6e87..74fbe10ac1 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -871,6 +871,9 @@ bool GrContextPriv::readSurfacePixels(GrSurfaceContext* src, int left, int top,
GrMipMapped::kNo,
tempDrawInfo.fTempSurfaceDesc.fOrigin);
if (tempRTC) {
+ // Adding discard to appease vulkan validation warning about loading uninitialized data
+ // on draw
+ tempRTC->discard();
SkMatrix textureMatrix = SkMatrix::MakeTrans(SkIntToScalar(left), SkIntToScalar(top));
sk_sp<GrTextureProxy> proxy = src->asTextureProxyRef();
auto fp = GrSimpleTextureEffect::Make(std::move(proxy), textureMatrix);
diff --git a/src/gpu/effects/GrConfigConversionEffect.fp b/src/gpu/effects/GrConfigConversionEffect.fp
index 856195b0bd..569011135e 100644
--- a/src/gpu/effects/GrConfigConversionEffect.fp
+++ b/src/gpu/effects/GrConfigConversionEffect.fp
@@ -49,6 +49,10 @@
if (!readRTC || !readRTC->asTextureProxy() || !tempRTC) {
return false;
}
+ // Adding discard to appease vulkan validation warning about loading uninitialized data on
+ // draw
+ readRTC->discard();
+
GrSurfaceDesc desc;
desc.fOrigin = kTopLeft_GrSurfaceOrigin;
desc.fWidth = kSize;
@@ -87,6 +91,10 @@
return false;
}
+ // Adding discard to appease vulkan validation warning about loading uninitialized data on
+ // draw
+ tempRTC->discard();
+
paint2.addColorTextureProcessor(readRTC->asTextureProxyRef(), SkMatrix::I());
paint2.addColorFragmentProcessor(std::move(upmToPM));
paint2.setPorterDuffXPFactory(SkBlendMode::kSrc);
diff --git a/src/gpu/effects/GrConfigConversionEffect.h b/src/gpu/effects/GrConfigConversionEffect.h
index b3709cafc8..ec5c2b3e41 100644
--- a/src/gpu/effects/GrConfigConversionEffect.h
+++ b/src/gpu/effects/GrConfigConversionEffect.h
@@ -53,6 +53,10 @@ public:
if (!readRTC || !readRTC->asTextureProxy() || !tempRTC) {
return false;
}
+ // Adding discard to appease vulkan validation warning about loading uninitialized data on
+ // draw
+ readRTC->discard();
+
GrSurfaceDesc desc;
desc.fOrigin = kTopLeft_GrSurfaceOrigin;
desc.fWidth = kSize;
@@ -91,6 +95,10 @@ public:
return false;
}
+ // Adding discard to appease vulkan validation warning about loading uninitialized data on
+ // draw
+ tempRTC->discard();
+
paint2.addColorTextureProcessor(readRTC->asTextureProxyRef(), SkMatrix::I());
paint2.addColorFragmentProcessor(std::move(upmToPM));
paint2.setPorterDuffXPFactory(SkBlendMode::kSrc);
diff --git a/tests/PrimitiveProcessorTest.cpp b/tests/PrimitiveProcessorTest.cpp
index d402e65f1c..089d6ce1bf 100644
--- a/tests/PrimitiveProcessorTest.cpp
+++ b/tests/PrimitiveProcessorTest.cpp
@@ -134,6 +134,9 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(VertexAttributeCount, reporter, ctxInfo) {
REPORTER_ASSERT(reporter, gpu->stats()->numDraws() == 0);
REPORTER_ASSERT(reporter, gpu->stats()->numFailedDraws() == 0);
#endif
+ // Adding discard to appease vulkan validation warning about loading uninitialized data on draw
+ renderTargetContext->discard();
+
GrPaint grPaint;
// This one should succeed.
renderTargetContext->priv().testingOnly_addDrawOp(Op::Make(attribCnt));
diff --git a/tests/TessellatingPathRendererTests.cpp b/tests/TessellatingPathRendererTests.cpp
index e24bf7a516..f6304f5b18 100644
--- a/tests/TessellatingPathRendererTests.cpp
+++ b/tests/TessellatingPathRendererTests.cpp
@@ -493,6 +493,9 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) {
}
ctx->flush();
+ // Adding discard to appease vulkan validation warning about loading uninitialized data on draw
+ rtc->discard();
+
test_path(ctx, rtc.get(), create_path_0());
test_path(ctx, rtc.get(), create_path_1());
test_path(ctx, rtc.get(), create_path_2());