Revert "Remove ability to sample textures in vertex or geometry shaders."
This reverts commit d50d6579d1c00de65b947c0531fa04c043729e49.
Reason for revert: chromes test gles test context is broken. Need to fix that then reland this
Original change's description:
> Remove ability to sample textures in vertex or geometry shaders.
>
> Bug: skia:
> Change-Id: I69cd07a4bbe4879e855fb4aa6289a049adf4e059
> Reviewed-on: https://skia-review.googlesource.com/c/160021
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,csmartdalton@google.com
Change-Id: I309dfa5f7118cb8d7280aaf6a88e1df232bd7099
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/160163
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/gl/GrGLUniformHandler.cpp b/src/gpu/gl/GrGLUniformHandler.cpp
index 7551e9a..0d57a14 100644
--- a/src/gpu/gl/GrGLUniformHandler.cpp
+++ b/src/gpu/gl/GrGLUniformHandler.cpp
@@ -61,11 +61,13 @@
return GrGLSLUniformHandler::UniformHandle(fUniforms.count() - 1);
}
-GrGLSLUniformHandler::SamplerHandle GrGLUniformHandler::addSampler(GrSwizzle swizzle,
+GrGLSLUniformHandler::SamplerHandle GrGLUniformHandler::addSampler(uint32_t visibility,
+ GrSwizzle swizzle,
GrTextureType type,
GrSLPrecision precision,
const char* name) {
SkASSERT(name && strlen(name));
+ SkASSERT(0 != visibility);
SkString mangleName;
char prefix = 'u';
@@ -77,7 +79,7 @@
sampler.fVariable.setPrecision(precision);
sampler.fVariable.setName(mangleName);
sampler.fLocation = -1;
- sampler.fVisibility = kFragment_GrShaderFlag;
+ sampler.fVisibility = visibility;
fSamplerSwizzles.push_back(swizzle);
SkASSERT(fSamplers.count() == fSamplerSwizzles.count());
return GrGLSLUniformHandler::SamplerHandle(fSamplers.count() - 1);