Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: src/gpu/glsl/GrGLSLShaderVar.h

Issue 1784023002: Add sampler precision to GrTextureAccess (Closed) Base URL: https://skia.googlesource.com/skia.git@upload2_verttex
Patch Set: rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/glsl/GrGLSLProgramBuilder.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/glsl/GrGLSLShaderVar.h
diff --git a/src/gpu/glsl/GrGLSLShaderVar.h b/src/gpu/glsl/GrGLSLShaderVar.h
index bdd36f3763fa4c9e3c33ba158c50d94337526435..a7d7479d3908c5d3dfdb2703972af12366a389da 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()) {
« no previous file with comments | « src/gpu/glsl/GrGLSLProgramBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698