Adding Tom who wrote this code. I know that some shader compilers are pretty light ...
12 years, 5 months ago
(2012-06-13 12:37:39 UTC)
#2
Adding Tom who wrote this code. I know that some shader compilers are pretty
light on optimizations, especially on mobile platforms. So I'm not opposed to
the change but I'm curious to know if you observed a speedup anywhere with this
change.
https://codereview.appspot.com/6302070/diff/1/src/gpu/effects/GrConvolutionEf...
File src/gpu/effects/GrConvolutionEffect.cpp (right):
https://codereview.appspot.com/6302070/diff/1/src/gpu/effects/GrConvolutionEf...
src/gpu/effects/GrConvolutionEffect.cpp:105:
code->appendf(state->fModulate.c_str());
I'm not sure I get this line. Don't we need something like:
if (state->fModulate.length()) {
code->appendf("\t\t%s = %s%s\n", outputColor, outputColor,
state->fModulate.c_str());
}
Maybe I'm not correctly remembering the interpretation of state->fModulate.
}
https://codereview.appspot.com/6302070/diff/1/src/gpu/effects/GrConvolutionEffect.cpp File src/gpu/effects/GrConvolutionEffect.cpp (right): https://codereview.appspot.com/6302070/diff/1/src/gpu/effects/GrConvolutionEffect.cpp#newcode105 src/gpu/effects/GrConvolutionEffect.cpp:105: code->appendf(state->fModulate.c_str()); Brian's right; the patch as submitted fails out/Debug/tests ...
12 years, 5 months ago
(2012-06-13 12:52:43 UTC)
#3
https://codereview.appspot.com/6302070/diff/1/src/gpu/effects/GrConvolutionEf...
File src/gpu/effects/GrConvolutionEffect.cpp (right):
https://codereview.appspot.com/6302070/diff/1/src/gpu/effects/GrConvolutionEf...
src/gpu/effects/GrConvolutionEffect.cpp:105:
code->appendf(state->fModulate.c_str());
Brian's right; the patch as submitted fails
out/Debug/tests --match GLPrograms
Using Brian's snippet (but with fModulate.size(), not length()) passes tests,
gm, and bench.
With those changes LGTM, but I agree with Brian that it'd be nice to know that
we're getting speedup somewhere before taking this patch. Given the failure of
unit tests, were you able to run this at all before submitting it?
Issue 6302070: Removing unnecessary temporary variable(sum) in fragmentshader
Created 12 years, 5 months ago by kondapallykalyan
Modified 12 years, 5 months ago
Reviewers: bsalomon, TomH
Base URL: http://skia.googlecode.com/svn/trunk/
Comments: 2