aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/glsl
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/glsl')
-rw-r--r--src/gpu/glsl/GrGLSL.cpp4
-rw-r--r--src/gpu/glsl/GrGLSLFragmentProcessor.cpp2
-rw-r--r--src/gpu/glsl/GrGLSLFragmentProcessor.h4
-rw-r--r--src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp38
-rw-r--r--src/gpu/glsl/GrGLSLPrimitiveProcessor.h4
-rw-r--r--src/gpu/glsl/GrGLSLProgramBuilder.cpp20
-rw-r--r--src/gpu/glsl/GrGLSLXferProcessor.cpp2
-rw-r--r--src/gpu/glsl/GrGLSLXferProcessor.h4
8 files changed, 39 insertions, 39 deletions
diff --git a/src/gpu/glsl/GrGLSL.cpp b/src/gpu/glsl/GrGLSL.cpp
index 2f69a3c5a2..d54ddee0d6 100644
--- a/src/gpu/glsl/GrGLSL.cpp
+++ b/src/gpu/glsl/GrGLSL.cpp
@@ -27,9 +27,9 @@ bool GrGLSLSupportsNamedFragmentShaderOutputs(GrGLSLGeneration gen) {
}
void GrGLSLAppendDefaultFloatPrecisionDeclaration(GrSLPrecision p,
- const GrShaderCaps& glslCaps,
+ const GrShaderCaps& shaderCaps,
SkString* out) {
- if (glslCaps.usesPrecisionModifiers()) {
+ if (shaderCaps.usesPrecisionModifiers()) {
switch (p) {
case kHigh_GrSLPrecision:
out->append("precision highp float;\n");
diff --git a/src/gpu/glsl/GrGLSLFragmentProcessor.cpp b/src/gpu/glsl/GrGLSLFragmentProcessor.cpp
index 8c32482d8e..a779accab2 100644
--- a/src/gpu/glsl/GrGLSLFragmentProcessor.cpp
+++ b/src/gpu/glsl/GrGLSLFragmentProcessor.cpp
@@ -52,7 +52,7 @@ void GrGLSLFragmentProcessor::internalEmitChild(int childIndex, const char* inpu
ImageStorages imageStorages = args.fImageStorages.childInputs(childIndex);
EmitArgs childArgs(fragBuilder,
args.fUniformHandler,
- args.fGLSLCaps,
+ args.fShaderCaps,
childProc,
outputColor,
inputColor,
diff --git a/src/gpu/glsl/GrGLSLFragmentProcessor.h b/src/gpu/glsl/GrGLSLFragmentProcessor.h
index c9230e4c92..7a8d51ca83 100644
--- a/src/gpu/glsl/GrGLSLFragmentProcessor.h
+++ b/src/gpu/glsl/GrGLSLFragmentProcessor.h
@@ -122,7 +122,7 @@ public:
bool gpImplementsDistanceVector)
: fFragBuilder(fragBuilder)
, fUniformHandler(uniformHandler)
- , fGLSLCaps(caps)
+ , fShaderCaps(caps)
, fFp(fp)
, fOutputColor(outputColor)
, fInputColor(inputColor)
@@ -133,7 +133,7 @@ public:
, fGpImplementsDistanceVector(gpImplementsDistanceVector) {}
GrGLSLFPFragmentBuilder* fFragBuilder;
GrGLSLUniformHandler* fUniformHandler;
- const GrShaderCaps* fGLSLCaps;
+ const GrShaderCaps* fShaderCaps;
const GrFragmentProcessor& fFp;
const char* fOutputColor;
const char* fInputColor;
diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
index 3d9802a720..8355f1de7d 100644
--- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
@@ -94,20 +94,20 @@ GrGLSLFragmentShaderBuilder::GrGLSLFragmentShaderBuilder(GrGLSLProgramBuilder* p
}
bool GrGLSLFragmentShaderBuilder::enableFeature(GLSLFeature feature) {
- const GrShaderCaps& glslCaps = *fProgramBuilder->shaderCaps();
+ const GrShaderCaps& shaderCaps = *fProgramBuilder->shaderCaps();
switch (feature) {
case kPixelLocalStorage_GLSLFeature:
- if (glslCaps.pixelLocalStorageSize() <= 0) {
+ if (shaderCaps.pixelLocalStorageSize() <= 0) {
return false;
}
this->addFeature(1 << kPixelLocalStorage_GLSLFeature,
"GL_EXT_shader_pixel_local_storage");
return true;
case kMultisampleInterpolation_GLSLFeature:
- if (!glslCaps.multisampleInterpolationSupport()) {
+ if (!shaderCaps.multisampleInterpolationSupport()) {
return false;
}
- if (const char* extension = glslCaps.multisampleInterpolationExtensionString()) {
+ if (const char* extension = shaderCaps.multisampleInterpolationExtensionString()) {
this->addFeature(1 << kMultisampleInterpolation_GLSLFeature, extension);
}
return true;
@@ -133,16 +133,16 @@ SkString GrGLSLFragmentShaderBuilder::ensureCoords2D(const GrShaderVar& coords)
const char* GrGLSLFragmentShaderBuilder::fragmentPosition() {
SkDEBUGCODE(fUsedProcessorFeatures |= GrProcessor::kFragmentPosition_RequiredFeature;)
- const GrShaderCaps* glslCaps = fProgramBuilder->shaderCaps();
+ const GrShaderCaps* shaderCaps = fProgramBuilder->shaderCaps();
// We only declare "gl_FragCoord" when we're in the case where we want to use layout qualifiers
// to reverse y. Otherwise it isn't necessary and whether the "in" qualifier appears in the
// declaration varies in earlier GLSL specs. So it is simpler to omit it.
if (kTopLeft_GrSurfaceOrigin == this->getSurfaceOrigin()) {
fSetupFragPosition = true;
return "gl_FragCoord";
- } else if (const char* extension = glslCaps->fragCoordConventionsExtensionString()) {
+ } else if (const char* extension = shaderCaps->fragCoordConventionsExtensionString()) {
if (!fSetupFragPosition) {
- if (glslCaps->generation() < k150_GrGLSLGeneration) {
+ if (shaderCaps->generation() < k150_GrGLSLGeneration) {
this->addFeature(1 << kFragCoordConventions_GLSLPrivateFeature,
extension);
}
@@ -193,12 +193,12 @@ void GrGLSLFragmentShaderBuilder::appendOffsetToSample(const char* sampleIdx, Co
}
void GrGLSLFragmentShaderBuilder::maskSampleCoverage(const char* mask, bool invert) {
- const GrShaderCaps& glslCaps = *fProgramBuilder->shaderCaps();
- if (!glslCaps.sampleVariablesSupport()) {
+ const GrShaderCaps& shaderCaps = *fProgramBuilder->shaderCaps();
+ if (!shaderCaps.sampleVariablesSupport()) {
SkDEBUGFAIL("Attempted to mask sample coverage without support.");
return;
}
- if (const char* extension = glslCaps.sampleVariablesExtensionString()) {
+ if (const char* extension = shaderCaps.sampleVariablesExtensionString()) {
this->addFeature(1 << kSampleVariables_GLSLPrivateFeature, extension);
}
if (!fHasInitializedSampleMask) {
@@ -213,13 +213,13 @@ void GrGLSLFragmentShaderBuilder::maskSampleCoverage(const char* mask, bool inve
}
void GrGLSLFragmentShaderBuilder::overrideSampleCoverage(const char* mask) {
- const GrShaderCaps& glslCaps = *fProgramBuilder->shaderCaps();
- if (!glslCaps.sampleMaskOverrideCoverageSupport()) {
+ const GrShaderCaps& shaderCaps = *fProgramBuilder->shaderCaps();
+ if (!shaderCaps.sampleMaskOverrideCoverageSupport()) {
SkDEBUGFAIL("Attempted to override sample coverage without support.");
return;
}
- SkASSERT(glslCaps.sampleVariablesSupport());
- if (const char* extension = glslCaps.sampleVariablesExtensionString()) {
+ SkASSERT(shaderCaps.sampleVariablesSupport());
+ if (const char* extension = shaderCaps.sampleVariablesExtensionString()) {
this->addFeature(1 << kSampleVariables_GLSLPrivateFeature, extension);
}
if (this->addFeature(1 << kSampleMaskOverrideCoverage_GLSLPrivateFeature,
@@ -240,14 +240,14 @@ const char* GrGLSLFragmentShaderBuilder::dstColor() {
return override;
}
- const GrShaderCaps* glslCaps = fProgramBuilder->shaderCaps();
- if (glslCaps->fbFetchSupport()) {
+ const GrShaderCaps* shaderCaps = fProgramBuilder->shaderCaps();
+ if (shaderCaps->fbFetchSupport()) {
this->addFeature(1 << kFramebufferFetch_GLSLPrivateFeature,
- glslCaps->fbFetchExtensionString());
+ shaderCaps->fbFetchExtensionString());
// Some versions of this extension string require declaring custom color output on ES 3.0+
- const char* fbFetchColorName = glslCaps->fbFetchColorName();
- if (glslCaps->fbFetchNeedsCustomOutput()) {
+ const char* fbFetchColorName = shaderCaps->fbFetchColorName();
+ if (shaderCaps->fbFetchNeedsCustomOutput()) {
this->enableCustomOutput();
fOutputs[fCustomColorOutputIndex].setTypeModifier(GrShaderVar::kInOut_TypeModifier);
fbFetchColorName = DeclaredColorOutputName();
diff --git a/src/gpu/glsl/GrGLSLPrimitiveProcessor.h b/src/gpu/glsl/GrGLSLPrimitiveProcessor.h
index 6c3d3a8963..4aae284efe 100644
--- a/src/gpu/glsl/GrGLSLPrimitiveProcessor.h
+++ b/src/gpu/glsl/GrGLSLPrimitiveProcessor.h
@@ -85,7 +85,7 @@ public:
, fFragBuilder(fragBuilder)
, fVaryingHandler(varyingHandler)
, fUniformHandler(uniformHandler)
- , fGLSLCaps(caps)
+ , fShaderCaps(caps)
, fGP(gp)
, fOutputColor(outputColor)
, fOutputCoverage(outputCoverage)
@@ -99,7 +99,7 @@ public:
GrGLSLPPFragmentBuilder* fFragBuilder;
GrGLSLVaryingHandler* fVaryingHandler;
GrGLSLUniformHandler* fUniformHandler;
- const GrShaderCaps* fGLSLCaps;
+ const GrShaderCaps* fShaderCaps;
const GrPrimitiveProcessor& fGP;
const char* fOutputColor;
const char* fOutputCoverage;
diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.cpp b/src/gpu/glsl/GrGLSLProgramBuilder.cpp
index 40e5a43ded..590439d629 100644
--- a/src/gpu/glsl/GrGLSLProgramBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLProgramBuilder.cpp
@@ -364,22 +364,22 @@ void GrGLSLProgramBuilder::emitFSOutputSwizzle(bool hasSecondaryOutput) {
}
bool GrGLSLProgramBuilder::checkSamplerCounts() {
- const GrShaderCaps& glslCaps = *this->shaderCaps();
- if (fNumVertexSamplers > glslCaps.maxVertexSamplers()) {
+ const GrShaderCaps& shaderCaps = *this->shaderCaps();
+ if (fNumVertexSamplers > shaderCaps.maxVertexSamplers()) {
GrCapsDebugf(this->caps(), "Program would use too many vertex samplers\n");
return false;
}
- if (fNumGeometrySamplers > glslCaps.maxGeometrySamplers()) {
+ if (fNumGeometrySamplers > shaderCaps.maxGeometrySamplers()) {
GrCapsDebugf(this->caps(), "Program would use too many geometry samplers\n");
return false;
}
- if (fNumFragmentSamplers > glslCaps.maxFragmentSamplers()) {
+ if (fNumFragmentSamplers > shaderCaps.maxFragmentSamplers()) {
GrCapsDebugf(this->caps(), "Program would use too many fragment samplers\n");
return false;
}
// If the same sampler is used in two different shaders, it counts as two combined samplers.
int numCombinedSamplers = fNumVertexSamplers + fNumGeometrySamplers + fNumFragmentSamplers;
- if (numCombinedSamplers > glslCaps.maxCombinedSamplers()) {
+ if (numCombinedSamplers > shaderCaps.maxCombinedSamplers()) {
GrCapsDebugf(this->caps(), "Program would use too many combined samplers\n");
return false;
}
@@ -387,23 +387,23 @@ bool GrGLSLProgramBuilder::checkSamplerCounts() {
}
bool GrGLSLProgramBuilder::checkImageStorageCounts() {
- const GrShaderCaps& glslCaps = *this->shaderCaps();
- if (fNumVertexImageStorages > glslCaps.maxVertexImageStorages()) {
+ const GrShaderCaps& shaderCaps = *this->shaderCaps();
+ if (fNumVertexImageStorages > shaderCaps.maxVertexImageStorages()) {
GrCapsDebugf(this->caps(), "Program would use too many vertex images\n");
return false;
}
- if (fNumGeometryImageStorages > glslCaps.maxGeometryImageStorages()) {
+ if (fNumGeometryImageStorages > shaderCaps.maxGeometryImageStorages()) {
GrCapsDebugf(this->caps(), "Program would use too many geometry images\n");
return false;
}
- if (fNumFragmentImageStorages > glslCaps.maxFragmentImageStorages()) {
+ if (fNumFragmentImageStorages > shaderCaps.maxFragmentImageStorages()) {
GrCapsDebugf(this->caps(), "Program would use too many fragment images\n");
return false;
}
// If the same image is used in two different shaders, it counts as two combined images.
int numCombinedImages = fNumVertexImageStorages + fNumGeometryImageStorages +
fNumFragmentImageStorages;
- if (numCombinedImages > glslCaps.maxCombinedImageStorages()) {
+ if (numCombinedImages > shaderCaps.maxCombinedImageStorages()) {
GrCapsDebugf(this->caps(), "Program would use too many combined images\n");
return false;
}
diff --git a/src/gpu/glsl/GrGLSLXferProcessor.cpp b/src/gpu/glsl/GrGLSLXferProcessor.cpp
index 0588513040..e2698199fd 100644
--- a/src/gpu/glsl/GrGLSLXferProcessor.cpp
+++ b/src/gpu/glsl/GrGLSLXferProcessor.cpp
@@ -63,7 +63,7 @@ void GrGLSLXferProcessor::emitCode(const EmitArgs& args) {
fragBuilder->appendTextureLookup(args.fTexSamplers[0], "_dstTexCoord", kVec2f_GrSLType);
fragBuilder->codeAppend(";");
} else {
- needsLocalOutColor = args.fGLSLCaps->requiresLocalOutputColorForFBFetch();
+ needsLocalOutColor = args.fShaderCaps->requiresLocalOutputColorForFBFetch();
}
const char* outColor = "_localColorOut";
diff --git a/src/gpu/glsl/GrGLSLXferProcessor.h b/src/gpu/glsl/GrGLSLXferProcessor.h
index f3a1c688da..90c1bce5b2 100644
--- a/src/gpu/glsl/GrGLSLXferProcessor.h
+++ b/src/gpu/glsl/GrGLSLXferProcessor.h
@@ -39,7 +39,7 @@ public:
const bool usePLSDstRead)
: fXPFragBuilder(fragBuilder)
, fUniformHandler(uniformHandler)
- , fGLSLCaps(caps)
+ , fShaderCaps(caps)
, fXP(xp)
, fInputColor(inputColor)
, fInputCoverage(inputCoverage)
@@ -52,7 +52,7 @@ public:
GrGLSLXPFragmentBuilder* fXPFragBuilder;
GrGLSLUniformHandler* fUniformHandler;
- const GrShaderCaps* fGLSLCaps;
+ const GrShaderCaps* fShaderCaps;
const GrXferProcessor& fXP;
const char* fInputColor;
const char* fInputCoverage;