diff options
author | Greg Daniel <egdaniel@google.com> | 2017-05-05 10:28:42 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-05 15:04:13 +0000 |
commit | bc5d4d769098a4fb46685c0e59034dc8e12318a2 (patch) | |
tree | 1a3ff07875fb27d058f3d2369b30b9b62f7d6324 /src/gpu/glsl/GrGLSLProgramBuilder.h | |
parent | 288d041c64322fafc77cfaf23907180ebad933a1 (diff) |
Split tracking of TexelBuffers from normal samplers
This is precursor CL to add support for texel buffers in Vulkan.
This change as includes fixes to the ordering of assigning
locations and texture units so that they match in
GrGLProgramDataManager and GrGLProgram.
Bug: skia:
Change-Id: I30c9578fb7dcb187256f744e07651e8564f93a6b
Reviewed-on: https://skia-review.googlesource.com/15225
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/glsl/GrGLSLProgramBuilder.h')
-rw-r--r-- | src/gpu/glsl/GrGLSLProgramBuilder.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.h b/src/gpu/glsl/GrGLSLProgramBuilder.h index 147eb98c98..f12ba5e925 100644 --- a/src/gpu/glsl/GrGLSLProgramBuilder.h +++ b/src/gpu/glsl/GrGLSLProgramBuilder.h @@ -31,6 +31,7 @@ class GrGLSLProgramBuilder { public: using UniformHandle = GrGLSLUniformHandler::UniformHandle; using SamplerHandle = GrGLSLUniformHandler::SamplerHandle; + using TexelBufferHandle = GrGLSLUniformHandler::TexelBufferHandle; using ImageStorageHandle = GrGLSLUniformHandler::ImageStorageHandle; virtual ~GrGLSLProgramBuilder() {} @@ -53,6 +54,10 @@ public: return this->uniformHandler()->samplerSwizzle(handle); } + const GrShaderVar& texelBufferVariable(TexelBufferHandle handle) const { + return this->uniformHandler()->texelBufferVariable(handle); + } + const GrShaderVar& imageStorageVariable(ImageStorageHandle handle) const { return this->uniformHandler()->imageStorageVariable(handle); } @@ -155,13 +160,15 @@ private: void emitAndInstallXferProc(const GrGLSLExpr4& colorIn, const GrGLSLExpr4& coverageIn); void emitSamplersAndImageStorages(const GrResourceIOProcessor& processor, SkTArray<SamplerHandle>* outTexSamplerHandles, - SkTArray<SamplerHandle>* outBufferSamplerHandles, + SkTArray<TexelBufferHandle>* outTexelBufferHandles, SkTArray<ImageStorageHandle>* outImageStorageHandles); SamplerHandle emitSampler(GrSLType samplerType, GrPixelConfig, const char* name, GrShaderFlags visibility); + TexelBufferHandle emitTexelBuffer(GrPixelConfig, const char* name, GrShaderFlags visibility); ImageStorageHandle emitImageStorage(const GrResourceIOProcessor::ImageStorageAccess&, const char* name); void emitFSOutputSwizzle(bool hasSecondaryOutput); + void updateSamplerCounts(GrShaderFlags visibility); bool checkSamplerCounts(); bool checkImageStorageCounts(); @@ -171,6 +178,8 @@ private: void verify(const GrFragmentProcessor&); #endif + // These are used to check that we don't excede the allowable number of resources in a shader. + // The sampler counts include both normal texure samplers as well as texel buffers. int fNumVertexSamplers; int fNumGeometrySamplers; int fNumFragmentSamplers; |