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

Unified Diff: src/gpu/glsl/GrGLSLShaderBuilder.cpp

Issue 2489673002: added constant folding & branch elimination to skslc (Closed)
Patch Set: textureProj on rectangle textures now working Created 3 years, 8 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/GrGLGpu.cpp ('k') | src/sksl/SkSLIRGenerator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/glsl/GrGLSLShaderBuilder.cpp
diff --git a/src/gpu/glsl/GrGLSLShaderBuilder.cpp b/src/gpu/glsl/GrGLSLShaderBuilder.cpp
index 865876611ab87584b7617776fd5820165b1e6df8..2c7e5e476db017f8cb2324e727b451691d711f38 100644
--- a/src/gpu/glsl/GrGLSLShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLShaderBuilder.cpp
@@ -72,18 +72,7 @@ void GrGLSLShaderBuilder::appendTextureLookup(SkString* out,
const char* coordName,
GrSLType varyingType) const {
const GrShaderVar& sampler = fProgramBuilder->samplerVariable(samplerHandle);
- GrSLType samplerType = sampler.getType();
- if (samplerType == kTexture2DRectSampler_GrSLType) {
- if (varyingType == kVec2f_GrSLType) {
- out->appendf("texture(%s, textureSize(%s) * %s)",
- sampler.c_str(), sampler.c_str(), coordName);
- } else {
- out->appendf("texture(%s, vec3(textureSize(%s) * %s.xy, %s.z))",
- sampler.c_str(), sampler.c_str(), coordName, coordName);
- }
- } else {
- out->appendf("texture(%s, %s)", sampler.c_str(), coordName);
- }
+ out->appendf("texture(%s, %s)", sampler.c_str(), coordName);
append_texture_swizzle(out, fProgramBuilder->samplerSwizzle(samplerHandle));
}
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | src/sksl/SkSLIRGenerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698