diff options
author | Alok Hota <[email protected]> | 2018-06-05 13:59:53 -0500 |
---|---|---|
committer | Tim Rowley <[email protected]> | 2018-06-18 13:57:38 -0500 |
commit | a678f40e467bbf72719c60928de26a91f21ac699 (patch) | |
tree | 1583ecaf97c287ad3976e4bf77b65a9349b291bc /src/gallium/drivers/swr/rasterizer/common | |
parent | d85fef1e34657fc082b9a763de9499d324fbeebf (diff) |
swr/rast: Clang-Format most rasterizer source code
Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/rasterizer/common')
34 files changed, 11867 insertions, 9343 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/common/formats.cpp b/src/gallium/drivers/swr/rasterizer/common/formats.cpp index 1c086ff1882..e0800f5e88e 100644 --- a/src/gallium/drivers/swr/rasterizer/common/formats.cpp +++ b/src/gallium/drivers/swr/rasterizer/common/formats.cpp @@ -1,32 +1,32 @@ /**************************************************************************** -* Copyright (C) 2016 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -* -* @file formats.cpp -* -* @brief auto-generated file -* -* DO NOT EDIT -* -******************************************************************************/ + * Copyright (C) 2016 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * @file formats.cpp + * + * @brief auto-generated file + * + * DO NOT EDIT + * + ******************************************************************************/ #include "formats.h" @@ -72,6842 +72,9227 @@ const SWR_FORMAT_INFO gFormatInfo[] = { // R32G32B32A32_FLOAT (0x0) { "R32G32B32A32_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 32, 32, 32, 32 }, // Bits per component - 128, // Bits per element - 16, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {32, 32, 32, 32}, // Bits per component + 128, // Bits per element + 16, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R32G32B32A32_SINT (0x1) { "R32G32B32A32_SINT", - { SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 32, 32, 32, 32 }, // Bits per component - 128, // Bits per element - 16, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {32, 32, 32, 32}, // Bits per component + 128, // Bits per element + 16, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R32G32B32A32_UINT (0x2) { "R32G32B32A32_UINT", - { SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 32, 32, 32, 32 }, // Bits per component - 128, // Bits per element - 16, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {32, 32, 32, 32}, // Bits per component + 128, // Bits per element + 16, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0x3) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x4) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // R64G64_FLOAT (0x5) { "R64G64_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 0, 0 }, // Swizzle - { 64, 64, 0, 0 }, // Bits per component - 128, // Bits per element - 16, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 0, 0}, // Swizzle + {64, 64, 0, 0}, // Bits per component + 128, // Bits per element + 16, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R32G32B32X32_FLOAT (0x6) { "R32G32B32X32_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNUSED }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 32, 32, 32, 32 }, // Bits per component - 128, // Bits per element - 16, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNUSED}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {32, 32, 32, 32}, // Bits per component + 128, // Bits per element + 16, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R32G32B32A32_SSCALED (0x7) { "R32G32B32A32_SSCALED", - { SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 32, 32, 32, 32 }, // Bits per component - 128, // Bits per element - 16, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {32, 32, 32, 32}, // Bits per component + 128, // Bits per element + 16, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R32G32B32A32_USCALED (0x8) { "R32G32B32A32_USCALED", - { SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 32, 32, 32, 32 }, // Bits per component - 128, // Bits per element - 16, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {32, 32, 32, 32}, // Bits per component + 128, // Bits per element + 16, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0x9) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xA) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xB) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xC) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xD) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xE) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xF) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x10) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x11) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x12) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x13) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x14) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x15) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x16) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x17) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x18) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x19) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1A) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1B) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1C) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1D) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1E) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1F) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // R32G32B32A32_SFIXED (0x20) { "R32G32B32A32_SFIXED", - { SWR_TYPE_SFIXED, SWR_TYPE_SFIXED, SWR_TYPE_SFIXED, SWR_TYPE_SFIXED }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 32, 32, 32, 32 }, // Bits per component - 128, // Bits per element - 16, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SFIXED, SWR_TYPE_SFIXED, SWR_TYPE_SFIXED, SWR_TYPE_SFIXED}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {32, 32, 32, 32}, // Bits per component + 128, // Bits per element + 16, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0x21) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x22) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x23) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x24) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x25) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x26) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x27) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x28) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x29) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x2A) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x2B) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x2C) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x2D) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x2E) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x2F) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x30) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x31) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x32) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x33) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x34) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x35) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x36) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x37) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x38) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x39) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x3A) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x3B) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x3C) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x3D) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x3E) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x3F) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // R32G32B32_FLOAT (0x40) { "R32G32B32_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 0 }, // Swizzle - { 32, 32, 32, 0 }, // Bits per component - 96, // Bits per element - 12, // Bytes per element - 3, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 0}, // Swizzle + {32, 32, 32, 0}, // Bits per component + 96, // Bits per element + 12, // Bytes per element + 3, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R32G32B32_SINT (0x41) { "R32G32B32_SINT", - { SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 2, 0 }, // Swizzle - { 32, 32, 32, 0 }, // Bits per component - 96, // Bits per element - 12, // Bytes per element - 3, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 2, 0}, // Swizzle + {32, 32, 32, 0}, // Bits per component + 96, // Bits per element + 12, // Bytes per element + 3, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R32G32B32_UINT (0x42) { "R32G32B32_UINT", - { SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 2, 0 }, // Swizzle - { 32, 32, 32, 0 }, // Bits per component - 96, // Bits per element - 12, // Bytes per element - 3, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 2, 0}, // Swizzle + {32, 32, 32, 0}, // Bits per component + 96, // Bits per element + 12, // Bytes per element + 3, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0x43) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x44) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // R32G32B32_SSCALED (0x45) { "R32G32B32_SSCALED", - { SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 0 }, // Swizzle - { 32, 32, 32, 0 }, // Bits per component - 96, // Bits per element - 12, // Bytes per element - 3, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 0}, // Swizzle + {32, 32, 32, 0}, // Bits per component + 96, // Bits per element + 12, // Bytes per element + 3, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R32G32B32_USCALED (0x46) { "R32G32B32_USCALED", - { SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 0 }, // Swizzle - { 32, 32, 32, 0 }, // Bits per component - 96, // Bits per element - 12, // Bytes per element - 3, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 0}, // Swizzle + {32, 32, 32, 0}, // Bits per component + 96, // Bits per element + 12, // Bytes per element + 3, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0x47) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x48) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x49) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x4A) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x4B) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x4C) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x4D) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x4E) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x4F) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // R32G32B32_SFIXED (0x50) { "R32G32B32_SFIXED", - { SWR_TYPE_SFIXED, SWR_TYPE_SFIXED, SWR_TYPE_SFIXED, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 0 }, // Swizzle - { 32, 32, 32, 0 }, // Bits per component - 96, // Bits per element - 12, // Bytes per element - 3, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SFIXED, SWR_TYPE_SFIXED, SWR_TYPE_SFIXED, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 0}, // Swizzle + {32, 32, 32, 0}, // Bits per component + 96, // Bits per element + 12, // Bytes per element + 3, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0x51) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x52) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x53) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x54) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x55) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x56) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x57) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x58) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x59) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x5A) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x5B) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x5C) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x5D) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x5E) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x5F) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x60) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x61) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x62) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x63) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x64) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x65) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x66) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x67) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x68) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x69) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x6A) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x6B) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x6C) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x6D) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x6E) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x6F) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x70) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x71) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x72) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x73) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x74) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x75) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x76) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x77) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x78) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x79) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x7A) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x7B) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x7C) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x7D) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x7E) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x7F) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // R16G16B16A16_UNORM (0x80) { "R16G16B16A16_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 16, 16, 16, 16 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, true }, // Is normalized? - { 1.0f / 65535.0f, 1.0f / 65535.0f, 1.0f / 65535.0f, 1.0f / 65535.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {16, 16, 16, 16}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, true}, // Is normalized? + {1.0f / 65535.0f, + 1.0f / 65535.0f, + 1.0f / 65535.0f, + 1.0f / 65535.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16G16B16A16_SNORM (0x81) { "R16G16B16A16_SNORM", - { SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_SNORM }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 16, 16, 16, 16 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, true }, // Is normalized? - { 1.0f / 32767.0f, 1.0f / 32767.0f, 1.0f / 32767.0f, 1.0f / 32767.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_SNORM}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {16, 16, 16, 16}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, true}, // Is normalized? + {1.0f / 32767.0f, + 1.0f / 32767.0f, + 1.0f / 32767.0f, + 1.0f / 32767.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16G16B16A16_SINT (0x82) { "R16G16B16A16_SINT", - { SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 16, 16, 16, 16 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {16, 16, 16, 16}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16G16B16A16_UINT (0x83) { "R16G16B16A16_UINT", - { SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 16, 16, 16, 16 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {16, 16, 16, 16}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16G16B16A16_FLOAT (0x84) { "R16G16B16A16_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 16, 16, 16, 16 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {16, 16, 16, 16}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R32G32_FLOAT (0x85) { "R32G32_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 0, 0 }, // Swizzle - { 32, 32, 0, 0 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 0, 0}, // Swizzle + {32, 32, 0, 0}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R32G32_SINT (0x86) { "R32G32_SINT", - { SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 0, 0 }, // Swizzle - { 32, 32, 0, 0 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 0, 0}, // Swizzle + {32, 32, 0, 0}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R32G32_UINT (0x87) { "R32G32_UINT", - { SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 0, 0 }, // Swizzle - { 32, 32, 0, 0 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 0, 0}, // Swizzle + {32, 32, 0, 0}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R32_FLOAT_X8X24_TYPELESS (0x88) { "R32_FLOAT_X8X24_TYPELESS", - { SWR_TYPE_FLOAT, SWR_TYPE_UNUSED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 32, 32, 0, 0 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_UNUSED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {32, 32, 0, 0}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // X32_TYPELESS_G8X24_UINT (0x89) { "X32_TYPELESS_G8X24_UINT", - { SWR_TYPE_UINT, SWR_TYPE_UNUSED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 32, 32, 0, 0 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UINT, SWR_TYPE_UNUSED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {32, 32, 0, 0}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // L32A32_FLOAT (0x8A) { "L32A32_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 3, 0, 0 }, // Swizzle - { 32, 32, 0, 0 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 3, 0, 0}, // Swizzle + {32, 32, 0, 0}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0x8B) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x8C) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // R64_FLOAT (0x8D) { "R64_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 64, 0, 0, 0 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {64, 0, 0, 0}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16G16B16X16_UNORM (0x8E) { "R16G16B16X16_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNUSED }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 16, 16, 16, 16 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, false }, // Is normalized? - { 1.0f / 65535.0f, 1.0f / 65535.0f, 1.0f / 65535.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNUSED}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {16, 16, 16, 16}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, false}, // Is normalized? + {1.0f / 65535.0f, 1.0f / 65535.0f, 1.0f / 65535.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16G16B16X16_FLOAT (0x8F) { "R16G16B16X16_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNUSED }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 16, 16, 16, 16 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNUSED}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {16, 16, 16, 16}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0x90) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // L32X32_FLOAT (0x91) { "L32X32_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 3, 0, 0 }, // Swizzle - { 32, 32, 0, 0 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 3, 0, 0}, // Swizzle + {32, 32, 0, 0}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // I32X32_FLOAT (0x92) { "I32X32_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 3, 0, 0 }, // Swizzle - { 32, 32, 0, 0 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 3, 0, 0}, // Swizzle + {32, 32, 0, 0}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16G16B16A16_SSCALED (0x93) { "R16G16B16A16_SSCALED", - { SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 16, 16, 16, 16 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {16, 16, 16, 16}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16G16B16A16_USCALED (0x94) { "R16G16B16A16_USCALED", - { SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 16, 16, 16, 16 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {16, 16, 16, 16}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R32G32_SSCALED (0x95) { "R32G32_SSCALED", - { SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 0, 0 }, // Swizzle - { 32, 32, 0, 0 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 0, 0}, // Swizzle + {32, 32, 0, 0}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R32G32_USCALED (0x96) { "R32G32_USCALED", - { SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 0, 0 }, // Swizzle - { 32, 32, 0, 0 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 0, 0}, // Swizzle + {32, 32, 0, 0}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0x97) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x98) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x99) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x9A) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x9B) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x9C) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x9D) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x9E) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x9F) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // R32G32_SFIXED (0xA0) { "R32G32_SFIXED", - { SWR_TYPE_SFIXED, SWR_TYPE_SFIXED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 0, 0 }, // Swizzle - { 32, 32, 0, 0 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SFIXED, SWR_TYPE_SFIXED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 0, 0}, // Swizzle + {32, 32, 0, 0}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0xA1) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xA2) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xA3) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xA4) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xA5) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xA6) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xA7) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xA8) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xA9) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xAA) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xAB) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xAC) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xAD) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xAE) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xAF) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xB0) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xB1) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xB2) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xB3) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xB4) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xB5) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xB6) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xB7) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xB8) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xB9) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xBA) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xBB) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xBC) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xBD) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xBE) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xBF) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // B8G8R8A8_UNORM (0xC0) { "B8G8R8A8_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 2, 1, 0, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, true }, // Is normalized? - { 1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {2, 1, 0, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, true}, // Is normalized? + {1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // B8G8R8A8_UNORM_SRGB (0xC1) { "B8G8R8A8_UNORM_SRGB", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 2, 1, 0, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - true, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, true }, // Is normalized? - { 1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {2, 1, 0, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + true, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, true}, // Is normalized? + {1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R10G10B10A2_UNORM (0xC2) { "R10G10B10A2_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 10, 10, 10, 2 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, true }, // Is normalized? - { 1.0f / 1023.0f, 1.0f / 1023.0f, 1.0f / 1023.0f, 1.0f / 3.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {10, 10, 10, 2}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, true}, // Is normalized? + {1.0f / 1023.0f, 1.0f / 1023.0f, 1.0f / 1023.0f, 1.0f / 3.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R10G10B10A2_UNORM_SRGB (0xC3) { "R10G10B10A2_UNORM_SRGB", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 10, 10, 10, 2 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - true, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, true }, // Is normalized? - { 1.0f / 1023.0f, 1.0f / 1023.0f, 1.0f / 1023.0f, 1.0f / 3.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {10, 10, 10, 2}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + true, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, true}, // Is normalized? + {1.0f / 1023.0f, 1.0f / 1023.0f, 1.0f / 1023.0f, 1.0f / 3.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R10G10B10A2_UINT (0xC4) { "R10G10B10A2_UINT", - { SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 10, 10, 10, 2 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {10, 10, 10, 2}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0xC5) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xC6) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // R8G8B8A8_UNORM (0xC7) { "R8G8B8A8_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, true }, // Is normalized? - { 1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, true}, // Is normalized? + {1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R8G8B8A8_UNORM_SRGB (0xC8) { "R8G8B8A8_UNORM_SRGB", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - true, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, true }, // Is normalized? - { 1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + true, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, true}, // Is normalized? + {1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R8G8B8A8_SNORM (0xC9) { "R8G8B8A8_SNORM", - { SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_SNORM }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, true }, // Is normalized? - { 1.0f / 127.0f, 1.0f / 127.0f, 1.0f / 127.0f, 1.0f / 127.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_SNORM}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, true}, // Is normalized? + {1.0f / 127.0f, 1.0f / 127.0f, 1.0f / 127.0f, 1.0f / 127.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R8G8B8A8_SINT (0xCA) { "R8G8B8A8_SINT", - { SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R8G8B8A8_UINT (0xCB) { "R8G8B8A8_UINT", - { SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16G16_UNORM (0xCC) { "R16G16_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 0, 0 }, // Swizzle - { 16, 16, 0, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, false, false }, // Is normalized? - { 1.0f / 65535.0f, 1.0f / 65535.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 0, 0}, // Swizzle + {16, 16, 0, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, false, false}, // Is normalized? + {1.0f / 65535.0f, 1.0f / 65535.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16G16_SNORM (0xCD) { "R16G16_SNORM", - { SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 0, 0 }, // Swizzle - { 16, 16, 0, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, false, false }, // Is normalized? - { 1.0f / 32767.0f, 1.0f / 32767.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 0, 0}, // Swizzle + {16, 16, 0, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, false, false}, // Is normalized? + {1.0f / 32767.0f, 1.0f / 32767.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16G16_SINT (0xCE) { "R16G16_SINT", - { SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 0, 0 }, // Swizzle - { 16, 16, 0, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 0, 0}, // Swizzle + {16, 16, 0, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16G16_UINT (0xCF) { "R16G16_UINT", - { SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 0, 0 }, // Swizzle - { 16, 16, 0, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 0, 0}, // Swizzle + {16, 16, 0, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16G16_FLOAT (0xD0) { "R16G16_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 0, 0 }, // Swizzle - { 16, 16, 0, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 0, 0}, // Swizzle + {16, 16, 0, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // B10G10R10A2_UNORM (0xD1) { "B10G10R10A2_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 2, 1, 0, 3 }, // Swizzle - { 10, 10, 10, 2 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, true }, // Is normalized? - { 1.0f / 1023.0f, 1.0f / 1023.0f, 1.0f / 1023.0f, 1.0f / 3.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {2, 1, 0, 3}, // Swizzle + {10, 10, 10, 2}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, true}, // Is normalized? + {1.0f / 1023.0f, 1.0f / 1023.0f, 1.0f / 1023.0f, 1.0f / 3.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // B10G10R10A2_UNORM_SRGB (0xD2) { "B10G10R10A2_UNORM_SRGB", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 2, 1, 0, 3 }, // Swizzle - { 10, 10, 10, 2 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - true, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, true }, // Is normalized? - { 1.0f / 1023.0f, 1.0f / 1023.0f, 1.0f / 1023.0f, 1.0f / 3.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {2, 1, 0, 3}, // Swizzle + {10, 10, 10, 2}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + true, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, true}, // Is normalized? + {1.0f / 1023.0f, 1.0f / 1023.0f, 1.0f / 1023.0f, 1.0f / 3.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R11G11B10_FLOAT (0xD3) { "R11G11B10_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 0 }, // Swizzle - { 11, 11, 10, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 3, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 0}, // Swizzle + {11, 11, 10, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 3, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0xD4) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // R10G10B10_FLOAT_A2_UNORM (0xD5) { "R10G10B10_FLOAT_A2_UNORM", - { SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNORM }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 10, 10, 10, 2 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f / 3.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNORM}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {10, 10, 10, 2}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f / 3.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R32_SINT (0xD6) { "R32_SINT", - { SWR_TYPE_SINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 32, 0, 0, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {32, 0, 0, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R32_UINT (0xD7) { "R32_UINT", - { SWR_TYPE_UINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 32, 0, 0, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {32, 0, 0, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R32_FLOAT (0xD8) { "R32_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 32, 0, 0, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {32, 0, 0, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R24_UNORM_X8_TYPELESS (0xD9) { "R24_UNORM_X8_TYPELESS", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 24, 0, 0, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 16777215.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {24, 0, 0, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 16777215.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // X24_TYPELESS_G8_UINT (0xDA) { "X24_TYPELESS_G8_UINT", - { SWR_TYPE_UINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 1, 0, 0, 0 }, // Swizzle - { 32, 0, 0, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {1, 0, 0, 0}, // Swizzle + {32, 0, 0, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0xDB) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xDC) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // L32_UNORM (0xDD) { "L32_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 32, 0, 0, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 4294967295.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {32, 0, 0, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 4294967295.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0xDE) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // L16A16_UNORM (0xDF) { "L16A16_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 3, 0, 0 }, // Swizzle - { 16, 16, 0, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { true, true, false, false }, // Is normalized? - { 1.0f / 65535.0f, 1.0f / 65535.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 3, 0, 0}, // Swizzle + {16, 16, 0, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {true, true, false, false}, // Is normalized? + {1.0f / 65535.0f, 1.0f / 65535.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // I24X8_UNORM (0xE0) { "I24X8_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 3, 0, 0 }, // Swizzle - { 24, 8, 0, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { true, true, false, false }, // Is normalized? - { 1.0f / 16777215.0f, 1.0f / 255.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 3, 0, 0}, // Swizzle + {24, 8, 0, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {true, true, false, false}, // Is normalized? + {1.0f / 16777215.0f, 1.0f / 255.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // L24X8_UNORM (0xE1) { "L24X8_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 3, 0, 0 }, // Swizzle - { 24, 8, 0, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { true, true, false, false }, // Is normalized? - { 1.0f / 16777215.0f, 1.0f / 255.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 3, 0, 0}, // Swizzle + {24, 8, 0, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {true, true, false, false}, // Is normalized? + {1.0f / 16777215.0f, 1.0f / 255.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0xE2) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // I32_FLOAT (0xE3) { "I32_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 32, 0, 0, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {32, 0, 0, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // L32_FLOAT (0xE4) { "L32_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 32, 0, 0, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {32, 0, 0, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // A32_FLOAT (0xE5) { "A32_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 3, 0, 0, 0 }, // Swizzle - { 32, 0, 0, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {3, 0, 0, 0}, // Swizzle + {32, 0, 0, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0xE6) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xE7) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xE8) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // B8G8R8X8_UNORM (0xE9) { "B8G8R8X8_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNUSED }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 2, 1, 0, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, false }, // Is normalized? - { 1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNUSED}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {2, 1, 0, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, false}, // Is normalized? + {1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // B8G8R8X8_UNORM_SRGB (0xEA) { "B8G8R8X8_UNORM_SRGB", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNUSED }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 2, 1, 0, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - true, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, false }, // Is normalized? - { 1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNUSED}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {2, 1, 0, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + true, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, false}, // Is normalized? + {1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R8G8B8X8_UNORM (0xEB) { "R8G8B8X8_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNUSED }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, false }, // Is normalized? - { 1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNUSED}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, false}, // Is normalized? + {1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R8G8B8X8_UNORM_SRGB (0xEC) { "R8G8B8X8_UNORM_SRGB", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNUSED }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - true, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, false }, // Is normalized? - { 1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNUSED}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + true, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, false}, // Is normalized? + {1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R9G9B9E5_SHAREDEXP (0xED) { "R9G9B9E5_SHAREDEXP", - { SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 9, 9, 9, 5 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {9, 9, 9, 5}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // B10G10R10X2_UNORM (0xEE) { "B10G10R10X2_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNUSED }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 2, 1, 0, 3 }, // Swizzle - { 10, 10, 10, 2 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, false }, // Is normalized? - { 1.0f / 1023.0f, 1.0f / 1023.0f, 1.0f / 1023.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNUSED}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {2, 1, 0, 3}, // Swizzle + {10, 10, 10, 2}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, false}, // Is normalized? + {1.0f / 1023.0f, 1.0f / 1023.0f, 1.0f / 1023.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0xEF) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // L16A16_FLOAT (0xF0) { "L16A16_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 3, 0, 0 }, // Swizzle - { 16, 16, 0, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 3, 0, 0}, // Swizzle + {16, 16, 0, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0xF1) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xF2) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // R10G10B10X2_USCALED (0xF3) { "R10G10B10X2_USCALED", - { SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_UNUSED }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 10, 10, 10, 2 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_UNUSED}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {10, 10, 10, 2}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R8G8B8A8_SSCALED (0xF4) { "R8G8B8A8_SSCALED", - { SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R8G8B8A8_USCALED (0xF5) { "R8G8B8A8_USCALED", - { SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16G16_SSCALED (0xF6) { "R16G16_SSCALED", - { SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 0, 0 }, // Swizzle - { 16, 16, 0, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 0, 0}, // Swizzle + {16, 16, 0, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16G16_USCALED (0xF7) { "R16G16_USCALED", - { SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 0, 0 }, // Swizzle - { 16, 16, 0, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 0, 0}, // Swizzle + {16, 16, 0, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R32_SSCALED (0xF8) { "R32_SSCALED", - { SWR_TYPE_SSCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 32, 0, 0, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SSCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {32, 0, 0, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R32_USCALED (0xF9) { "R32_USCALED", - { SWR_TYPE_USCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 32, 0, 0, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_USCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {32, 0, 0, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0xFA) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xFB) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xFC) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xFD) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xFE) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0xFF) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // B5G6R5_UNORM (0x100) { "B5G6R5_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 2, 1, 0, 0 }, // Swizzle - { 5, 6, 5, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 3, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, false }, // Is normalized? - { 1.0f / 31.0f, 1.0f / 63.0f, 1.0f / 31.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {2, 1, 0, 0}, // Swizzle + {5, 6, 5, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 3, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, false}, // Is normalized? + {1.0f / 31.0f, 1.0f / 63.0f, 1.0f / 31.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // B5G6R5_UNORM_SRGB (0x101) { "B5G6R5_UNORM_SRGB", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 2, 1, 0, 0 }, // Swizzle - { 5, 6, 5, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 3, // Num components - true, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, false }, // Is normalized? - { 1.0f / 31.0f, 1.0f / 63.0f, 1.0f / 31.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {2, 1, 0, 0}, // Swizzle + {5, 6, 5, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 3, // Num components + true, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, false}, // Is normalized? + {1.0f / 31.0f, 1.0f / 63.0f, 1.0f / 31.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // B5G5R5A1_UNORM (0x102) { "B5G5R5A1_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 2, 1, 0, 3 }, // Swizzle - { 5, 5, 5, 1 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, true }, // Is normalized? - { 1.0f / 31.0f, 1.0f / 31.0f, 1.0f / 31.0f, 1.0f / 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {2, 1, 0, 3}, // Swizzle + {5, 5, 5, 1}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, true}, // Is normalized? + {1.0f / 31.0f, 1.0f / 31.0f, 1.0f / 31.0f, 1.0f / 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // B5G5R5A1_UNORM_SRGB (0x103) { "B5G5R5A1_UNORM_SRGB", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 2, 1, 0, 3 }, // Swizzle - { 5, 5, 5, 1 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 4, // Num components - true, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, true }, // Is normalized? - { 1.0f / 31.0f, 1.0f / 31.0f, 1.0f / 31.0f, 1.0f / 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {2, 1, 0, 3}, // Swizzle + {5, 5, 5, 1}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 4, // Num components + true, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, true}, // Is normalized? + {1.0f / 31.0f, 1.0f / 31.0f, 1.0f / 31.0f, 1.0f / 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // B4G4R4A4_UNORM (0x104) { "B4G4R4A4_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 2, 1, 0, 3 }, // Swizzle - { 4, 4, 4, 4 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, true }, // Is normalized? - { 1.0f / 15.0f, 1.0f / 15.0f, 1.0f / 15.0f, 1.0f / 15.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {2, 1, 0, 3}, // Swizzle + {4, 4, 4, 4}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, true}, // Is normalized? + {1.0f / 15.0f, 1.0f / 15.0f, 1.0f / 15.0f, 1.0f / 15.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // B4G4R4A4_UNORM_SRGB (0x105) { "B4G4R4A4_UNORM_SRGB", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 2, 1, 0, 3 }, // Swizzle - { 4, 4, 4, 4 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 4, // Num components - true, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, true }, // Is normalized? - { 1.0f / 15.0f, 1.0f / 15.0f, 1.0f / 15.0f, 1.0f / 15.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {2, 1, 0, 3}, // Swizzle + {4, 4, 4, 4}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 4, // Num components + true, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, true}, // Is normalized? + {1.0f / 15.0f, 1.0f / 15.0f, 1.0f / 15.0f, 1.0f / 15.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R8G8_UNORM (0x106) { "R8G8_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 0, 0 }, // Swizzle - { 8, 8, 0, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, false, false }, // Is normalized? - { 1.0f / 255.0f, 1.0f / 255.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 0, 0}, // Swizzle + {8, 8, 0, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, false, false}, // Is normalized? + {1.0f / 255.0f, 1.0f / 255.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R8G8_SNORM (0x107) { "R8G8_SNORM", - { SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 0, 0 }, // Swizzle - { 8, 8, 0, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, false, false }, // Is normalized? - { 1.0f / 127.0f, 1.0f / 127.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 0, 0}, // Swizzle + {8, 8, 0, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, false, false}, // Is normalized? + {1.0f / 127.0f, 1.0f / 127.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R8G8_SINT (0x108) { "R8G8_SINT", - { SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 0, 0 }, // Swizzle - { 8, 8, 0, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 0, 0}, // Swizzle + {8, 8, 0, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R8G8_UINT (0x109) { "R8G8_UINT", - { SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 0, 0 }, // Swizzle - { 8, 8, 0, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 0, 0}, // Swizzle + {8, 8, 0, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16_UNORM (0x10A) { "R16_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 16, 0, 0, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 65535.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {16, 0, 0, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 65535.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16_SNORM (0x10B) { "R16_SNORM", - { SWR_TYPE_SNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 16, 0, 0, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 32767.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {16, 0, 0, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 32767.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16_SINT (0x10C) { "R16_SINT", - { SWR_TYPE_SINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 16, 0, 0, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {16, 0, 0, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16_UINT (0x10D) { "R16_UINT", - { SWR_TYPE_UINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 16, 0, 0, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {16, 0, 0, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16_FLOAT (0x10E) { "R16_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 16, 0, 0, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {16, 0, 0, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0x10F) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x110) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // I16_UNORM (0x111) { "I16_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 16, 0, 0, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 65535.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {16, 0, 0, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 65535.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // L16_UNORM (0x112) { "L16_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 16, 0, 0, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 65535.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {16, 0, 0, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 65535.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // A16_UNORM (0x113) { "A16_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 3, 0, 0, 0 }, // Swizzle - { 16, 0, 0, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 65535.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {3, 0, 0, 0}, // Swizzle + {16, 0, 0, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 65535.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // L8A8_UNORM (0x114) { "L8A8_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 3, 0, 0 }, // Swizzle - { 8, 8, 0, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { true, true, false, false }, // Is normalized? - { 1.0f / 255.0f, 1.0f / 255.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 3, 0, 0}, // Swizzle + {8, 8, 0, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {true, true, false, false}, // Is normalized? + {1.0f / 255.0f, 1.0f / 255.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // I16_FLOAT (0x115) { "I16_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 16, 0, 0, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {16, 0, 0, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // L16_FLOAT (0x116) { "L16_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 16, 0, 0, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {16, 0, 0, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // A16_FLOAT (0x117) { "A16_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 3, 0, 0, 0 }, // Swizzle - { 16, 0, 0, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {3, 0, 0, 0}, // Swizzle + {16, 0, 0, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // L8A8_UNORM_SRGB (0x118) { "L8A8_UNORM_SRGB", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 3, 0, 0 }, // Swizzle - { 8, 8, 0, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 2, // Num components - true, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { true, true, false, false }, // Is normalized? - { 1.0f / 255.0f, 1.0f / 255.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 3, 0, 0}, // Swizzle + {8, 8, 0, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 2, // Num components + true, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {true, true, false, false}, // Is normalized? + {1.0f / 255.0f, 1.0f / 255.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0x119) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // B5G5R5X1_UNORM (0x11A) { "B5G5R5X1_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNUSED }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 2, 1, 0, 3 }, // Swizzle - { 5, 5, 5, 1 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, false }, // Is normalized? - { 1.0f / 31.0f, 1.0f / 31.0f, 1.0f / 31.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNUSED}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {2, 1, 0, 3}, // Swizzle + {5, 5, 5, 1}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, false}, // Is normalized? + {1.0f / 31.0f, 1.0f / 31.0f, 1.0f / 31.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // B5G5R5X1_UNORM_SRGB (0x11B) { "B5G5R5X1_UNORM_SRGB", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNUSED }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 2, 1, 0, 3 }, // Swizzle - { 5, 5, 5, 1 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 4, // Num components - true, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, false }, // Is normalized? - { 1.0f / 31.0f, 1.0f / 31.0f, 1.0f / 31.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNUSED}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {2, 1, 0, 3}, // Swizzle + {5, 5, 5, 1}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 4, // Num components + true, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, false}, // Is normalized? + {1.0f / 31.0f, 1.0f / 31.0f, 1.0f / 31.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R8G8_SSCALED (0x11C) { "R8G8_SSCALED", - { SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 0, 0 }, // Swizzle - { 8, 8, 0, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 0, 0}, // Swizzle + {8, 8, 0, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R8G8_USCALED (0x11D) { "R8G8_USCALED", - { SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 0, 0 }, // Swizzle - { 8, 8, 0, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 0, 0}, // Swizzle + {8, 8, 0, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16_SSCALED (0x11E) { "R16_SSCALED", - { SWR_TYPE_SSCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 16, 0, 0, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SSCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {16, 0, 0, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16_USCALED (0x11F) { "R16_USCALED", - { SWR_TYPE_USCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 16, 0, 0, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_USCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {16, 0, 0, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0x120) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x121) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x122) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x123) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // A1B5G5R5_UNORM (0x124) { "A1B5G5R5_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 3, 2, 1, 0 }, // Swizzle - { 1, 5, 5, 5 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, true }, // Is normalized? - { 1.0f / 1.0f, 1.0f / 31.0f, 1.0f / 31.0f, 1.0f / 31.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {3, 2, 1, 0}, // Swizzle + {1, 5, 5, 5}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, true}, // Is normalized? + {1.0f / 1.0f, 1.0f / 31.0f, 1.0f / 31.0f, 1.0f / 31.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // A4B4G4R4_UNORM (0x125) { "A4B4G4R4_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 3, 2, 1, 0 }, // Swizzle - { 4, 4, 4, 4 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, true }, // Is normalized? - { 1.0f / 15.0f, 1.0f / 15.0f, 1.0f / 15.0f, 1.0f / 15.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {3, 2, 1, 0}, // Swizzle + {4, 4, 4, 4}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, true}, // Is normalized? + {1.0f / 15.0f, 1.0f / 15.0f, 1.0f / 15.0f, 1.0f / 15.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // L8A8_UINT (0x126) { "L8A8_UINT", - { SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 3, 0, 0 }, // Swizzle - { 8, 8, 0, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 3, 0, 0}, // Swizzle + {8, 8, 0, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // L8A8_SINT (0x127) { "L8A8_SINT", - { SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 3, 0, 0 }, // Swizzle - { 8, 8, 0, 0 }, // Bits per component - 16, // Bits per element - 2, // Bytes per element - 2, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 3, 0, 0}, // Swizzle + {8, 8, 0, 0}, // Bits per component + 16, // Bits per element + 2, // Bytes per element + 2, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0x128) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x129) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x12A) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x12B) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x12C) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x12D) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x12E) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x12F) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x130) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x131) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x132) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x133) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x134) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x135) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x136) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x137) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x138) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x139) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x13A) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x13B) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x13C) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x13D) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x13E) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x13F) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // R8_UNORM (0x140) { "R8_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 8, 0, 0, 0 }, // Bits per component - 8, // Bits per element - 1, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 255.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {8, 0, 0, 0}, // Bits per component + 8, // Bits per element + 1, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 255.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R8_SNORM (0x141) { "R8_SNORM", - { SWR_TYPE_SNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 8, 0, 0, 0 }, // Bits per component - 8, // Bits per element - 1, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 127.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {8, 0, 0, 0}, // Bits per component + 8, // Bits per element + 1, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 127.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R8_SINT (0x142) { "R8_SINT", - { SWR_TYPE_SINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 8, 0, 0, 0 }, // Bits per component - 8, // Bits per element - 1, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {8, 0, 0, 0}, // Bits per component + 8, // Bits per element + 1, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R8_UINT (0x143) { "R8_UINT", - { SWR_TYPE_UINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 8, 0, 0, 0 }, // Bits per component - 8, // Bits per element - 1, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {8, 0, 0, 0}, // Bits per component + 8, // Bits per element + 1, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // A8_UNORM (0x144) { "A8_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 3, 0, 0, 0 }, // Swizzle - { 8, 0, 0, 0 }, // Bits per component - 8, // Bits per element - 1, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 255.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {3, 0, 0, 0}, // Swizzle + {8, 0, 0, 0}, // Bits per component + 8, // Bits per element + 1, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 255.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // I8_UNORM (0x145) { "I8_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 8, 0, 0, 0 }, // Bits per component - 8, // Bits per element - 1, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 255.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {8, 0, 0, 0}, // Bits per component + 8, // Bits per element + 1, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 255.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // L8_UNORM (0x146) { "L8_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 8, 0, 0, 0 }, // Bits per component - 8, // Bits per element - 1, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 255.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {8, 0, 0, 0}, // Bits per component + 8, // Bits per element + 1, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 255.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0x147) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x148) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // R8_SSCALED (0x149) { "R8_SSCALED", - { SWR_TYPE_SSCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 8, 0, 0, 0 }, // Bits per component - 8, // Bits per element - 1, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SSCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {8, 0, 0, 0}, // Bits per component + 8, // Bits per element + 1, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R8_USCALED (0x14A) { "R8_USCALED", - { SWR_TYPE_USCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 8, 0, 0, 0 }, // Bits per component - 8, // Bits per element - 1, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_USCALED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {8, 0, 0, 0}, // Bits per component + 8, // Bits per element + 1, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0x14B) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // L8_UNORM_SRGB (0x14C) { "L8_UNORM_SRGB", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 8, 0, 0, 0 }, // Bits per component - 8, // Bits per element - 1, // Bytes per element - 1, // Num components - true, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 255.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {8, 0, 0, 0}, // Bits per component + 8, // Bits per element + 1, // Bytes per element + 1, // Num components + true, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 255.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0x14D) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x14E) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x14F) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x150) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x151) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // L8_UINT (0x152) { "L8_UINT", - { SWR_TYPE_UINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 8, 0, 0, 0 }, // Bits per component - 8, // Bits per element - 1, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {8, 0, 0, 0}, // Bits per component + 8, // Bits per element + 1, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // L8_SINT (0x153) { "L8_SINT", - { SWR_TYPE_SINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 8, 0, 0, 0 }, // Bits per component - 8, // Bits per element - 1, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {8, 0, 0, 0}, // Bits per component + 8, // Bits per element + 1, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // I8_UINT (0x154) { "I8_UINT", - { SWR_TYPE_UINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 8, 0, 0, 0 }, // Bits per component - 8, // Bits per element - 1, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {8, 0, 0, 0}, // Bits per component + 8, // Bits per element + 1, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // I8_SINT (0x155) { "I8_SINT", - { SWR_TYPE_SINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 8, 0, 0, 0 }, // Bits per component - 8, // Bits per element - 1, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - true, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {8, 0, 0, 0}, // Bits per component + 8, // Bits per element + 1, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + true, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0x156) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x157) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x158) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x159) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x15A) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x15B) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x15C) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x15D) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x15E) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x15F) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x160) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x161) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x162) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x163) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x164) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x165) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x166) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x167) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x168) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x169) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x16A) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x16B) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x16C) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x16D) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x16E) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x16F) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x170) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x171) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x172) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x173) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x174) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x175) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x176) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x177) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x178) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x179) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x17A) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x17B) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x17C) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x17D) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x17E) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x17F) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // DXT1_RGB_SRGB (0x180) { "DXT1_RGB_SRGB", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 1, // Num components - false, // isSRGB - true, // isBC - false, // isSubsampled - false, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 255.0f, 0, 0, 0 }, // To float scale factor - 4, // bcWidth - 4, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 1, // Num components + false, // isSRGB + true, // isBC + false, // isSubsampled + false, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 255.0f, 0, 0, 0}, // To float scale factor + 4, // bcWidth + 4, // bcHeight }, // padding (0x181) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x182) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // YCRCB_SWAPUVY (0x183) { "YCRCB_SWAPUVY", - { SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - true, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 2, // bcWidth - 1, // bcHeight + {SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + true, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 2, // bcWidth + 1, // bcHeight }, // padding (0x184) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x185) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // BC1_UNORM (0x186) { "BC1_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 1, // Num components - false, // isSRGB - true, // isBC - false, // isSubsampled - false, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 255.0f, 0, 0, 0 }, // To float scale factor - 4, // bcWidth - 4, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 1, // Num components + false, // isSRGB + true, // isBC + false, // isSubsampled + false, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 255.0f, 0, 0, 0}, // To float scale factor + 4, // bcWidth + 4, // bcHeight }, // BC2_UNORM (0x187) { "BC2_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 128, // Bits per element - 16, // Bytes per element - 1, // Num components - false, // isSRGB - true, // isBC - false, // isSubsampled - false, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 255.0f, 0, 0, 0 }, // To float scale factor - 4, // bcWidth - 4, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 128, // Bits per element + 16, // Bytes per element + 1, // Num components + false, // isSRGB + true, // isBC + false, // isSubsampled + false, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 255.0f, 0, 0, 0}, // To float scale factor + 4, // bcWidth + 4, // bcHeight }, // BC3_UNORM (0x188) { "BC3_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 128, // Bits per element - 16, // Bytes per element - 1, // Num components - false, // isSRGB - true, // isBC - false, // isSubsampled - false, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 255.0f, 0, 0, 0 }, // To float scale factor - 4, // bcWidth - 4, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 128, // Bits per element + 16, // Bytes per element + 1, // Num components + false, // isSRGB + true, // isBC + false, // isSubsampled + false, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 255.0f, 0, 0, 0}, // To float scale factor + 4, // bcWidth + 4, // bcHeight }, // BC4_UNORM (0x189) { "BC4_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 1, // Num components - false, // isSRGB - true, // isBC - false, // isSubsampled - false, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 255.0f, 0, 0, 0 }, // To float scale factor - 4, // bcWidth - 4, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 1, // Num components + false, // isSRGB + true, // isBC + false, // isSubsampled + false, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 255.0f, 0, 0, 0}, // To float scale factor + 4, // bcWidth + 4, // bcHeight }, // BC5_UNORM (0x18A) { "BC5_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 128, // Bits per element - 16, // Bytes per element - 1, // Num components - false, // isSRGB - true, // isBC - false, // isSubsampled - false, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 255.0f, 0, 0, 0 }, // To float scale factor - 4, // bcWidth - 4, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 128, // Bits per element + 16, // Bytes per element + 1, // Num components + false, // isSRGB + true, // isBC + false, // isSubsampled + false, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 255.0f, 0, 0, 0}, // To float scale factor + 4, // bcWidth + 4, // bcHeight }, // BC1_UNORM_SRGB (0x18B) { "BC1_UNORM_SRGB", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 1, // Num components - true, // isSRGB - true, // isBC - false, // isSubsampled - false, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 255.0f, 0, 0, 0 }, // To float scale factor - 4, // bcWidth - 4, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 1, // Num components + true, // isSRGB + true, // isBC + false, // isSubsampled + false, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 255.0f, 0, 0, 0}, // To float scale factor + 4, // bcWidth + 4, // bcHeight }, // BC2_UNORM_SRGB (0x18C) { "BC2_UNORM_SRGB", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 128, // Bits per element - 16, // Bytes per element - 1, // Num components - true, // isSRGB - true, // isBC - false, // isSubsampled - false, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 255.0f, 0, 0, 0 }, // To float scale factor - 4, // bcWidth - 4, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 128, // Bits per element + 16, // Bytes per element + 1, // Num components + true, // isSRGB + true, // isBC + false, // isSubsampled + false, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 255.0f, 0, 0, 0}, // To float scale factor + 4, // bcWidth + 4, // bcHeight }, // BC3_UNORM_SRGB (0x18D) { "BC3_UNORM_SRGB", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 128, // Bits per element - 16, // Bytes per element - 1, // Num components - true, // isSRGB - true, // isBC - false, // isSubsampled - false, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 255.0f, 0, 0, 0 }, // To float scale factor - 4, // bcWidth - 4, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 128, // Bits per element + 16, // Bytes per element + 1, // Num components + true, // isSRGB + true, // isBC + false, // isSubsampled + false, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 255.0f, 0, 0, 0}, // To float scale factor + 4, // bcWidth + 4, // bcHeight }, // padding (0x18E) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // YCRCB_SWAPUV (0x18F) { "YCRCB_SWAPUV", - { SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - true, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 2, // bcWidth - 1, // bcHeight + {SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + true, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 2, // bcWidth + 1, // bcHeight }, // padding (0x190) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // DXT1_RGB (0x191) { "DXT1_RGB", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 1, // Num components - false, // isSRGB - true, // isBC - false, // isSubsampled - false, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 255.0f, 0, 0, 0 }, // To float scale factor - 4, // bcWidth - 4, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 1, // Num components + false, // isSRGB + true, // isBC + false, // isSubsampled + false, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 255.0f, 0, 0, 0}, // To float scale factor + 4, // bcWidth + 4, // bcHeight }, // padding (0x192) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // R8G8B8_UNORM (0x193) { "R8G8B8_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 0 }, // Swizzle - { 8, 8, 8, 0 }, // Bits per component - 24, // Bits per element - 3, // Bytes per element - 3, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, false }, // Is normalized? - { 1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 0}, // Swizzle + {8, 8, 8, 0}, // Bits per component + 24, // Bits per element + 3, // Bytes per element + 3, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, false}, // Is normalized? + {1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R8G8B8_SNORM (0x194) { "R8G8B8_SNORM", - { SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 0 }, // Swizzle - { 8, 8, 8, 0 }, // Bits per component - 24, // Bits per element - 3, // Bytes per element - 3, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, false }, // Is normalized? - { 1.0f / 127.0f, 1.0f / 127.0f, 1.0f / 127.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 0}, // Swizzle + {8, 8, 8, 0}, // Bits per component + 24, // Bits per element + 3, // Bytes per element + 3, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, false}, // Is normalized? + {1.0f / 127.0f, 1.0f / 127.0f, 1.0f / 127.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R8G8B8_SSCALED (0x195) { "R8G8B8_SSCALED", - { SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 0 }, // Swizzle - { 8, 8, 8, 0 }, // Bits per component - 24, // Bits per element - 3, // Bytes per element - 3, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 0}, // Swizzle + {8, 8, 8, 0}, // Bits per component + 24, // Bits per element + 3, // Bytes per element + 3, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R8G8B8_USCALED (0x196) { "R8G8B8_USCALED", - { SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 0 }, // Swizzle - { 8, 8, 8, 0 }, // Bits per component - 24, // Bits per element - 3, // Bytes per element - 3, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 0}, // Swizzle + {8, 8, 8, 0}, // Bits per component + 24, // Bits per element + 3, // Bytes per element + 3, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R64G64B64A64_FLOAT (0x197) { "R64G64B64A64_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 64, 64, 64, 64 }, // Bits per component - 256, // Bits per element - 32, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {64, 64, 64, 64}, // Bits per component + 256, // Bits per element + 32, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R64G64B64_FLOAT (0x198) { "R64G64B64_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 0 }, // Swizzle - { 64, 64, 64, 0 }, // Bits per component - 192, // Bits per element - 24, // Bytes per element - 3, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 0}, // Swizzle + {64, 64, 64, 0}, // Bits per component + 192, // Bits per element + 24, // Bytes per element + 3, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // BC4_SNORM (0x199) { "BC4_SNORM", - { SWR_TYPE_SNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 64, // Bits per element - 8, // Bytes per element - 1, // Num components - false, // isSRGB - true, // isBC - false, // isSubsampled - false, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 127.0f, 0, 0, 0 }, // To float scale factor - 4, // bcWidth - 4, // bcHeight + {SWR_TYPE_SNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 64, // Bits per element + 8, // Bytes per element + 1, // Num components + false, // isSRGB + true, // isBC + false, // isSubsampled + false, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 127.0f, 0, 0, 0}, // To float scale factor + 4, // bcWidth + 4, // bcHeight }, // BC5_SNORM (0x19A) { "BC5_SNORM", - { SWR_TYPE_SNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 128, // Bits per element - 16, // Bytes per element - 1, // Num components - false, // isSRGB - true, // isBC - false, // isSubsampled - false, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 127.0f, 0, 0, 0 }, // To float scale factor - 4, // bcWidth - 4, // bcHeight + {SWR_TYPE_SNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 128, // Bits per element + 16, // Bytes per element + 1, // Num components + false, // isSRGB + true, // isBC + false, // isSubsampled + false, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 127.0f, 0, 0, 0}, // To float scale factor + 4, // bcWidth + 4, // bcHeight }, // R16G16B16_FLOAT (0x19B) { "R16G16B16_FLOAT", - { SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 0 }, // Swizzle - { 16, 16, 16, 0 }, // Bits per component - 48, // Bits per element - 6, // Bytes per element - 3, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_FLOAT, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 0}, // Swizzle + {16, 16, 16, 0}, // Bits per component + 48, // Bits per element + 6, // Bytes per element + 3, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16G16B16_UNORM (0x19C) { "R16G16B16_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 0 }, // Swizzle - { 16, 16, 16, 0 }, // Bits per component - 48, // Bits per element - 6, // Bytes per element - 3, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, false }, // Is normalized? - { 1.0f / 65535.0f, 1.0f / 65535.0f, 1.0f / 65535.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 0}, // Swizzle + {16, 16, 16, 0}, // Bits per component + 48, // Bits per element + 6, // Bytes per element + 3, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, false}, // Is normalized? + {1.0f / 65535.0f, 1.0f / 65535.0f, 1.0f / 65535.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16G16B16_SNORM (0x19D) { "R16G16B16_SNORM", - { SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 0 }, // Swizzle - { 16, 16, 16, 0 }, // Bits per component - 48, // Bits per element - 6, // Bytes per element - 3, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, false }, // Is normalized? - { 1.0f / 32767.0f, 1.0f / 32767.0f, 1.0f / 32767.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 0}, // Swizzle + {16, 16, 16, 0}, // Bits per component + 48, // Bits per element + 6, // Bytes per element + 3, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, false}, // Is normalized? + {1.0f / 32767.0f, 1.0f / 32767.0f, 1.0f / 32767.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16G16B16_SSCALED (0x19E) { "R16G16B16_SSCALED", - { SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 0 }, // Swizzle - { 16, 16, 16, 0 }, // Bits per component - 48, // Bits per element - 6, // Bytes per element - 3, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 0}, // Swizzle + {16, 16, 16, 0}, // Bits per component + 48, // Bits per element + 6, // Bytes per element + 3, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16G16B16_USCALED (0x19F) { "R16G16B16_USCALED", - { SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 0 }, // Swizzle - { 16, 16, 16, 0 }, // Bits per component - 48, // Bits per element - 6, // Bytes per element - 3, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 0}, // Swizzle + {16, 16, 16, 0}, // Bits per component + 48, // Bits per element + 6, // Bytes per element + 3, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0x1A0) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // BC6H_SF16 (0x1A1) { "BC6H_SF16", - { SWR_TYPE_SNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 128, // Bits per element - 16, // Bytes per element - 1, // Num components - false, // isSRGB - true, // isBC - false, // isSubsampled - false, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 127.0f, 0, 0, 0 }, // To float scale factor - 4, // bcWidth - 4, // bcHeight + {SWR_TYPE_SNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 128, // Bits per element + 16, // Bytes per element + 1, // Num components + false, // isSRGB + true, // isBC + false, // isSubsampled + false, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 127.0f, 0, 0, 0}, // To float scale factor + 4, // bcWidth + 4, // bcHeight }, // BC7_UNORM (0x1A2) { "BC7_UNORM", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 128, // Bits per element - 16, // Bytes per element - 1, // Num components - false, // isSRGB - true, // isBC - false, // isSubsampled - false, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 255.0f, 0, 0, 0 }, // To float scale factor - 4, // bcWidth - 4, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 128, // Bits per element + 16, // Bytes per element + 1, // Num components + false, // isSRGB + true, // isBC + false, // isSubsampled + false, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 255.0f, 0, 0, 0}, // To float scale factor + 4, // bcWidth + 4, // bcHeight }, // BC7_UNORM_SRGB (0x1A3) { "BC7_UNORM_SRGB", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 128, // Bits per element - 16, // Bytes per element - 1, // Num components - true, // isSRGB - true, // isBC - false, // isSubsampled - false, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 255.0f, 0, 0, 0 }, // To float scale factor - 4, // bcWidth - 4, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 128, // Bits per element + 16, // Bytes per element + 1, // Num components + true, // isSRGB + true, // isBC + false, // isSubsampled + false, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 255.0f, 0, 0, 0}, // To float scale factor + 4, // bcWidth + 4, // bcHeight }, // BC6H_UF16 (0x1A4) { "BC6H_UF16", - { SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 8, 8, 8 }, // Bits per component - 128, // Bits per element - 16, // Bytes per element - 1, // Num components - false, // isSRGB - true, // isBC - false, // isSubsampled - false, // isLuminance - { true, false, false, false }, // Is normalized? - { 1.0f / 255.0f, 0, 0, 0 }, // To float scale factor - 4, // bcWidth - 4, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 8, 8, 8}, // Bits per component + 128, // Bits per element + 16, // Bytes per element + 1, // Num components + false, // isSRGB + true, // isBC + false, // isSubsampled + false, // isLuminance + {true, false, false, false}, // Is normalized? + {1.0f / 255.0f, 0, 0, 0}, // To float scale factor + 4, // bcWidth + 4, // bcHeight }, // padding (0x1A5) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1A6) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1A7) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // R8G8B8_UNORM_SRGB (0x1A8) { "R8G8B8_UNORM_SRGB", - { SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 0 }, // Swizzle - { 8, 8, 8, 0 }, // Bits per component - 24, // Bits per element - 3, // Bytes per element - 3, // Num components - true, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, false }, // Is normalized? - { 1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNORM, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 0}, // Swizzle + {8, 8, 8, 0}, // Bits per component + 24, // Bits per element + 3, // Bytes per element + 3, // Num components + true, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, false}, // Is normalized? + {1.0f / 255.0f, 1.0f / 255.0f, 1.0f / 255.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0x1A9) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1AA) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1AB) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1AC) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1AD) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1AE) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1AF) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // R16G16B16_UINT (0x1B0) { "R16G16B16_UINT", - { SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 2, 0 }, // Swizzle - { 16, 16, 16, 0 }, // Bits per component - 48, // Bits per element - 6, // Bytes per element - 3, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 2, 0}, // Swizzle + {16, 16, 16, 0}, // Bits per component + 48, // Bits per element + 6, // Bytes per element + 3, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R16G16B16_SINT (0x1B1) { "R16G16B16_SINT", - { SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 2, 0 }, // Swizzle - { 16, 16, 16, 0 }, // Bits per component - 48, // Bits per element - 6, // Bytes per element - 3, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 2, 0}, // Swizzle + {16, 16, 16, 0}, // Bits per component + 48, // Bits per element + 6, // Bytes per element + 3, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R32_SFIXED (0x1B2) { "R32_SFIXED", - { SWR_TYPE_SFIXED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 0, 0, 0 }, // Swizzle - { 32, 0, 0, 0 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SFIXED, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 0, 0, 0}, // Swizzle + {32, 0, 0, 0}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R10G10B10A2_SNORM (0x1B3) { "R10G10B10A2_SNORM", - { SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_SNORM }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 10, 10, 10, 2 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, true }, // Is normalized? - { 1.0f / 511.0f, 1.0f / 511.0f, 1.0f / 511.0f, 1.0f / 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_SNORM}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {10, 10, 10, 2}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, true}, // Is normalized? + {1.0f / 511.0f, 1.0f / 511.0f, 1.0f / 511.0f, 1.0f / 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R10G10B10A2_USCALED (0x1B4) { "R10G10B10A2_USCALED", - { SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 10, 10, 10, 2 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {10, 10, 10, 2}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R10G10B10A2_SSCALED (0x1B5) { "R10G10B10A2_SSCALED", - { SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 10, 10, 10, 2 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {10, 10, 10, 2}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R10G10B10A2_SINT (0x1B6) { "R10G10B10A2_SINT", - { SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 10, 10, 10, 2 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {10, 10, 10, 2}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // B10G10R10A2_SNORM (0x1B7) { "B10G10R10A2_SNORM", - { SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_SNORM }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 2, 1, 0, 3 }, // Swizzle - { 10, 10, 10, 2 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { true, true, true, true }, // Is normalized? - { 1.0f / 511.0f, 1.0f / 511.0f, 1.0f / 511.0f, 1.0f / 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_SNORM, SWR_TYPE_SNORM}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {2, 1, 0, 3}, // Swizzle + {10, 10, 10, 2}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {true, true, true, true}, // Is normalized? + {1.0f / 511.0f, 1.0f / 511.0f, 1.0f / 511.0f, 1.0f / 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // B10G10R10A2_USCALED (0x1B8) { "B10G10R10A2_USCALED", - { SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 2, 1, 0, 3 }, // Swizzle - { 10, 10, 10, 2 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED, SWR_TYPE_USCALED}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {2, 1, 0, 3}, // Swizzle + {10, 10, 10, 2}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // B10G10R10A2_SSCALED (0x1B9) { "B10G10R10A2_SSCALED", - { SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED }, - { 0, 0, 0, 0x3f800000 }, // Defaults for missing components - { 2, 1, 0, 3 }, // Swizzle - { 10, 10, 10, 2 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED, SWR_TYPE_SSCALED}, + {0, 0, 0, 0x3f800000}, // Defaults for missing components + {2, 1, 0, 3}, // Swizzle + {10, 10, 10, 2}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // B10G10R10A2_UINT (0x1BA) { "B10G10R10A2_UINT", - { SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 2, 1, 0, 3 }, // Swizzle - { 10, 10, 10, 2 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT}, + {0, 0, 0, 0x1}, // Defaults for missing components + {2, 1, 0, 3}, // Swizzle + {10, 10, 10, 2}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // B10G10R10A2_SINT (0x1BB) { "B10G10R10A2_SINT", - { SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 2, 1, 0, 3 }, // Swizzle - { 10, 10, 10, 2 }, // Bits per component - 32, // Bits per element - 4, // Bytes per element - 4, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 1.0f }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT}, + {0, 0, 0, 0x1}, // Defaults for missing components + {2, 1, 0, 3}, // Swizzle + {10, 10, 10, 2}, // Bits per component + 32, // Bits per element + 4, // Bytes per element + 4, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 1.0f}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0x1BC) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1BD) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1BE) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1BF) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1C0) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1C1) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1C2) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1C3) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1C4) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1C5) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1C6) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1C7) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // R8G8B8_UINT (0x1C8) { "R8G8B8_UINT", - { SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 2, 0 }, // Swizzle - { 8, 8, 8, 0 }, // Bits per component - 24, // Bits per element - 3, // Bytes per element - 3, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UINT, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 2, 0}, // Swizzle + {8, 8, 8, 0}, // Bits per component + 24, // Bits per element + 3, // Bytes per element + 3, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // R8G8B8_SINT (0x1C9) { "R8G8B8_SINT", - { SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 2, 0 }, // Swizzle - { 8, 8, 8, 0 }, // Bits per component - 24, // Bits per element - 3, // Bytes per element - 3, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 1.0f, 1.0f, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_SINT, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 2, 0}, // Swizzle + {8, 8, 8, 0}, // Bits per component + 24, // Bits per element + 3, // Bytes per element + 3, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 1.0f, 1.0f, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, // padding (0x1CA) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1CB) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1CC) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1CD) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1CE) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1CF) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1D0) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1D1) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1D2) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1D3) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1D4) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1D5) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1D6) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1D7) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1D8) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1D9) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1DA) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1DB) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1DC) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1DD) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1DE) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1DF) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1E0) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1E1) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1E2) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1E3) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1E4) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1E5) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1E6) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1E7) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1E8) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1E9) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1EA) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1EB) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1EC) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1ED) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1EE) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1EF) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1F0) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1F1) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1F2) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1F3) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1F4) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1F5) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1F6) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1F7) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1F8) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1F9) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1FA) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1FB) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1FC) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1FD) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // padding (0x1FE) - { - nullptr, - { SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 }, - 0, 0, 0, false, false, false, false, - { false, false, false, false }, - { 0.0f, 0.0f, 0.0f, 0.0f }, - 1, 1 - }, + {nullptr, + {SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + 0, + 0, + false, + false, + false, + false, + {false, false, false, false}, + {0.0f, 0.0f, 0.0f, 0.0f}, + 1, + 1}, // RAW (0x1FF) { "RAW", - { SWR_TYPE_UINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN }, - { 0, 0, 0, 0x1 }, // Defaults for missing components - { 0, 1, 2, 3 }, // Swizzle - { 8, 0, 0, 0 }, // Bits per component - 8, // Bits per element - 1, // Bytes per element - 1, // Num components - false, // isSRGB - false, // isBC - false, // isSubsampled - false, // isLuminance - { false, false, false, false }, // Is normalized? - { 1.0f, 0, 0, 0 }, // To float scale factor - 1, // bcWidth - 1, // bcHeight + {SWR_TYPE_UINT, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN, SWR_TYPE_UNKNOWN}, + {0, 0, 0, 0x1}, // Defaults for missing components + {0, 1, 2, 3}, // Swizzle + {8, 0, 0, 0}, // Bits per component + 8, // Bits per element + 1, // Bytes per element + 1, // Num components + false, // isSRGB + false, // isBC + false, // isSubsampled + false, // isLuminance + {false, false, false, false}, // Is normalized? + {1.0f, 0, 0, 0}, // To float scale factor + 1, // bcWidth + 1, // bcHeight }, }; - diff --git a/src/gallium/drivers/swr/rasterizer/common/formats.h b/src/gallium/drivers/swr/rasterizer/common/formats.h index f13f338f8b1..b7a3e533d15 100644 --- a/src/gallium/drivers/swr/rasterizer/common/formats.h +++ b/src/gallium/drivers/swr/rasterizer/common/formats.h @@ -1,32 +1,32 @@ /**************************************************************************** -* Copyright (C) 2016 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -* -* @file formats.h -* -* @brief auto-generated file -* -* DO NOT EDIT -* -******************************************************************************/ + * Copyright (C) 2016 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * @file formats.h + * + * @brief auto-generated file + * + * DO NOT EDIT + * + ******************************************************************************/ #pragma once @@ -54,179 +54,179 @@ enum SWR_TYPE ////////////////////////////////////////////////////////////////////////// enum SWR_FORMAT { - R32G32B32A32_FLOAT = 0x0, - R32G32B32A32_SINT = 0x1, - R32G32B32A32_UINT = 0x2, - R64G64_FLOAT = 0x5, - R32G32B32X32_FLOAT = 0x6, - R32G32B32A32_SSCALED = 0x7, - R32G32B32A32_USCALED = 0x8, - R32G32B32A32_SFIXED = 0x20, - R32G32B32_FLOAT = 0x40, - R32G32B32_SINT = 0x41, - R32G32B32_UINT = 0x42, - R32G32B32_SSCALED = 0x45, - R32G32B32_USCALED = 0x46, - R32G32B32_SFIXED = 0x50, - R16G16B16A16_UNORM = 0x80, - R16G16B16A16_SNORM = 0x81, - R16G16B16A16_SINT = 0x82, - R16G16B16A16_UINT = 0x83, - R16G16B16A16_FLOAT = 0x84, - R32G32_FLOAT = 0x85, - R32G32_SINT = 0x86, - R32G32_UINT = 0x87, - R32_FLOAT_X8X24_TYPELESS = 0x88, - X32_TYPELESS_G8X24_UINT = 0x89, - L32A32_FLOAT = 0x8A, - R64_FLOAT = 0x8D, - R16G16B16X16_UNORM = 0x8E, - R16G16B16X16_FLOAT = 0x8F, - L32X32_FLOAT = 0x91, - I32X32_FLOAT = 0x92, - R16G16B16A16_SSCALED = 0x93, - R16G16B16A16_USCALED = 0x94, - R32G32_SSCALED = 0x95, - R32G32_USCALED = 0x96, - R32G32_SFIXED = 0xA0, - B8G8R8A8_UNORM = 0xC0, - B8G8R8A8_UNORM_SRGB = 0xC1, - R10G10B10A2_UNORM = 0xC2, - R10G10B10A2_UNORM_SRGB = 0xC3, - R10G10B10A2_UINT = 0xC4, - R8G8B8A8_UNORM = 0xC7, - R8G8B8A8_UNORM_SRGB = 0xC8, - R8G8B8A8_SNORM = 0xC9, - R8G8B8A8_SINT = 0xCA, - R8G8B8A8_UINT = 0xCB, - R16G16_UNORM = 0xCC, - R16G16_SNORM = 0xCD, - R16G16_SINT = 0xCE, - R16G16_UINT = 0xCF, - R16G16_FLOAT = 0xD0, - B10G10R10A2_UNORM = 0xD1, - B10G10R10A2_UNORM_SRGB = 0xD2, - R11G11B10_FLOAT = 0xD3, - R10G10B10_FLOAT_A2_UNORM = 0xD5, - R32_SINT = 0xD6, - R32_UINT = 0xD7, - R32_FLOAT = 0xD8, - R24_UNORM_X8_TYPELESS = 0xD9, - X24_TYPELESS_G8_UINT = 0xDA, - L32_UNORM = 0xDD, - L16A16_UNORM = 0xDF, - I24X8_UNORM = 0xE0, - L24X8_UNORM = 0xE1, - I32_FLOAT = 0xE3, - L32_FLOAT = 0xE4, - A32_FLOAT = 0xE5, - B8G8R8X8_UNORM = 0xE9, - B8G8R8X8_UNORM_SRGB = 0xEA, - R8G8B8X8_UNORM = 0xEB, - R8G8B8X8_UNORM_SRGB = 0xEC, - R9G9B9E5_SHAREDEXP = 0xED, - B10G10R10X2_UNORM = 0xEE, - L16A16_FLOAT = 0xF0, - R10G10B10X2_USCALED = 0xF3, - R8G8B8A8_SSCALED = 0xF4, - R8G8B8A8_USCALED = 0xF5, - R16G16_SSCALED = 0xF6, - R16G16_USCALED = 0xF7, - R32_SSCALED = 0xF8, - R32_USCALED = 0xF9, - B5G6R5_UNORM = 0x100, - B5G6R5_UNORM_SRGB = 0x101, - B5G5R5A1_UNORM = 0x102, - B5G5R5A1_UNORM_SRGB = 0x103, - B4G4R4A4_UNORM = 0x104, - B4G4R4A4_UNORM_SRGB = 0x105, - R8G8_UNORM = 0x106, - R8G8_SNORM = 0x107, - R8G8_SINT = 0x108, - R8G8_UINT = 0x109, - R16_UNORM = 0x10A, - R16_SNORM = 0x10B, - R16_SINT = 0x10C, - R16_UINT = 0x10D, - R16_FLOAT = 0x10E, - I16_UNORM = 0x111, - L16_UNORM = 0x112, - A16_UNORM = 0x113, - L8A8_UNORM = 0x114, - I16_FLOAT = 0x115, - L16_FLOAT = 0x116, - A16_FLOAT = 0x117, - L8A8_UNORM_SRGB = 0x118, - B5G5R5X1_UNORM = 0x11A, - B5G5R5X1_UNORM_SRGB = 0x11B, - R8G8_SSCALED = 0x11C, - R8G8_USCALED = 0x11D, - R16_SSCALED = 0x11E, - R16_USCALED = 0x11F, - A1B5G5R5_UNORM = 0x124, - A4B4G4R4_UNORM = 0x125, - L8A8_UINT = 0x126, - L8A8_SINT = 0x127, - R8_UNORM = 0x140, - R8_SNORM = 0x141, - R8_SINT = 0x142, - R8_UINT = 0x143, - A8_UNORM = 0x144, - I8_UNORM = 0x145, - L8_UNORM = 0x146, - R8_SSCALED = 0x149, - R8_USCALED = 0x14A, - L8_UNORM_SRGB = 0x14C, - L8_UINT = 0x152, - L8_SINT = 0x153, - I8_UINT = 0x154, - I8_SINT = 0x155, - DXT1_RGB_SRGB = 0x180, - YCRCB_SWAPUVY = 0x183, - BC1_UNORM = 0x186, - BC2_UNORM = 0x187, - BC3_UNORM = 0x188, - BC4_UNORM = 0x189, - BC5_UNORM = 0x18A, - BC1_UNORM_SRGB = 0x18B, - BC2_UNORM_SRGB = 0x18C, - BC3_UNORM_SRGB = 0x18D, - YCRCB_SWAPUV = 0x18F, - DXT1_RGB = 0x191, - R8G8B8_UNORM = 0x193, - R8G8B8_SNORM = 0x194, - R8G8B8_SSCALED = 0x195, - R8G8B8_USCALED = 0x196, - R64G64B64A64_FLOAT = 0x197, - R64G64B64_FLOAT = 0x198, - BC4_SNORM = 0x199, - BC5_SNORM = 0x19A, - R16G16B16_FLOAT = 0x19B, - R16G16B16_UNORM = 0x19C, - R16G16B16_SNORM = 0x19D, - R16G16B16_SSCALED = 0x19E, - R16G16B16_USCALED = 0x19F, - BC6H_SF16 = 0x1A1, - BC7_UNORM = 0x1A2, - BC7_UNORM_SRGB = 0x1A3, - BC6H_UF16 = 0x1A4, - R8G8B8_UNORM_SRGB = 0x1A8, - R16G16B16_UINT = 0x1B0, - R16G16B16_SINT = 0x1B1, - R32_SFIXED = 0x1B2, - R10G10B10A2_SNORM = 0x1B3, - R10G10B10A2_USCALED = 0x1B4, - R10G10B10A2_SSCALED = 0x1B5, - R10G10B10A2_SINT = 0x1B6, - B10G10R10A2_SNORM = 0x1B7, - B10G10R10A2_USCALED = 0x1B8, - B10G10R10A2_SSCALED = 0x1B9, - B10G10R10A2_UINT = 0x1BA, - B10G10R10A2_SINT = 0x1BB, - R8G8B8_UINT = 0x1C8, - R8G8B8_SINT = 0x1C9, - RAW = 0x1FF, - NUM_SWR_FORMATS = 0x200, + R32G32B32A32_FLOAT = 0x0, + R32G32B32A32_SINT = 0x1, + R32G32B32A32_UINT = 0x2, + R64G64_FLOAT = 0x5, + R32G32B32X32_FLOAT = 0x6, + R32G32B32A32_SSCALED = 0x7, + R32G32B32A32_USCALED = 0x8, + R32G32B32A32_SFIXED = 0x20, + R32G32B32_FLOAT = 0x40, + R32G32B32_SINT = 0x41, + R32G32B32_UINT = 0x42, + R32G32B32_SSCALED = 0x45, + R32G32B32_USCALED = 0x46, + R32G32B32_SFIXED = 0x50, + R16G16B16A16_UNORM = 0x80, + R16G16B16A16_SNORM = 0x81, + R16G16B16A16_SINT = 0x82, + R16G16B16A16_UINT = 0x83, + R16G16B16A16_FLOAT = 0x84, + R32G32_FLOAT = 0x85, + R32G32_SINT = 0x86, + R32G32_UINT = 0x87, + R32_FLOAT_X8X24_TYPELESS = 0x88, + X32_TYPELESS_G8X24_UINT = 0x89, + L32A32_FLOAT = 0x8A, + R64_FLOAT = 0x8D, + R16G16B16X16_UNORM = 0x8E, + R16G16B16X16_FLOAT = 0x8F, + L32X32_FLOAT = 0x91, + I32X32_FLOAT = 0x92, + R16G16B16A16_SSCALED = 0x93, + R16G16B16A16_USCALED = 0x94, + R32G32_SSCALED = 0x95, + R32G32_USCALED = 0x96, + R32G32_SFIXED = 0xA0, + B8G8R8A8_UNORM = 0xC0, + B8G8R8A8_UNORM_SRGB = 0xC1, + R10G10B10A2_UNORM = 0xC2, + R10G10B10A2_UNORM_SRGB = 0xC3, + R10G10B10A2_UINT = 0xC4, + R8G8B8A8_UNORM = 0xC7, + R8G8B8A8_UNORM_SRGB = 0xC8, + R8G8B8A8_SNORM = 0xC9, + R8G8B8A8_SINT = 0xCA, + R8G8B8A8_UINT = 0xCB, + R16G16_UNORM = 0xCC, + R16G16_SNORM = 0xCD, + R16G16_SINT = 0xCE, + R16G16_UINT = 0xCF, + R16G16_FLOAT = 0xD0, + B10G10R10A2_UNORM = 0xD1, + B10G10R10A2_UNORM_SRGB = 0xD2, + R11G11B10_FLOAT = 0xD3, + R10G10B10_FLOAT_A2_UNORM = 0xD5, + R32_SINT = 0xD6, + R32_UINT = 0xD7, + R32_FLOAT = 0xD8, + R24_UNORM_X8_TYPELESS = 0xD9, + X24_TYPELESS_G8_UINT = 0xDA, + L32_UNORM = 0xDD, + L16A16_UNORM = 0xDF, + I24X8_UNORM = 0xE0, + L24X8_UNORM = 0xE1, + I32_FLOAT = 0xE3, + L32_FLOAT = 0xE4, + A32_FLOAT = 0xE5, + B8G8R8X8_UNORM = 0xE9, + B8G8R8X8_UNORM_SRGB = 0xEA, + R8G8B8X8_UNORM = 0xEB, + R8G8B8X8_UNORM_SRGB = 0xEC, + R9G9B9E5_SHAREDEXP = 0xED, + B10G10R10X2_UNORM = 0xEE, + L16A16_FLOAT = 0xF0, + R10G10B10X2_USCALED = 0xF3, + R8G8B8A8_SSCALED = 0xF4, + R8G8B8A8_USCALED = 0xF5, + R16G16_SSCALED = 0xF6, + R16G16_USCALED = 0xF7, + R32_SSCALED = 0xF8, + R32_USCALED = 0xF9, + B5G6R5_UNORM = 0x100, + B5G6R5_UNORM_SRGB = 0x101, + B5G5R5A1_UNORM = 0x102, + B5G5R5A1_UNORM_SRGB = 0x103, + B4G4R4A4_UNORM = 0x104, + B4G4R4A4_UNORM_SRGB = 0x105, + R8G8_UNORM = 0x106, + R8G8_SNORM = 0x107, + R8G8_SINT = 0x108, + R8G8_UINT = 0x109, + R16_UNORM = 0x10A, + R16_SNORM = 0x10B, + R16_SINT = 0x10C, + R16_UINT = 0x10D, + R16_FLOAT = 0x10E, + I16_UNORM = 0x111, + L16_UNORM = 0x112, + A16_UNORM = 0x113, + L8A8_UNORM = 0x114, + I16_FLOAT = 0x115, + L16_FLOAT = 0x116, + A16_FLOAT = 0x117, + L8A8_UNORM_SRGB = 0x118, + B5G5R5X1_UNORM = 0x11A, + B5G5R5X1_UNORM_SRGB = 0x11B, + R8G8_SSCALED = 0x11C, + R8G8_USCALED = 0x11D, + R16_SSCALED = 0x11E, + R16_USCALED = 0x11F, + A1B5G5R5_UNORM = 0x124, + A4B4G4R4_UNORM = 0x125, + L8A8_UINT = 0x126, + L8A8_SINT = 0x127, + R8_UNORM = 0x140, + R8_SNORM = 0x141, + R8_SINT = 0x142, + R8_UINT = 0x143, + A8_UNORM = 0x144, + I8_UNORM = 0x145, + L8_UNORM = 0x146, + R8_SSCALED = 0x149, + R8_USCALED = 0x14A, + L8_UNORM_SRGB = 0x14C, + L8_UINT = 0x152, + L8_SINT = 0x153, + I8_UINT = 0x154, + I8_SINT = 0x155, + DXT1_RGB_SRGB = 0x180, + YCRCB_SWAPUVY = 0x183, + BC1_UNORM = 0x186, + BC2_UNORM = 0x187, + BC3_UNORM = 0x188, + BC4_UNORM = 0x189, + BC5_UNORM = 0x18A, + BC1_UNORM_SRGB = 0x18B, + BC2_UNORM_SRGB = 0x18C, + BC3_UNORM_SRGB = 0x18D, + YCRCB_SWAPUV = 0x18F, + DXT1_RGB = 0x191, + R8G8B8_UNORM = 0x193, + R8G8B8_SNORM = 0x194, + R8G8B8_SSCALED = 0x195, + R8G8B8_USCALED = 0x196, + R64G64B64A64_FLOAT = 0x197, + R64G64B64_FLOAT = 0x198, + BC4_SNORM = 0x199, + BC5_SNORM = 0x19A, + R16G16B16_FLOAT = 0x19B, + R16G16B16_UNORM = 0x19C, + R16G16B16_SNORM = 0x19D, + R16G16B16_SSCALED = 0x19E, + R16G16B16_USCALED = 0x19F, + BC6H_SF16 = 0x1A1, + BC7_UNORM = 0x1A2, + BC7_UNORM_SRGB = 0x1A3, + BC6H_UF16 = 0x1A4, + R8G8B8_UNORM_SRGB = 0x1A8, + R16G16B16_UINT = 0x1B0, + R16G16B16_SINT = 0x1B1, + R32_SFIXED = 0x1B2, + R10G10B10A2_SNORM = 0x1B3, + R10G10B10A2_USCALED = 0x1B4, + R10G10B10A2_SSCALED = 0x1B5, + R10G10B10A2_SINT = 0x1B6, + B10G10R10A2_SNORM = 0x1B7, + B10G10R10A2_USCALED = 0x1B8, + B10G10R10A2_SSCALED = 0x1B9, + B10G10R10A2_UINT = 0x1BA, + B10G10R10A2_SINT = 0x1BB, + R8G8B8_UINT = 0x1C8, + R8G8B8_SINT = 0x1C9, + RAW = 0x1FF, + NUM_SWR_FORMATS = 0x200, }; ////////////////////////////////////////////////////////////////////////// @@ -266,4 +266,3 @@ INLINE const SWR_FORMAT_INFO& GetFormatInfo(SWR_FORMAT format) // lookup table for unorm8 srgb -> float conversion extern const uint32_t srgb8Table[256]; - diff --git a/src/gallium/drivers/swr/rasterizer/common/intrin.h b/src/gallium/drivers/swr/rasterizer/common/intrin.h index 59d66bc60a8..4c413caf441 100644 --- a/src/gallium/drivers/swr/rasterizer/common/intrin.h +++ b/src/gallium/drivers/swr/rasterizer/common/intrin.h @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2014-2015 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2014-2015 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #ifndef __SWR_INTRIN_H__ #define __SWR_INTRIN_H__ @@ -28,34 +28,34 @@ #if !defined(SIMD_ARCH) #define SIMD_ARCH KNOB_ARCH -#endif +#endif #include "simdlib_types.hpp" -typedef SIMDImpl::SIMD128Impl::Float simd4scalar; -typedef SIMDImpl::SIMD128Impl::Double simd4scalard; -typedef SIMDImpl::SIMD128Impl::Integer simd4scalari; -typedef SIMDImpl::SIMD128Impl::Vec4 simd4vector; -typedef SIMDImpl::SIMD128Impl::Mask simd4mask; - -typedef SIMDImpl::SIMD256Impl::Float simd8scalar; -typedef SIMDImpl::SIMD256Impl::Double simd8scalard; -typedef SIMDImpl::SIMD256Impl::Integer simd8scalari; -typedef SIMDImpl::SIMD256Impl::Vec4 simd8vector; -typedef SIMDImpl::SIMD256Impl::Mask simd8mask; - -typedef SIMDImpl::SIMD512Impl::Float simd16scalar; -typedef SIMDImpl::SIMD512Impl::Double simd16scalard; -typedef SIMDImpl::SIMD512Impl::Integer simd16scalari; -typedef SIMDImpl::SIMD512Impl::Vec4 simd16vector; -typedef SIMDImpl::SIMD512Impl::Mask simd16mask; - -#if KNOB_SIMD_WIDTH == 8 -typedef simd8scalar simdscalar; -typedef simd8scalard simdscalard; -typedef simd8scalari simdscalari; -typedef simd8vector simdvector; -typedef simd8mask simdmask; +typedef SIMDImpl::SIMD128Impl::Float simd4scalar; +typedef SIMDImpl::SIMD128Impl::Double simd4scalard; +typedef SIMDImpl::SIMD128Impl::Integer simd4scalari; +typedef SIMDImpl::SIMD128Impl::Vec4 simd4vector; +typedef SIMDImpl::SIMD128Impl::Mask simd4mask; + +typedef SIMDImpl::SIMD256Impl::Float simd8scalar; +typedef SIMDImpl::SIMD256Impl::Double simd8scalard; +typedef SIMDImpl::SIMD256Impl::Integer simd8scalari; +typedef SIMDImpl::SIMD256Impl::Vec4 simd8vector; +typedef SIMDImpl::SIMD256Impl::Mask simd8mask; + +typedef SIMDImpl::SIMD512Impl::Float simd16scalar; +typedef SIMDImpl::SIMD512Impl::Double simd16scalard; +typedef SIMDImpl::SIMD512Impl::Integer simd16scalari; +typedef SIMDImpl::SIMD512Impl::Vec4 simd16vector; +typedef SIMDImpl::SIMD512Impl::Mask simd16mask; + +#if KNOB_SIMD_WIDTH == 8 +typedef simd8scalar simdscalar; +typedef simd8scalard simdscalard; +typedef simd8scalari simdscalari; +typedef simd8vector simdvector; +typedef simd8mask simdmask; #else #error Unsupported vector width #endif @@ -68,7 +68,7 @@ UINT pdep_u32(UINT a, UINT mask) #else UINT result = 0; - // copied from http://wm.ite.pl/articles/pdep-soft-emu.html + // copied from http://wm.ite.pl/articles/pdep-soft-emu.html // using bsf instead of funky loop DWORD maskIndex; while (_BitScanForward(&maskIndex, mask)) @@ -99,8 +99,8 @@ UINT pext_u32(UINT a, UINT mask) #if KNOB_ARCH >= KNOB_ARCH_AVX2 return _pext_u32(a, mask); #else - UINT result = 0; - DWORD maskIndex; + UINT result = 0; + DWORD maskIndex; uint32_t currentBit = 0; while (_BitScanForward(&maskIndex, mask)) { @@ -117,4 +117,4 @@ UINT pext_u32(UINT a, UINT mask) #endif } -#endif//__SWR_INTRIN_H__ +#endif //__SWR_INTRIN_H__ diff --git a/src/gallium/drivers/swr/rasterizer/common/isa.hpp b/src/gallium/drivers/swr/rasterizer/common/isa.hpp index a62350f2b60..aea5740bb66 100644 --- a/src/gallium/drivers/swr/rasterizer/common/isa.hpp +++ b/src/gallium/drivers/swr/rasterizer/common/isa.hpp @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2014-2015 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2014-2015 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #pragma once @@ -44,7 +44,7 @@ class InstructionSet { public: - InstructionSet() : CPU_Rep() {}; + InstructionSet() : CPU_Rep(){}; // getters std::string Vendor(void) { return CPU_Rep.vendor_; } @@ -113,21 +113,11 @@ private: class InstructionSet_Internal { public: - InstructionSet_Internal() - : nIds_{ 0 }, - nExIds_{ 0 }, - isIntel_{ false }, - isAMD_{ false }, - f_1_ECX_{ 0 }, - f_1_EDX_{ 0 }, - f_7_EBX_{ 0 }, - f_7_ECX_{ 0 }, - f_81_ECX_{ 0 }, - f_81_EDX_{ 0 }, - data_{}, - extdata_{} + InstructionSet_Internal() : + nIds_{0}, nExIds_{0}, isIntel_{false}, isAMD_{false}, f_1_ECX_{0}, f_1_EDX_{0}, + f_7_EBX_{0}, f_7_ECX_{0}, f_81_ECX_{0}, f_81_EDX_{0}, data_{}, extdata_{} { - //int cpuInfo[4] = {-1}; + // int cpuInfo[4] = {-1}; std::array<int, 4> cpui; // Calling __cpuid with 0x0 as the function_id argument @@ -144,7 +134,7 @@ private: #if defined(_MSC_VER) && !defined(__clang__) __cpuidex(cpui.data(), i, 0); #else - int *data = cpui.data(); + int* data = cpui.data(); __cpuid_count(i, 0, data[0], data[1], data[2], data[3]); #endif data_.push_back(cpui); @@ -153,10 +143,10 @@ private: // Capture vendor string char vendor[0x20]; memset(vendor, 0, sizeof(vendor)); - *reinterpret_cast<int*>(vendor) = data_[0][1]; + *reinterpret_cast<int*>(vendor) = data_[0][1]; *reinterpret_cast<int*>(vendor + 4) = data_[0][3]; *reinterpret_cast<int*>(vendor + 8) = data_[0][2]; - vendor_ = vendor; + vendor_ = vendor; if (vendor_ == "GenuineIntel") { isIntel_ = true; @@ -197,7 +187,7 @@ private: #if defined(_MSC_VER) && !defined(__clang__) __cpuidex(cpui.data(), i, 0); #else - int *data = cpui.data(); + int* data = cpui.data(); __cpuid_count(i, 0, data[0], data[1], data[2], data[3]); #endif extdata_.push_back(cpui); @@ -220,18 +210,18 @@ private: } }; - int nIds_; - unsigned nExIds_; - std::string vendor_; - std::string brand_; - bool isIntel_; - bool isAMD_; - std::bitset<32> f_1_ECX_; - std::bitset<32> f_1_EDX_; - std::bitset<32> f_7_EBX_; - std::bitset<32> f_7_ECX_; - std::bitset<32> f_81_ECX_; - std::bitset<32> f_81_EDX_; + int nIds_; + unsigned nExIds_; + std::string vendor_; + std::string brand_; + bool isIntel_; + bool isAMD_; + std::bitset<32> f_1_ECX_; + std::bitset<32> f_1_EDX_; + std::bitset<32> f_7_EBX_; + std::bitset<32> f_7_ECX_; + std::bitset<32> f_81_ECX_; + std::bitset<32> f_81_EDX_; std::vector<std::array<int, 4>> data_; std::vector<std::array<int, 4>> extdata_; }; diff --git a/src/gallium/drivers/swr/rasterizer/common/os.cpp b/src/gallium/drivers/swr/rasterizer/common/os.cpp index 2d97270b997..aa817d451b4 100644 --- a/src/gallium/drivers/swr/rasterizer/common/os.cpp +++ b/src/gallium/drivers/swr/rasterizer/common/os.cpp @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2017 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2017 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #include "common/os.h" #include <vector> @@ -34,28 +34,26 @@ #include <pthread.h> #endif // Linux - - #if defined(_WIN32) static const DWORD MS_VC_EXCEPTION = 0x406D1388; -#pragma pack(push,8) +#pragma pack(push, 8) typedef struct tagTHREADNAME_INFO { - DWORD dwType; // Must be 0x1000. - LPCSTR szName; // Pointer to name (in user addr space). - DWORD dwThreadID; // Thread ID (-1=caller thread). - DWORD dwFlags; // Reserved for future use, must be zero. + DWORD dwType; // Must be 0x1000. + LPCSTR szName; // Pointer to name (in user addr space). + DWORD dwThreadID; // Thread ID (-1=caller thread). + DWORD dwFlags; // Reserved for future use, must be zero. } THREADNAME_INFO; #pragma pack(pop) void LegacySetThreadName(const char* pThreadName) { THREADNAME_INFO info; - info.dwType = 0x1000; - info.szName = pThreadName; + info.dwType = 0x1000; + info.szName = pThreadName; info.dwThreadID = GetCurrentThreadId(); - info.dwFlags = 0; + info.dwFlags = 0; if (!IsDebuggerPresent()) { @@ -63,14 +61,16 @@ void LegacySetThreadName(const char* pThreadName) return; } -#pragma warning(push) -#pragma warning(disable: 6320 6322) - __try { +#pragma warning(push) +#pragma warning(disable : 6320 6322) + __try + { RaiseException(MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(ULONG_PTR), (ULONG_PTR*)&info); } - __except (EXCEPTION_EXECUTE_HANDLER) { + __except (EXCEPTION_EXECUTE_HANDLER) + { } -#pragma warning(pop) +#pragma warning(pop) } #endif // _WIN32 @@ -78,23 +78,21 @@ void SWR_API SetCurrentThreadName(const char* pThreadName) { #if defined(_WIN32) // The SetThreadDescription API was brought in version 1607 of Windows 10. - typedef HRESULT(WINAPI* PFNSetThreadDescription)(HANDLE hThread, PCWSTR lpThreadDescription); + typedef HRESULT(WINAPI * PFNSetThreadDescription)(HANDLE hThread, PCWSTR lpThreadDescription); // The SetThreadDescription API works even if no debugger is attached. - auto pfnSetThreadDescription = - reinterpret_cast<PFNSetThreadDescription>( - GetProcAddress(GetModuleHandleA("Kernel32.dll"), "SetThreadDescription")); + auto pfnSetThreadDescription = reinterpret_cast<PFNSetThreadDescription>( + GetProcAddress(GetModuleHandleA("Kernel32.dll"), "SetThreadDescription")); if (!pfnSetThreadDescription) { // try KernelBase.dll - pfnSetThreadDescription = - reinterpret_cast<PFNSetThreadDescription>( - GetProcAddress(GetModuleHandleA("KernelBase.dll"), "SetThreadDescription")); + pfnSetThreadDescription = reinterpret_cast<PFNSetThreadDescription>( + GetProcAddress(GetModuleHandleA("KernelBase.dll"), "SetThreadDescription")); } if (pfnSetThreadDescription) { - std::string utf8Name = pThreadName; + std::string utf8Name = pThreadName; std::wstring wideName; wideName.resize(utf8Name.size() + 1); swprintf_s(&(wideName.front()), wideName.size(), L"%S", utf8Name.c_str()); @@ -113,12 +111,13 @@ void SWR_API SetCurrentThreadName(const char* pThreadName) #endif // Linux } -static void SplitString(std::vector<std::string>& out_segments, const std::string& input, char splitToken) +static void +SplitString(std::vector<std::string>& out_segments, const std::string& input, char splitToken) { out_segments.clear(); std::istringstream f(input); - std::string s; + std::string s; while (std::getline(f, s, splitToken)) { if (s.size()) @@ -155,12 +154,11 @@ void SWR_API CreateDirectoryPath(const std::string& path) /// Execute Command (block until finished) /// @returns process exit value -int SWR_API ExecCmd( - const std::string& cmd, ///< (In) Command line string - const char* pOptEnvStrings, ///< (Optional In) Environment block for new process - std::string* pOptStdOut, ///< (Optional Out) Standard Output text - std::string* pOptStdErr, ///< (Optional Out) Standard Error text - const std::string* pOptStdIn) ///< (Optional In) Standard Input text +int SWR_API ExecCmd(const std::string& cmd, ///< (In) Command line string + const char* pOptEnvStrings, ///< (Optional In) Environment block for new process + std::string* pOptStdOut, ///< (Optional Out) Standard Output text + std::string* pOptStdErr, ///< (Optional Out) Standard Error text + const std::string* pOptStdIn) ///< (Optional In) Standard Input text { int rvalue = -1; @@ -172,8 +170,8 @@ int SWR_API ExecCmd( }; std::array<WinPipe, 3> hPipes = {}; - SECURITY_ATTRIBUTES saAttr = { sizeof(SECURITY_ATTRIBUTES) }; - saAttr.bInheritHandle = TRUE; //Pipe handles are inherited by child process. + SECURITY_ATTRIBUTES saAttr = {sizeof(SECURITY_ATTRIBUTES)}; + saAttr.bInheritHandle = TRUE; // Pipe handles are inherited by child process. saAttr.lpSecurityDescriptor = NULL; { @@ -198,7 +196,7 @@ int SWR_API ExecCmd( } STARTUPINFOA StartupInfo{}; - StartupInfo.cb = sizeof(STARTUPINFOA); + StartupInfo.cb = sizeof(STARTUPINFOA); StartupInfo.dwFlags = STARTF_USESTDHANDLES; StartupInfo.dwFlags |= STARTF_USESHOWWINDOW; StartupInfo.wShowWindow = SW_HIDE; @@ -207,30 +205,28 @@ int SWR_API ExecCmd( StartupInfo.hStdInput = hPipes[0].hRead; } StartupInfo.hStdOutput = hPipes[1].hWrite; - StartupInfo.hStdError = hPipes[2].hWrite; + StartupInfo.hStdError = hPipes[2].hWrite; PROCESS_INFORMATION procInfo{}; // CreateProcess can modify the string std::string local_cmd = cmd; - BOOL ProcessValue = CreateProcessA( - NULL, - (LPSTR)local_cmd.c_str(), - NULL, - NULL, - TRUE, - 0, - (LPVOID)pOptEnvStrings, - NULL, - &StartupInfo, - &procInfo); + BOOL ProcessValue = CreateProcessA(NULL, + (LPSTR)local_cmd.c_str(), + NULL, + NULL, + TRUE, + 0, + (LPVOID)pOptEnvStrings, + NULL, + &StartupInfo, + &procInfo); if (ProcessValue && procInfo.hProcess) { - auto ReadFromPipe = [](HANDLE hPipe, std::string* pOutStr) - { - char buf[1024]; - DWORD dwRead = 0; + auto ReadFromPipe = [](HANDLE hPipe, std::string* pOutStr) { + char buf[1024]; + DWORD dwRead = 0; DWORD dwAvail = 0; while (true) { @@ -244,7 +240,12 @@ int SWR_API ExecCmd( break; } - if (!::ReadFile(hPipe, buf, std::min<size_t>(sizeof(buf) - 1, size_t(dwAvail)), &dwRead, NULL) || !dwRead) + if (!::ReadFile(hPipe, + buf, + std::min<size_t>(sizeof(buf) - 1, size_t(dwAvail)), + &dwRead, + NULL) || + !dwRead) { // error, the child process might ended break; @@ -257,17 +258,18 @@ int SWR_API ExecCmd( } } }; - bool bProcessEnded = false; - size_t bytesWritten = 0; + bool bProcessEnded = false; + size_t bytesWritten = 0; do { if (pOptStdIn && (pOptStdIn->size() > bytesWritten)) { DWORD bytesToWrite = static_cast<DWORD>(pOptStdIn->size()) - bytesWritten; - if (!::WriteFile( - hPipes[0].hWrite, - pOptStdIn->data() + bytesWritten, - bytesToWrite, &bytesToWrite, nullptr)) + if (!::WriteFile(hPipes[0].hWrite, + pOptStdIn->data() + bytesWritten, + bytesToWrite, + &bytesToWrite, + nullptr)) { // Failed to write to pipe break; @@ -280,8 +282,7 @@ int SWR_API ExecCmd( ReadFromPipe(hPipes[1].hRead, pOptStdOut); ReadFromPipe(hPipes[2].hRead, pOptStdErr); - } - while (!bProcessEnded); + } while (!bProcessEnded); DWORD exitVal = 0; if (!GetExitCodeProcess(procInfo.hProcess, &exitVal)) diff --git a/src/gallium/drivers/swr/rasterizer/common/os.h b/src/gallium/drivers/swr/rasterizer/common/os.h index e779562225e..d33c8735d11 100644 --- a/src/gallium/drivers/swr/rasterizer/common/os.h +++ b/src/gallium/drivers/swr/rasterizer/common/os.h @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2014-2017 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2014-2017 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #ifndef __SWR_OS_H__ #define __SWR_OS_H__ @@ -30,7 +30,7 @@ #if (defined(FORCE_WINDOWS) || defined(_WIN32)) && !defined(FORCE_LINUX) #define SWR_API __cdecl -#define SWR_VISIBLE __declspec(dllexport) +#define SWR_VISIBLE __declspec(dllexport) #ifndef NOMINMAX #define NOMINMAX @@ -64,12 +64,12 @@ #define DEBUGBREAK __debugbreak() #define PRAGMA_WARNING_PUSH_DISABLE(...) \ - __pragma(warning(push));\ - __pragma(warning(disable:__VA_ARGS__)); + __pragma(warning(push)); \ + __pragma(warning(disable : __VA_ARGS__)); #define PRAGMA_WARNING_POP() __pragma(warning(pop)) -static inline void *AlignedMalloc(size_t _Size, size_t _Alignment) +static inline void* AlignedMalloc(size_t _Size, size_t _Alignment) { return _aligned_malloc(_Size, _Alignment); } @@ -104,13 +104,13 @@ static inline void AlignedFree(void* p) #include <stdio.h> #include <limits.h> -typedef void VOID; -typedef void* LPVOID; -typedef int INT; -typedef unsigned int UINT; -typedef void* HANDLE; -typedef int LONG; -typedef unsigned int DWORD; +typedef void VOID; +typedef void* LPVOID; +typedef int INT; +typedef unsigned int UINT; +typedef void* HANDLE; +typedef int LONG; +typedef unsigned int DWORD; #undef FALSE #define FALSE 0 @@ -124,7 +124,7 @@ typedef unsigned int DWORD; #ifndef INLINE #define INLINE __inline #endif -#define DEBUGBREAK asm ("int $3") +#define DEBUGBREAK asm("int $3") #if !defined(__CYGWIN__) @@ -136,28 +136,25 @@ typedef unsigned int DWORD; #endif #if defined(__GNUC__) && !defined(__INTEL_COMPILER) - #define __declspec(x) __declspec_##x - #define __declspec_align(y) __attribute__((aligned(y))) - #define __declspec_deprecated __attribute__((deprecated)) - #define __declspec_dllexport - #define __declspec_dllimport - #define __declspec_noinline __attribute__((__noinline__)) - #define __declspec_nothrow __attribute__((nothrow)) - #define __declspec_novtable - #define __declspec_thread __thread +#define __declspec(x) __declspec_##x +#define __declspec_align(y) __attribute__((aligned(y))) +#define __declspec_deprecated __attribute__((deprecated)) +#define __declspec_dllexport +#define __declspec_dllimport +#define __declspec_noinline __attribute__((__noinline__)) +#define __declspec_nothrow __attribute__((nothrow)) +#define __declspec_novtable +#define __declspec_thread __thread #else - #define __declspec(X) +#define __declspec(X) #endif #endif -#define GCC_VERSION (__GNUC__ * 10000 \ - + __GNUC_MINOR__ * 100 \ - + __GNUC_PATCHLEVEL__) +#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) #if !defined(__clang__) && (__GNUC__) && (GCC_VERSION < 40500) -inline -uint64_t __rdtsc() +inline uint64_t __rdtsc() { long low, high; asm volatile("rdtsc" : "=a"(low), "=d"(high)); @@ -165,10 +162,9 @@ uint64_t __rdtsc() } #endif -#if !defined( __clang__) && !defined(__INTEL_COMPILER) +#if !defined(__clang__) && !defined(__INTEL_COMPILER) // Intrinsic not defined in gcc -static INLINE -void _mm256_storeu2_m128i(__m128i *hi, __m128i *lo, __m256i a) +static INLINE void _mm256_storeu2_m128i(__m128i* hi, __m128i* lo, __m256i a) { _mm_storeu_si128((__m128i*)lo, _mm256_castsi256_si128(a)); _mm_storeu_si128((__m128i*)hi, _mm256_extractf128_si256(a, 0x1)); @@ -181,29 +177,25 @@ void _mm256_storeu2_m128i(__m128i *hi, __m128i *lo, __m256i a) #endif #endif -inline -unsigned char _BitScanForward(unsigned long *Index, unsigned long Mask) +inline unsigned char _BitScanForward(unsigned long* Index, unsigned long Mask) { *Index = __builtin_ctz(Mask); return (Mask != 0); } -inline -unsigned char _BitScanForward(unsigned int *Index, unsigned int Mask) +inline unsigned char _BitScanForward(unsigned int* Index, unsigned int Mask) { *Index = __builtin_ctz(Mask); return (Mask != 0); } -inline -unsigned char _BitScanReverse(unsigned long *Index, unsigned long Mask) +inline unsigned char _BitScanReverse(unsigned long* Index, unsigned long Mask) { *Index = __builtin_clz(Mask); return (Mask != 0); } -inline -unsigned char _BitScanReverse(unsigned int *Index, unsigned int Mask) +inline unsigned char _BitScanReverse(unsigned int* Index, unsigned int Mask) { *Index = __builtin_clz(Mask); return (Mask != 0); @@ -212,10 +204,9 @@ unsigned char _BitScanReverse(unsigned int *Index, unsigned int Mask) #define _BitScanForward64 _BitScanForward #define _BitScanReverse64 _BitScanReverse -inline -void *AlignedMalloc(size_t size, size_t alignment) +inline void* AlignedMalloc(size_t size, size_t alignment) { - void *ret; + void* ret; if (posix_memalign(&ret, alignment, size)) { return NULL; @@ -223,19 +214,19 @@ void *AlignedMalloc(size_t size, size_t alignment) return ret; } -static inline -void AlignedFree(void* p) +static inline void AlignedFree(void* p) { free(p); } -#define _countof(a) (sizeof(a)/sizeof(*(a))) +#define _countof(a) (sizeof(a) / sizeof(*(a))) #define sprintf_s sprintf -#define strcpy_s(dst,size,src) strncpy(dst,src,size) +#define strcpy_s(dst, size, src) strncpy(dst, src, size) #define GetCurrentProcessId getpid -#define InterlockedCompareExchange(Dest, Exchange, Comparand) __sync_val_compare_and_swap(Dest, Comparand, Exchange) +#define InterlockedCompareExchange(Dest, Exchange, Comparand) \ + __sync_val_compare_and_swap(Dest, Comparand, Exchange) #define InterlockedExchangeAdd(Addend, Value) __sync_fetch_and_add(Addend, Value) #define InterlockedDecrement(Append) __sync_sub_and_fetch(Append, 1) #define InterlockedDecrement64(Append) __sync_sub_and_fetch(Append, 1) @@ -257,9 +248,9 @@ void AlignedFree(void* p) #define THREAD thread_local // Universal types -typedef uint8_t KILOBYTE[1024]; -typedef KILOBYTE MEGABYTE[1024]; -typedef MEGABYTE GIGABYTE[1024]; +typedef uint8_t KILOBYTE[1024]; +typedef KILOBYTE MEGABYTE[1024]; +typedef MEGABYTE GIGABYTE[1024]; #define OSALIGNLINE(RWORD) OSALIGN(RWORD, 64) #define OSALIGNSIMD(RWORD) OSALIGN(RWORD, KNOB_SIMD_BYTES) @@ -275,9 +266,9 @@ typedef MEGABYTE GIGABYTE[1024]; #define ATTR_UNUSED #endif -#define SWR_FUNC(_retType, _funcName, /* args */...) \ - typedef _retType (SWR_API * PFN##_funcName)(__VA_ARGS__); \ - _retType SWR_API _funcName(__VA_ARGS__); +#define SWR_FUNC(_retType, _funcName, /* args */...) \ + typedef _retType(SWR_API* PFN##_funcName)(__VA_ARGS__); \ + _retType SWR_API _funcName(__VA_ARGS__); // Defined in os.cpp void SWR_API SetCurrentThreadName(const char* pThreadName); @@ -285,11 +276,11 @@ void SWR_API CreateDirectoryPath(const std::string& path); /// Execute Command (block until finished) /// @returns process exit value -int SWR_API ExecCmd( - const std::string& cmd, ///< (In) Command line string - const char* pOptEnvStrings = nullptr, ///< (Optional In) Environment block for new process - std::string* pOptStdOut = nullptr, ///< (Optional Out) Standard Output text - std::string* pOptStdErr = nullptr, ///< (Optional Out) Standard Error text - const std::string* pOptStdIn = nullptr); ///< (Optional In) Standard Input text - -#endif//__SWR_OS_H__ +int SWR_API + ExecCmd(const std::string& cmd, ///< (In) Command line string + const char* pOptEnvStrings = nullptr, ///< (Optional In) Environment block for new process + std::string* pOptStdOut = nullptr, ///< (Optional Out) Standard Output text + std::string* pOptStdErr = nullptr, ///< (Optional Out) Standard Error text + const std::string* pOptStdIn = nullptr); ///< (Optional In) Standard Input text + +#endif //__SWR_OS_H__ diff --git a/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets.cpp b/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets.cpp index 79e82c4e6b3..e19a2d11045 100644 --- a/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets.cpp +++ b/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets.cpp @@ -1,32 +1,32 @@ /**************************************************************************** -* Copyright (C) 2014-2015 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -* -* @file rdtsc_buckets.cpp -* -* @brief implementation of rdtsc buckets. -* -* Notes: -* -******************************************************************************/ + * Copyright (C) 2014-2015 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * @file rdtsc_buckets.cpp + * + * @brief implementation of rdtsc buckets. + * + * Notes: + * + ******************************************************************************/ #include "rdtsc_buckets.h" #include <inttypes.h> @@ -50,16 +50,16 @@ void BucketManager::RegisterThread(const std::string& name) BUCKET_THREAD newThread; newThread.name = name; newThread.root.children.reserve(mBuckets.size()); - newThread.root.id = 0; + newThread.root.id = 0; newThread.root.pParent = nullptr; - newThread.pCurrent = &newThread.root; + newThread.pCurrent = &newThread.root; mThreadMutex.lock(); // assign unique thread id for this thread - size_t id = mThreads.size(); + size_t id = mThreads.size(); newThread.id = (UINT)id; - tlsThreadId = (UINT)id; + tlsThreadId = (UINT)id; // store new thread mThreads.push_back(newThread); @@ -76,9 +76,10 @@ UINT BucketManager::RegisterBucket(const BUCKET_DESC& desc) return (UINT)id; } -void BucketManager::PrintBucket(FILE* f, UINT level, uint64_t threadCycles, uint64_t parentCycles, const BUCKET& bucket) +void BucketManager::PrintBucket( + FILE* f, UINT level, uint64_t threadCycles, uint64_t parentCycles, const BUCKET& bucket) { - const char *arrows[] = { + const char* arrows[] = { "", "|-> ", " |-> ", @@ -99,7 +100,7 @@ void BucketManager::PrintBucket(FILE* f, UINT level, uint64_t threadCycles, uint // compute average cycle count per invocation uint64_t CPE = bucket.elapsed / bucket.count; - BUCKET_DESC &desc = mBuckets[bucket.id]; + BUCKET_DESC& desc = mBuckets[bucket.id]; // construct hierarchy visualization char hier[80]; @@ -107,16 +108,16 @@ void BucketManager::PrintBucket(FILE* f, UINT level, uint64_t threadCycles, uint strcat(hier, desc.name.c_str()); // print out - fprintf(f, "%6.2f %6.2f %-10" PRIu64 " %-10" PRIu64 " %-10u %-10lu %-10u %s\n", - percentTotal, - percentParent, - bucket.elapsed, - CPE, - bucket.count, - (unsigned long)0, - (uint32_t)0, - hier - ); + fprintf(f, + "%6.2f %6.2f %-10" PRIu64 " %-10" PRIu64 " %-10u %-10lu %-10u %s\n", + percentTotal, + percentParent, + bucket.elapsed, + CPE, + bucket.count, + (unsigned long)0, + (uint32_t)0, + hier); // dump all children of this bucket for (const BUCKET& child : bucket.children) @@ -135,8 +136,8 @@ void BucketManager::PrintThread(FILE* f, const BUCKET_THREAD& thread) fprintf(f, " %%Tot %%Par Cycles CPE NumEvent CPE2 NumEvent2 Bucket\n"); // compute thread level total cycle counts across all buckets from root - const BUCKET& root = thread.root; - uint64_t totalCycles = 0; + const BUCKET& root = thread.root; + uint64_t totalCycles = 0; for (const BUCKET& child : root.children) { totalCycles += child.elapsed; diff --git a/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets.h b/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets.h index 48042ac2233..bbc9538b86d 100644 --- a/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets.h +++ b/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets.h @@ -1,32 +1,32 @@ /**************************************************************************** -* Copyright (C) 2014-2015 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -* -* @file rdtsc_buckets.h -* -* @brief declaration for rdtsc buckets. -* -* Notes: -* -******************************************************************************/ + * Copyright (C) 2014-2015 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * @file rdtsc_buckets.h + * + * @brief declaration for rdtsc buckets. + * + * Notes: + * + ******************************************************************************/ #pragma once #include "os.h" @@ -48,7 +48,7 @@ extern THREAD UINT tlsThreadId; class BucketManager { public: - BucketManager() { } + BucketManager() {} ~BucketManager(); // removes all registered thread data @@ -112,7 +112,8 @@ public: // @param id generated by RegisterBucket INLINE void StartBucket(UINT id) { - if (!mCapturing) return; + if (!mCapturing) + return; SWR_ASSERT(tlsThreadId < mThreads.size()); @@ -125,10 +126,10 @@ public: { bt.pCurrent->children.resize(mBuckets.size()); } - BUCKET &child = bt.pCurrent->children[id]; + BUCKET& child = bt.pCurrent->children[id]; child.pParent = bt.pCurrent; - child.id = id; - child.start = tsc; + child.id = id; + child.start = tsc; // update thread's currently executing bucket bt.pCurrent = &child; @@ -142,7 +143,7 @@ public: INLINE void StopBucket(UINT id) { SWR_ASSERT(tlsThreadId < mThreads.size()); - BUCKET_THREAD &bt = mThreads[tlsThreadId]; + BUCKET_THREAD& bt = mThreads[tlsThreadId]; if (bt.level == 0) { @@ -152,7 +153,8 @@ public: uint64_t tsc = __rdtsc(); { - if (bt.pCurrent->start == 0) return; + if (bt.pCurrent->start == 0) + return; SWR_ASSERT(bt.pCurrent->id == id, "Mismatched buckets detected"); bt.pCurrent->elapsed += (tsc - bt.pCurrent->start); @@ -167,7 +169,8 @@ public: INLINE void AddEvent(uint32_t id, uint32_t count) { - if (!mCapturing) return; + if (!mCapturing) + return; SWR_ASSERT(tlsThreadId < mThreads.size()); @@ -179,15 +182,16 @@ public: { bt.pCurrent->children.resize(mBuckets.size()); } - BUCKET &child = bt.pCurrent->children[id]; + BUCKET& child = bt.pCurrent->children[id]; child.pParent = bt.pCurrent; - child.id = id; + child.id = id; child.count += count; } } private: - void PrintBucket(FILE* f, UINT level, uint64_t threadCycles, uint64_t parentCycles, const BUCKET& bucket); + void PrintBucket( + FILE* f, UINT level, uint64_t threadCycles, uint64_t parentCycles, const BUCKET& bucket); void PrintThread(FILE* f, const BUCKET_THREAD& thread); // list of active threads that have registered with this manager @@ -197,10 +201,10 @@ private: std::vector<BUCKET_DESC> mBuckets; // is capturing currently enabled - volatile bool mCapturing{ false }; + volatile bool mCapturing{false}; // has capturing completed - volatile bool mDoneCapturing{ false }; + volatile bool mDoneCapturing{false}; std::mutex mThreadMutex; @@ -208,7 +212,6 @@ private: }; - // C helpers for jitter void BucketManager_StartBucket(BucketManager* pBucketMgr, uint32_t id); void BucketManager_StopBucket(BucketManager* pBucketMgr, uint32_t id); diff --git a/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets_shared.h b/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets_shared.h index f6e75cda89d..fd3b1df746a 100644 --- a/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets_shared.h +++ b/src/gallium/drivers/swr/rasterizer/common/rdtsc_buckets_shared.h @@ -1,32 +1,32 @@ /**************************************************************************** -* Copyright (C) 2014-2015 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -* -* @file rdtsc_buckets.h -* -* @brief declaration for rdtsc buckets. -* -* Notes: -* -******************************************************************************/ + * Copyright (C) 2014-2015 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * @file rdtsc_buckets.h + * + * @brief declaration for rdtsc buckets. + * + * Notes: + * + ******************************************************************************/ #pragma once #include <vector> @@ -34,12 +34,12 @@ struct BUCKET { - uint32_t id{ 0 }; - uint64_t start{ 0 }; - uint64_t elapsed{ 0 }; - uint32_t count{ 0 }; + uint32_t id{0}; + uint64_t start{0}; + uint64_t elapsed{0}; + uint32_t count{0}; - BUCKET* pParent{ nullptr }; + BUCKET* pParent{nullptr}; std::vector<BUCKET> children; }; @@ -65,29 +65,29 @@ struct BUCKET_THREAD std::string name; // id for this thread, assigned by the thread manager - uint32_t id{ 0 }; + uint32_t id{0}; // root of the bucket hierarchy for this thread BUCKET root; // currently executing bucket somewhere in the hierarchy - BUCKET* pCurrent{ nullptr }; + BUCKET* pCurrent{nullptr}; // currently executing hierarchy level - uint32_t level{ 0 }; + uint32_t level{0}; // threadviz file object - FILE* vizFile{ nullptr }; + FILE* vizFile{nullptr}; BUCKET_THREAD() {} BUCKET_THREAD(const BUCKET_THREAD& that) { - name = that.name; - id = that.id; - root = that.root; + name = that.name; + id = that.id; + root = that.root; pCurrent = &root; - vizFile = that.vizFile; + vizFile = that.vizFile; } }; @@ -100,14 +100,14 @@ enum VIZ_TYPE struct VIZ_START_DATA { - uint8_t type; + uint8_t type; uint32_t bucketId; uint64_t timestamp; }; struct VIZ_STOP_DATA { - uint8_t type; + uint8_t type; uint64_t timestamp; }; @@ -144,7 +144,7 @@ inline void Serialize(FILE* f, const std::string& string) inline void Deserialize(FILE* f, std::string& string) { - char cstr[256]; + char cstr[256]; uint8_t length; fread(&length, sizeof(length), 1, f); fread(cstr, length, 1, f); diff --git a/src/gallium/drivers/swr/rasterizer/common/simd16intrin.h b/src/gallium/drivers/swr/rasterizer/common/simd16intrin.h index 98a8b9b2f9f..b08fb2eaaea 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simd16intrin.h +++ b/src/gallium/drivers/swr/rasterizer/common/simd16intrin.h @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2014-2015 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2014-2015 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #ifndef __SWR_SIMD16INTRIN_H__ #define __SWR_SIMD16INTRIN_H__ @@ -27,144 +27,146 @@ #if ENABLE_AVX512_SIMD16 #if KNOB_SIMD16_WIDTH == 16 -typedef SIMD512 SIMD16; +typedef SIMD512 SIMD16; #else #error Unsupported vector width -#endif//KNOB_SIMD16_WIDTH == 16 +#endif // KNOB_SIMD16_WIDTH == 16 -#define _simd16_setzero_ps SIMD16::setzero_ps -#define _simd16_setzero_si SIMD16::setzero_si -#define _simd16_set1_ps SIMD16::set1_ps -#define _simd16_set1_epi8 SIMD16::set1_epi8 -#define _simd16_set1_epi32 SIMD16::set1_epi32 -#define _simd16_set_ps SIMD16::set_ps -#define _simd16_set_epi32 SIMD16::set_epi32 -#define _simd16_load_ps SIMD16::load_ps -#define _simd16_loadu_ps SIMD16::loadu_ps -#if 1 -#define _simd16_load1_ps SIMD16::broadcast_ss -#endif -#define _simd16_load_si SIMD16::load_si -#define _simd16_loadu_si SIMD16::loadu_si -#define _simd16_broadcast_ss(m) SIMD16::broadcast_ss((float const*)m) -#define _simd16_store_ps SIMD16::store_ps -#define _simd16_store_si SIMD16::store_si -#define _simd16_extract_ps(a, imm8) SIMD16::extract_ps<imm8>(a) -#define _simd16_extract_si(a, imm8) SIMD16::extract_si<imm8>(a) -#define _simd16_insert_ps(a, b, imm8) SIMD16::insert_ps<imm8>(a, b) -#define _simd16_insert_si(a, b, imm8) SIMD16::insert_si<imm8>(a, b) -#define _simd16_maskstore_ps SIMD16::maskstore_ps -#define _simd16_blend_ps(a, b, mask) SIMD16::blend_ps<mask>(a, b) -#define _simd16_blendv_ps SIMD16::blendv_ps -#define _simd16_blendv_epi32 SIMD16::blendv_epi32 -#define _simd16_mul_ps SIMD16::mul_ps -#define _simd16_div_ps SIMD16::div_ps -#define _simd16_add_ps SIMD16::add_ps -#define _simd16_sub_ps SIMD16::sub_ps -#define _simd16_rsqrt_ps SIMD16::rsqrt_ps -#define _simd16_min_ps SIMD16::min_ps -#define _simd16_max_ps SIMD16::max_ps -#define _simd16_movemask_ps SIMD16::movemask_ps -#define _simd16_movemask_pd SIMD16::movemask_pd -#define _simd16_cvtps_epi32 SIMD16::cvtps_epi32 -#define _simd16_cvttps_epi32 SIMD16::cvttps_epi32 -#define _simd16_cvtepi32_ps SIMD16::cvtepi32_ps -#define _simd16_cmp_ps(a, b, comp) SIMD16::cmp_ps<SIMD16::CompareType(comp)>(a, b) -#define _simd16_cmplt_ps SIMD16::cmplt_ps -#define _simd16_cmpgt_ps SIMD16::cmpgt_ps -#define _simd16_cmpneq_ps SIMD16::cmpneq_ps -#define _simd16_cmpeq_ps SIMD16::cmpeq_ps -#define _simd16_cmpge_ps SIMD16::cmpge_ps -#define _simd16_cmple_ps SIMD16::cmple_ps -#define _simd16_castsi_ps SIMD16::castsi_ps -#define _simd16_castps_si SIMD16::castps_si -#define _simd16_castsi_pd SIMD16::castsi_pd -#define _simd16_castpd_si SIMD16::castpd_si -#define _simd16_castpd_ps SIMD16::castpd_ps -#define _simd16_castps_pd SIMD16::castps_pd -#define _simd16_and_ps SIMD16::and_ps -#define _simd16_andnot_ps SIMD16::andnot_ps -#define _simd16_or_ps SIMD16::or_ps -#define _simd16_xor_ps SIMD16::xor_ps -#define _simd16_round_ps(a, mode) SIMD16::round_ps<SIMD16::RoundMode(mode)>(a) -#define _simd16_mul_epi32 SIMD16::mul_epi32 -#define _simd16_mullo_epi32 SIMD16::mullo_epi32 -#define _simd16_sub_epi32 SIMD16::sub_epi32 -#define _simd16_sub_epi64 SIMD16::sub_epi64 -#define _simd16_min_epi32 SIMD16::min_epi32 -#define _simd16_max_epi32 SIMD16::max_epi32 -#define _simd16_min_epu32 SIMD16::min_epu32 -#define _simd16_max_epu32 SIMD16::max_epu32 -#define _simd16_add_epi32 SIMD16::add_epi32 -#define _simd16_and_si SIMD16::and_si -#define _simd16_andnot_si SIMD16::andnot_si -#define _simd16_or_si SIMD16::or_si -#define _simd16_xor_si SIMD16::xor_si -#define _simd16_cmpeq_epi32 SIMD16::cmpeq_epi32 -#define _simd16_cmpgt_epi32 SIMD16::cmpgt_epi32 -#define _simd16_cmplt_epi32 SIMD16::cmplt_epi32 -#define _simd16_testz_ps SIMD16::testz_ps -#define _simd16_unpacklo_ps SIMD16::unpacklo_ps -#define _simd16_unpackhi_ps SIMD16::unpackhi_ps -#define _simd16_unpacklo_pd SIMD16::unpacklo_pd -#define _simd16_unpackhi_pd SIMD16::unpackhi_pd -#define _simd16_unpacklo_epi8 SIMD16::unpacklo_epi8 -#define _simd16_unpackhi_epi8 SIMD16::unpackhi_epi8 -#define _simd16_unpacklo_epi16 SIMD16::unpacklo_epi16 -#define _simd16_unpackhi_epi16 SIMD16::unpackhi_epi16 -#define _simd16_unpacklo_epi32 SIMD16::unpacklo_epi32 -#define _simd16_unpackhi_epi32 SIMD16::unpackhi_epi32 -#define _simd16_unpacklo_epi64 SIMD16::unpacklo_epi64 -#define _simd16_unpackhi_epi64 SIMD16::unpackhi_epi64 -#define _simd16_slli_epi32(a, i) SIMD16::slli_epi32<i>(a) -#define _simd16_srli_epi32(a, i) SIMD16::srli_epi32<i>(a) -#define _simd16_srai_epi32(a, i) SIMD16::srai_epi32<i>(a) -#define _simd16_fmadd_ps SIMD16::fmadd_ps -#define _simd16_fmsub_ps SIMD16::fmsub_ps -#define _simd16_adds_epu8 SIMD16::adds_epu8 -#define _simd16_subs_epu8 SIMD16::subs_epu8 -#define _simd16_add_epi8 SIMD16::add_epi8 -#define _simd16_shuffle_epi8 SIMD16::shuffle_epi8 +#define _simd16_setzero_ps SIMD16::setzero_ps +#define _simd16_setzero_si SIMD16::setzero_si +#define _simd16_set1_ps SIMD16::set1_ps +#define _simd16_set1_epi8 SIMD16::set1_epi8 +#define _simd16_set1_epi32 SIMD16::set1_epi32 +#define _simd16_set_ps SIMD16::set_ps +#define _simd16_set_epi32 SIMD16::set_epi32 +#define _simd16_load_ps SIMD16::load_ps +#define _simd16_loadu_ps SIMD16::loadu_ps +#if 1 +#define _simd16_load1_ps SIMD16::broadcast_ss +#endif +#define _simd16_load_si SIMD16::load_si +#define _simd16_loadu_si SIMD16::loadu_si +#define _simd16_broadcast_ss(m) SIMD16::broadcast_ss((float const*)m) +#define _simd16_store_ps SIMD16::store_ps +#define _simd16_store_si SIMD16::store_si +#define _simd16_extract_ps(a, imm8) SIMD16::extract_ps<imm8>(a) +#define _simd16_extract_si(a, imm8) SIMD16::extract_si<imm8>(a) +#define _simd16_insert_ps(a, b, imm8) SIMD16::insert_ps<imm8>(a, b) +#define _simd16_insert_si(a, b, imm8) SIMD16::insert_si<imm8>(a, b) +#define _simd16_maskstore_ps SIMD16::maskstore_ps +#define _simd16_blend_ps(a, b, mask) SIMD16::blend_ps<mask>(a, b) +#define _simd16_blendv_ps SIMD16::blendv_ps +#define _simd16_blendv_epi32 SIMD16::blendv_epi32 +#define _simd16_mul_ps SIMD16::mul_ps +#define _simd16_div_ps SIMD16::div_ps +#define _simd16_add_ps SIMD16::add_ps +#define _simd16_sub_ps SIMD16::sub_ps +#define _simd16_rsqrt_ps SIMD16::rsqrt_ps +#define _simd16_min_ps SIMD16::min_ps +#define _simd16_max_ps SIMD16::max_ps +#define _simd16_movemask_ps SIMD16::movemask_ps +#define _simd16_movemask_pd SIMD16::movemask_pd +#define _simd16_cvtps_epi32 SIMD16::cvtps_epi32 +#define _simd16_cvttps_epi32 SIMD16::cvttps_epi32 +#define _simd16_cvtepi32_ps SIMD16::cvtepi32_ps +#define _simd16_cmp_ps(a, b, comp) SIMD16::cmp_ps<SIMD16::CompareType(comp)>(a, b) +#define _simd16_cmplt_ps SIMD16::cmplt_ps +#define _simd16_cmpgt_ps SIMD16::cmpgt_ps +#define _simd16_cmpneq_ps SIMD16::cmpneq_ps +#define _simd16_cmpeq_ps SIMD16::cmpeq_ps +#define _simd16_cmpge_ps SIMD16::cmpge_ps +#define _simd16_cmple_ps SIMD16::cmple_ps +#define _simd16_castsi_ps SIMD16::castsi_ps +#define _simd16_castps_si SIMD16::castps_si +#define _simd16_castsi_pd SIMD16::castsi_pd +#define _simd16_castpd_si SIMD16::castpd_si +#define _simd16_castpd_ps SIMD16::castpd_ps +#define _simd16_castps_pd SIMD16::castps_pd +#define _simd16_and_ps SIMD16::and_ps +#define _simd16_andnot_ps SIMD16::andnot_ps +#define _simd16_or_ps SIMD16::or_ps +#define _simd16_xor_ps SIMD16::xor_ps +#define _simd16_round_ps(a, mode) SIMD16::round_ps<SIMD16::RoundMode(mode)>(a) +#define _simd16_mul_epi32 SIMD16::mul_epi32 +#define _simd16_mullo_epi32 SIMD16::mullo_epi32 +#define _simd16_sub_epi32 SIMD16::sub_epi32 +#define _simd16_sub_epi64 SIMD16::sub_epi64 +#define _simd16_min_epi32 SIMD16::min_epi32 +#define _simd16_max_epi32 SIMD16::max_epi32 +#define _simd16_min_epu32 SIMD16::min_epu32 +#define _simd16_max_epu32 SIMD16::max_epu32 +#define _simd16_add_epi32 SIMD16::add_epi32 +#define _simd16_and_si SIMD16::and_si +#define _simd16_andnot_si SIMD16::andnot_si +#define _simd16_or_si SIMD16::or_si +#define _simd16_xor_si SIMD16::xor_si +#define _simd16_cmpeq_epi32 SIMD16::cmpeq_epi32 +#define _simd16_cmpgt_epi32 SIMD16::cmpgt_epi32 +#define _simd16_cmplt_epi32 SIMD16::cmplt_epi32 +#define _simd16_testz_ps SIMD16::testz_ps +#define _simd16_unpacklo_ps SIMD16::unpacklo_ps +#define _simd16_unpackhi_ps SIMD16::unpackhi_ps +#define _simd16_unpacklo_pd SIMD16::unpacklo_pd +#define _simd16_unpackhi_pd SIMD16::unpackhi_pd +#define _simd16_unpacklo_epi8 SIMD16::unpacklo_epi8 +#define _simd16_unpackhi_epi8 SIMD16::unpackhi_epi8 +#define _simd16_unpacklo_epi16 SIMD16::unpacklo_epi16 +#define _simd16_unpackhi_epi16 SIMD16::unpackhi_epi16 +#define _simd16_unpacklo_epi32 SIMD16::unpacklo_epi32 +#define _simd16_unpackhi_epi32 SIMD16::unpackhi_epi32 +#define _simd16_unpacklo_epi64 SIMD16::unpacklo_epi64 +#define _simd16_unpackhi_epi64 SIMD16::unpackhi_epi64 +#define _simd16_slli_epi32(a, i) SIMD16::slli_epi32<i>(a) +#define _simd16_srli_epi32(a, i) SIMD16::srli_epi32<i>(a) +#define _simd16_srai_epi32(a, i) SIMD16::srai_epi32<i>(a) +#define _simd16_fmadd_ps SIMD16::fmadd_ps +#define _simd16_fmsub_ps SIMD16::fmsub_ps +#define _simd16_adds_epu8 SIMD16::adds_epu8 +#define _simd16_subs_epu8 SIMD16::subs_epu8 +#define _simd16_add_epi8 SIMD16::add_epi8 +#define _simd16_shuffle_epi8 SIMD16::shuffle_epi8 -#define _simd16_i32gather_ps(m, index, scale) SIMD16::i32gather_ps<SIMD16::ScaleFactor(scale)>(m, index) -#define _simd16_mask_i32gather_ps(a, m, index, mask, scale) SIMD16::mask_i32gather_ps<SIMD16::ScaleFactor(scale)>(a, m, index, mask) +#define _simd16_i32gather_ps(m, index, scale) \ + SIMD16::i32gather_ps<SIMD16::ScaleFactor(scale)>(m, index) +#define _simd16_mask_i32gather_ps(a, m, index, mask, scale) \ + SIMD16::mask_i32gather_ps<SIMD16::ScaleFactor(scale)>(a, m, index, mask) -#define _simd16_abs_epi32 SIMD16::abs_epi32 +#define _simd16_abs_epi32 SIMD16::abs_epi32 -#define _simd16_cmpeq_epi64 SIMD16::cmpeq_epi64 -#define _simd16_cmpgt_epi64 SIMD16::cmpgt_epi64 -#define _simd16_cmpeq_epi16 SIMD16::cmpeq_epi16 -#define _simd16_cmpgt_epi16 SIMD16::cmpgt_epi16 -#define _simd16_cmpeq_epi8 SIMD16::cmpeq_epi8 -#define _simd16_cmpgt_epi8 SIMD16::cmpgt_epi8 +#define _simd16_cmpeq_epi64 SIMD16::cmpeq_epi64 +#define _simd16_cmpgt_epi64 SIMD16::cmpgt_epi64 +#define _simd16_cmpeq_epi16 SIMD16::cmpeq_epi16 +#define _simd16_cmpgt_epi16 SIMD16::cmpgt_epi16 +#define _simd16_cmpeq_epi8 SIMD16::cmpeq_epi8 +#define _simd16_cmpgt_epi8 SIMD16::cmpgt_epi8 -#define _simd16_permute_ps_i(a, i) SIMD16::permute_ps<i>(a) -#define _simd16_permute_ps SIMD16::permute_ps -#define _simd16_permute_epi32 SIMD16::permute_epi32 -#define _simd16_sllv_epi32 SIMD16::sllv_epi32 -#define _simd16_srlv_epi32 SIMD16::sllv_epi32 -#define _simd16_permute2f128_ps(a, b, i) SIMD16::permute2f128_ps<i>(a, b) -#define _simd16_permute2f128_pd(a, b, i) SIMD16::permute2f128_pd<i>(a, b) -#define _simd16_permute2f128_si(a, b, i) SIMD16::permute2f128_si<i>(a, b) -#define _simd16_shuffle_ps(a, b, i) SIMD16::shuffle_ps<i>(a, b) -#define _simd16_shuffle_pd(a, b, i) SIMD16::shuffle_pd<i>(a, b) -#define _simd16_shuffle_epi32(a, b, imm8) SIMD16::shuffle_epi32<imm8>(a, b) -#define _simd16_shuffle_epi64(a, b, imm8) SIMD16::shuffle_epi64<imm8>(a, b) -#define _simd16_cvtepu8_epi16 SIMD16::cvtepu8_epi16 -#define _simd16_cvtepu8_epi32 SIMD16::cvtepu8_epi32 -#define _simd16_cvtepu16_epi32 SIMD16::cvtepu16_epi32 -#define _simd16_cvtepu16_epi64 SIMD16::cvtepu16_epi64 -#define _simd16_cvtepu32_epi64 SIMD16::cvtepu32_epi64 -#define _simd16_packus_epi16 SIMD16::packus_epi16 -#define _simd16_packs_epi16 SIMD16::packs_epi16 -#define _simd16_packus_epi32 SIMD16::packus_epi32 -#define _simd16_packs_epi32 SIMD16::packs_epi32 -#define _simd16_cmplt_ps_mask SIMD16::cmp_ps_mask<SIMD16::CompareType::LT_OQ> -#define _simd16_cmpeq_ps_mask SIMD16::cmp_ps_mask<SIMD16::CompareType::EQ_OQ> -#define _simd16_int2mask(mask) simd16mask(mask) -#define _simd16_mask2int(mask) int(mask) -#define _simd16_vmask_ps SIMD16::vmask_ps +#define _simd16_permute_ps_i(a, i) SIMD16::permute_ps<i>(a) +#define _simd16_permute_ps SIMD16::permute_ps +#define _simd16_permute_epi32 SIMD16::permute_epi32 +#define _simd16_sllv_epi32 SIMD16::sllv_epi32 +#define _simd16_srlv_epi32 SIMD16::sllv_epi32 +#define _simd16_permute2f128_ps(a, b, i) SIMD16::permute2f128_ps<i>(a, b) +#define _simd16_permute2f128_pd(a, b, i) SIMD16::permute2f128_pd<i>(a, b) +#define _simd16_permute2f128_si(a, b, i) SIMD16::permute2f128_si<i>(a, b) +#define _simd16_shuffle_ps(a, b, i) SIMD16::shuffle_ps<i>(a, b) +#define _simd16_shuffle_pd(a, b, i) SIMD16::shuffle_pd<i>(a, b) +#define _simd16_shuffle_epi32(a, b, imm8) SIMD16::shuffle_epi32<imm8>(a, b) +#define _simd16_shuffle_epi64(a, b, imm8) SIMD16::shuffle_epi64<imm8>(a, b) +#define _simd16_cvtepu8_epi16 SIMD16::cvtepu8_epi16 +#define _simd16_cvtepu8_epi32 SIMD16::cvtepu8_epi32 +#define _simd16_cvtepu16_epi32 SIMD16::cvtepu16_epi32 +#define _simd16_cvtepu16_epi64 SIMD16::cvtepu16_epi64 +#define _simd16_cvtepu32_epi64 SIMD16::cvtepu32_epi64 +#define _simd16_packus_epi16 SIMD16::packus_epi16 +#define _simd16_packs_epi16 SIMD16::packs_epi16 +#define _simd16_packus_epi32 SIMD16::packus_epi32 +#define _simd16_packs_epi32 SIMD16::packs_epi32 +#define _simd16_cmplt_ps_mask SIMD16::cmp_ps_mask<SIMD16::CompareType::LT_OQ> +#define _simd16_cmpeq_ps_mask SIMD16::cmp_ps_mask<SIMD16::CompareType::EQ_OQ> +#define _simd16_int2mask(mask) simd16mask(mask) +#define _simd16_mask2int(mask) int(mask) +#define _simd16_vmask_ps SIMD16::vmask_ps -#endif//ENABLE_AVX512_SIMD16 +#endif // ENABLE_AVX512_SIMD16 -#endif//__SWR_SIMD16INTRIN_H_ +#endif //__SWR_SIMD16INTRIN_H_ diff --git a/src/gallium/drivers/swr/rasterizer/common/simdintrin.h b/src/gallium/drivers/swr/rasterizer/common/simdintrin.h index b1471a97250..8ffda3f8458 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdintrin.h +++ b/src/gallium/drivers/swr/rasterizer/common/simdintrin.h @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2014-2015 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2014-2015 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #ifndef __SWR_SIMDINTRIN_H__ #define __SWR_SIMDINTRIN_H__ @@ -28,176 +28,177 @@ #include "common/simdlib.hpp" #if KNOB_SIMD_WIDTH == 8 -typedef SIMD256 SIMD; +typedef SIMD256 SIMD; #else #error Unsupported vector width -#endif//KNOB_SIMD16_WIDTH == 16 - - -#define _simd128_maskstore_ps SIMD128::maskstore_ps -#define _simd128_fmadd_ps SIMD128::fmadd_ps - -#define _simd_load_ps SIMD::load_ps -#define _simd_load1_ps SIMD::broadcast_ss -#define _simd_loadu_ps SIMD::loadu_ps -#define _simd_setzero_ps SIMD::setzero_ps -#define _simd_set1_ps SIMD::set1_ps -#define _simd_blend_ps(a, b, i) SIMD::blend_ps<i>(a, b) -#define _simd_blend_epi32(a, b, i) SIMD::blend_epi32<i>(a, b) -#define _simd_blendv_ps SIMD::blendv_ps -#define _simd_store_ps SIMD::store_ps -#define _simd_mul_ps SIMD::mul_ps -#define _simd_add_ps SIMD::add_ps -#define _simd_sub_ps SIMD::sub_ps -#define _simd_rsqrt_ps SIMD::rsqrt_ps -#define _simd_min_ps SIMD::min_ps -#define _simd_max_ps SIMD::max_ps -#define _simd_movemask_ps SIMD::movemask_ps -#define _simd_cvtps_epi32 SIMD::cvtps_epi32 -#define _simd_cvttps_epi32 SIMD::cvttps_epi32 -#define _simd_cvtepi32_ps SIMD::cvtepi32_ps -#define _simd_cmplt_ps SIMD::cmplt_ps -#define _simd_cmpgt_ps SIMD::cmpgt_ps -#define _simd_cmpneq_ps SIMD::cmpneq_ps -#define _simd_cmpeq_ps SIMD::cmpeq_ps -#define _simd_cmpge_ps SIMD::cmpge_ps -#define _simd_cmple_ps SIMD::cmple_ps -#define _simd_cmp_ps(a, b, imm) SIMD::cmp_ps<SIMD::CompareType(imm)>(a, b) -#define _simd_and_ps SIMD::and_ps -#define _simd_or_ps SIMD::or_ps -#define _simd_rcp_ps SIMD::rcp_ps -#define _simd_div_ps SIMD::div_ps -#define _simd_castsi_ps SIMD::castsi_ps -#define _simd_castps_pd SIMD::castps_pd -#define _simd_castpd_ps SIMD::castpd_ps -#define _simd_andnot_ps SIMD::andnot_ps -#define _simd_round_ps(a, i) SIMD::round_ps<SIMD::RoundMode(i)>(a) -#define _simd_castpd_ps SIMD::castpd_ps -#define _simd_broadcast_ps(a) SIMD::broadcast_ps((SIMD128::Float const *)(a)) -#define _simd_stream_ps SIMD::stream_ps - -#define _simd_movemask_pd SIMD::movemask_pd -#define _simd_castsi_pd SIMD::castsi_pd - -#define _simd_mul_epi32 SIMD::mul_epi32 -#define _simd_mullo_epi32 SIMD::mullo_epi32 -#define _simd_sub_epi32 SIMD::sub_epi32 -#define _simd_sub_epi64 SIMD::sub_epi64 -#define _simd_min_epi32 SIMD::min_epi32 -#define _simd_min_epu32 SIMD::min_epu32 -#define _simd_max_epi32 SIMD::max_epi32 -#define _simd_max_epu32 SIMD::max_epu32 -#define _simd_add_epi32 SIMD::add_epi32 -#define _simd_and_si SIMD::and_si -#define _simd_andnot_si SIMD::andnot_si -#define _simd_cmpeq_epi32 SIMD::cmpeq_epi32 -#define _simd_cmplt_epi32 SIMD::cmplt_epi32 -#define _simd_cmpgt_epi32 SIMD::cmpgt_epi32 -#define _simd_or_si SIMD::or_si -#define _simd_xor_si SIMD::xor_si -#define _simd_castps_si SIMD::castps_si -#define _simd_adds_epu8 SIMD::adds_epu8 -#define _simd_subs_epu8 SIMD::subs_epu8 -#define _simd_add_epi8 SIMD::add_epi8 -#define _simd_cmpeq_epi64 SIMD::cmpeq_epi64 -#define _simd_cmpgt_epi64 SIMD::cmpgt_epi64 -#define _simd_cmpgt_epi8 SIMD::cmpgt_epi8 -#define _simd_cmpeq_epi8 SIMD::cmpeq_epi8 -#define _simd_cmpgt_epi16 SIMD::cmpgt_epi16 -#define _simd_cmpeq_epi16 SIMD::cmpeq_epi16 -#define _simd_movemask_epi8 SIMD::movemask_epi8 -#define _simd_permute_ps_i(a, i) SIMD::permute_ps<i>(a) -#define _simd_permute_ps SIMD::permute_ps -#define _simd_permute_epi32 SIMD::permute_epi32 -#define _simd_srlv_epi32 SIMD::srlv_epi32 -#define _simd_sllv_epi32 SIMD::sllv_epi32 - -#define _simd_unpacklo_epi8 SIMD::unpacklo_epi8 -#define _simd_unpackhi_epi8 SIMD::unpackhi_epi8 -#define _simd_unpacklo_epi16 SIMD::unpacklo_epi16 -#define _simd_unpackhi_epi16 SIMD::unpackhi_epi16 -#define _simd_unpacklo_epi32 SIMD::unpacklo_epi32 -#define _simd_unpackhi_epi32 SIMD::unpackhi_epi32 -#define _simd_unpacklo_epi64 SIMD::unpacklo_epi64 -#define _simd_unpackhi_epi64 SIMD::unpackhi_epi64 - -#define _simd_slli_epi32(a,i) SIMD::slli_epi32<i>(a) -#define _simd_srai_epi32(a,i) SIMD::srai_epi32<i>(a) -#define _simd_srli_epi32(a,i) SIMD::srli_epi32<i>(a) -#define _simd_srlisi_ps(a,i) SIMD::srlisi_ps<i>(a) - -#define _simd_fmadd_ps SIMD::fmadd_ps -#define _simd_fmsub_ps SIMD::fmsub_ps -#define _simd_shuffle_epi8 SIMD::shuffle_epi8 - -#define _simd_i32gather_ps(p, o, s) SIMD::i32gather_ps<SIMD::ScaleFactor(s)>(p, o) -#define _simd_mask_i32gather_ps(r, p, o, m, s) SIMD::mask_i32gather_ps<SIMD::ScaleFactor(s)>(r, p, o, m) -#define _simd_abs_epi32 SIMD::abs_epi32 - -#define _simd_cvtepu8_epi16 SIMD::cvtepu8_epi16 -#define _simd_cvtepu8_epi32 SIMD::cvtepu8_epi32 -#define _simd_cvtepu16_epi32 SIMD::cvtepu16_epi32 -#define _simd_cvtepu16_epi64 SIMD::cvtepu16_epi64 -#define _simd_cvtepu32_epi64 SIMD::cvtepu32_epi64 - -#define _simd_packus_epi16 SIMD::packus_epi16 -#define _simd_packs_epi16 SIMD::packs_epi16 -#define _simd_packus_epi32 SIMD::packus_epi32 -#define _simd_packs_epi32 SIMD::packs_epi32 - -#define _simd_unpacklo_ps SIMD::unpacklo_ps -#define _simd_unpackhi_ps SIMD::unpackhi_ps -#define _simd_unpacklo_pd SIMD::unpacklo_pd -#define _simd_unpackhi_pd SIMD::unpackhi_pd -#define _simd_insertf128_ps SIMD::insertf128_ps -#define _simd_insertf128_pd SIMD::insertf128_pd -#define _simd_insertf128_si(a, b, i) SIMD::insertf128_si<i>(a, b) -#define _simd_extractf128_ps(a, i) SIMD::extractf128_ps<i>(a) -#define _simd_extractf128_pd(a, i) SIMD::extractf128_pd<i>(a) -#define _simd_extractf128_si(a, i) SIMD::extractf128_si<i>(a) -#define _simd_permute2f128_ps(a, b, i) SIMD::permute2f128_ps<i>(a, b) -#define _simd_permute2f128_pd(a, b, i) SIMD::permute2f128_pd<i>(a, b) -#define _simd_permute2f128_si(a, b, i) SIMD::permute2f128_si<i>(a, b) -#define _simd_shuffle_ps(a, b, i) SIMD::shuffle_ps<i>(a, b) -#define _simd_shuffle_pd(a, b, i) SIMD::shuffle_pd<i>(a, b) -#define _simd_shuffle_epi32(a, b, imm8) SIMD::shuffle_epi32<imm8>(a, b) -#define _simd_shuffle_epi64(a, b, imm8) SIMD::shuffle_epi64<imm8>(a, b) -#define _simd_set1_epi32 SIMD::set1_epi32 -#define _simd_set_epi32 SIMD::set_epi32 -#define _simd_set_ps SIMD::set_ps -#define _simd_set1_epi8 SIMD::set1_epi8 -#define _simd_setzero_si SIMD::setzero_si -#define _simd_cvttps_epi32 SIMD::cvttps_epi32 -#define _simd_store_si SIMD::store_si -#define _simd_broadcast_ss SIMD::broadcast_ss -#define _simd_maskstore_ps SIMD::maskstore_ps -#define _simd_load_si SIMD::load_si -#define _simd_loadu_si SIMD::loadu_si -#define _simd_sub_ps SIMD::sub_ps -#define _simd_testz_ps SIMD::testz_ps -#define _simd_testz_si SIMD::testz_si -#define _simd_xor_ps SIMD::xor_ps - -#define _simd_loadu2_si SIMD::loadu2_si -#define _simd_storeu2_si SIMD::storeu2_si - -#define _simd_blendv_epi32 SIMD::blendv_epi32 -#define _simd_vmask_ps SIMD::vmask_ps - -template<int mask> SIMDINLINE -SIMD128::Integer _simd_blend4_epi32(SIMD128::Integer const &a, SIMD128::Integer const &b) +#endif // KNOB_SIMD16_WIDTH == 16 + +#define _simd128_maskstore_ps SIMD128::maskstore_ps +#define _simd128_fmadd_ps SIMD128::fmadd_ps + +#define _simd_load_ps SIMD::load_ps +#define _simd_load1_ps SIMD::broadcast_ss +#define _simd_loadu_ps SIMD::loadu_ps +#define _simd_setzero_ps SIMD::setzero_ps +#define _simd_set1_ps SIMD::set1_ps +#define _simd_blend_ps(a, b, i) SIMD::blend_ps<i>(a, b) +#define _simd_blend_epi32(a, b, i) SIMD::blend_epi32<i>(a, b) +#define _simd_blendv_ps SIMD::blendv_ps +#define _simd_store_ps SIMD::store_ps +#define _simd_mul_ps SIMD::mul_ps +#define _simd_add_ps SIMD::add_ps +#define _simd_sub_ps SIMD::sub_ps +#define _simd_rsqrt_ps SIMD::rsqrt_ps +#define _simd_min_ps SIMD::min_ps +#define _simd_max_ps SIMD::max_ps +#define _simd_movemask_ps SIMD::movemask_ps +#define _simd_cvtps_epi32 SIMD::cvtps_epi32 +#define _simd_cvttps_epi32 SIMD::cvttps_epi32 +#define _simd_cvtepi32_ps SIMD::cvtepi32_ps +#define _simd_cmplt_ps SIMD::cmplt_ps +#define _simd_cmpgt_ps SIMD::cmpgt_ps +#define _simd_cmpneq_ps SIMD::cmpneq_ps +#define _simd_cmpeq_ps SIMD::cmpeq_ps +#define _simd_cmpge_ps SIMD::cmpge_ps +#define _simd_cmple_ps SIMD::cmple_ps +#define _simd_cmp_ps(a, b, imm) SIMD::cmp_ps<SIMD::CompareType(imm)>(a, b) +#define _simd_and_ps SIMD::and_ps +#define _simd_or_ps SIMD::or_ps +#define _simd_rcp_ps SIMD::rcp_ps +#define _simd_div_ps SIMD::div_ps +#define _simd_castsi_ps SIMD::castsi_ps +#define _simd_castps_pd SIMD::castps_pd +#define _simd_castpd_ps SIMD::castpd_ps +#define _simd_andnot_ps SIMD::andnot_ps +#define _simd_round_ps(a, i) SIMD::round_ps<SIMD::RoundMode(i)>(a) +#define _simd_castpd_ps SIMD::castpd_ps +#define _simd_broadcast_ps(a) SIMD::broadcast_ps((SIMD128::Float const*)(a)) +#define _simd_stream_ps SIMD::stream_ps + +#define _simd_movemask_pd SIMD::movemask_pd +#define _simd_castsi_pd SIMD::castsi_pd + +#define _simd_mul_epi32 SIMD::mul_epi32 +#define _simd_mullo_epi32 SIMD::mullo_epi32 +#define _simd_sub_epi32 SIMD::sub_epi32 +#define _simd_sub_epi64 SIMD::sub_epi64 +#define _simd_min_epi32 SIMD::min_epi32 +#define _simd_min_epu32 SIMD::min_epu32 +#define _simd_max_epi32 SIMD::max_epi32 +#define _simd_max_epu32 SIMD::max_epu32 +#define _simd_add_epi32 SIMD::add_epi32 +#define _simd_and_si SIMD::and_si +#define _simd_andnot_si SIMD::andnot_si +#define _simd_cmpeq_epi32 SIMD::cmpeq_epi32 +#define _simd_cmplt_epi32 SIMD::cmplt_epi32 +#define _simd_cmpgt_epi32 SIMD::cmpgt_epi32 +#define _simd_or_si SIMD::or_si +#define _simd_xor_si SIMD::xor_si +#define _simd_castps_si SIMD::castps_si +#define _simd_adds_epu8 SIMD::adds_epu8 +#define _simd_subs_epu8 SIMD::subs_epu8 +#define _simd_add_epi8 SIMD::add_epi8 +#define _simd_cmpeq_epi64 SIMD::cmpeq_epi64 +#define _simd_cmpgt_epi64 SIMD::cmpgt_epi64 +#define _simd_cmpgt_epi8 SIMD::cmpgt_epi8 +#define _simd_cmpeq_epi8 SIMD::cmpeq_epi8 +#define _simd_cmpgt_epi16 SIMD::cmpgt_epi16 +#define _simd_cmpeq_epi16 SIMD::cmpeq_epi16 +#define _simd_movemask_epi8 SIMD::movemask_epi8 +#define _simd_permute_ps_i(a, i) SIMD::permute_ps<i>(a) +#define _simd_permute_ps SIMD::permute_ps +#define _simd_permute_epi32 SIMD::permute_epi32 +#define _simd_srlv_epi32 SIMD::srlv_epi32 +#define _simd_sllv_epi32 SIMD::sllv_epi32 + +#define _simd_unpacklo_epi8 SIMD::unpacklo_epi8 +#define _simd_unpackhi_epi8 SIMD::unpackhi_epi8 +#define _simd_unpacklo_epi16 SIMD::unpacklo_epi16 +#define _simd_unpackhi_epi16 SIMD::unpackhi_epi16 +#define _simd_unpacklo_epi32 SIMD::unpacklo_epi32 +#define _simd_unpackhi_epi32 SIMD::unpackhi_epi32 +#define _simd_unpacklo_epi64 SIMD::unpacklo_epi64 +#define _simd_unpackhi_epi64 SIMD::unpackhi_epi64 + +#define _simd_slli_epi32(a, i) SIMD::slli_epi32<i>(a) +#define _simd_srai_epi32(a, i) SIMD::srai_epi32<i>(a) +#define _simd_srli_epi32(a, i) SIMD::srli_epi32<i>(a) +#define _simd_srlisi_ps(a, i) SIMD::srlisi_ps<i>(a) + +#define _simd_fmadd_ps SIMD::fmadd_ps +#define _simd_fmsub_ps SIMD::fmsub_ps +#define _simd_shuffle_epi8 SIMD::shuffle_epi8 + +#define _simd_i32gather_ps(p, o, s) SIMD::i32gather_ps<SIMD::ScaleFactor(s)>(p, o) +#define _simd_mask_i32gather_ps(r, p, o, m, s) \ + SIMD::mask_i32gather_ps<SIMD::ScaleFactor(s)>(r, p, o, m) +#define _simd_abs_epi32 SIMD::abs_epi32 + +#define _simd_cvtepu8_epi16 SIMD::cvtepu8_epi16 +#define _simd_cvtepu8_epi32 SIMD::cvtepu8_epi32 +#define _simd_cvtepu16_epi32 SIMD::cvtepu16_epi32 +#define _simd_cvtepu16_epi64 SIMD::cvtepu16_epi64 +#define _simd_cvtepu32_epi64 SIMD::cvtepu32_epi64 + +#define _simd_packus_epi16 SIMD::packus_epi16 +#define _simd_packs_epi16 SIMD::packs_epi16 +#define _simd_packus_epi32 SIMD::packus_epi32 +#define _simd_packs_epi32 SIMD::packs_epi32 + +#define _simd_unpacklo_ps SIMD::unpacklo_ps +#define _simd_unpackhi_ps SIMD::unpackhi_ps +#define _simd_unpacklo_pd SIMD::unpacklo_pd +#define _simd_unpackhi_pd SIMD::unpackhi_pd +#define _simd_insertf128_ps SIMD::insertf128_ps +#define _simd_insertf128_pd SIMD::insertf128_pd +#define _simd_insertf128_si(a, b, i) SIMD::insertf128_si<i>(a, b) +#define _simd_extractf128_ps(a, i) SIMD::extractf128_ps<i>(a) +#define _simd_extractf128_pd(a, i) SIMD::extractf128_pd<i>(a) +#define _simd_extractf128_si(a, i) SIMD::extractf128_si<i>(a) +#define _simd_permute2f128_ps(a, b, i) SIMD::permute2f128_ps<i>(a, b) +#define _simd_permute2f128_pd(a, b, i) SIMD::permute2f128_pd<i>(a, b) +#define _simd_permute2f128_si(a, b, i) SIMD::permute2f128_si<i>(a, b) +#define _simd_shuffle_ps(a, b, i) SIMD::shuffle_ps<i>(a, b) +#define _simd_shuffle_pd(a, b, i) SIMD::shuffle_pd<i>(a, b) +#define _simd_shuffle_epi32(a, b, imm8) SIMD::shuffle_epi32<imm8>(a, b) +#define _simd_shuffle_epi64(a, b, imm8) SIMD::shuffle_epi64<imm8>(a, b) +#define _simd_set1_epi32 SIMD::set1_epi32 +#define _simd_set_epi32 SIMD::set_epi32 +#define _simd_set_ps SIMD::set_ps +#define _simd_set1_epi8 SIMD::set1_epi8 +#define _simd_setzero_si SIMD::setzero_si +#define _simd_cvttps_epi32 SIMD::cvttps_epi32 +#define _simd_store_si SIMD::store_si +#define _simd_broadcast_ss SIMD::broadcast_ss +#define _simd_maskstore_ps SIMD::maskstore_ps +#define _simd_load_si SIMD::load_si +#define _simd_loadu_si SIMD::loadu_si +#define _simd_sub_ps SIMD::sub_ps +#define _simd_testz_ps SIMD::testz_ps +#define _simd_testz_si SIMD::testz_si +#define _simd_xor_ps SIMD::xor_ps + +#define _simd_loadu2_si SIMD::loadu2_si +#define _simd_storeu2_si SIMD::storeu2_si + +#define _simd_blendv_epi32 SIMD::blendv_epi32 +#define _simd_vmask_ps SIMD::vmask_ps + +template <int mask> +SIMDINLINE SIMD128::Integer _simd_blend4_epi32(SIMD128::Integer const& a, SIMD128::Integer const& b) { - return SIMD128::castps_si(SIMD128::blend_ps<mask>(SIMD128::castsi_ps(a), SIMD128::castsi_ps(b))); + return SIMD128::castps_si( + SIMD128::blend_ps<mask>(SIMD128::castsi_ps(a), SIMD128::castsi_ps(b))); } SIMDINLINE -void _simd_mov(simdscalar &r, unsigned int rlane, simdscalar& s, unsigned int slane) +void _simd_mov(simdscalar& r, unsigned int rlane, simdscalar& s, unsigned int slane) { OSALIGNSIMD(float) rArray[KNOB_SIMD_WIDTH], sArray[KNOB_SIMD_WIDTH]; SIMD256::store_ps(rArray, r); SIMD256::store_ps(sArray, s); rArray[rlane] = sArray[slane]; - r = SIMD256::load_ps(rArray); + r = SIMD256::load_ps(rArray); } // Populates a simdvector from a vector. So p = xyzw becomes xxxx yyyy zzzz wwww. @@ -228,34 +229,42 @@ void _simdvec_mov(simdvector &r, unsigned int rlane, simdvector& s, unsigned int #endif -#define _simdvec_dp3_ps SIMD::vec4_dp3_ps -#define _simdvec_dp4_ps SIMD::vec4_dp4_ps -#define _simdvec_rcp_length_ps SIMD::vec4_rcp_length_ps -#define _simdvec_normalize_ps SIMD::vec4_normalize_ps -#define _simdvec_mul_ps SIMD::vec4_mul_ps -#define _simdvec_add_ps SIMD::vec4_add_ps -#define _simdvec_min_ps SIMD::vec4_min_ps -#define _simdvec_max_ps SIMD::vec4_max_ps -#define _simd_mat4x4_vec4_multiply SIMD::mat4x4_vec4_multiply -#define _simd_mat3x3_vec3_w0_multiply SIMD::mat3x3_vec3_w0_multiply -#define _simd_mat4x4_vec3_w1_multiply SIMD::mat4x4_vec3_w1_multiply -#define _simd_mat4x3_vec3_w1_multiply SIMD::mat4x3_vec3_w1_multiply +#define _simdvec_dp3_ps SIMD::vec4_dp3_ps +#define _simdvec_dp4_ps SIMD::vec4_dp4_ps +#define _simdvec_rcp_length_ps SIMD::vec4_rcp_length_ps +#define _simdvec_normalize_ps SIMD::vec4_normalize_ps +#define _simdvec_mul_ps SIMD::vec4_mul_ps +#define _simdvec_add_ps SIMD::vec4_add_ps +#define _simdvec_min_ps SIMD::vec4_min_ps +#define _simdvec_max_ps SIMD::vec4_max_ps +#define _simd_mat4x4_vec4_multiply SIMD::mat4x4_vec4_multiply +#define _simd_mat3x3_vec3_w0_multiply SIMD::mat3x3_vec3_w0_multiply +#define _simd_mat4x4_vec3_w1_multiply SIMD::mat4x4_vec3_w1_multiply +#define _simd_mat4x3_vec3_w1_multiply SIMD::mat4x3_vec3_w1_multiply ////////////////////////////////////////////////////////////////////////// /// @brief Compute plane equation vA * vX + vB * vY + vC -SIMDINLINE simdscalar vplaneps(simdscalar const &vA, simdscalar const &vB, simdscalar const &vC, simdscalar const &vX, simdscalar const &vY) +SIMDINLINE simdscalar vplaneps(simdscalar const& vA, + simdscalar const& vB, + simdscalar const& vC, + simdscalar const& vX, + simdscalar const& vY) { simdscalar vOut = _simd_fmadd_ps(vA, vX, vC); - vOut = _simd_fmadd_ps(vB, vY, vOut); + vOut = _simd_fmadd_ps(vB, vY, vOut); return vOut; } ////////////////////////////////////////////////////////////////////////// /// @brief Compute plane equation vA * vX + vB * vY + vC -SIMDINLINE simd4scalar vplaneps(simd4scalar const &vA, simd4scalar const &vB, simd4scalar const &vC, simd4scalar const &vX, simd4scalar const &vY) +SIMDINLINE simd4scalar vplaneps(simd4scalar const& vA, + simd4scalar const& vB, + simd4scalar const& vC, + simd4scalar const& vX, + simd4scalar const& vY) { simd4scalar vOut = _simd128_fmadd_ps(vA, vX, vC); - vOut = _simd128_fmadd_ps(vB, vY, vOut); + vOut = _simd128_fmadd_ps(vB, vY, vOut); return vOut; } @@ -264,30 +273,32 @@ SIMDINLINE simd4scalar vplaneps(simd4scalar const &vA, simd4scalar const &vB, si /// @param vI - barycentric I /// @param vJ - barycentric J /// @param pInterpBuffer - pointer to attribute barycentric coeffs -template<UINT Attrib, UINT Comp, UINT numComponents = 4> -static SIMDINLINE simdscalar InterpolateComponent(simdscalar const &vI, simdscalar const &vJ, const float *pInterpBuffer) +template <UINT Attrib, UINT Comp, UINT numComponents = 4> +static SIMDINLINE simdscalar InterpolateComponent(simdscalar const& vI, + simdscalar const& vJ, + const float* pInterpBuffer) { - const float *pInterpA = &pInterpBuffer[Attrib * 3 * numComponents + 0 + Comp]; - const float *pInterpB = &pInterpBuffer[Attrib * 3 * numComponents + numComponents + Comp]; - const float *pInterpC = &pInterpBuffer[Attrib * 3 * numComponents + numComponents * 2 + Comp]; + const float* pInterpA = &pInterpBuffer[Attrib * 3 * numComponents + 0 + Comp]; + const float* pInterpB = &pInterpBuffer[Attrib * 3 * numComponents + numComponents + Comp]; + const float* pInterpC = &pInterpBuffer[Attrib * 3 * numComponents + numComponents * 2 + Comp]; simdscalar vA = _simd_broadcast_ss(pInterpA); simdscalar vB = _simd_broadcast_ss(pInterpB); simdscalar vC = _simd_broadcast_ss(pInterpC); simdscalar vk = _simd_sub_ps(_simd_sub_ps(_simd_set1_ps(1.0f), vI), vJ); - vC = _simd_mul_ps(vk, vC); - + vC = _simd_mul_ps(vk, vC); + return vplaneps(vA, vB, vC, vI, vJ); } ////////////////////////////////////////////////////////////////////////// /// @brief Interpolates a single component (flat shade). /// @param pInterpBuffer - pointer to attribute barycentric coeffs -template<UINT Attrib, UINT Comp, UINT numComponents = 4> -static SIMDINLINE simdscalar InterpolateComponentFlat(const float *pInterpBuffer) +template <UINT Attrib, UINT Comp, UINT numComponents = 4> +static SIMDINLINE simdscalar InterpolateComponentFlat(const float* pInterpBuffer) { - const float *pInterpA = &pInterpBuffer[Attrib * 3 * numComponents + 0 + Comp]; + const float* pInterpA = &pInterpBuffer[Attrib * 3 * numComponents + 0 + Comp]; simdscalar vA = _simd_broadcast_ss(pInterpA); @@ -299,38 +310,39 @@ static SIMDINLINE simdscalar InterpolateComponentFlat(const float *pInterpBuffer /// @param vI - barycentric I /// @param vJ - barycentric J /// @param pInterpBuffer - pointer to attribute barycentric coeffs -template<UINT Attrib, UINT Comp, UINT numComponents = 4> -static SIMDINLINE simd4scalar InterpolateComponent(simd4scalar const &vI, simd4scalar const &vJ, const float *pInterpBuffer) +template <UINT Attrib, UINT Comp, UINT numComponents = 4> +static SIMDINLINE simd4scalar InterpolateComponent(simd4scalar const& vI, + simd4scalar const& vJ, + const float* pInterpBuffer) { - const float *pInterpA = &pInterpBuffer[Attrib * 3 * numComponents + 0 + Comp]; - const float *pInterpB = &pInterpBuffer[Attrib * 3 * numComponents + numComponents + Comp]; - const float *pInterpC = &pInterpBuffer[Attrib * 3 * numComponents + numComponents * 2 + Comp]; + const float* pInterpA = &pInterpBuffer[Attrib * 3 * numComponents + 0 + Comp]; + const float* pInterpB = &pInterpBuffer[Attrib * 3 * numComponents + numComponents + Comp]; + const float* pInterpC = &pInterpBuffer[Attrib * 3 * numComponents + numComponents * 2 + Comp]; simd4scalar vA = SIMD128::broadcast_ss(pInterpA); simd4scalar vB = SIMD128::broadcast_ss(pInterpB); simd4scalar vC = SIMD128::broadcast_ss(pInterpC); simd4scalar vk = SIMD128::sub_ps(SIMD128::sub_ps(SIMD128::set1_ps(1.0f), vI), vJ); - vC = SIMD128::mul_ps(vk, vC); + vC = SIMD128::mul_ps(vk, vC); return vplaneps(vA, vB, vC, vI, vJ); } -static SIMDINLINE simd4scalar _simd128_abs_ps(simd4scalar const &a) +static SIMDINLINE simd4scalar _simd128_abs_ps(simd4scalar const& a) { simd4scalari ai = SIMD128::castps_si(a); return SIMD128::castsi_ps(SIMD128::and_si(ai, SIMD128::set1_epi32(0x7fffffff))); } -static SIMDINLINE simdscalar _simd_abs_ps(simdscalar const &a) +static SIMDINLINE simdscalar _simd_abs_ps(simdscalar const& a) { simdscalari ai = _simd_castps_si(a); return _simd_castsi_ps(_simd_and_si(ai, _simd_set1_epi32(0x7fffffff))); } - #if ENABLE_AVX512_SIMD16 #include "simd16intrin.h" -#endif//ENABLE_AVX512_SIMD16 +#endif // ENABLE_AVX512_SIMD16 -#endif//__SWR_SIMDINTRIN_H__ +#endif //__SWR_SIMDINTRIN_H__ diff --git a/src/gallium/drivers/swr/rasterizer/common/simdlib.hpp b/src/gallium/drivers/swr/rasterizer/common/simdlib.hpp index 24cf27d4dbc..bd48fb2aae7 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdlib.hpp +++ b/src/gallium/drivers/swr/rasterizer/common/simdlib.hpp @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2017 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2017 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #pragma once #include "simdlib_types.hpp" @@ -38,8 +38,7 @@ namespace SIMDImpl #include "simdlib_128_avx.inl" #undef __SIMD_LIB_AVX_HPP__ }; // struct AVXImpl -#endif // #if SIMD_ARCH >= SIMD_ARCH_AVX - +#endif // #if SIMD_ARCH >= SIMD_ARCH_AVX #if SIMD_ARCH >= SIMD_ARCH_AVX2 struct AVX2Impl : AVXImpl @@ -48,7 +47,7 @@ namespace SIMDImpl #include "simdlib_128_avx2.inl" #undef __SIMD_LIB_AVX2_HPP__ }; // struct AVX2Impl -#endif // #if SIMD_ARCH >= SIMD_ARCH_AVX2 +#endif // #if SIMD_ARCH >= SIMD_ARCH_AVX2 #if SIMD_ARCH >= SIMD_ARCH_AVX512 struct AVX512Impl : AVX2Impl @@ -62,9 +61,9 @@ namespace SIMDImpl #include "simdlib_128_avx512_core.inl" #endif // defined(SIMD_ARCH_KNIGHTS) #undef __SIMD_LIB_AVX512_HPP__ -#endif // SIMD_OPT_128_AVX512 +#endif // SIMD_OPT_128_AVX512 }; // struct AVX2Impl -#endif // #if SIMD_ARCH >= SIMD_ARCH_AVX512 +#endif // #if SIMD_ARCH >= SIMD_ARCH_AVX512 struct Traits : SIMDImpl::Traits { @@ -78,13 +77,13 @@ namespace SIMDImpl #error Invalid value for SIMD_ARCH #endif - using Float = SIMD128Impl::Float; - using Double = SIMD128Impl::Double; - using Integer = SIMD128Impl::Integer; - using Vec4 = SIMD128Impl::Vec4; - using Mask = SIMD128Impl::Mask; + using Float = SIMD128Impl::Float; + using Double = SIMD128Impl::Double; + using Integer = SIMD128Impl::Integer; + using Vec4 = SIMD128Impl::Vec4; + using Mask = SIMD128Impl::Mask; }; - } // ns SIMD128Impl + } // namespace SIMD128Impl namespace SIMD256Impl { @@ -95,8 +94,7 @@ namespace SIMDImpl #include "simdlib_256_avx.inl" #undef __SIMD_LIB_AVX_HPP__ }; // struct AVXImpl -#endif // #if SIMD_ARCH >= SIMD_ARCH_AVX - +#endif // #if SIMD_ARCH >= SIMD_ARCH_AVX #if SIMD_ARCH >= SIMD_ARCH_AVX2 struct AVX2Impl : AVXImpl @@ -105,7 +103,7 @@ namespace SIMDImpl #include "simdlib_256_avx2.inl" #undef __SIMD_LIB_AVX2_HPP__ }; // struct AVX2Impl -#endif // #if SIMD_ARCH >= SIMD_ARCH_AVX2 +#endif // #if SIMD_ARCH >= SIMD_ARCH_AVX2 #if SIMD_ARCH >= SIMD_ARCH_AVX512 struct AVX512Impl : AVX2Impl @@ -119,9 +117,9 @@ namespace SIMDImpl #include "simdlib_256_avx512_core.inl" #endif // defined(SIMD_ARCH_KNIGHTS) #undef __SIMD_LIB_AVX512_HPP__ -#endif // SIMD_OPT_256_AVX512 +#endif // SIMD_OPT_256_AVX512 }; // struct AVX2Impl -#endif // #if SIMD_ARCH >= SIMD_ARCH_AVX512 +#endif // #if SIMD_ARCH >= SIMD_ARCH_AVX512 struct Traits : SIMDImpl::Traits { @@ -135,18 +133,18 @@ namespace SIMDImpl #error Invalid value for SIMD_ARCH #endif - using Float = SIMD256Impl::Float; - using Double = SIMD256Impl::Double; - using Integer = SIMD256Impl::Integer; - using Vec4 = SIMD256Impl::Vec4; - using Mask = SIMD256Impl::Mask; + using Float = SIMD256Impl::Float; + using Double = SIMD256Impl::Double; + using Integer = SIMD256Impl::Integer; + using Vec4 = SIMD256Impl::Vec4; + using Mask = SIMD256Impl::Mask; }; - } // ns SIMD256Impl + } // namespace SIMD256Impl namespace SIMD512Impl { #if SIMD_ARCH >= SIMD_ARCH_AVX - template<typename SIMD256T> + template <typename SIMD256T> struct AVXImplBase { #define __SIMD_LIB_AVX_HPP__ @@ -157,12 +155,10 @@ namespace SIMDImpl using AVXImpl = AVXImplBase<SIMD256Impl::AVXImpl>; #endif // #if SIMD_ARCH >= SIMD_ARCH_AVX - #if SIMD_ARCH >= SIMD_ARCH_AVX2 using AVX2Impl = AVXImplBase<SIMD256Impl::AVX2Impl>; #endif // #if SIMD_ARCH >= SIMD_ARCH_AVX2 - #if SIMD_ARCH >= SIMD_ARCH_AVX512 struct AVX512Impl : AVXImplBase<SIMD256Impl::AVX512Impl> { @@ -178,7 +174,7 @@ namespace SIMDImpl #endif // defined(SIMD_ARCH_KNIGHTS) #undef __SIMD_LIB_AVX512_HPP__ }; // struct AVX512ImplBase -#endif // #if SIMD_ARCH >= SIMD_ARCH_AVX512 +#endif // #if SIMD_ARCH >= SIMD_ARCH_AVX512 struct Traits : SIMDImpl::Traits { @@ -192,33 +188,32 @@ namespace SIMDImpl #error Invalid value for SIMD_ARCH #endif - using Float = SIMD512Impl::Float; - using Double = SIMD512Impl::Double; - using Integer = SIMD512Impl::Integer; - using Vec4 = SIMD512Impl::Vec4; - using Mask = SIMD512Impl::Mask; + using Float = SIMD512Impl::Float; + using Double = SIMD512Impl::Double; + using Integer = SIMD512Impl::Integer; + using Vec4 = SIMD512Impl::Vec4; + using Mask = SIMD512Impl::Mask; }; - } // ns SIMD512Impl -} // ns SIMDImpl + } // namespace SIMD512Impl +} // namespace SIMDImpl template <typename Traits> struct SIMDBase : Traits::IsaImpl { - using CompareType = typename Traits::CompareType; - using ScaleFactor = typename Traits::ScaleFactor; - using RoundMode = typename Traits::RoundMode; - using SIMD = typename Traits::IsaImpl; - using Float = typename Traits::Float; - using Double = typename Traits::Double; - using Integer = typename Traits::Integer; - using Vec4 = typename Traits::Vec4; - using Mask = typename Traits::Mask; + using CompareType = typename Traits::CompareType; + using ScaleFactor = typename Traits::ScaleFactor; + using RoundMode = typename Traits::RoundMode; + using SIMD = typename Traits::IsaImpl; + using Float = typename Traits::Float; + using Double = typename Traits::Double; + using Integer = typename Traits::Integer; + using Vec4 = typename Traits::Vec4; + using Mask = typename Traits::Mask; static const size_t VECTOR_BYTES = sizeof(Float); // Populates a SIMD Vec4 from a non-simd vector. So p = xyzw becomes xxxx yyyy zzzz wwww. - static SIMDINLINE - void vec4_load1_ps(Vec4& r, const float *p) + static SIMDINLINE void vec4_load1_ps(Vec4& r, const float* p) { r[0] = SIMD::set1_ps(p[0]); r[1] = SIMD::set1_ps(p[1]); @@ -226,8 +221,7 @@ struct SIMDBase : Traits::IsaImpl r[3] = SIMD::set1_ps(p[3]); } - static SIMDINLINE - void vec4_set1_vps(Vec4& r, Float const &s) + static SIMDINLINE void vec4_set1_vps(Vec4& r, Float const& s) { r[0] = s; r[1] = s; @@ -235,48 +229,44 @@ struct SIMDBase : Traits::IsaImpl r[3] = s; } - static SIMDINLINE - Float vec4_dp3_ps(const Vec4& v0, const Vec4& v1) + static SIMDINLINE Float vec4_dp3_ps(const Vec4& v0, const Vec4& v1) { Float tmp, r; - r = SIMD::mul_ps(v0[0], v1[0]); // (v0.x*v1.x) + r = SIMD::mul_ps(v0[0], v1[0]); // (v0.x*v1.x) - tmp = SIMD::mul_ps(v0[1], v1[1]); // (v0.y*v1.y) - r = SIMD::add_ps(r, tmp); // (v0.x*v1.x) + (v0.y*v1.y) + tmp = SIMD::mul_ps(v0[1], v1[1]); // (v0.y*v1.y) + r = SIMD::add_ps(r, tmp); // (v0.x*v1.x) + (v0.y*v1.y) - tmp = SIMD::mul_ps(v0[2], v1[2]); // (v0.z*v1.z) - r = SIMD::add_ps(r, tmp); // (v0.x*v1.x) + (v0.y*v1.y) + (v0.z*v1.z) + tmp = SIMD::mul_ps(v0[2], v1[2]); // (v0.z*v1.z) + r = SIMD::add_ps(r, tmp); // (v0.x*v1.x) + (v0.y*v1.y) + (v0.z*v1.z) return r; } - static SIMDINLINE - Float vec4_dp4_ps(const Vec4& v0, const Vec4& v1) + static SIMDINLINE Float vec4_dp4_ps(const Vec4& v0, const Vec4& v1) { Float tmp, r; - r = SIMD::mul_ps(v0[0], v1[0]); // (v0.x*v1.x) + r = SIMD::mul_ps(v0[0], v1[0]); // (v0.x*v1.x) - tmp = SIMD::mul_ps(v0[1], v1[1]); // (v0.y*v1.y) - r = SIMD::add_ps(r, tmp); // (v0.x*v1.x) + (v0.y*v1.y) + tmp = SIMD::mul_ps(v0[1], v1[1]); // (v0.y*v1.y) + r = SIMD::add_ps(r, tmp); // (v0.x*v1.x) + (v0.y*v1.y) - tmp = SIMD::mul_ps(v0[2], v1[2]); // (v0.z*v1.z) - r = SIMD::add_ps(r, tmp); // (v0.x*v1.x) + (v0.y*v1.y) + (v0.z*v1.z) + tmp = SIMD::mul_ps(v0[2], v1[2]); // (v0.z*v1.z) + r = SIMD::add_ps(r, tmp); // (v0.x*v1.x) + (v0.y*v1.y) + (v0.z*v1.z) - tmp = SIMD::mul_ps(v0[3], v1[3]); // (v0.w*v1.w) - r = SIMD::add_ps(r, tmp); // (v0.x*v1.x) + (v0.y*v1.y) + (v0.z*v1.z) + tmp = SIMD::mul_ps(v0[3], v1[3]); // (v0.w*v1.w) + r = SIMD::add_ps(r, tmp); // (v0.x*v1.x) + (v0.y*v1.y) + (v0.z*v1.z) return r; } - static SIMDINLINE - Float vec4_rcp_length_ps(const Vec4& v) + static SIMDINLINE Float vec4_rcp_length_ps(const Vec4& v) { Float length = vec4_dp4_ps(v, v); return SIMD::rsqrt_ps(length); } - static SIMDINLINE - void vec4_normalize_ps(Vec4& r, const Vec4& v) + static SIMDINLINE void vec4_normalize_ps(Vec4& r, const Vec4& v) { Float rcpLength = vec4_rcp_length_ps(v); @@ -286,8 +276,7 @@ struct SIMDBase : Traits::IsaImpl r[3] = SIMD::mul_ps(v[3], rcpLength); } - static SIMDINLINE - void vec4_mul_ps(Vec4& r, const Vec4& v, Float const &s) + static SIMDINLINE void vec4_mul_ps(Vec4& r, const Vec4& v, Float const& s) { r[0] = SIMD::mul_ps(v[0], s); r[1] = SIMD::mul_ps(v[1], s); @@ -295,8 +284,7 @@ struct SIMDBase : Traits::IsaImpl r[3] = SIMD::mul_ps(v[3], s); } - static SIMDINLINE - void vec4_mul_ps(Vec4& r, const Vec4& v0, const Vec4& v1) + static SIMDINLINE void vec4_mul_ps(Vec4& r, const Vec4& v0, const Vec4& v1) { r[0] = SIMD::mul_ps(v0[0], v1[0]); r[1] = SIMD::mul_ps(v0[1], v1[1]); @@ -304,8 +292,7 @@ struct SIMDBase : Traits::IsaImpl r[3] = SIMD::mul_ps(v0[3], v1[3]); } - static SIMDINLINE - void vec4_add_ps(Vec4& r, const Vec4& v0, Float const &s) + static SIMDINLINE void vec4_add_ps(Vec4& r, const Vec4& v0, Float const& s) { r[0] = SIMD::add_ps(v0[0], s); r[1] = SIMD::add_ps(v0[1], s); @@ -313,8 +300,7 @@ struct SIMDBase : Traits::IsaImpl r[3] = SIMD::add_ps(v0[3], s); } - static SIMDINLINE - void vec4_add_ps(Vec4& r, const Vec4& v0, const Vec4& v1) + static SIMDINLINE void vec4_add_ps(Vec4& r, const Vec4& v0, const Vec4& v1) { r[0] = SIMD::add_ps(v0[0], v1[0]); r[1] = SIMD::add_ps(v0[1], v1[1]); @@ -322,8 +308,7 @@ struct SIMDBase : Traits::IsaImpl r[3] = SIMD::add_ps(v0[3], v1[3]); } - static SIMDINLINE - void vec4_min_ps(Vec4& r, const Vec4& v0, Float const &s) + static SIMDINLINE void vec4_min_ps(Vec4& r, const Vec4& v0, Float const& s) { r[0] = SIMD::min_ps(v0[0], s); r[1] = SIMD::min_ps(v0[1], s); @@ -331,8 +316,7 @@ struct SIMDBase : Traits::IsaImpl r[3] = SIMD::min_ps(v0[3], s); } - static SIMDINLINE - void vec4_max_ps(Vec4& r, const Vec4& v0, Float const &s) + static SIMDINLINE void vec4_max_ps(Vec4& r, const Vec4& v0, Float const& s) { r[0] = SIMD::max_ps(v0[0], s); r[1] = SIMD::max_ps(v0[1], s); @@ -345,66 +329,64 @@ struct SIMDBase : Traits::IsaImpl // outVec.y = (m10 * v.x) + (m11 * v.y) + (m12 * v.z) + (m13 * v.w) // outVec.z = (m20 * v.x) + (m21 * v.y) + (m22 * v.z) + (m23 * v.w) // outVec.w = (m30 * v.x) + (m31 * v.y) + (m32 * v.z) + (m33 * v.w) - static SIMDINLINE - void SIMDCALL mat4x4_vec4_multiply( - Vec4& result, - const float *pMatrix, - const Vec4& v) + static SIMDINLINE void SIMDCALL mat4x4_vec4_multiply(Vec4& result, + const float* pMatrix, + const Vec4& v) { Float m; Float r0; Float r1; - m = SIMD::load1_ps(pMatrix + 0*4 + 0); // m[row][0] - r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) - m = SIMD::load1_ps(pMatrix + 0*4 + 1); // m[row][1] - r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) - m = SIMD::load1_ps(pMatrix + 0*4 + 2); // m[row][2] - r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) - m = SIMD::load1_ps(pMatrix + 0*4 + 3); // m[row][3] - r1 = SIMD::mul_ps(m, v[3]); // (m3 * v.z) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + (m2 * v.w) + m = SIMD::load1_ps(pMatrix + 0 * 4 + 0); // m[row][0] + r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) + m = SIMD::load1_ps(pMatrix + 0 * 4 + 1); // m[row][1] + r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + m = SIMD::load1_ps(pMatrix + 0 * 4 + 2); // m[row][2] + r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + m = SIMD::load1_ps(pMatrix + 0 * 4 + 3); // m[row][3] + r1 = SIMD::mul_ps(m, v[3]); // (m3 * v.z) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + (m2 * v.w) result[0] = r0; - m = SIMD::load1_ps(pMatrix + 1*4 + 0); // m[row][0] - r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) - m = SIMD::load1_ps(pMatrix + 1*4 + 1); // m[row][1] - r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) - m = SIMD::load1_ps(pMatrix + 1*4 + 2); // m[row][2] - r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) - m = SIMD::load1_ps(pMatrix + 1*4 + 3); // m[row][3] - r1 = SIMD::mul_ps(m, v[3]); // (m3 * v.z) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + (m2 * v.w) + m = SIMD::load1_ps(pMatrix + 1 * 4 + 0); // m[row][0] + r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) + m = SIMD::load1_ps(pMatrix + 1 * 4 + 1); // m[row][1] + r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + m = SIMD::load1_ps(pMatrix + 1 * 4 + 2); // m[row][2] + r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + m = SIMD::load1_ps(pMatrix + 1 * 4 + 3); // m[row][3] + r1 = SIMD::mul_ps(m, v[3]); // (m3 * v.z) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + (m2 * v.w) result[1] = r0; - m = SIMD::load1_ps(pMatrix + 2*4 + 0); // m[row][0] - r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) - m = SIMD::load1_ps(pMatrix + 2*4 + 1); // m[row][1] - r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) - m = SIMD::load1_ps(pMatrix + 2*4 + 2); // m[row][2] - r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) - m = SIMD::load1_ps(pMatrix + 2*4 + 3); // m[row][3] - r1 = SIMD::mul_ps(m, v[3]); // (m3 * v.z) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + (m2 * v.w) + m = SIMD::load1_ps(pMatrix + 2 * 4 + 0); // m[row][0] + r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) + m = SIMD::load1_ps(pMatrix + 2 * 4 + 1); // m[row][1] + r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + m = SIMD::load1_ps(pMatrix + 2 * 4 + 2); // m[row][2] + r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + m = SIMD::load1_ps(pMatrix + 2 * 4 + 3); // m[row][3] + r1 = SIMD::mul_ps(m, v[3]); // (m3 * v.z) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + (m2 * v.w) result[2] = r0; - m = SIMD::load1_ps(pMatrix + 3*4 + 0); // m[row][0] - r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) - m = SIMD::load1_ps(pMatrix + 3*4 + 1); // m[row][1] - r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) - m = SIMD::load1_ps(pMatrix + 3*4 + 2); // m[row][2] - r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) - m = SIMD::load1_ps(pMatrix + 3*4 + 3); // m[row][3] - r1 = SIMD::mul_ps(m, v[3]); // (m3 * v.z) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + (m2 * v.w) + m = SIMD::load1_ps(pMatrix + 3 * 4 + 0); // m[row][0] + r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) + m = SIMD::load1_ps(pMatrix + 3 * 4 + 1); // m[row][1] + r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + m = SIMD::load1_ps(pMatrix + 3 * 4 + 2); // m[row][2] + r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + m = SIMD::load1_ps(pMatrix + 3 * 4 + 3); // m[row][3] + r1 = SIMD::mul_ps(m, v[3]); // (m3 * v.z) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + (m2 * v.w) result[3] = r0; } @@ -413,44 +395,42 @@ struct SIMDBase : Traits::IsaImpl // outVec.y = (m10 * v.x) + (m11 * v.y) + (m12 * v.z) + (m13 * 0) // outVec.z = (m20 * v.x) + (m21 * v.y) + (m22 * v.z) + (m23 * 0) // outVec.w = (m30 * v.x) + (m31 * v.y) + (m32 * v.z) + (m33 * 0) - static SIMDINLINE - void SIMDCALL mat3x3_vec3_w0_multiply( - Vec4& result, - const float *pMatrix, - const Vec4& v) + static SIMDINLINE void SIMDCALL mat3x3_vec3_w0_multiply(Vec4& result, + const float* pMatrix, + const Vec4& v) { Float m; Float r0; Float r1; - m = SIMD::load1_ps(pMatrix + 0*4 + 0); // m[row][0] - r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) - m = SIMD::load1_ps(pMatrix + 0*4 + 1); // m[row][1] - r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) - m = SIMD::load1_ps(pMatrix + 0*4 + 2); // m[row][2] - r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + m = SIMD::load1_ps(pMatrix + 0 * 4 + 0); // m[row][0] + r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) + m = SIMD::load1_ps(pMatrix + 0 * 4 + 1); // m[row][1] + r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + m = SIMD::load1_ps(pMatrix + 0 * 4 + 2); // m[row][2] + r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) result[0] = r0; - m = SIMD::load1_ps(pMatrix + 1*4 + 0); // m[row][0] - r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) - m = SIMD::load1_ps(pMatrix + 1*4 + 1); // m[row][1] - r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) - m = SIMD::load1_ps(pMatrix + 1*4 + 2); // m[row][2] - r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + m = SIMD::load1_ps(pMatrix + 1 * 4 + 0); // m[row][0] + r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) + m = SIMD::load1_ps(pMatrix + 1 * 4 + 1); // m[row][1] + r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + m = SIMD::load1_ps(pMatrix + 1 * 4 + 2); // m[row][2] + r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) result[1] = r0; - m = SIMD::load1_ps(pMatrix + 2*4 + 0); // m[row][0] - r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) - m = SIMD::load1_ps(pMatrix + 2*4 + 1); // m[row][1] - r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) - m = SIMD::load1_ps(pMatrix + 2*4 + 2); // m[row][2] - r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + m = SIMD::load1_ps(pMatrix + 2 * 4 + 0); // m[row][0] + r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) + m = SIMD::load1_ps(pMatrix + 2 * 4 + 1); // m[row][1] + r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + m = SIMD::load1_ps(pMatrix + 2 * 4 + 2); // m[row][2] + r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) result[2] = r0; result[3] = SIMD::setzero_ps(); @@ -461,108 +441,104 @@ struct SIMDBase : Traits::IsaImpl // outVec.y = (m10 * v.x) + (m11 * v.y) + (m12 * v.z) + (m13 * 1) // outVec.z = (m20 * v.x) + (m21 * v.y) + (m22 * v.z) + (m23 * 1) // outVec.w = (m30 * v.x) + (m31 * v.y) + (m32 * v.z) + (m33 * 1) - static SIMDINLINE - void SIMDCALL mat4x4_vec3_w1_multiply( - Vec4& result, - const float *pMatrix, - const Vec4& v) + static SIMDINLINE void SIMDCALL mat4x4_vec3_w1_multiply(Vec4& result, + const float* pMatrix, + const Vec4& v) { Float m; Float r0; Float r1; - m = SIMD::load1_ps(pMatrix + 0*4 + 0); // m[row][0] - r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) - m = SIMD::load1_ps(pMatrix + 0*4 + 1); // m[row][1] - r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) - m = SIMD::load1_ps(pMatrix + 0*4 + 2); // m[row][2] - r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) - m = SIMD::load1_ps(pMatrix + 0*4 + 3); // m[row][3] - r0 = SIMD::add_ps(r0, m); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + (m2 * 1) + m = SIMD::load1_ps(pMatrix + 0 * 4 + 0); // m[row][0] + r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) + m = SIMD::load1_ps(pMatrix + 0 * 4 + 1); // m[row][1] + r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + m = SIMD::load1_ps(pMatrix + 0 * 4 + 2); // m[row][2] + r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + m = SIMD::load1_ps(pMatrix + 0 * 4 + 3); // m[row][3] + r0 = SIMD::add_ps(r0, m); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + (m2 * 1) result[0] = r0; - m = SIMD::load1_ps(pMatrix + 1*4 + 0); // m[row][0] - r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) - m = SIMD::load1_ps(pMatrix + 1*4 + 1); // m[row][1] - r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) - m = SIMD::load1_ps(pMatrix + 1*4 + 2); // m[row][2] - r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) - m = SIMD::load1_ps(pMatrix + 1*4 + 3); // m[row][3] - r0 = SIMD::add_ps(r0, m); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + (m2 * 1) + m = SIMD::load1_ps(pMatrix + 1 * 4 + 0); // m[row][0] + r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) + m = SIMD::load1_ps(pMatrix + 1 * 4 + 1); // m[row][1] + r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + m = SIMD::load1_ps(pMatrix + 1 * 4 + 2); // m[row][2] + r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + m = SIMD::load1_ps(pMatrix + 1 * 4 + 3); // m[row][3] + r0 = SIMD::add_ps(r0, m); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + (m2 * 1) result[1] = r0; - m = SIMD::load1_ps(pMatrix + 2*4 + 0); // m[row][0] - r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) - m = SIMD::load1_ps(pMatrix + 2*4 + 1); // m[row][1] - r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) - m = SIMD::load1_ps(pMatrix + 2*4 + 2); // m[row][2] - r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) - m = SIMD::load1_ps(pMatrix + 2*4 + 3); // m[row][3] - r0 = SIMD::add_ps(r0, m); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + (m2 * 1) + m = SIMD::load1_ps(pMatrix + 2 * 4 + 0); // m[row][0] + r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) + m = SIMD::load1_ps(pMatrix + 2 * 4 + 1); // m[row][1] + r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + m = SIMD::load1_ps(pMatrix + 2 * 4 + 2); // m[row][2] + r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + m = SIMD::load1_ps(pMatrix + 2 * 4 + 3); // m[row][3] + r0 = SIMD::add_ps(r0, m); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + (m2 * 1) result[2] = r0; - m = SIMD::load1_ps(pMatrix + 3*4 + 0); // m[row][0] - r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) - m = SIMD::load1_ps(pMatrix + 3*4 + 1); // m[row][1] - r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) - m = SIMD::load1_ps(pMatrix + 3*4 + 2); // m[row][2] - r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) - m = SIMD::load1_ps(pMatrix + 3*4 + 3); // m[row][3] - result[3] = SIMD::add_ps(r0, m); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + (m2 * 1) + m = SIMD::load1_ps(pMatrix + 3 * 4 + 0); // m[row][0] + r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) + m = SIMD::load1_ps(pMatrix + 3 * 4 + 1); // m[row][1] + r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + m = SIMD::load1_ps(pMatrix + 3 * 4 + 2); // m[row][2] + r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + m = SIMD::load1_ps(pMatrix + 3 * 4 + 3); // m[row][3] + result[3] = SIMD::add_ps(r0, m); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + (m2 * 1) } - static SIMDINLINE - void SIMDCALL mat4x3_vec3_w1_multiply( - Vec4& result, - const float *pMatrix, - const Vec4& v) + static SIMDINLINE void SIMDCALL mat4x3_vec3_w1_multiply(Vec4& result, + const float* pMatrix, + const Vec4& v) { Float m; Float r0; Float r1; - m = SIMD::load1_ps(pMatrix + 0*4 + 0); // m[row][0] - r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) - m = SIMD::load1_ps(pMatrix + 0*4 + 1); // m[row][1] - r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) - m = SIMD::load1_ps(pMatrix + 0*4 + 2); // m[row][2] - r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) - m = SIMD::load1_ps(pMatrix + 0*4 + 3); // m[row][3] - r0 = SIMD::add_ps(r0, m); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + (m2 * 1) + m = SIMD::load1_ps(pMatrix + 0 * 4 + 0); // m[row][0] + r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) + m = SIMD::load1_ps(pMatrix + 0 * 4 + 1); // m[row][1] + r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + m = SIMD::load1_ps(pMatrix + 0 * 4 + 2); // m[row][2] + r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + m = SIMD::load1_ps(pMatrix + 0 * 4 + 3); // m[row][3] + r0 = SIMD::add_ps(r0, m); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + (m2 * 1) result[0] = r0; - m = SIMD::load1_ps(pMatrix + 1*4 + 0); // m[row][0] - r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) - m = SIMD::load1_ps(pMatrix + 1*4 + 1); // m[row][1] - r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) - m = SIMD::load1_ps(pMatrix + 1*4 + 2); // m[row][2] - r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) - m = SIMD::load1_ps(pMatrix + 1*4 + 3); // m[row][3] - r0 = SIMD::add_ps(r0, m); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + (m2 * 1) + m = SIMD::load1_ps(pMatrix + 1 * 4 + 0); // m[row][0] + r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) + m = SIMD::load1_ps(pMatrix + 1 * 4 + 1); // m[row][1] + r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + m = SIMD::load1_ps(pMatrix + 1 * 4 + 2); // m[row][2] + r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + m = SIMD::load1_ps(pMatrix + 1 * 4 + 3); // m[row][3] + r0 = SIMD::add_ps(r0, m); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + (m2 * 1) result[1] = r0; - m = SIMD::load1_ps(pMatrix + 2*4 + 0); // m[row][0] - r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) - m = SIMD::load1_ps(pMatrix + 2*4 + 1); // m[row][1] - r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) - m = SIMD::load1_ps(pMatrix + 2*4 + 2); // m[row][2] - r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) - r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) - m = SIMD::load1_ps(pMatrix + 2*4 + 3); // m[row][3] - r0 = SIMD::add_ps(r0, m); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + (m2 * 1) + m = SIMD::load1_ps(pMatrix + 2 * 4 + 0); // m[row][0] + r0 = SIMD::mul_ps(m, v[0]); // (m00 * v.x) + m = SIMD::load1_ps(pMatrix + 2 * 4 + 1); // m[row][1] + r1 = SIMD::mul_ps(m, v[1]); // (m1 * v.y) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + m = SIMD::load1_ps(pMatrix + 2 * 4 + 2); // m[row][2] + r1 = SIMD::mul_ps(m, v[2]); // (m2 * v.z) + r0 = SIMD::add_ps(r0, r1); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + m = SIMD::load1_ps(pMatrix + 2 * 4 + 3); // m[row][3] + r0 = SIMD::add_ps(r0, m); // (m0 * v.x) + (m1 * v.y) + (m2 * v.z) + (m2 * 1) result[2] = r0; result[3] = SIMD::set1_ps(1.0f); } @@ -572,30 +548,38 @@ using SIMD128 = SIMDBase<SIMDImpl::SIMD128Impl::Traits>; using SIMD256 = SIMDBase<SIMDImpl::SIMD256Impl::Traits>; using SIMD512 = SIMDBase<SIMDImpl::SIMD512Impl::Traits>; -template <typename SIMD_T> using CompareType = typename SIMD_T::CompareType; -template <typename SIMD_T> using ScaleFactor = typename SIMD_T::ScaleFactor; -template <typename SIMD_T> using RoundMode = typename SIMD_T::RoundMode; -template <typename SIMD_T> using Float = typename SIMD_T::Float; -template <typename SIMD_T> using Double = typename SIMD_T::Double; -template <typename SIMD_T> using Integer = typename SIMD_T::Integer; -template <typename SIMD_T> using Vec4 = typename SIMD_T::Vec4; -template <typename SIMD_T> using Mask = typename SIMD_T::Mask; +template <typename SIMD_T> +using CompareType = typename SIMD_T::CompareType; +template <typename SIMD_T> +using ScaleFactor = typename SIMD_T::ScaleFactor; +template <typename SIMD_T> +using RoundMode = typename SIMD_T::RoundMode; +template <typename SIMD_T> +using Float = typename SIMD_T::Float; +template <typename SIMD_T> +using Double = typename SIMD_T::Double; +template <typename SIMD_T> +using Integer = typename SIMD_T::Integer; +template <typename SIMD_T> +using Vec4 = typename SIMD_T::Vec4; +template <typename SIMD_T> +using Mask = typename SIMD_T::Mask; template <typename SIMD_T> struct SIMDVecEqual { - INLINE bool operator () (Integer<SIMD_T> a, Integer<SIMD_T> b) const + INLINE bool operator()(Integer<SIMD_T> a, Integer<SIMD_T> b) const { Integer<SIMD_T> c = SIMD_T::xor_si(a, b); return SIMD_T::testz_si(c, c); } - INLINE bool operator () (Float<SIMD_T> a, Float<SIMD_T> b) const + INLINE bool operator()(Float<SIMD_T> a, Float<SIMD_T> b) const { return this->operator()(SIMD_T::castps_si(a), SIMD_T::castps_si(b)); } - INLINE bool operator () (Double<SIMD_T> a, Double<SIMD_T> b) const + INLINE bool operator()(Double<SIMD_T> a, Double<SIMD_T> b) const { return this->operator()(SIMD_T::castpd_si(a), SIMD_T::castpd_si(b)); } @@ -604,13 +588,13 @@ struct SIMDVecEqual template <typename SIMD_T> struct SIMDVecHash { - INLINE uint32_t operator ()(Integer<SIMD_T> val) const + INLINE uint32_t operator()(Integer<SIMD_T> val) const { #if defined(_WIN64) || !defined(_WIN32) // assume non-Windows is always 64-bit static_assert(sizeof(void*) == 8, "This path only meant for 64-bit code"); - uint64_t crc32 = 0; - const uint64_t *pData = reinterpret_cast<const uint64_t*>(&val); + uint64_t crc32 = 0; + const uint64_t* pData = reinterpret_cast<const uint64_t*>(&val); static const uint32_t loopIterations = sizeof(val) / sizeof(void*); static_assert(loopIterations * sizeof(void*) == sizeof(val), "bad vector size"); @@ -624,7 +608,7 @@ struct SIMDVecHash static_assert(sizeof(void*) == 4, "This path only meant for 32-bit code"); uint32_t crc32 = 0; - const uint32_t *pData = reinterpret_cast<const uint32_t*>(&val); + const uint32_t* pData = reinterpret_cast<const uint32_t*>(&val); static const uint32_t loopIterations = sizeof(val) / sizeof(void*); static_assert(loopIterations * sizeof(void*) == sizeof(val), "bad vector size"); @@ -637,11 +621,11 @@ struct SIMDVecHash #endif }; - INLINE uint32_t operator ()(Float<SIMD_T> val) const + INLINE uint32_t operator()(Float<SIMD_T> val) const { return operator()(SIMD_T::castps_si(val)); }; - INLINE uint32_t operator ()(Double<SIMD_T> val) const + INLINE uint32_t operator()(Double<SIMD_T> val) const { return operator()(SIMD_T::castpd_si(val)); } diff --git a/src/gallium/drivers/swr/rasterizer/common/simdlib_128_avx.inl b/src/gallium/drivers/swr/rasterizer/common/simdlib_128_avx.inl index b1511c6c0e2..0c5795cf136 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdlib_128_avx.inl +++ b/src/gallium/drivers/swr/rasterizer/common/simdlib_128_avx.inl @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2017 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2017 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #if !defined(__SIMD_LIB_AVX_HPP__) #error Do not include this file directly, use "simdlib.hpp" instead. #endif @@ -28,100 +28,79 @@ // SIMD128 AVX (1) implementation //============================================================================ -#define SIMD_WRAPPER_1(op) \ - static SIMDINLINE Float SIMDCALL op(Float a) \ - {\ - return _mm_##op(a);\ - } +#define SIMD_WRAPPER_1(op) \ + static SIMDINLINE Float SIMDCALL op(Float a) { return _mm_##op(a); } -#define SIMD_WRAPPER_2(op) \ - static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ - {\ - return _mm_##op(a, b);\ - } +#define SIMD_WRAPPER_2(op) \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b) { return _mm_##op(a, b); } -#define SIMD_DWRAPPER_2(op) \ - static SIMDINLINE Double SIMDCALL op(Double a, Double b) \ - {\ - return _mm_##op(a, b);\ - } +#define SIMD_DWRAPPER_2(op) \ + static SIMDINLINE Double SIMDCALL op(Double a, Double b) { return _mm_##op(a, b); } -#define SIMD_WRAPPER_2I(op) \ - template<int ImmT>\ - static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ - {\ - return _mm_##op(a, b, ImmT);\ +#define SIMD_WRAPPER_2I(op) \ + template <int ImmT> \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ + { \ + return _mm_##op(a, b, ImmT); \ } -#define SIMD_DWRAPPER_2I(op) \ - template<int ImmT>\ - static SIMDINLINE Double SIMDCALL op(Double a, Double b) \ - {\ - return _mm_##op(a, b, ImmT);\ +#define SIMD_DWRAPPER_2I(op) \ + template <int ImmT> \ + static SIMDINLINE Double SIMDCALL op(Double a, Double b) \ + { \ + return _mm_##op(a, b, ImmT); \ } -#define SIMD_WRAPPER_3(op) \ - static SIMDINLINE Float SIMDCALL op(Float a, Float b, Float c) \ - {\ - return _mm_##op(a, b, c);\ - } +#define SIMD_WRAPPER_3(op) \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b, Float c) { return _mm_##op(a, b, c); } -#define SIMD_IWRAPPER_1(op) \ - static SIMDINLINE Integer SIMDCALL op(Integer a) \ - {\ - return _mm_##op(a);\ - } +#define SIMD_IWRAPPER_1(op) \ + static SIMDINLINE Integer SIMDCALL op(Integer a) { return _mm_##op(a); } -#define SIMD_IWRAPPER_1I_(op, intrin) \ - template<int ImmT> \ - static SIMDINLINE Integer SIMDCALL op(Integer a) \ - {\ - return intrin(a, ImmT);\ +#define SIMD_IWRAPPER_1I_(op, intrin) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer a) \ + { \ + return intrin(a, ImmT); \ } #define SIMD_IWRAPPER_1I(op) SIMD_IWRAPPER_1I_(op, _mm_##op) -#define SIMD_IWRAPPER_2_(op, intrin) \ - static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ - {\ - return intrin(a, b);\ - } +#define SIMD_IWRAPPER_2_(op, intrin) \ + static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) { return intrin(a, b); } -#define SIMD_IWRAPPER_2(op) \ - static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ - {\ - return _mm_##op(a, b);\ - } +#define SIMD_IWRAPPER_2(op) \ + static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) { return _mm_##op(a, b); } -#define SIMD_IFWRAPPER_2(op, intrin) \ - static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ - {\ - return castps_si( intrin(castsi_ps(a), castsi_ps(b)) );\ +#define SIMD_IFWRAPPER_2(op, intrin) \ + static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ + { \ + return castps_si(intrin(castsi_ps(a), castsi_ps(b))); \ } -#define SIMD_IWRAPPER_2I(op) \ - template<int ImmT>\ - static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ - {\ - return _mm_##op(a, b, ImmT);\ +#define SIMD_IWRAPPER_2I(op) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ + { \ + return _mm_##op(a, b, ImmT); \ } //----------------------------------------------------------------------- // Single precision floating point arithmetic operations //----------------------------------------------------------------------- -SIMD_WRAPPER_2(add_ps); // return a + b -SIMD_WRAPPER_2(div_ps); // return a / b -SIMD_WRAPPER_2(max_ps); // return (a > b) ? a : b -SIMD_WRAPPER_2(min_ps); // return (a < b) ? a : b -SIMD_WRAPPER_2(mul_ps); // return a * b -SIMD_WRAPPER_1(rcp_ps); // return 1.0f / a -SIMD_WRAPPER_1(rsqrt_ps); // return 1.0f / sqrt(a) -SIMD_WRAPPER_2(sub_ps); // return a - b +SIMD_WRAPPER_2(add_ps); // return a + b +SIMD_WRAPPER_2(div_ps); // return a / b +SIMD_WRAPPER_2(max_ps); // return (a > b) ? a : b +SIMD_WRAPPER_2(min_ps); // return (a < b) ? a : b +SIMD_WRAPPER_2(mul_ps); // return a * b +SIMD_WRAPPER_1(rcp_ps); // return 1.0f / a +SIMD_WRAPPER_1(rsqrt_ps); // return 1.0f / sqrt(a) +SIMD_WRAPPER_2(sub_ps); // return a - b -static SIMDINLINE Float SIMDCALL fmadd_ps(Float a, Float b, Float c) // return (a * b) + c +static SIMDINLINE Float SIMDCALL fmadd_ps(Float a, Float b, Float c) // return (a * b) + c { return add_ps(mul_ps(a, b), c); } -static SIMDINLINE Float SIMDCALL fmsub_ps(Float a, Float b, Float c) // return (a * b) - c +static SIMDINLINE Float SIMDCALL fmsub_ps(Float a, Float b, Float c) // return (a * b) - c { return sub_ps(mul_ps(a, b), c); } @@ -132,8 +111,14 @@ static SIMDINLINE Float SIMDCALL round_ps(Float a) return _mm_round_ps(a, static_cast<int>(RMT)); } -static SIMDINLINE Float SIMDCALL ceil_ps(Float a) { return round_ps<RoundMode::CEIL_NOEXC>(a); } -static SIMDINLINE Float SIMDCALL floor_ps(Float a) { return round_ps<RoundMode::FLOOR_NOEXC>(a); } +static SIMDINLINE Float SIMDCALL ceil_ps(Float a) +{ + return round_ps<RoundMode::CEIL_NOEXC>(a); +} +static SIMDINLINE Float SIMDCALL floor_ps(Float a) +{ + return round_ps<RoundMode::FLOOR_NOEXC>(a); +} //----------------------------------------------------------------------- // Integer (various width) arithmetic operations @@ -141,7 +126,7 @@ static SIMDINLINE Float SIMDCALL floor_ps(Float a) { return round_ps<RoundMode:: SIMD_IWRAPPER_1(abs_epi32); // return absolute_value(a) (int32) SIMD_IWRAPPER_2(add_epi32); // return a + b (int32) SIMD_IWRAPPER_2(add_epi8); // return a + b (int8) -SIMD_IWRAPPER_2(adds_epu8); // return ((a + b) > 0xff) ? 0xff : (a + b) (uint8) +SIMD_IWRAPPER_2(adds_epu8); // return ((a + b) > 0xff) ? 0xff : (a + b) (uint8) SIMD_IWRAPPER_2(max_epi32); // return (a > b) ? a : b (int32) SIMD_IWRAPPER_2(max_epu32); // return (a > b) ? a : b (uint32) SIMD_IWRAPPER_2(min_epi32); // return (a < b) ? a : b (int32) @@ -160,41 +145,40 @@ SIMD_IWRAPPER_2(subs_epu8); // return (b > a) ? 0 : (a - b) (uint8) //----------------------------------------------------------------------- // Logical operations //----------------------------------------------------------------------- -SIMD_WRAPPER_2(and_ps); // return a & b (float treated as int) -SIMD_IWRAPPER_2_(and_si, _mm_and_si128); // return a & b (int) -SIMD_WRAPPER_2(andnot_ps); // return (~a) & b (float treated as int) -SIMD_IWRAPPER_2_(andnot_si, _mm_andnot_si128); // return (~a) & b (int) -SIMD_WRAPPER_2(or_ps); // return a | b (float treated as int) -SIMD_IWRAPPER_2_(or_si, _mm_or_si128); // return a | b (int) -SIMD_WRAPPER_2(xor_ps); // return a ^ b (float treated as int) -SIMD_IWRAPPER_2_(xor_si, _mm_xor_si128); // return a ^ b (int) - +SIMD_WRAPPER_2(and_ps); // return a & b (float treated as int) +SIMD_IWRAPPER_2_(and_si, _mm_and_si128); // return a & b (int) +SIMD_WRAPPER_2(andnot_ps); // return (~a) & b (float treated as int) +SIMD_IWRAPPER_2_(andnot_si, _mm_andnot_si128); // return (~a) & b (int) +SIMD_WRAPPER_2(or_ps); // return a | b (float treated as int) +SIMD_IWRAPPER_2_(or_si, _mm_or_si128); // return a | b (int) +SIMD_WRAPPER_2(xor_ps); // return a ^ b (float treated as int) +SIMD_IWRAPPER_2_(xor_si, _mm_xor_si128); // return a ^ b (int) //----------------------------------------------------------------------- // Shift operations //----------------------------------------------------------------------- -SIMD_IWRAPPER_1I(slli_epi32); // return a << ImmT -SIMD_IWRAPPER_1I(slli_epi64); // return a << ImmT +SIMD_IWRAPPER_1I(slli_epi32); // return a << ImmT +SIMD_IWRAPPER_1I(slli_epi64); // return a << ImmT static SIMDINLINE Integer SIMDCALL sllv_epi32(Integer vA, Integer vB) // return a << b (uint32) { int32_t a, count; - a = _mm_extract_epi32(vA, 0); + a = _mm_extract_epi32(vA, 0); count = _mm_extract_epi32(vB, 0); a <<= count; vA = _mm_insert_epi32(vA, a, 0); - a = _mm_extract_epi32(vA, 1); + a = _mm_extract_epi32(vA, 1); count = _mm_extract_epi32(vB, 1); a <<= count; vA = _mm_insert_epi32(vA, a, 1); - a = _mm_extract_epi32(vA, 2); + a = _mm_extract_epi32(vA, 2); count = _mm_extract_epi32(vB, 2); a <<= count; vA = _mm_insert_epi32(vA, a, 2); - a = _mm_extract_epi32(vA, 3); + a = _mm_extract_epi32(vA, 3); count = _mm_extract_epi32(vB, 3); a <<= count; vA = _mm_insert_epi32(vA, a, 3); @@ -211,7 +195,7 @@ static SIMDINLINE Integer SIMDCALL srl_epi64(Integer a, Integer n) return _mm_srl_epi64(a, n); } -template<int ImmT> // same as srli_si, but with Float cast to int +template <int ImmT> // same as srli_si, but with Float cast to int static SIMDINLINE Float SIMDCALL srlisi_ps(Float a) { return castsi_ps(srli_si<ImmT>(castps_si(a))); @@ -220,22 +204,22 @@ static SIMDINLINE Float SIMDCALL srlisi_ps(Float a) static SIMDINLINE Integer SIMDCALL srlv_epi32(Integer vA, Integer vB) // return a >> b (uint32) { int32_t a, count; - a = _mm_extract_epi32(vA, 0); + a = _mm_extract_epi32(vA, 0); count = _mm_extract_epi32(vB, 0); a >>= count; vA = _mm_insert_epi32(vA, a, 0); - a = _mm_extract_epi32(vA, 1); + a = _mm_extract_epi32(vA, 1); count = _mm_extract_epi32(vB, 1); a >>= count; vA = _mm_insert_epi32(vA, a, 1); - a = _mm_extract_epi32(vA, 2); + a = _mm_extract_epi32(vA, 2); count = _mm_extract_epi32(vB, 2); a >>= count; vA = _mm_insert_epi32(vA, a, 2); - a = _mm_extract_epi32(vA, 3); + a = _mm_extract_epi32(vA, 3); count = _mm_extract_epi32(vB, 3); a >>= count; vA = _mm_insert_epi32(vA, a, 3); @@ -243,32 +227,30 @@ static SIMDINLINE Integer SIMDCALL srlv_epi32(Integer vA, Integer vB) // return return vA; } - - //----------------------------------------------------------------------- // Conversion operations //----------------------------------------------------------------------- -static SIMDINLINE Float SIMDCALL castpd_ps(Double a) // return *(Float*)(&a) +static SIMDINLINE Float SIMDCALL castpd_ps(Double a) // return *(Float*)(&a) { return _mm_castpd_ps(a); } -static SIMDINLINE Integer SIMDCALL castps_si(Float a) // return *(Integer*)(&a) +static SIMDINLINE Integer SIMDCALL castps_si(Float a) // return *(Integer*)(&a) { return _mm_castps_si128(a); } -static SIMDINLINE Double SIMDCALL castsi_pd(Integer a) // return *(Double*)(&a) +static SIMDINLINE Double SIMDCALL castsi_pd(Integer a) // return *(Double*)(&a) { return _mm_castsi128_pd(a); } -static SIMDINLINE Double SIMDCALL castps_pd(Float a) // return *(Double*)(&a) +static SIMDINLINE Double SIMDCALL castps_pd(Float a) // return *(Double*)(&a) { return _mm_castps_pd(a); } -static SIMDINLINE Float SIMDCALL castsi_ps(Integer a) // return *(Float*)(&a) +static SIMDINLINE Float SIMDCALL castsi_ps(Integer a) // return *(Float*)(&a) { return _mm_castsi128_ps(a); } @@ -288,18 +270,19 @@ static SIMDINLINE Integer SIMDCALL cvtsi32_si128(int32_t n) // return a[0] = n, return _mm_cvtsi32_si128(n); } -SIMD_IWRAPPER_1(cvtepu8_epi16); // return (int16)a (uint8 --> int16) -SIMD_IWRAPPER_1(cvtepu8_epi32); // return (int32)a (uint8 --> int32) -SIMD_IWRAPPER_1(cvtepu16_epi32); // return (int32)a (uint16 --> int32) -SIMD_IWRAPPER_1(cvtepu16_epi64); // return (int64)a (uint16 --> int64) -SIMD_IWRAPPER_1(cvtepu32_epi64); // return (int64)a (uint32 --> int64) +SIMD_IWRAPPER_1(cvtepu8_epi16); // return (int16)a (uint8 --> int16) +SIMD_IWRAPPER_1(cvtepu8_epi32); // return (int32)a (uint8 --> int32) +SIMD_IWRAPPER_1(cvtepu16_epi32); // return (int32)a (uint16 --> int32) +SIMD_IWRAPPER_1(cvtepu16_epi64); // return (int64)a (uint16 --> int64) +SIMD_IWRAPPER_1(cvtepu32_epi64); // return (int64)a (uint32 --> int64) -static SIMDINLINE Integer SIMDCALL cvtps_epi32(Float a) // return (int32)a (float --> int32) +static SIMDINLINE Integer SIMDCALL cvtps_epi32(Float a) // return (int32)a (float --> int32) { return _mm_cvtps_epi32(a); } -static SIMDINLINE Integer SIMDCALL cvttps_epi32(Float a) // return (int32)a (rnd_to_zero(float) --> int32) +static SIMDINLINE Integer SIMDCALL + cvttps_epi32(Float a) // return (int32)a (rnd_to_zero(float) --> int32) { return _mm_cvttps_epi32(a); } @@ -307,77 +290,104 @@ static SIMDINLINE Integer SIMDCALL cvttps_epi32(Float a) // return (in //----------------------------------------------------------------------- // Comparison operations //----------------------------------------------------------------------- -template<CompareType CmpTypeT> +template <CompareType CmpTypeT> static SIMDINLINE Float SIMDCALL cmp_ps(Float a, Float b) // return a (CmpTypeT) b { return _mm_cmp_ps(a, b, static_cast<const int>(CmpTypeT)); } -static SIMDINLINE Float SIMDCALL cmplt_ps(Float a, Float b) { return cmp_ps<CompareType::LT_OQ>(a, b); } -static SIMDINLINE Float SIMDCALL cmpgt_ps(Float a, Float b) { return cmp_ps<CompareType::GT_OQ>(a, b); } -static SIMDINLINE Float SIMDCALL cmpneq_ps(Float a, Float b) { return cmp_ps<CompareType::NEQ_OQ>(a, b); } -static SIMDINLINE Float SIMDCALL cmpeq_ps(Float a, Float b) { return cmp_ps<CompareType::EQ_OQ>(a, b); } -static SIMDINLINE Float SIMDCALL cmpge_ps(Float a, Float b) { return cmp_ps<CompareType::GE_OQ>(a, b); } -static SIMDINLINE Float SIMDCALL cmple_ps(Float a, Float b) { return cmp_ps<CompareType::LE_OQ>(a, b); } +static SIMDINLINE Float SIMDCALL cmplt_ps(Float a, Float b) +{ + return cmp_ps<CompareType::LT_OQ>(a, b); +} +static SIMDINLINE Float SIMDCALL cmpgt_ps(Float a, Float b) +{ + return cmp_ps<CompareType::GT_OQ>(a, b); +} +static SIMDINLINE Float SIMDCALL cmpneq_ps(Float a, Float b) +{ + return cmp_ps<CompareType::NEQ_OQ>(a, b); +} +static SIMDINLINE Float SIMDCALL cmpeq_ps(Float a, Float b) +{ + return cmp_ps<CompareType::EQ_OQ>(a, b); +} +static SIMDINLINE Float SIMDCALL cmpge_ps(Float a, Float b) +{ + return cmp_ps<CompareType::GE_OQ>(a, b); +} +static SIMDINLINE Float SIMDCALL cmple_ps(Float a, Float b) +{ + return cmp_ps<CompareType::LE_OQ>(a, b); +} -SIMD_IWRAPPER_2(cmpeq_epi8); // return a == b (int8) -SIMD_IWRAPPER_2(cmpeq_epi16); // return a == b (int16) -SIMD_IWRAPPER_2(cmpeq_epi32); // return a == b (int32) -SIMD_IWRAPPER_2(cmpeq_epi64); // return a == b (int64) -SIMD_IWRAPPER_2(cmpgt_epi8); // return a > b (int8) -SIMD_IWRAPPER_2(cmpgt_epi16); // return a > b (int16) -SIMD_IWRAPPER_2(cmpgt_epi32); // return a > b (int32) -SIMD_IWRAPPER_2(cmpgt_epi64); // return a > b (int64) -SIMD_IWRAPPER_2(cmplt_epi32); // return a < b (int32) +SIMD_IWRAPPER_2(cmpeq_epi8); // return a == b (int8) +SIMD_IWRAPPER_2(cmpeq_epi16); // return a == b (int16) +SIMD_IWRAPPER_2(cmpeq_epi32); // return a == b (int32) +SIMD_IWRAPPER_2(cmpeq_epi64); // return a == b (int64) +SIMD_IWRAPPER_2(cmpgt_epi8); // return a > b (int8) +SIMD_IWRAPPER_2(cmpgt_epi16); // return a > b (int16) +SIMD_IWRAPPER_2(cmpgt_epi32); // return a > b (int32) +SIMD_IWRAPPER_2(cmpgt_epi64); // return a > b (int64) +SIMD_IWRAPPER_2(cmplt_epi32); // return a < b (int32) -static SIMDINLINE bool SIMDCALL testz_ps(Float a, Float b) // return all_lanes_zero(a & b) ? 1 : 0 (float) +static SIMDINLINE bool SIMDCALL testz_ps(Float a, + Float b) // return all_lanes_zero(a & b) ? 1 : 0 (float) { - return 0 != _mm_testz_ps(a, b); + return 0 != _mm_testz_ps(a, b); } -static SIMDINLINE bool SIMDCALL testz_si(Integer a, Integer b) // return all_lanes_zero(a & b) ? 1 : 0 (int) +static SIMDINLINE bool SIMDCALL testz_si(Integer a, + Integer b) // return all_lanes_zero(a & b) ? 1 : 0 (int) { - return 0 != _mm_testz_si128(a, b); + return 0 != _mm_testz_si128(a, b); } //----------------------------------------------------------------------- // Blend / shuffle / permute operations //----------------------------------------------------------------------- -SIMD_WRAPPER_2I(blend_ps); // return ImmT ? b : a (float) -SIMD_WRAPPER_3(blendv_ps); // return mask ? b : a (float) +SIMD_WRAPPER_2I(blend_ps); // return ImmT ? b : a (float) +SIMD_WRAPPER_3(blendv_ps); // return mask ? b : a (float) -static SIMDINLINE Integer SIMDCALL blendv_epi32(Integer a, Integer b, Float mask) // return mask ? b : a (int) +static SIMDINLINE Integer SIMDCALL blendv_epi32(Integer a, + Integer b, + Float mask) // return mask ? b : a (int) { return castps_si(blendv_ps(castsi_ps(a), castsi_ps(b), mask)); } -static SIMDINLINE Integer SIMDCALL blendv_epi32(Integer a, Integer b, Integer mask) // return mask ? b : a (int) +static SIMDINLINE Integer SIMDCALL blendv_epi32(Integer a, + Integer b, + Integer mask) // return mask ? b : a (int) { return castps_si(blendv_ps(castsi_ps(a), castsi_ps(b), castsi_ps(mask))); } -static SIMDINLINE Float SIMDCALL broadcast_ss(float const *p) // return *p (all elements in vector get same value) +static SIMDINLINE Float SIMDCALL + broadcast_ss(float const* p) // return *p (all elements in vector get same value) { return _mm_broadcast_ss(p); } -SIMD_IWRAPPER_2(packs_epi16); // See documentation for _mm_packs_epi16 and _mm512_packs_epi16 -SIMD_IWRAPPER_2(packs_epi32); // See documentation for _mm_packs_epi32 and _mm512_packs_epi32 -SIMD_IWRAPPER_2(packus_epi16); // See documentation for _mm_packus_epi16 and _mm512_packus_epi16 -SIMD_IWRAPPER_2(packus_epi32); // See documentation for _mm_packus_epi32 and _mm512_packus_epi32 +SIMD_IWRAPPER_2(packs_epi16); // See documentation for _mm_packs_epi16 and _mm512_packs_epi16 +SIMD_IWRAPPER_2(packs_epi32); // See documentation for _mm_packs_epi32 and _mm512_packs_epi32 +SIMD_IWRAPPER_2(packus_epi16); // See documentation for _mm_packus_epi16 and _mm512_packus_epi16 +SIMD_IWRAPPER_2(packus_epi32); // See documentation for _mm_packus_epi32 and _mm512_packus_epi32 -static SIMDINLINE Integer SIMDCALL permute_epi32(Integer a, Integer swiz) // return a[swiz[i]] for each 32-bit lane i (float) +static SIMDINLINE Integer SIMDCALL + permute_epi32(Integer a, Integer swiz) // return a[swiz[i]] for each 32-bit lane i (float) { return castps_si(_mm_permutevar_ps(castsi_ps(a), swiz)); } -static SIMDINLINE Float SIMDCALL permute_ps(Float a, Integer swiz) // return a[swiz[i]] for each 32-bit lane i (float) +static SIMDINLINE Float SIMDCALL + permute_ps(Float a, Integer swiz) // return a[swiz[i]] for each 32-bit lane i (float) { return _mm_permutevar_ps(a, swiz); } SIMD_IWRAPPER_1I(shuffle_epi32); -template<int ImmT> +template <int ImmT> static SIMDINLINE Integer SIMDCALL shuffle_epi64(Integer a, Integer b) = delete; SIMD_IWRAPPER_2(shuffle_epi8); @@ -385,7 +395,7 @@ SIMD_DWRAPPER_2I(shuffle_pd); SIMD_WRAPPER_2I(shuffle_ps); SIMD_IWRAPPER_2(unpackhi_epi16); -//SIMD_IFWRAPPER_2(unpackhi_epi32, _mm_unpackhi_ps); +// SIMD_IFWRAPPER_2(unpackhi_epi32, _mm_unpackhi_ps); static SIMDINLINE Integer SIMDCALL unpackhi_epi32(Integer a, Integer b) { return castps_si(_mm_unpackhi_ps(castsi_ps(a), castsi_ps(b))); @@ -405,68 +415,74 @@ SIMD_WRAPPER_2(unpacklo_ps); //----------------------------------------------------------------------- // Load / store operations //----------------------------------------------------------------------- -template<ScaleFactor ScaleT> -static SIMDINLINE Float SIMDCALL i32gather_ps(float const* p, Integer idx) // return *(float*)(((int8*)p) + (idx * ScaleT)) +template <ScaleFactor ScaleT> +static SIMDINLINE Float SIMDCALL + i32gather_ps(float const* p, Integer idx) // return *(float*)(((int8*)p) + (idx * ScaleT)) { - uint32_t *pOffsets = (uint32_t*)&idx; - Float vResult; - float* pResult = (float*)&vResult; + uint32_t* pOffsets = (uint32_t*)&idx; + Float vResult; + float* pResult = (float*)&vResult; for (uint32_t i = 0; i < SIMD_WIDTH; ++i) { uint32_t offset = pOffsets[i]; - offset = offset * static_cast<uint32_t>(ScaleT); - pResult[i] = *(float const*)(((uint8_t const*)p + offset)); + offset = offset * static_cast<uint32_t>(ScaleT); + pResult[i] = *(float const*)(((uint8_t const*)p + offset)); } return vResult; } -static SIMDINLINE Float SIMDCALL load1_ps(float const *p) // return *p (broadcast 1 value to all elements) +static SIMDINLINE Float SIMDCALL + load1_ps(float const* p) // return *p (broadcast 1 value to all elements) { return broadcast_ss(p); } -static SIMDINLINE Float SIMDCALL load_ps(float const *p) // return *p (loads SIMD width elements from memory) +static SIMDINLINE Float SIMDCALL + load_ps(float const* p) // return *p (loads SIMD width elements from memory) { return _mm_load_ps(p); } -static SIMDINLINE Integer SIMDCALL load_si(Integer const *p) // return *p +static SIMDINLINE Integer SIMDCALL load_si(Integer const* p) // return *p { return _mm_load_si128(&p->v); } -static SIMDINLINE Float SIMDCALL loadu_ps(float const *p) // return *p (same as load_ps but allows for unaligned mem) +static SIMDINLINE Float SIMDCALL + loadu_ps(float const* p) // return *p (same as load_ps but allows for unaligned mem) { return _mm_loadu_ps(p); } -static SIMDINLINE Integer SIMDCALL loadu_si(Integer const *p) // return *p (same as load_si but allows for unaligned mem) +static SIMDINLINE Integer SIMDCALL + loadu_si(Integer const* p) // return *p (same as load_si but allows for unaligned mem) { return _mm_lddqu_si128(&p->v); } // for each element: (mask & (1 << 31)) ? (i32gather_ps<ScaleT>(p, idx), mask = 0) : old -template<ScaleFactor ScaleT> -static SIMDINLINE Float SIMDCALL mask_i32gather_ps(Float old, float const* p, Integer idx, Float mask) -{ - uint32_t *pOffsets = (uint32_t*)&idx; - Float vResult = old; - float* pResult = (float*)&vResult; - DWORD index; - uint32_t umask = movemask_ps(mask); +template <ScaleFactor ScaleT> +static SIMDINLINE Float SIMDCALL + mask_i32gather_ps(Float old, float const* p, Integer idx, Float mask) +{ + uint32_t* pOffsets = (uint32_t*)&idx; + Float vResult = old; + float* pResult = (float*)&vResult; + DWORD index; + uint32_t umask = movemask_ps(mask); while (_BitScanForward(&index, umask)) { umask &= ~(1 << index); uint32_t offset = pOffsets[index]; - offset = offset * static_cast<uint32_t>(ScaleT); - pResult[index] = *(float const *)(((uint8_t const *)p + offset)); + offset = offset * static_cast<uint32_t>(ScaleT); + pResult[index] = *(float const*)(((uint8_t const*)p + offset)); } return vResult; } -static SIMDINLINE void SIMDCALL maskstore_ps(float *p, Integer mask, Float src) +static SIMDINLINE void SIMDCALL maskstore_ps(float* p, Integer mask, Float src) { _mm_maskstore_ps(p, mask, src); } @@ -495,37 +511,40 @@ static SIMDINLINE Integer SIMDCALL set1_epi8(char i) // return i (all elements a return _mm_set1_epi8(i); } -static SIMDINLINE Float SIMDCALL set1_ps(float f) // return f (all elements are same value) +static SIMDINLINE Float SIMDCALL set1_ps(float f) // return f (all elements are same value) { return _mm_set1_ps(f); } -static SIMDINLINE Float SIMDCALL setzero_ps() // return 0 (float) +static SIMDINLINE Float SIMDCALL setzero_ps() // return 0 (float) { return _mm_setzero_ps(); } -static SIMDINLINE Integer SIMDCALL setzero_si() // return 0 (integer) +static SIMDINLINE Integer SIMDCALL setzero_si() // return 0 (integer) { return _mm_setzero_si128(); } -static SIMDINLINE void SIMDCALL store_ps(float *p, Float a) // *p = a (stores all elements contiguously in memory) +static SIMDINLINE void SIMDCALL + store_ps(float* p, Float a) // *p = a (stores all elements contiguously in memory) { _mm_store_ps(p, a); } -static SIMDINLINE void SIMDCALL store_si(Integer *p, Integer a) // *p = a +static SIMDINLINE void SIMDCALL store_si(Integer* p, Integer a) // *p = a { _mm_store_si128(&p->v, a); } -static SIMDINLINE void SIMDCALL storeu_si(Integer *p, Integer a) // *p = a (same as store_si but allows for unaligned mem) +static SIMDINLINE void SIMDCALL + storeu_si(Integer* p, Integer a) // *p = a (same as store_si but allows for unaligned mem) { _mm_storeu_si128(&p->v, a); } -static SIMDINLINE void SIMDCALL stream_ps(float *p, Float a) // *p = a (same as store_ps, but doesn't keep memory in cache) +static SIMDINLINE void SIMDCALL + stream_ps(float* p, Float a) // *p = a (same as store_ps, but doesn't keep memory in cache) { _mm_stream_ps(p, a); } @@ -549,11 +568,10 @@ static SIMDINLINE float SIMDCALL extract_ps(Float a) static SIMDINLINE Float SIMDCALL vmask_ps(int32_t mask) { - Integer vec = set1_epi32(mask); - const Integer bit = set_epi32( - 0x08, 0x04, 0x02, 0x01); - vec = and_si(vec, bit); - vec = cmplt_epi32(setzero_si(), vec); + Integer vec = set1_epi32(mask); + const Integer bit = set_epi32(0x08, 0x04, 0x02, 0x01); + vec = and_si(vec, bit); + vec = cmplt_epi32(setzero_si(), vec); return castsi_ps(vec); } @@ -573,4 +591,3 @@ static SIMDINLINE Float SIMDCALL vmask_ps(int32_t mask) #undef SIMD_IWRAPPER_2 #undef SIMD_IWRAPPER_2_ #undef SIMD_IWRAPPER_2I - diff --git a/src/gallium/drivers/swr/rasterizer/common/simdlib_128_avx2.inl b/src/gallium/drivers/swr/rasterizer/common/simdlib_128_avx2.inl index e8ee0b4d87b..35f9175ea46 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdlib_128_avx2.inl +++ b/src/gallium/drivers/swr/rasterizer/common/simdlib_128_avx2.inl @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2017 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2017 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #if !defined(__SIMD_LIB_AVX2_HPP__) #error Do not include this file directly, use "simdlib.hpp" instead. #endif @@ -32,14 +32,11 @@ // Only 2 shifts and 2 gathers were introduced with AVX 2 // Also, add native support for FMA operations //============================================================================ -#define SIMD_WRAPPER_3(op) \ - static SIMDINLINE Float SIMDCALL op(Float a, Float b, Float c) \ - {\ - return _mm_##op(a, b, c);\ - } +#define SIMD_WRAPPER_3(op) \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b, Float c) { return _mm_##op(a, b, c); } -SIMD_WRAPPER_3(fmadd_ps); // return (a * b) + c -SIMD_WRAPPER_3(fmsub_ps); // return (a * b) - c +SIMD_WRAPPER_3(fmadd_ps); // return (a * b) + c +SIMD_WRAPPER_3(fmsub_ps); // return (a * b) - c static SIMDINLINE Integer SIMDCALL sllv_epi32(Integer vA, Integer vB) // return a << b (uint32) { @@ -51,18 +48,19 @@ static SIMDINLINE Integer SIMDCALL srlv_epi32(Integer vA, Integer vB) // return return _mm_srlv_epi32(vA, vB); } -template<ScaleFactor ScaleT> -static SIMDINLINE Float SIMDCALL i32gather_ps(float const* p, Integer idx) // return *(float*)(((int8*)p) + (idx * ScaleT)) +template <ScaleFactor ScaleT> +static SIMDINLINE Float SIMDCALL + i32gather_ps(float const* p, Integer idx) // return *(float*)(((int8*)p) + (idx * ScaleT)) { return _mm_i32gather_ps(p, idx, static_cast<const int>(ScaleT)); } // for each element: (mask & (1 << 31)) ? (i32gather_ps<ScaleT>(p, idx), mask = 0) : old -template<ScaleFactor ScaleT> -static SIMDINLINE Float SIMDCALL mask_i32gather_ps(Float old, float const* p, Integer idx, Float mask) +template <ScaleFactor ScaleT> +static SIMDINLINE Float SIMDCALL + mask_i32gather_ps(Float old, float const* p, Integer idx, Float mask) { return _mm_mask_i32gather_ps(old, p, idx, mask, static_cast<const int>(ScaleT)); } #undef SIMD_WRAPPER_3 - diff --git a/src/gallium/drivers/swr/rasterizer/common/simdlib_128_avx512.inl b/src/gallium/drivers/swr/rasterizer/common/simdlib_128_avx512.inl index b70a7691e2b..2ce3caa582f 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdlib_128_avx512.inl +++ b/src/gallium/drivers/swr/rasterizer/common/simdlib_128_avx512.inl @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2017 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2017 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #if !defined(__SIMD_LIB_AVX512_HPP__) #error Do not include this file directly, use "simdlib.hpp" instead. #endif @@ -34,120 +34,138 @@ //============================================================================ private: - static SIMDINLINE __m512 __conv(Float r) { return _mm512_castps128_ps512(r.v); } - static SIMDINLINE __m512d __conv(Double r) { return _mm512_castpd128_pd512(r.v); } - static SIMDINLINE __m512i __conv(Integer r) { return _mm512_castsi128_si512(r.v); } - static SIMDINLINE Float __conv(__m512 r) { return _mm512_castps512_ps128(r); } - static SIMDINLINE Double __conv(__m512d r) { return _mm512_castpd512_pd128(r); } - static SIMDINLINE Integer __conv(__m512i r) { return _mm512_castsi512_si128(r); } -public: +static SIMDINLINE __m512 __conv(Float r) +{ + return _mm512_castps128_ps512(r.v); +} +static SIMDINLINE __m512d __conv(Double r) +{ + return _mm512_castpd128_pd512(r.v); +} +static SIMDINLINE __m512i __conv(Integer r) +{ + return _mm512_castsi128_si512(r.v); +} +static SIMDINLINE Float __conv(__m512 r) +{ + return _mm512_castps512_ps128(r); +} +static SIMDINLINE Double __conv(__m512d r) +{ + return _mm512_castpd512_pd128(r); +} +static SIMDINLINE Integer __conv(__m512i r) +{ + return _mm512_castsi512_si128(r); +} -#define SIMD_WRAPPER_1_(op, intrin, mask) \ - static SIMDINLINE Float SIMDCALL op(Float a) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a)));\ +public: +#define SIMD_WRAPPER_1_(op, intrin, mask) \ + static SIMDINLINE Float SIMDCALL op(Float a) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a))); \ } -#define SIMD_WRAPPER_1(op) SIMD_WRAPPER_1_(op, op, __mmask16(0xf)) +#define SIMD_WRAPPER_1(op) SIMD_WRAPPER_1_(op, op, __mmask16(0xf)) -#define SIMD_WRAPPER_1I_(op, intrin, mask) \ - template<int ImmT> \ - static SIMDINLINE Float SIMDCALL op(Float a) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a), ImmT));\ +#define SIMD_WRAPPER_1I_(op, intrin, mask) \ + template <int ImmT> \ + static SIMDINLINE Float SIMDCALL op(Float a) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a), ImmT)); \ } -#define SIMD_WRAPPER_1I(op) SIMD_WRAPPER_1I_(op, op, __mmask16(0xf)) +#define SIMD_WRAPPER_1I(op) SIMD_WRAPPER_1I_(op, op, __mmask16(0xf)) -#define SIMD_WRAPPER_2_(op, intrin, mask) \ - static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b)));\ +#define SIMD_WRAPPER_2_(op, intrin, mask) \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b))); \ } -#define SIMD_WRAPPER_2(op) SIMD_WRAPPER_2_(op, op, __mmask16(0xf)) +#define SIMD_WRAPPER_2(op) SIMD_WRAPPER_2_(op, op, __mmask16(0xf)) -#define SIMD_WRAPPER_2I(op) \ - template<int ImmT>\ - static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ - {\ - return __conv(_mm512_maskz_##op(0xf, __conv(a), __conv(b), ImmT));\ +#define SIMD_WRAPPER_2I(op) \ + template <int ImmT> \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ + { \ + return __conv(_mm512_maskz_##op(0xf, __conv(a), __conv(b), ImmT)); \ } -#define SIMD_WRAPPER_3_(op, intrin, mask) \ - static SIMDINLINE Float SIMDCALL op(Float a, Float b, Float c) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b), __conv(c)));\ +#define SIMD_WRAPPER_3_(op, intrin, mask) \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b, Float c) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b), __conv(c))); \ } -#define SIMD_WRAPPER_3(op) SIMD_WRAPPER_3_(op, op, __mmask16(0xf)) +#define SIMD_WRAPPER_3(op) SIMD_WRAPPER_3_(op, op, __mmask16(0xf)) -#define SIMD_DWRAPPER_2I(op) \ - template<int ImmT>\ - static SIMDINLINE Double SIMDCALL op(Double a, Double b) \ - {\ - return __conv(_mm512_maskz_##op(0x3, __conv(a), __conv(b), ImmT));\ +#define SIMD_DWRAPPER_2I(op) \ + template <int ImmT> \ + static SIMDINLINE Double SIMDCALL op(Double a, Double b) \ + { \ + return __conv(_mm512_maskz_##op(0x3, __conv(a), __conv(b), ImmT)); \ } -#define SIMD_IWRAPPER_1_(op, intrin, mask) \ - static SIMDINLINE Integer SIMDCALL op(Integer a) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a)));\ +#define SIMD_IWRAPPER_1_(op, intrin, mask) \ + static SIMDINLINE Integer SIMDCALL op(Integer a) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a))); \ } -#define SIMD_IWRAPPER_1_32(op) SIMD_IWRAPPER_1_(op, op, __mmask16(0xf)) +#define SIMD_IWRAPPER_1_32(op) SIMD_IWRAPPER_1_(op, op, __mmask16(0xf)) -#define SIMD_IWRAPPER_1I_(op, intrin, mask) \ - template<int ImmT> \ - static SIMDINLINE Integer SIMDCALL op(Integer a) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a), ImmT));\ +#define SIMD_IWRAPPER_1I_(op, intrin, mask) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer a) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a), ImmT)); \ } -#define SIMD_IWRAPPER_1I_32(op) SIMD_IWRAPPER_1I_(op, op, __mmask16(0xf)) +#define SIMD_IWRAPPER_1I_32(op) SIMD_IWRAPPER_1I_(op, op, __mmask16(0xf)) -#define SIMD_IWRAPPER_2_(op, intrin, mask) \ - static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b)));\ +#define SIMD_IWRAPPER_2_(op, intrin, mask) \ + static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b))); \ } -#define SIMD_IWRAPPER_2_32(op) SIMD_IWRAPPER_2_(op, op, __mmask16(0xf)) +#define SIMD_IWRAPPER_2_32(op) SIMD_IWRAPPER_2_(op, op, __mmask16(0xf)) -#define SIMD_IWRAPPER_2I(op) \ - template<int ImmT>\ - static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ - {\ - return __conv(_mm512_maskz_##op(0xf, __conv(a), __conv(b), ImmT));\ +#define SIMD_IWRAPPER_2I(op) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ + { \ + return __conv(_mm512_maskz_##op(0xf, __conv(a), __conv(b), ImmT)); \ } //----------------------------------------------------------------------- // Single precision floating point arithmetic operations //----------------------------------------------------------------------- -SIMD_WRAPPER_2(add_ps); // return a + b -SIMD_WRAPPER_2(div_ps); // return a / b -SIMD_WRAPPER_3(fmadd_ps); // return (a * b) + c -SIMD_WRAPPER_3(fmsub_ps); // return (a * b) - c -SIMD_WRAPPER_2(max_ps); // return (a > b) ? a : b -SIMD_WRAPPER_2(min_ps); // return (a < b) ? a : b -SIMD_WRAPPER_2(mul_ps); // return a * b +SIMD_WRAPPER_2(add_ps); // return a + b +SIMD_WRAPPER_2(div_ps); // return a / b +SIMD_WRAPPER_3(fmadd_ps); // return (a * b) + c +SIMD_WRAPPER_3(fmsub_ps); // return (a * b) - c +SIMD_WRAPPER_2(max_ps); // return (a > b) ? a : b +SIMD_WRAPPER_2(min_ps); // return (a < b) ? a : b +SIMD_WRAPPER_2(mul_ps); // return a * b SIMD_WRAPPER_1_(rcp_ps, rcp14_ps, __mmask16(0xf)); // return 1.0f / a -SIMD_WRAPPER_1_(rsqrt_ps, rsqrt14_ps, __mmask16(0xf)); // return 1.0f / sqrt(a) -SIMD_WRAPPER_2(sub_ps); // return a - b +SIMD_WRAPPER_1_(rsqrt_ps, rsqrt14_ps, __mmask16(0xf)); // return 1.0f / sqrt(a) +SIMD_WRAPPER_2(sub_ps); // return a - b //----------------------------------------------------------------------- // Integer (various width) arithmetic operations //----------------------------------------------------------------------- -SIMD_IWRAPPER_1_32(abs_epi32); // return absolute_value(a) (int32) -SIMD_IWRAPPER_2_32(add_epi32); // return a + b (int32) -SIMD_IWRAPPER_2_32(max_epi32); // return (a > b) ? a : b (int32) -SIMD_IWRAPPER_2_32(max_epu32); // return (a > b) ? a : b (uint32) -SIMD_IWRAPPER_2_32(min_epi32); // return (a < b) ? a : b (int32) -SIMD_IWRAPPER_2_32(min_epu32); // return (a < b) ? a : b (uint32) -SIMD_IWRAPPER_2_32(mul_epi32); // return a * b (int32) +SIMD_IWRAPPER_1_32(abs_epi32); // return absolute_value(a) (int32) +SIMD_IWRAPPER_2_32(add_epi32); // return a + b (int32) +SIMD_IWRAPPER_2_32(max_epi32); // return (a > b) ? a : b (int32) +SIMD_IWRAPPER_2_32(max_epu32); // return (a > b) ? a : b (uint32) +SIMD_IWRAPPER_2_32(min_epi32); // return (a < b) ? a : b (int32) +SIMD_IWRAPPER_2_32(min_epu32); // return (a < b) ? a : b (uint32) +SIMD_IWRAPPER_2_32(mul_epi32); // return a * b (int32) // SIMD_IWRAPPER_2_8(add_epi8); // return a + b (int8) -// SIMD_IWRAPPER_2_8(adds_epu8); // return ((a + b) > 0xff) ? 0xff : (a + b) (uint8) +// SIMD_IWRAPPER_2_8(adds_epu8); // return ((a + b) > 0xff) ? 0xff : (a + b) (uint8) // return (a * b) & 0xFFFFFFFF // // Multiply the packed 32-bit integers in a and b, producing intermediate 64-bit integers, // and store the low 32 bits of the intermediate integers in dst. SIMD_IWRAPPER_2_32(mullo_epi32); -SIMD_IWRAPPER_2_32(sub_epi32); // return a - b (int32) +SIMD_IWRAPPER_2_32(sub_epi32); // return a - b (int32) // SIMD_IWRAPPER_2_64(sub_epi64); // return a - b (int64) // SIMD_IWRAPPER_2_8(subs_epu8); // return (b > a) ? 0 : (a - b) (uint8) @@ -155,23 +173,22 @@ SIMD_IWRAPPER_2_32(sub_epi32); // return a - b (int32) //----------------------------------------------------------------------- // Logical operations //----------------------------------------------------------------------- -SIMD_IWRAPPER_2_(and_si, and_epi32, __mmask16(0xf)); // return a & b (int) +SIMD_IWRAPPER_2_(and_si, and_epi32, __mmask16(0xf)); // return a & b (int) SIMD_IWRAPPER_2_(andnot_si, andnot_epi32, __mmask16(0xf)); // return (~a) & b (int) -SIMD_IWRAPPER_2_(or_si, or_epi32, __mmask16(0xf)); // return a | b (int) -SIMD_IWRAPPER_2_(xor_si, xor_epi32, __mmask16(0xf)); // return a ^ b (int) - +SIMD_IWRAPPER_2_(or_si, or_epi32, __mmask16(0xf)); // return a | b (int) +SIMD_IWRAPPER_2_(xor_si, xor_epi32, __mmask16(0xf)); // return a ^ b (int) //----------------------------------------------------------------------- // Shift operations //----------------------------------------------------------------------- -SIMD_IWRAPPER_1I_32(slli_epi32); // return a << ImmT -SIMD_IWRAPPER_2_32(sllv_epi32); // return a << b (uint32) -SIMD_IWRAPPER_1I_32(srai_epi32); // return a >> ImmT (int32) -SIMD_IWRAPPER_1I_32(srli_epi32); // return a >> ImmT (uint32) -SIMD_IWRAPPER_2_32(srlv_epi32); // return a >> b (uint32) +SIMD_IWRAPPER_1I_32(slli_epi32); // return a << ImmT +SIMD_IWRAPPER_2_32(sllv_epi32); // return a << b (uint32) +SIMD_IWRAPPER_1I_32(srai_epi32); // return a >> ImmT (int32) +SIMD_IWRAPPER_1I_32(srli_epi32); // return a >> ImmT (uint32) +SIMD_IWRAPPER_2_32(srlv_epi32); // return a >> b (uint32) // use AVX2 version -//SIMD_IWRAPPER_1I_(srli_si, srli_si256); // return a >> (ImmT*8) (uint) +// SIMD_IWRAPPER_1I_(srli_si, srli_si256); // return a >> (ImmT*8) (uint) //----------------------------------------------------------------------- // Conversion operations (Use AVX2 versions) @@ -185,16 +202,16 @@ SIMD_IWRAPPER_2_32(srlv_epi32); // return a >> b (uint32) //----------------------------------------------------------------------- // Comparison operations (Use AVX2 versions //----------------------------------------------------------------------- -//SIMD_IWRAPPER_2_CMP(cmpeq_epi8); // return a == b (int8) -//SIMD_IWRAPPER_2_CMP(cmpeq_epi16); // return a == b (int16) -//SIMD_IWRAPPER_2_CMP(cmpeq_epi32); // return a == b (int32) -//SIMD_IWRAPPER_2_CMP(cmpeq_epi64); // return a == b (int64) -//SIMD_IWRAPPER_2_CMP(cmpgt_epi8,); // return a > b (int8) -//SIMD_IWRAPPER_2_CMP(cmpgt_epi16); // return a > b (int16) -//SIMD_IWRAPPER_2_CMP(cmpgt_epi32); // return a > b (int32) -//SIMD_IWRAPPER_2_CMP(cmpgt_epi64); // return a > b (int64) +// SIMD_IWRAPPER_2_CMP(cmpeq_epi8); // return a == b (int8) +// SIMD_IWRAPPER_2_CMP(cmpeq_epi16); // return a == b (int16) +// SIMD_IWRAPPER_2_CMP(cmpeq_epi32); // return a == b (int32) +// SIMD_IWRAPPER_2_CMP(cmpeq_epi64); // return a == b (int64) +// SIMD_IWRAPPER_2_CMP(cmpgt_epi8,); // return a > b (int8) +// SIMD_IWRAPPER_2_CMP(cmpgt_epi16); // return a > b (int16) +// SIMD_IWRAPPER_2_CMP(cmpgt_epi32); // return a > b (int32) +// SIMD_IWRAPPER_2_CMP(cmpgt_epi64); // return a > b (int64) // -//static SIMDINLINE Integer SIMDCALL cmplt_epi32(Integer a, Integer b) // return a < b (int32) +// static SIMDINLINE Integer SIMDCALL cmplt_epi32(Integer a, Integer b) // return a < b (int32) //{ // return cmpgt_epi32(b, a); //} @@ -202,24 +219,27 @@ SIMD_IWRAPPER_2_32(srlv_epi32); // return a >> b (uint32) //----------------------------------------------------------------------- // Blend / shuffle / permute operations //----------------------------------------------------------------------- -// SIMD_IWRAPPER_2_8(packs_epi16); // int16 --> int8 See documentation for _mm256_packs_epi16 and _mm512_packs_epi16 -// SIMD_IWRAPPER_2_16(packs_epi32); // int32 --> int16 See documentation for _mm256_packs_epi32 and _mm512_packs_epi32 -// SIMD_IWRAPPER_2_8(packus_epi16); // uint16 --> uint8 See documentation for _mm256_packus_epi16 and _mm512_packus_epi16 -// SIMD_IWRAPPER_2_16(packus_epi32); // uint32 --> uint16 See documentation for _mm256_packus_epi32 and _mm512_packus_epi32 -// SIMD_IWRAPPER_2_(permute_epi32, permutevar8x32_epi32); - -//static SIMDINLINE Float SIMDCALL permute_ps(Float a, Integer swiz) // return a[swiz[i]] for each 32-bit lane i (float) +// SIMD_IWRAPPER_2_8(packs_epi16); // int16 --> int8 See documentation for _mm256_packs_epi16 +// and _mm512_packs_epi16 SIMD_IWRAPPER_2_16(packs_epi32); // int32 --> int16 See documentation +// for _mm256_packs_epi32 and _mm512_packs_epi32 SIMD_IWRAPPER_2_8(packus_epi16); // uint16 --> +// uint8 See documentation for _mm256_packus_epi16 and _mm512_packus_epi16 +// SIMD_IWRAPPER_2_16(packus_epi32); // uint32 --> uint16 See documentation for +// _mm256_packus_epi32 and _mm512_packus_epi32 SIMD_IWRAPPER_2_(permute_epi32, +// permutevar8x32_epi32); + +// static SIMDINLINE Float SIMDCALL permute_ps(Float a, Integer swiz) // return a[swiz[i]] for +// each 32-bit lane i (float) //{ // return _mm256_permutevar8x32_ps(a, swiz); //} SIMD_IWRAPPER_1I_32(shuffle_epi32); -//template<int ImmT> -//static SIMDINLINE Integer SIMDCALL shuffle_epi64(Integer a, Integer b) +// template<int ImmT> +// static SIMDINLINE Integer SIMDCALL shuffle_epi64(Integer a, Integer b) //{ // return castpd_si(shuffle_pd<ImmT>(castsi_pd(a), castsi_pd(b))); //} -//SIMD_IWRAPPER_2(shuffle_epi8); +// SIMD_IWRAPPER_2(shuffle_epi8); SIMD_IWRAPPER_2_32(unpackhi_epi32); SIMD_IWRAPPER_2_32(unpacklo_epi32); @@ -233,50 +253,47 @@ SIMD_IWRAPPER_2_32(unpacklo_epi32); //----------------------------------------------------------------------- // Load / store operations //----------------------------------------------------------------------- -static SIMDINLINE Float SIMDCALL load_ps(float const *p) // return *p (loads SIMD width elements from memory) +static SIMDINLINE Float SIMDCALL + load_ps(float const* p) // return *p (loads SIMD width elements from memory) { return __conv(_mm512_maskz_loadu_ps(__mmask16(0xf), p)); } -static SIMDINLINE Integer SIMDCALL load_si(Integer const *p) // return *p +static SIMDINLINE Integer SIMDCALL load_si(Integer const* p) // return *p { return __conv(_mm512_maskz_loadu_epi32(__mmask16(0xf), p)); } -static SIMDINLINE Float SIMDCALL loadu_ps(float const *p) // return *p (same as load_ps but allows for unaligned mem) +static SIMDINLINE Float SIMDCALL + loadu_ps(float const* p) // return *p (same as load_ps but allows for unaligned mem) { return __conv(_mm512_maskz_loadu_ps(__mmask16(0xf), p)); } -static SIMDINLINE Integer SIMDCALL loadu_si(Integer const *p) // return *p (same as load_si but allows for unaligned mem) +static SIMDINLINE Integer SIMDCALL + loadu_si(Integer const* p) // return *p (same as load_si but allows for unaligned mem) { return __conv(_mm512_maskz_loadu_epi32(__mmask16(0xf), p)); } -template<ScaleFactor ScaleT> -static SIMDINLINE Float SIMDCALL i32gather_ps(float const* p, Integer idx) // return *(float*)(((int8*)p) + (idx * ScaleT)) +template <ScaleFactor ScaleT> +static SIMDINLINE Float SIMDCALL + i32gather_ps(float const* p, Integer idx) // return *(float*)(((int8*)p) + (idx * ScaleT)) { return __conv(_mm512_mask_i32gather_ps( - _mm512_setzero_ps(), - __mmask16(0xf), - __conv(idx), - p, - static_cast<int>(ScaleT))); + _mm512_setzero_ps(), __mmask16(0xf), __conv(idx), p, static_cast<int>(ScaleT))); } // for each element: (mask & (1 << 31)) ? (i32gather_ps<ScaleT>(p, idx), mask = 0) : old -template<ScaleFactor ScaleT> -static SIMDINLINE Float SIMDCALL mask_i32gather_ps(Float old, float const* p, Integer idx, Float mask) +template <ScaleFactor ScaleT> +static SIMDINLINE Float SIMDCALL + mask_i32gather_ps(Float old, float const* p, Integer idx, Float mask) { __mmask16 m = 0xf; - m = _mm512_mask_test_epi32_mask(m, _mm512_castps_si512(__conv(mask)), - _mm512_set1_epi32(0x80000000)); - return __conv(_mm512_mask_i32gather_ps( - __conv(old), - m, - __conv(idx), - p, - static_cast<int>(ScaleT))); + m = _mm512_mask_test_epi32_mask( + m, _mm512_castps_si512(__conv(mask)), _mm512_set1_epi32(0x80000000)); + return __conv( + _mm512_mask_i32gather_ps(__conv(old), m, __conv(idx), p, static_cast<int>(ScaleT))); } // static SIMDINLINE uint32_t SIMDCALL movemask_epi8(Integer a) @@ -286,19 +303,20 @@ static SIMDINLINE Float SIMDCALL mask_i32gather_ps(Float old, float const* p, In // _mm512_mask_test_epi8_mask(m, __conv(a), _mm512_set1_epi8(0x80))); // } -static SIMDINLINE void SIMDCALL maskstore_ps(float *p, Integer mask, Float src) +static SIMDINLINE void SIMDCALL maskstore_ps(float* p, Integer mask, Float src) { __mmask16 m = 0xf; - m = _mm512_mask_test_epi32_mask(m, __conv(mask), _mm512_set1_epi32(0x80000000)); + m = _mm512_mask_test_epi32_mask(m, __conv(mask), _mm512_set1_epi32(0x80000000)); _mm512_mask_storeu_ps(p, m, __conv(src)); } -static SIMDINLINE void SIMDCALL store_ps(float *p, Float a) // *p = a (stores all elements contiguously in memory) +static SIMDINLINE void SIMDCALL + store_ps(float* p, Float a) // *p = a (stores all elements contiguously in memory) { _mm512_mask_storeu_ps(p, __mmask16(0xf), __conv(a)); } -static SIMDINLINE void SIMDCALL store_si(Integer *p, Integer a) // *p = a +static SIMDINLINE void SIMDCALL store_si(Integer* p, Integer a) // *p = a { _mm512_mask_storeu_epi32(p, __mmask16(0xf), __conv(a)); } diff --git a/src/gallium/drivers/swr/rasterizer/common/simdlib_128_avx512_core.inl b/src/gallium/drivers/swr/rasterizer/common/simdlib_128_avx512_core.inl index a4ecd09f164..16e59c4decb 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdlib_128_avx512_core.inl +++ b/src/gallium/drivers/swr/rasterizer/common/simdlib_128_avx512_core.inl @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2017 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2017 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #if !defined(__SIMD_LIB_AVX512_HPP__) #error Do not include this file directly, use "simdlib.hpp" instead. #endif @@ -33,114 +33,118 @@ // register set. //============================================================================ -#define SIMD_WRAPPER_1_(op, intrin, mask) \ - static SIMDINLINE Float SIMDCALL op(Float a) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a)));\ +#define SIMD_WRAPPER_1_(op, intrin, mask) \ + static SIMDINLINE Float SIMDCALL op(Float a) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a))); \ } -#define SIMD_WRAPPER_1(op) SIMD_WRAPPER_1_(op, op, __mmask16(0xf)) +#define SIMD_WRAPPER_1(op) SIMD_WRAPPER_1_(op, op, __mmask16(0xf)) -#define SIMD_WRAPPER_1I_(op, intrin, mask) \ - template<int ImmT> \ - static SIMDINLINE Float SIMDCALL op(Float a) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a), ImmT));\ +#define SIMD_WRAPPER_1I_(op, intrin, mask) \ + template <int ImmT> \ + static SIMDINLINE Float SIMDCALL op(Float a) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a), ImmT)); \ } -#define SIMD_WRAPPER_1I(op) SIMD_WRAPPER_1I_(op, op, __mmask16(0xf)) +#define SIMD_WRAPPER_1I(op) SIMD_WRAPPER_1I_(op, op, __mmask16(0xf)) -#define SIMD_WRAPPER_2_(op, intrin, mask) \ - static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b)));\ +#define SIMD_WRAPPER_2_(op, intrin, mask) \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b))); \ } -#define SIMD_WRAPPER_2(op) SIMD_WRAPPER_2_(op, op, __mmask16(0xf)) +#define SIMD_WRAPPER_2(op) SIMD_WRAPPER_2_(op, op, __mmask16(0xf)) -#define SIMD_WRAPPER_2I(op) \ - template<int ImmT>\ - static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ - {\ - return __conv(_mm512_maskz_##op(0xf, __conv(a), __conv(b), ImmT));\ +#define SIMD_WRAPPER_2I(op) \ + template <int ImmT> \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ + { \ + return __conv(_mm512_maskz_##op(0xf, __conv(a), __conv(b), ImmT)); \ } -#define SIMD_WRAPPER_3_(op, intrin, mask) \ - static SIMDINLINE Float SIMDCALL op(Float a, Float b, Float c) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b), __conv(c)));\ +#define SIMD_WRAPPER_3_(op, intrin, mask) \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b, Float c) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b), __conv(c))); \ } -#define SIMD_WRAPPER_3(op) SIMD_WRAPPER_3_(op, op, __mmask16(0xf)) +#define SIMD_WRAPPER_3(op) SIMD_WRAPPER_3_(op, op, __mmask16(0xf)) -#define SIMD_DWRAPPER_1_(op, intrin, mask) \ - static SIMDINLINE Double SIMDCALL op(Double a) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a)));\ +#define SIMD_DWRAPPER_1_(op, intrin, mask) \ + static SIMDINLINE Double SIMDCALL op(Double a) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a))); \ } -#define SIMD_DWRAPPER_1(op) SIMD_DWRAPPER_1_(op, op, __mmask8(0x3)) +#define SIMD_DWRAPPER_1(op) SIMD_DWRAPPER_1_(op, op, __mmask8(0x3)) -#define SIMD_DWRAPPER_1I_(op, intrin, mask) \ - template<int ImmT> \ - static SIMDINLINE Double SIMDCALL op(Double a) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a), ImmT));\ +#define SIMD_DWRAPPER_1I_(op, intrin, mask) \ + template <int ImmT> \ + static SIMDINLINE Double SIMDCALL op(Double a) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a), ImmT)); \ } -#define SIMD_DWRAPPER_1I(op) SIMD_DWRAPPER_1I_(op, op, __mmask8(0x3)) +#define SIMD_DWRAPPER_1I(op) SIMD_DWRAPPER_1I_(op, op, __mmask8(0x3)) -#define SIMD_DWRAPPER_2_(op, intrin, mask) \ - static SIMDINLINE Double SIMDCALL op(Double a, Double b) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b)));\ +#define SIMD_DWRAPPER_2_(op, intrin, mask) \ + static SIMDINLINE Double SIMDCALL op(Double a, Double b) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b))); \ } -#define SIMD_DWRAPPER_2(op) SIMD_DWRAPPER_2_(op, op, __mmask8(0x3)) +#define SIMD_DWRAPPER_2(op) SIMD_DWRAPPER_2_(op, op, __mmask8(0x3)) -#define SIMD_DWRAPPER_2I(op) \ - template<int ImmT>\ - static SIMDINLINE Double SIMDCALL op(Double a, Double b) \ - {\ - return __conv(_mm512_maskz_##op(0x3, __conv(a), __conv(b), ImmT));\ +#define SIMD_DWRAPPER_2I(op) \ + template <int ImmT> \ + static SIMDINLINE Double SIMDCALL op(Double a, Double b) \ + { \ + return __conv(_mm512_maskz_##op(0x3, __conv(a), __conv(b), ImmT)); \ } -#define SIMD_IWRAPPER_1_(op, intrin, mask) \ - static SIMDINLINE Integer SIMDCALL op(Integer a) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a)));\ +#define SIMD_IWRAPPER_1_(op, intrin, mask) \ + static SIMDINLINE Integer SIMDCALL op(Integer a) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a))); \ } -#define SIMD_IWRAPPER_1_8(op) SIMD_IWRAPPER_1_(op, op, __mmask64(0xffffull)) -#define SIMD_IWRAPPER_1_16(op) SIMD_IWRAPPER_1_(op, op, __mmask32(0xff)) -#define SIMD_IWRAPPER_1_64(op) SIMD_IWRAPPER_1_(op, op, __mmask8(0x3)) - -#define SIMD_IWRAPPER_1I_(op, intrin, mask) \ - template<int ImmT> \ - static SIMDINLINE Integer SIMDCALL op(Integer a) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a), ImmT));\ +#define SIMD_IWRAPPER_1_8(op) SIMD_IWRAPPER_1_(op, op, __mmask64(0xffffull)) +#define SIMD_IWRAPPER_1_16(op) SIMD_IWRAPPER_1_(op, op, __mmask32(0xff)) +#define SIMD_IWRAPPER_1_64(op) SIMD_IWRAPPER_1_(op, op, __mmask8(0x3)) + +#define SIMD_IWRAPPER_1I_(op, intrin, mask) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer a) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a), ImmT)); \ } -#define SIMD_IWRAPPER_1I_8(op) SIMD_IWRAPPER_1I_(op, op, __mmask64(0xffffull)) -#define SIMD_IWRAPPER_1I_16(op) SIMD_IWRAPPER_1I_(op, op, __mmask32(0xff)) -#define SIMD_IWRAPPER_1I_64(op) SIMD_IWRAPPER_1I_(op, op, __mmask8(0x3)) - -#define SIMD_IWRAPPER_2_(op, intrin, mask) \ - static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b)));\ +#define SIMD_IWRAPPER_1I_8(op) SIMD_IWRAPPER_1I_(op, op, __mmask64(0xffffull)) +#define SIMD_IWRAPPER_1I_16(op) SIMD_IWRAPPER_1I_(op, op, __mmask32(0xff)) +#define SIMD_IWRAPPER_1I_64(op) SIMD_IWRAPPER_1I_(op, op, __mmask8(0x3)) + +#define SIMD_IWRAPPER_2_(op, intrin, mask) \ + static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b))); \ } -#define SIMD_IWRAPPER_2_8(op) SIMD_IWRAPPER_2_(op, op, __mmask64(0xffffull)) -#define SIMD_IWRAPPER_2_16(op) SIMD_IWRAPPER_2_(op, op, __mmask32(0xff)) -#define SIMD_IWRAPPER_2_64(op) SIMD_IWRAPPER_2_(op, op, __mmask8(0x3)) - -#define SIMD_IWRAPPER_2I(op) \ - template<int ImmT>\ - static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ - {\ - return __conv(_mm512_maskz_##op(0xf, __conv(a), __conv(b), ImmT));\ +#define SIMD_IWRAPPER_2_8(op) SIMD_IWRAPPER_2_(op, op, __mmask64(0xffffull)) +#define SIMD_IWRAPPER_2_16(op) SIMD_IWRAPPER_2_(op, op, __mmask32(0xff)) +#define SIMD_IWRAPPER_2_64(op) SIMD_IWRAPPER_2_(op, op, __mmask8(0x3)) + +#define SIMD_IWRAPPER_2I(op) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ + { \ + return __conv(_mm512_maskz_##op(0xf, __conv(a), __conv(b), ImmT)); \ } -SIMD_IWRAPPER_2_8(add_epi8); // return a + b (int8) -SIMD_IWRAPPER_2_8(adds_epu8); // return ((a + b) > 0xff) ? 0xff : (a + b) (uint8) -SIMD_IWRAPPER_2_64(sub_epi64); // return a - b (int64) -SIMD_IWRAPPER_2_8(subs_epu8); // return (b > a) ? 0 : (a - b) (uint8) -SIMD_IWRAPPER_2_8(packs_epi16); // int16 --> int8 See documentation for _mm256_packs_epi16 and _mm512_packs_epi16 -SIMD_IWRAPPER_2_16(packs_epi32); // int32 --> int16 See documentation for _mm256_packs_epi32 and _mm512_packs_epi32 -SIMD_IWRAPPER_2_8(packus_epi16); // uint16 --> uint8 See documentation for _mm256_packus_epi16 and _mm512_packus_epi16 -SIMD_IWRAPPER_2_16(packus_epi32); // uint32 --> uint16 See documentation for _mm256_packus_epi32 and _mm512_packus_epi32 +SIMD_IWRAPPER_2_8(add_epi8); // return a + b (int8) +SIMD_IWRAPPER_2_8(adds_epu8); // return ((a + b) > 0xff) ? 0xff : (a + b) (uint8) +SIMD_IWRAPPER_2_64(sub_epi64); // return a - b (int64) +SIMD_IWRAPPER_2_8(subs_epu8); // return (b > a) ? 0 : (a - b) (uint8) +SIMD_IWRAPPER_2_8(packs_epi16); // int16 --> int8 See documentation for _mm256_packs_epi16 and + // _mm512_packs_epi16 +SIMD_IWRAPPER_2_16(packs_epi32); // int32 --> int16 See documentation for _mm256_packs_epi32 and + // _mm512_packs_epi32 +SIMD_IWRAPPER_2_8(packus_epi16); // uint16 --> uint8 See documentation for _mm256_packus_epi16 and + // _mm512_packus_epi16 +SIMD_IWRAPPER_2_16(packus_epi32); // uint32 --> uint16 See documentation for _mm256_packus_epi32 and + // _mm512_packus_epi32 SIMD_IWRAPPER_2_16(unpackhi_epi16); SIMD_IWRAPPER_2_64(unpackhi_epi64); SIMD_IWRAPPER_2_8(unpackhi_epi8); @@ -151,8 +155,7 @@ SIMD_IWRAPPER_2_8(unpacklo_epi8); static SIMDINLINE uint32_t SIMDCALL movemask_epi8(Integer a) { __mmask64 m = 0xffffull; - return static_cast<uint32_t>( - _mm512_mask_test_epi8_mask(m, __conv(a), _mm512_set1_epi8(0x80))); + return static_cast<uint32_t>(_mm512_mask_test_epi8_mask(m, __conv(a), _mm512_set1_epi8(0x80))); } #undef SIMD_WRAPPER_1_ diff --git a/src/gallium/drivers/swr/rasterizer/common/simdlib_128_avx512_knights.inl b/src/gallium/drivers/swr/rasterizer/common/simdlib_128_avx512_knights.inl index b0cae503419..1b6592e2003 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdlib_128_avx512_knights.inl +++ b/src/gallium/drivers/swr/rasterizer/common/simdlib_128_avx512_knights.inl @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2017 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2017 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #if !defined(__SIMD_LIB_AVX512_HPP__) #error Do not include this file directly, use "simdlib.hpp" instead. #endif @@ -32,4 +32,3 @@ // These use native AVX512 instructions with masking to enable a larger // register set. //============================================================================ - diff --git a/src/gallium/drivers/swr/rasterizer/common/simdlib_256_avx.inl b/src/gallium/drivers/swr/rasterizer/common/simdlib_256_avx.inl index 00c094a425a..4ac0f95a468 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdlib_256_avx.inl +++ b/src/gallium/drivers/swr/rasterizer/common/simdlib_256_avx.inl @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2017 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2017 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #if !defined(__SIMD_LIB_AVX_HPP__) #error Do not include this file directly, use "simdlib.hpp" instead. #endif @@ -30,178 +30,172 @@ using SIMD128T = SIMD128Impl::AVXImpl; // SIMD256 AVX (1) implementation //============================================================================ -#define SIMD_WRAPPER_1(op) \ - static SIMDINLINE Float SIMDCALL op(Float const &a) \ - {\ - return _mm256_##op(a);\ - } +#define SIMD_WRAPPER_1(op) \ + static SIMDINLINE Float SIMDCALL op(Float const& a) { return _mm256_##op(a); } -#define SIMD_WRAPPER_2(op) \ - static SIMDINLINE Float SIMDCALL op(Float const &a, Float const &b) \ - {\ - return _mm256_##op(a, b);\ +#define SIMD_WRAPPER_2(op) \ + static SIMDINLINE Float SIMDCALL op(Float const& a, Float const& b) \ + { \ + return _mm256_##op(a, b); \ } -#define SIMD_DWRAPPER_2(op) \ - static SIMDINLINE Double SIMDCALL op(Double const &a, Double const &b) \ - {\ - return _mm256_##op(a, b);\ +#define SIMD_DWRAPPER_2(op) \ + static SIMDINLINE Double SIMDCALL op(Double const& a, Double const& b) \ + { \ + return _mm256_##op(a, b); \ } -#define SIMD_WRAPPER_2I(op) \ - template<int ImmT>\ - static SIMDINLINE Float SIMDCALL op(Float const &a, Float const &b) \ - {\ - return _mm256_##op(a, b, ImmT);\ +#define SIMD_WRAPPER_2I(op) \ + template <int ImmT> \ + static SIMDINLINE Float SIMDCALL op(Float const& a, Float const& b) \ + { \ + return _mm256_##op(a, b, ImmT); \ } -#define SIMD_DWRAPPER_2I(op) \ - template<int ImmT>\ - static SIMDINLINE Double SIMDCALL op(Double const &a, Double const &b) \ - {\ - return _mm256_##op(a, b, ImmT);\ +#define SIMD_DWRAPPER_2I(op) \ + template <int ImmT> \ + static SIMDINLINE Double SIMDCALL op(Double const& a, Double const& b) \ + { \ + return _mm256_##op(a, b, ImmT); \ } -#define SIMD_WRAPPER_3(op) \ - static SIMDINLINE Float SIMDCALL op(Float const &a, Float const &b, Float const &c) \ - {\ - return _mm256_##op(a, b, c);\ +#define SIMD_WRAPPER_3(op) \ + static SIMDINLINE Float SIMDCALL op(Float const& a, Float const& b, Float const& c) \ + { \ + return _mm256_##op(a, b, c); \ } -#define SIMD_IWRAPPER_1(op) \ - static SIMDINLINE Integer SIMDCALL op(Integer const &a) \ - {\ - return _mm256_##op(a);\ - } +#define SIMD_IWRAPPER_1(op) \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a) { return _mm256_##op(a); } -#define SIMD_IWRAPPER_2(op) \ - static SIMDINLINE Integer SIMDCALL op(Integer const &a, Integer const &b) \ - {\ - return _mm256_##op(a, b);\ +#define SIMD_IWRAPPER_2(op) \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a, Integer const& b) \ + { \ + return _mm256_##op(a, b); \ } -#define SIMD_IFWRAPPER_2(op, intrin) \ - static SIMDINLINE Integer SIMDCALL op(Integer const &a, Integer const &b) \ - {\ - return castps_si( intrin(castsi_ps(a), castsi_ps(b)) );\ +#define SIMD_IFWRAPPER_2(op, intrin) \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a, Integer const& b) \ + { \ + return castps_si(intrin(castsi_ps(a), castsi_ps(b))); \ } -#define SIMD_IFWRAPPER_2I(op, intrin) \ - template<int ImmT> \ - static SIMDINLINE Integer SIMDCALL op(Integer const &a, Integer const &b) \ - {\ - return castps_si( intrin(castsi_ps(a), castsi_ps(b), ImmT) );\ +#define SIMD_IFWRAPPER_2I(op, intrin) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a, Integer const& b) \ + { \ + return castps_si(intrin(castsi_ps(a), castsi_ps(b), ImmT)); \ } -#define SIMD_IWRAPPER_2I_(op, intrin) \ - template<int ImmT>\ - static SIMDINLINE Integer SIMDCALL op(Integer const &a, Integer const &b) \ - {\ - return _mm256_##intrin(a, b, ImmT);\ +#define SIMD_IWRAPPER_2I_(op, intrin) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a, Integer const& b) \ + { \ + return _mm256_##intrin(a, b, ImmT); \ } -#define SIMD_IWRAPPER_2I(op) SIMD_IWRAPPER_2I_(op, op) +#define SIMD_IWRAPPER_2I(op) SIMD_IWRAPPER_2I_(op, op) -#define SIMD_IWRAPPER_3(op) \ - static SIMDINLINE Integer SIMDCALL op(Integer const &a, Integer const &b, Integer const &c) \ - {\ - return _mm256_##op(a, b, c);\ +#define SIMD_IWRAPPER_3(op) \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a, Integer const& b, Integer const& c) \ + { \ + return _mm256_##op(a, b, c); \ } // emulated integer simd -#define SIMD_EMU_IWRAPPER_1(op) \ - static SIMDINLINE \ - Integer SIMDCALL op(Integer const &a)\ - {\ - return Integer\ - {\ - SIMD128T::op(a.v4[0]),\ - SIMD128T::op(a.v4[1]),\ - };\ +#define SIMD_EMU_IWRAPPER_1(op) \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a) \ + { \ + return Integer{ \ + SIMD128T::op(a.v4[0]), \ + SIMD128T::op(a.v4[1]), \ + }; \ } -#define SIMD_EMU_IWRAPPER_1L(op, shift) \ - static SIMDINLINE \ - Integer SIMDCALL op(Integer const &a)\ - {\ - return Integer \ - {\ - SIMD128T::op(a.v4[0]), \ - SIMD128T::op(SIMD128T::template srli_si<shift>(a.v4[0])), \ - };\ - }\ - static SIMDINLINE \ - Integer SIMDCALL op(SIMD128Impl::Integer const &a)\ - {\ - return Integer \ - {\ - SIMD128T::op(a), \ - SIMD128T::op(SIMD128T::template srli_si<shift>(a)), \ - };\ +#define SIMD_EMU_IWRAPPER_1L(op, shift) \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a) \ + { \ + return Integer{ \ + SIMD128T::op(a.v4[0]), \ + SIMD128T::op(SIMD128T::template srli_si<shift>(a.v4[0])), \ + }; \ + } \ + static SIMDINLINE Integer SIMDCALL op(SIMD128Impl::Integer const& a) \ + { \ + return Integer{ \ + SIMD128T::op(a), \ + SIMD128T::op(SIMD128T::template srli_si<shift>(a)), \ + }; \ } -#define SIMD_EMU_IWRAPPER_1I(op) \ - template <int ImmT> static SIMDINLINE \ - Integer SIMDCALL op(Integer const &a)\ - {\ - return Integer\ - {\ - SIMD128T::template op<ImmT>(a.v4[0]),\ - SIMD128T::template op<ImmT>(a.v4[1]),\ - };\ +#define SIMD_EMU_IWRAPPER_1I(op) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a) \ + { \ + return Integer{ \ + SIMD128T::template op<ImmT>(a.v4[0]), \ + SIMD128T::template op<ImmT>(a.v4[1]), \ + }; \ } -#define SIMD_EMU_IWRAPPER_2(op) \ - static SIMDINLINE \ - Integer SIMDCALL op(Integer const &a, Integer const &b)\ - {\ - return Integer\ - {\ - SIMD128T::op(a.v4[0], b.v4[0]),\ - SIMD128T::op(a.v4[1], b.v4[1]),\ - };\ +#define SIMD_EMU_IWRAPPER_2(op) \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a, Integer const& b) \ + { \ + return Integer{ \ + SIMD128T::op(a.v4[0], b.v4[0]), \ + SIMD128T::op(a.v4[1], b.v4[1]), \ + }; \ } -#define SIMD_EMU_IWRAPPER_2I(op) \ - template <int ImmT> static SIMDINLINE \ - Integer SIMDCALL op(Integer const &a, Integer const &b)\ - {\ - return Integer\ - {\ - SIMD128T::template op<ImmT>(a.v4[0], b.v[0]),\ - SIMD128T::template op<ImmT>(a.v4[1], b.v[1]),\ - };\ +#define SIMD_EMU_IWRAPPER_2I(op) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a, Integer const& b) \ + { \ + return Integer{ \ + SIMD128T::template op<ImmT>(a.v4[0], b.v[0]), \ + SIMD128T::template op<ImmT>(a.v4[1], b.v[1]), \ + }; \ } //----------------------------------------------------------------------- // Single precision floating point arithmetic operations //----------------------------------------------------------------------- -SIMD_WRAPPER_2(add_ps); // return a + b -SIMD_WRAPPER_2(div_ps); // return a / b +SIMD_WRAPPER_2(add_ps); // return a + b +SIMD_WRAPPER_2(div_ps); // return a / b -static SIMDINLINE Float SIMDCALL fmadd_ps(Float const &a, Float const &b, Float const &c) // return (a * b) + c +static SIMDINLINE Float SIMDCALL fmadd_ps(Float const& a, + Float const& b, + Float const& c) // return (a * b) + c { return add_ps(mul_ps(a, b), c); } -static SIMDINLINE Float SIMDCALL fmsub_ps(Float const &a, Float const &b, Float const &c) // return (a * b) - c +static SIMDINLINE Float SIMDCALL fmsub_ps(Float const& a, + Float const& b, + Float const& c) // return (a * b) - c { return sub_ps(mul_ps(a, b), c); } -SIMD_WRAPPER_2(max_ps); // return (a > b) ? a : b -SIMD_WRAPPER_2(min_ps); // return (a < b) ? a : b -SIMD_WRAPPER_2(mul_ps); // return a * b -SIMD_WRAPPER_1(rcp_ps); // return 1.0f / a -SIMD_WRAPPER_1(rsqrt_ps); // return 1.0f / sqrt(a) -SIMD_WRAPPER_2(sub_ps); // return a - b +SIMD_WRAPPER_2(max_ps); // return (a > b) ? a : b +SIMD_WRAPPER_2(min_ps); // return (a < b) ? a : b +SIMD_WRAPPER_2(mul_ps); // return a * b +SIMD_WRAPPER_1(rcp_ps); // return 1.0f / a +SIMD_WRAPPER_1(rsqrt_ps); // return 1.0f / sqrt(a) +SIMD_WRAPPER_2(sub_ps); // return a - b template <RoundMode RMT> -static SIMDINLINE Float SIMDCALL round_ps(Float const &a) +static SIMDINLINE Float SIMDCALL round_ps(Float const& a) { return _mm256_round_ps(a, static_cast<int>(RMT)); } -static SIMDINLINE Float SIMDCALL ceil_ps(Float const &a) { return round_ps<RoundMode::CEIL_NOEXC>(a); } -static SIMDINLINE Float SIMDCALL floor_ps(Float const &a) { return round_ps<RoundMode::FLOOR_NOEXC>(a); } +static SIMDINLINE Float SIMDCALL ceil_ps(Float const& a) +{ + return round_ps<RoundMode::CEIL_NOEXC>(a); +} +static SIMDINLINE Float SIMDCALL floor_ps(Float const& a) +{ + return round_ps<RoundMode::FLOOR_NOEXC>(a); +} //----------------------------------------------------------------------- // Integer (various width) arithmetic operations @@ -209,7 +203,7 @@ static SIMDINLINE Float SIMDCALL floor_ps(Float const &a) { return round_ps<Roun SIMD_EMU_IWRAPPER_1(abs_epi32); // return absolute_value(a) (int32) SIMD_EMU_IWRAPPER_2(add_epi32); // return a + b (int32) SIMD_EMU_IWRAPPER_2(add_epi8); // return a + b (int8) -SIMD_EMU_IWRAPPER_2(adds_epu8); // return ((a + b) > 0xff) ? 0xff : (a + b) (uint8) +SIMD_EMU_IWRAPPER_2(adds_epu8); // return ((a + b) > 0xff) ? 0xff : (a + b) (uint8) SIMD_EMU_IWRAPPER_2(max_epi32); // return (a > b) ? a : b (int32) SIMD_EMU_IWRAPPER_2(max_epu32); // return (a > b) ? a : b (uint32) SIMD_EMU_IWRAPPER_2(min_epi32); // return (a < b) ? a : b (int32) @@ -237,182 +231,184 @@ SIMD_EMU_IWRAPPER_2(or_si); // return a | b (int) SIMD_WRAPPER_2(xor_ps); // return a ^ b (float treated as int) SIMD_EMU_IWRAPPER_2(xor_si); // return a ^ b (int) - //----------------------------------------------------------------------- // Shift operations //----------------------------------------------------------------------- -SIMD_EMU_IWRAPPER_1I(slli_epi32); // return a << ImmT +SIMD_EMU_IWRAPPER_1I(slli_epi32); // return a << ImmT -static SIMDINLINE Integer SIMDCALL sllv_epi32(Integer const &vA, Integer const &vCount) // return a << b (uint32) +static SIMDINLINE Integer SIMDCALL sllv_epi32(Integer const& vA, + Integer const& vCount) // return a << b (uint32) { int32_t aHi, aLow, countHi, countLow; - __m128i vAHi = _mm_castps_si128(_mm256_extractf128_ps(_mm256_castsi256_ps(vA), 1)); - __m128i vALow = _mm_castps_si128(_mm256_extractf128_ps(_mm256_castsi256_ps(vA), 0)); - __m128i vCountHi = _mm_castps_si128(_mm256_extractf128_ps(_mm256_castsi256_ps(vCount), 1)); + __m128i vAHi = _mm_castps_si128(_mm256_extractf128_ps(_mm256_castsi256_ps(vA), 1)); + __m128i vALow = _mm_castps_si128(_mm256_extractf128_ps(_mm256_castsi256_ps(vA), 0)); + __m128i vCountHi = _mm_castps_si128(_mm256_extractf128_ps(_mm256_castsi256_ps(vCount), 1)); __m128i vCountLow = _mm_castps_si128(_mm256_extractf128_ps(_mm256_castsi256_ps(vCount), 0)); - aHi = _mm_extract_epi32(vAHi, 0); + aHi = _mm_extract_epi32(vAHi, 0); countHi = _mm_extract_epi32(vCountHi, 0); aHi <<= countHi; vAHi = _mm_insert_epi32(vAHi, aHi, 0); - aLow = _mm_extract_epi32(vALow, 0); + aLow = _mm_extract_epi32(vALow, 0); countLow = _mm_extract_epi32(vCountLow, 0); aLow <<= countLow; vALow = _mm_insert_epi32(vALow, aLow, 0); - aHi = _mm_extract_epi32(vAHi, 1); + aHi = _mm_extract_epi32(vAHi, 1); countHi = _mm_extract_epi32(vCountHi, 1); aHi <<= countHi; vAHi = _mm_insert_epi32(vAHi, aHi, 1); - aLow = _mm_extract_epi32(vALow, 1); + aLow = _mm_extract_epi32(vALow, 1); countLow = _mm_extract_epi32(vCountLow, 1); aLow <<= countLow; vALow = _mm_insert_epi32(vALow, aLow, 1); - aHi = _mm_extract_epi32(vAHi, 2); + aHi = _mm_extract_epi32(vAHi, 2); countHi = _mm_extract_epi32(vCountHi, 2); aHi <<= countHi; vAHi = _mm_insert_epi32(vAHi, aHi, 2); - aLow = _mm_extract_epi32(vALow, 2); + aLow = _mm_extract_epi32(vALow, 2); countLow = _mm_extract_epi32(vCountLow, 2); aLow <<= countLow; vALow = _mm_insert_epi32(vALow, aLow, 2); - aHi = _mm_extract_epi32(vAHi, 3); + aHi = _mm_extract_epi32(vAHi, 3); countHi = _mm_extract_epi32(vCountHi, 3); aHi <<= countHi; vAHi = _mm_insert_epi32(vAHi, aHi, 3); - aLow = _mm_extract_epi32(vALow, 3); + aLow = _mm_extract_epi32(vALow, 3); countLow = _mm_extract_epi32(vCountLow, 3); aLow <<= countLow; vALow = _mm_insert_epi32(vALow, aLow, 3); __m256i ret = _mm256_set1_epi32(0); - ret = _mm256_insertf128_si256(ret, vAHi, 1); - ret = _mm256_insertf128_si256(ret, vALow, 0); + ret = _mm256_insertf128_si256(ret, vAHi, 1); + ret = _mm256_insertf128_si256(ret, vALow, 0); return ret; } -SIMD_EMU_IWRAPPER_1I(srai_epi32); // return a >> ImmT (int32) -SIMD_EMU_IWRAPPER_1I(srli_epi32); // return a >> ImmT (uint32) -SIMD_EMU_IWRAPPER_1I(srli_si); // return a >> (ImmT*8) (uint) +SIMD_EMU_IWRAPPER_1I(srai_epi32); // return a >> ImmT (int32) +SIMD_EMU_IWRAPPER_1I(srli_epi32); // return a >> ImmT (uint32) +SIMD_EMU_IWRAPPER_1I(srli_si); // return a >> (ImmT*8) (uint) -template<int ImmT> // same as srli_si, but with Float cast to int -static SIMDINLINE Float SIMDCALL srlisi_ps(Float const &a) +template <int ImmT> // same as srli_si, but with Float cast to int +static SIMDINLINE Float SIMDCALL srlisi_ps(Float const& a) { return castsi_ps(srli_si<ImmT>(castps_si(a))); } -static SIMDINLINE Integer SIMDCALL srlv_epi32(Integer const &vA, Integer const &vCount) // return a >> b (uint32) +static SIMDINLINE Integer SIMDCALL srlv_epi32(Integer const& vA, + Integer const& vCount) // return a >> b (uint32) { int32_t aHi, aLow, countHi, countLow; - __m128i vAHi = _mm_castps_si128(_mm256_extractf128_ps(_mm256_castsi256_ps(vA), 1)); - __m128i vALow = _mm_castps_si128(_mm256_extractf128_ps(_mm256_castsi256_ps(vA), 0)); - __m128i vCountHi = _mm_castps_si128(_mm256_extractf128_ps(_mm256_castsi256_ps(vCount), 1)); + __m128i vAHi = _mm_castps_si128(_mm256_extractf128_ps(_mm256_castsi256_ps(vA), 1)); + __m128i vALow = _mm_castps_si128(_mm256_extractf128_ps(_mm256_castsi256_ps(vA), 0)); + __m128i vCountHi = _mm_castps_si128(_mm256_extractf128_ps(_mm256_castsi256_ps(vCount), 1)); __m128i vCountLow = _mm_castps_si128(_mm256_extractf128_ps(_mm256_castsi256_ps(vCount), 0)); - aHi = _mm_extract_epi32(vAHi, 0); + aHi = _mm_extract_epi32(vAHi, 0); countHi = _mm_extract_epi32(vCountHi, 0); aHi >>= countHi; vAHi = _mm_insert_epi32(vAHi, aHi, 0); - aLow = _mm_extract_epi32(vALow, 0); + aLow = _mm_extract_epi32(vALow, 0); countLow = _mm_extract_epi32(vCountLow, 0); aLow >>= countLow; vALow = _mm_insert_epi32(vALow, aLow, 0); - aHi = _mm_extract_epi32(vAHi, 1); + aHi = _mm_extract_epi32(vAHi, 1); countHi = _mm_extract_epi32(vCountHi, 1); aHi >>= countHi; vAHi = _mm_insert_epi32(vAHi, aHi, 1); - aLow = _mm_extract_epi32(vALow, 1); + aLow = _mm_extract_epi32(vALow, 1); countLow = _mm_extract_epi32(vCountLow, 1); aLow >>= countLow; vALow = _mm_insert_epi32(vALow, aLow, 1); - aHi = _mm_extract_epi32(vAHi, 2); + aHi = _mm_extract_epi32(vAHi, 2); countHi = _mm_extract_epi32(vCountHi, 2); aHi >>= countHi; vAHi = _mm_insert_epi32(vAHi, aHi, 2); - aLow = _mm_extract_epi32(vALow, 2); + aLow = _mm_extract_epi32(vALow, 2); countLow = _mm_extract_epi32(vCountLow, 2); aLow >>= countLow; vALow = _mm_insert_epi32(vALow, aLow, 2); - aHi = _mm_extract_epi32(vAHi, 3); + aHi = _mm_extract_epi32(vAHi, 3); countHi = _mm_extract_epi32(vCountHi, 3); aHi >>= countHi; vAHi = _mm_insert_epi32(vAHi, aHi, 3); - aLow = _mm_extract_epi32(vALow, 3); + aLow = _mm_extract_epi32(vALow, 3); countLow = _mm_extract_epi32(vCountLow, 3); aLow >>= countLow; vALow = _mm_insert_epi32(vALow, aLow, 3); __m256i ret = _mm256_set1_epi32(0); - ret = _mm256_insertf128_si256(ret, vAHi, 1); - ret = _mm256_insertf128_si256(ret, vALow, 0); + ret = _mm256_insertf128_si256(ret, vAHi, 1); + ret = _mm256_insertf128_si256(ret, vALow, 0); return ret; } - - //----------------------------------------------------------------------- // Conversion operations //----------------------------------------------------------------------- -static SIMDINLINE Float SIMDCALL castpd_ps(Double const &a) // return *(Float*)(&a) +static SIMDINLINE Float SIMDCALL castpd_ps(Double const& a) // return *(Float*)(&a) { return _mm256_castpd_ps(a); } -static SIMDINLINE Integer SIMDCALL castps_si(Float const &a) // return *(Integer*)(&a) +static SIMDINLINE Integer SIMDCALL castps_si(Float const& a) // return *(Integer*)(&a) { return _mm256_castps_si256(a); } -static SIMDINLINE Double SIMDCALL castsi_pd(Integer const &a) // return *(Double*)(&a) +static SIMDINLINE Double SIMDCALL castsi_pd(Integer const& a) // return *(Double*)(&a) { return _mm256_castsi256_pd(a); } -static SIMDINLINE Double SIMDCALL castps_pd(Float const &a) // return *(Double*)(&a) +static SIMDINLINE Double SIMDCALL castps_pd(Float const& a) // return *(Double*)(&a) { return _mm256_castps_pd(a); } -static SIMDINLINE Integer SIMDCALL castpd_si(Double const &a) // return *(Integer*)(&a) +static SIMDINLINE Integer SIMDCALL castpd_si(Double const& a) // return *(Integer*)(&a) { return _mm256_castpd_si256(a); } -static SIMDINLINE Float SIMDCALL castsi_ps(Integer const &a) // return *(Float*)(&a) +static SIMDINLINE Float SIMDCALL castsi_ps(Integer const& a) // return *(Float*)(&a) { return _mm256_castsi256_ps(a); } -static SIMDINLINE Float SIMDCALL cvtepi32_ps(Integer const &a) // return (float)a (int32 --> float) +static SIMDINLINE Float SIMDCALL + cvtepi32_ps(Integer const& a) // return (float)a (int32 --> float) { return _mm256_cvtepi32_ps(a); } -SIMD_EMU_IWRAPPER_1L(cvtepu8_epi16, 8); // return (int16)a (uint8 --> int16) -SIMD_EMU_IWRAPPER_1L(cvtepu8_epi32, 4); // return (int32)a (uint8 --> int32) -SIMD_EMU_IWRAPPER_1L(cvtepu16_epi32, 8); // return (int32)a (uint16 --> int32) -SIMD_EMU_IWRAPPER_1L(cvtepu16_epi64, 4); // return (int64)a (uint16 --> int64) -SIMD_EMU_IWRAPPER_1L(cvtepu32_epi64, 8); // return (int64)a (uint32 --> int64) +SIMD_EMU_IWRAPPER_1L(cvtepu8_epi16, 8); // return (int16)a (uint8 --> int16) +SIMD_EMU_IWRAPPER_1L(cvtepu8_epi32, 4); // return (int32)a (uint8 --> int32) +SIMD_EMU_IWRAPPER_1L(cvtepu16_epi32, 8); // return (int32)a (uint16 --> int32) +SIMD_EMU_IWRAPPER_1L(cvtepu16_epi64, 4); // return (int64)a (uint16 --> int64) +SIMD_EMU_IWRAPPER_1L(cvtepu32_epi64, 8); // return (int64)a (uint32 --> int64) -static SIMDINLINE Integer SIMDCALL cvtps_epi32(Float const &a) // return (int32)a (float --> int32) +static SIMDINLINE Integer SIMDCALL + cvtps_epi32(Float const& a) // return (int32)a (float --> int32) { return _mm256_cvtps_epi32(a); } -static SIMDINLINE Integer SIMDCALL cvttps_epi32(Float const &a) // return (int32)a (rnd_to_zero(float) --> int32) +static SIMDINLINE Integer SIMDCALL + cvttps_epi32(Float const& a) // return (int32)a (rnd_to_zero(float) --> int32) { return _mm256_cvttps_epi32(a); } @@ -420,79 +416,107 @@ static SIMDINLINE Integer SIMDCALL cvttps_epi32(Float const &a) // ret //----------------------------------------------------------------------- // Comparison operations //----------------------------------------------------------------------- -template<CompareType CmpTypeT> -static SIMDINLINE Float SIMDCALL cmp_ps(Float const &a, Float const &b) // return a (CmpTypeT) b +template <CompareType CmpTypeT> +static SIMDINLINE Float SIMDCALL cmp_ps(Float const& a, Float const& b) // return a (CmpTypeT) b { return _mm256_cmp_ps(a, b, static_cast<const int>(CmpTypeT)); } -static SIMDINLINE Float SIMDCALL cmplt_ps(Float const &a, Float const &b) { return cmp_ps<CompareType::LT_OQ>(a, b); } -static SIMDINLINE Float SIMDCALL cmpgt_ps(Float const &a, Float const &b) { return cmp_ps<CompareType::GT_OQ>(a, b); } -static SIMDINLINE Float SIMDCALL cmpneq_ps(Float const &a, Float const &b) { return cmp_ps<CompareType::NEQ_OQ>(a, b); } -static SIMDINLINE Float SIMDCALL cmpeq_ps(Float const &a, Float const &b) { return cmp_ps<CompareType::EQ_OQ>(a, b); } -static SIMDINLINE Float SIMDCALL cmpge_ps(Float const &a, Float const &b) { return cmp_ps<CompareType::GE_OQ>(a, b); } -static SIMDINLINE Float SIMDCALL cmple_ps(Float const &a, Float const &b) { return cmp_ps<CompareType::LE_OQ>(a, b); } +static SIMDINLINE Float SIMDCALL cmplt_ps(Float const& a, Float const& b) +{ + return cmp_ps<CompareType::LT_OQ>(a, b); +} +static SIMDINLINE Float SIMDCALL cmpgt_ps(Float const& a, Float const& b) +{ + return cmp_ps<CompareType::GT_OQ>(a, b); +} +static SIMDINLINE Float SIMDCALL cmpneq_ps(Float const& a, Float const& b) +{ + return cmp_ps<CompareType::NEQ_OQ>(a, b); +} +static SIMDINLINE Float SIMDCALL cmpeq_ps(Float const& a, Float const& b) +{ + return cmp_ps<CompareType::EQ_OQ>(a, b); +} +static SIMDINLINE Float SIMDCALL cmpge_ps(Float const& a, Float const& b) +{ + return cmp_ps<CompareType::GE_OQ>(a, b); +} +static SIMDINLINE Float SIMDCALL cmple_ps(Float const& a, Float const& b) +{ + return cmp_ps<CompareType::LE_OQ>(a, b); +} -SIMD_EMU_IWRAPPER_2(cmpeq_epi8); // return a == b (int8) -SIMD_EMU_IWRAPPER_2(cmpeq_epi16); // return a == b (int16) -SIMD_EMU_IWRAPPER_2(cmpeq_epi32); // return a == b (int32) -SIMD_EMU_IWRAPPER_2(cmpeq_epi64); // return a == b (int64) -SIMD_EMU_IWRAPPER_2(cmpgt_epi8); // return a > b (int8) -SIMD_EMU_IWRAPPER_2(cmpgt_epi16); // return a > b (int16) -SIMD_EMU_IWRAPPER_2(cmpgt_epi32); // return a > b (int32) -SIMD_EMU_IWRAPPER_2(cmpgt_epi64); // return a > b (int64) -SIMD_EMU_IWRAPPER_2(cmplt_epi32); // return a < b (int32) +SIMD_EMU_IWRAPPER_2(cmpeq_epi8); // return a == b (int8) +SIMD_EMU_IWRAPPER_2(cmpeq_epi16); // return a == b (int16) +SIMD_EMU_IWRAPPER_2(cmpeq_epi32); // return a == b (int32) +SIMD_EMU_IWRAPPER_2(cmpeq_epi64); // return a == b (int64) +SIMD_EMU_IWRAPPER_2(cmpgt_epi8); // return a > b (int8) +SIMD_EMU_IWRAPPER_2(cmpgt_epi16); // return a > b (int16) +SIMD_EMU_IWRAPPER_2(cmpgt_epi32); // return a > b (int32) +SIMD_EMU_IWRAPPER_2(cmpgt_epi64); // return a > b (int64) +SIMD_EMU_IWRAPPER_2(cmplt_epi32); // return a < b (int32) -static SIMDINLINE bool SIMDCALL testz_ps(Float const &a, Float const &b) // return all_lanes_zero(a & b) ? 1 : 0 (float) +static SIMDINLINE bool SIMDCALL + testz_ps(Float const& a, Float const& b) // return all_lanes_zero(a & b) ? 1 : 0 (float) { - return 0 != _mm256_testz_ps(a, b); + return 0 != _mm256_testz_ps(a, b); } -static SIMDINLINE bool SIMDCALL testz_si(Integer const &a, Integer const &b) // return all_lanes_zero(a & b) ? 1 : 0 (int) +static SIMDINLINE bool SIMDCALL + testz_si(Integer const& a, Integer const& b) // return all_lanes_zero(a & b) ? 1 : 0 (int) { - return 0 != _mm256_testz_si256(a, b); + return 0 != _mm256_testz_si256(a, b); } //----------------------------------------------------------------------- // Blend / shuffle / permute operations //----------------------------------------------------------------------- -SIMD_WRAPPER_2I(blend_ps); // return ImmT ? b : a (float) -SIMD_IFWRAPPER_2I(blend_epi32, _mm256_blend_ps); // return ImmT ? b : a (int32) -SIMD_WRAPPER_3(blendv_ps); // return mask ? b : a (float) +SIMD_WRAPPER_2I(blend_ps); // return ImmT ? b : a (float) +SIMD_IFWRAPPER_2I(blend_epi32, _mm256_blend_ps); // return ImmT ? b : a (int32) +SIMD_WRAPPER_3(blendv_ps); // return mask ? b : a (float) -static SIMDINLINE Integer SIMDCALL blendv_epi32(Integer const &a, Integer const &b, Float const &mask) // return mask ? b : a (int) +static SIMDINLINE Integer SIMDCALL blendv_epi32(Integer const& a, + Integer const& b, + Float const& mask) // return mask ? b : a (int) { return castps_si(blendv_ps(castsi_ps(a), castsi_ps(b), mask)); } -static SIMDINLINE Integer SIMDCALL blendv_epi32(Integer const &a, Integer const &b, Integer const &mask) // return mask ? b : a (int) +static SIMDINLINE Integer SIMDCALL blendv_epi32(Integer const& a, + Integer const& b, + Integer const& mask) // return mask ? b : a (int) { return castps_si(blendv_ps(castsi_ps(a), castsi_ps(b), castsi_ps(mask))); } -static SIMDINLINE Float SIMDCALL broadcast_ss(float const *p) // return *p (all elements in vector get same value) +static SIMDINLINE Float SIMDCALL + broadcast_ss(float const* p) // return *p (all elements in vector get same value) { return _mm256_broadcast_ss(p); } -SIMD_EMU_IWRAPPER_2(packs_epi16); // See documentation for _mm256_packs_epi16 and _mm512_packs_epi16 -SIMD_EMU_IWRAPPER_2(packs_epi32); // See documentation for _mm256_packs_epi32 and _mm512_packs_epi32 -SIMD_EMU_IWRAPPER_2(packus_epi16); // See documentation for _mm256_packus_epi16 and _mm512_packus_epi16 -SIMD_EMU_IWRAPPER_2(packus_epi32); // See documentation for _mm256_packus_epi32 and _mm512_packus_epi32 +SIMD_EMU_IWRAPPER_2(packs_epi16); // See documentation for _mm256_packs_epi16 and _mm512_packs_epi16 +SIMD_EMU_IWRAPPER_2(packs_epi32); // See documentation for _mm256_packs_epi32 and _mm512_packs_epi32 +SIMD_EMU_IWRAPPER_2( + packus_epi16); // See documentation for _mm256_packus_epi16 and _mm512_packus_epi16 +SIMD_EMU_IWRAPPER_2( + packus_epi32); // See documentation for _mm256_packus_epi32 and _mm512_packus_epi32 -template<int ImmT> -static SIMDINLINE Float SIMDCALL permute_ps(Float const &a) +template <int ImmT> +static SIMDINLINE Float SIMDCALL permute_ps(Float const& a) { return _mm256_permute_ps(a, ImmT); } -static SIMDINLINE Integer SIMDCALL permute_epi32(Integer const &a, Integer const &swiz) // return a[swiz[i]] for each 32-bit lane i (int32) +static SIMDINLINE Integer SIMDCALL permute_epi32( + Integer const& a, Integer const& swiz) // return a[swiz[i]] for each 32-bit lane i (int32) { Integer result; // Ugly slow implementation - uint32_t const *pA = reinterpret_cast<uint32_t const*>(&a); - uint32_t const *pSwiz = reinterpret_cast<uint32_t const*>(&swiz); - uint32_t *pResult = reinterpret_cast<uint32_t *>(&result); + uint32_t const* pA = reinterpret_cast<uint32_t const*>(&a); + uint32_t const* pSwiz = reinterpret_cast<uint32_t const*>(&swiz); + uint32_t* pResult = reinterpret_cast<uint32_t*>(&result); for (uint32_t i = 0; i < SIMD_WIDTH; ++i) { @@ -502,14 +526,15 @@ static SIMDINLINE Integer SIMDCALL permute_epi32(Integer const &a, Integer const return result; } -static SIMDINLINE Float SIMDCALL permute_ps(Float const &a, Integer const &swiz) // return a[swiz[i]] for each 32-bit lane i (float) +static SIMDINLINE Float SIMDCALL + permute_ps(Float const& a, Integer const& swiz) // return a[swiz[i]] for each 32-bit lane i (float) { Float result; // Ugly slow implementation - float const *pA = reinterpret_cast<float const*>(&a); - uint32_t const *pSwiz = reinterpret_cast<uint32_t const*>(&swiz); - float *pResult = reinterpret_cast<float *>(&result); + float const* pA = reinterpret_cast<float const*>(&a); + uint32_t const* pSwiz = reinterpret_cast<uint32_t const*>(&swiz); + float* pResult = reinterpret_cast<float*>(&result); for (uint32_t i = 0; i < SIMD_WIDTH; ++i) { @@ -523,11 +548,10 @@ SIMD_WRAPPER_2I(permute2f128_ps); SIMD_DWRAPPER_2I(permute2f128_pd); SIMD_IWRAPPER_2I_(permute2f128_si, permute2f128_si256); - SIMD_EMU_IWRAPPER_1I(shuffle_epi32); -template<int ImmT> -static SIMDINLINE Integer SIMDCALL shuffle_epi64(Integer const &a, Integer const &b) +template <int ImmT> +static SIMDINLINE Integer SIMDCALL shuffle_epi64(Integer const& a, Integer const& b) { return castpd_si(shuffle_pd<ImmT>(castsi_pd(a), castsi_pd(b))); } @@ -550,83 +574,88 @@ SIMD_WRAPPER_2(unpacklo_ps); //----------------------------------------------------------------------- // Load / store operations //----------------------------------------------------------------------- -template<ScaleFactor ScaleT> -static SIMDINLINE Float SIMDCALL i32gather_ps(float const* p, Integer const &idx) // return *(float*)(((int8*)p) + (idx * ScaleT)) +template <ScaleFactor ScaleT> +static SIMDINLINE Float SIMDCALL + i32gather_ps(float const* p, Integer const& idx) // return *(float*)(((int8*)p) + (idx * ScaleT)) { - uint32_t *pOffsets = (uint32_t*)&idx; - Float vResult; - float* pResult = (float*)&vResult; + uint32_t* pOffsets = (uint32_t*)&idx; + Float vResult; + float* pResult = (float*)&vResult; for (uint32_t i = 0; i < SIMD_WIDTH; ++i) { uint32_t offset = pOffsets[i]; - offset = offset * static_cast<uint32_t>(ScaleT); - pResult[i] = *(float const*)(((uint8_t const*)p + offset)); + offset = offset * static_cast<uint32_t>(ScaleT); + pResult[i] = *(float const*)(((uint8_t const*)p + offset)); } return vResult; } -static SIMDINLINE Float SIMDCALL load1_ps(float const *p) // return *p (broadcast 1 value to all elements) +static SIMDINLINE Float SIMDCALL + load1_ps(float const* p) // return *p (broadcast 1 value to all elements) { return broadcast_ss(p); } -static SIMDINLINE Float SIMDCALL load_ps(float const *p) // return *p (loads SIMD width elements from memory) +static SIMDINLINE Float SIMDCALL + load_ps(float const* p) // return *p (loads SIMD width elements from memory) { return _mm256_load_ps(p); } -static SIMDINLINE Integer SIMDCALL load_si(Integer const *p) // return *p +static SIMDINLINE Integer SIMDCALL load_si(Integer const* p) // return *p { return _mm256_load_si256(&p->v); } -static SIMDINLINE Float SIMDCALL loadu_ps(float const *p) // return *p (same as load_ps but allows for unaligned mem) +static SIMDINLINE Float SIMDCALL + loadu_ps(float const* p) // return *p (same as load_ps but allows for unaligned mem) { return _mm256_loadu_ps(p); } -static SIMDINLINE Integer SIMDCALL loadu_si(Integer const *p) // return *p (same as load_si but allows for unaligned mem) +static SIMDINLINE Integer SIMDCALL + loadu_si(Integer const* p) // return *p (same as load_si but allows for unaligned mem) { return _mm256_lddqu_si256(&p->v); } // for each element: (mask & (1 << 31)) ? (i32gather_ps<ScaleT>(p, idx), mask = 0) : old -template<ScaleFactor ScaleT> -static SIMDINLINE Float SIMDCALL mask_i32gather_ps(Float const &old, float const* p, Integer const &idx, Float const &mask) -{ - uint32_t *pOffsets = (uint32_t*)&idx; - Float vResult = old; - float* pResult = (float*)&vResult; - DWORD index; - uint32_t umask = movemask_ps(mask); +template <ScaleFactor ScaleT> +static SIMDINLINE Float SIMDCALL + mask_i32gather_ps(Float const& old, float const* p, Integer const& idx, Float const& mask) +{ + uint32_t* pOffsets = (uint32_t*)&idx; + Float vResult = old; + float* pResult = (float*)&vResult; + DWORD index; + uint32_t umask = movemask_ps(mask); while (_BitScanForward(&index, umask)) { umask &= ~(1 << index); uint32_t offset = pOffsets[index]; - offset = offset * static_cast<uint32_t>(ScaleT); - pResult[index] = *(float const *)(((uint8_t const *)p + offset)); + offset = offset * static_cast<uint32_t>(ScaleT); + pResult[index] = *(float const*)(((uint8_t const*)p + offset)); } return vResult; } -static SIMDINLINE void SIMDCALL maskstore_ps(float *p, Integer const &mask, Float const &src) +static SIMDINLINE void SIMDCALL maskstore_ps(float* p, Integer const& mask, Float const& src) { _mm256_maskstore_ps(p, mask, src); } -static SIMDINLINE uint32_t SIMDCALL movemask_epi8(Integer const &a) +static SIMDINLINE uint32_t SIMDCALL movemask_epi8(Integer const& a) { - return SIMD128T::movemask_epi8(a.v4[0]) | - (SIMD128T::movemask_epi8(a.v4[1]) << 16); + return SIMD128T::movemask_epi8(a.v4[0]) | (SIMD128T::movemask_epi8(a.v4[1]) << 16); } -static SIMDINLINE uint32_t SIMDCALL movemask_pd(Double const &a) +static SIMDINLINE uint32_t SIMDCALL movemask_pd(Double const& a) { return static_cast<uint32_t>(_mm256_movemask_pd(a)); } -static SIMDINLINE uint32_t SIMDCALL movemask_ps(Float const &a) +static SIMDINLINE uint32_t SIMDCALL movemask_ps(Float const& a) { return static_cast<uint32_t>(_mm256_movemask_ps(a)); } @@ -641,32 +670,34 @@ static SIMDINLINE Integer SIMDCALL set1_epi8(char i) // return i (all elements a return _mm256_set1_epi8(i); } -static SIMDINLINE Float SIMDCALL set1_ps(float f) // return f (all elements are same value) +static SIMDINLINE Float SIMDCALL set1_ps(float f) // return f (all elements are same value) { return _mm256_set1_ps(f); } -static SIMDINLINE Float SIMDCALL setzero_ps() // return 0 (float) +static SIMDINLINE Float SIMDCALL setzero_ps() // return 0 (float) { return _mm256_setzero_ps(); } -static SIMDINLINE Integer SIMDCALL setzero_si() // return 0 (integer) +static SIMDINLINE Integer SIMDCALL setzero_si() // return 0 (integer) { return _mm256_setzero_si256(); } -static SIMDINLINE void SIMDCALL store_ps(float *p, Float const &a) // *p = a (stores all elements contiguously in memory) +static SIMDINLINE void SIMDCALL + store_ps(float* p, Float const& a) // *p = a (stores all elements contiguously in memory) { _mm256_store_ps(p, a); } -static SIMDINLINE void SIMDCALL store_si(Integer *p, Integer const &a) // *p = a +static SIMDINLINE void SIMDCALL store_si(Integer* p, Integer const& a) // *p = a { _mm256_store_si256(&p->v, a); } -static SIMDINLINE void SIMDCALL stream_ps(float *p, Float const &a) // *p = a (same as store_ps, but doesn't keep memory in cache) +static SIMDINLINE void SIMDCALL + stream_ps(float* p, Float const& a) // *p = a (same as store_ps, but doesn't keep memory in cache) { _mm256_stream_ps(p, a); } @@ -675,43 +706,43 @@ static SIMDINLINE void SIMDCALL stream_ps(float *p, Float const &a) // *p = a // Legacy interface (available only in SIMD256 width) //======================================================================= -static SIMDINLINE Float SIMDCALL broadcast_ps(SIMD128Impl::Float const *p) +static SIMDINLINE Float SIMDCALL broadcast_ps(SIMD128Impl::Float const* p) { return _mm256_broadcast_ps(&p->v); } -template<int ImmT> -static SIMDINLINE SIMD128Impl::Double SIMDCALL extractf128_pd(Double const &a) +template <int ImmT> +static SIMDINLINE SIMD128Impl::Double SIMDCALL extractf128_pd(Double const& a) { return _mm256_extractf128_pd(a, ImmT); } -template<int ImmT> -static SIMDINLINE SIMD128Impl::Float SIMDCALL extractf128_ps(Float const &a) +template <int ImmT> +static SIMDINLINE SIMD128Impl::Float SIMDCALL extractf128_ps(Float const& a) { return _mm256_extractf128_ps(a, ImmT); } -template<int ImmT> -static SIMDINLINE SIMD128Impl::Integer SIMDCALL extractf128_si(Integer const &a) +template <int ImmT> +static SIMDINLINE SIMD128Impl::Integer SIMDCALL extractf128_si(Integer const& a) { return _mm256_extractf128_si256(a, ImmT); } -template<int ImmT> -static SIMDINLINE Double SIMDCALL insertf128_pd(Double const &a, SIMD128Impl::Double const &b) +template <int ImmT> +static SIMDINLINE Double SIMDCALL insertf128_pd(Double const& a, SIMD128Impl::Double const& b) { return _mm256_insertf128_pd(a, b, ImmT); } -template<int ImmT> -static SIMDINLINE Float SIMDCALL insertf128_ps(Float const &a, SIMD128Impl::Float const &b) +template <int ImmT> +static SIMDINLINE Float SIMDCALL insertf128_ps(Float const& a, SIMD128Impl::Float const& b) { return _mm256_insertf128_ps(a, b, ImmT); } -template<int ImmT> -static SIMDINLINE Integer SIMDCALL insertf128_si(Integer const &a, SIMD128Impl::Integer const &b) +template <int ImmT> +static SIMDINLINE Integer SIMDCALL insertf128_si(Integer const& a, SIMD128Impl::Integer const& b) { return _mm256_insertf128_si256(a, b, ImmT); } @@ -727,33 +758,37 @@ static SIMDINLINE Integer SIMDCALL insertf128_si(Integer const &a, SIMD128Impl:: _mm256_set_m128i(_mm_loadu_si128(hiaddr), _mm_loadu_si128(loaddr)) #endif -static SIMDINLINE Integer SIMDCALL loadu2_si(SIMD128Impl::Integer const* phi, SIMD128Impl::Integer const* plo) +static SIMDINLINE Integer SIMDCALL loadu2_si(SIMD128Impl::Integer const* phi, + SIMD128Impl::Integer const* plo) { return _mm256_loadu2_m128i(&phi->v, &plo->v); } -static SIMDINLINE Integer SIMDCALL set_epi32(int i7, int i6, int i5, int i4, int i3, int i2, int i1, int i0) +static SIMDINLINE Integer SIMDCALL + set_epi32(int i7, int i6, int i5, int i4, int i3, int i2, int i1, int i0) { return _mm256_set_epi32(i7, i6, i5, i4, i3, i2, i1, i0); } -static SIMDINLINE Float SIMDCALL set_ps(float i7, float i6, float i5, float i4, float i3, float i2, float i1, float i0) +static SIMDINLINE Float SIMDCALL + set_ps(float i7, float i6, float i5, float i4, float i3, float i2, float i1, float i0) { return _mm256_set_ps(i7, i6, i5, i4, i3, i2, i1, i0); } -static SIMDINLINE void SIMDCALL storeu2_si(SIMD128Impl::Integer *phi, SIMD128Impl::Integer *plo, Integer const &src) +static SIMDINLINE void SIMDCALL storeu2_si(SIMD128Impl::Integer* phi, + SIMD128Impl::Integer* plo, + Integer const& src) { _mm256_storeu2_m128i(&phi->v, &plo->v, src); } static SIMDINLINE Float SIMDCALL vmask_ps(int32_t mask) { - Integer vec = set1_epi32(mask); - const Integer bit = set_epi32( - 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01); - vec = and_si(vec, bit); - vec = cmplt_epi32(setzero_si(), vec); + Integer vec = set1_epi32(mask); + const Integer bit = set_epi32(0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01); + vec = and_si(vec, bit); + vec = cmplt_epi32(setzero_si(), vec); return castsi_ps(vec); } diff --git a/src/gallium/drivers/swr/rasterizer/common/simdlib_256_avx2.inl b/src/gallium/drivers/swr/rasterizer/common/simdlib_256_avx2.inl index 96c24fff9da..59a61cf9263 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdlib_256_avx2.inl +++ b/src/gallium/drivers/swr/rasterizer/common/simdlib_256_avx2.inl @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2017 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2017 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #if !defined(__SIMD_LIB_AVX2_HPP__) #error Do not include this file directly, use "simdlib.hpp" instead. #endif @@ -32,62 +32,61 @@ // Mostly these are integer operations that are no longer emulated with SSE //============================================================================ -#define SIMD_IWRAPPER_1(op) \ - static SIMDINLINE Integer SIMDCALL op(Integer const &a) \ - {\ - return _mm256_##op(a);\ +#define SIMD_IWRAPPER_1(op) \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a) { return _mm256_##op(a); } + +#define SIMD_IWRAPPER_1L(op) \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a) \ + { \ + return _mm256_##op(_mm256_castsi256_si128(a)); \ } -#define SIMD_IWRAPPER_1L(op) \ - static SIMDINLINE Integer SIMDCALL op(Integer const &a) \ - {\ - return _mm256_##op(_mm256_castsi256_si128(a));\ - }\ - -#define SIMD_IWRAPPER_1I(op) \ - template<int ImmT> \ - static SIMDINLINE Integer SIMDCALL op(Integer const &a) \ - {\ - return _mm256_##op(a, ImmT);\ +#define SIMD_IWRAPPER_1I(op) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a) \ + { \ + return _mm256_##op(a, ImmT); \ } -#define SIMD_IWRAPPER_1I_(op, intrin) \ - template<int ImmT> \ - static SIMDINLINE Integer SIMDCALL op(Integer const &a) \ - {\ - return _mm256_##intrin(a, ImmT);\ +#define SIMD_IWRAPPER_1I_(op, intrin) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a) \ + { \ + return _mm256_##intrin(a, ImmT); \ } -#define SIMD_IWRAPPER_2_(op, intrin) \ - static SIMDINLINE Integer SIMDCALL op(Integer const &a, Integer const &b) \ - {\ - return _mm256_##intrin(a, b);\ +#define SIMD_IWRAPPER_2_(op, intrin) \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a, Integer const& b) \ + { \ + return _mm256_##intrin(a, b); \ } -#define SIMD_IWRAPPER_2(op) \ - static SIMDINLINE Integer SIMDCALL op(Integer const &a, Integer const &b) \ - {\ - return _mm256_##op(a, b);\ +#define SIMD_IWRAPPER_2(op) \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a, Integer const& b) \ + { \ + return _mm256_##op(a, b); \ } -#define SIMD_IWRAPPER_2I(op) \ - template<int ImmT> \ - static SIMDINLINE Integer SIMDCALL op(Integer const &a, Integer const &b) \ - {\ - return _mm256_##op(a, b, ImmT);\ +#define SIMD_IWRAPPER_2I(op) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a, Integer const& b) \ + { \ + return _mm256_##op(a, b, ImmT); \ } -#define SIMD_IWRAPPER_2I(op) \ - template<int ImmT>\ - static SIMDINLINE Integer SIMDCALL op(Integer const &a, Integer const &b) \ - {\ - return _mm256_##op(a, b, ImmT);\ +#define SIMD_IWRAPPER_2I(op) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a, Integer const& b) \ + { \ + return _mm256_##op(a, b, ImmT); \ } //----------------------------------------------------------------------- // Floating point arithmetic operations //----------------------------------------------------------------------- -static SIMDINLINE Float SIMDCALL fmadd_ps(Float const &a, Float const &b, Float const &c) // return (a * b) + c +static SIMDINLINE Float SIMDCALL fmadd_ps(Float const& a, + Float const& b, + Float const& c) // return (a * b) + c { return _mm256_fmadd_ps(a, b, c); } @@ -98,7 +97,7 @@ static SIMDINLINE Float SIMDCALL fmadd_ps(Float const &a, Float const &b, Float SIMD_IWRAPPER_1(abs_epi32); // return absolute_value(a) (int32) SIMD_IWRAPPER_2(add_epi32); // return a + b (int32) SIMD_IWRAPPER_2(add_epi8); // return a + b (int8) -SIMD_IWRAPPER_2(adds_epu8); // return ((a + b) > 0xff) ? 0xff : (a + b) (uint8) +SIMD_IWRAPPER_2(adds_epu8); // return ((a + b) > 0xff) ? 0xff : (a + b) (uint8) SIMD_IWRAPPER_2(max_epi32); // return (a > b) ? a : b (int32) SIMD_IWRAPPER_2(max_epu32); // return (a > b) ? a : b (uint32) SIMD_IWRAPPER_2(min_epi32); // return (a < b) ? a : b (int32) @@ -117,51 +116,50 @@ SIMD_IWRAPPER_2(subs_epu8); // return (b > a) ? 0 : (a - b) (uint8) //----------------------------------------------------------------------- // Logical operations //----------------------------------------------------------------------- -SIMD_IWRAPPER_2_(and_si, and_si256); // return a & b (int) -SIMD_IWRAPPER_2_(andnot_si, andnot_si256); // return (~a) & b (int) -SIMD_IWRAPPER_2_(or_si, or_si256); // return a | b (int) -SIMD_IWRAPPER_2_(xor_si, xor_si256); // return a ^ b (int) - +SIMD_IWRAPPER_2_(and_si, and_si256); // return a & b (int) +SIMD_IWRAPPER_2_(andnot_si, andnot_si256); // return (~a) & b (int) +SIMD_IWRAPPER_2_(or_si, or_si256); // return a | b (int) +SIMD_IWRAPPER_2_(xor_si, xor_si256); // return a ^ b (int) //----------------------------------------------------------------------- // Shift operations //----------------------------------------------------------------------- -SIMD_IWRAPPER_1I(slli_epi32); // return a << ImmT -SIMD_IWRAPPER_2(sllv_epi32); // return a << b (uint32) -SIMD_IWRAPPER_1I(srai_epi32); // return a >> ImmT (int32) -SIMD_IWRAPPER_1I(srli_epi32); // return a >> ImmT (uint32) -SIMD_IWRAPPER_2(srlv_epi32); // return a >> b (uint32) -SIMD_IWRAPPER_1I_(srli_si, srli_si256); // return a >> (ImmT*8) (uint) +SIMD_IWRAPPER_1I(slli_epi32); // return a << ImmT +SIMD_IWRAPPER_2(sllv_epi32); // return a << b (uint32) +SIMD_IWRAPPER_1I(srai_epi32); // return a >> ImmT (int32) +SIMD_IWRAPPER_1I(srli_epi32); // return a >> ImmT (uint32) +SIMD_IWRAPPER_2(srlv_epi32); // return a >> b (uint32) +SIMD_IWRAPPER_1I_(srli_si, srli_si256); // return a >> (ImmT*8) (uint) -template<int ImmT> // same as srli_si, but with Float cast to int -static SIMDINLINE Float SIMDCALL srlisi_ps(Float const &a) +template <int ImmT> // same as srli_si, but with Float cast to int +static SIMDINLINE Float SIMDCALL srlisi_ps(Float const& a) { return castsi_ps(srli_si<ImmT>(castps_si(a))); } - //----------------------------------------------------------------------- // Conversion operations //----------------------------------------------------------------------- -SIMD_IWRAPPER_1L(cvtepu8_epi16); // return (int16)a (uint8 --> int16) -SIMD_IWRAPPER_1L(cvtepu8_epi32); // return (int32)a (uint8 --> int32) -SIMD_IWRAPPER_1L(cvtepu16_epi32); // return (int32)a (uint16 --> int32) -SIMD_IWRAPPER_1L(cvtepu16_epi64); // return (int64)a (uint16 --> int64) -SIMD_IWRAPPER_1L(cvtepu32_epi64); // return (int64)a (uint32 --> int64) +SIMD_IWRAPPER_1L(cvtepu8_epi16); // return (int16)a (uint8 --> int16) +SIMD_IWRAPPER_1L(cvtepu8_epi32); // return (int32)a (uint8 --> int32) +SIMD_IWRAPPER_1L(cvtepu16_epi32); // return (int32)a (uint16 --> int32) +SIMD_IWRAPPER_1L(cvtepu16_epi64); // return (int64)a (uint16 --> int64) +SIMD_IWRAPPER_1L(cvtepu32_epi64); // return (int64)a (uint32 --> int64) //----------------------------------------------------------------------- // Comparison operations //----------------------------------------------------------------------- -SIMD_IWRAPPER_2(cmpeq_epi8); // return a == b (int8) -SIMD_IWRAPPER_2(cmpeq_epi16); // return a == b (int16) -SIMD_IWRAPPER_2(cmpeq_epi32); // return a == b (int32) -SIMD_IWRAPPER_2(cmpeq_epi64); // return a == b (int64) -SIMD_IWRAPPER_2(cmpgt_epi8); // return a > b (int8) -SIMD_IWRAPPER_2(cmpgt_epi16); // return a > b (int16) -SIMD_IWRAPPER_2(cmpgt_epi32); // return a > b (int32) -SIMD_IWRAPPER_2(cmpgt_epi64); // return a > b (int64) - -static SIMDINLINE Integer SIMDCALL cmplt_epi32(Integer const &a, Integer const &b) // return a < b (int32) +SIMD_IWRAPPER_2(cmpeq_epi8); // return a == b (int8) +SIMD_IWRAPPER_2(cmpeq_epi16); // return a == b (int16) +SIMD_IWRAPPER_2(cmpeq_epi32); // return a == b (int32) +SIMD_IWRAPPER_2(cmpeq_epi64); // return a == b (int64) +SIMD_IWRAPPER_2(cmpgt_epi8); // return a > b (int8) +SIMD_IWRAPPER_2(cmpgt_epi16); // return a > b (int16) +SIMD_IWRAPPER_2(cmpgt_epi32); // return a > b (int32) +SIMD_IWRAPPER_2(cmpgt_epi64); // return a > b (int64) + +static SIMDINLINE Integer SIMDCALL cmplt_epi32(Integer const& a, + Integer const& b) // return a < b (int32) { return cmpgt_epi32(b, a); } @@ -169,28 +167,29 @@ static SIMDINLINE Integer SIMDCALL cmplt_epi32(Integer const &a, Integer const & //----------------------------------------------------------------------- // Blend / shuffle / permute operations //----------------------------------------------------------------------- -SIMD_IWRAPPER_2I(blend_epi32); // return ImmT ? b : a (int32) -SIMD_IWRAPPER_2(packs_epi16); // See documentation for _mm256_packs_epi16 and _mm512_packs_epi16 -SIMD_IWRAPPER_2(packs_epi32); // See documentation for _mm256_packs_epi32 and _mm512_packs_epi32 -SIMD_IWRAPPER_2(packus_epi16); // See documentation for _mm256_packus_epi16 and _mm512_packus_epi16 -SIMD_IWRAPPER_2(packus_epi32); // See documentation for _mm256_packus_epi32 and _mm512_packus_epi32 +SIMD_IWRAPPER_2I(blend_epi32); // return ImmT ? b : a (int32) +SIMD_IWRAPPER_2(packs_epi16); // See documentation for _mm256_packs_epi16 and _mm512_packs_epi16 +SIMD_IWRAPPER_2(packs_epi32); // See documentation for _mm256_packs_epi32 and _mm512_packs_epi32 +SIMD_IWRAPPER_2(packus_epi16); // See documentation for _mm256_packus_epi16 and _mm512_packus_epi16 +SIMD_IWRAPPER_2(packus_epi32); // See documentation for _mm256_packus_epi32 and _mm512_packus_epi32 -template<int ImmT> -static SIMDINLINE Float SIMDCALL permute_ps(Float const &a) +template <int ImmT> +static SIMDINLINE Float SIMDCALL permute_ps(Float const& a) { return _mm256_permute_ps(a, ImmT); } SIMD_IWRAPPER_2_(permute_epi32, permutevar8x32_epi32); -static SIMDINLINE Float SIMDCALL permute_ps(Float const &a, Integer const &swiz) // return a[swiz[i]] for each 32-bit lane i (float) +static SIMDINLINE Float SIMDCALL + permute_ps(Float const& a, Integer const& swiz) // return a[swiz[i]] for each 32-bit lane i (float) { return _mm256_permutevar8x32_ps(a, swiz); } SIMD_IWRAPPER_1I(shuffle_epi32); -template<int ImmT> -static SIMDINLINE Integer SIMDCALL shuffle_epi64(Integer const &a, Integer const &b) +template <int ImmT> +static SIMDINLINE Integer SIMDCALL shuffle_epi64(Integer const& a, Integer const& b) { return castpd_si(shuffle_pd<ImmT>(castsi_pd(a), castsi_pd(b))); } @@ -207,22 +206,24 @@ SIMD_IWRAPPER_2(unpacklo_epi8); //----------------------------------------------------------------------- // Load / store operations //----------------------------------------------------------------------- -template<ScaleFactor ScaleT> -static SIMDINLINE Float SIMDCALL i32gather_ps(float const* p, Integer const &idx) // return *(float*)(((int8*)p) + (idx * ScaleT)) +template <ScaleFactor ScaleT> +static SIMDINLINE Float SIMDCALL + i32gather_ps(float const* p, Integer const& idx) // return *(float*)(((int8*)p) + (idx * ScaleT)) { return _mm256_i32gather_ps(p, idx, static_cast<int>(ScaleT)); } // for each element: (mask & (1 << 31)) ? (i32gather_ps<ScaleT>(p, idx), mask = 0) : old -template<ScaleFactor ScaleT> -static SIMDINLINE Float SIMDCALL mask_i32gather_ps(Float const &old, float const* p, Integer const &idx, Float const &mask) +template <ScaleFactor ScaleT> +static SIMDINLINE Float SIMDCALL + mask_i32gather_ps(Float const& old, float const* p, Integer const& idx, Float const& mask) { - // g++ in debug mode needs the explicit .v suffix instead of relying on operator __m256() - // Only for this intrinsic - not sure why. :( + // g++ in debug mode needs the explicit .v suffix instead of relying on operator __m256() + // Only for this intrinsic - not sure why. :( return _mm256_mask_i32gather_ps(old.v, p, idx.v, mask.v, static_cast<int>(ScaleT)); } -static SIMDINLINE uint32_t SIMDCALL movemask_epi8(Integer const &a) +static SIMDINLINE uint32_t SIMDCALL movemask_epi8(Integer const& a) { return static_cast<uint32_t>(_mm256_movemask_epi8(a)); } diff --git a/src/gallium/drivers/swr/rasterizer/common/simdlib_256_avx512.inl b/src/gallium/drivers/swr/rasterizer/common/simdlib_256_avx512.inl index 3fcfd250f91..790609861e5 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdlib_256_avx512.inl +++ b/src/gallium/drivers/swr/rasterizer/common/simdlib_256_avx512.inl @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2017 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2017 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #if !defined(__SIMD_LIB_AVX512_HPP__) #error Do not include this file directly, use "simdlib.hpp" instead. #endif @@ -34,120 +34,138 @@ //============================================================================ private: - static SIMDINLINE __m512 __conv(Float r) { return _mm512_castps256_ps512(r.v); } - static SIMDINLINE __m512d __conv(Double r) { return _mm512_castpd256_pd512(r.v); } - static SIMDINLINE __m512i __conv(Integer r) { return _mm512_castsi256_si512(r.v); } - static SIMDINLINE Float __conv(__m512 r) { return _mm512_castps512_ps256(r); } - static SIMDINLINE Double __conv(__m512d r) { return _mm512_castpd512_pd256(r); } - static SIMDINLINE Integer __conv(__m512i r) { return _mm512_castsi512_si256(r); } -public: +static SIMDINLINE __m512 __conv(Float r) +{ + return _mm512_castps256_ps512(r.v); +} +static SIMDINLINE __m512d __conv(Double r) +{ + return _mm512_castpd256_pd512(r.v); +} +static SIMDINLINE __m512i __conv(Integer r) +{ + return _mm512_castsi256_si512(r.v); +} +static SIMDINLINE Float __conv(__m512 r) +{ + return _mm512_castps512_ps256(r); +} +static SIMDINLINE Double __conv(__m512d r) +{ + return _mm512_castpd512_pd256(r); +} +static SIMDINLINE Integer __conv(__m512i r) +{ + return _mm512_castsi512_si256(r); +} -#define SIMD_WRAPPER_1_(op, intrin, mask) \ - static SIMDINLINE Float SIMDCALL op(Float a) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a)));\ +public: +#define SIMD_WRAPPER_1_(op, intrin, mask) \ + static SIMDINLINE Float SIMDCALL op(Float a) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a))); \ } -#define SIMD_WRAPPER_1(op) SIMD_WRAPPER_1_(op, op, __mmask16(0xff)) +#define SIMD_WRAPPER_1(op) SIMD_WRAPPER_1_(op, op, __mmask16(0xff)) -#define SIMD_WRAPPER_1I_(op, intrin, mask) \ - template<int ImmT> \ - static SIMDINLINE Float SIMDCALL op(Float a) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a), ImmT));\ +#define SIMD_WRAPPER_1I_(op, intrin, mask) \ + template <int ImmT> \ + static SIMDINLINE Float SIMDCALL op(Float a) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a), ImmT)); \ } -#define SIMD_WRAPPER_1I(op) SIMD_WRAPPER_1I_(op, op, __mmask16(0xff)) +#define SIMD_WRAPPER_1I(op) SIMD_WRAPPER_1I_(op, op, __mmask16(0xff)) -#define SIMD_WRAPPER_2_(op, intrin, mask) \ - static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b)));\ +#define SIMD_WRAPPER_2_(op, intrin, mask) \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b))); \ } -#define SIMD_WRAPPER_2(op) SIMD_WRAPPER_2_(op, op, __mmask16(0xff)) +#define SIMD_WRAPPER_2(op) SIMD_WRAPPER_2_(op, op, __mmask16(0xff)) -#define SIMD_WRAPPER_2I(op) \ - template<int ImmT>\ - static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ - {\ - return __conv(_mm512_maskz_##op(0xff, __conv(a), __conv(b), ImmT));\ +#define SIMD_WRAPPER_2I(op) \ + template <int ImmT> \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ + { \ + return __conv(_mm512_maskz_##op(0xff, __conv(a), __conv(b), ImmT)); \ } -#define SIMD_WRAPPER_3_(op, intrin, mask) \ - static SIMDINLINE Float SIMDCALL op(Float a, Float b, Float c) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b), __conv(c)));\ +#define SIMD_WRAPPER_3_(op, intrin, mask) \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b, Float c) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b), __conv(c))); \ } -#define SIMD_WRAPPER_3(op) SIMD_WRAPPER_3_(op, op, __mmask16(0xff)) +#define SIMD_WRAPPER_3(op) SIMD_WRAPPER_3_(op, op, __mmask16(0xff)) -#define SIMD_DWRAPPER_2I(op) \ - template<int ImmT>\ - static SIMDINLINE Double SIMDCALL op(Double a, Double b) \ - {\ - return __conv(_mm512_maskz_##op(0xf, __conv(a), __conv(b), ImmT));\ +#define SIMD_DWRAPPER_2I(op) \ + template <int ImmT> \ + static SIMDINLINE Double SIMDCALL op(Double a, Double b) \ + { \ + return __conv(_mm512_maskz_##op(0xf, __conv(a), __conv(b), ImmT)); \ } -#define SIMD_IWRAPPER_1_(op, intrin, mask) \ - static SIMDINLINE Integer SIMDCALL op(Integer a) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a)));\ +#define SIMD_IWRAPPER_1_(op, intrin, mask) \ + static SIMDINLINE Integer SIMDCALL op(Integer a) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a))); \ } -#define SIMD_IWRAPPER_1_32(op) SIMD_IWRAPPER_1_(op, op, __mmask16(0xff)) +#define SIMD_IWRAPPER_1_32(op) SIMD_IWRAPPER_1_(op, op, __mmask16(0xff)) -#define SIMD_IWRAPPER_1I_(op, intrin, mask) \ - template<int ImmT> \ - static SIMDINLINE Integer SIMDCALL op(Integer a) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a), ImmT));\ +#define SIMD_IWRAPPER_1I_(op, intrin, mask) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer a) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a), ImmT)); \ } -#define SIMD_IWRAPPER_1I_32(op) SIMD_IWRAPPER_1I_(op, op, __mmask16(0xff)) +#define SIMD_IWRAPPER_1I_32(op) SIMD_IWRAPPER_1I_(op, op, __mmask16(0xff)) -#define SIMD_IWRAPPER_2_(op, intrin, mask) \ - static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b)));\ +#define SIMD_IWRAPPER_2_(op, intrin, mask) \ + static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b))); \ } -#define SIMD_IWRAPPER_2_32(op) SIMD_IWRAPPER_2_(op, op, __mmask16(0xff)) +#define SIMD_IWRAPPER_2_32(op) SIMD_IWRAPPER_2_(op, op, __mmask16(0xff)) -#define SIMD_IWRAPPER_2I(op) \ - template<int ImmT>\ - static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ - {\ - return __conv(_mm512_maskz_##op(0xff, __conv(a), __conv(b), ImmT));\ +#define SIMD_IWRAPPER_2I(op) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ + { \ + return __conv(_mm512_maskz_##op(0xff, __conv(a), __conv(b), ImmT)); \ } //----------------------------------------------------------------------- // Single precision floating point arithmetic operations //----------------------------------------------------------------------- -SIMD_WRAPPER_2(add_ps); // return a + b -SIMD_WRAPPER_2(div_ps); // return a / b -SIMD_WRAPPER_3(fmadd_ps); // return (a * b) + c -SIMD_WRAPPER_3(fmsub_ps); // return (a * b) - c -SIMD_WRAPPER_2(max_ps); // return (a > b) ? a : b -SIMD_WRAPPER_2(min_ps); // return (a < b) ? a : b -SIMD_WRAPPER_2(mul_ps); // return a * b +SIMD_WRAPPER_2(add_ps); // return a + b +SIMD_WRAPPER_2(div_ps); // return a / b +SIMD_WRAPPER_3(fmadd_ps); // return (a * b) + c +SIMD_WRAPPER_3(fmsub_ps); // return (a * b) - c +SIMD_WRAPPER_2(max_ps); // return (a > b) ? a : b +SIMD_WRAPPER_2(min_ps); // return (a < b) ? a : b +SIMD_WRAPPER_2(mul_ps); // return a * b SIMD_WRAPPER_1_(rcp_ps, rcp14_ps, __mmask16(0xff)); // return 1.0f / a -SIMD_WRAPPER_1_(rsqrt_ps, rsqrt14_ps, __mmask16(0xff)); // return 1.0f / sqrt(a) -SIMD_WRAPPER_2(sub_ps); // return a - b +SIMD_WRAPPER_1_(rsqrt_ps, rsqrt14_ps, __mmask16(0xff)); // return 1.0f / sqrt(a) +SIMD_WRAPPER_2(sub_ps); // return a - b //----------------------------------------------------------------------- // Integer (various width) arithmetic operations //----------------------------------------------------------------------- -SIMD_IWRAPPER_1_32(abs_epi32); // return absolute_value(a) (int32) -SIMD_IWRAPPER_2_32(add_epi32); // return a + b (int32) -SIMD_IWRAPPER_2_32(max_epi32); // return (a > b) ? a : b (int32) -SIMD_IWRAPPER_2_32(max_epu32); // return (a > b) ? a : b (uint32) -SIMD_IWRAPPER_2_32(min_epi32); // return (a < b) ? a : b (int32) -SIMD_IWRAPPER_2_32(min_epu32); // return (a < b) ? a : b (uint32) -SIMD_IWRAPPER_2_32(mul_epi32); // return a * b (int32) +SIMD_IWRAPPER_1_32(abs_epi32); // return absolute_value(a) (int32) +SIMD_IWRAPPER_2_32(add_epi32); // return a + b (int32) +SIMD_IWRAPPER_2_32(max_epi32); // return (a > b) ? a : b (int32) +SIMD_IWRAPPER_2_32(max_epu32); // return (a > b) ? a : b (uint32) +SIMD_IWRAPPER_2_32(min_epi32); // return (a < b) ? a : b (int32) +SIMD_IWRAPPER_2_32(min_epu32); // return (a < b) ? a : b (uint32) +SIMD_IWRAPPER_2_32(mul_epi32); // return a * b (int32) // SIMD_IWRAPPER_2_8(add_epi8); // return a + b (int8) -// SIMD_IWRAPPER_2_8(adds_epu8); // return ((a + b) > 0xff) ? 0xff : (a + b) (uint8) +// SIMD_IWRAPPER_2_8(adds_epu8); // return ((a + b) > 0xff) ? 0xff : (a + b) (uint8) // return (a * b) & 0xFFFFFFFF // // Multiply the packed 32-bit integers in a and b, producing intermediate 64-bit integers, // and store the low 32 bits of the intermediate integers in dst. SIMD_IWRAPPER_2_32(mullo_epi32); -SIMD_IWRAPPER_2_32(sub_epi32); // return a - b (int32) +SIMD_IWRAPPER_2_32(sub_epi32); // return a - b (int32) // SIMD_IWRAPPER_2_64(sub_epi64); // return a - b (int64) // SIMD_IWRAPPER_2_8(subs_epu8); // return (b > a) ? 0 : (a - b) (uint8) @@ -155,23 +173,22 @@ SIMD_IWRAPPER_2_32(sub_epi32); // return a - b (int32) //----------------------------------------------------------------------- // Logical operations //----------------------------------------------------------------------- -SIMD_IWRAPPER_2_(and_si, and_epi32, __mmask16(0xff)); // return a & b (int) +SIMD_IWRAPPER_2_(and_si, and_epi32, __mmask16(0xff)); // return a & b (int) SIMD_IWRAPPER_2_(andnot_si, andnot_epi32, __mmask16(0xff)); // return (~a) & b (int) -SIMD_IWRAPPER_2_(or_si, or_epi32, __mmask16(0xff)); // return a | b (int) -SIMD_IWRAPPER_2_(xor_si, xor_epi32, __mmask16(0xff)); // return a ^ b (int) - +SIMD_IWRAPPER_2_(or_si, or_epi32, __mmask16(0xff)); // return a | b (int) +SIMD_IWRAPPER_2_(xor_si, xor_epi32, __mmask16(0xff)); // return a ^ b (int) //----------------------------------------------------------------------- // Shift operations //----------------------------------------------------------------------- -SIMD_IWRAPPER_1I_32(slli_epi32); // return a << ImmT -SIMD_IWRAPPER_2_32(sllv_epi32); // return a << b (uint32) -SIMD_IWRAPPER_1I_32(srai_epi32); // return a >> ImmT (int32) -SIMD_IWRAPPER_1I_32(srli_epi32); // return a >> ImmT (uint32) -SIMD_IWRAPPER_2_32(srlv_epi32); // return a >> b (uint32) +SIMD_IWRAPPER_1I_32(slli_epi32); // return a << ImmT +SIMD_IWRAPPER_2_32(sllv_epi32); // return a << b (uint32) +SIMD_IWRAPPER_1I_32(srai_epi32); // return a >> ImmT (int32) +SIMD_IWRAPPER_1I_32(srli_epi32); // return a >> ImmT (uint32) +SIMD_IWRAPPER_2_32(srlv_epi32); // return a >> b (uint32) // use AVX2 version -//SIMD_IWRAPPER_1I_(srli_si, srli_si256); // return a >> (ImmT*8) (uint) +// SIMD_IWRAPPER_1I_(srli_si, srli_si256); // return a >> (ImmT*8) (uint) //----------------------------------------------------------------------- // Conversion operations (Use AVX2 versions) @@ -185,16 +202,16 @@ SIMD_IWRAPPER_2_32(srlv_epi32); // return a >> b (uint32) //----------------------------------------------------------------------- // Comparison operations (Use AVX2 versions //----------------------------------------------------------------------- -//SIMD_IWRAPPER_2_CMP(cmpeq_epi8); // return a == b (int8) -//SIMD_IWRAPPER_2_CMP(cmpeq_epi16); // return a == b (int16) -//SIMD_IWRAPPER_2_CMP(cmpeq_epi32); // return a == b (int32) -//SIMD_IWRAPPER_2_CMP(cmpeq_epi64); // return a == b (int64) -//SIMD_IWRAPPER_2_CMP(cmpgt_epi8,); // return a > b (int8) -//SIMD_IWRAPPER_2_CMP(cmpgt_epi16); // return a > b (int16) -//SIMD_IWRAPPER_2_CMP(cmpgt_epi32); // return a > b (int32) -//SIMD_IWRAPPER_2_CMP(cmpgt_epi64); // return a > b (int64) +// SIMD_IWRAPPER_2_CMP(cmpeq_epi8); // return a == b (int8) +// SIMD_IWRAPPER_2_CMP(cmpeq_epi16); // return a == b (int16) +// SIMD_IWRAPPER_2_CMP(cmpeq_epi32); // return a == b (int32) +// SIMD_IWRAPPER_2_CMP(cmpeq_epi64); // return a == b (int64) +// SIMD_IWRAPPER_2_CMP(cmpgt_epi8,); // return a > b (int8) +// SIMD_IWRAPPER_2_CMP(cmpgt_epi16); // return a > b (int16) +// SIMD_IWRAPPER_2_CMP(cmpgt_epi32); // return a > b (int32) +// SIMD_IWRAPPER_2_CMP(cmpgt_epi64); // return a > b (int64) // -//static SIMDINLINE Integer SIMDCALL cmplt_epi32(Integer a, Integer b) // return a < b (int32) +// static SIMDINLINE Integer SIMDCALL cmplt_epi32(Integer a, Integer b) // return a < b (int32) //{ // return cmpgt_epi32(b, a); //} @@ -202,25 +219,28 @@ SIMD_IWRAPPER_2_32(srlv_epi32); // return a >> b (uint32) //----------------------------------------------------------------------- // Blend / shuffle / permute operations //----------------------------------------------------------------------- -// SIMD_IWRAPPER_2_8(packs_epi16); // int16 --> int8 See documentation for _mm256_packs_epi16 and _mm512_packs_epi16 -// SIMD_IWRAPPER_2_16(packs_epi32); // int32 --> int16 See documentation for _mm256_packs_epi32 and _mm512_packs_epi32 -// SIMD_IWRAPPER_2_8(packus_epi16); // uint16 --> uint8 See documentation for _mm256_packus_epi16 and _mm512_packus_epi16 -// SIMD_IWRAPPER_2_16(packus_epi32); // uint32 --> uint16 See documentation for _mm256_packus_epi32 and _mm512_packus_epi32 +// SIMD_IWRAPPER_2_8(packs_epi16); // int16 --> int8 See documentation for _mm256_packs_epi16 +// and _mm512_packs_epi16 SIMD_IWRAPPER_2_16(packs_epi32); // int32 --> int16 See documentation +// for _mm256_packs_epi32 and _mm512_packs_epi32 SIMD_IWRAPPER_2_8(packus_epi16); // uint16 --> +// uint8 See documentation for _mm256_packus_epi16 and _mm512_packus_epi16 +// SIMD_IWRAPPER_2_16(packus_epi32); // uint32 --> uint16 See documentation for +// _mm256_packus_epi32 and _mm512_packus_epi32 // SIMD_IWRAPPER_2_(permute_epi32, permutevar8x32_epi32); -//static SIMDINLINE Float SIMDCALL permute_ps(Float a, Integer swiz) // return a[swiz[i]] for each 32-bit lane i (float) +// static SIMDINLINE Float SIMDCALL permute_ps(Float a, Integer swiz) // return a[swiz[i]] for +// each 32-bit lane i (float) //{ // return _mm256_permutevar8x32_ps(a, swiz); //} SIMD_IWRAPPER_1I_32(shuffle_epi32); -//template<int ImmT> -//static SIMDINLINE Integer SIMDCALL shuffle_epi64(Integer a, Integer b) +// template<int ImmT> +// static SIMDINLINE Integer SIMDCALL shuffle_epi64(Integer a, Integer b) //{ // return castpd_si(shuffle_pd<ImmT>(castsi_pd(a), castsi_pd(b))); //} -//SIMD_IWRAPPER_2(shuffle_epi8); +// SIMD_IWRAPPER_2(shuffle_epi8); SIMD_IWRAPPER_2_32(unpackhi_epi32); SIMD_IWRAPPER_2_32(unpacklo_epi32); @@ -234,50 +254,47 @@ SIMD_IWRAPPER_2_32(unpacklo_epi32); //----------------------------------------------------------------------- // Load / store operations //----------------------------------------------------------------------- -static SIMDINLINE Float SIMDCALL load_ps(float const *p) // return *p (loads SIMD width elements from memory) +static SIMDINLINE Float SIMDCALL + load_ps(float const* p) // return *p (loads SIMD width elements from memory) { return __conv(_mm512_maskz_loadu_ps(__mmask16(0xff), p)); } -static SIMDINLINE Integer SIMDCALL load_si(Integer const *p) // return *p +static SIMDINLINE Integer SIMDCALL load_si(Integer const* p) // return *p { return __conv(_mm512_maskz_loadu_epi32(__mmask16(0xff), p)); } -static SIMDINLINE Float SIMDCALL loadu_ps(float const *p) // return *p (same as load_ps but allows for unaligned mem) +static SIMDINLINE Float SIMDCALL + loadu_ps(float const* p) // return *p (same as load_ps but allows for unaligned mem) { return __conv(_mm512_maskz_loadu_ps(__mmask16(0xff), p)); } -static SIMDINLINE Integer SIMDCALL loadu_si(Integer const *p) // return *p (same as load_si but allows for unaligned mem) +static SIMDINLINE Integer SIMDCALL + loadu_si(Integer const* p) // return *p (same as load_si but allows for unaligned mem) { return __conv(_mm512_maskz_loadu_epi32(__mmask16(0xff), p)); } -template<ScaleFactor ScaleT> -static SIMDINLINE Float SIMDCALL i32gather_ps(float const* p, Integer idx) // return *(float*)(((int8*)p) + (idx * ScaleT)) +template <ScaleFactor ScaleT> +static SIMDINLINE Float SIMDCALL + i32gather_ps(float const* p, Integer idx) // return *(float*)(((int8*)p) + (idx * ScaleT)) { return __conv(_mm512_mask_i32gather_ps( - _mm512_setzero_ps(), - __mmask16(0xff), - __conv(idx), - p, - static_cast<int>(ScaleT))); + _mm512_setzero_ps(), __mmask16(0xff), __conv(idx), p, static_cast<int>(ScaleT))); } // for each element: (mask & (1 << 31)) ? (i32gather_ps<ScaleT>(p, idx), mask = 0) : old -template<ScaleFactor ScaleT> -static SIMDINLINE Float SIMDCALL mask_i32gather_ps(Float old, float const* p, Integer idx, Float mask) +template <ScaleFactor ScaleT> +static SIMDINLINE Float SIMDCALL + mask_i32gather_ps(Float old, float const* p, Integer idx, Float mask) { __mmask16 m = 0xff; - m = _mm512_mask_test_epi32_mask(m, _mm512_castps_si512(__conv(mask)), - _mm512_set1_epi32(0x80000000)); - return __conv(_mm512_mask_i32gather_ps( - __conv(old), - m, - __conv(idx), - p, - static_cast<int>(ScaleT))); + m = _mm512_mask_test_epi32_mask( + m, _mm512_castps_si512(__conv(mask)), _mm512_set1_epi32(0x80000000)); + return __conv( + _mm512_mask_i32gather_ps(__conv(old), m, __conv(idx), p, static_cast<int>(ScaleT))); } // static SIMDINLINE uint32_t SIMDCALL movemask_epi8(Integer a) @@ -287,19 +304,20 @@ static SIMDINLINE Float SIMDCALL mask_i32gather_ps(Float old, float const* p, In // _mm512_mask_test_epi8_mask(m, __conv(a), _mm512_set1_epi8(0x80))); // } -static SIMDINLINE void SIMDCALL maskstore_ps(float *p, Integer mask, Float src) +static SIMDINLINE void SIMDCALL maskstore_ps(float* p, Integer mask, Float src) { __mmask16 m = 0xff; - m = _mm512_mask_test_epi32_mask(m, __conv(mask), _mm512_set1_epi32(0x80000000)); + m = _mm512_mask_test_epi32_mask(m, __conv(mask), _mm512_set1_epi32(0x80000000)); _mm512_mask_storeu_ps(p, m, __conv(src)); } -static SIMDINLINE void SIMDCALL store_ps(float *p, Float a) // *p = a (stores all elements contiguously in memory) +static SIMDINLINE void SIMDCALL + store_ps(float* p, Float a) // *p = a (stores all elements contiguously in memory) { _mm512_mask_storeu_ps(p, __mmask16(0xff), __conv(a)); } -static SIMDINLINE void SIMDCALL store_si(Integer *p, Integer a) // *p = a +static SIMDINLINE void SIMDCALL store_si(Integer* p, Integer a) // *p = a { _mm512_mask_storeu_epi32(p, __mmask16(0xff), __conv(a)); } diff --git a/src/gallium/drivers/swr/rasterizer/common/simdlib_256_avx512_core.inl b/src/gallium/drivers/swr/rasterizer/common/simdlib_256_avx512_core.inl index 6ffe7c2a0f0..1acdc7e07ff 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdlib_256_avx512_core.inl +++ b/src/gallium/drivers/swr/rasterizer/common/simdlib_256_avx512_core.inl @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2017 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2017 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #if !defined(__SIMD_LIB_AVX512_HPP__) #error Do not include this file directly, use "simdlib.hpp" instead. #endif @@ -33,65 +33,68 @@ // register set. //============================================================================ -#define SIMD_DWRAPPER_1_(op, intrin, mask) \ - static SIMDINLINE Double SIMDCALL op(Double a) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a)));\ +#define SIMD_DWRAPPER_1_(op, intrin, mask) \ + static SIMDINLINE Double SIMDCALL op(Double a) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a))); \ } -#define SIMD_DWRAPPER_1(op) SIMD_DWRAPPER_1_(op, op, __mmask8(0xf)) +#define SIMD_DWRAPPER_1(op) SIMD_DWRAPPER_1_(op, op, __mmask8(0xf)) -#define SIMD_DWRAPPER_1I_(op, intrin, mask) \ - template<int ImmT> \ - static SIMDINLINE Double SIMDCALL op(Double a) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a), ImmT));\ +#define SIMD_DWRAPPER_1I_(op, intrin, mask) \ + template <int ImmT> \ + static SIMDINLINE Double SIMDCALL op(Double a) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a), ImmT)); \ } -#define SIMD_DWRAPPER_1I(op) SIMD_DWRAPPER_1I_(op, op, __mmask8(0xf)) +#define SIMD_DWRAPPER_1I(op) SIMD_DWRAPPER_1I_(op, op, __mmask8(0xf)) -#define SIMD_DWRAPPER_2_(op, intrin, mask) \ - static SIMDINLINE Double SIMDCALL op(Double a, Double b) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b)));\ +#define SIMD_DWRAPPER_2_(op, intrin, mask) \ + static SIMDINLINE Double SIMDCALL op(Double a, Double b) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b))); \ } -#define SIMD_DWRAPPER_2(op) SIMD_DWRAPPER_2_(op, op, __mmask8(0xf)) +#define SIMD_DWRAPPER_2(op) SIMD_DWRAPPER_2_(op, op, __mmask8(0xf)) -#define SIMD_IWRAPPER_1_(op, intrin, mask) \ - static SIMDINLINE Integer SIMDCALL op(Integer a) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a)));\ +#define SIMD_IWRAPPER_1_(op, intrin, mask) \ + static SIMDINLINE Integer SIMDCALL op(Integer a) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a))); \ } -#define SIMD_IWRAPPER_1_8(op) SIMD_IWRAPPER_1_(op, op, __mmask64(0xffffffffull)) -#define SIMD_IWRAPPER_1_16(op) SIMD_IWRAPPER_1_(op, op, __mmask32(0xffff)) -#define SIMD_IWRAPPER_1_64(op) SIMD_IWRAPPER_1_(op, op, __mmask8(0xf)) +#define SIMD_IWRAPPER_1_8(op) SIMD_IWRAPPER_1_(op, op, __mmask64(0xffffffffull)) +#define SIMD_IWRAPPER_1_16(op) SIMD_IWRAPPER_1_(op, op, __mmask32(0xffff)) +#define SIMD_IWRAPPER_1_64(op) SIMD_IWRAPPER_1_(op, op, __mmask8(0xf)) -#define SIMD_IWRAPPER_1I_(op, intrin, mask) \ - template<int ImmT> \ - static SIMDINLINE Integer SIMDCALL op(Integer a) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a), ImmT));\ +#define SIMD_IWRAPPER_1I_(op, intrin, mask) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer a) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a), ImmT)); \ } -#define SIMD_IWRAPPER_1I_8(op) SIMD_IWRAPPER_1I_(op, op, __mmask64(0xffffffffull)) -#define SIMD_IWRAPPER_1I_16(op) SIMD_IWRAPPER_1I_(op, op, __mmask32(0xffff)) -#define SIMD_IWRAPPER_1I_64(op) SIMD_IWRAPPER_1I_(op, op, __mmask8(0xf)) +#define SIMD_IWRAPPER_1I_8(op) SIMD_IWRAPPER_1I_(op, op, __mmask64(0xffffffffull)) +#define SIMD_IWRAPPER_1I_16(op) SIMD_IWRAPPER_1I_(op, op, __mmask32(0xffff)) +#define SIMD_IWRAPPER_1I_64(op) SIMD_IWRAPPER_1I_(op, op, __mmask8(0xf)) -#define SIMD_IWRAPPER_2_(op, intrin, mask) \ - static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ - {\ - return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b)));\ +#define SIMD_IWRAPPER_2_(op, intrin, mask) \ + static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ + { \ + return __conv(_mm512_maskz_##intrin((mask), __conv(a), __conv(b))); \ } -#define SIMD_IWRAPPER_2_8(op) SIMD_IWRAPPER_2_(op, op, __mmask64(0xffffffffull)) -#define SIMD_IWRAPPER_2_16(op) SIMD_IWRAPPER_2_(op, op, __mmask32(0xffff)) -#define SIMD_IWRAPPER_2_64(op) SIMD_IWRAPPER_2_(op, op, __mmask8(0xf)) +#define SIMD_IWRAPPER_2_8(op) SIMD_IWRAPPER_2_(op, op, __mmask64(0xffffffffull)) +#define SIMD_IWRAPPER_2_16(op) SIMD_IWRAPPER_2_(op, op, __mmask32(0xffff)) +#define SIMD_IWRAPPER_2_64(op) SIMD_IWRAPPER_2_(op, op, __mmask8(0xf)) - -SIMD_IWRAPPER_2_8(add_epi8); // return a + b (int8) -SIMD_IWRAPPER_2_8(adds_epu8); // return ((a + b) > 0xff) ? 0xff : (a + b) (uint8) -SIMD_IWRAPPER_2_64(sub_epi64); // return a - b (int64) -SIMD_IWRAPPER_2_8(subs_epu8); // return (b > a) ? 0 : (a - b) (uint8) -SIMD_IWRAPPER_2_8(packs_epi16); // int16 --> int8 See documentation for _mm256_packs_epi16 and _mm512_packs_epi16 -SIMD_IWRAPPER_2_16(packs_epi32); // int32 --> int16 See documentation for _mm256_packs_epi32 and _mm512_packs_epi32 -SIMD_IWRAPPER_2_8(packus_epi16); // uint16 --> uint8 See documentation for _mm256_packus_epi16 and _mm512_packus_epi16 -SIMD_IWRAPPER_2_16(packus_epi32); // uint32 --> uint16 See documentation for _mm256_packus_epi32 and _mm512_packus_epi32 +SIMD_IWRAPPER_2_8(add_epi8); // return a + b (int8) +SIMD_IWRAPPER_2_8(adds_epu8); // return ((a + b) > 0xff) ? 0xff : (a + b) (uint8) +SIMD_IWRAPPER_2_64(sub_epi64); // return a - b (int64) +SIMD_IWRAPPER_2_8(subs_epu8); // return (b > a) ? 0 : (a - b) (uint8) +SIMD_IWRAPPER_2_8(packs_epi16); // int16 --> int8 See documentation for _mm256_packs_epi16 and + // _mm512_packs_epi16 +SIMD_IWRAPPER_2_16(packs_epi32); // int32 --> int16 See documentation for _mm256_packs_epi32 and + // _mm512_packs_epi32 +SIMD_IWRAPPER_2_8(packus_epi16); // uint16 --> uint8 See documentation for _mm256_packus_epi16 and + // _mm512_packus_epi16 +SIMD_IWRAPPER_2_16(packus_epi32); // uint32 --> uint16 See documentation for _mm256_packus_epi32 and + // _mm512_packus_epi32 SIMD_IWRAPPER_2_16(unpackhi_epi16); SIMD_IWRAPPER_2_64(unpackhi_epi64); SIMD_IWRAPPER_2_8(unpackhi_epi8); @@ -102,8 +105,7 @@ SIMD_IWRAPPER_2_8(unpacklo_epi8); static SIMDINLINE uint32_t SIMDCALL movemask_epi8(Integer a) { __mmask64 m = 0xffffffffull; - return static_cast<uint32_t>( - _mm512_mask_test_epi8_mask(m, __conv(a), _mm512_set1_epi8(0x80))); + return static_cast<uint32_t>(_mm512_mask_test_epi8_mask(m, __conv(a), _mm512_set1_epi8(0x80))); } #undef SIMD_DWRAPPER_1_ diff --git a/src/gallium/drivers/swr/rasterizer/common/simdlib_256_avx512_knights.inl b/src/gallium/drivers/swr/rasterizer/common/simdlib_256_avx512_knights.inl index acd8ffd9688..52b6ca2b61e 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdlib_256_avx512_knights.inl +++ b/src/gallium/drivers/swr/rasterizer/common/simdlib_256_avx512_knights.inl @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2017 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2017 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #if !defined(__SIMD_LIB_AVX512_HPP__) #error Do not include this file directly, use "simdlib.hpp" instead. #endif @@ -32,4 +32,3 @@ // These use native AVX512 instructions with masking to enable a larger // register set. //============================================================================ - diff --git a/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512.inl b/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512.inl index dfe19d3c04a..e9e908ac3c6 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512.inl +++ b/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512.inl @@ -1,41 +1,41 @@ /**************************************************************************** -* Copyright (C) 2017 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2017 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #if !defined(__SIMD_LIB_AVX512_HPP__) #error Do not include this file directly, use "simdlib.hpp" instead. #endif -#if defined(__GNUC__) && !defined( __clang__) && !defined(__INTEL_COMPILER) +#if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) // gcc as of 7.1 was missing these intrinsics #ifndef _mm512_cmpneq_ps_mask -#define _mm512_cmpneq_ps_mask(a,b) _mm512_cmp_ps_mask((a),(b),_CMP_NEQ_UQ) +#define _mm512_cmpneq_ps_mask(a, b) _mm512_cmp_ps_mask((a), (b), _CMP_NEQ_UQ) #endif #ifndef _mm512_cmplt_ps_mask -#define _mm512_cmplt_ps_mask(a,b) _mm512_cmp_ps_mask((a),(b),_CMP_LT_OS) +#define _mm512_cmplt_ps_mask(a, b) _mm512_cmp_ps_mask((a), (b), _CMP_LT_OS) #endif #ifndef _mm512_cmplt_pd_mask -#define _mm512_cmplt_pd_mask(a,b) _mm512_cmp_pd_mask((a),(b),_CMP_LT_OS) +#define _mm512_cmplt_pd_mask(a, b) _mm512_cmp_pd_mask((a), (b), _CMP_LT_OS) #endif #endif @@ -47,136 +47,108 @@ //============================================================================ static const int TARGET_SIMD_WIDTH = 16; -using SIMD256T = SIMD256Impl::AVX2Impl; +using SIMD256T = SIMD256Impl::AVX2Impl; -#define SIMD_WRAPPER_1_(op, intrin) \ - static SIMDINLINE Float SIMDCALL op(Float a) \ - {\ - return intrin(a);\ - } +#define SIMD_WRAPPER_1_(op, intrin) \ + static SIMDINLINE Float SIMDCALL op(Float a) { return intrin(a); } -#define SIMD_WRAPPER_1(op) \ - SIMD_WRAPPER_1_(op, _mm512_##op) +#define SIMD_WRAPPER_1(op) SIMD_WRAPPER_1_(op, _mm512_##op) -#define SIMD_WRAPPER_2_(op, intrin) \ - static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ - {\ - return _mm512_##intrin(a, b);\ - } +#define SIMD_WRAPPER_2_(op, intrin) \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b) { return _mm512_##intrin(a, b); } #define SIMD_WRAPPER_2(op) SIMD_WRAPPER_2_(op, op) -#define SIMD_WRAPPERI_2_(op, intrin) \ - static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ - {\ - return _mm512_castsi512_ps(_mm512_##intrin(\ - _mm512_castps_si512(a), _mm512_castps_si512(b)));\ +#define SIMD_WRAPPERI_2_(op, intrin) \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ + { \ + return _mm512_castsi512_ps( \ + _mm512_##intrin(_mm512_castps_si512(a), _mm512_castps_si512(b))); \ } -#define SIMD_DWRAPPER_2(op) \ - static SIMDINLINE Double SIMDCALL op(Double a, Double b) \ - {\ - return _mm512_##op(a, b);\ - } +#define SIMD_DWRAPPER_2(op) \ + static SIMDINLINE Double SIMDCALL op(Double a, Double b) { return _mm512_##op(a, b); } -#define SIMD_WRAPPER_2I_(op, intrin) \ - template<int ImmT>\ - static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ - {\ - return _mm512_##intrin(a, b, ImmT);\ +#define SIMD_WRAPPER_2I_(op, intrin) \ + template <int ImmT> \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ + { \ + return _mm512_##intrin(a, b, ImmT); \ } -#define SIMD_WRAPPER_2I(op) SIMD_WRAPPER_2I_(op, op) +#define SIMD_WRAPPER_2I(op) SIMD_WRAPPER_2I_(op, op) -#define SIMD_DWRAPPER_2I_(op, intrin) \ - template<int ImmT>\ - static SIMDINLINE Double SIMDCALL op(Double a, Double b) \ - {\ - return _mm512_##intrin(a, b, ImmT);\ +#define SIMD_DWRAPPER_2I_(op, intrin) \ + template <int ImmT> \ + static SIMDINLINE Double SIMDCALL op(Double a, Double b) \ + { \ + return _mm512_##intrin(a, b, ImmT); \ } -#define SIMD_DWRAPPER_2I(op) SIMD_DWRAPPER_2I_(op, op) +#define SIMD_DWRAPPER_2I(op) SIMD_DWRAPPER_2I_(op, op) -#define SIMD_WRAPPER_3(op) \ - static SIMDINLINE Float SIMDCALL op(Float a, Float b, Float c) \ - {\ - return _mm512_##op(a, b, c);\ - } +#define SIMD_WRAPPER_3(op) \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b, Float c) { return _mm512_##op(a, b, c); } -#define SIMD_IWRAPPER_1(op) \ - static SIMDINLINE Integer SIMDCALL op(Integer a) \ - {\ - return _mm512_##op(a);\ - } -#define SIMD_IWRAPPER_1_8(op) \ - static SIMDINLINE Integer SIMDCALL op(SIMD256Impl::Integer a) \ - {\ - return _mm512_##op(a);\ - } +#define SIMD_IWRAPPER_1(op) \ + static SIMDINLINE Integer SIMDCALL op(Integer a) { return _mm512_##op(a); } +#define SIMD_IWRAPPER_1_8(op) \ + static SIMDINLINE Integer SIMDCALL op(SIMD256Impl::Integer a) { return _mm512_##op(a); } -#define SIMD_IWRAPPER_1_4(op) \ - static SIMDINLINE Integer SIMDCALL op(SIMD128Impl::Integer a) \ - {\ - return _mm512_##op(a);\ - } +#define SIMD_IWRAPPER_1_4(op) \ + static SIMDINLINE Integer SIMDCALL op(SIMD128Impl::Integer a) { return _mm512_##op(a); } -#define SIMD_IWRAPPER_1I_(op, intrin) \ - template<int ImmT> \ - static SIMDINLINE Integer SIMDCALL op(Integer a) \ - {\ - return intrin(a, ImmT);\ +#define SIMD_IWRAPPER_1I_(op, intrin) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer a) \ + { \ + return intrin(a, ImmT); \ } #define SIMD_IWRAPPER_1I(op) SIMD_IWRAPPER_1I_(op, _mm512_##op) -#define SIMD_IWRAPPER_2_(op, intrin) \ - static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ - {\ - return _mm512_##intrin(a, b);\ - } -#define SIMD_IWRAPPER_2(op) SIMD_IWRAPPER_2_(op, op) +#define SIMD_IWRAPPER_2_(op, intrin) \ + static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) { return _mm512_##intrin(a, b); } +#define SIMD_IWRAPPER_2(op) SIMD_IWRAPPER_2_(op, op) -#define SIMD_IWRAPPER_2_CMP(op, cmp) \ - static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ - {\ - return cmp(a, b);\ - } +#define SIMD_IWRAPPER_2_CMP(op, cmp) \ + static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) { return cmp(a, b); } -#define SIMD_IFWRAPPER_2(op, intrin) \ - static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ - {\ - return castps_si(_mm512_##intrin(castsi_ps(a), castsi_ps(b)) );\ +#define SIMD_IFWRAPPER_2(op, intrin) \ + static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ + { \ + return castps_si(_mm512_##intrin(castsi_ps(a), castsi_ps(b))); \ } -#define SIMD_IWRAPPER_2I_(op, intrin) \ - template<int ImmT>\ - static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ - {\ - return _mm512_##intrin(a, b, ImmT);\ +#define SIMD_IWRAPPER_2I_(op, intrin) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ + { \ + return _mm512_##intrin(a, b, ImmT); \ } #define SIMD_IWRAPPER_2I(op) SIMD_IWRAPPER_2I_(op, op) private: - static SIMDINLINE Integer vmask(__mmask16 m) - { - return _mm512_maskz_set1_epi32(m, -1); - } +static SIMDINLINE Integer vmask(__mmask16 m) +{ + return _mm512_maskz_set1_epi32(m, -1); +} - static SIMDINLINE Integer vmask(__mmask8 m) - { - return _mm512_maskz_set1_epi64(m, -1LL); - } +static SIMDINLINE Integer vmask(__mmask8 m) +{ + return _mm512_maskz_set1_epi64(m, -1LL); +} public: //----------------------------------------------------------------------- // Single precision floating point arithmetic operations //----------------------------------------------------------------------- -SIMD_WRAPPER_2(add_ps); // return a + b -SIMD_WRAPPER_2(div_ps); // return a / b -SIMD_WRAPPER_3(fmadd_ps); // return (a * b) + c -SIMD_WRAPPER_3(fmsub_ps); // return (a * b) - c -SIMD_WRAPPER_2(max_ps); // return (a > b) ? a : b -SIMD_WRAPPER_2(min_ps); // return (a < b) ? a : b -SIMD_WRAPPER_2(mul_ps); // return a * b -SIMD_WRAPPER_1_(rcp_ps, _mm512_rcp14_ps); // return 1.0f / a -SIMD_WRAPPER_1_(rsqrt_ps, _mm512_rsqrt14_ps); // return 1.0f / sqrt(a) -SIMD_WRAPPER_2(sub_ps); // return a - b +SIMD_WRAPPER_2(add_ps); // return a + b +SIMD_WRAPPER_2(div_ps); // return a / b +SIMD_WRAPPER_3(fmadd_ps); // return (a * b) + c +SIMD_WRAPPER_3(fmsub_ps); // return (a * b) - c +SIMD_WRAPPER_2(max_ps); // return (a > b) ? a : b +SIMD_WRAPPER_2(min_ps); // return (a < b) ? a : b +SIMD_WRAPPER_2(mul_ps); // return a * b +SIMD_WRAPPER_1_(rcp_ps, _mm512_rcp14_ps); // return 1.0f / a +SIMD_WRAPPER_1_(rsqrt_ps, _mm512_rsqrt14_ps); // return 1.0f / sqrt(a) +SIMD_WRAPPER_2(sub_ps); // return a - b template <RoundMode RMT> static SIMDINLINE Float SIMDCALL round_ps(Float a) @@ -184,52 +156,57 @@ static SIMDINLINE Float SIMDCALL round_ps(Float a) return _mm512_roundscale_ps(a, static_cast<int>(RMT)); } -static SIMDINLINE Float SIMDCALL ceil_ps(Float a) { return round_ps<RoundMode::CEIL_NOEXC>(a); } -static SIMDINLINE Float SIMDCALL floor_ps(Float a) { return round_ps<RoundMode::FLOOR_NOEXC>(a); } +static SIMDINLINE Float SIMDCALL ceil_ps(Float a) +{ + return round_ps<RoundMode::CEIL_NOEXC>(a); +} +static SIMDINLINE Float SIMDCALL floor_ps(Float a) +{ + return round_ps<RoundMode::FLOOR_NOEXC>(a); +} //----------------------------------------------------------------------- // Integer (various width) arithmetic operations //----------------------------------------------------------------------- SIMD_IWRAPPER_1(abs_epi32); // return absolute_value(a) (int32) SIMD_IWRAPPER_2(add_epi32); // return a + b (int32) -//SIMD_IWRAPPER_2(add_epi8); // return a + b (int8) -//SIMD_IWRAPPER_2(adds_epu8); // return ((a + b) > 0xff) ? 0xff : (a + b) (uint8) +// SIMD_IWRAPPER_2(add_epi8); // return a + b (int8) +// SIMD_IWRAPPER_2(adds_epu8); // return ((a + b) > 0xff) ? 0xff : (a + b) (uint8) SIMD_IWRAPPER_2(max_epi32); // return (a > b) ? a : b (int32) SIMD_IWRAPPER_2(max_epu32); // return (a > b) ? a : b (uint32) SIMD_IWRAPPER_2(min_epi32); // return (a < b) ? a : b (int32) SIMD_IWRAPPER_2(min_epu32); // return (a < b) ? a : b (uint32) SIMD_IWRAPPER_2(mul_epi32); // return a * b (int32) - // return (a * b) & 0xFFFFFFFF - // - // Multiply the packed 32-bit integers in a and b, producing intermediate 64-bit integers, - // and store the low 32 bits of the intermediate integers in dst. +// return (a * b) & 0xFFFFFFFF +// +// Multiply the packed 32-bit integers in a and b, producing intermediate 64-bit integers, +// and store the low 32 bits of the intermediate integers in dst. SIMD_IWRAPPER_2(mullo_epi32); SIMD_IWRAPPER_2(sub_epi32); // return a - b (int32) SIMD_IWRAPPER_2(sub_epi64); // return a - b (int64) -//SIMD_IWRAPPER_2(subs_epu8); // return (b > a) ? 0 : (a - b) (uint8) +// SIMD_IWRAPPER_2(subs_epu8); // return (b > a) ? 0 : (a - b) (uint8) //----------------------------------------------------------------------- // Logical operations //----------------------------------------------------------------------- -SIMD_IWRAPPER_2_(and_si, and_si512); // return a & b (int) -SIMD_IWRAPPER_2_(andnot_si, andnot_si512); // return (~a) & b (int) -SIMD_IWRAPPER_2_(or_si, or_si512); // return a | b (int) -SIMD_IWRAPPER_2_(xor_si, xor_si512); // return a ^ b (int) +SIMD_IWRAPPER_2_(and_si, and_si512); // return a & b (int) +SIMD_IWRAPPER_2_(andnot_si, andnot_si512); // return (~a) & b (int) +SIMD_IWRAPPER_2_(or_si, or_si512); // return a | b (int) +SIMD_IWRAPPER_2_(xor_si, xor_si512); // return a ^ b (int) // SIMD_WRAPPER_2(and_ps); // return a & b (float treated as int) // SIMD_WRAPPER_2(andnot_ps); // return (~a) & b (float treated as int) // SIMD_WRAPPER_2(or_ps); // return a | b (float treated as int) // SIMD_WRAPPER_2(xor_ps); // return a ^ b (float treated as int) - //----------------------------------------------------------------------- // Shift operations //----------------------------------------------------------------------- -SIMD_IWRAPPER_1I(slli_epi32); // return a << ImmT +SIMD_IWRAPPER_1I(slli_epi32); // return a << ImmT SIMD_IWRAPPER_2(sllv_epi32); -SIMD_IWRAPPER_1I(srai_epi32); // return a >> ImmT (int32) -SIMD_IWRAPPER_1I(srli_epi32); // return a >> ImmT (uint32) +SIMD_IWRAPPER_1I(srai_epi32); // return a >> ImmT (int32) +SIMD_IWRAPPER_1I(srli_epi32); // return a >> ImmT (uint32) #if 0 SIMD_IWRAPPER_1I_(srli_si, srli_si512); // return a >> (ImmT*8) (uint) @@ -246,32 +223,32 @@ SIMD_IWRAPPER_2(srlv_epi32); //----------------------------------------------------------------------- // Conversion operations //----------------------------------------------------------------------- -static SIMDINLINE Float SIMDCALL castpd_ps(Double a) // return *(Float*)(&a) +static SIMDINLINE Float SIMDCALL castpd_ps(Double a) // return *(Float*)(&a) { return _mm512_castpd_ps(a); } -static SIMDINLINE Integer SIMDCALL castps_si(Float a) // return *(Integer*)(&a) +static SIMDINLINE Integer SIMDCALL castps_si(Float a) // return *(Integer*)(&a) { return _mm512_castps_si512(a); } -static SIMDINLINE Double SIMDCALL castsi_pd(Integer a) // return *(Double*)(&a) +static SIMDINLINE Double SIMDCALL castsi_pd(Integer a) // return *(Double*)(&a) { return _mm512_castsi512_pd(a); } -static SIMDINLINE Double SIMDCALL castps_pd(Float a) // return *(Double*)(&a) +static SIMDINLINE Double SIMDCALL castps_pd(Float a) // return *(Double*)(&a) { return _mm512_castps_pd(a); } -static SIMDINLINE Integer SIMDCALL castpd_si(Double a) // return *(Integer*)(&a) +static SIMDINLINE Integer SIMDCALL castpd_si(Double a) // return *(Integer*)(&a) { return _mm512_castpd_si512(a); } -static SIMDINLINE Float SIMDCALL castsi_ps(Integer a) // return *(Float*)(&a) +static SIMDINLINE Float SIMDCALL castsi_ps(Integer a) // return *(Float*)(&a) { return _mm512_castsi512_ps(a); } @@ -281,18 +258,19 @@ static SIMDINLINE Float SIMDCALL cvtepi32_ps(Integer a) // return (float)a (i return _mm512_cvtepi32_ps(a); } -//SIMD_IWRAPPER_1_8(cvtepu8_epi16); // return (int16)a (uint8 --> int16) -SIMD_IWRAPPER_1_4(cvtepu8_epi32); // return (int32)a (uint8 --> int32) -SIMD_IWRAPPER_1_8(cvtepu16_epi32); // return (int32)a (uint16 --> int32) -SIMD_IWRAPPER_1_4(cvtepu16_epi64); // return (int64)a (uint16 --> int64) -SIMD_IWRAPPER_1_8(cvtepu32_epi64); // return (int64)a (uint32 --> int64) +// SIMD_IWRAPPER_1_8(cvtepu8_epi16); // return (int16)a (uint8 --> int16) +SIMD_IWRAPPER_1_4(cvtepu8_epi32); // return (int32)a (uint8 --> int32) +SIMD_IWRAPPER_1_8(cvtepu16_epi32); // return (int32)a (uint16 --> int32) +SIMD_IWRAPPER_1_4(cvtepu16_epi64); // return (int64)a (uint16 --> int64) +SIMD_IWRAPPER_1_8(cvtepu32_epi64); // return (int64)a (uint32 --> int64) -static SIMDINLINE Integer SIMDCALL cvtps_epi32(Float a) // return (int32)a (float --> int32) +static SIMDINLINE Integer SIMDCALL cvtps_epi32(Float a) // return (int32)a (float --> int32) { return _mm512_cvtps_epi32(a); } -static SIMDINLINE Integer SIMDCALL cvttps_epi32(Float a) // return (int32)a (rnd_to_zero(float) --> int32) +static SIMDINLINE Integer SIMDCALL + cvttps_epi32(Float a) // return (int32)a (rnd_to_zero(float) --> int32) { return _mm512_cvttps_epi32(a); } @@ -300,13 +278,13 @@ static SIMDINLINE Integer SIMDCALL cvttps_epi32(Float a) // return (in //----------------------------------------------------------------------- // Comparison operations //----------------------------------------------------------------------- -template<CompareType CmpTypeT> +template <CompareType CmpTypeT> static SIMDINLINE Mask SIMDCALL cmp_ps_mask(Float a, Float b) { return _mm512_cmp_ps_mask(a, b, static_cast<const int>(CmpTypeT)); } -template<CompareType CmpTypeT> +template <CompareType CmpTypeT> static SIMDINLINE Float SIMDCALL cmp_ps(Float a, Float b) // return a (CmpTypeT) b { // Legacy vector mask generator @@ -314,21 +292,39 @@ static SIMDINLINE Float SIMDCALL cmp_ps(Float a, Float b) // return a (CmpTypeT) return castsi_ps(vmask(result)); } -static SIMDINLINE Float SIMDCALL cmplt_ps(Float a, Float b) { return cmp_ps<CompareType::LT_OQ>(a, b); } -static SIMDINLINE Float SIMDCALL cmpgt_ps(Float a, Float b) { return cmp_ps<CompareType::GT_OQ>(a, b); } -static SIMDINLINE Float SIMDCALL cmpneq_ps(Float a, Float b) { return cmp_ps<CompareType::NEQ_OQ>(a, b); } -static SIMDINLINE Float SIMDCALL cmpeq_ps(Float a, Float b) { return cmp_ps<CompareType::EQ_OQ>(a, b); } -static SIMDINLINE Float SIMDCALL cmpge_ps(Float a, Float b) { return cmp_ps<CompareType::GE_OQ>(a, b); } -static SIMDINLINE Float SIMDCALL cmple_ps(Float a, Float b) { return cmp_ps<CompareType::LE_OQ>(a, b); } +static SIMDINLINE Float SIMDCALL cmplt_ps(Float a, Float b) +{ + return cmp_ps<CompareType::LT_OQ>(a, b); +} +static SIMDINLINE Float SIMDCALL cmpgt_ps(Float a, Float b) +{ + return cmp_ps<CompareType::GT_OQ>(a, b); +} +static SIMDINLINE Float SIMDCALL cmpneq_ps(Float a, Float b) +{ + return cmp_ps<CompareType::NEQ_OQ>(a, b); +} +static SIMDINLINE Float SIMDCALL cmpeq_ps(Float a, Float b) +{ + return cmp_ps<CompareType::EQ_OQ>(a, b); +} +static SIMDINLINE Float SIMDCALL cmpge_ps(Float a, Float b) +{ + return cmp_ps<CompareType::GE_OQ>(a, b); +} +static SIMDINLINE Float SIMDCALL cmple_ps(Float a, Float b) +{ + return cmp_ps<CompareType::LE_OQ>(a, b); +} -template<CompareTypeInt CmpTypeT> +template <CompareTypeInt CmpTypeT> static SIMDINLINE Integer SIMDCALL cmp_epi32(Integer a, Integer b) { // Legacy vector mask generator __mmask16 result = _mm512_cmp_epi32_mask(a, b, static_cast<const int>(CmpTypeT)); return vmask(result); } -template<CompareTypeInt CmpTypeT> +template <CompareTypeInt CmpTypeT> static SIMDINLINE Integer SIMDCALL cmp_epi64(Integer a, Integer b) { // Legacy vector mask generator @@ -336,22 +332,24 @@ static SIMDINLINE Integer SIMDCALL cmp_epi64(Integer a, Integer b) return vmask(result); } -//SIMD_IWRAPPER_2_CMP(cmpeq_epi8, cmp_epi8<CompareTypeInt::EQ>); // return a == b (int8) -//SIMD_IWRAPPER_2_CMP(cmpeq_epi16, cmp_epi16<CompareTypeInt::EQ>); // return a == b (int16) -SIMD_IWRAPPER_2_CMP(cmpeq_epi32, cmp_epi32<CompareTypeInt::EQ>); // return a == b (int32) -SIMD_IWRAPPER_2_CMP(cmpeq_epi64, cmp_epi64<CompareTypeInt::EQ>); // return a == b (int64) -//SIMD_IWRAPPER_2_CMP(cmpgt_epi8, cmp_epi8<CompareTypeInt::GT>); // return a > b (int8) -//SIMD_IWRAPPER_2_CMP(cmpgt_epi16, cmp_epi16<CompareTypeInt::GT>); // return a > b (int16) -SIMD_IWRAPPER_2_CMP(cmpgt_epi32, cmp_epi32<CompareTypeInt::GT>); // return a > b (int32) -SIMD_IWRAPPER_2_CMP(cmpgt_epi64, cmp_epi64<CompareTypeInt::GT>); // return a > b (int64) -SIMD_IWRAPPER_2_CMP(cmplt_epi32, cmp_epi32<CompareTypeInt::LT>); // return a < b (int32) +// SIMD_IWRAPPER_2_CMP(cmpeq_epi8, cmp_epi8<CompareTypeInt::EQ>); // return a == b (int8) +// SIMD_IWRAPPER_2_CMP(cmpeq_epi16, cmp_epi16<CompareTypeInt::EQ>); // return a == b (int16) +SIMD_IWRAPPER_2_CMP(cmpeq_epi32, cmp_epi32<CompareTypeInt::EQ>); // return a == b (int32) +SIMD_IWRAPPER_2_CMP(cmpeq_epi64, cmp_epi64<CompareTypeInt::EQ>); // return a == b (int64) +// SIMD_IWRAPPER_2_CMP(cmpgt_epi8, cmp_epi8<CompareTypeInt::GT>); // return a > b (int8) +// SIMD_IWRAPPER_2_CMP(cmpgt_epi16, cmp_epi16<CompareTypeInt::GT>); // return a > b (int16) +SIMD_IWRAPPER_2_CMP(cmpgt_epi32, cmp_epi32<CompareTypeInt::GT>); // return a > b (int32) +SIMD_IWRAPPER_2_CMP(cmpgt_epi64, cmp_epi64<CompareTypeInt::GT>); // return a > b (int64) +SIMD_IWRAPPER_2_CMP(cmplt_epi32, cmp_epi32<CompareTypeInt::LT>); // return a < b (int32) -static SIMDINLINE bool SIMDCALL testz_ps(Float a, Float b) // return all_lanes_zero(a & b) ? 1 : 0 (float) +static SIMDINLINE bool SIMDCALL testz_ps(Float a, + Float b) // return all_lanes_zero(a & b) ? 1 : 0 (float) { return (0 == static_cast<int>(_mm512_test_epi32_mask(castps_si(a), castps_si(b)))); } -static SIMDINLINE bool SIMDCALL testz_si(Integer a, Integer b) // return all_lanes_zero(a & b) ? 1 : 0 (int) +static SIMDINLINE bool SIMDCALL testz_si(Integer a, + Integer b) // return all_lanes_zero(a & b) ? 1 : 0 (int) { return (0 == static_cast<int>(_mm512_test_epi32_mask(a, b))); } @@ -376,75 +374,82 @@ static SIMDINLINE Float blendv_ps(Float a, Float b, Float mask) // return mask ? return _mm512_mask_blend_ps(__mmask16(movemask_ps(mask)), a, b); } - -static SIMDINLINE Integer SIMDCALL blendv_epi32(Integer a, Integer b, Float mask) // return mask ? b : a (int) +static SIMDINLINE Integer SIMDCALL blendv_epi32(Integer a, + Integer b, + Float mask) // return mask ? b : a (int) { return castps_si(blendv_ps(castsi_ps(a), castsi_ps(b), mask)); } -static SIMDINLINE Integer SIMDCALL blendv_epi32(Integer a, Integer b, Integer mask) // return mask ? b : a (int) +static SIMDINLINE Integer SIMDCALL blendv_epi32(Integer a, + Integer b, + Integer mask) // return mask ? b : a (int) { return castps_si(blendv_ps(castsi_ps(a), castsi_ps(b), castsi_ps(mask))); } -static SIMDINLINE Float SIMDCALL broadcast_ss(float const *p) // return *p (all elements in vector get same value) +static SIMDINLINE Float SIMDCALL + broadcast_ss(float const* p) // return *p (all elements in vector get same value) { return _mm512_set1_ps(*p); } -template<int imm> +template <int imm> static SIMDINLINE SIMD256Impl::Float SIMDCALL extract_ps(Float a) { return _mm256_castpd_ps(_mm512_extractf64x4_pd(_mm512_castps_pd(a), imm)); } -template<int imm> +template <int imm> static SIMDINLINE SIMD256Impl::Double SIMDCALL extract_pd(Double a) { return _mm512_extractf64x4_pd(a, imm); } -template<int imm> +template <int imm> static SIMDINLINE SIMD256Impl::Integer SIMDCALL extract_si(Integer a) { return _mm512_extracti64x4_epi64(a, imm); } -template<int imm> +template <int imm> static SIMDINLINE Float SIMDCALL insert_ps(Float a, SIMD256Impl::Float b) { return _mm512_castpd_ps(_mm512_insertf64x4(_mm512_castps_pd(a), _mm256_castps_pd(b), imm)); } -template<int imm> +template <int imm> static SIMDINLINE Double SIMDCALL insert_pd(Double a, SIMD256Impl::Double b) { return _mm512_insertf64x4(a, b, imm); } -template<int imm> +template <int imm> static SIMDINLINE Integer SIMDCALL insert_si(Integer a, SIMD256Impl::Integer b) { return _mm512_inserti64x4(a, b, imm); } -// SIMD_IWRAPPER_2(packs_epi16); // See documentation for _mm512_packs_epi16 and _mm512_packs_epi16 -// SIMD_IWRAPPER_2(packs_epi32); // See documentation for _mm512_packs_epi32 and _mm512_packs_epi32 -// SIMD_IWRAPPER_2(packus_epi16); // See documentation for _mm512_packus_epi16 and _mm512_packus_epi16 -// SIMD_IWRAPPER_2(packus_epi32); // See documentation for _mm512_packus_epi32 and _mm512_packus_epi32 +// SIMD_IWRAPPER_2(packs_epi16); // See documentation for _mm512_packs_epi16 and +// _mm512_packs_epi16 SIMD_IWRAPPER_2(packs_epi32); // See documentation for _mm512_packs_epi32 +// and _mm512_packs_epi32 SIMD_IWRAPPER_2(packus_epi16); // See documentation for +// _mm512_packus_epi16 and _mm512_packus_epi16 SIMD_IWRAPPER_2(packus_epi32); // See documentation +// for _mm512_packus_epi32 and _mm512_packus_epi32 -template<int ImmT> -static SIMDINLINE Float SIMDCALL permute_ps(Float const &a) +template <int ImmT> +static SIMDINLINE Float SIMDCALL permute_ps(Float const& a) { return _mm512_permute_ps(a, ImmT); } -static SIMDINLINE Integer SIMDCALL permute_epi32(Integer a, Integer swiz) // return a[swiz[i]] for each 32-bit lane i (float) +static SIMDINLINE Integer SIMDCALL + permute_epi32(Integer a, Integer swiz) // return a[swiz[i]] for each 32-bit lane i (float) { return _mm512_permutexvar_epi32(swiz, a); } -static SIMDINLINE Float SIMDCALL permute_ps(Float a, Integer swiz) // return a[swiz[i]] for each 32-bit lane i (float) +static SIMDINLINE Float SIMDCALL + permute_ps(Float a, Integer swiz) // return a[swiz[i]] for each 32-bit lane i (float) { return _mm512_permutexvar_ps(swiz, a); } @@ -455,11 +460,11 @@ SIMD_IWRAPPER_2I_(permute2f128_si, shuffle_i32x4); SIMD_IWRAPPER_1I(shuffle_epi32); -//SIMD_IWRAPPER_2(shuffle_epi8); +// SIMD_IWRAPPER_2(shuffle_epi8); SIMD_DWRAPPER_2I(shuffle_pd); SIMD_WRAPPER_2I(shuffle_ps); -template<int ImmT> +template <int ImmT> static SIMDINLINE Integer SIMDCALL shuffle_epi64(Integer a, Integer b) { return castpd_si(shuffle_pd<ImmT>(castsi_pd(a), castsi_pd(b))); @@ -467,73 +472,79 @@ static SIMDINLINE Integer SIMDCALL shuffle_epi64(Integer a, Integer b) SIMD_IWRAPPER_2(unpackhi_epi16); -//SIMD_IFWRAPPER_2(unpackhi_epi32, _mm512_unpackhi_ps); +// SIMD_IFWRAPPER_2(unpackhi_epi32, _mm512_unpackhi_ps); static SIMDINLINE Integer SIMDCALL unpackhi_epi32(Integer a, Integer b) { return castps_si(_mm512_unpackhi_ps(castsi_ps(a), castsi_ps(b))); } SIMD_IWRAPPER_2(unpackhi_epi64); -//SIMD_IWRAPPER_2(unpackhi_epi8); +// SIMD_IWRAPPER_2(unpackhi_epi8); SIMD_DWRAPPER_2(unpackhi_pd); SIMD_WRAPPER_2(unpackhi_ps); -//SIMD_IWRAPPER_2(unpacklo_epi16); +// SIMD_IWRAPPER_2(unpacklo_epi16); SIMD_IFWRAPPER_2(unpacklo_epi32, unpacklo_ps); SIMD_IWRAPPER_2(unpacklo_epi64); -//SIMD_IWRAPPER_2(unpacklo_epi8); +// SIMD_IWRAPPER_2(unpacklo_epi8); SIMD_DWRAPPER_2(unpacklo_pd); SIMD_WRAPPER_2(unpacklo_ps); //----------------------------------------------------------------------- // Load / store operations //----------------------------------------------------------------------- -template<ScaleFactor ScaleT> -static SIMDINLINE Float SIMDCALL i32gather_ps(float const* p, Integer idx) // return *(float*)(((int8*)p) + (idx * ScaleT)) +template <ScaleFactor ScaleT> +static SIMDINLINE Float SIMDCALL + i32gather_ps(float const* p, Integer idx) // return *(float*)(((int8*)p) + (idx * ScaleT)) { return _mm512_i32gather_ps(idx, p, static_cast<int>(ScaleT)); } -static SIMDINLINE Float SIMDCALL load1_ps(float const *p) // return *p (broadcast 1 value to all elements) +static SIMDINLINE Float SIMDCALL + load1_ps(float const* p) // return *p (broadcast 1 value to all elements) { return broadcast_ss(p); } -static SIMDINLINE Float SIMDCALL load_ps(float const *p) // return *p (loads SIMD width elements from memory) +static SIMDINLINE Float SIMDCALL + load_ps(float const* p) // return *p (loads SIMD width elements from memory) { return _mm512_load_ps(p); } -static SIMDINLINE Integer SIMDCALL load_si(Integer const *p) // return *p +static SIMDINLINE Integer SIMDCALL load_si(Integer const* p) // return *p { return _mm512_load_si512(&p->v); } -static SIMDINLINE Float SIMDCALL loadu_ps(float const *p) // return *p (same as load_ps but allows for unaligned mem) +static SIMDINLINE Float SIMDCALL + loadu_ps(float const* p) // return *p (same as load_ps but allows for unaligned mem) { return _mm512_loadu_ps(p); } -static SIMDINLINE Integer SIMDCALL loadu_si(Integer const *p) // return *p (same as load_si but allows for unaligned mem) +static SIMDINLINE Integer SIMDCALL + loadu_si(Integer const* p) // return *p (same as load_si but allows for unaligned mem) { return _mm512_loadu_si512(p); } // for each element: (mask & (1 << 31)) ? (i32gather_ps<ScaleT>(p, idx), mask = 0) : old -template<ScaleFactor ScaleT> -static SIMDINLINE Float SIMDCALL mask_i32gather_ps(Float old, float const* p, Integer idx, Float mask) +template <ScaleFactor ScaleT> +static SIMDINLINE Float SIMDCALL + mask_i32gather_ps(Float old, float const* p, Integer idx, Float mask) { __mmask16 k = _mm512_cmpneq_ps_mask(mask, setzero_ps()); return _mm512_mask_i32gather_ps(old, k, idx, p, static_cast<int>(ScaleT)); } -static SIMDINLINE void SIMDCALL maskstore_ps(float *p, Integer mask, Float src) +static SIMDINLINE void SIMDCALL maskstore_ps(float* p, Integer mask, Float src) { Mask m = _mm512_cmplt_epi32_mask(mask, setzero_si()); _mm512_mask_store_ps(p, m, src); } -//static SIMDINLINE uint64_t SIMDCALL movemask_epi8(Integer a) +// static SIMDINLINE uint64_t SIMDCALL movemask_epi8(Integer a) //{ // __mmask64 m = _mm512_cmplt_epi8_mask(a, setzero_si()); // return static_cast<uint64_t>(m); @@ -565,78 +576,99 @@ static SIMDINLINE Integer SIMDCALL set1_epi8(char i) // return i (all elements a return _mm512_set1_epi8(i); } -static SIMDINLINE Float SIMDCALL set1_ps(float f) // return f (all elements are same value) +static SIMDINLINE Float SIMDCALL set1_ps(float f) // return f (all elements are same value) { return _mm512_set1_ps(f); } -static SIMDINLINE Double SIMDCALL setzero_pd() // return 0 (double) +static SIMDINLINE Double SIMDCALL setzero_pd() // return 0 (double) { return _mm512_setzero_pd(); } -static SIMDINLINE Float SIMDCALL setzero_ps() // return 0 (float) +static SIMDINLINE Float SIMDCALL setzero_ps() // return 0 (float) { return _mm512_setzero_ps(); } -static SIMDINLINE Integer SIMDCALL setzero_si() // return 0 (integer) +static SIMDINLINE Integer SIMDCALL setzero_si() // return 0 (integer) { return _mm512_setzero_si512(); } -static SIMDINLINE void SIMDCALL store_ps(float *p, Float a) // *p = a (stores all elements contiguously in memory) +static SIMDINLINE void SIMDCALL + store_ps(float* p, Float a) // *p = a (stores all elements contiguously in memory) { _mm512_store_ps(p, a); } -static SIMDINLINE void SIMDCALL store_si(Integer *p, Integer a) // *p = a +static SIMDINLINE void SIMDCALL store_si(Integer* p, Integer a) // *p = a { _mm512_store_si512(&p->v, a); } -static SIMDINLINE void SIMDCALL storeu_si(Integer *p, Integer a) // *p = a (same as store_si but allows for unaligned mem) +static SIMDINLINE void SIMDCALL + storeu_si(Integer* p, Integer a) // *p = a (same as store_si but allows for unaligned mem) { _mm512_storeu_si512(&p->v, a); } -static SIMDINLINE void SIMDCALL stream_ps(float *p, Float a) // *p = a (same as store_ps, but doesn't keep memory in cache) +static SIMDINLINE void SIMDCALL + stream_ps(float* p, Float a) // *p = a (same as store_ps, but doesn't keep memory in cache) { _mm512_stream_ps(p, a); } -static SIMDINLINE Integer SIMDCALL set_epi32( - int i15, int i14, int i13, int i12, int i11, int i10, int i9, int i8, - int i7, int i6, int i5, int i4, int i3, int i2, int i1, int i0) +static SIMDINLINE Integer SIMDCALL set_epi32(int i15, + int i14, + int i13, + int i12, + int i11, + int i10, + int i9, + int i8, + int i7, + int i6, + int i5, + int i4, + int i3, + int i2, + int i1, + int i0) { - return _mm512_set_epi32( - i15, i14, i13, i12, i11, i10, i9, i8, - i7, i6, i5, i4, i3, i2, i1, i0); + return _mm512_set_epi32(i15, i14, i13, i12, i11, i10, i9, i8, i7, i6, i5, i4, i3, i2, i1, i0); } -static SIMDINLINE Integer SIMDCALL set_epi32( - int i7, int i6, int i5, int i4, int i3, int i2, int i1, int i0) +static SIMDINLINE Integer SIMDCALL + set_epi32(int i7, int i6, int i5, int i4, int i3, int i2, int i1, int i0) { - return set_epi32( - 0, 0, 0, 0, 0, 0, 0, 0, - i7, i6, i5, i4, i3, i2, i1, i0); + return set_epi32(0, 0, 0, 0, 0, 0, 0, 0, i7, i6, i5, i4, i3, i2, i1, i0); } -static SIMDINLINE Float SIMDCALL set_ps( - float i15, float i14, float i13, float i12, float i11, float i10, float i9, float i8, - float i7, float i6, float i5, float i4, float i3, float i2, float i1, float i0) +static SIMDINLINE Float SIMDCALL set_ps(float i15, + float i14, + float i13, + float i12, + float i11, + float i10, + float i9, + float i8, + float i7, + float i6, + float i5, + float i4, + float i3, + float i2, + float i1, + float i0) { - return _mm512_set_ps( - i15, i14, i13, i12, i11, i10, i9, i8, - i7, i6, i5, i4, i3, i2, i1, i0); + return _mm512_set_ps(i15, i14, i13, i12, i11, i10, i9, i8, i7, i6, i5, i4, i3, i2, i1, i0); } -static SIMDINLINE Float SIMDCALL set_ps( - float i7, float i6, float i5, float i4, float i3, float i2, float i1, float i0) +static SIMDINLINE Float SIMDCALL + set_ps(float i7, float i6, float i5, float i4, float i3, float i2, float i1, float i0) { - return set_ps( - 0, 0, 0, 0, 0, 0, 0, 0, - i7, i6, i5, i4, i3, i2, i1, i0); + return set_ps(0, 0, 0, 0, 0, 0, 0, 0, i7, i6, i5, i4, i3, i2, i1, i0); } static SIMDINLINE Float SIMDCALL vmask_ps(int32_t mask) @@ -665,4 +697,3 @@ static SIMDINLINE Float SIMDCALL vmask_ps(int32_t mask) #undef SIMD_IWRAPPER_2 #undef SIMD_IWRAPPER_2_ #undef SIMD_IWRAPPER_2I - diff --git a/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512_core.inl b/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512_core.inl index fed6307f4bc..82aa2bb4173 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512_core.inl +++ b/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512_core.inl @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2017 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2017 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #if !defined(__SIMD_LIB_AVX512_HPP__) #error Do not include this file directly, use "simdlib.hpp" instead. #endif @@ -29,139 +29,111 @@ // //============================================================================ -#define SIMD_WRAPPER_1_(op, intrin) \ - static SIMDINLINE Float SIMDCALL op(Float a) \ - {\ - return intrin(a);\ - } +#define SIMD_WRAPPER_1_(op, intrin) \ + static SIMDINLINE Float SIMDCALL op(Float a) { return intrin(a); } -#define SIMD_WRAPPER_1(op) \ - SIMD_WRAPPER_1_(op, _mm512_##op) +#define SIMD_WRAPPER_1(op) SIMD_WRAPPER_1_(op, _mm512_##op) -#define SIMD_WRAPPER_2_(op, intrin) \ - static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ - {\ - return _mm512_##intrin(a, b);\ - } +#define SIMD_WRAPPER_2_(op, intrin) \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b) { return _mm512_##intrin(a, b); } #define SIMD_WRAPPER_2(op) SIMD_WRAPPER_2_(op, op) -#define SIMD_WRAPPERI_2_(op, intrin) \ - static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ - {\ - return _mm512_castsi512_ps(_mm512_##intrin(\ - _mm512_castps_si512(a), _mm512_castps_si512(b)));\ +#define SIMD_WRAPPERI_2_(op, intrin) \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ + { \ + return _mm512_castsi512_ps( \ + _mm512_##intrin(_mm512_castps_si512(a), _mm512_castps_si512(b))); \ } -#define SIMD_DWRAPPER_2(op) \ - static SIMDINLINE Double SIMDCALL op(Double a, Double b) \ - {\ - return _mm512_##op(a, b);\ - } +#define SIMD_DWRAPPER_2(op) \ + static SIMDINLINE Double SIMDCALL op(Double a, Double b) { return _mm512_##op(a, b); } -#define SIMD_WRAPPER_2I_(op, intrin) \ - template<int ImmT>\ - static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ - {\ - return _mm512_##intrin(a, b, ImmT);\ +#define SIMD_WRAPPER_2I_(op, intrin) \ + template <int ImmT> \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ + { \ + return _mm512_##intrin(a, b, ImmT); \ } -#define SIMD_WRAPPER_2I(op) SIMD_WRAPPER_2I_(op, op) +#define SIMD_WRAPPER_2I(op) SIMD_WRAPPER_2I_(op, op) -#define SIMD_DWRAPPER_2I_(op, intrin) \ - template<int ImmT>\ - static SIMDINLINE Double SIMDCALL op(Double a, Double b) \ - {\ - return _mm512_##intrin(a, b, ImmT);\ +#define SIMD_DWRAPPER_2I_(op, intrin) \ + template <int ImmT> \ + static SIMDINLINE Double SIMDCALL op(Double a, Double b) \ + { \ + return _mm512_##intrin(a, b, ImmT); \ } -#define SIMD_DWRAPPER_2I(op) SIMD_DWRAPPER_2I_(op, op) +#define SIMD_DWRAPPER_2I(op) SIMD_DWRAPPER_2I_(op, op) -#define SIMD_WRAPPER_3(op) \ - static SIMDINLINE Float SIMDCALL op(Float a, Float b, Float c) \ - {\ - return _mm512_##op(a, b, c);\ - } +#define SIMD_WRAPPER_3(op) \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b, Float c) { return _mm512_##op(a, b, c); } -#define SIMD_IWRAPPER_1(op) \ - static SIMDINLINE Integer SIMDCALL op(Integer a) \ - {\ - return _mm512_##op(a);\ - } -#define SIMD_IWRAPPER_1_8(op) \ - static SIMDINLINE Integer SIMDCALL op(SIMD256Impl::Integer a) \ - {\ - return _mm512_##op(a);\ - } +#define SIMD_IWRAPPER_1(op) \ + static SIMDINLINE Integer SIMDCALL op(Integer a) { return _mm512_##op(a); } +#define SIMD_IWRAPPER_1_8(op) \ + static SIMDINLINE Integer SIMDCALL op(SIMD256Impl::Integer a) { return _mm512_##op(a); } -#define SIMD_IWRAPPER_1_4(op) \ - static SIMDINLINE Integer SIMDCALL op(SIMD128Impl::Integer a) \ - {\ - return _mm512_##op(a);\ - } +#define SIMD_IWRAPPER_1_4(op) \ + static SIMDINLINE Integer SIMDCALL op(SIMD128Impl::Integer a) { return _mm512_##op(a); } -#define SIMD_IWRAPPER_1I_(op, intrin) \ - template<int ImmT> \ - static SIMDINLINE Integer SIMDCALL op(Integer a) \ - {\ - return intrin(a, ImmT);\ +#define SIMD_IWRAPPER_1I_(op, intrin) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer a) \ + { \ + return intrin(a, ImmT); \ } #define SIMD_IWRAPPER_1I(op) SIMD_IWRAPPER_1I_(op, _mm512_##op) -#define SIMD_IWRAPPER_2_(op, intrin) \ - static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ - {\ - return _mm512_##intrin(a, b);\ - } -#define SIMD_IWRAPPER_2(op) SIMD_IWRAPPER_2_(op, op) +#define SIMD_IWRAPPER_2_(op, intrin) \ + static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) { return _mm512_##intrin(a, b); } +#define SIMD_IWRAPPER_2(op) SIMD_IWRAPPER_2_(op, op) -#define SIMD_IWRAPPER_2_CMP(op, cmp) \ - static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ - {\ - return cmp(a, b);\ - } +#define SIMD_IWRAPPER_2_CMP(op, cmp) \ + static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) { return cmp(a, b); } -#define SIMD_IFWRAPPER_2(op, intrin) \ - static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ - {\ - return castps_si(_mm512_##intrin(castsi_ps(a), castsi_ps(b)) );\ +#define SIMD_IFWRAPPER_2(op, intrin) \ + static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ + { \ + return castps_si(_mm512_##intrin(castsi_ps(a), castsi_ps(b))); \ } -#define SIMD_IWRAPPER_2I_(op, intrin) \ - template<int ImmT>\ - static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ - {\ - return _mm512_##intrin(a, b, ImmT);\ +#define SIMD_IWRAPPER_2I_(op, intrin) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ + { \ + return _mm512_##intrin(a, b, ImmT); \ } #define SIMD_IWRAPPER_2I(op) SIMD_IWRAPPER_2I_(op, op) private: - static SIMDINLINE Integer vmask(__mmask32 m) - { - return _mm512_maskz_set1_epi16(m, -1); - } - static SIMDINLINE Integer vmask(__mmask64 m) - { - return _mm512_maskz_set1_epi8(m, -1); - } -public: +static SIMDINLINE Integer vmask(__mmask32 m) +{ + return _mm512_maskz_set1_epi16(m, -1); +} +static SIMDINLINE Integer vmask(__mmask64 m) +{ + return _mm512_maskz_set1_epi8(m, -1); +} -SIMD_IWRAPPER_2(add_epi8); // return a + b (int8) -SIMD_IWRAPPER_2(adds_epu8); // return ((a + b) > 0xff) ? 0xff : (a + b) (uint8) -SIMD_IWRAPPER_2(subs_epu8); // return (b > a) ? 0 : (a - b) (uint8) +public: +SIMD_IWRAPPER_2(add_epi8); // return a + b (int8) +SIMD_IWRAPPER_2(adds_epu8); // return ((a + b) > 0xff) ? 0xff : (a + b) (uint8) +SIMD_IWRAPPER_2(subs_epu8); // return (b > a) ? 0 : (a - b) (uint8) -SIMD_WRAPPER_2(and_ps); // return a & b (float treated as int) -SIMD_WRAPPER_2(andnot_ps); // return (~a) & b (float treated as int) -SIMD_WRAPPER_2(or_ps); // return a | b (float treated as int) -SIMD_WRAPPER_2(xor_ps); // return a ^ b (float treated as int) +SIMD_WRAPPER_2(and_ps); // return a & b (float treated as int) +SIMD_WRAPPER_2(andnot_ps); // return (~a) & b (float treated as int) +SIMD_WRAPPER_2(or_ps); // return a | b (float treated as int) +SIMD_WRAPPER_2(xor_ps); // return a ^ b (float treated as int) -SIMD_IWRAPPER_1_8(cvtepu8_epi16); // return (int16)a (uint8 --> int16) +SIMD_IWRAPPER_1_8(cvtepu8_epi16); // return (int16)a (uint8 --> int16) -template<CompareTypeInt CmpTypeT> +template <CompareTypeInt CmpTypeT> static SIMDINLINE Integer SIMDCALL cmp_epi8(Integer a, Integer b) { // Legacy vector mask generator __mmask64 result = _mm512_cmp_epi8_mask(a, b, static_cast<const int>(CmpTypeT)); return vmask(result); } -template<CompareTypeInt CmpTypeT> +template <CompareTypeInt CmpTypeT> static SIMDINLINE Integer SIMDCALL cmp_epi16(Integer a, Integer b) { // Legacy vector mask generator @@ -169,19 +141,19 @@ static SIMDINLINE Integer SIMDCALL cmp_epi16(Integer a, Integer b) return vmask(result); } -SIMD_IWRAPPER_2_CMP(cmpeq_epi8, cmp_epi8<CompareTypeInt::EQ>); // return a == b (int8) -SIMD_IWRAPPER_2_CMP(cmpeq_epi16, cmp_epi16<CompareTypeInt::EQ>); // return a == b (int16) -SIMD_IWRAPPER_2_CMP(cmpgt_epi8, cmp_epi8<CompareTypeInt::GT>); // return a > b (int8) -SIMD_IWRAPPER_2_CMP(cmpgt_epi16, cmp_epi16<CompareTypeInt::GT>); // return a > b (int16) +SIMD_IWRAPPER_2_CMP(cmpeq_epi8, cmp_epi8<CompareTypeInt::EQ>); // return a == b (int8) +SIMD_IWRAPPER_2_CMP(cmpeq_epi16, cmp_epi16<CompareTypeInt::EQ>); // return a == b (int16) +SIMD_IWRAPPER_2_CMP(cmpgt_epi8, cmp_epi8<CompareTypeInt::GT>); // return a > b (int8) +SIMD_IWRAPPER_2_CMP(cmpgt_epi16, cmp_epi16<CompareTypeInt::GT>); // return a > b (int16) -SIMD_IWRAPPER_2(packs_epi16); // See documentation for _mm512_packs_epi16 -SIMD_IWRAPPER_2(packs_epi32); // See documentation for _mm512_packs_epi32 -SIMD_IWRAPPER_2(packus_epi16); // See documentation for _mm512_packus_epi16 -SIMD_IWRAPPER_2(packus_epi32); // See documentation for _mm512_packus_epi32 +SIMD_IWRAPPER_2(packs_epi16); // See documentation for _mm512_packs_epi16 +SIMD_IWRAPPER_2(packs_epi32); // See documentation for _mm512_packs_epi32 +SIMD_IWRAPPER_2(packus_epi16); // See documentation for _mm512_packus_epi16 +SIMD_IWRAPPER_2(packus_epi32); // See documentation for _mm512_packus_epi32 -SIMD_IWRAPPER_2(unpackhi_epi8); // See documentation for _mm512_unpackhi_epi8 -SIMD_IWRAPPER_2(unpacklo_epi16); // See documentation for _mm512_unpacklo_epi16 -SIMD_IWRAPPER_2(unpacklo_epi8); // See documentation for _mm512_unpacklo_epi8 +SIMD_IWRAPPER_2(unpackhi_epi8); // See documentation for _mm512_unpackhi_epi8 +SIMD_IWRAPPER_2(unpacklo_epi16); // See documentation for _mm512_unpacklo_epi16 +SIMD_IWRAPPER_2(unpacklo_epi8); // See documentation for _mm512_unpacklo_epi8 SIMD_IWRAPPER_2(shuffle_epi8); @@ -191,8 +163,6 @@ static SIMDINLINE uint64_t SIMDCALL movemask_epi8(Integer a) return static_cast<uint64_t>(m); } - - #undef SIMD_WRAPPER_1_ #undef SIMD_WRAPPER_1 #undef SIMD_WRAPPER_2 @@ -214,4 +184,3 @@ static SIMDINLINE uint64_t SIMDCALL movemask_epi8(Integer a) #undef SIMD_IWRAPPER_2 #undef SIMD_IWRAPPER_2_ #undef SIMD_IWRAPPER_2I - diff --git a/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512_knights.inl b/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512_knights.inl index 690ab386b46..9ec3ff6c6b1 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512_knights.inl +++ b/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512_knights.inl @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2017 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2017 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #if !defined(__SIMD_LIB_AVX512_HPP__) #error Do not include this file directly, use "simdlib.hpp" instead. #endif @@ -29,113 +29,85 @@ // //============================================================================ -#define SIMD_WRAPPER_1_(op, intrin) \ - static SIMDINLINE Float SIMDCALL op(Float a) \ - {\ - return intrin(a);\ - } +#define SIMD_WRAPPER_1_(op, intrin) \ + static SIMDINLINE Float SIMDCALL op(Float a) { return intrin(a); } -#define SIMD_WRAPPER_1(op) \ - SIMD_WRAPPER_1_(op, _mm512_##op) +#define SIMD_WRAPPER_1(op) SIMD_WRAPPER_1_(op, _mm512_##op) -#define SIMD_WRAPPER_2_(op, intrin) \ - static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ - {\ - return _mm512_##intrin(a, b);\ - } +#define SIMD_WRAPPER_2_(op, intrin) \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b) { return _mm512_##intrin(a, b); } #define SIMD_WRAPPER_2(op) SIMD_WRAPPER_2_(op, op) -#define SIMD_WRAPPERI_2_(op, intrin) \ - static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ - {\ - return _mm512_castsi512_ps(_mm512_##intrin(\ - _mm512_castps_si512(a), _mm512_castps_si512(b)));\ +#define SIMD_WRAPPERI_2_(op, intrin) \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ + { \ + return _mm512_castsi512_ps( \ + _mm512_##intrin(_mm512_castps_si512(a), _mm512_castps_si512(b))); \ } -#define SIMD_DWRAPPER_2(op) \ - static SIMDINLINE Double SIMDCALL op(Double a, Double b) \ - {\ - return _mm512_##op(a, b);\ - } +#define SIMD_DWRAPPER_2(op) \ + static SIMDINLINE Double SIMDCALL op(Double a, Double b) { return _mm512_##op(a, b); } -#define SIMD_WRAPPER_2I_(op, intrin) \ - template<int ImmT>\ - static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ - {\ - return _mm512_##intrin(a, b, ImmT);\ +#define SIMD_WRAPPER_2I_(op, intrin) \ + template <int ImmT> \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b) \ + { \ + return _mm512_##intrin(a, b, ImmT); \ } -#define SIMD_WRAPPER_2I(op) SIMD_WRAPPER_2I_(op, op) +#define SIMD_WRAPPER_2I(op) SIMD_WRAPPER_2I_(op, op) -#define SIMD_DWRAPPER_2I_(op, intrin) \ - template<int ImmT>\ - static SIMDINLINE Double SIMDCALL op(Double a, Double b) \ - {\ - return _mm512_##intrin(a, b, ImmT);\ +#define SIMD_DWRAPPER_2I_(op, intrin) \ + template <int ImmT> \ + static SIMDINLINE Double SIMDCALL op(Double a, Double b) \ + { \ + return _mm512_##intrin(a, b, ImmT); \ } -#define SIMD_DWRAPPER_2I(op) SIMD_DWRAPPER_2I_(op, op) +#define SIMD_DWRAPPER_2I(op) SIMD_DWRAPPER_2I_(op, op) -#define SIMD_WRAPPER_3(op) \ - static SIMDINLINE Float SIMDCALL op(Float a, Float b, Float c) \ - {\ - return _mm512_##op(a, b, c);\ - } +#define SIMD_WRAPPER_3(op) \ + static SIMDINLINE Float SIMDCALL op(Float a, Float b, Float c) { return _mm512_##op(a, b, c); } -#define SIMD_IWRAPPER_1(op) \ - static SIMDINLINE Integer SIMDCALL op(Integer a) \ - {\ - return _mm512_##op(a);\ - } -#define SIMD_IWRAPPER_1_8(op) \ - static SIMDINLINE Integer SIMDCALL op(SIMD256Impl::Integer a) \ - {\ - return _mm512_##op(a);\ - } +#define SIMD_IWRAPPER_1(op) \ + static SIMDINLINE Integer SIMDCALL op(Integer a) { return _mm512_##op(a); } +#define SIMD_IWRAPPER_1_8(op) \ + static SIMDINLINE Integer SIMDCALL op(SIMD256Impl::Integer a) { return _mm512_##op(a); } -#define SIMD_IWRAPPER_1_4(op) \ - static SIMDINLINE Integer SIMDCALL op(SIMD128Impl::Integer a) \ - {\ - return _mm512_##op(a);\ - } +#define SIMD_IWRAPPER_1_4(op) \ + static SIMDINLINE Integer SIMDCALL op(SIMD128Impl::Integer a) { return _mm512_##op(a); } -#define SIMD_IWRAPPER_1I_(op, intrin) \ - template<int ImmT> \ - static SIMDINLINE Integer SIMDCALL op(Integer a) \ - {\ - return intrin(a, ImmT);\ +#define SIMD_IWRAPPER_1I_(op, intrin) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer a) \ + { \ + return intrin(a, ImmT); \ } #define SIMD_IWRAPPER_1I(op) SIMD_IWRAPPER_1I_(op, _mm512_##op) -#define SIMD_IWRAPPER_2_(op, intrin) \ - static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ - {\ - return _mm512_##intrin(a, b);\ - } -#define SIMD_IWRAPPER_2(op) SIMD_IWRAPPER_2_(op, op) +#define SIMD_IWRAPPER_2_(op, intrin) \ + static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) { return _mm512_##intrin(a, b); } +#define SIMD_IWRAPPER_2(op) SIMD_IWRAPPER_2_(op, op) -#define SIMD_IWRAPPER_2_CMP(op, cmp) \ - static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ - {\ - return cmp(a, b);\ - } +#define SIMD_IWRAPPER_2_CMP(op, cmp) \ + static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) { return cmp(a, b); } -#define SIMD_IFWRAPPER_2(op, intrin) \ - static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ - {\ - return castps_si(_mm512_##intrin(castsi_ps(a), castsi_ps(b)) );\ +#define SIMD_IFWRAPPER_2(op, intrin) \ + static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ + { \ + return castps_si(_mm512_##intrin(castsi_ps(a), castsi_ps(b))); \ } -#define SIMD_IWRAPPER_2I_(op, intrin) \ - template<int ImmT>\ - static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ - {\ - return _mm512_##intrin(a, b, ImmT);\ +#define SIMD_IWRAPPER_2I_(op, intrin) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer a, Integer b) \ + { \ + return _mm512_##intrin(a, b, ImmT); \ } #define SIMD_IWRAPPER_2I(op) SIMD_IWRAPPER_2I_(op, op) -SIMD_WRAPPERI_2_(and_ps, and_epi32); // return a & b (float treated as int) -SIMD_WRAPPERI_2_(andnot_ps, andnot_epi32); // return (~a) & b (float treated as int) -SIMD_WRAPPERI_2_(or_ps, or_epi32); // return a | b (float treated as int) -SIMD_WRAPPERI_2_(xor_ps, xor_epi32); // return a ^ b (float treated as int) +SIMD_WRAPPERI_2_(and_ps, and_epi32); // return a & b (float treated as int) +SIMD_WRAPPERI_2_(andnot_ps, andnot_epi32); // return (~a) & b (float treated as int) +SIMD_WRAPPERI_2_(or_ps, or_epi32); // return a | b (float treated as int) +SIMD_WRAPPERI_2_(xor_ps, xor_epi32); // return a ^ b (float treated as int) #undef SIMD_WRAPPER_1_ #undef SIMD_WRAPPER_1 @@ -158,4 +130,3 @@ SIMD_WRAPPERI_2_(xor_ps, xor_epi32); // return a ^ b (float treat #undef SIMD_IWRAPPER_2 #undef SIMD_IWRAPPER_2_ #undef SIMD_IWRAPPER_2I - diff --git a/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512_masks.inl b/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512_masks.inl index 3e36ce5bd36..f9d4b8c3902 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512_masks.inl +++ b/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512_masks.inl @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2017 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2017 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #if !defined(__SIMD_LIB_AVX512_HPP__) #error Do not include this file directly, use "simdlib.hpp" instead. #endif diff --git a/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512_masks_core.inl b/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512_masks_core.inl index 3e36ce5bd36..f9d4b8c3902 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512_masks_core.inl +++ b/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512_masks_core.inl @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2017 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2017 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #if !defined(__SIMD_LIB_AVX512_HPP__) #error Do not include this file directly, use "simdlib.hpp" instead. #endif diff --git a/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512_masks_knights.inl b/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512_masks_knights.inl index 3e36ce5bd36..f9d4b8c3902 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512_masks_knights.inl +++ b/src/gallium/drivers/swr/rasterizer/common/simdlib_512_avx512_masks_knights.inl @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2017 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2017 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #if !defined(__SIMD_LIB_AVX512_HPP__) #error Do not include this file directly, use "simdlib.hpp" instead. #endif diff --git a/src/gallium/drivers/swr/rasterizer/common/simdlib_512_emu.inl b/src/gallium/drivers/swr/rasterizer/common/simdlib_512_emu.inl index 55981dceba1..91705f2646d 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdlib_512_emu.inl +++ b/src/gallium/drivers/swr/rasterizer/common/simdlib_512_emu.inl @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2017 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2017 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #if !defined(__SIMD_LIB_AVX_HPP__) #error Do not include this file directly, use "simdlib.hpp" instead. #endif @@ -29,149 +29,143 @@ //============================================================================ static const int TARGET_SIMD_WIDTH = 8; -using SIMD128T = SIMD128Impl::AVXImpl; - -#define SIMD_WRAPPER_1(op) \ - static SIMDINLINE Float SIMDCALL op(Float const &a) \ - {\ - return Float\ - {\ - SIMD256T::op(a.v8[0]),\ - SIMD256T::op(a.v8[1]),\ - };\ +using SIMD128T = SIMD128Impl::AVXImpl; + +#define SIMD_WRAPPER_1(op) \ + static SIMDINLINE Float SIMDCALL op(Float const& a) \ + { \ + return Float{ \ + SIMD256T::op(a.v8[0]), \ + SIMD256T::op(a.v8[1]), \ + }; \ } -#define SIMD_WRAPPER_2(op) \ - static SIMDINLINE Float SIMDCALL op(Float const &a, Float const &b) \ - {\ - return Float\ - {\ - SIMD256T::op(a.v8[0], b.v8[0]),\ - SIMD256T::op(a.v8[1], b.v8[1]),\ - };\ +#define SIMD_WRAPPER_2(op) \ + static SIMDINLINE Float SIMDCALL op(Float const& a, Float const& b) \ + { \ + return Float{ \ + SIMD256T::op(a.v8[0], b.v8[0]), \ + SIMD256T::op(a.v8[1], b.v8[1]), \ + }; \ } -#define SIMD_WRAPPER_2I(op) \ - template<int ImmT>\ - static SIMDINLINE Float SIMDCALL op(Float const &a, Float const &b) \ - {\ - return Float\ - {\ - SIMD256T::template op<0xFF & ImmT>(a.v8[0], b.v8[0]),\ - SIMD256T::template op<0xFF & (ImmT >> TARGET_SIMD_WIDTH)>(a.v8[1], b.v8[1]),\ - };\ +#define SIMD_WRAPPER_2I(op) \ + template <int ImmT> \ + static SIMDINLINE Float SIMDCALL op(Float const& a, Float const& b) \ + { \ + return Float{ \ + SIMD256T::template op<0xFF & ImmT>(a.v8[0], b.v8[0]), \ + SIMD256T::template op<0xFF & (ImmT >> TARGET_SIMD_WIDTH)>(a.v8[1], b.v8[1]), \ + }; \ } -#define SIMD_WRAPPER_2I_1(op) \ - template<int ImmT>\ - static SIMDINLINE Float SIMDCALL op(Float const &a, Float const &b) \ - {\ - return Float\ - {\ - SIMD256T::template op<ImmT>(a.v8[0], b.v8[0]),\ - SIMD256T::template op<ImmT>(a.v8[1], b.v8[1]),\ - };\ +#define SIMD_WRAPPER_2I_1(op) \ + template <int ImmT> \ + static SIMDINLINE Float SIMDCALL op(Float const& a, Float const& b) \ + { \ + return Float{ \ + SIMD256T::template op<ImmT>(a.v8[0], b.v8[0]), \ + SIMD256T::template op<ImmT>(a.v8[1], b.v8[1]), \ + }; \ } -#define SIMD_WRAPPER_3(op) \ - static SIMDINLINE Float SIMDCALL op(Float const &a, Float const &b, Float const &c) \ - {\ - return Float\ - {\ - SIMD256T::op(a.v8[0], b.v8[0], c.v8[0]),\ - SIMD256T::op(a.v8[1], b.v8[1], c.v8[1]),\ - };\ - } - -#define SIMD_IWRAPPER_1(op) \ - static SIMDINLINE Integer SIMDCALL op(Integer const &a) \ - {\ - return Integer\ - {\ - SIMD256T::op(a.v8[0]),\ - SIMD256T::op(a.v8[1]),\ - };\ +#define SIMD_WRAPPER_3(op) \ + static SIMDINLINE Float SIMDCALL op(Float const& a, Float const& b, Float const& c) \ + { \ + return Float{ \ + SIMD256T::op(a.v8[0], b.v8[0], c.v8[0]), \ + SIMD256T::op(a.v8[1], b.v8[1], c.v8[1]), \ + }; \ } -#define SIMD_IWRAPPER_2(op) \ - static SIMDINLINE Integer SIMDCALL op(Integer const &a, Integer const &b) \ - {\ - return Integer\ - {\ - SIMD256T::op(a.v8[0], b.v8[0]),\ - SIMD256T::op(a.v8[1], b.v8[1]),\ - };\ +#define SIMD_IWRAPPER_1(op) \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a) \ + { \ + return Integer{ \ + SIMD256T::op(a.v8[0]), \ + SIMD256T::op(a.v8[1]), \ + }; \ } -#define SIMD_IWRAPPER_2I(op) \ - template<int ImmT>\ - static SIMDINLINE Integer SIMDCALL op(Integer const &a, Integer const &b) \ - {\ - return Integer\ - {\ - SIMD256T::template op<0xFF & ImmT>(a.v8[0], b.v8[0]),\ - SIMD256T::template op<0xFF & (ImmT >> TARGET_SIMD_WIDTH)>(a.v8[1], b.v8[1]),\ - };\ +#define SIMD_IWRAPPER_2(op) \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a, Integer const& b) \ + { \ + return Integer{ \ + SIMD256T::op(a.v8[0], b.v8[0]), \ + SIMD256T::op(a.v8[1], b.v8[1]), \ + }; \ } -#define SIMD_IWRAPPER_2I_1(op) \ - template<int ImmT>\ - static SIMDINLINE Integer SIMDCALL op(Integer const &a, Integer const &b) \ - {\ - return Integer\ - {\ - SIMD256T::template op<ImmT>(a.v8[0], b.v8[0]),\ - SIMD256T::template op<ImmT>(a.v8[1], b.v8[1]),\ - };\ +#define SIMD_IWRAPPER_2I(op) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a, Integer const& b) \ + { \ + return Integer{ \ + SIMD256T::template op<0xFF & ImmT>(a.v8[0], b.v8[0]), \ + SIMD256T::template op<0xFF & (ImmT >> TARGET_SIMD_WIDTH)>(a.v8[1], b.v8[1]), \ + }; \ } -#define SIMD_IWRAPPER_2I_2(op) \ - template<int ImmT>\ - static SIMDINLINE Integer SIMDCALL op(Integer const &a, Integer const &b) \ - {\ - return Integer\ - {\ - SIMD256T::template op<0xF & ImmT>(a.v8[0], b.v8[0]),\ - SIMD256T::template op<0xF & (ImmT >> 4)>(a.v8[1], b.v8[1]),\ - };\ +#define SIMD_IWRAPPER_2I_1(op) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a, Integer const& b) \ + { \ + return Integer{ \ + SIMD256T::template op<ImmT>(a.v8[0], b.v8[0]), \ + SIMD256T::template op<ImmT>(a.v8[1], b.v8[1]), \ + }; \ } -#define SIMD_IWRAPPER_3(op) \ - static SIMDINLINE Integer SIMDCALL op(Integer const &a, Integer const &b, Integer const &c) \ - {\ - return Integer\ - {\ - SIMD256T::op(a.v8[0], b.v8[0], c.v8[0]),\ - SIMD256T::op(a.v8[1], b.v8[1], c.v8[1]),\ - };\ +#define SIMD_IWRAPPER_2I_2(op) \ + template <int ImmT> \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a, Integer const& b) \ + { \ + return Integer{ \ + SIMD256T::template op<0xF & ImmT>(a.v8[0], b.v8[0]), \ + SIMD256T::template op<0xF & (ImmT >> 4)>(a.v8[1], b.v8[1]), \ + }; \ + } + +#define SIMD_IWRAPPER_3(op) \ + static SIMDINLINE Integer SIMDCALL op(Integer const& a, Integer const& b, Integer const& c) \ + { \ + return Integer{ \ + SIMD256T::op(a.v8[0], b.v8[0], c.v8[0]), \ + SIMD256T::op(a.v8[1], b.v8[1], c.v8[1]), \ + }; \ } //----------------------------------------------------------------------- // Single precision floating point arithmetic operations //----------------------------------------------------------------------- -SIMD_WRAPPER_2(add_ps); // return a + b -SIMD_WRAPPER_2(div_ps); // return a / b -SIMD_WRAPPER_3(fmadd_ps); // return (a * b) + c -SIMD_WRAPPER_3(fmsub_ps); // return (a * b) - c -SIMD_WRAPPER_2(max_ps); // return (a > b) ? a : b -SIMD_WRAPPER_2(min_ps); // return (a < b) ? a : b -SIMD_WRAPPER_2(mul_ps); // return a * b -SIMD_WRAPPER_1(rcp_ps); // return 1.0f / a -SIMD_WRAPPER_1(rsqrt_ps); // return 1.0f / sqrt(a) -SIMD_WRAPPER_2(sub_ps); // return a - b +SIMD_WRAPPER_2(add_ps); // return a + b +SIMD_WRAPPER_2(div_ps); // return a / b +SIMD_WRAPPER_3(fmadd_ps); // return (a * b) + c +SIMD_WRAPPER_3(fmsub_ps); // return (a * b) - c +SIMD_WRAPPER_2(max_ps); // return (a > b) ? a : b +SIMD_WRAPPER_2(min_ps); // return (a < b) ? a : b +SIMD_WRAPPER_2(mul_ps); // return a * b +SIMD_WRAPPER_1(rcp_ps); // return 1.0f / a +SIMD_WRAPPER_1(rsqrt_ps); // return 1.0f / sqrt(a) +SIMD_WRAPPER_2(sub_ps); // return a - b template <RoundMode RMT> -static SIMDINLINE Float SIMDCALL round_ps(Float const &a) +static SIMDINLINE Float SIMDCALL round_ps(Float const& a) { - return Float - { + return Float{ SIMD256T::template round_ps<RMT>(a.v8[0]), SIMD256T::template round_ps<RMT>(a.v8[1]), }; } -static SIMDINLINE Float SIMDCALL ceil_ps(Float const &a) { return round_ps<RoundMode::CEIL_NOEXC>(a); } -static SIMDINLINE Float SIMDCALL floor_ps(Float const &a) { return round_ps<RoundMode::FLOOR_NOEXC>(a); } +static SIMDINLINE Float SIMDCALL ceil_ps(Float const& a) +{ + return round_ps<RoundMode::CEIL_NOEXC>(a); +} +static SIMDINLINE Float SIMDCALL floor_ps(Float const& a) +{ + return round_ps<RoundMode::FLOOR_NOEXC>(a); +} //----------------------------------------------------------------------- // Integer (various width) arithmetic operations @@ -179,7 +173,7 @@ static SIMDINLINE Float SIMDCALL floor_ps(Float const &a) { return round_ps<Roun SIMD_IWRAPPER_1(abs_epi32); // return absolute_value(a) (int32) SIMD_IWRAPPER_2(add_epi32); // return a + b (int32) SIMD_IWRAPPER_2(add_epi8); // return a + b (int8) -SIMD_IWRAPPER_2(adds_epu8); // return ((a + b) > 0xff) ? 0xff : (a + b) (uint8) +SIMD_IWRAPPER_2(adds_epu8); // return ((a + b) > 0xff) ? 0xff : (a + b) (uint8) SIMD_IWRAPPER_2(max_epi32); // return (a > b) ? a : b (int32) SIMD_IWRAPPER_2(max_epu32); // return (a > b) ? a : b (uint32) SIMD_IWRAPPER_2(min_epi32); // return (a < b) ? a : b (int32) @@ -207,178 +201,168 @@ SIMD_IWRAPPER_2(or_si); // return a | b (int) SIMD_WRAPPER_2(xor_ps); // return a ^ b (float treated as int) SIMD_IWRAPPER_2(xor_si); // return a ^ b (int) - //----------------------------------------------------------------------- // Shift operations //----------------------------------------------------------------------- -template<int ImmT> -static SIMDINLINE Integer SIMDCALL slli_epi32(Integer const &a) // return a << ImmT +template <int ImmT> +static SIMDINLINE Integer SIMDCALL slli_epi32(Integer const& a) // return a << ImmT { - return Integer - { + return Integer{ SIMD256T::template slli_epi32<ImmT>(a.v8[0]), SIMD256T::template slli_epi32<ImmT>(a.v8[1]), }; } -SIMD_IWRAPPER_2(sllv_epi32); // return a << b (uint32) +SIMD_IWRAPPER_2(sllv_epi32); // return a << b (uint32) -template<int ImmT> -static SIMDINLINE Integer SIMDCALL srai_epi32(Integer const &a) // return a >> ImmT (int32) +template <int ImmT> +static SIMDINLINE Integer SIMDCALL srai_epi32(Integer const& a) // return a >> ImmT (int32) { - return Integer - { + return Integer{ SIMD256T::template srai_epi32<ImmT>(a.v8[0]), SIMD256T::template srai_epi32<ImmT>(a.v8[1]), }; } -template<int ImmT> -static SIMDINLINE Integer SIMDCALL srli_epi32(Integer const &a) // return a >> ImmT (uint32) +template <int ImmT> +static SIMDINLINE Integer SIMDCALL srli_epi32(Integer const& a) // return a >> ImmT (uint32) { - return Integer - { + return Integer{ SIMD256T::template srli_epi32<ImmT>(a.v8[0]), SIMD256T::template srli_epi32<ImmT>(a.v8[1]), }; } -template<int ImmT> // for each 128-bit lane: -static SIMDINLINE Integer SIMDCALL srli_si(Integer const &a) // return a >> (ImmT*8) (uint) +template <int ImmT> // for each 128-bit lane: +static SIMDINLINE Integer SIMDCALL srli_si(Integer const& a) // return a >> (ImmT*8) (uint) { - return Integer - { + return Integer{ SIMD256T::template srli_si<ImmT>(a.v8[0]), SIMD256T::template srli_si<ImmT>(a.v8[1]), }; } -template<int ImmT> -static SIMDINLINE Float SIMDCALL srlisi_ps(Float const &a) // same as srli_si, but with Float cast to int +template <int ImmT> +static SIMDINLINE Float SIMDCALL + srlisi_ps(Float const& a) // same as srli_si, but with Float cast to int { - return Float - { + return Float{ SIMD256T::template srlisi_ps<ImmT>(a.v8[0]), SIMD256T::template srlisi_ps<ImmT>(a.v8[1]), }; } -SIMD_IWRAPPER_2(srlv_epi32); // return a >> b (uint32) +SIMD_IWRAPPER_2(srlv_epi32); // return a >> b (uint32) //----------------------------------------------------------------------- // Conversion operations //----------------------------------------------------------------------- -static SIMDINLINE Float SIMDCALL castpd_ps(Double const &a) // return *(Float*)(&a) +static SIMDINLINE Float SIMDCALL castpd_ps(Double const& a) // return *(Float*)(&a) { - return Float - { + return Float{ SIMD256T::castpd_ps(a.v8[0]), SIMD256T::castpd_ps(a.v8[1]), }; } -static SIMDINLINE Integer SIMDCALL castps_si(Float const &a) // return *(Integer*)(&a) +static SIMDINLINE Integer SIMDCALL castps_si(Float const& a) // return *(Integer*)(&a) { - return Integer - { + return Integer{ SIMD256T::castps_si(a.v8[0]), SIMD256T::castps_si(a.v8[1]), }; } -static SIMDINLINE Double SIMDCALL castsi_pd(Integer const &a) // return *(Double*)(&a) +static SIMDINLINE Double SIMDCALL castsi_pd(Integer const& a) // return *(Double*)(&a) { - return Double - { + return Double{ SIMD256T::castsi_pd(a.v8[0]), SIMD256T::castsi_pd(a.v8[1]), }; } -static SIMDINLINE Double SIMDCALL castps_pd(Float const &a) // return *(Double*)(&a) +static SIMDINLINE Double SIMDCALL castps_pd(Float const& a) // return *(Double*)(&a) { - return Double - { + return Double{ SIMD256T::castps_pd(a.v8[0]), SIMD256T::castps_pd(a.v8[1]), }; } -static SIMDINLINE Float SIMDCALL castsi_ps(Integer const &a) // return *(Float*)(&a) +static SIMDINLINE Float SIMDCALL castsi_ps(Integer const& a) // return *(Float*)(&a) { - return Float - { + return Float{ SIMD256T::castsi_ps(a.v8[0]), SIMD256T::castsi_ps(a.v8[1]), }; } -static SIMDINLINE Float SIMDCALL cvtepi32_ps(Integer const &a) // return (float)a (int32 --> float) +static SIMDINLINE Float SIMDCALL + cvtepi32_ps(Integer const& a) // return (float)a (int32 --> float) { - return Float - { + return Float{ SIMD256T::cvtepi32_ps(a.v8[0]), SIMD256T::cvtepi32_ps(a.v8[1]), }; } -static SIMDINLINE Integer SIMDCALL cvtepu8_epi16(SIMD256Impl::Integer const &a) // return (int16)a (uint8 --> int16) +static SIMDINLINE Integer SIMDCALL + cvtepu8_epi16(SIMD256Impl::Integer const& a) // return (int16)a (uint8 --> int16) { - return Integer - { + return Integer{ SIMD256T::cvtepu8_epi16(a.v4[0]), SIMD256T::cvtepu8_epi16(a.v4[1]), }; } -static SIMDINLINE Integer SIMDCALL cvtepu8_epi32(SIMD256Impl::Integer const &a) // return (int32)a (uint8 --> int32) +static SIMDINLINE Integer SIMDCALL + cvtepu8_epi32(SIMD256Impl::Integer const& a) // return (int32)a (uint8 --> int32) { - return Integer - { + return Integer{ SIMD256T::cvtepu8_epi32(a.v4[0]), SIMD256T::cvtepu8_epi32(SIMD128T::template srli_si<8>(a.v4[0])), - }; + }; } -static SIMDINLINE Integer SIMDCALL cvtepu16_epi32(SIMD256Impl::Integer const &a) // return (int32)a (uint16 --> int32) +static SIMDINLINE Integer SIMDCALL + cvtepu16_epi32(SIMD256Impl::Integer const& a) // return (int32)a (uint16 --> int32) { - return Integer - { + return Integer{ SIMD256T::cvtepu16_epi32(a.v4[0]), SIMD256T::cvtepu16_epi32(a.v4[1]), }; } -static SIMDINLINE Integer SIMDCALL cvtepu16_epi64(SIMD256Impl::Integer const &a) // return (int64)a (uint16 --> int64) +static SIMDINLINE Integer SIMDCALL + cvtepu16_epi64(SIMD256Impl::Integer const& a) // return (int64)a (uint16 --> int64) { - return Integer - { + return Integer{ SIMD256T::cvtepu16_epi64(a.v4[0]), SIMD256T::cvtepu16_epi64(SIMD128T::template srli_si<8>(a.v4[0])), }; } -static SIMDINLINE Integer SIMDCALL cvtepu32_epi64(SIMD256Impl::Integer const &a) // return (int64)a (uint32 --> int64) +static SIMDINLINE Integer SIMDCALL + cvtepu32_epi64(SIMD256Impl::Integer const& a) // return (int64)a (uint32 --> int64) { - return Integer - { + return Integer{ SIMD256T::cvtepu32_epi64(a.v4[0]), SIMD256T::cvtepu32_epi64(a.v4[1]), }; } -static SIMDINLINE Integer SIMDCALL cvtps_epi32(Float const &a) // return (int32)a (float --> int32) +static SIMDINLINE Integer SIMDCALL + cvtps_epi32(Float const& a) // return (int32)a (float --> int32) { - return Integer - { + return Integer{ SIMD256T::cvtps_epi32(a.v8[0]), SIMD256T::cvtps_epi32(a.v8[1]), }; } -static SIMDINLINE Integer SIMDCALL cvttps_epi32(Float const &a) // return (int32)a (rnd_to_zero(float) --> int32) +static SIMDINLINE Integer SIMDCALL + cvttps_epi32(Float const& a) // return (int32)a (rnd_to_zero(float) --> int32) { - return Integer - { + return Integer{ SIMD256T::cvtps_epi32(a.v8[0]), SIMD256T::cvtps_epi32(a.v8[1]), }; @@ -387,126 +371,144 @@ static SIMDINLINE Integer SIMDCALL cvttps_epi32(Float const &a) // ret //----------------------------------------------------------------------- // Comparison operations //----------------------------------------------------------------------- -template<CompareType CmpTypeT> -static SIMDINLINE Float SIMDCALL cmp_ps(Float const &a, Float const &b) // return a (CmpTypeT) b +template <CompareType CmpTypeT> +static SIMDINLINE Float SIMDCALL cmp_ps(Float const& a, Float const& b) // return a (CmpTypeT) b { - return Float - { + return Float{ SIMD256T::template cmp_ps<CmpTypeT>(a.v8[0], b.v8[0]), SIMD256T::template cmp_ps<CmpTypeT>(a.v8[1], b.v8[1]), }; } -static SIMDINLINE Float SIMDCALL cmplt_ps(Float const &a, Float const &b) { return cmp_ps<CompareType::LT_OQ>(a, b); } -static SIMDINLINE Float SIMDCALL cmpgt_ps(Float const &a, Float const &b) { return cmp_ps<CompareType::GT_OQ>(a, b); } -static SIMDINLINE Float SIMDCALL cmpneq_ps(Float const &a, Float const &b) { return cmp_ps<CompareType::NEQ_OQ>(a, b); } -static SIMDINLINE Float SIMDCALL cmpeq_ps(Float const &a, Float const &b) { return cmp_ps<CompareType::EQ_OQ>(a, b); } -static SIMDINLINE Float SIMDCALL cmpge_ps(Float const &a, Float const &b) { return cmp_ps<CompareType::GE_OQ>(a, b); } -static SIMDINLINE Float SIMDCALL cmple_ps(Float const &a, Float const &b) { return cmp_ps<CompareType::LE_OQ>(a, b); } +static SIMDINLINE Float SIMDCALL cmplt_ps(Float const& a, Float const& b) +{ + return cmp_ps<CompareType::LT_OQ>(a, b); +} +static SIMDINLINE Float SIMDCALL cmpgt_ps(Float const& a, Float const& b) +{ + return cmp_ps<CompareType::GT_OQ>(a, b); +} +static SIMDINLINE Float SIMDCALL cmpneq_ps(Float const& a, Float const& b) +{ + return cmp_ps<CompareType::NEQ_OQ>(a, b); +} +static SIMDINLINE Float SIMDCALL cmpeq_ps(Float const& a, Float const& b) +{ + return cmp_ps<CompareType::EQ_OQ>(a, b); +} +static SIMDINLINE Float SIMDCALL cmpge_ps(Float const& a, Float const& b) +{ + return cmp_ps<CompareType::GE_OQ>(a, b); +} +static SIMDINLINE Float SIMDCALL cmple_ps(Float const& a, Float const& b) +{ + return cmp_ps<CompareType::LE_OQ>(a, b); +} -template<CompareType CmpTypeT> -static SIMDINLINE Mask SIMDCALL cmp_ps_mask(Float const &a, Float const &b) +template <CompareType CmpTypeT> +static SIMDINLINE Mask SIMDCALL cmp_ps_mask(Float const& a, Float const& b) { return static_cast<Mask>(movemask_ps(cmp_ps<CmpTypeT>(a, b))); } +SIMD_IWRAPPER_2(cmpeq_epi8); // return a == b (int8) +SIMD_IWRAPPER_2(cmpeq_epi16); // return a == b (int16) +SIMD_IWRAPPER_2(cmpeq_epi32); // return a == b (int32) +SIMD_IWRAPPER_2(cmpeq_epi64); // return a == b (int64) +SIMD_IWRAPPER_2(cmpgt_epi8); // return a > b (int8) +SIMD_IWRAPPER_2(cmpgt_epi16); // return a > b (int16) +SIMD_IWRAPPER_2(cmpgt_epi32); // return a > b (int32) +SIMD_IWRAPPER_2(cmpgt_epi64); // return a > b (int64) +SIMD_IWRAPPER_2(cmplt_epi32); // return a < b (int32) -SIMD_IWRAPPER_2(cmpeq_epi8); // return a == b (int8) -SIMD_IWRAPPER_2(cmpeq_epi16); // return a == b (int16) -SIMD_IWRAPPER_2(cmpeq_epi32); // return a == b (int32) -SIMD_IWRAPPER_2(cmpeq_epi64); // return a == b (int64) -SIMD_IWRAPPER_2(cmpgt_epi8); // return a > b (int8) -SIMD_IWRAPPER_2(cmpgt_epi16); // return a > b (int16) -SIMD_IWRAPPER_2(cmpgt_epi32); // return a > b (int32) -SIMD_IWRAPPER_2(cmpgt_epi64); // return a > b (int64) -SIMD_IWRAPPER_2(cmplt_epi32); // return a < b (int32) - -static SIMDINLINE bool SIMDCALL testz_ps(Float const &a, Float const &b) // return all_lanes_zero(a & b) ? 1 : 0 (float) +static SIMDINLINE bool SIMDCALL + testz_ps(Float const& a, Float const& b) // return all_lanes_zero(a & b) ? 1 : 0 (float) { - return 0 != (SIMD256T::testz_ps(a.v8[0], b.v8[0]) & - SIMD256T::testz_ps(a.v8[1], b.v8[1])); + return 0 != (SIMD256T::testz_ps(a.v8[0], b.v8[0]) & SIMD256T::testz_ps(a.v8[1], b.v8[1])); } -static SIMDINLINE bool SIMDCALL testz_si(Integer const &a, Integer const &b) // return all_lanes_zero(a & b) ? 1 : 0 (int) +static SIMDINLINE bool SIMDCALL + testz_si(Integer const& a, Integer const& b) // return all_lanes_zero(a & b) ? 1 : 0 (int) { - return 0 != (SIMD256T::testz_si(a.v8[0], b.v8[0]) & - SIMD256T::testz_si(a.v8[1], b.v8[1])); + return 0 != (SIMD256T::testz_si(a.v8[0], b.v8[0]) & SIMD256T::testz_si(a.v8[1], b.v8[1])); } //----------------------------------------------------------------------- // Blend / shuffle / permute operations //----------------------------------------------------------------------- -SIMD_WRAPPER_2I(blend_ps); // return ImmT ? b : a (float) -SIMD_IWRAPPER_2I(blend_epi32); // return ImmT ? b : a (int32) -SIMD_WRAPPER_3(blendv_ps); // return mask ? b : a (float) -static SIMDINLINE Integer SIMDCALL blendv_epi32(Integer const &a, Integer const &b, Float const &mask) // return mask ? b : a (int) -{ - return Integer - { +SIMD_WRAPPER_2I(blend_ps); // return ImmT ? b : a (float) +SIMD_IWRAPPER_2I(blend_epi32); // return ImmT ? b : a (int32) +SIMD_WRAPPER_3(blendv_ps); // return mask ? b : a (float) +static SIMDINLINE Integer SIMDCALL blendv_epi32(Integer const& a, + Integer const& b, + Float const& mask) // return mask ? b : a (int) +{ + return Integer{ SIMD256T::blendv_epi32(a.v8[0], b.v8[0], mask.v8[0]), SIMD256T::blendv_epi32(a.v8[1], b.v8[1], mask.v8[1]), }; } -static SIMDINLINE Integer SIMDCALL blendv_epi32(Integer const &a, Integer const &b, Integer const &mask) // return mask ? b : a (int) +static SIMDINLINE Integer SIMDCALL blendv_epi32(Integer const& a, + Integer const& b, + Integer const& mask) // return mask ? b : a (int) { - return Integer - { + return Integer{ SIMD256T::blendv_epi32(a.v8[0], b.v8[0], mask.v8[0]), SIMD256T::blendv_epi32(a.v8[1], b.v8[1], mask.v8[1]), }; } -static SIMDINLINE Float SIMDCALL broadcast_ss(float const *p) // return *p (all elements in vector get same value) +static SIMDINLINE Float SIMDCALL + broadcast_ss(float const* p) // return *p (all elements in vector get same value) { float f = *p; - return Float - { + return Float{ SIMD256T::set1_ps(f), SIMD256T::set1_ps(f), }; } -template<int imm> -static SIMDINLINE SIMD256Impl::Float SIMDCALL extract_ps(Float const &a) +template <int imm> +static SIMDINLINE SIMD256Impl::Float SIMDCALL extract_ps(Float const& a) { SWR_ASSERT(imm == 0 || imm == 1, "Invalid control code: %d", imm); return a.v8[imm]; } -template<int imm> -static SIMDINLINE SIMD256Impl::Double SIMDCALL extract_pd(Double const &a) +template <int imm> +static SIMDINLINE SIMD256Impl::Double SIMDCALL extract_pd(Double const& a) { SWR_ASSERT(imm == 0 || imm == 1, "Invalid control code: %d", imm); return a.v8[imm]; } -template<int imm> -static SIMDINLINE SIMD256Impl::Integer SIMDCALL extract_si(Integer const &a) +template <int imm> +static SIMDINLINE SIMD256Impl::Integer SIMDCALL extract_si(Integer const& a) { SWR_ASSERT(imm == 0 || imm == 1, "Invalid control code: %d", imm); return a.v8[imm]; } -template<int imm> -static SIMDINLINE Float SIMDCALL insert_ps(Float const &a, SIMD256Impl::Float const &b) +template <int imm> +static SIMDINLINE Float SIMDCALL insert_ps(Float const& a, SIMD256Impl::Float const& b) { SWR_ASSERT(imm == 0 || imm == 1, "Invalid control code: %d", imm); - Float r = a; + Float r = a; r.v8[imm] = b; return r; } -template<int imm> -static SIMDINLINE Double SIMDCALL insert_pd(Double const &a, SIMD256Impl::Double const &b) +template <int imm> +static SIMDINLINE Double SIMDCALL insert_pd(Double const& a, SIMD256Impl::Double const& b) { SWR_ASSERT(imm == 0 || imm == 1, "Invalid control code: %d", imm); - Double r = a; + Double r = a; r.v8[imm] = b; return r; } -template<int imm> -static SIMDINLINE Integer SIMDCALL insert_si(Integer const &a, SIMD256Impl::Integer const &b) +template <int imm> +static SIMDINLINE Integer SIMDCALL insert_si(Integer const& a, SIMD256Impl::Integer const& b) { SWR_ASSERT(imm == 0 || imm == 1, "Invalid control code: %d", imm); Integer r = a; @@ -514,27 +516,28 @@ static SIMDINLINE Integer SIMDCALL insert_si(Integer const &a, SIMD256Impl::Inte return r; } -SIMD_IWRAPPER_2(packs_epi16); // See documentation for _mm256_packs_epi16 and _mm512_packs_epi16 -SIMD_IWRAPPER_2(packs_epi32); // See documentation for _mm256_packs_epi32 and _mm512_packs_epi32 -SIMD_IWRAPPER_2(packus_epi16); // See documentation for _mm256_packus_epi16 and _mm512_packus_epi16 -SIMD_IWRAPPER_2(packus_epi32); // See documentation for _mm256_packus_epi32 and _mm512_packus_epi32 +SIMD_IWRAPPER_2(packs_epi16); // See documentation for _mm256_packs_epi16 and _mm512_packs_epi16 +SIMD_IWRAPPER_2(packs_epi32); // See documentation for _mm256_packs_epi32 and _mm512_packs_epi32 +SIMD_IWRAPPER_2(packus_epi16); // See documentation for _mm256_packus_epi16 and _mm512_packus_epi16 +SIMD_IWRAPPER_2(packus_epi32); // See documentation for _mm256_packus_epi32 and _mm512_packus_epi32 -template<int ImmT> -static SIMDINLINE Float SIMDCALL permute_ps(Float const &a) +template <int ImmT> +static SIMDINLINE Float SIMDCALL permute_ps(Float const& a) { - return Float - { + return Float{ SIMD256T::template permute_ps<ImmT>(a.v8[0]), SIMD256T::template permute_ps<ImmT>(a.v8[1]), }; } -static SIMDINLINE Integer SIMDCALL permute_epi32(Integer const &a, Integer const &swiz) // return a[swiz[i]] for each 32-bit lane i (int32) +static SIMDINLINE Integer SIMDCALL permute_epi32( + Integer const& a, Integer const& swiz) // return a[swiz[i]] for each 32-bit lane i (int32) { return castps_si(permute_ps(castsi_ps(a), swiz)); } -static SIMDINLINE Float SIMDCALL permute_ps(Float const &a, Integer const &swiz) // return a[swiz[i]] for each 32-bit lane i (float) +static SIMDINLINE Float SIMDCALL + permute_ps(Float const& a, Integer const& swiz) // return a[swiz[i]] for each 32-bit lane i (float) { const auto mask = SIMD256T::set1_epi32(7); @@ -544,10 +547,11 @@ static SIMDINLINE Float SIMDCALL permute_ps(Float const &a, Integer const &swiz) auto hilo = SIMD256T::permute_ps(a.v8[0], SIMD256T::and_si(swiz.v8[1], mask)); auto hihi = SIMD256T::permute_ps(a.v8[1], SIMD256T::and_si(swiz.v8[1], mask)); - return Float - { - SIMD256T::blendv_ps(lolo, lohi, SIMD256T::castsi_ps(SIMD256T::cmpgt_epi32(swiz.v8[0], mask))), - SIMD256T::blendv_ps(hilo, hihi, SIMD256T::castsi_ps(SIMD256T::cmpgt_epi32(swiz.v8[1], mask))), + return Float{ + SIMD256T::blendv_ps( + lolo, lohi, SIMD256T::castsi_ps(SIMD256T::cmpgt_epi32(swiz.v8[0], mask))), + SIMD256T::blendv_ps( + hilo, hihi, SIMD256T::castsi_ps(SIMD256T::cmpgt_epi32(swiz.v8[1], mask))), }; } @@ -562,7 +566,7 @@ static SIMDINLINE Float SIMDCALL permute_ps(Float const &a, Integer const &swiz) // ESAC // RETURN tmp[127:0] // } -// +// // dst[127:0] : = SELECT4(a[511:0], imm8[1:0]) // dst[255:128] : = SELECT4(a[511:0], imm8[3:2]) // dst[383:256] : = SELECT4(b[511:0], imm8[5:4]) @@ -574,32 +578,35 @@ static SIMDINLINE Float SIMDCALL permute_ps(Float const &a, Integer const &swiz) // AVX instructions for emulation. // template <int shuf> -static SIMDINLINE Float SIMDCALL permute2f128_ps(Float const &a, Float const &b) +static SIMDINLINE Float SIMDCALL permute2f128_ps(Float const& a, Float const& b) { - return Float - { - SIMD256T::template permute2f128_ps<((shuf & 0x03) << 0) | ((shuf & 0x0C) << 2)>(a.v8[0], a.v8[1]), - SIMD256T::template permute2f128_ps<((shuf & 0x30) >> 4) | ((shuf & 0xC0) >> 2)>(b.v8[0], b.v8[1]), + return Float{ + SIMD256T::template permute2f128_ps<((shuf & 0x03) << 0) | ((shuf & 0x0C) << 2)>(a.v8[0], + a.v8[1]), + SIMD256T::template permute2f128_ps<((shuf & 0x30) >> 4) | ((shuf & 0xC0) >> 2)>(b.v8[0], + b.v8[1]), }; } template <int shuf> -static SIMDINLINE Double SIMDCALL permute2f128_pd(Double const &a, Double const &b) +static SIMDINLINE Double SIMDCALL permute2f128_pd(Double const& a, Double const& b) { - return Double - { - SIMD256T::template permute2f128_pd<((shuf & 0x03) << 0) | ((shuf & 0x0C) << 2)>(a.v8[0], a.v8[1]), - SIMD256T::template permute2f128_pd<((shuf & 0x30) >> 4) | ((shuf & 0xC0) >> 2)>(b.v8[0], b.v8[1]), + return Double{ + SIMD256T::template permute2f128_pd<((shuf & 0x03) << 0) | ((shuf & 0x0C) << 2)>(a.v8[0], + a.v8[1]), + SIMD256T::template permute2f128_pd<((shuf & 0x30) >> 4) | ((shuf & 0xC0) >> 2)>(b.v8[0], + b.v8[1]), }; } template <int shuf> -static SIMDINLINE Integer SIMDCALL permute2f128_si(Integer const &a, Integer const &b) +static SIMDINLINE Integer SIMDCALL permute2f128_si(Integer const& a, Integer const& b) { - return Integer - { - SIMD256T::template permute2f128_si<((shuf & 0x03) << 0) | ((shuf & 0x0C) << 2)>(a.v8[0], a.v8[1]), - SIMD256T::template permute2f128_si<((shuf & 0x30) >> 4) | ((shuf & 0xC0) >> 2)>(b.v8[0], b.v8[1]), + return Integer{ + SIMD256T::template permute2f128_si<((shuf & 0x03) << 0) | ((shuf & 0x0C) << 2)>(a.v8[0], + a.v8[1]), + SIMD256T::template permute2f128_si<((shuf & 0x30) >> 4) | ((shuf & 0xC0) >> 2)>(b.v8[0], + b.v8[1]), }; } @@ -624,209 +631,193 @@ SIMD_WRAPPER_2(unpacklo_ps); //----------------------------------------------------------------------- // Load / store operations //----------------------------------------------------------------------- -template<ScaleFactor ScaleT> -static SIMDINLINE Float SIMDCALL i32gather_ps(float const* p, Integer const &idx) // return *(float*)(((int8*)p) + (idx * ScaleT)) +template <ScaleFactor ScaleT> +static SIMDINLINE Float SIMDCALL + i32gather_ps(float const* p, Integer const& idx) // return *(float*)(((int8*)p) + (idx * ScaleT)) { - return Float - { + return Float{ SIMD256T::template i32gather_ps<ScaleT>(p, idx.v8[0]), SIMD256T::template i32gather_ps<ScaleT>(p, idx.v8[1]), }; } -static SIMDINLINE Float SIMDCALL load1_ps(float const *p) // return *p (broadcast 1 value to all elements) +static SIMDINLINE Float SIMDCALL + load1_ps(float const* p) // return *p (broadcast 1 value to all elements) { return broadcast_ss(p); } -static SIMDINLINE Float SIMDCALL load_ps(float const *p) // return *p (loads SIMD width elements from memory) +static SIMDINLINE Float SIMDCALL + load_ps(float const* p) // return *p (loads SIMD width elements from memory) { - return Float - { - SIMD256T::load_ps(p), - SIMD256T::load_ps(p + TARGET_SIMD_WIDTH) - }; + return Float{SIMD256T::load_ps(p), SIMD256T::load_ps(p + TARGET_SIMD_WIDTH)}; } -static SIMDINLINE Integer SIMDCALL load_si(Integer const *p) // return *p +static SIMDINLINE Integer SIMDCALL load_si(Integer const* p) // return *p { - return Integer - { + return Integer{ SIMD256T::load_si(&p->v8[0]), SIMD256T::load_si(&p->v8[1]), }; } -static SIMDINLINE Float SIMDCALL loadu_ps(float const *p) // return *p (same as load_ps but allows for unaligned mem) +static SIMDINLINE Float SIMDCALL + loadu_ps(float const* p) // return *p (same as load_ps but allows for unaligned mem) { - return Float - { - SIMD256T::loadu_ps(p), - SIMD256T::loadu_ps(p + TARGET_SIMD_WIDTH) - }; + return Float{SIMD256T::loadu_ps(p), SIMD256T::loadu_ps(p + TARGET_SIMD_WIDTH)}; } -static SIMDINLINE Integer SIMDCALL loadu_si(Integer const *p) // return *p (same as load_si but allows for unaligned mem) +static SIMDINLINE Integer SIMDCALL + loadu_si(Integer const* p) // return *p (same as load_si but allows for unaligned mem) { - return Integer - { + return Integer{ SIMD256T::loadu_si(&p->v8[0]), SIMD256T::loadu_si(&p->v8[1]), }; } // for each element: (mask & (1 << 31)) ? (i32gather_ps<ScaleT>(p, idx), mask = 0) : old -template<ScaleFactor ScaleT> -static SIMDINLINE Float SIMDCALL mask_i32gather_ps(Float const &old, float const* p, Integer const &idx, Float const &mask) +template <ScaleFactor ScaleT> +static SIMDINLINE Float SIMDCALL + mask_i32gather_ps(Float const& old, float const* p, Integer const& idx, Float const& mask) { - return Float - { + return Float{ SIMD256T::template mask_i32gather_ps<ScaleT>(old.v8[0], p, idx.v8[0], mask.v8[0]), SIMD256T::template mask_i32gather_ps<ScaleT>(old.v8[1], p, idx.v8[1], mask.v8[1]), }; } -static SIMDINLINE void SIMDCALL maskstore_ps(float *p, Integer const &mask, Float const &src) +static SIMDINLINE void SIMDCALL maskstore_ps(float* p, Integer const& mask, Float const& src) { SIMD256T::maskstore_ps(p, mask.v8[0], src.v8[0]); SIMD256T::maskstore_ps(p + TARGET_SIMD_WIDTH, mask.v8[1], src.v8[1]); } -static SIMDINLINE uint64_t SIMDCALL movemask_epi8(Integer const &a) +static SIMDINLINE uint64_t SIMDCALL movemask_epi8(Integer const& a) { uint64_t mask = static_cast<uint64_t>(SIMD256T::movemask_epi8(a.v8[0])); - mask |= static_cast<uint64_t>(SIMD256T::movemask_epi8(a.v8[1])) << (TARGET_SIMD_WIDTH * 4); + mask |= static_cast<uint64_t>(SIMD256T::movemask_epi8(a.v8[1])) << (TARGET_SIMD_WIDTH * 4); return mask; } -static SIMDINLINE uint32_t SIMDCALL movemask_pd(Double const &a) +static SIMDINLINE uint32_t SIMDCALL movemask_pd(Double const& a) { uint32_t mask = static_cast<uint32_t>(SIMD256T::movemask_pd(a.v8[0])); - mask |= static_cast<uint32_t>(SIMD256T::movemask_pd(a.v8[1])) << (TARGET_SIMD_WIDTH / 2); + mask |= static_cast<uint32_t>(SIMD256T::movemask_pd(a.v8[1])) << (TARGET_SIMD_WIDTH / 2); return mask; } -static SIMDINLINE uint32_t SIMDCALL movemask_ps(Float const &a) +static SIMDINLINE uint32_t SIMDCALL movemask_ps(Float const& a) { uint32_t mask = static_cast<uint32_t>(SIMD256T::movemask_ps(a.v8[0])); - mask |= static_cast<uint32_t>(SIMD256T::movemask_ps(a.v8[1])) << TARGET_SIMD_WIDTH; + mask |= static_cast<uint32_t>(SIMD256T::movemask_ps(a.v8[1])) << TARGET_SIMD_WIDTH; return mask; } static SIMDINLINE Integer SIMDCALL set1_epi32(int i) // return i (all elements are same value) { - return Integer - { - SIMD256T::set1_epi32(i), - SIMD256T::set1_epi32(i) - }; + return Integer{SIMD256T::set1_epi32(i), SIMD256T::set1_epi32(i)}; } static SIMDINLINE Integer SIMDCALL set1_epi8(char i) // return i (all elements are same value) { - return Integer - { - SIMD256T::set1_epi8(i), - SIMD256T::set1_epi8(i) - }; + return Integer{SIMD256T::set1_epi8(i), SIMD256T::set1_epi8(i)}; } -static SIMDINLINE Float SIMDCALL set1_ps(float f) // return f (all elements are same value) +static SIMDINLINE Float SIMDCALL set1_ps(float f) // return f (all elements are same value) { - return Float - { - SIMD256T::set1_ps(f), - SIMD256T::set1_ps(f) - }; + return Float{SIMD256T::set1_ps(f), SIMD256T::set1_ps(f)}; } -static SIMDINLINE Float SIMDCALL setzero_ps() // return 0 (float) +static SIMDINLINE Float SIMDCALL setzero_ps() // return 0 (float) { - return Float - { - SIMD256T::setzero_ps(), - SIMD256T::setzero_ps() - }; + return Float{SIMD256T::setzero_ps(), SIMD256T::setzero_ps()}; } -static SIMDINLINE Integer SIMDCALL setzero_si() // return 0 (integer) +static SIMDINLINE Integer SIMDCALL setzero_si() // return 0 (integer) { - return Integer - { - SIMD256T::setzero_si(), - SIMD256T::setzero_si() - }; + return Integer{SIMD256T::setzero_si(), SIMD256T::setzero_si()}; } -static SIMDINLINE void SIMDCALL store_ps(float *p, Float const &a) // *p = a (stores all elements contiguously in memory) +static SIMDINLINE void SIMDCALL + store_ps(float* p, Float const& a) // *p = a (stores all elements contiguously in memory) { SIMD256T::store_ps(p, a.v8[0]); SIMD256T::store_ps(p + TARGET_SIMD_WIDTH, a.v8[1]); } -static SIMDINLINE void SIMDCALL store_si(Integer *p, Integer const &a) // *p = a +static SIMDINLINE void SIMDCALL store_si(Integer* p, Integer const& a) // *p = a { SIMD256T::store_si(&p->v8[0], a.v8[0]); SIMD256T::store_si(&p->v8[1], a.v8[1]); } -static SIMDINLINE void SIMDCALL stream_ps(float *p, Float const &a) // *p = a (same as store_ps, but doesn't keep memory in cache) +static SIMDINLINE void SIMDCALL + stream_ps(float* p, Float const& a) // *p = a (same as store_ps, but doesn't keep memory in cache) { SIMD256T::stream_ps(p, a.v8[0]); SIMD256T::stream_ps(p + TARGET_SIMD_WIDTH, a.v8[1]); } -static SIMDINLINE Integer SIMDCALL set_epi32( - int i15, int i14, int i13, int i12, int i11, int i10, int i9, int i8, - int i7, int i6, int i5, int i4, int i3, int i2, int i1, int i0) +static SIMDINLINE Integer SIMDCALL set_epi32(int i15, + int i14, + int i13, + int i12, + int i11, + int i10, + int i9, + int i8, + int i7, + int i6, + int i5, + int i4, + int i3, + int i2, + int i1, + int i0) { - return Integer - { - SIMD256T::set_epi32( - i7, i6, i5, i4, i3, i2, i1, i0), - SIMD256T::set_epi32( - i15, i14, i13, i12, i11, i10, i9, i8) - }; + return Integer{SIMD256T::set_epi32(i7, i6, i5, i4, i3, i2, i1, i0), + SIMD256T::set_epi32(i15, i14, i13, i12, i11, i10, i9, i8)}; } -static SIMDINLINE Integer SIMDCALL set_epi32( - int i7, int i6, int i5, int i4, int i3, int i2, int i1, int i0) +static SIMDINLINE Integer SIMDCALL + set_epi32(int i7, int i6, int i5, int i4, int i3, int i2, int i1, int i0) { - return set_epi32( - 0, 0, 0, 0, 0, 0, 0, 0, - i7, i6, i5, i4, i3, i2, i1, i0); + return set_epi32(0, 0, 0, 0, 0, 0, 0, 0, i7, i6, i5, i4, i3, i2, i1, i0); } -static SIMDINLINE Float SIMDCALL set_ps( - float i15, float i14, float i13, float i12, float i11, float i10, float i9, float i8, - float i7, float i6, float i5, float i4, float i3, float i2, float i1, float i0) +static SIMDINLINE Float SIMDCALL set_ps(float i15, + float i14, + float i13, + float i12, + float i11, + float i10, + float i9, + float i8, + float i7, + float i6, + float i5, + float i4, + float i3, + float i2, + float i1, + float i0) { - return Float - { - SIMD256T::set_ps( - i7, i6, i5, i4, i3, i2, i1, i0), - SIMD256T::set_ps( - i15, i14, i13, i12, i11, i10, i9, i8) - }; + return Float{SIMD256T::set_ps(i7, i6, i5, i4, i3, i2, i1, i0), + SIMD256T::set_ps(i15, i14, i13, i12, i11, i10, i9, i8)}; } -static SIMDINLINE Float SIMDCALL set_ps( - float i7, float i6, float i5, float i4, float i3, float i2, float i1, float i0) +static SIMDINLINE Float SIMDCALL + set_ps(float i7, float i6, float i5, float i4, float i3, float i2, float i1, float i0) { - return set_ps( - 0, 0, 0, 0, 0, 0, 0, 0, - i7, i6, i5, i4, i3, i2, i1, i0); + return set_ps(0, 0, 0, 0, 0, 0, 0, 0, i7, i6, i5, i4, i3, i2, i1, i0); } static SIMDINLINE Float SIMDCALL vmask_ps(int32_t mask) { - return Float - { - SIMD256T::vmask_ps(mask), - SIMD256T::vmask_ps(mask >> TARGET_SIMD_WIDTH) - }; + return Float{SIMD256T::vmask_ps(mask), SIMD256T::vmask_ps(mask >> TARGET_SIMD_WIDTH)}; } #undef SIMD_WRAPPER_1 diff --git a/src/gallium/drivers/swr/rasterizer/common/simdlib_512_emu_masks.inl b/src/gallium/drivers/swr/rasterizer/common/simdlib_512_emu_masks.inl index bc5bff477a4..473934824ee 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdlib_512_emu_masks.inl +++ b/src/gallium/drivers/swr/rasterizer/common/simdlib_512_emu_masks.inl @@ -1,28 +1,27 @@ /**************************************************************************** -* Copyright (C) 2017 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2017 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #if !defined(__SIMD_LIB_AVX_HPP__) #error Do not include this file directly, use "simdlib.hpp" instead. #endif // no backwards compatibility for simd mask-enabled functions - diff --git a/src/gallium/drivers/swr/rasterizer/common/simdlib_interface.hpp b/src/gallium/drivers/swr/rasterizer/common/simdlib_interface.hpp index df2df1b09cd..7902bcb2b64 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdlib_interface.hpp +++ b/src/gallium/drivers/swr/rasterizer/common/simdlib_interface.hpp @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2017 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2017 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #pragma once #if 0 //=========================================================================== diff --git a/src/gallium/drivers/swr/rasterizer/common/simdlib_types.hpp b/src/gallium/drivers/swr/rasterizer/common/simdlib_types.hpp index 0fad0e1fd8c..944c3c23fd3 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdlib_types.hpp +++ b/src/gallium/drivers/swr/rasterizer/common/simdlib_types.hpp @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2017 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2017 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #pragma once #if !defined(__cplusplus) @@ -30,9 +30,9 @@ #include <inttypes.h> #include <stdint.h> -#define SIMD_ARCH_AVX 0 -#define SIMD_ARCH_AVX2 1 -#define SIMD_ARCH_AVX512 2 +#define SIMD_ARCH_AVX 0 +#define SIMD_ARCH_AVX2 1 +#define SIMD_ARCH_AVX512 2 #if !defined(SIMD_ARCH) #define SIMD_ARCH SIMD_ARCH_AVX @@ -55,81 +55,81 @@ namespace SIMDImpl { enum class CompareType { - EQ_OQ = 0x00, // Equal (ordered, nonsignaling) - LT_OS = 0x01, // Less-than (ordered, signaling) - LE_OS = 0x02, // Less-than-or-equal (ordered, signaling) - UNORD_Q = 0x03, // Unordered (nonsignaling) - NEQ_UQ = 0x04, // Not-equal (unordered, nonsignaling) - NLT_US = 0x05, // Not-less-than (unordered, signaling) - NLE_US = 0x06, // Not-less-than-or-equal (unordered, signaling) - ORD_Q = 0x07, // Ordered (nonsignaling) - EQ_UQ = 0x08, // Equal (unordered, non-signaling) - NGE_US = 0x09, // Not-greater-than-or-equal (unordered, signaling) - NGT_US = 0x0A, // Not-greater-than (unordered, signaling) - FALSE_OQ = 0x0B, // False (ordered, nonsignaling) - NEQ_OQ = 0x0C, // Not-equal (ordered, non-signaling) - GE_OS = 0x0D, // Greater-than-or-equal (ordered, signaling) - GT_OS = 0x0E, // Greater-than (ordered, signaling) - TRUE_UQ = 0x0F, // True (unordered, non-signaling) - EQ_OS = 0x10, // Equal (ordered, signaling) - LT_OQ = 0x11, // Less-than (ordered, nonsignaling) - LE_OQ = 0x12, // Less-than-or-equal (ordered, nonsignaling) - UNORD_S = 0x13, // Unordered (signaling) - NEQ_US = 0x14, // Not-equal (unordered, signaling) - NLT_UQ = 0x15, // Not-less-than (unordered, nonsignaling) - NLE_UQ = 0x16, // Not-less-than-or-equal (unordered, nonsignaling) - ORD_S = 0x17, // Ordered (signaling) - EQ_US = 0x18, // Equal (unordered, signaling) - NGE_UQ = 0x19, // Not-greater-than-or-equal (unordered, nonsignaling) - NGT_UQ = 0x1A, // Not-greater-than (unordered, nonsignaling) - FALSE_OS = 0x1B, // False (ordered, signaling) - NEQ_OS = 0x1C, // Not-equal (ordered, signaling) - GE_OQ = 0x1D, // Greater-than-or-equal (ordered, nonsignaling) - GT_OQ = 0x1E, // Greater-than (ordered, nonsignaling) - TRUE_US = 0x1F, // True (unordered, signaling) + EQ_OQ = 0x00, // Equal (ordered, nonsignaling) + LT_OS = 0x01, // Less-than (ordered, signaling) + LE_OS = 0x02, // Less-than-or-equal (ordered, signaling) + UNORD_Q = 0x03, // Unordered (nonsignaling) + NEQ_UQ = 0x04, // Not-equal (unordered, nonsignaling) + NLT_US = 0x05, // Not-less-than (unordered, signaling) + NLE_US = 0x06, // Not-less-than-or-equal (unordered, signaling) + ORD_Q = 0x07, // Ordered (nonsignaling) + EQ_UQ = 0x08, // Equal (unordered, non-signaling) + NGE_US = 0x09, // Not-greater-than-or-equal (unordered, signaling) + NGT_US = 0x0A, // Not-greater-than (unordered, signaling) + FALSE_OQ = 0x0B, // False (ordered, nonsignaling) + NEQ_OQ = 0x0C, // Not-equal (ordered, non-signaling) + GE_OS = 0x0D, // Greater-than-or-equal (ordered, signaling) + GT_OS = 0x0E, // Greater-than (ordered, signaling) + TRUE_UQ = 0x0F, // True (unordered, non-signaling) + EQ_OS = 0x10, // Equal (ordered, signaling) + LT_OQ = 0x11, // Less-than (ordered, nonsignaling) + LE_OQ = 0x12, // Less-than-or-equal (ordered, nonsignaling) + UNORD_S = 0x13, // Unordered (signaling) + NEQ_US = 0x14, // Not-equal (unordered, signaling) + NLT_UQ = 0x15, // Not-less-than (unordered, nonsignaling) + NLE_UQ = 0x16, // Not-less-than-or-equal (unordered, nonsignaling) + ORD_S = 0x17, // Ordered (signaling) + EQ_US = 0x18, // Equal (unordered, signaling) + NGE_UQ = 0x19, // Not-greater-than-or-equal (unordered, nonsignaling) + NGT_UQ = 0x1A, // Not-greater-than (unordered, nonsignaling) + FALSE_OS = 0x1B, // False (ordered, signaling) + NEQ_OS = 0x1C, // Not-equal (ordered, signaling) + GE_OQ = 0x1D, // Greater-than-or-equal (ordered, nonsignaling) + GT_OQ = 0x1E, // Greater-than (ordered, nonsignaling) + TRUE_US = 0x1F, // True (unordered, signaling) }; #if SIMD_ARCH >= SIMD_ARCH_AVX512 enum class CompareTypeInt { - EQ = _MM_CMPINT_EQ, // Equal - LT = _MM_CMPINT_LT, // Less than - LE = _MM_CMPINT_LE, // Less than or Equal - NE = _MM_CMPINT_NE, // Not Equal - GE = _MM_CMPINT_GE, // Greater than or Equal - GT = _MM_CMPINT_GT, // Greater than + EQ = _MM_CMPINT_EQ, // Equal + LT = _MM_CMPINT_LT, // Less than + LE = _MM_CMPINT_LE, // Less than or Equal + NE = _MM_CMPINT_NE, // Not Equal + GE = _MM_CMPINT_GE, // Greater than or Equal + GT = _MM_CMPINT_GT, // Greater than }; #endif // SIMD_ARCH >= SIMD_ARCH_AVX512 enum class ScaleFactor { - SF_1 = 1, // No scaling - SF_2 = 2, // Scale offset by 2 - SF_4 = 4, // Scale offset by 4 - SF_8 = 8, // Scale offset by 8 + SF_1 = 1, // No scaling + SF_2 = 2, // Scale offset by 2 + SF_4 = 4, // Scale offset by 4 + SF_8 = 8, // Scale offset by 8 }; enum class RoundMode { - TO_NEAREST_INT = 0x00, // Round to nearest integer == TRUNCATE(value + 0.5) - TO_NEG_INF = 0x01, // Round to negative infinity - TO_POS_INF = 0x02, // Round to positive infinity - TO_ZERO = 0x03, // Round to 0 a.k.a. truncate - CUR_DIRECTION = 0x04, // Round in direction set in MXCSR register - - RAISE_EXC = 0x00, // Raise exception on overflow - NO_EXC = 0x08, // Suppress exceptions - - NINT = static_cast<int>(TO_NEAREST_INT) | static_cast<int>(RAISE_EXC), - NINT_NOEXC = static_cast<int>(TO_NEAREST_INT) | static_cast<int>(NO_EXC), - FLOOR = static_cast<int>(TO_NEG_INF) | static_cast<int>(RAISE_EXC), - FLOOR_NOEXC = static_cast<int>(TO_NEG_INF) | static_cast<int>(NO_EXC), - CEIL = static_cast<int>(TO_POS_INF) | static_cast<int>(RAISE_EXC), - CEIL_NOEXC = static_cast<int>(TO_POS_INF) | static_cast<int>(NO_EXC), - TRUNC = static_cast<int>(TO_ZERO) | static_cast<int>(RAISE_EXC), - TRUNC_NOEXC = static_cast<int>(TO_ZERO) | static_cast<int>(NO_EXC), - RINT = static_cast<int>(CUR_DIRECTION) | static_cast<int>(RAISE_EXC), - NEARBYINT = static_cast<int>(CUR_DIRECTION) | static_cast<int>(NO_EXC), + TO_NEAREST_INT = 0x00, // Round to nearest integer == TRUNCATE(value + 0.5) + TO_NEG_INF = 0x01, // Round to negative infinity + TO_POS_INF = 0x02, // Round to positive infinity + TO_ZERO = 0x03, // Round to 0 a.k.a. truncate + CUR_DIRECTION = 0x04, // Round in direction set in MXCSR register + + RAISE_EXC = 0x00, // Raise exception on overflow + NO_EXC = 0x08, // Suppress exceptions + + NINT = static_cast<int>(TO_NEAREST_INT) | static_cast<int>(RAISE_EXC), + NINT_NOEXC = static_cast<int>(TO_NEAREST_INT) | static_cast<int>(NO_EXC), + FLOOR = static_cast<int>(TO_NEG_INF) | static_cast<int>(RAISE_EXC), + FLOOR_NOEXC = static_cast<int>(TO_NEG_INF) | static_cast<int>(NO_EXC), + CEIL = static_cast<int>(TO_POS_INF) | static_cast<int>(RAISE_EXC), + CEIL_NOEXC = static_cast<int>(TO_POS_INF) | static_cast<int>(NO_EXC), + TRUNC = static_cast<int>(TO_ZERO) | static_cast<int>(RAISE_EXC), + TRUNC_NOEXC = static_cast<int>(TO_ZERO) | static_cast<int>(NO_EXC), + RINT = static_cast<int>(CUR_DIRECTION) | static_cast<int>(RAISE_EXC), + NEARBYINT = static_cast<int>(CUR_DIRECTION) | static_cast<int>(NO_EXC), }; struct Traits @@ -140,7 +140,7 @@ namespace SIMDImpl }; // Attribute, 4-dimensional attribute in SIMD SOA layout - template<typename Float, typename Integer, typename Double> + template <typename Float, typename Integer, typename Double> union Vec4 { Float v[4]; @@ -148,14 +148,14 @@ namespace SIMDImpl Double vd[4]; struct { - Float x; - Float y; - Float z; - Float w; + Float x; + Float y; + Float z; + Float w; }; - SIMDINLINE Float& SIMDCALL operator[] (const int i) { return v[i]; } - SIMDINLINE Float const & SIMDCALL operator[] (const int i) const { return v[i]; } - SIMDINLINE Vec4& SIMDCALL operator=(Vec4 const & in) + SIMDINLINE Float& SIMDCALL operator[](const int i) { return v[i]; } + SIMDINLINE Float const& SIMDCALL operator[](const int i) const { return v[i]; } + SIMDINLINE Vec4& SIMDCALL operator=(Vec4 const& in) { v[0] = in.v[0]; v[1] = in.v[1]; @@ -171,8 +171,16 @@ namespace SIMDImpl { SIMDINLINE Float() = default; SIMDINLINE Float(__m128 in) : v(in) {} - SIMDINLINE Float& SIMDCALL operator=(__m128 in) { v = in; return *this; } - SIMDINLINE Float& SIMDCALL operator=(Float const & in) { v = in.v; return *this; } + SIMDINLINE Float& SIMDCALL operator=(__m128 in) + { + v = in; + return *this; + } + SIMDINLINE Float& SIMDCALL operator=(Float const& in) + { + v = in.v; + return *this; + } SIMDINLINE SIMDCALL operator __m128() const { return v; } SIMDALIGN(__m128, 16) v; @@ -182,8 +190,16 @@ namespace SIMDImpl { SIMDINLINE Integer() = default; SIMDINLINE Integer(__m128i in) : v(in) {} - SIMDINLINE Integer& SIMDCALL operator=(__m128i in) { v = in; return *this; } - SIMDINLINE Integer& SIMDCALL operator=(Integer const & in) { v = in.v; return *this; } + SIMDINLINE Integer& SIMDCALL operator=(__m128i in) + { + v = in; + return *this; + } + SIMDINLINE Integer& SIMDCALL operator=(Integer const& in) + { + v = in.v; + return *this; + } SIMDINLINE SIMDCALL operator __m128i() const { return v; } SIMDALIGN(__m128i, 16) v; @@ -193,8 +209,16 @@ namespace SIMDImpl { SIMDINLINE Double() = default; SIMDINLINE Double(__m128d in) : v(in) {} - SIMDINLINE Double& SIMDCALL operator=(__m128d in) { v = in; return *this; } - SIMDINLINE Double& SIMDCALL operator=(Double const & in) { v = in.v; return *this; } + SIMDINLINE Double& SIMDCALL operator=(__m128d in) + { + v = in; + return *this; + } + SIMDINLINE Double& SIMDCALL operator=(Double const& in) + { + v = in.v; + return *this; + } SIMDINLINE SIMDCALL operator __m128d() const { return v; } SIMDALIGN(__m128d, 16) v; @@ -204,7 +228,7 @@ namespace SIMDImpl using Mask = uint8_t; static const uint32_t SIMD_WIDTH = 4; - } // ns SIMD128Impl + } // namespace SIMD128Impl namespace SIMD256Impl { @@ -212,12 +236,21 @@ namespace SIMDImpl { SIMDINLINE Float() = default; SIMDINLINE Float(__m256 in) : v(in) {} - SIMDINLINE Float(SIMD128Impl::Float const &in_lo, SIMD128Impl::Float const &in_hi = _mm_setzero_ps()) + SIMDINLINE Float(SIMD128Impl::Float const& in_lo, + SIMD128Impl::Float const& in_hi = _mm_setzero_ps()) { v = _mm256_insertf128_ps(_mm256_castps128_ps256(in_lo), in_hi, 0x1); } - SIMDINLINE Float& SIMDCALL operator=(__m256 in) { v = in; return *this; } - SIMDINLINE Float& SIMDCALL operator=(Float const & in) { v = in.v; return *this; } + SIMDINLINE Float& SIMDCALL operator=(__m256 in) + { + v = in; + return *this; + } + SIMDINLINE Float& SIMDCALL operator=(Float const& in) + { + v = in.v; + return *this; + } SIMDINLINE SIMDCALL operator __m256() const { return v; } SIMDALIGN(__m256, 32) v; @@ -228,12 +261,21 @@ namespace SIMDImpl { SIMDINLINE Integer() = default; SIMDINLINE Integer(__m256i in) : v(in) {} - SIMDINLINE Integer(SIMD128Impl::Integer const &in_lo, SIMD128Impl::Integer const &in_hi = _mm_setzero_si128()) + SIMDINLINE Integer(SIMD128Impl::Integer const& in_lo, + SIMD128Impl::Integer const& in_hi = _mm_setzero_si128()) { v = _mm256_insertf128_si256(_mm256_castsi128_si256(in_lo), in_hi, 0x1); } - SIMDINLINE Integer& SIMDCALL operator=(__m256i in) { v = in; return *this; } - SIMDINLINE Integer& SIMDCALL operator=(Integer const & in) { v = in.v; return *this; } + SIMDINLINE Integer& SIMDCALL operator=(__m256i in) + { + v = in; + return *this; + } + SIMDINLINE Integer& SIMDCALL operator=(Integer const& in) + { + v = in.v; + return *this; + } SIMDINLINE SIMDCALL operator __m256i() const { return v; } SIMDALIGN(__m256i, 32) v; @@ -243,13 +285,22 @@ namespace SIMDImpl union Double { SIMDINLINE Double() = default; - SIMDINLINE Double(__m256d const &in) : v(in) {} - SIMDINLINE Double(SIMD128Impl::Double const &in_lo, SIMD128Impl::Double const &in_hi = _mm_setzero_pd()) + SIMDINLINE Double(__m256d const& in) : v(in) {} + SIMDINLINE Double(SIMD128Impl::Double const& in_lo, + SIMD128Impl::Double const& in_hi = _mm_setzero_pd()) { v = _mm256_insertf128_pd(_mm256_castpd128_pd256(in_lo), in_hi, 0x1); } - SIMDINLINE Double& SIMDCALL operator=(__m256d in) { v = in; return *this; } - SIMDINLINE Double& SIMDCALL operator=(Double const & in) { v = in.v; return *this; } + SIMDINLINE Double& SIMDCALL operator=(__m256d in) + { + v = in; + return *this; + } + SIMDINLINE Double& SIMDCALL operator=(Double const& in) + { + v = in.v; + return *this; + } SIMDINLINE SIMDCALL operator __m256d() const { return v; } SIMDALIGN(__m256d, 32) v; @@ -260,7 +311,7 @@ namespace SIMDImpl using Mask = uint8_t; static const uint32_t SIMD_WIDTH = 8; - } // ns SIMD256Impl + } // namespace SIMD256Impl namespace SIMD512Impl { @@ -282,14 +333,14 @@ namespace SIMDImpl union __m512i { private: - int8_t m512i_i8[64]; - int16_t m512i_i16[32]; - int32_t m512i_i32[16]; - int64_t m512i_i64[8]; - uint8_t m512i_u8[64]; - uint16_t m512i_u16[32]; - uint32_t m512i_u32[16]; - uint64_t m512i_u64[8]; + int8_t m512i_i8[64]; + int16_t m512i_i16[32]; + int32_t m512i_i32[16]; + int64_t m512i_i64[8]; + uint8_t m512i_u8[64]; + uint16_t m512i_u16[32]; + uint32_t m512i_u32[16]; + uint64_t m512i_u64[8]; }; using __mmask16 = uint16_t; @@ -305,9 +356,18 @@ namespace SIMDImpl { SIMDINLINE Float() = default; SIMDINLINE Float(__m512 in) : v(in) {} - SIMDINLINE Float(SIMD256Impl::Float const &in_lo, SIMD256Impl::Float const &in_hi = _mm256_setzero_ps()) { v8[0] = in_lo; v8[1] = in_hi; } - SIMDINLINE Float& SIMDCALL operator=(__m512 in) { v = in; return *this; } - SIMDINLINE Float& SIMDCALL operator=(Float const & in) + SIMDINLINE Float(SIMD256Impl::Float const& in_lo, + SIMD256Impl::Float const& in_hi = _mm256_setzero_ps()) + { + v8[0] = in_lo; + v8[1] = in_hi; + } + SIMDINLINE Float& SIMDCALL operator=(__m512 in) + { + v = in; + return *this; + } + SIMDINLINE Float& SIMDCALL operator=(Float const& in) { #if SIMD_ARCH >= SIMD_ARCH_AVX512 v = in.v; @@ -327,9 +387,18 @@ namespace SIMDImpl { SIMDINLINE Integer() = default; SIMDINLINE Integer(__m512i in) : v(in) {} - SIMDINLINE Integer(SIMD256Impl::Integer const &in_lo, SIMD256Impl::Integer const &in_hi = _mm256_setzero_si256()) { v8[0] = in_lo; v8[1] = in_hi; } - SIMDINLINE Integer& SIMDCALL operator=(__m512i in) { v = in; return *this; } - SIMDINLINE Integer& SIMDCALL operator=(Integer const & in) + SIMDINLINE Integer(SIMD256Impl::Integer const& in_lo, + SIMD256Impl::Integer const& in_hi = _mm256_setzero_si256()) + { + v8[0] = in_lo; + v8[1] = in_hi; + } + SIMDINLINE Integer& SIMDCALL operator=(__m512i in) + { + v = in; + return *this; + } + SIMDINLINE Integer& SIMDCALL operator=(Integer const& in) { #if SIMD_ARCH >= SIMD_ARCH_AVX512 v = in.v; @@ -350,9 +419,18 @@ namespace SIMDImpl { SIMDINLINE Double() = default; SIMDINLINE Double(__m512d in) : v(in) {} - SIMDINLINE Double(SIMD256Impl::Double const &in_lo, SIMD256Impl::Double const &in_hi = _mm256_setzero_pd()) { v8[0] = in_lo; v8[1] = in_hi; } - SIMDINLINE Double& SIMDCALL operator=(__m512d in) { v = in; return *this; } - SIMDINLINE Double& SIMDCALL operator=(Double const & in) + SIMDINLINE Double(SIMD256Impl::Double const& in_lo, + SIMD256Impl::Double const& in_hi = _mm256_setzero_pd()) + { + v8[0] = in_lo; + v8[1] = in_hi; + } + SIMDINLINE Double& SIMDCALL operator=(__m512d in) + { + v = in; + return *this; + } + SIMDINLINE Double& SIMDCALL operator=(Double const& in) { #if SIMD_ARCH >= SIMD_ARCH_AVX512 v = in.v; @@ -375,5 +453,5 @@ namespace SIMDImpl static const uint32_t SIMD_WIDTH = 16; #undef SIMD_ALIGNMENT_BYTES - } // ns SIMD512Impl -} // ns SIMDImpl + } // namespace SIMD512Impl +} // namespace SIMDImpl diff --git a/src/gallium/drivers/swr/rasterizer/common/swr_assert.cpp b/src/gallium/drivers/swr/rasterizer/common/swr_assert.cpp index 43b74a68fde..8e874fbc223 100644 --- a/src/gallium/drivers/swr/rasterizer/common/swr_assert.cpp +++ b/src/gallium/drivers/swr/rasterizer/common/swr_assert.cpp @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2014-2015 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2014-2015 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #include "common/os.h" #include <stdarg.h> @@ -38,29 +38,32 @@ namespace ConsoleUtils { enum class TextColor { - BLACK = 0, + BLACK = 0, #if defined(_WIN32) - RED = 4, - GREEN = 2, - BLUE = 1, + RED = 4, + GREEN = 2, + BLUE = 1, #else - RED = 1, - GREEN = 2, - BLUE = 4, + RED = 1, + GREEN = 2, + BLUE = 4, #endif // _WIN32 - PURPLE = static_cast<uint32_t>(RED) | static_cast<uint32_t>(BLUE), - CYAN = static_cast<uint32_t>(GREEN) | static_cast<uint32_t>(BLUE), - YELLOW = static_cast<uint32_t>(RED) | static_cast<uint32_t>(GREEN), - WHITE = static_cast<uint32_t>(RED) | static_cast<uint32_t>(GREEN) | static_cast<uint32_t>(BLUE), + PURPLE = static_cast<uint32_t>(RED) | static_cast<uint32_t>(BLUE), + CYAN = static_cast<uint32_t>(GREEN) | static_cast<uint32_t>(BLUE), + YELLOW = static_cast<uint32_t>(RED) | static_cast<uint32_t>(GREEN), + WHITE = + static_cast<uint32_t>(RED) | static_cast<uint32_t>(GREEN) | static_cast<uint32_t>(BLUE), }; enum class TextStyle { - NORMAL = 0, - INTENSITY = 1, + NORMAL = 0, + INTENSITY = 1, }; - void SetTextColor(FILE* stream, TextColor color = TextColor::WHITE, TextStyle style = TextStyle::NORMAL) + void SetTextColor(FILE* stream, + TextColor color = TextColor::WHITE, + TextStyle style = TextStyle::NORMAL) { #if defined(_WIN32) @@ -89,7 +92,8 @@ namespace ConsoleUtils #else // !_WIN32 // Print ANSI codes - uint32_t cc = 30 + ((style == TextStyle::INTENSITY) ? 60 : 0) + static_cast<uint32_t>(color); + uint32_t cc = + 30 + ((style == TextStyle::INTENSITY) ? 60 : 0) + static_cast<uint32_t>(color); fprintf(stream, "\033[0m\033[%d;%dm", static_cast<uint32_t>(style), cc); #endif @@ -110,17 +114,16 @@ namespace ConsoleUtils } static std::mutex g_stderrMutex; -} // ns ConsoleUtils - -bool SwrAssert( - bool chkDebugger, - bool& enabled, - const char* pExpression, - const char* pFileName, - uint32_t lineNum, - const char* pFunction, - const char* pFmtString, - ...) +} // namespace ConsoleUtils + +bool SwrAssert(bool chkDebugger, + bool& enabled, + const char* pExpression, + const char* pFileName, + uint32_t lineNum, + const char* pFunction, + const char* pFmtString, + ...) { using namespace ConsoleUtils; std::lock_guard<std::mutex> l(g_stderrMutex); @@ -151,7 +154,7 @@ bool SwrAssert( #if defined(_WIN32) static const int MAX_MESSAGE_LEN = 2048; - char msgBuf[MAX_MESSAGE_LEN]; + char msgBuf[MAX_MESSAGE_LEN]; sprintf_s(msgBuf, "%s(%d): ASSERT: %s\n", pFileName, lineNum, pExpression); msgBuf[MAX_MESSAGE_LEN - 2] = '\n'; @@ -169,15 +172,13 @@ bool SwrAssert( { va_list args; va_start(args, pFmtString); - offset = _vsnprintf_s( - msgBuf, - sizeof(msgBuf), - sizeof(msgBuf), - pFmtString, - args); + offset = _vsnprintf_s(msgBuf, sizeof(msgBuf), sizeof(msgBuf), pFmtString, args); va_end(args); - if (offset < 0) { return true; } + if (offset < 0) + { + return true; + } OutputDebugStringA("\t"); OutputDebugStringA(msgBuf); @@ -186,46 +187,51 @@ bool SwrAssert( if (enabled && KNOB_ENABLE_ASSERT_DIALOGS) { - int retval = sprintf_s( - &msgBuf[offset], - MAX_MESSAGE_LEN - offset, - "\n\n" - "File: %s\n" - "Line: %d\n" - "\n" - "Expression: %s\n\n" - "Cancel: Disable this assert for the remainder of the process\n" - "Try Again: Break into the debugger\n" - "Continue: Continue execution (but leave assert enabled)", - pFileName, - lineNum, - pExpression); - - if (retval < 0) { return true; } + int retval = sprintf_s(&msgBuf[offset], + MAX_MESSAGE_LEN - offset, + "\n\n" + "File: %s\n" + "Line: %d\n" + "\n" + "Expression: %s\n\n" + "Cancel: Disable this assert for the remainder of the process\n" + "Try Again: Break into the debugger\n" + "Continue: Continue execution (but leave assert enabled)", + pFileName, + lineNum, + pExpression); + + if (retval < 0) + { + return true; + } offset += retval; if (!IsDebuggerPresent()) { - sprintf_s( - &msgBuf[offset], - MAX_MESSAGE_LEN - offset, - "\n\n*** NO DEBUGGER DETECTED ***\n\nPressing \"Try Again\" will cause a program crash!"); + sprintf_s(&msgBuf[offset], + MAX_MESSAGE_LEN - offset, + "\n\n*** NO DEBUGGER DETECTED ***\n\nPressing \"Try Again\" will cause a " + "program crash!"); } - retval = MessageBoxA(nullptr, msgBuf, "Assert Failed", MB_CANCELTRYCONTINUE | MB_ICONEXCLAMATION | MB_SETFOREGROUND); + retval = MessageBoxA(nullptr, + msgBuf, + "Assert Failed", + MB_CANCELTRYCONTINUE | MB_ICONEXCLAMATION | MB_SETFOREGROUND); switch (retval) { - case IDCANCEL: - enabled = false; - return false; + case IDCANCEL: + enabled = false; + return false; - case IDTRYAGAIN: - return true; + case IDTRYAGAIN: + return true; - case IDCONTINUE: - return false; + case IDCONTINUE: + return false; } } else @@ -238,11 +244,7 @@ bool SwrAssert( } void SwrTrace( - const char* pFileName, - uint32_t lineNum, - const char* pFunction, - const char* pFmtString, - ...) + const char* pFileName, uint32_t lineNum, const char* pFunction, const char* pFmtString, ...) { using namespace ConsoleUtils; std::lock_guard<std::mutex> l(g_stderrMutex); @@ -266,7 +268,7 @@ void SwrTrace( #if defined(_WIN32) static const int MAX_MESSAGE_LEN = 2048; - char msgBuf[MAX_MESSAGE_LEN]; + char msgBuf[MAX_MESSAGE_LEN]; sprintf_s(msgBuf, "%s(%d): TRACE in %s\n", pFileName, lineNum, pFunction); msgBuf[MAX_MESSAGE_LEN - 2] = '\n'; @@ -279,15 +281,13 @@ void SwrTrace( { va_list args; va_start(args, pFmtString); - offset = _vsnprintf_s( - msgBuf, - sizeof(msgBuf), - sizeof(msgBuf), - pFmtString, - args); + offset = _vsnprintf_s(msgBuf, sizeof(msgBuf), sizeof(msgBuf), pFmtString, args); va_end(args); - if (offset < 0) { return; } + if (offset < 0) + { + return; + } OutputDebugStringA("\t"); OutputDebugStringA(msgBuf); diff --git a/src/gallium/drivers/swr/rasterizer/common/swr_assert.h b/src/gallium/drivers/swr/rasterizer/common/swr_assert.h index a9e5bb4e77f..d74b7981255 100644 --- a/src/gallium/drivers/swr/rasterizer/common/swr_assert.h +++ b/src/gallium/drivers/swr/rasterizer/common/swr_assert.h @@ -1,25 +1,25 @@ /**************************************************************************** -* Copyright (C) 2014-2015 Intel Corporation. All Rights Reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice (including the next -* paragraph) shall be included in all copies or substantial portions of the -* Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -* IN THE SOFTWARE. -****************************************************************************/ + * Copyright (C) 2014-2015 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + ****************************************************************************/ #ifndef __SWR_ASSERT_H__ #define __SWR_ASSERT_H__ @@ -55,28 +55,38 @@ // Stupid preprocessor tricks to avoid -Wall / -W4 warnings #if defined(_MSC_VER) -#define _SWR_WARN_DISABLE __pragma(warning(push)) __pragma(warning(disable:4127)) +#define _SWR_WARN_DISABLE __pragma(warning(push)) __pragma(warning(disable : 4127)) #define _SWR_WARN_RESTORE __pragma(warning(pop)) #else // ! MSVC compiler #define _SWR_WARN_DISABLE #define _SWR_WARN_RESTORE #endif -#define _SWR_MACRO_START do { -#define _SWR_MACRO_END \ - _SWR_WARN_DISABLE \ - } while(0) \ +#define _SWR_MACRO_START \ + do \ + { +#define _SWR_MACRO_END \ + _SWR_WARN_DISABLE \ + } \ + while (0) \ _SWR_WARN_RESTORE - #if defined(_WIN32) -#define SWR_ASSUME(e, ...) _SWR_MACRO_START __assume(e); _SWR_MACRO_END +#define SWR_ASSUME(e, ...) \ + _SWR_MACRO_START __assume(e); \ + _SWR_MACRO_END #elif defined(__clang__) -#define SWR_ASSUME(e, ...) _SWR_MACRO_START __builtin_assume(e); _SWR_MACRO_END +#define SWR_ASSUME(e, ...) \ + _SWR_MACRO_START __builtin_assume(e); \ + _SWR_MACRO_END #elif defined(__GNUC__) -#define SWR_ASSUME(e, ...) _SWR_MACRO_START ((e) ? ((void)0) : __builtin_unreachable()); _SWR_MACRO_END +#define SWR_ASSUME(e, ...) \ + _SWR_MACRO_START((e) ? ((void)0) : __builtin_unreachable()); \ + _SWR_MACRO_END #else -#define SWR_ASSUME(e, ...) _SWR_MACRO_START ASSUME(e); _SWR_MACRO_END +#define SWR_ASSUME(e, ...) \ + _SWR_MACRO_START ASSUME(e); \ + _SWR_MACRO_END #endif #if !defined(SWR_ENABLE_ASSERTS) @@ -110,47 +120,50 @@ #else -bool SwrAssert( - bool chkDebugger, - bool& enabled, - const char* pExpression, - const char* pFileName, - uint32_t lineNum, - const char* function, - const char* pFmtString = nullptr, - ...); +bool SwrAssert(bool chkDebugger, + bool& enabled, + const char* pExpression, + const char* pFileName, + uint32_t lineNum, + const char* function, + const char* pFmtString = nullptr, + ...); void SwrTrace( - const char* pFileName, - uint32_t lineNum, - const char* function, - const char* pFmtString, - ...); - -#define _SWR_ASSERT(chkDebugger, e, ...) \ - _SWR_MACRO_START \ - bool expFailed = !(e);\ - if (expFailed) {\ - static bool swrAssertEnabled = true;\ - expFailed = SwrAssert(chkDebugger, swrAssertEnabled, #e, __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__);\ - if (expFailed) { DEBUGBREAK; }\ - }\ + const char* pFileName, uint32_t lineNum, const char* function, const char* pFmtString, ...); + +#define _SWR_ASSERT(chkDebugger, e, ...) \ + _SWR_MACRO_START \ + bool expFailed = !(e); \ + if (expFailed) \ + { \ + static bool swrAssertEnabled = true; \ + expFailed = SwrAssert( \ + chkDebugger, swrAssertEnabled, #e, __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__); \ + if (expFailed) \ + { \ + DEBUGBREAK; \ + } \ + } \ _SWR_MACRO_END -#define _SWR_INVALID(chkDebugger, ...) \ - _SWR_MACRO_START \ - static bool swrAssertEnabled = true;\ - bool expFailed = SwrAssert(chkDebugger, swrAssertEnabled, "", __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__);\ - if (expFailed) { DEBUGBREAK; }\ +#define _SWR_INVALID(chkDebugger, ...) \ + _SWR_MACRO_START \ + static bool swrAssertEnabled = true; \ + bool expFailed = SwrAssert( \ + chkDebugger, swrAssertEnabled, "", __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__); \ + if (expFailed) \ + { \ + DEBUGBREAK; \ + } \ _SWR_MACRO_END -#define _SWR_TRACE(_fmtstr, ...) \ - SwrTrace(__FILE__, __LINE__, __FUNCTION__, _fmtstr, ##__VA_ARGS__); +#define _SWR_TRACE(_fmtstr, ...) SwrTrace(__FILE__, __LINE__, __FUNCTION__, _fmtstr, ##__VA_ARGS__); #if SWR_ENABLE_ASSERTS -#define SWR_ASSERT(e, ...) _SWR_ASSERT(true, e, ##__VA_ARGS__) -#define SWR_ASSUME_ASSERT(e, ...) SWR_ASSERT(e, ##__VA_ARGS__) -#define SWR_TRACE(_fmtstr, ...) _SWR_TRACE(_fmtstr, ##__VA_ARGS__) +#define SWR_ASSERT(e, ...) _SWR_ASSERT(true, e, ##__VA_ARGS__) +#define SWR_ASSUME_ASSERT(e, ...) SWR_ASSERT(e, ##__VA_ARGS__) +#define SWR_TRACE(_fmtstr, ...) _SWR_TRACE(_fmtstr, ##__VA_ARGS__) #if defined(assert) #undef assert @@ -160,24 +173,25 @@ void SwrTrace( #endif // SWR_ENABLE_ASSERTS #if SWR_ENABLE_REL_ASSERTS -#define SWR_REL_ASSERT(e, ...) _SWR_ASSERT(false, e, ##__VA_ARGS__) -#define SWR_REL_ASSUME_ASSERT(e, ...) SWR_REL_ASSERT(e, ##__VA_ARGS__) -#define SWR_REL_TRACE(_fmtstr, ...) _SWR_TRACE(_fmtstr, ##__VA_ARGS__) +#define SWR_REL_ASSERT(e, ...) _SWR_ASSERT(false, e, ##__VA_ARGS__) +#define SWR_REL_ASSUME_ASSERT(e, ...) SWR_REL_ASSERT(e, ##__VA_ARGS__) +#define SWR_REL_TRACE(_fmtstr, ...) _SWR_TRACE(_fmtstr, ##__VA_ARGS__) // SWR_INVALID is always enabled // Funky handling to allow 0 arguments with g++/gcc // This is needed because you can't "swallow commas" with ##_VA_ARGS__ unless // there is a first argument to the macro. So having a macro that can optionally // accept 0 arguments is tricky. -#define _SWR_INVALID_0() _SWR_INVALID(false) -#define _SWR_INVALID_1(...) _SWR_INVALID(false, ##__VA_ARGS__) +#define _SWR_INVALID_0() _SWR_INVALID(false) +#define _SWR_INVALID_1(...) _SWR_INVALID(false, ##__VA_ARGS__) #define _SWR_INVALID_VARGS_(_10, _9, _8, _7, _6, _5, _4, _3, _2, _1, N, ...) N -#define _SWR_INVALID_VARGS(...) _SWR_INVALID_VARGS_(__VA_ARGS__, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1) -#define _SWR_INVALID_VARGS_0() 1, 2, 3, 4, 5, 6, 7, 9, 9, 10 -#define _SWR_INVALID_CONCAT_(a, b) a##b -#define _SWR_INVALID_CONCAT(a, b) _SWR_INVALID_CONCAT_(a, b) -#define SWR_INVALID(...) \ - _SWR_INVALID_CONCAT(_SWR_INVALID_,_SWR_INVALID_VARGS(_SWR_INVALID_VARGS_0 __VA_ARGS__ ()))(__VA_ARGS__) +#define _SWR_INVALID_VARGS(...) _SWR_INVALID_VARGS_(__VA_ARGS__, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1) +#define _SWR_INVALID_VARGS_0() 1, 2, 3, 4, 5, 6, 7, 9, 9, 10 +#define _SWR_INVALID_CONCAT_(a, b) a##b +#define _SWR_INVALID_CONCAT(a, b) _SWR_INVALID_CONCAT_(a, b) +#define SWR_INVALID(...) \ + _SWR_INVALID_CONCAT(_SWR_INVALID_, _SWR_INVALID_VARGS(_SWR_INVALID_VARGS_0 __VA_ARGS__())) \ + (__VA_ARGS__) #endif #endif // C++ @@ -185,20 +199,33 @@ void SwrTrace( #endif // SWR_ENABLE_ASSERTS || SWR_ENABLE_REL_ASSERTS // Needed to allow passing bitfield members to sizeof() in disabled asserts -template<typename T> -static bool SwrSizeofWorkaround(T) {return false;} +template <typename T> +static bool SwrSizeofWorkaround(T) +{ + return false; +} #if !SWR_ENABLE_ASSERTS -#define SWR_ASSERT(e, ...) _SWR_MACRO_START (void)sizeof(SwrSizeofWorkaround(e)); _SWR_MACRO_END -#define SWR_ASSUME_ASSERT(e, ...) SWR_ASSUME(e, ##__VA_ARGS__) -#define SWR_TRACE(_fmtstr, ...) _SWR_MACRO_START (void)(0); _SWR_MACRO_END +#define SWR_ASSERT(e, ...) \ + _SWR_MACRO_START(void) sizeof(SwrSizeofWorkaround(e)); \ + _SWR_MACRO_END +#define SWR_ASSUME_ASSERT(e, ...) SWR_ASSUME(e, ##__VA_ARGS__) +#define SWR_TRACE(_fmtstr, ...) \ + _SWR_MACRO_START(void)(0); \ + _SWR_MACRO_END #endif #if !SWR_ENABLE_REL_ASSERTS -#define SWR_REL_ASSERT(e, ...) _SWR_MACRO_START (void)sizeof(SwrSizeofWorkaround(e)); _SWR_MACRO_END -#define SWR_INVALID(...) _SWR_MACRO_START (void)(0); _SWR_MACRO_END -#define SWR_REL_ASSUME_ASSERT(e, ...) SWR_ASSUME(e, ##__VA_ARGS__) -#define SWR_REL_TRACE(_fmtstr, ...) _SWR_MACRO_START (void)(0); _SWR_MACRO_END +#define SWR_REL_ASSERT(e, ...) \ + _SWR_MACRO_START(void) sizeof(SwrSizeofWorkaround(e)); \ + _SWR_MACRO_END +#define SWR_INVALID(...) \ + _SWR_MACRO_START(void)(0); \ + _SWR_MACRO_END +#define SWR_REL_ASSUME_ASSERT(e, ...) SWR_ASSUME(e, ##__VA_ARGS__) +#define SWR_REL_TRACE(_fmtstr, ...) \ + _SWR_MACRO_START(void)(0); \ + _SWR_MACRO_END #endif #if defined(_MSC_VER) @@ -211,4 +238,4 @@ static bool SwrSizeofWorkaround(T) {return false;} #define SWR_NOT_IMPL SWR_INVALID("%s not implemented", SWR_FUNCTION_DECL) -#endif//__SWR_ASSERT_H__ +#endif //__SWR_ASSERT_H__ |