Changing dst sample type to flags.
Instead of having an enum that says how to sample the dst in the shader
(or lack of dst sampling), we now rely on whether or not we have a valid
proxy in the GrDstProxyView to know whether we are sampling the dst at
all. Then if so we additionally have GrDstSampleFlags to say whether we
need to use a texture barrier and whether we are sampling from an input
attachment.
Change-Id: Id0390a8ad57ec52674922807f6c050d59b7e75a2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/416416
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrXferProcessor.cpp b/src/gpu/GrXferProcessor.cpp
index 2921ae0..1d74e12 100644
--- a/src/gpu/GrXferProcessor.cpp
+++ b/src/gpu/GrXferProcessor.cpp
@@ -30,7 +30,7 @@
void GrXferProcessor::getGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b,
const GrSurfaceOrigin* originIfDstTexture,
- GrDstSampleType dstSampleType) const {
+ bool usesInputAttachmentForDstRead) const {
uint32_t key = this->willReadDstColor() ? 0x1 : 0x0;
if (key) {
if (originIfDstTexture) {
@@ -38,9 +38,7 @@
if (kTopLeft_GrSurfaceOrigin == *originIfDstTexture) {
key |= 0x4;
}
- // We don't just add the whole dstSampleType to the key because sampling a copy or the
- // rt directly produces the same shader code.
- if (dstSampleType == GrDstSampleType::kAsInputAttachment) {
+ if (usesInputAttachmentForDstRead) {
key |= 0x8;
}
}