diff options
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/GrTextureAccess.cpp | 13 | ||||
-rw-r--r-- | src/gpu/gl/GrGLUniformHandler.cpp | 2 | ||||
-rw-r--r-- | src/gpu/glsl/GrGLSLProgramBuilder.cpp | 2 | ||||
-rw-r--r-- | src/gpu/glsl/GrGLSLShaderVar.h | 12 |
4 files changed, 17 insertions, 12 deletions
diff --git a/src/gpu/GrTextureAccess.cpp b/src/gpu/GrTextureAccess.cpp index 675bc20777..a62a4ddce0 100644 --- a/src/gpu/GrTextureAccess.cpp +++ b/src/gpu/GrTextureAccess.cpp @@ -18,25 +18,30 @@ GrTextureAccess::GrTextureAccess(GrTexture* texture, const GrTextureParams& para GrTextureAccess::GrTextureAccess(GrTexture* texture, GrTextureParams::FilterMode filterMode, SkShader::TileMode tileXAndY, - GrShaderFlags visibility) { - this->reset(texture, filterMode, tileXAndY, visibility); + GrShaderFlags visibility, + GrSLPrecision precision) { + this->reset(texture, filterMode, tileXAndY, visibility, precision); } void GrTextureAccess::reset(GrTexture* texture, const GrTextureParams& params, - GrShaderFlags visibility) { + GrShaderFlags visibility, + GrSLPrecision precision) { SkASSERT(texture); fTexture.set(SkRef(texture), kRead_GrIOType); fParams = params; fVisibility = visibility; + fPrecision = precision; } void GrTextureAccess::reset(GrTexture* texture, GrTextureParams::FilterMode filterMode, SkShader::TileMode tileXAndY, - GrShaderFlags visibility) { + GrShaderFlags visibility, + GrSLPrecision precision) { SkASSERT(texture); fTexture.set(SkRef(texture), kRead_GrIOType); fParams.reset(tileXAndY, filterMode); fVisibility = visibility; + fPrecision = precision; } diff --git a/src/gpu/gl/GrGLUniformHandler.cpp b/src/gpu/gl/GrGLUniformHandler.cpp index 856afb4b9a..7f6f106964 100644 --- a/src/gpu/gl/GrGLUniformHandler.cpp +++ b/src/gpu/gl/GrGLUniformHandler.cpp @@ -26,7 +26,7 @@ GrGLSLUniformHandler::UniformHandle GrGLUniformHandler::internalAddUniformArray( SkDEBUGCODE(static const uint32_t kVisMask = kVertex_GrShaderFlag | kFragment_GrShaderFlag); SkASSERT(0 == (~kVisMask & visibility)); SkASSERT(0 != visibility); - SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsNumeric(type)); + SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeAcceptsPrecision(type)); UniformInfo& uni = fUniforms.push_back(); uni.fVariable.setType(type); diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.cpp b/src/gpu/glsl/GrGLSLProgramBuilder.cpp index bc0208321c..7116d193f4 100644 --- a/src/gpu/glsl/GrGLSLProgramBuilder.cpp +++ b/src/gpu/glsl/GrGLSLProgramBuilder.cpp @@ -240,7 +240,7 @@ void GrGLSLProgramBuilder::emitSamplers(const GrProcessor& processor, name.printf("Sampler%d", t); localSamplerUniforms[t] = this->uniformHandler()->addUniform(access.getVisibility(), samplerType, - kDefault_GrSLPrecision, + access.getPrecision(), name.c_str()); outSamplers->emplace_back(localSamplerUniforms[t], access); } diff --git a/src/gpu/glsl/GrGLSLShaderVar.h b/src/gpu/glsl/GrGLSLShaderVar.h index bdd36f3763..a7d7479d39 100644 --- a/src/gpu/glsl/GrGLSLShaderVar.h +++ b/src/gpu/glsl/GrGLSLShaderVar.h @@ -76,7 +76,7 @@ public: const char* extraModifiers = nullptr, bool useUniformFloatArrays = USE_UNIFORM_FLOAT_ARRAYS) { SkASSERT(kVoid_GrSLType != type); - SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsNumeric(type)); + SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeAcceptsPrecision(type)); INHERITED::set(type, name, typeModifier, precision); fLayoutQualifier = layoutQualifier; if (extraModifiers) { @@ -96,7 +96,7 @@ public: const char* extraModifiers = nullptr, bool useUniformFloatArrays = USE_UNIFORM_FLOAT_ARRAYS) { SkASSERT(kVoid_GrSLType != type); - SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsNumeric(type)); + SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeAcceptsPrecision(type)); INHERITED::set(type, name, typeModifier, precision); fLayoutQualifier = layoutQualifier; if (extraModifiers) { @@ -117,7 +117,7 @@ public: const char* extraModifiers = nullptr, bool useUniformFloatArrays = USE_UNIFORM_FLOAT_ARRAYS) { SkASSERT(kVoid_GrSLType != type); - SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsNumeric(type)); + SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeAcceptsPrecision(type)); INHERITED::set(type, name, typeModifier, precision, count); fLayoutQualifier = layoutQualifier; if (extraModifiers) { @@ -138,7 +138,7 @@ public: const char* extraModifiers = nullptr, bool useUniformFloatArrays = USE_UNIFORM_FLOAT_ARRAYS) { SkASSERT(kVoid_GrSLType != type); - SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsNumeric(type)); + SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeAcceptsPrecision(type)); INHERITED::set(type, name, typeModifier, precision, count); fLayoutQualifier = layoutQualifier; if (extraModifiers) { @@ -164,7 +164,7 @@ public: * Write a declaration of this variable to out. */ void appendDecl(const GrGLSLCaps* glslCaps, SkString* out) const { - SkASSERT(kDefault_GrSLPrecision == fPrecision || GrSLTypeIsNumeric(fType)); + SkASSERT(kDefault_GrSLPrecision == fPrecision || GrSLTypeAcceptsPrecision(fType)); if (!fLayoutQualifier.isEmpty()) { out->appendf("layout(%s) ", fLayoutQualifier.c_str()); } @@ -174,7 +174,7 @@ public: out->append(" "); } GrSLType effectiveType = this->getType(); - if (effectiveType != kBool_GrSLType) { + if (GrSLTypeAcceptsPrecision(effectiveType)) { out->append(PrecisionString(glslCaps, fPrecision)); } if (this->isArray()) { |