Only use GrRenderTarget for sample locations in GrGLSLProgramBuilder
The idea here is to separate information we can have at opList time:
numSamples, origin, primProc, primProcProxies and pipeline
and what we can only have at flush time:
sample locations
The opList-available parameters will then be moved into a descriptor (GrProgramInfo).
Change-Id: Iae044a98a0cfc8685569c923d154a6f9dabfeb75
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245621
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.h b/src/gpu/glsl/GrGLSLProgramBuilder.h
index 9f5e3a3..dec6d11 100644
--- a/src/gpu/glsl/GrGLSLProgramBuilder.h
+++ b/src/gpu/glsl/GrGLSLProgramBuilder.h
@@ -38,12 +38,14 @@
const GrPrimitiveProcessor& primitiveProcessor() const { return fPrimProc; }
const GrTextureProxy* const* primProcProxies() const { return fPrimProcProxies; }
- const GrRenderTarget* renderTarget() const { return fRenderTarget; }
- GrPixelConfig config() const { return fRenderTarget->config(); }
int effectiveSampleCnt() const {
SkASSERT(GrProcessor::CustomFeatures::kSampleLocations & header().processorFeatures());
return fRenderTarget->renderTargetPriv().getSampleLocations().count();
}
+ const SkTArray<SkPoint>& getSampleLocations() const {
+ return fRenderTarget->renderTargetPriv().getSampleLocations();
+ }
+ int numSamples() const { return fNumSamples; }
GrSurfaceOrigin origin() const { return fOrigin; }
const GrPipeline& pipeline() const { return fPipeline; }
GrProgramDesc* desc() { return fDesc; }
@@ -94,6 +96,7 @@
int fStageIndex;
const GrRenderTarget* fRenderTarget;
+ const int fNumSamples;
const GrSurfaceOrigin fOrigin;
const GrPipeline& fPipeline;
const GrPrimitiveProcessor& fPrimProc;
@@ -109,7 +112,9 @@
int fFragmentProcessorCnt;
protected:
- explicit GrGLSLProgramBuilder(GrRenderTarget* renderTarget, GrSurfaceOrigin origin,
+ explicit GrGLSLProgramBuilder(GrRenderTarget* renderTarget,
+ int numSamples,
+ GrSurfaceOrigin origin,
const GrPrimitiveProcessor&,
const GrTextureProxy* const primProcProxies[],
const GrPipeline&,