Integer types support in Blitter The blitter now supports integer types. This means: - It supports conversions to/from integer types from/to other already supported types. - It supports integer to integer conversions without going to an intermediate float format. Also added a Blitter::GetScale() function to avoid having 2 instances of the same switch statement in the code and added the read/write utility functions. The final Blitter code is not longer peppered with switch statements and is, hopefully, easier to read that way. Change-Id: I80de519aaaa768f8cedd98f97dc4414dda75bf54 Reviewed-on: https://swiftshader-review.googlesource.com/4113 Tested-by: Alexis Hétu <sugoi@google.com> Reviewed-by: Nicolas Capens <capn@google.com>
diff --git a/src/D3D9/Direct3DVolumeTexture9.cpp b/src/D3D9/Direct3DVolumeTexture9.cpp index 5372a2e..5633cc1 100644 --- a/src/D3D9/Direct3DVolumeTexture9.cpp +++ b/src/D3D9/Direct3DVolumeTexture9.cpp
@@ -216,18 +216,7 @@ for(int i = 0; i < dWidth; i++) { - sw::Color<float> color; - - if(filter <= D3DTEXF_POINT) - { - color = source->readInternal((int)x, (int)y, (int)z); - } - else // filter >= D3DTEXF_LINEAR - { - color = source->sampleInternal(x, y, z); - } - - dest->writeInternal(i, j, k, color); + dest->copyInternal(source, i, j, k, x, y, z, filter > D3DTEXF_POINT); x += w; }