Commit 5fd1cfaa by Alexis Hetu Committed by Alexis Hétu

Pitch fix for IO surfaces

On MacOS, a Surface constructor receiving the 'pitchPprovided' parameter wasn't using it for the surface's external pitch, which was causing an error when using the Image::getPitch() function, which returns getExternalPitchB(). Image::getPitch() is used within Image::loadImageData(), which is used by gl functions like glTexImage2D() and glTexSubImage2D(). Both the internal and external buffers now use the parameter to solve this issue. Bug b/19979104 Change-Id: I9762ed53b535ae9eb052f57ee1ceed8ee87cb29c Reviewed-on: https://swiftshader-review.googlesource.com/18828Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 0641aebe
......@@ -1310,8 +1310,8 @@ namespace sw
external.samples = (short)samples;
external.format = format;
external.bytes = bytes(external.format);
external.pitchB = pitchB(external.width, 0, external.format, renderTarget && !texture);
external.pitchP = pitchP(external.width, 0, external.format, renderTarget && !texture);
external.pitchB = !pitchPprovided ? pitchB(external.width, 0, external.format, renderTarget && !texture) : pitchPprovided * external.bytes;
external.pitchP = !pitchPprovided ? pitchP(external.width, 0, external.format, renderTarget && !texture) : pitchPprovided;
external.sliceB = sliceB(external.width, external.height, 0, external.format, renderTarget && !texture);
external.sliceP = sliceP(external.width, external.height, 0, external.format, renderTarget && !texture);
external.border = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment