Skip to content

Commit

Permalink
Remove "setData" operations from GrMtlPipelineState::setTextures
Browse files Browse the repository at this point in the history
Change-Id: Iaba354865599097d562b29c2ba5e7da8112b22a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272724
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
  • Loading branch information
csmartdalton86 authored and Skia Commit-Bot committed Feb 24, 2020
1 parent 108a494 commit 7d25230
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/gpu/mtl/GrMtlPipelineState.mm
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,20 @@
GrFragmentProcessor::PipelineCoordTransformRange transformRange(programInfo.pipeline());
fGeometryProcessor->setData(fDataManager, programInfo.primProc(), transformRange);

GrFragmentProcessor::CIter fpIter(programInfo.pipeline());
GrGLSLFragmentProcessor::Iter glslIter(fFragmentProcessors.get(), fFragmentProcessorCnt);
for (; fpIter && glslIter; ++fpIter, ++glslIter) {
glslIter->setData(fDataManager, *fpIter);
}
SkASSERT(!fpIter && !glslIter);

{
SkIPoint offset;
GrTexture* dstTexture = programInfo.pipeline().peekDstTexture(&offset);
fXferProcessor->setData(fDataManager, programInfo.pipeline().getXferProcessor(), dstTexture,
offset);
}

if (!programInfo.hasDynamicPrimProcTextures()) {
auto proxies = programInfo.hasFixedPrimProcTextures() ? programInfo.fixedPrimProcTextures()
: nullptr;
Expand Down Expand Up @@ -90,23 +104,12 @@
}

GrFragmentProcessor::CIter fpIter(programInfo.pipeline());
GrGLSLFragmentProcessor::Iter glslIter(fFragmentProcessors.get(), fFragmentProcessorCnt);
for (; fpIter && glslIter; ++fpIter, ++glslIter) {
glslIter->setData(fDataManager, *fpIter);
for (; fpIter; ++fpIter) {
for (int i = 0; i < fpIter->numTextureSamplers(); ++i) {
const auto& sampler = fpIter->textureSampler(i);
fSamplerBindings.emplace_back(sampler.samplerState(), sampler.peekTexture(), fGpu);
}
}
SkASSERT(!fpIter && !glslIter);

{
SkIPoint offset;
GrTexture* dstTexture = programInfo.pipeline().peekDstTexture(&offset);

fXferProcessor->setData(fDataManager, programInfo.pipeline().getXferProcessor(),
dstTexture, offset);
}

if (GrTextureProxy* dstTextureProxy = programInfo.pipeline().dstProxyView().asTextureProxy()) {
fSamplerBindings.emplace_back(
Expand Down

0 comments on commit 7d25230

Please sign in to comment.