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

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

Issue 2143143002: Add Texture2D and Sampler GrSLTypes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nits Created 4 years, 5 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/gl/GrGLTexture.cpp ('k') | src/gpu/glsl/GrGLSLProgramBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/glsl/GrGLSL.h
diff --git a/src/gpu/glsl/GrGLSL.h b/src/gpu/glsl/GrGLSL.h
index 844b7c76db9ba65eb067ac487f96a4968a65f419..e4e165b284b0052cce552f4db2a87a952dff0ca2 100644
--- a/src/gpu/glsl/GrGLSL.h
+++ b/src/gpu/glsl/GrGLSL.h
@@ -58,7 +58,7 @@ bool GrGLSLSupportsNamedFragmentShaderOutputs(GrGLSLGeneration);
*/
inline const char* GrGLSLTexture2DFunctionName(GrSLType coordType, GrSLType samplerType,
GrGLSLGeneration glslGen) {
- SkASSERT(GrSLTypeIs2DTextureType(samplerType));
+ SkASSERT(GrSLTypeIs2DCombinedSamplerType(samplerType));
SkASSERT(kVec2f_GrSLType == coordType || kVec3f_GrSLType == coordType);
// GL_TEXTURE_RECTANGLE_ARB is written against OpenGL 2.0/GLSL 1.10. At that time there were
// separate texture*() functions. In OpenGL 3.0/GLSL 1.30 the different texture*() functions
@@ -70,9 +70,10 @@ inline const char* GrGLSLTexture2DFunctionName(GrSLType coordType, GrSLType samp
return (kVec2f_GrSLType == coordType) ? "texture" : "textureProj";
}
if (kVec2f_GrSLType == coordType) {
- return (samplerType == kSampler2DRect_GrSLType) ? "texture2DRect" : "texture2D";
+ return (samplerType == kTexture2DRectSampler_GrSLType) ? "texture2DRect" : "texture2D";
} else {
- return (samplerType == kSampler2DRect_GrSLType) ? "texture2DRectProj" : "texture2DProj";
+ return (samplerType == kTexture2DRectSampler_GrSLType) ? "texture2DRectProj"
+ : "texture2DProj";
}
}
@@ -121,13 +122,13 @@ static inline const char* GrGLSLTypeString(GrSLType t) {
return "mat3";
case kMat44f_GrSLType:
return "mat4";
- case kSampler2D_GrSLType:
+ case kTexture2DSampler_GrSLType:
return "sampler2D";
- case kSamplerExternal_GrSLType:
+ case kTextureExternalSampler_GrSLType:
return "samplerExternalOES";
- case kSampler2DRect_GrSLType:
+ case kTexture2DRectSampler_GrSLType:
return "sampler2DRect";
- case kSamplerBuffer_GrSLType:
+ case kTextureBufferSampler_GrSLType:
return "samplerBuffer";
case kBool_GrSLType:
return "bool";
@@ -135,6 +136,10 @@ static inline const char* GrGLSLTypeString(GrSLType t) {
return "int";
case kUint_GrSLType:
return "uint";
+ case kTexture2D_GrSLType:
+ return "texture2D";
+ case kSampler_GrSLType:
+ return "sampler";
default:
SkFAIL("Unknown shader var type.");
return ""; // suppress warning
« no previous file with comments | « src/gpu/gl/GrGLTexture.cpp ('k') | src/gpu/glsl/GrGLSLProgramBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698