Commit b8c63935 by Nicolas Capens Committed by Nicolas Capens

Use C++11 std::swap()

Bug b/126126820 Change-Id: Iaf3991d58c64995018ba0d15773b65d463e03fad Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27549Reviewed-by: 's avatarBen Clayton <bclayton@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 289a576d
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#include "Vulkan/VkDebug.hpp" #include "Vulkan/VkDebug.hpp"
#include "Vulkan/VkImage.hpp" #include "Vulkan/VkImage.hpp"
#include <utility>
namespace sw namespace sw
{ {
Blitter::Blitter() Blitter::Blitter()
...@@ -1523,14 +1525,14 @@ namespace sw ...@@ -1523,14 +1525,14 @@ namespace sw
if(region.dstOffsets[0].x > region.dstOffsets[1].x) if(region.dstOffsets[0].x > region.dstOffsets[1].x)
{ {
swap(region.srcOffsets[0].x, region.srcOffsets[1].x); std::swap(region.srcOffsets[0].x, region.srcOffsets[1].x);
swap(region.dstOffsets[0].x, region.dstOffsets[1].x); std::swap(region.dstOffsets[0].x, region.dstOffsets[1].x);
} }
if(region.dstOffsets[0].y > region.dstOffsets[1].y) if(region.dstOffsets[0].y > region.dstOffsets[1].y)
{ {
swap(region.srcOffsets[0].y, region.srcOffsets[1].y); std::swap(region.srcOffsets[0].y, region.srcOffsets[1].y);
swap(region.dstOffsets[0].y, region.dstOffsets[1].y); std::swap(region.dstOffsets[0].y, region.dstOffsets[1].y);
} }
VkExtent3D srcExtent = src->getMipLevelExtent(region.srcSubresource.mipLevel); VkExtent3D srcExtent = src->getMipLevelExtent(region.srcSubresource.mipLevel);
......
...@@ -66,14 +66,6 @@ namespace sw ...@@ -66,14 +66,6 @@ namespace sw
return min(min(a, b), min(c, d)); return min(min(a, b), min(c, d));
} }
template<class T>
inline void swap(T &a, T &b)
{
T t = a;
a = b;
b = t;
}
template <typename destType, typename sourceType> template <typename destType, typename sourceType>
destType bit_cast(const sourceType &source) destType bit_cast(const sourceType &source)
{ {
......
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