aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/glsl/GrGLSLProgramBuilder.h
diff options
context:
space:
mode:
authorGravatar cdalton <cdalton@nvidia.com>2016-03-11 10:07:37 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-11 10:07:37 -0800
commit9c3f14327a38e79ab7d0cf30dfd9bf89676fde06 (patch)
treef4695cc85cf19bf471ed8c956083f2234f18d4e1 /src/gpu/glsl/GrGLSLProgramBuilder.h
parent6b563156eb7ce05b51997695ec9ab2aedcc2e6b1 (diff)
Add support for vertex and geometry shader textures
Adds a visibility bitfield to GrTextureAccess that controls in which shaders the texture should be accessible. Also adds caps and validation to ensure we don't exceed texture limits. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1782583002 Review URL: https://codereview.chromium.org/1782583002
Diffstat (limited to 'src/gpu/glsl/GrGLSLProgramBuilder.h')
-rw-r--r--src/gpu/glsl/GrGLSLProgramBuilder.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.h b/src/gpu/glsl/GrGLSLProgramBuilder.h
index b8669bf2f6..83c004da98 100644
--- a/src/gpu/glsl/GrGLSLProgramBuilder.h
+++ b/src/gpu/glsl/GrGLSLProgramBuilder.h
@@ -93,12 +93,16 @@ public:
protected:
explicit GrGLSLProgramBuilder(const DrawArgs& args);
- bool emitAndInstallProcs(GrGLSLExpr4* inputColor, GrGLSLExpr4* inputCoverage, int maxTextures);
+ void addFeature(GrShaderFlags shaders, uint32_t featureBit, const char* extensionName);
+
+ bool emitAndInstallProcs(GrGLSLExpr4* inputColor, GrGLSLExpr4* inputCoverage);
void cleanupFragmentProcessors();
void finalizeShaders();
+ SkTArray<UniformHandle> fSamplerUniforms;
+
private:
// reset is called by program creator between each processor's emit code. It increments the
// stage offset for variable name mangling, and also ensures verfication variables in the
@@ -139,7 +143,10 @@ private:
const GrGLSLExpr4& coverageIn,
bool ignoresCoverage,
GrPixelLocalStorageState plsState);
+ void emitSamplers(const GrProcessor& processor,
+ GrGLSLTextureSampler::TextureSamplerArray* outSamplers);
void emitFSOutputSwizzle(bool hasSecondaryOutput);
+ bool checkSamplerCounts();
#ifdef SK_DEBUG
void verify(const GrPrimitiveProcessor&);
@@ -147,11 +154,11 @@ private:
void verify(const GrFragmentProcessor&);
#endif
- virtual void emitSamplers(const GrProcessor& processor,
- GrGLSLTextureSampler::TextureSamplerArray* outSamplers) = 0;
-
- GrGLSLPrimitiveProcessor::TransformsIn fCoordTransforms;
- GrGLSLPrimitiveProcessor::TransformsOut fOutCoords;
+ GrGLSLPrimitiveProcessor::TransformsIn fCoordTransforms;
+ GrGLSLPrimitiveProcessor::TransformsOut fOutCoords;
+ int fNumVertexSamplers;
+ int fNumGeometrySamplers;
+ int fNumFragmentSamplers;
};
#endif