Switch from querying swizzle on caps to using swizzles stored on proxies.
Change-Id: I03f4a3affd6dda7a83bee8eec768dcaa93a6b801
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220534
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index 7583ce0..e96ffa3 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -101,6 +101,7 @@
fXferProcessor->setData(fProgramDataManager, xp, dstTexture, offset);
if (dstTexture) {
fGpu->bindTexture(nextTexSamplerIdx++, GrSamplerState::ClampNearest(),
+ pipeline.dstTextureProxy()->textureSwizzle(),
static_cast<GrGLTexture*>(dstTexture));
}
SkASSERT(nextTexSamplerIdx == fNumTextureSamplers);
@@ -110,7 +111,8 @@
const GrTextureProxy* const proxies[]) {
for (int i = 0; i < primProc.numTextureSamplers(); ++i) {
auto* tex = static_cast<GrGLTexture*>(proxies[i]->peekTexture());
- fGpu->bindTexture(i, primProc.textureSampler(i).samplerState(), tex);
+ fGpu->bindTexture(i, primProc.textureSampler(i).samplerState(),
+ primProc.textureSampler(i).swizzle(), tex);
}
}
@@ -123,7 +125,7 @@
glslFP->setData(fProgramDataManager, *fp);
for (int i = 0; i < fp->numTextureSamplers(); ++i) {
const GrFragmentProcessor::TextureSampler& sampler = fp->textureSampler(i);
- fGpu->bindTexture((*nextTexSamplerIdx)++, sampler.samplerState(),
+ fGpu->bindTexture((*nextTexSamplerIdx)++, sampler.samplerState(), sampler.swizzle(),
static_cast<GrGLTexture*>(sampler.peekTexture()));
}
fp = iter.next();