1 /**************************************************************************** 2 * Copyright (C) 2016 Intel Corporation. All Rights Reserved. 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the 9 * Software is furnished to do so, subject to the following conditions: 10 * 11 * The above copyright notice and this permission notice (including the next 12 * paragraph) shall be included in all copies or substantial portions of the 13 * Software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 * IN THE SOFTWARE. 22 * 23 * @file gen_format_traits.h 24 * 25 * @brief Format Traits. auto-generated file 26 * 27 * DO NOT EDIT 28 * 29 ******************************************************************************/ 30 #pragma once 31 32 #include "format_types.h" 33 #include "utils.h" 34 35 ////////////////////////////////////////////////////////////////////////// 36 /// FormatSwizzle - Component swizzle selects 37 ////////////////////////////////////////////////////////////////////////// 38 template<UINT comp0 = 0, uint32_t comp1 = 0, uint32_t comp2 = 0, uint32_t comp3 = 0> 39 struct FormatSwizzle 40 { 41 // Return swizzle select for component. swizzleFormatSwizzle42 INLINE static uint32_t swizzle(UINT c) 43 { 44 static const uint32_t s[4] = { comp0, comp1, comp2, comp3 }; 45 return s[c]; 46 } 47 }; 48 49 ////////////////////////////////////////////////////////////////////////// 50 /// FormatTraits - Format traits 51 ////////////////////////////////////////////////////////////////////////// 52 template<SWR_FORMAT format> 53 struct FormatTraits : 54 ComponentTraits<SWR_TYPE_UNKNOWN, 0>, 55 FormatSwizzle<0>, 56 Defaults<0, 0, 0, 0> 57 { 58 static const uint32_t bpp{ 0 }; 59 static const uint32_t numComps{ 0 }; 60 static const bool hasAlpha{ false }; 61 static const uint32_t alphaComp{ 0 }; 62 63 static const bool isSRGB{ false }; 64 static const bool isBC{ false }; 65 static const bool isSubsampled{ false }; 66 static const uint32_t bcWidth{ 1 }; 67 static const uint32_t bcHeight{ 1 }; 68 }; 69 70 ////////////////////////////////////////////////////////////////////////// 71 /// FormatTraits<R32G32B32A32_FLOAT> - Format traits specialization for R32G32B32A32_FLOAT 72 ////////////////////////////////////////////////////////////////////////// 73 template<> struct FormatTraits<R32G32B32A32_FLOAT> : 74 ComponentTraits<SWR_TYPE_FLOAT, 32, SWR_TYPE_FLOAT, 32, SWR_TYPE_FLOAT, 32, SWR_TYPE_FLOAT, 32>, 75 FormatSwizzle<0, 1, 2, 3>, 76 Defaults<0, 0, 0, 0x3f800000> 77 { 78 static const uint32_t bpp{ 128 }; 79 static const uint32_t numComps{ 4 }; 80 static const bool hasAlpha{ true }; 81 static const uint32_t alphaComp{ 3 }; 82 static const bool isSRGB{ false }; 83 static const bool isBC{ false }; 84 static const bool isSubsampled{ false }; 85 static const uint32_t bcWidth{ 1 }; 86 static const uint32_t bcHeight{ 1 }; 87 88 typedef Transpose32_32_32_32 TransposeT; 89 typedef Format4<32, 32, 32, 32> FormatT; 90 }; 91 92 ////////////////////////////////////////////////////////////////////////// 93 /// FormatTraits<R32G32B32A32_SINT> - Format traits specialization for R32G32B32A32_SINT 94 ////////////////////////////////////////////////////////////////////////// 95 template<> struct FormatTraits<R32G32B32A32_SINT> : 96 ComponentTraits<SWR_TYPE_SINT, 32, SWR_TYPE_SINT, 32, SWR_TYPE_SINT, 32, SWR_TYPE_SINT, 32>, 97 FormatSwizzle<0, 1, 2, 3>, 98 Defaults<0, 0, 0, 0x1> 99 { 100 static const uint32_t bpp{ 128 }; 101 static const uint32_t numComps{ 4 }; 102 static const bool hasAlpha{ true }; 103 static const uint32_t alphaComp{ 3 }; 104 static const bool isSRGB{ false }; 105 static const bool isBC{ false }; 106 static const bool isSubsampled{ false }; 107 static const uint32_t bcWidth{ 1 }; 108 static const uint32_t bcHeight{ 1 }; 109 110 typedef Transpose32_32_32_32 TransposeT; 111 typedef Format4<32, 32, 32, 32> FormatT; 112 }; 113 114 ////////////////////////////////////////////////////////////////////////// 115 /// FormatTraits<R32G32B32A32_UINT> - Format traits specialization for R32G32B32A32_UINT 116 ////////////////////////////////////////////////////////////////////////// 117 template<> struct FormatTraits<R32G32B32A32_UINT> : 118 ComponentTraits<SWR_TYPE_UINT, 32, SWR_TYPE_UINT, 32, SWR_TYPE_UINT, 32, SWR_TYPE_UINT, 32>, 119 FormatSwizzle<0, 1, 2, 3>, 120 Defaults<0, 0, 0, 0x1> 121 { 122 static const uint32_t bpp{ 128 }; 123 static const uint32_t numComps{ 4 }; 124 static const bool hasAlpha{ true }; 125 static const uint32_t alphaComp{ 3 }; 126 static const bool isSRGB{ false }; 127 static const bool isBC{ false }; 128 static const bool isSubsampled{ false }; 129 static const uint32_t bcWidth{ 1 }; 130 static const uint32_t bcHeight{ 1 }; 131 132 typedef Transpose32_32_32_32 TransposeT; 133 typedef Format4<32, 32, 32, 32> FormatT; 134 }; 135 136 ////////////////////////////////////////////////////////////////////////// 137 /// FormatTraits<R64G64_FLOAT> - Format traits specialization for R64G64_FLOAT 138 ////////////////////////////////////////////////////////////////////////// 139 template<> struct FormatTraits<R64G64_FLOAT> : 140 ComponentTraits<SWR_TYPE_FLOAT, 64, SWR_TYPE_FLOAT, 64>, 141 FormatSwizzle<0, 1>, 142 Defaults<0, 0, 0, 0x3f800000> 143 { 144 static const uint32_t bpp{ 128 }; 145 static const uint32_t numComps{ 2 }; 146 static const bool hasAlpha{ false }; 147 static const uint32_t alphaComp{ 0 }; 148 static const bool isSRGB{ false }; 149 static const bool isBC{ false }; 150 static const bool isSubsampled{ false }; 151 static const uint32_t bcWidth{ 1 }; 152 static const uint32_t bcHeight{ 1 }; 153 154 typedef Transpose64_64 TransposeT; 155 typedef Format2<64, 64> FormatT; 156 }; 157 158 ////////////////////////////////////////////////////////////////////////// 159 /// FormatTraits<R32G32B32X32_FLOAT> - Format traits specialization for R32G32B32X32_FLOAT 160 ////////////////////////////////////////////////////////////////////////// 161 template<> struct FormatTraits<R32G32B32X32_FLOAT> : 162 ComponentTraits<SWR_TYPE_FLOAT, 32, SWR_TYPE_FLOAT, 32, SWR_TYPE_FLOAT, 32, SWR_TYPE_UNUSED, 32>, 163 FormatSwizzle<0, 1, 2, 3>, 164 Defaults<0, 0, 0, 0x3f800000> 165 { 166 static const uint32_t bpp{ 128 }; 167 static const uint32_t numComps{ 3 }; 168 static const bool hasAlpha{ false }; 169 static const uint32_t alphaComp{ 0 }; 170 static const bool isSRGB{ false }; 171 static const bool isBC{ false }; 172 static const bool isSubsampled{ false }; 173 static const uint32_t bcWidth{ 1 }; 174 static const uint32_t bcHeight{ 1 }; 175 176 typedef Transpose32_32_32_32 TransposeT; 177 typedef Format4<32, 32, 32, 32> FormatT; 178 }; 179 180 ////////////////////////////////////////////////////////////////////////// 181 /// FormatTraits<R32G32B32A32_SSCALED> - Format traits specialization for R32G32B32A32_SSCALED 182 ////////////////////////////////////////////////////////////////////////// 183 template<> struct FormatTraits<R32G32B32A32_SSCALED> : 184 ComponentTraits<SWR_TYPE_SSCALED, 32, SWR_TYPE_SSCALED, 32, SWR_TYPE_SSCALED, 32, SWR_TYPE_SSCALED, 32>, 185 FormatSwizzle<0, 1, 2, 3>, 186 Defaults<0, 0, 0, 0x3f800000> 187 { 188 static const uint32_t bpp{ 128 }; 189 static const uint32_t numComps{ 4 }; 190 static const bool hasAlpha{ true }; 191 static const uint32_t alphaComp{ 3 }; 192 static const bool isSRGB{ false }; 193 static const bool isBC{ false }; 194 static const bool isSubsampled{ false }; 195 static const uint32_t bcWidth{ 1 }; 196 static const uint32_t bcHeight{ 1 }; 197 198 typedef Transpose32_32_32_32 TransposeT; 199 typedef Format4<32, 32, 32, 32> FormatT; 200 }; 201 202 ////////////////////////////////////////////////////////////////////////// 203 /// FormatTraits<R32G32B32A32_USCALED> - Format traits specialization for R32G32B32A32_USCALED 204 ////////////////////////////////////////////////////////////////////////// 205 template<> struct FormatTraits<R32G32B32A32_USCALED> : 206 ComponentTraits<SWR_TYPE_USCALED, 32, SWR_TYPE_USCALED, 32, SWR_TYPE_USCALED, 32, SWR_TYPE_USCALED, 32>, 207 FormatSwizzle<0, 1, 2, 3>, 208 Defaults<0, 0, 0, 0x3f800000> 209 { 210 static const uint32_t bpp{ 128 }; 211 static const uint32_t numComps{ 4 }; 212 static const bool hasAlpha{ true }; 213 static const uint32_t alphaComp{ 3 }; 214 static const bool isSRGB{ false }; 215 static const bool isBC{ false }; 216 static const bool isSubsampled{ false }; 217 static const uint32_t bcWidth{ 1 }; 218 static const uint32_t bcHeight{ 1 }; 219 220 typedef Transpose32_32_32_32 TransposeT; 221 typedef Format4<32, 32, 32, 32> FormatT; 222 }; 223 224 ////////////////////////////////////////////////////////////////////////// 225 /// FormatTraits<R32G32B32A32_SFIXED> - Format traits specialization for R32G32B32A32_SFIXED 226 ////////////////////////////////////////////////////////////////////////// 227 template<> struct FormatTraits<R32G32B32A32_SFIXED> : 228 ComponentTraits<SWR_TYPE_SFIXED, 32, SWR_TYPE_SFIXED, 32, SWR_TYPE_SFIXED, 32, SWR_TYPE_SFIXED, 32>, 229 FormatSwizzle<0, 1, 2, 3>, 230 Defaults<0, 0, 0, 0x3f800000> 231 { 232 static const uint32_t bpp{ 128 }; 233 static const uint32_t numComps{ 4 }; 234 static const bool hasAlpha{ true }; 235 static const uint32_t alphaComp{ 3 }; 236 static const bool isSRGB{ false }; 237 static const bool isBC{ false }; 238 static const bool isSubsampled{ false }; 239 static const uint32_t bcWidth{ 1 }; 240 static const uint32_t bcHeight{ 1 }; 241 242 typedef Transpose32_32_32_32 TransposeT; 243 typedef Format4<32, 32, 32, 32> FormatT; 244 }; 245 246 ////////////////////////////////////////////////////////////////////////// 247 /// FormatTraits<R32G32B32_FLOAT> - Format traits specialization for R32G32B32_FLOAT 248 ////////////////////////////////////////////////////////////////////////// 249 template<> struct FormatTraits<R32G32B32_FLOAT> : 250 ComponentTraits<SWR_TYPE_FLOAT, 32, SWR_TYPE_FLOAT, 32, SWR_TYPE_FLOAT, 32>, 251 FormatSwizzle<0, 1, 2>, 252 Defaults<0, 0, 0, 0x3f800000> 253 { 254 static const uint32_t bpp{ 96 }; 255 static const uint32_t numComps{ 3 }; 256 static const bool hasAlpha{ false }; 257 static const uint32_t alphaComp{ 0 }; 258 static const bool isSRGB{ false }; 259 static const bool isBC{ false }; 260 static const bool isSubsampled{ false }; 261 static const uint32_t bcWidth{ 1 }; 262 static const uint32_t bcHeight{ 1 }; 263 264 typedef Transpose32_32_32 TransposeT; 265 typedef Format3<32, 32, 32> FormatT; 266 }; 267 268 ////////////////////////////////////////////////////////////////////////// 269 /// FormatTraits<R32G32B32_SINT> - Format traits specialization for R32G32B32_SINT 270 ////////////////////////////////////////////////////////////////////////// 271 template<> struct FormatTraits<R32G32B32_SINT> : 272 ComponentTraits<SWR_TYPE_SINT, 32, SWR_TYPE_SINT, 32, SWR_TYPE_SINT, 32>, 273 FormatSwizzle<0, 1, 2>, 274 Defaults<0, 0, 0, 0x1> 275 { 276 static const uint32_t bpp{ 96 }; 277 static const uint32_t numComps{ 3 }; 278 static const bool hasAlpha{ false }; 279 static const uint32_t alphaComp{ 0 }; 280 static const bool isSRGB{ false }; 281 static const bool isBC{ false }; 282 static const bool isSubsampled{ false }; 283 static const uint32_t bcWidth{ 1 }; 284 static const uint32_t bcHeight{ 1 }; 285 286 typedef Transpose32_32_32 TransposeT; 287 typedef Format3<32, 32, 32> FormatT; 288 }; 289 290 ////////////////////////////////////////////////////////////////////////// 291 /// FormatTraits<R32G32B32_UINT> - Format traits specialization for R32G32B32_UINT 292 ////////////////////////////////////////////////////////////////////////// 293 template<> struct FormatTraits<R32G32B32_UINT> : 294 ComponentTraits<SWR_TYPE_UINT, 32, SWR_TYPE_UINT, 32, SWR_TYPE_UINT, 32>, 295 FormatSwizzle<0, 1, 2>, 296 Defaults<0, 0, 0, 0x1> 297 { 298 static const uint32_t bpp{ 96 }; 299 static const uint32_t numComps{ 3 }; 300 static const bool hasAlpha{ false }; 301 static const uint32_t alphaComp{ 0 }; 302 static const bool isSRGB{ false }; 303 static const bool isBC{ false }; 304 static const bool isSubsampled{ false }; 305 static const uint32_t bcWidth{ 1 }; 306 static const uint32_t bcHeight{ 1 }; 307 308 typedef Transpose32_32_32 TransposeT; 309 typedef Format3<32, 32, 32> FormatT; 310 }; 311 312 ////////////////////////////////////////////////////////////////////////// 313 /// FormatTraits<R32G32B32_SSCALED> - Format traits specialization for R32G32B32_SSCALED 314 ////////////////////////////////////////////////////////////////////////// 315 template<> struct FormatTraits<R32G32B32_SSCALED> : 316 ComponentTraits<SWR_TYPE_SSCALED, 32, SWR_TYPE_SSCALED, 32, SWR_TYPE_SSCALED, 32>, 317 FormatSwizzle<0, 1, 2>, 318 Defaults<0, 0, 0, 0x3f800000> 319 { 320 static const uint32_t bpp{ 96 }; 321 static const uint32_t numComps{ 3 }; 322 static const bool hasAlpha{ false }; 323 static const uint32_t alphaComp{ 0 }; 324 static const bool isSRGB{ false }; 325 static const bool isBC{ false }; 326 static const bool isSubsampled{ false }; 327 static const uint32_t bcWidth{ 1 }; 328 static const uint32_t bcHeight{ 1 }; 329 330 typedef Transpose32_32_32 TransposeT; 331 typedef Format3<32, 32, 32> FormatT; 332 }; 333 334 ////////////////////////////////////////////////////////////////////////// 335 /// FormatTraits<R32G32B32_USCALED> - Format traits specialization for R32G32B32_USCALED 336 ////////////////////////////////////////////////////////////////////////// 337 template<> struct FormatTraits<R32G32B32_USCALED> : 338 ComponentTraits<SWR_TYPE_USCALED, 32, SWR_TYPE_USCALED, 32, SWR_TYPE_USCALED, 32>, 339 FormatSwizzle<0, 1, 2>, 340 Defaults<0, 0, 0, 0x3f800000> 341 { 342 static const uint32_t bpp{ 96 }; 343 static const uint32_t numComps{ 3 }; 344 static const bool hasAlpha{ false }; 345 static const uint32_t alphaComp{ 0 }; 346 static const bool isSRGB{ false }; 347 static const bool isBC{ false }; 348 static const bool isSubsampled{ false }; 349 static const uint32_t bcWidth{ 1 }; 350 static const uint32_t bcHeight{ 1 }; 351 352 typedef Transpose32_32_32 TransposeT; 353 typedef Format3<32, 32, 32> FormatT; 354 }; 355 356 ////////////////////////////////////////////////////////////////////////// 357 /// FormatTraits<R32G32B32_SFIXED> - Format traits specialization for R32G32B32_SFIXED 358 ////////////////////////////////////////////////////////////////////////// 359 template<> struct FormatTraits<R32G32B32_SFIXED> : 360 ComponentTraits<SWR_TYPE_SFIXED, 32, SWR_TYPE_SFIXED, 32, SWR_TYPE_SFIXED, 32>, 361 FormatSwizzle<0, 1, 2>, 362 Defaults<0, 0, 0, 0x3f800000> 363 { 364 static const uint32_t bpp{ 96 }; 365 static const uint32_t numComps{ 3 }; 366 static const bool hasAlpha{ false }; 367 static const uint32_t alphaComp{ 0 }; 368 static const bool isSRGB{ false }; 369 static const bool isBC{ false }; 370 static const bool isSubsampled{ false }; 371 static const uint32_t bcWidth{ 1 }; 372 static const uint32_t bcHeight{ 1 }; 373 374 typedef Transpose32_32_32 TransposeT; 375 typedef Format3<32, 32, 32> FormatT; 376 }; 377 378 ////////////////////////////////////////////////////////////////////////// 379 /// FormatTraits<R16G16B16A16_UNORM> - Format traits specialization for R16G16B16A16_UNORM 380 ////////////////////////////////////////////////////////////////////////// 381 template<> struct FormatTraits<R16G16B16A16_UNORM> : 382 ComponentTraits<SWR_TYPE_UNORM, 16, SWR_TYPE_UNORM, 16, SWR_TYPE_UNORM, 16, SWR_TYPE_UNORM, 16>, 383 FormatSwizzle<0, 1, 2, 3>, 384 Defaults<0, 0, 0, 0x3f800000> 385 { 386 static const uint32_t bpp{ 64 }; 387 static const uint32_t numComps{ 4 }; 388 static const bool hasAlpha{ true }; 389 static const uint32_t alphaComp{ 3 }; 390 static const bool isSRGB{ false }; 391 static const bool isBC{ false }; 392 static const bool isSubsampled{ false }; 393 static const uint32_t bcWidth{ 1 }; 394 static const uint32_t bcHeight{ 1 }; 395 396 typedef Transpose16_16_16_16 TransposeT; 397 typedef Format4<16, 16, 16, 16> FormatT; 398 }; 399 400 ////////////////////////////////////////////////////////////////////////// 401 /// FormatTraits<R16G16B16A16_SNORM> - Format traits specialization for R16G16B16A16_SNORM 402 ////////////////////////////////////////////////////////////////////////// 403 template<> struct FormatTraits<R16G16B16A16_SNORM> : 404 ComponentTraits<SWR_TYPE_SNORM, 16, SWR_TYPE_SNORM, 16, SWR_TYPE_SNORM, 16, SWR_TYPE_SNORM, 16>, 405 FormatSwizzle<0, 1, 2, 3>, 406 Defaults<0, 0, 0, 0x3f800000> 407 { 408 static const uint32_t bpp{ 64 }; 409 static const uint32_t numComps{ 4 }; 410 static const bool hasAlpha{ true }; 411 static const uint32_t alphaComp{ 3 }; 412 static const bool isSRGB{ false }; 413 static const bool isBC{ false }; 414 static const bool isSubsampled{ false }; 415 static const uint32_t bcWidth{ 1 }; 416 static const uint32_t bcHeight{ 1 }; 417 418 typedef Transpose16_16_16_16 TransposeT; 419 typedef Format4<16, 16, 16, 16> FormatT; 420 }; 421 422 ////////////////////////////////////////////////////////////////////////// 423 /// FormatTraits<R16G16B16A16_SINT> - Format traits specialization for R16G16B16A16_SINT 424 ////////////////////////////////////////////////////////////////////////// 425 template<> struct FormatTraits<R16G16B16A16_SINT> : 426 ComponentTraits<SWR_TYPE_SINT, 16, SWR_TYPE_SINT, 16, SWR_TYPE_SINT, 16, SWR_TYPE_SINT, 16>, 427 FormatSwizzle<0, 1, 2, 3>, 428 Defaults<0, 0, 0, 0x1> 429 { 430 static const uint32_t bpp{ 64 }; 431 static const uint32_t numComps{ 4 }; 432 static const bool hasAlpha{ true }; 433 static const uint32_t alphaComp{ 3 }; 434 static const bool isSRGB{ false }; 435 static const bool isBC{ false }; 436 static const bool isSubsampled{ false }; 437 static const uint32_t bcWidth{ 1 }; 438 static const uint32_t bcHeight{ 1 }; 439 440 typedef Transpose16_16_16_16 TransposeT; 441 typedef Format4<16, 16, 16, 16> FormatT; 442 }; 443 444 ////////////////////////////////////////////////////////////////////////// 445 /// FormatTraits<R16G16B16A16_UINT> - Format traits specialization for R16G16B16A16_UINT 446 ////////////////////////////////////////////////////////////////////////// 447 template<> struct FormatTraits<R16G16B16A16_UINT> : 448 ComponentTraits<SWR_TYPE_UINT, 16, SWR_TYPE_UINT, 16, SWR_TYPE_UINT, 16, SWR_TYPE_UINT, 16>, 449 FormatSwizzle<0, 1, 2, 3>, 450 Defaults<0, 0, 0, 0x1> 451 { 452 static const uint32_t bpp{ 64 }; 453 static const uint32_t numComps{ 4 }; 454 static const bool hasAlpha{ true }; 455 static const uint32_t alphaComp{ 3 }; 456 static const bool isSRGB{ false }; 457 static const bool isBC{ false }; 458 static const bool isSubsampled{ false }; 459 static const uint32_t bcWidth{ 1 }; 460 static const uint32_t bcHeight{ 1 }; 461 462 typedef Transpose16_16_16_16 TransposeT; 463 typedef Format4<16, 16, 16, 16> FormatT; 464 }; 465 466 ////////////////////////////////////////////////////////////////////////// 467 /// FormatTraits<R16G16B16A16_FLOAT> - Format traits specialization for R16G16B16A16_FLOAT 468 ////////////////////////////////////////////////////////////////////////// 469 template<> struct FormatTraits<R16G16B16A16_FLOAT> : 470 ComponentTraits<SWR_TYPE_FLOAT, 16, SWR_TYPE_FLOAT, 16, SWR_TYPE_FLOAT, 16, SWR_TYPE_FLOAT, 16>, 471 FormatSwizzle<0, 1, 2, 3>, 472 Defaults<0, 0, 0, 0x3f800000> 473 { 474 static const uint32_t bpp{ 64 }; 475 static const uint32_t numComps{ 4 }; 476 static const bool hasAlpha{ true }; 477 static const uint32_t alphaComp{ 3 }; 478 static const bool isSRGB{ false }; 479 static const bool isBC{ false }; 480 static const bool isSubsampled{ false }; 481 static const uint32_t bcWidth{ 1 }; 482 static const uint32_t bcHeight{ 1 }; 483 484 typedef Transpose16_16_16_16 TransposeT; 485 typedef Format4<16, 16, 16, 16> FormatT; 486 }; 487 488 ////////////////////////////////////////////////////////////////////////// 489 /// FormatTraits<R32G32_FLOAT> - Format traits specialization for R32G32_FLOAT 490 ////////////////////////////////////////////////////////////////////////// 491 template<> struct FormatTraits<R32G32_FLOAT> : 492 ComponentTraits<SWR_TYPE_FLOAT, 32, SWR_TYPE_FLOAT, 32>, 493 FormatSwizzle<0, 1>, 494 Defaults<0, 0, 0, 0x3f800000> 495 { 496 static const uint32_t bpp{ 64 }; 497 static const uint32_t numComps{ 2 }; 498 static const bool hasAlpha{ false }; 499 static const uint32_t alphaComp{ 0 }; 500 static const bool isSRGB{ false }; 501 static const bool isBC{ false }; 502 static const bool isSubsampled{ false }; 503 static const uint32_t bcWidth{ 1 }; 504 static const uint32_t bcHeight{ 1 }; 505 506 typedef Transpose32_32 TransposeT; 507 typedef Format2<32, 32> FormatT; 508 }; 509 510 ////////////////////////////////////////////////////////////////////////// 511 /// FormatTraits<R32G32_SINT> - Format traits specialization for R32G32_SINT 512 ////////////////////////////////////////////////////////////////////////// 513 template<> struct FormatTraits<R32G32_SINT> : 514 ComponentTraits<SWR_TYPE_SINT, 32, SWR_TYPE_SINT, 32>, 515 FormatSwizzle<0, 1>, 516 Defaults<0, 0, 0, 0x1> 517 { 518 static const uint32_t bpp{ 64 }; 519 static const uint32_t numComps{ 2 }; 520 static const bool hasAlpha{ false }; 521 static const uint32_t alphaComp{ 0 }; 522 static const bool isSRGB{ false }; 523 static const bool isBC{ false }; 524 static const bool isSubsampled{ false }; 525 static const uint32_t bcWidth{ 1 }; 526 static const uint32_t bcHeight{ 1 }; 527 528 typedef Transpose32_32 TransposeT; 529 typedef Format2<32, 32> FormatT; 530 }; 531 532 ////////////////////////////////////////////////////////////////////////// 533 /// FormatTraits<R32G32_UINT> - Format traits specialization for R32G32_UINT 534 ////////////////////////////////////////////////////////////////////////// 535 template<> struct FormatTraits<R32G32_UINT> : 536 ComponentTraits<SWR_TYPE_UINT, 32, SWR_TYPE_UINT, 32>, 537 FormatSwizzle<0, 1>, 538 Defaults<0, 0, 0, 0x1> 539 { 540 static const uint32_t bpp{ 64 }; 541 static const uint32_t numComps{ 2 }; 542 static const bool hasAlpha{ false }; 543 static const uint32_t alphaComp{ 0 }; 544 static const bool isSRGB{ false }; 545 static const bool isBC{ false }; 546 static const bool isSubsampled{ false }; 547 static const uint32_t bcWidth{ 1 }; 548 static const uint32_t bcHeight{ 1 }; 549 550 typedef Transpose32_32 TransposeT; 551 typedef Format2<32, 32> FormatT; 552 }; 553 554 ////////////////////////////////////////////////////////////////////////// 555 /// FormatTraits<R32_FLOAT_X8X24_TYPELESS> - Format traits specialization for R32_FLOAT_X8X24_TYPELESS 556 ////////////////////////////////////////////////////////////////////////// 557 template<> struct FormatTraits<R32_FLOAT_X8X24_TYPELESS> : 558 ComponentTraits<SWR_TYPE_FLOAT, 32, SWR_TYPE_UNUSED, 32>, 559 FormatSwizzle<0, 1>, 560 Defaults<0, 0, 0, 0x3f800000> 561 { 562 static const uint32_t bpp{ 64 }; 563 static const uint32_t numComps{ 1 }; 564 static const bool hasAlpha{ false }; 565 static const uint32_t alphaComp{ 3 }; 566 static const bool isSRGB{ false }; 567 static const bool isBC{ false }; 568 static const bool isSubsampled{ false }; 569 static const uint32_t bcWidth{ 1 }; 570 static const uint32_t bcHeight{ 1 }; 571 572 typedef Transpose32_32 TransposeT; 573 typedef Format2<32, 32> FormatT; 574 }; 575 576 ////////////////////////////////////////////////////////////////////////// 577 /// FormatTraits<X32_TYPELESS_G8X24_UINT> - Format traits specialization for X32_TYPELESS_G8X24_UINT 578 ////////////////////////////////////////////////////////////////////////// 579 template<> struct FormatTraits<X32_TYPELESS_G8X24_UINT> : 580 ComponentTraits<SWR_TYPE_UINT, 32, SWR_TYPE_UNUSED, 32>, 581 FormatSwizzle<0, 1>, 582 Defaults<0, 0, 0, 0x1> 583 { 584 static const uint32_t bpp{ 64 }; 585 static const uint32_t numComps{ 1 }; 586 static const bool hasAlpha{ false }; 587 static const uint32_t alphaComp{ 3 }; 588 static const bool isSRGB{ false }; 589 static const bool isBC{ false }; 590 static const bool isSubsampled{ false }; 591 static const uint32_t bcWidth{ 1 }; 592 static const uint32_t bcHeight{ 1 }; 593 594 typedef Transpose32_32 TransposeT; 595 typedef Format2<32, 32> FormatT; 596 }; 597 598 ////////////////////////////////////////////////////////////////////////// 599 /// FormatTraits<L32A32_FLOAT> - Format traits specialization for L32A32_FLOAT 600 ////////////////////////////////////////////////////////////////////////// 601 template<> struct FormatTraits<L32A32_FLOAT> : 602 ComponentTraits<SWR_TYPE_FLOAT, 32, SWR_TYPE_FLOAT, 32>, 603 FormatSwizzle<0, 3>, 604 Defaults<0, 0, 0, 0x3f800000> 605 { 606 static const uint32_t bpp{ 64 }; 607 static const uint32_t numComps{ 2 }; 608 static const bool hasAlpha{ true }; 609 static const uint32_t alphaComp{ 1 }; 610 static const bool isSRGB{ false }; 611 static const bool isBC{ false }; 612 static const bool isSubsampled{ false }; 613 static const uint32_t bcWidth{ 1 }; 614 static const uint32_t bcHeight{ 1 }; 615 616 typedef Transpose32_32 TransposeT; 617 typedef Format2<32, 32> FormatT; 618 }; 619 620 ////////////////////////////////////////////////////////////////////////// 621 /// FormatTraits<R64_FLOAT> - Format traits specialization for R64_FLOAT 622 ////////////////////////////////////////////////////////////////////////// 623 template<> struct FormatTraits<R64_FLOAT> : 624 ComponentTraits<SWR_TYPE_FLOAT, 64>, 625 FormatSwizzle<0>, 626 Defaults<0, 0, 0, 0x3f800000> 627 { 628 static const uint32_t bpp{ 64 }; 629 static const uint32_t numComps{ 1 }; 630 static const bool hasAlpha{ false }; 631 static const uint32_t alphaComp{ 0 }; 632 static const bool isSRGB{ false }; 633 static const bool isBC{ false }; 634 static const bool isSubsampled{ false }; 635 static const uint32_t bcWidth{ 1 }; 636 static const uint32_t bcHeight{ 1 }; 637 638 typedef TransposeSingleComponent<64> TransposeT; 639 typedef Format1<64> FormatT; 640 }; 641 642 ////////////////////////////////////////////////////////////////////////// 643 /// FormatTraits<R16G16B16X16_UNORM> - Format traits specialization for R16G16B16X16_UNORM 644 ////////////////////////////////////////////////////////////////////////// 645 template<> struct FormatTraits<R16G16B16X16_UNORM> : 646 ComponentTraits<SWR_TYPE_UNORM, 16, SWR_TYPE_UNORM, 16, SWR_TYPE_UNORM, 16, SWR_TYPE_UNUSED, 16>, 647 FormatSwizzle<0, 1, 2, 3>, 648 Defaults<0, 0, 0, 0x3f800000> 649 { 650 static const uint32_t bpp{ 64 }; 651 static const uint32_t numComps{ 3 }; 652 static const bool hasAlpha{ false }; 653 static const uint32_t alphaComp{ 0 }; 654 static const bool isSRGB{ false }; 655 static const bool isBC{ false }; 656 static const bool isSubsampled{ false }; 657 static const uint32_t bcWidth{ 1 }; 658 static const uint32_t bcHeight{ 1 }; 659 660 typedef Transpose16_16_16_16 TransposeT; 661 typedef Format4<16, 16, 16, 16> FormatT; 662 }; 663 664 ////////////////////////////////////////////////////////////////////////// 665 /// FormatTraits<R16G16B16X16_FLOAT> - Format traits specialization for R16G16B16X16_FLOAT 666 ////////////////////////////////////////////////////////////////////////// 667 template<> struct FormatTraits<R16G16B16X16_FLOAT> : 668 ComponentTraits<SWR_TYPE_FLOAT, 16, SWR_TYPE_FLOAT, 16, SWR_TYPE_FLOAT, 16, SWR_TYPE_UNUSED, 16>, 669 FormatSwizzle<0, 1, 2, 3>, 670 Defaults<0, 0, 0, 0x3f800000> 671 { 672 static const uint32_t bpp{ 64 }; 673 static const uint32_t numComps{ 3 }; 674 static const bool hasAlpha{ false }; 675 static const uint32_t alphaComp{ 0 }; 676 static const bool isSRGB{ false }; 677 static const bool isBC{ false }; 678 static const bool isSubsampled{ false }; 679 static const uint32_t bcWidth{ 1 }; 680 static const uint32_t bcHeight{ 1 }; 681 682 typedef Transpose16_16_16_16 TransposeT; 683 typedef Format4<16, 16, 16, 16> FormatT; 684 }; 685 686 ////////////////////////////////////////////////////////////////////////// 687 /// FormatTraits<L32X32_FLOAT> - Format traits specialization for L32X32_FLOAT 688 ////////////////////////////////////////////////////////////////////////// 689 template<> struct FormatTraits<L32X32_FLOAT> : 690 ComponentTraits<SWR_TYPE_FLOAT, 32, SWR_TYPE_FLOAT, 32>, 691 FormatSwizzle<0, 3>, 692 Defaults<0, 0, 0, 0x3f800000> 693 { 694 static const uint32_t bpp{ 64 }; 695 static const uint32_t numComps{ 2 }; 696 static const bool hasAlpha{ false }; 697 static const uint32_t alphaComp{ 0 }; 698 static const bool isSRGB{ false }; 699 static const bool isBC{ false }; 700 static const bool isSubsampled{ false }; 701 static const uint32_t bcWidth{ 1 }; 702 static const uint32_t bcHeight{ 1 }; 703 704 typedef Transpose32_32 TransposeT; 705 typedef Format2<32, 32> FormatT; 706 }; 707 708 ////////////////////////////////////////////////////////////////////////// 709 /// FormatTraits<I32X32_FLOAT> - Format traits specialization for I32X32_FLOAT 710 ////////////////////////////////////////////////////////////////////////// 711 template<> struct FormatTraits<I32X32_FLOAT> : 712 ComponentTraits<SWR_TYPE_FLOAT, 32, SWR_TYPE_FLOAT, 32>, 713 FormatSwizzle<0, 3>, 714 Defaults<0, 0, 0, 0x3f800000> 715 { 716 static const uint32_t bpp{ 64 }; 717 static const uint32_t numComps{ 2 }; 718 static const bool hasAlpha{ false }; 719 static const uint32_t alphaComp{ 0 }; 720 static const bool isSRGB{ false }; 721 static const bool isBC{ false }; 722 static const bool isSubsampled{ false }; 723 static const uint32_t bcWidth{ 1 }; 724 static const uint32_t bcHeight{ 1 }; 725 726 typedef Transpose32_32 TransposeT; 727 typedef Format2<32, 32> FormatT; 728 }; 729 730 ////////////////////////////////////////////////////////////////////////// 731 /// FormatTraits<R16G16B16A16_SSCALED> - Format traits specialization for R16G16B16A16_SSCALED 732 ////////////////////////////////////////////////////////////////////////// 733 template<> struct FormatTraits<R16G16B16A16_SSCALED> : 734 ComponentTraits<SWR_TYPE_SSCALED, 16, SWR_TYPE_SSCALED, 16, SWR_TYPE_SSCALED, 16, SWR_TYPE_SSCALED, 16>, 735 FormatSwizzle<0, 1, 2, 3>, 736 Defaults<0, 0, 0, 0x3f800000> 737 { 738 static const uint32_t bpp{ 64 }; 739 static const uint32_t numComps{ 4 }; 740 static const bool hasAlpha{ true }; 741 static const uint32_t alphaComp{ 3 }; 742 static const bool isSRGB{ false }; 743 static const bool isBC{ false }; 744 static const bool isSubsampled{ false }; 745 static const uint32_t bcWidth{ 1 }; 746 static const uint32_t bcHeight{ 1 }; 747 748 typedef Transpose16_16_16_16 TransposeT; 749 typedef Format4<16, 16, 16, 16> FormatT; 750 }; 751 752 ////////////////////////////////////////////////////////////////////////// 753 /// FormatTraits<R16G16B16A16_USCALED> - Format traits specialization for R16G16B16A16_USCALED 754 ////////////////////////////////////////////////////////////////////////// 755 template<> struct FormatTraits<R16G16B16A16_USCALED> : 756 ComponentTraits<SWR_TYPE_USCALED, 16, SWR_TYPE_USCALED, 16, SWR_TYPE_USCALED, 16, SWR_TYPE_USCALED, 16>, 757 FormatSwizzle<0, 1, 2, 3>, 758 Defaults<0, 0, 0, 0x3f800000> 759 { 760 static const uint32_t bpp{ 64 }; 761 static const uint32_t numComps{ 4 }; 762 static const bool hasAlpha{ true }; 763 static const uint32_t alphaComp{ 3 }; 764 static const bool isSRGB{ false }; 765 static const bool isBC{ false }; 766 static const bool isSubsampled{ false }; 767 static const uint32_t bcWidth{ 1 }; 768 static const uint32_t bcHeight{ 1 }; 769 770 typedef Transpose16_16_16_16 TransposeT; 771 typedef Format4<16, 16, 16, 16> FormatT; 772 }; 773 774 ////////////////////////////////////////////////////////////////////////// 775 /// FormatTraits<R32G32_SSCALED> - Format traits specialization for R32G32_SSCALED 776 ////////////////////////////////////////////////////////////////////////// 777 template<> struct FormatTraits<R32G32_SSCALED> : 778 ComponentTraits<SWR_TYPE_SSCALED, 32, SWR_TYPE_SSCALED, 32>, 779 FormatSwizzle<0, 1>, 780 Defaults<0, 0, 0, 0x3f800000> 781 { 782 static const uint32_t bpp{ 64 }; 783 static const uint32_t numComps{ 2 }; 784 static const bool hasAlpha{ false }; 785 static const uint32_t alphaComp{ 0 }; 786 static const bool isSRGB{ false }; 787 static const bool isBC{ false }; 788 static const bool isSubsampled{ false }; 789 static const uint32_t bcWidth{ 1 }; 790 static const uint32_t bcHeight{ 1 }; 791 792 typedef Transpose32_32 TransposeT; 793 typedef Format2<32, 32> FormatT; 794 }; 795 796 ////////////////////////////////////////////////////////////////////////// 797 /// FormatTraits<R32G32_USCALED> - Format traits specialization for R32G32_USCALED 798 ////////////////////////////////////////////////////////////////////////// 799 template<> struct FormatTraits<R32G32_USCALED> : 800 ComponentTraits<SWR_TYPE_USCALED, 32, SWR_TYPE_USCALED, 32>, 801 FormatSwizzle<0, 1>, 802 Defaults<0, 0, 0, 0x3f800000> 803 { 804 static const uint32_t bpp{ 64 }; 805 static const uint32_t numComps{ 2 }; 806 static const bool hasAlpha{ false }; 807 static const uint32_t alphaComp{ 0 }; 808 static const bool isSRGB{ false }; 809 static const bool isBC{ false }; 810 static const bool isSubsampled{ false }; 811 static const uint32_t bcWidth{ 1 }; 812 static const uint32_t bcHeight{ 1 }; 813 814 typedef Transpose32_32 TransposeT; 815 typedef Format2<32, 32> FormatT; 816 }; 817 818 ////////////////////////////////////////////////////////////////////////// 819 /// FormatTraits<R32G32_SFIXED> - Format traits specialization for R32G32_SFIXED 820 ////////////////////////////////////////////////////////////////////////// 821 template<> struct FormatTraits<R32G32_SFIXED> : 822 ComponentTraits<SWR_TYPE_SFIXED, 32, SWR_TYPE_SFIXED, 32>, 823 FormatSwizzle<0, 1>, 824 Defaults<0, 0, 0, 0x3f800000> 825 { 826 static const uint32_t bpp{ 64 }; 827 static const uint32_t numComps{ 2 }; 828 static const bool hasAlpha{ false }; 829 static const uint32_t alphaComp{ 0 }; 830 static const bool isSRGB{ false }; 831 static const bool isBC{ false }; 832 static const bool isSubsampled{ false }; 833 static const uint32_t bcWidth{ 1 }; 834 static const uint32_t bcHeight{ 1 }; 835 836 typedef Transpose32_32 TransposeT; 837 typedef Format2<32, 32> FormatT; 838 }; 839 840 ////////////////////////////////////////////////////////////////////////// 841 /// FormatTraits<B8G8R8A8_UNORM> - Format traits specialization for B8G8R8A8_UNORM 842 ////////////////////////////////////////////////////////////////////////// 843 template<> struct FormatTraits<B8G8R8A8_UNORM> : 844 ComponentTraits<SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8>, 845 FormatSwizzle<2, 1, 0, 3>, 846 Defaults<0, 0, 0, 0x3f800000> 847 { 848 static const uint32_t bpp{ 32 }; 849 static const uint32_t numComps{ 4 }; 850 static const bool hasAlpha{ true }; 851 static const uint32_t alphaComp{ 3 }; 852 static const bool isSRGB{ false }; 853 static const bool isBC{ false }; 854 static const bool isSubsampled{ false }; 855 static const uint32_t bcWidth{ 1 }; 856 static const uint32_t bcHeight{ 1 }; 857 858 typedef Transpose8_8_8_8 TransposeT; 859 typedef Format4<8, 8, 8, 8> FormatT; 860 }; 861 862 ////////////////////////////////////////////////////////////////////////// 863 /// FormatTraits<B8G8R8A8_UNORM_SRGB> - Format traits specialization for B8G8R8A8_UNORM_SRGB 864 ////////////////////////////////////////////////////////////////////////// 865 template<> struct FormatTraits<B8G8R8A8_UNORM_SRGB> : 866 ComponentTraits<SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8>, 867 FormatSwizzle<2, 1, 0, 3>, 868 Defaults<0, 0, 0, 0x3f800000> 869 { 870 static const uint32_t bpp{ 32 }; 871 static const uint32_t numComps{ 4 }; 872 static const bool hasAlpha{ true }; 873 static const uint32_t alphaComp{ 3 }; 874 static const bool isSRGB{ true }; 875 static const bool isBC{ false }; 876 static const bool isSubsampled{ false }; 877 static const uint32_t bcWidth{ 1 }; 878 static const uint32_t bcHeight{ 1 }; 879 880 typedef Transpose8_8_8_8 TransposeT; 881 typedef Format4<8, 8, 8, 8> FormatT; 882 }; 883 884 ////////////////////////////////////////////////////////////////////////// 885 /// FormatTraits<R10G10B10A2_UNORM> - Format traits specialization for R10G10B10A2_UNORM 886 ////////////////////////////////////////////////////////////////////////// 887 template<> struct FormatTraits<R10G10B10A2_UNORM> : 888 ComponentTraits<SWR_TYPE_UNORM, 10, SWR_TYPE_UNORM, 10, SWR_TYPE_UNORM, 10, SWR_TYPE_UNORM, 2>, 889 FormatSwizzle<0, 1, 2, 3>, 890 Defaults<0, 0, 0, 0x3f800000> 891 { 892 static const uint32_t bpp{ 32 }; 893 static const uint32_t numComps{ 4 }; 894 static const bool hasAlpha{ true }; 895 static const uint32_t alphaComp{ 3 }; 896 static const bool isSRGB{ false }; 897 static const bool isBC{ false }; 898 static const bool isSubsampled{ false }; 899 static const uint32_t bcWidth{ 1 }; 900 static const uint32_t bcHeight{ 1 }; 901 902 typedef Transpose10_10_10_2 TransposeT; 903 typedef Format4<10, 10, 10, 2> FormatT; 904 }; 905 906 ////////////////////////////////////////////////////////////////////////// 907 /// FormatTraits<R10G10B10A2_UNORM_SRGB> - Format traits specialization for R10G10B10A2_UNORM_SRGB 908 ////////////////////////////////////////////////////////////////////////// 909 template<> struct FormatTraits<R10G10B10A2_UNORM_SRGB> : 910 ComponentTraits<SWR_TYPE_UNORM, 10, SWR_TYPE_UNORM, 10, SWR_TYPE_UNORM, 10, SWR_TYPE_UNORM, 2>, 911 FormatSwizzle<0, 1, 2, 3>, 912 Defaults<0, 0, 0, 0x3f800000> 913 { 914 static const uint32_t bpp{ 32 }; 915 static const uint32_t numComps{ 4 }; 916 static const bool hasAlpha{ true }; 917 static const uint32_t alphaComp{ 3 }; 918 static const bool isSRGB{ true }; 919 static const bool isBC{ false }; 920 static const bool isSubsampled{ false }; 921 static const uint32_t bcWidth{ 1 }; 922 static const uint32_t bcHeight{ 1 }; 923 924 typedef Transpose10_10_10_2 TransposeT; 925 typedef Format4<10, 10, 10, 2> FormatT; 926 }; 927 928 ////////////////////////////////////////////////////////////////////////// 929 /// FormatTraits<R10G10B10A2_UINT> - Format traits specialization for R10G10B10A2_UINT 930 ////////////////////////////////////////////////////////////////////////// 931 template<> struct FormatTraits<R10G10B10A2_UINT> : 932 ComponentTraits<SWR_TYPE_UINT, 10, SWR_TYPE_UINT, 10, SWR_TYPE_UINT, 10, SWR_TYPE_UINT, 2>, 933 FormatSwizzle<0, 1, 2, 3>, 934 Defaults<0, 0, 0, 0x1> 935 { 936 static const uint32_t bpp{ 32 }; 937 static const uint32_t numComps{ 4 }; 938 static const bool hasAlpha{ true }; 939 static const uint32_t alphaComp{ 3 }; 940 static const bool isSRGB{ false }; 941 static const bool isBC{ false }; 942 static const bool isSubsampled{ false }; 943 static const uint32_t bcWidth{ 1 }; 944 static const uint32_t bcHeight{ 1 }; 945 946 typedef Transpose10_10_10_2 TransposeT; 947 typedef Format4<10, 10, 10, 2> FormatT; 948 }; 949 950 ////////////////////////////////////////////////////////////////////////// 951 /// FormatTraits<R8G8B8A8_UNORM> - Format traits specialization for R8G8B8A8_UNORM 952 ////////////////////////////////////////////////////////////////////////// 953 template<> struct FormatTraits<R8G8B8A8_UNORM> : 954 ComponentTraits<SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8>, 955 FormatSwizzle<0, 1, 2, 3>, 956 Defaults<0, 0, 0, 0x3f800000> 957 { 958 static const uint32_t bpp{ 32 }; 959 static const uint32_t numComps{ 4 }; 960 static const bool hasAlpha{ true }; 961 static const uint32_t alphaComp{ 3 }; 962 static const bool isSRGB{ false }; 963 static const bool isBC{ false }; 964 static const bool isSubsampled{ false }; 965 static const uint32_t bcWidth{ 1 }; 966 static const uint32_t bcHeight{ 1 }; 967 968 typedef Transpose8_8_8_8 TransposeT; 969 typedef Format4<8, 8, 8, 8> FormatT; 970 }; 971 972 ////////////////////////////////////////////////////////////////////////// 973 /// FormatTraits<R8G8B8A8_UNORM_SRGB> - Format traits specialization for R8G8B8A8_UNORM_SRGB 974 ////////////////////////////////////////////////////////////////////////// 975 template<> struct FormatTraits<R8G8B8A8_UNORM_SRGB> : 976 ComponentTraits<SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8>, 977 FormatSwizzle<0, 1, 2, 3>, 978 Defaults<0, 0, 0, 0x3f800000> 979 { 980 static const uint32_t bpp{ 32 }; 981 static const uint32_t numComps{ 4 }; 982 static const bool hasAlpha{ true }; 983 static const uint32_t alphaComp{ 3 }; 984 static const bool isSRGB{ true }; 985 static const bool isBC{ false }; 986 static const bool isSubsampled{ false }; 987 static const uint32_t bcWidth{ 1 }; 988 static const uint32_t bcHeight{ 1 }; 989 990 typedef Transpose8_8_8_8 TransposeT; 991 typedef Format4<8, 8, 8, 8> FormatT; 992 }; 993 994 ////////////////////////////////////////////////////////////////////////// 995 /// FormatTraits<R8G8B8A8_SNORM> - Format traits specialization for R8G8B8A8_SNORM 996 ////////////////////////////////////////////////////////////////////////// 997 template<> struct FormatTraits<R8G8B8A8_SNORM> : 998 ComponentTraits<SWR_TYPE_SNORM, 8, SWR_TYPE_SNORM, 8, SWR_TYPE_SNORM, 8, SWR_TYPE_SNORM, 8>, 999 FormatSwizzle<0, 1, 2, 3>, 1000 Defaults<0, 0, 0, 0x3f800000> 1001 { 1002 static const uint32_t bpp{ 32 }; 1003 static const uint32_t numComps{ 4 }; 1004 static const bool hasAlpha{ true }; 1005 static const uint32_t alphaComp{ 3 }; 1006 static const bool isSRGB{ false }; 1007 static const bool isBC{ false }; 1008 static const bool isSubsampled{ false }; 1009 static const uint32_t bcWidth{ 1 }; 1010 static const uint32_t bcHeight{ 1 }; 1011 1012 typedef Transpose8_8_8_8 TransposeT; 1013 typedef Format4<8, 8, 8, 8> FormatT; 1014 }; 1015 1016 ////////////////////////////////////////////////////////////////////////// 1017 /// FormatTraits<R8G8B8A8_SINT> - Format traits specialization for R8G8B8A8_SINT 1018 ////////////////////////////////////////////////////////////////////////// 1019 template<> struct FormatTraits<R8G8B8A8_SINT> : 1020 ComponentTraits<SWR_TYPE_SINT, 8, SWR_TYPE_SINT, 8, SWR_TYPE_SINT, 8, SWR_TYPE_SINT, 8>, 1021 FormatSwizzle<0, 1, 2, 3>, 1022 Defaults<0, 0, 0, 0x1> 1023 { 1024 static const uint32_t bpp{ 32 }; 1025 static const uint32_t numComps{ 4 }; 1026 static const bool hasAlpha{ true }; 1027 static const uint32_t alphaComp{ 3 }; 1028 static const bool isSRGB{ false }; 1029 static const bool isBC{ false }; 1030 static const bool isSubsampled{ false }; 1031 static const uint32_t bcWidth{ 1 }; 1032 static const uint32_t bcHeight{ 1 }; 1033 1034 typedef Transpose8_8_8_8 TransposeT; 1035 typedef Format4<8, 8, 8, 8> FormatT; 1036 }; 1037 1038 ////////////////////////////////////////////////////////////////////////// 1039 /// FormatTraits<R8G8B8A8_UINT> - Format traits specialization for R8G8B8A8_UINT 1040 ////////////////////////////////////////////////////////////////////////// 1041 template<> struct FormatTraits<R8G8B8A8_UINT> : 1042 ComponentTraits<SWR_TYPE_UINT, 8, SWR_TYPE_UINT, 8, SWR_TYPE_UINT, 8, SWR_TYPE_UINT, 8>, 1043 FormatSwizzle<0, 1, 2, 3>, 1044 Defaults<0, 0, 0, 0x1> 1045 { 1046 static const uint32_t bpp{ 32 }; 1047 static const uint32_t numComps{ 4 }; 1048 static const bool hasAlpha{ true }; 1049 static const uint32_t alphaComp{ 3 }; 1050 static const bool isSRGB{ false }; 1051 static const bool isBC{ false }; 1052 static const bool isSubsampled{ false }; 1053 static const uint32_t bcWidth{ 1 }; 1054 static const uint32_t bcHeight{ 1 }; 1055 1056 typedef Transpose8_8_8_8 TransposeT; 1057 typedef Format4<8, 8, 8, 8> FormatT; 1058 }; 1059 1060 ////////////////////////////////////////////////////////////////////////// 1061 /// FormatTraits<R16G16_UNORM> - Format traits specialization for R16G16_UNORM 1062 ////////////////////////////////////////////////////////////////////////// 1063 template<> struct FormatTraits<R16G16_UNORM> : 1064 ComponentTraits<SWR_TYPE_UNORM, 16, SWR_TYPE_UNORM, 16>, 1065 FormatSwizzle<0, 1>, 1066 Defaults<0, 0, 0, 0x3f800000> 1067 { 1068 static const uint32_t bpp{ 32 }; 1069 static const uint32_t numComps{ 2 }; 1070 static const bool hasAlpha{ false }; 1071 static const uint32_t alphaComp{ 0 }; 1072 static const bool isSRGB{ false }; 1073 static const bool isBC{ false }; 1074 static const bool isSubsampled{ false }; 1075 static const uint32_t bcWidth{ 1 }; 1076 static const uint32_t bcHeight{ 1 }; 1077 1078 typedef Transpose16_16 TransposeT; 1079 typedef Format2<16, 16> FormatT; 1080 }; 1081 1082 ////////////////////////////////////////////////////////////////////////// 1083 /// FormatTraits<R16G16_SNORM> - Format traits specialization for R16G16_SNORM 1084 ////////////////////////////////////////////////////////////////////////// 1085 template<> struct FormatTraits<R16G16_SNORM> : 1086 ComponentTraits<SWR_TYPE_SNORM, 16, SWR_TYPE_SNORM, 16>, 1087 FormatSwizzle<0, 1>, 1088 Defaults<0, 0, 0, 0x3f800000> 1089 { 1090 static const uint32_t bpp{ 32 }; 1091 static const uint32_t numComps{ 2 }; 1092 static const bool hasAlpha{ false }; 1093 static const uint32_t alphaComp{ 0 }; 1094 static const bool isSRGB{ false }; 1095 static const bool isBC{ false }; 1096 static const bool isSubsampled{ false }; 1097 static const uint32_t bcWidth{ 1 }; 1098 static const uint32_t bcHeight{ 1 }; 1099 1100 typedef Transpose16_16 TransposeT; 1101 typedef Format2<16, 16> FormatT; 1102 }; 1103 1104 ////////////////////////////////////////////////////////////////////////// 1105 /// FormatTraits<R16G16_SINT> - Format traits specialization for R16G16_SINT 1106 ////////////////////////////////////////////////////////////////////////// 1107 template<> struct FormatTraits<R16G16_SINT> : 1108 ComponentTraits<SWR_TYPE_SINT, 16, SWR_TYPE_SINT, 16>, 1109 FormatSwizzle<0, 1>, 1110 Defaults<0, 0, 0, 0x1> 1111 { 1112 static const uint32_t bpp{ 32 }; 1113 static const uint32_t numComps{ 2 }; 1114 static const bool hasAlpha{ false }; 1115 static const uint32_t alphaComp{ 0 }; 1116 static const bool isSRGB{ false }; 1117 static const bool isBC{ false }; 1118 static const bool isSubsampled{ false }; 1119 static const uint32_t bcWidth{ 1 }; 1120 static const uint32_t bcHeight{ 1 }; 1121 1122 typedef Transpose16_16 TransposeT; 1123 typedef Format2<16, 16> FormatT; 1124 }; 1125 1126 ////////////////////////////////////////////////////////////////////////// 1127 /// FormatTraits<R16G16_UINT> - Format traits specialization for R16G16_UINT 1128 ////////////////////////////////////////////////////////////////////////// 1129 template<> struct FormatTraits<R16G16_UINT> : 1130 ComponentTraits<SWR_TYPE_UINT, 16, SWR_TYPE_UINT, 16>, 1131 FormatSwizzle<0, 1>, 1132 Defaults<0, 0, 0, 0x1> 1133 { 1134 static const uint32_t bpp{ 32 }; 1135 static const uint32_t numComps{ 2 }; 1136 static const bool hasAlpha{ false }; 1137 static const uint32_t alphaComp{ 0 }; 1138 static const bool isSRGB{ false }; 1139 static const bool isBC{ false }; 1140 static const bool isSubsampled{ false }; 1141 static const uint32_t bcWidth{ 1 }; 1142 static const uint32_t bcHeight{ 1 }; 1143 1144 typedef Transpose16_16 TransposeT; 1145 typedef Format2<16, 16> FormatT; 1146 }; 1147 1148 ////////////////////////////////////////////////////////////////////////// 1149 /// FormatTraits<R16G16_FLOAT> - Format traits specialization for R16G16_FLOAT 1150 ////////////////////////////////////////////////////////////////////////// 1151 template<> struct FormatTraits<R16G16_FLOAT> : 1152 ComponentTraits<SWR_TYPE_FLOAT, 16, SWR_TYPE_FLOAT, 16>, 1153 FormatSwizzle<0, 1>, 1154 Defaults<0, 0, 0, 0x3f800000> 1155 { 1156 static const uint32_t bpp{ 32 }; 1157 static const uint32_t numComps{ 2 }; 1158 static const bool hasAlpha{ false }; 1159 static const uint32_t alphaComp{ 0 }; 1160 static const bool isSRGB{ false }; 1161 static const bool isBC{ false }; 1162 static const bool isSubsampled{ false }; 1163 static const uint32_t bcWidth{ 1 }; 1164 static const uint32_t bcHeight{ 1 }; 1165 1166 typedef Transpose16_16 TransposeT; 1167 typedef Format2<16, 16> FormatT; 1168 }; 1169 1170 ////////////////////////////////////////////////////////////////////////// 1171 /// FormatTraits<B10G10R10A2_UNORM> - Format traits specialization for B10G10R10A2_UNORM 1172 ////////////////////////////////////////////////////////////////////////// 1173 template<> struct FormatTraits<B10G10R10A2_UNORM> : 1174 ComponentTraits<SWR_TYPE_UNORM, 10, SWR_TYPE_UNORM, 10, SWR_TYPE_UNORM, 10, SWR_TYPE_UNORM, 2>, 1175 FormatSwizzle<2, 1, 0, 3>, 1176 Defaults<0, 0, 0, 0x3f800000> 1177 { 1178 static const uint32_t bpp{ 32 }; 1179 static const uint32_t numComps{ 4 }; 1180 static const bool hasAlpha{ true }; 1181 static const uint32_t alphaComp{ 3 }; 1182 static const bool isSRGB{ false }; 1183 static const bool isBC{ false }; 1184 static const bool isSubsampled{ false }; 1185 static const uint32_t bcWidth{ 1 }; 1186 static const uint32_t bcHeight{ 1 }; 1187 1188 typedef Transpose10_10_10_2 TransposeT; 1189 typedef Format4<10, 10, 10, 2> FormatT; 1190 }; 1191 1192 ////////////////////////////////////////////////////////////////////////// 1193 /// FormatTraits<B10G10R10A2_UNORM_SRGB> - Format traits specialization for B10G10R10A2_UNORM_SRGB 1194 ////////////////////////////////////////////////////////////////////////// 1195 template<> struct FormatTraits<B10G10R10A2_UNORM_SRGB> : 1196 ComponentTraits<SWR_TYPE_UNORM, 10, SWR_TYPE_UNORM, 10, SWR_TYPE_UNORM, 10, SWR_TYPE_UNORM, 2>, 1197 FormatSwizzle<2, 1, 0, 3>, 1198 Defaults<0, 0, 0, 0x3f800000> 1199 { 1200 static const uint32_t bpp{ 32 }; 1201 static const uint32_t numComps{ 4 }; 1202 static const bool hasAlpha{ true }; 1203 static const uint32_t alphaComp{ 3 }; 1204 static const bool isSRGB{ true }; 1205 static const bool isBC{ false }; 1206 static const bool isSubsampled{ false }; 1207 static const uint32_t bcWidth{ 1 }; 1208 static const uint32_t bcHeight{ 1 }; 1209 1210 typedef Transpose10_10_10_2 TransposeT; 1211 typedef Format4<10, 10, 10, 2> FormatT; 1212 }; 1213 1214 ////////////////////////////////////////////////////////////////////////// 1215 /// FormatTraits<R11G11B10_FLOAT> - Format traits specialization for R11G11B10_FLOAT 1216 ////////////////////////////////////////////////////////////////////////// 1217 template<> struct FormatTraits<R11G11B10_FLOAT> : 1218 ComponentTraits<SWR_TYPE_FLOAT, 11, SWR_TYPE_FLOAT, 11, SWR_TYPE_FLOAT, 10>, 1219 FormatSwizzle<0, 1, 2>, 1220 Defaults<0, 0, 0, 0x3f800000> 1221 { 1222 static const uint32_t bpp{ 32 }; 1223 static const uint32_t numComps{ 3 }; 1224 static const bool hasAlpha{ false }; 1225 static const uint32_t alphaComp{ 0 }; 1226 static const bool isSRGB{ false }; 1227 static const bool isBC{ false }; 1228 static const bool isSubsampled{ false }; 1229 static const uint32_t bcWidth{ 1 }; 1230 static const uint32_t bcHeight{ 1 }; 1231 1232 typedef Transpose11_11_10 TransposeT; 1233 typedef Format3<11, 11, 10> FormatT; 1234 }; 1235 1236 ////////////////////////////////////////////////////////////////////////// 1237 /// FormatTraits<R10G10B10_FLOAT_A2_UNORM> - Format traits specialization for R10G10B10_FLOAT_A2_UNORM 1238 ////////////////////////////////////////////////////////////////////////// 1239 template<> struct FormatTraits<R10G10B10_FLOAT_A2_UNORM> : 1240 ComponentTraits<SWR_TYPE_FLOAT, 10, SWR_TYPE_FLOAT, 10, SWR_TYPE_FLOAT, 10, SWR_TYPE_FLOAT, 2>, 1241 FormatSwizzle<0, 1, 2, 3>, 1242 Defaults<0, 0, 0, 0x3f800000> 1243 { 1244 static const uint32_t bpp{ 32 }; 1245 static const uint32_t numComps{ 4 }; 1246 static const bool hasAlpha{ true }; 1247 static const uint32_t alphaComp{ 3 }; 1248 static const bool isSRGB{ false }; 1249 static const bool isBC{ false }; 1250 static const bool isSubsampled{ false }; 1251 static const uint32_t bcWidth{ 1 }; 1252 static const uint32_t bcHeight{ 1 }; 1253 1254 typedef Transpose10_10_10_2 TransposeT; 1255 typedef Format4<10, 10, 10, 2> FormatT; 1256 }; 1257 1258 ////////////////////////////////////////////////////////////////////////// 1259 /// FormatTraits<R32_SINT> - Format traits specialization for R32_SINT 1260 ////////////////////////////////////////////////////////////////////////// 1261 template<> struct FormatTraits<R32_SINT> : 1262 ComponentTraits<SWR_TYPE_SINT, 32>, 1263 FormatSwizzle<0>, 1264 Defaults<0, 0, 0, 0x1> 1265 { 1266 static const uint32_t bpp{ 32 }; 1267 static const uint32_t numComps{ 1 }; 1268 static const bool hasAlpha{ false }; 1269 static const uint32_t alphaComp{ 0 }; 1270 static const bool isSRGB{ false }; 1271 static const bool isBC{ false }; 1272 static const bool isSubsampled{ false }; 1273 static const uint32_t bcWidth{ 1 }; 1274 static const uint32_t bcHeight{ 1 }; 1275 1276 typedef TransposeSingleComponent<32> TransposeT; 1277 typedef Format1<32> FormatT; 1278 }; 1279 1280 ////////////////////////////////////////////////////////////////////////// 1281 /// FormatTraits<R32_UINT> - Format traits specialization for R32_UINT 1282 ////////////////////////////////////////////////////////////////////////// 1283 template<> struct FormatTraits<R32_UINT> : 1284 ComponentTraits<SWR_TYPE_UINT, 32>, 1285 FormatSwizzle<0>, 1286 Defaults<0, 0, 0, 0x1> 1287 { 1288 static const uint32_t bpp{ 32 }; 1289 static const uint32_t numComps{ 1 }; 1290 static const bool hasAlpha{ false }; 1291 static const uint32_t alphaComp{ 0 }; 1292 static const bool isSRGB{ false }; 1293 static const bool isBC{ false }; 1294 static const bool isSubsampled{ false }; 1295 static const uint32_t bcWidth{ 1 }; 1296 static const uint32_t bcHeight{ 1 }; 1297 1298 typedef TransposeSingleComponent<32> TransposeT; 1299 typedef Format1<32> FormatT; 1300 }; 1301 1302 ////////////////////////////////////////////////////////////////////////// 1303 /// FormatTraits<R32_FLOAT> - Format traits specialization for R32_FLOAT 1304 ////////////////////////////////////////////////////////////////////////// 1305 template<> struct FormatTraits<R32_FLOAT> : 1306 ComponentTraits<SWR_TYPE_FLOAT, 32>, 1307 FormatSwizzle<0>, 1308 Defaults<0, 0, 0, 0x3f800000> 1309 { 1310 static const uint32_t bpp{ 32 }; 1311 static const uint32_t numComps{ 1 }; 1312 static const bool hasAlpha{ false }; 1313 static const uint32_t alphaComp{ 0 }; 1314 static const bool isSRGB{ false }; 1315 static const bool isBC{ false }; 1316 static const bool isSubsampled{ false }; 1317 static const uint32_t bcWidth{ 1 }; 1318 static const uint32_t bcHeight{ 1 }; 1319 1320 typedef TransposeSingleComponent<32> TransposeT; 1321 typedef Format1<32> FormatT; 1322 }; 1323 1324 ////////////////////////////////////////////////////////////////////////// 1325 /// FormatTraits<R24_UNORM_X8_TYPELESS> - Format traits specialization for R24_UNORM_X8_TYPELESS 1326 ////////////////////////////////////////////////////////////////////////// 1327 template<> struct FormatTraits<R24_UNORM_X8_TYPELESS> : 1328 ComponentTraits<SWR_TYPE_UNORM, 24>, 1329 FormatSwizzle<0>, 1330 Defaults<0, 0, 0, 0x3f800000> 1331 { 1332 static const uint32_t bpp{ 32 }; 1333 static const uint32_t numComps{ 1 }; 1334 static const bool hasAlpha{ false }; 1335 static const uint32_t alphaComp{ 3 }; 1336 static const bool isSRGB{ false }; 1337 static const bool isBC{ false }; 1338 static const bool isSubsampled{ false }; 1339 static const uint32_t bcWidth{ 1 }; 1340 static const uint32_t bcHeight{ 1 }; 1341 1342 typedef TransposeSingleComponent<32> TransposeT; 1343 typedef Format1<24> FormatT; 1344 }; 1345 1346 ////////////////////////////////////////////////////////////////////////// 1347 /// FormatTraits<X24_TYPELESS_G8_UINT> - Format traits specialization for X24_TYPELESS_G8_UINT 1348 ////////////////////////////////////////////////////////////////////////// 1349 template<> struct FormatTraits<X24_TYPELESS_G8_UINT> : 1350 ComponentTraits<SWR_TYPE_UINT, 32>, 1351 FormatSwizzle<1>, 1352 Defaults<0, 0, 0, 0x1> 1353 { 1354 static const uint32_t bpp{ 32 }; 1355 static const uint32_t numComps{ 1 }; 1356 static const bool hasAlpha{ false }; 1357 static const uint32_t alphaComp{ 3 }; 1358 static const bool isSRGB{ false }; 1359 static const bool isBC{ false }; 1360 static const bool isSubsampled{ false }; 1361 static const uint32_t bcWidth{ 1 }; 1362 static const uint32_t bcHeight{ 1 }; 1363 1364 typedef TransposeSingleComponent<32> TransposeT; 1365 typedef Format1<32> FormatT; 1366 }; 1367 1368 ////////////////////////////////////////////////////////////////////////// 1369 /// FormatTraits<L32_UNORM> - Format traits specialization for L32_UNORM 1370 ////////////////////////////////////////////////////////////////////////// 1371 template<> struct FormatTraits<L32_UNORM> : 1372 ComponentTraits<SWR_TYPE_UNORM, 32>, 1373 FormatSwizzle<0>, 1374 Defaults<0, 0, 0, 0x3f800000> 1375 { 1376 static const uint32_t bpp{ 32 }; 1377 static const uint32_t numComps{ 1 }; 1378 static const bool hasAlpha{ false }; 1379 static const uint32_t alphaComp{ 0 }; 1380 static const bool isSRGB{ false }; 1381 static const bool isBC{ false }; 1382 static const bool isSubsampled{ false }; 1383 static const uint32_t bcWidth{ 1 }; 1384 static const uint32_t bcHeight{ 1 }; 1385 1386 typedef TransposeSingleComponent<32> TransposeT; 1387 typedef Format1<32> FormatT; 1388 }; 1389 1390 ////////////////////////////////////////////////////////////////////////// 1391 /// FormatTraits<L16A16_UNORM> - Format traits specialization for L16A16_UNORM 1392 ////////////////////////////////////////////////////////////////////////// 1393 template<> struct FormatTraits<L16A16_UNORM> : 1394 ComponentTraits<SWR_TYPE_UNORM, 16, SWR_TYPE_UNORM, 16>, 1395 FormatSwizzle<0, 3>, 1396 Defaults<0, 0, 0, 0x3f800000> 1397 { 1398 static const uint32_t bpp{ 32 }; 1399 static const uint32_t numComps{ 2 }; 1400 static const bool hasAlpha{ true }; 1401 static const uint32_t alphaComp{ 1 }; 1402 static const bool isSRGB{ false }; 1403 static const bool isBC{ false }; 1404 static const bool isSubsampled{ false }; 1405 static const uint32_t bcWidth{ 1 }; 1406 static const uint32_t bcHeight{ 1 }; 1407 1408 typedef Transpose16_16 TransposeT; 1409 typedef Format2<16, 16> FormatT; 1410 }; 1411 1412 ////////////////////////////////////////////////////////////////////////// 1413 /// FormatTraits<I24X8_UNORM> - Format traits specialization for I24X8_UNORM 1414 ////////////////////////////////////////////////////////////////////////// 1415 template<> struct FormatTraits<I24X8_UNORM> : 1416 ComponentTraits<SWR_TYPE_UNORM, 24, SWR_TYPE_UNORM, 8>, 1417 FormatSwizzle<0, 3>, 1418 Defaults<0, 0, 0, 0x3f800000> 1419 { 1420 static const uint32_t bpp{ 32 }; 1421 static const uint32_t numComps{ 2 }; 1422 static const bool hasAlpha{ false }; 1423 static const uint32_t alphaComp{ 0 }; 1424 static const bool isSRGB{ false }; 1425 static const bool isBC{ false }; 1426 static const bool isSubsampled{ false }; 1427 static const uint32_t bcWidth{ 1 }; 1428 static const uint32_t bcHeight{ 1 }; 1429 1430 typedef Transpose24_8 TransposeT; 1431 typedef Format2<24, 8> FormatT; 1432 }; 1433 1434 ////////////////////////////////////////////////////////////////////////// 1435 /// FormatTraits<L24X8_UNORM> - Format traits specialization for L24X8_UNORM 1436 ////////////////////////////////////////////////////////////////////////// 1437 template<> struct FormatTraits<L24X8_UNORM> : 1438 ComponentTraits<SWR_TYPE_UNORM, 24, SWR_TYPE_UNORM, 8>, 1439 FormatSwizzle<0, 3>, 1440 Defaults<0, 0, 0, 0x3f800000> 1441 { 1442 static const uint32_t bpp{ 32 }; 1443 static const uint32_t numComps{ 2 }; 1444 static const bool hasAlpha{ false }; 1445 static const uint32_t alphaComp{ 0 }; 1446 static const bool isSRGB{ false }; 1447 static const bool isBC{ false }; 1448 static const bool isSubsampled{ false }; 1449 static const uint32_t bcWidth{ 1 }; 1450 static const uint32_t bcHeight{ 1 }; 1451 1452 typedef Transpose24_8 TransposeT; 1453 typedef Format2<24, 8> FormatT; 1454 }; 1455 1456 ////////////////////////////////////////////////////////////////////////// 1457 /// FormatTraits<I32_FLOAT> - Format traits specialization for I32_FLOAT 1458 ////////////////////////////////////////////////////////////////////////// 1459 template<> struct FormatTraits<I32_FLOAT> : 1460 ComponentTraits<SWR_TYPE_FLOAT, 32>, 1461 FormatSwizzle<0>, 1462 Defaults<0, 0, 0, 0x3f800000> 1463 { 1464 static const uint32_t bpp{ 32 }; 1465 static const uint32_t numComps{ 1 }; 1466 static const bool hasAlpha{ false }; 1467 static const uint32_t alphaComp{ 0 }; 1468 static const bool isSRGB{ false }; 1469 static const bool isBC{ false }; 1470 static const bool isSubsampled{ false }; 1471 static const uint32_t bcWidth{ 1 }; 1472 static const uint32_t bcHeight{ 1 }; 1473 1474 typedef TransposeSingleComponent<32> TransposeT; 1475 typedef Format1<32> FormatT; 1476 }; 1477 1478 ////////////////////////////////////////////////////////////////////////// 1479 /// FormatTraits<L32_FLOAT> - Format traits specialization for L32_FLOAT 1480 ////////////////////////////////////////////////////////////////////////// 1481 template<> struct FormatTraits<L32_FLOAT> : 1482 ComponentTraits<SWR_TYPE_FLOAT, 32>, 1483 FormatSwizzle<0>, 1484 Defaults<0, 0, 0, 0x3f800000> 1485 { 1486 static const uint32_t bpp{ 32 }; 1487 static const uint32_t numComps{ 1 }; 1488 static const bool hasAlpha{ false }; 1489 static const uint32_t alphaComp{ 0 }; 1490 static const bool isSRGB{ false }; 1491 static const bool isBC{ false }; 1492 static const bool isSubsampled{ false }; 1493 static const uint32_t bcWidth{ 1 }; 1494 static const uint32_t bcHeight{ 1 }; 1495 1496 typedef TransposeSingleComponent<32> TransposeT; 1497 typedef Format1<32> FormatT; 1498 }; 1499 1500 ////////////////////////////////////////////////////////////////////////// 1501 /// FormatTraits<A32_FLOAT> - Format traits specialization for A32_FLOAT 1502 ////////////////////////////////////////////////////////////////////////// 1503 template<> struct FormatTraits<A32_FLOAT> : 1504 ComponentTraits<SWR_TYPE_FLOAT, 32>, 1505 FormatSwizzle<3>, 1506 Defaults<0, 0, 0, 0x3f800000> 1507 { 1508 static const uint32_t bpp{ 32 }; 1509 static const uint32_t numComps{ 1 }; 1510 static const bool hasAlpha{ true }; 1511 static const uint32_t alphaComp{ 0 }; 1512 static const bool isSRGB{ false }; 1513 static const bool isBC{ false }; 1514 static const bool isSubsampled{ false }; 1515 static const uint32_t bcWidth{ 1 }; 1516 static const uint32_t bcHeight{ 1 }; 1517 1518 typedef TransposeSingleComponent<32> TransposeT; 1519 typedef Format1<32> FormatT; 1520 }; 1521 1522 ////////////////////////////////////////////////////////////////////////// 1523 /// FormatTraits<B8G8R8X8_UNORM> - Format traits specialization for B8G8R8X8_UNORM 1524 ////////////////////////////////////////////////////////////////////////// 1525 template<> struct FormatTraits<B8G8R8X8_UNORM> : 1526 ComponentTraits<SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8, SWR_TYPE_UNUSED, 8>, 1527 FormatSwizzle<2, 1, 0, 3>, 1528 Defaults<0, 0, 0, 0x3f800000> 1529 { 1530 static const uint32_t bpp{ 32 }; 1531 static const uint32_t numComps{ 3 }; 1532 static const bool hasAlpha{ false }; 1533 static const uint32_t alphaComp{ 0 }; 1534 static const bool isSRGB{ false }; 1535 static const bool isBC{ false }; 1536 static const bool isSubsampled{ false }; 1537 static const uint32_t bcWidth{ 1 }; 1538 static const uint32_t bcHeight{ 1 }; 1539 1540 typedef Transpose8_8_8_8 TransposeT; 1541 typedef Format4<8, 8, 8, 8> FormatT; 1542 }; 1543 1544 ////////////////////////////////////////////////////////////////////////// 1545 /// FormatTraits<B8G8R8X8_UNORM_SRGB> - Format traits specialization for B8G8R8X8_UNORM_SRGB 1546 ////////////////////////////////////////////////////////////////////////// 1547 template<> struct FormatTraits<B8G8R8X8_UNORM_SRGB> : 1548 ComponentTraits<SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8, SWR_TYPE_UNUSED, 8>, 1549 FormatSwizzle<2, 1, 0, 3>, 1550 Defaults<0, 0, 0, 0x3f800000> 1551 { 1552 static const uint32_t bpp{ 32 }; 1553 static const uint32_t numComps{ 3 }; 1554 static const bool hasAlpha{ false }; 1555 static const uint32_t alphaComp{ 0 }; 1556 static const bool isSRGB{ true }; 1557 static const bool isBC{ false }; 1558 static const bool isSubsampled{ false }; 1559 static const uint32_t bcWidth{ 1 }; 1560 static const uint32_t bcHeight{ 1 }; 1561 1562 typedef Transpose8_8_8_8 TransposeT; 1563 typedef Format4<8, 8, 8, 8> FormatT; 1564 }; 1565 1566 ////////////////////////////////////////////////////////////////////////// 1567 /// FormatTraits<R8G8B8X8_UNORM> - Format traits specialization for R8G8B8X8_UNORM 1568 ////////////////////////////////////////////////////////////////////////// 1569 template<> struct FormatTraits<R8G8B8X8_UNORM> : 1570 ComponentTraits<SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8, SWR_TYPE_UNUSED, 8>, 1571 FormatSwizzle<0, 1, 2, 3>, 1572 Defaults<0, 0, 0, 0x3f800000> 1573 { 1574 static const uint32_t bpp{ 32 }; 1575 static const uint32_t numComps{ 3 }; 1576 static const bool hasAlpha{ false }; 1577 static const uint32_t alphaComp{ 0 }; 1578 static const bool isSRGB{ false }; 1579 static const bool isBC{ false }; 1580 static const bool isSubsampled{ false }; 1581 static const uint32_t bcWidth{ 1 }; 1582 static const uint32_t bcHeight{ 1 }; 1583 1584 typedef Transpose8_8_8_8 TransposeT; 1585 typedef Format4<8, 8, 8, 8> FormatT; 1586 }; 1587 1588 ////////////////////////////////////////////////////////////////////////// 1589 /// FormatTraits<R8G8B8X8_UNORM_SRGB> - Format traits specialization for R8G8B8X8_UNORM_SRGB 1590 ////////////////////////////////////////////////////////////////////////// 1591 template<> struct FormatTraits<R8G8B8X8_UNORM_SRGB> : 1592 ComponentTraits<SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8, SWR_TYPE_UNUSED, 8>, 1593 FormatSwizzle<0, 1, 2, 3>, 1594 Defaults<0, 0, 0, 0x3f800000> 1595 { 1596 static const uint32_t bpp{ 32 }; 1597 static const uint32_t numComps{ 3 }; 1598 static const bool hasAlpha{ false }; 1599 static const uint32_t alphaComp{ 0 }; 1600 static const bool isSRGB{ true }; 1601 static const bool isBC{ false }; 1602 static const bool isSubsampled{ false }; 1603 static const uint32_t bcWidth{ 1 }; 1604 static const uint32_t bcHeight{ 1 }; 1605 1606 typedef Transpose8_8_8_8 TransposeT; 1607 typedef Format4<8, 8, 8, 8> FormatT; 1608 }; 1609 1610 ////////////////////////////////////////////////////////////////////////// 1611 /// FormatTraits<R9G9B9E5_SHAREDEXP> - Format traits specialization for R9G9B9E5_SHAREDEXP 1612 ////////////////////////////////////////////////////////////////////////// 1613 template<> struct FormatTraits<R9G9B9E5_SHAREDEXP> : 1614 ComponentTraits<SWR_TYPE_UINT, 9, SWR_TYPE_UINT, 9, SWR_TYPE_UINT, 9, SWR_TYPE_UINT, 5>, 1615 FormatSwizzle<0, 1, 2, 3>, 1616 Defaults<0, 0, 0, 0x1> 1617 { 1618 static const uint32_t bpp{ 32 }; 1619 static const uint32_t numComps{ 4 }; 1620 static const bool hasAlpha{ false }; 1621 static const uint32_t alphaComp{ 3 }; 1622 static const bool isSRGB{ false }; 1623 static const bool isBC{ false }; 1624 static const bool isSubsampled{ false }; 1625 static const uint32_t bcWidth{ 1 }; 1626 static const uint32_t bcHeight{ 1 }; 1627 1628 typedef Transpose9_9_9_5 TransposeT; 1629 typedef Format4<9, 9, 9, 5> FormatT; 1630 }; 1631 1632 ////////////////////////////////////////////////////////////////////////// 1633 /// FormatTraits<B10G10R10X2_UNORM> - Format traits specialization for B10G10R10X2_UNORM 1634 ////////////////////////////////////////////////////////////////////////// 1635 template<> struct FormatTraits<B10G10R10X2_UNORM> : 1636 ComponentTraits<SWR_TYPE_UNORM, 10, SWR_TYPE_UNORM, 10, SWR_TYPE_UNORM, 10, SWR_TYPE_UNUSED, 2>, 1637 FormatSwizzle<2, 1, 0, 3>, 1638 Defaults<0, 0, 0, 0x3f800000> 1639 { 1640 static const uint32_t bpp{ 32 }; 1641 static const uint32_t numComps{ 3 }; 1642 static const bool hasAlpha{ false }; 1643 static const uint32_t alphaComp{ 0 }; 1644 static const bool isSRGB{ false }; 1645 static const bool isBC{ false }; 1646 static const bool isSubsampled{ false }; 1647 static const uint32_t bcWidth{ 1 }; 1648 static const uint32_t bcHeight{ 1 }; 1649 1650 typedef Transpose10_10_10_2 TransposeT; 1651 typedef Format4<10, 10, 10, 2> FormatT; 1652 }; 1653 1654 ////////////////////////////////////////////////////////////////////////// 1655 /// FormatTraits<L16A16_FLOAT> - Format traits specialization for L16A16_FLOAT 1656 ////////////////////////////////////////////////////////////////////////// 1657 template<> struct FormatTraits<L16A16_FLOAT> : 1658 ComponentTraits<SWR_TYPE_FLOAT, 16, SWR_TYPE_FLOAT, 16>, 1659 FormatSwizzle<0, 3>, 1660 Defaults<0, 0, 0, 0x3f800000> 1661 { 1662 static const uint32_t bpp{ 32 }; 1663 static const uint32_t numComps{ 2 }; 1664 static const bool hasAlpha{ true }; 1665 static const uint32_t alphaComp{ 1 }; 1666 static const bool isSRGB{ false }; 1667 static const bool isBC{ false }; 1668 static const bool isSubsampled{ false }; 1669 static const uint32_t bcWidth{ 1 }; 1670 static const uint32_t bcHeight{ 1 }; 1671 1672 typedef Transpose16_16 TransposeT; 1673 typedef Format2<16, 16> FormatT; 1674 }; 1675 1676 ////////////////////////////////////////////////////////////////////////// 1677 /// FormatTraits<R10G10B10X2_USCALED> - Format traits specialization for R10G10B10X2_USCALED 1678 ////////////////////////////////////////////////////////////////////////// 1679 template<> struct FormatTraits<R10G10B10X2_USCALED> : 1680 ComponentTraits<SWR_TYPE_USCALED, 10, SWR_TYPE_USCALED, 10, SWR_TYPE_USCALED, 10, SWR_TYPE_UNUSED, 2>, 1681 FormatSwizzle<0, 1, 2, 3>, 1682 Defaults<0, 0, 0, 0x3f800000> 1683 { 1684 static const uint32_t bpp{ 32 }; 1685 static const uint32_t numComps{ 3 }; 1686 static const bool hasAlpha{ false }; 1687 static const uint32_t alphaComp{ 0 }; 1688 static const bool isSRGB{ false }; 1689 static const bool isBC{ false }; 1690 static const bool isSubsampled{ false }; 1691 static const uint32_t bcWidth{ 1 }; 1692 static const uint32_t bcHeight{ 1 }; 1693 1694 typedef Transpose10_10_10_2 TransposeT; 1695 typedef Format4<10, 10, 10, 2> FormatT; 1696 }; 1697 1698 ////////////////////////////////////////////////////////////////////////// 1699 /// FormatTraits<R8G8B8A8_SSCALED> - Format traits specialization for R8G8B8A8_SSCALED 1700 ////////////////////////////////////////////////////////////////////////// 1701 template<> struct FormatTraits<R8G8B8A8_SSCALED> : 1702 ComponentTraits<SWR_TYPE_SSCALED, 8, SWR_TYPE_SSCALED, 8, SWR_TYPE_SSCALED, 8, SWR_TYPE_SSCALED, 8>, 1703 FormatSwizzle<0, 1, 2, 3>, 1704 Defaults<0, 0, 0, 0x3f800000> 1705 { 1706 static const uint32_t bpp{ 32 }; 1707 static const uint32_t numComps{ 4 }; 1708 static const bool hasAlpha{ true }; 1709 static const uint32_t alphaComp{ 3 }; 1710 static const bool isSRGB{ false }; 1711 static const bool isBC{ false }; 1712 static const bool isSubsampled{ false }; 1713 static const uint32_t bcWidth{ 1 }; 1714 static const uint32_t bcHeight{ 1 }; 1715 1716 typedef Transpose8_8_8_8 TransposeT; 1717 typedef Format4<8, 8, 8, 8> FormatT; 1718 }; 1719 1720 ////////////////////////////////////////////////////////////////////////// 1721 /// FormatTraits<R8G8B8A8_USCALED> - Format traits specialization for R8G8B8A8_USCALED 1722 ////////////////////////////////////////////////////////////////////////// 1723 template<> struct FormatTraits<R8G8B8A8_USCALED> : 1724 ComponentTraits<SWR_TYPE_USCALED, 8, SWR_TYPE_USCALED, 8, SWR_TYPE_USCALED, 8, SWR_TYPE_USCALED, 8>, 1725 FormatSwizzle<0, 1, 2, 3>, 1726 Defaults<0, 0, 0, 0x3f800000> 1727 { 1728 static const uint32_t bpp{ 32 }; 1729 static const uint32_t numComps{ 4 }; 1730 static const bool hasAlpha{ true }; 1731 static const uint32_t alphaComp{ 3 }; 1732 static const bool isSRGB{ false }; 1733 static const bool isBC{ false }; 1734 static const bool isSubsampled{ false }; 1735 static const uint32_t bcWidth{ 1 }; 1736 static const uint32_t bcHeight{ 1 }; 1737 1738 typedef Transpose8_8_8_8 TransposeT; 1739 typedef Format4<8, 8, 8, 8> FormatT; 1740 }; 1741 1742 ////////////////////////////////////////////////////////////////////////// 1743 /// FormatTraits<R16G16_SSCALED> - Format traits specialization for R16G16_SSCALED 1744 ////////////////////////////////////////////////////////////////////////// 1745 template<> struct FormatTraits<R16G16_SSCALED> : 1746 ComponentTraits<SWR_TYPE_SSCALED, 16, SWR_TYPE_SSCALED, 16>, 1747 FormatSwizzle<0, 1>, 1748 Defaults<0, 0, 0, 0x3f800000> 1749 { 1750 static const uint32_t bpp{ 32 }; 1751 static const uint32_t numComps{ 2 }; 1752 static const bool hasAlpha{ false }; 1753 static const uint32_t alphaComp{ 0 }; 1754 static const bool isSRGB{ false }; 1755 static const bool isBC{ false }; 1756 static const bool isSubsampled{ false }; 1757 static const uint32_t bcWidth{ 1 }; 1758 static const uint32_t bcHeight{ 1 }; 1759 1760 typedef Transpose16_16 TransposeT; 1761 typedef Format2<16, 16> FormatT; 1762 }; 1763 1764 ////////////////////////////////////////////////////////////////////////// 1765 /// FormatTraits<R16G16_USCALED> - Format traits specialization for R16G16_USCALED 1766 ////////////////////////////////////////////////////////////////////////// 1767 template<> struct FormatTraits<R16G16_USCALED> : 1768 ComponentTraits<SWR_TYPE_USCALED, 16, SWR_TYPE_USCALED, 16>, 1769 FormatSwizzle<0, 1>, 1770 Defaults<0, 0, 0, 0x3f800000> 1771 { 1772 static const uint32_t bpp{ 32 }; 1773 static const uint32_t numComps{ 2 }; 1774 static const bool hasAlpha{ false }; 1775 static const uint32_t alphaComp{ 0 }; 1776 static const bool isSRGB{ false }; 1777 static const bool isBC{ false }; 1778 static const bool isSubsampled{ false }; 1779 static const uint32_t bcWidth{ 1 }; 1780 static const uint32_t bcHeight{ 1 }; 1781 1782 typedef Transpose16_16 TransposeT; 1783 typedef Format2<16, 16> FormatT; 1784 }; 1785 1786 ////////////////////////////////////////////////////////////////////////// 1787 /// FormatTraits<R32_SSCALED> - Format traits specialization for R32_SSCALED 1788 ////////////////////////////////////////////////////////////////////////// 1789 template<> struct FormatTraits<R32_SSCALED> : 1790 ComponentTraits<SWR_TYPE_SSCALED, 32>, 1791 FormatSwizzle<0>, 1792 Defaults<0, 0, 0, 0x3f800000> 1793 { 1794 static const uint32_t bpp{ 32 }; 1795 static const uint32_t numComps{ 1 }; 1796 static const bool hasAlpha{ false }; 1797 static const uint32_t alphaComp{ 0 }; 1798 static const bool isSRGB{ false }; 1799 static const bool isBC{ false }; 1800 static const bool isSubsampled{ false }; 1801 static const uint32_t bcWidth{ 1 }; 1802 static const uint32_t bcHeight{ 1 }; 1803 1804 typedef TransposeSingleComponent<32> TransposeT; 1805 typedef Format1<32> FormatT; 1806 }; 1807 1808 ////////////////////////////////////////////////////////////////////////// 1809 /// FormatTraits<R32_USCALED> - Format traits specialization for R32_USCALED 1810 ////////////////////////////////////////////////////////////////////////// 1811 template<> struct FormatTraits<R32_USCALED> : 1812 ComponentTraits<SWR_TYPE_USCALED, 32>, 1813 FormatSwizzle<0>, 1814 Defaults<0, 0, 0, 0x3f800000> 1815 { 1816 static const uint32_t bpp{ 32 }; 1817 static const uint32_t numComps{ 1 }; 1818 static const bool hasAlpha{ false }; 1819 static const uint32_t alphaComp{ 0 }; 1820 static const bool isSRGB{ false }; 1821 static const bool isBC{ false }; 1822 static const bool isSubsampled{ false }; 1823 static const uint32_t bcWidth{ 1 }; 1824 static const uint32_t bcHeight{ 1 }; 1825 1826 typedef TransposeSingleComponent<32> TransposeT; 1827 typedef Format1<32> FormatT; 1828 }; 1829 1830 ////////////////////////////////////////////////////////////////////////// 1831 /// FormatTraits<B5G6R5_UNORM> - Format traits specialization for B5G6R5_UNORM 1832 ////////////////////////////////////////////////////////////////////////// 1833 template<> struct FormatTraits<B5G6R5_UNORM> : 1834 ComponentTraits<SWR_TYPE_UNORM, 5, SWR_TYPE_UNORM, 6, SWR_TYPE_UNORM, 5>, 1835 FormatSwizzle<2, 1, 0>, 1836 Defaults<0, 0, 0, 0x3f800000> 1837 { 1838 static const uint32_t bpp{ 16 }; 1839 static const uint32_t numComps{ 3 }; 1840 static const bool hasAlpha{ false }; 1841 static const uint32_t alphaComp{ 0 }; 1842 static const bool isSRGB{ false }; 1843 static const bool isBC{ false }; 1844 static const bool isSubsampled{ false }; 1845 static const uint32_t bcWidth{ 1 }; 1846 static const uint32_t bcHeight{ 1 }; 1847 1848 typedef Transpose5_6_5 TransposeT; 1849 typedef Format3<5, 6, 5> FormatT; 1850 }; 1851 1852 ////////////////////////////////////////////////////////////////////////// 1853 /// FormatTraits<B5G6R5_UNORM_SRGB> - Format traits specialization for B5G6R5_UNORM_SRGB 1854 ////////////////////////////////////////////////////////////////////////// 1855 template<> struct FormatTraits<B5G6R5_UNORM_SRGB> : 1856 ComponentTraits<SWR_TYPE_UNORM, 5, SWR_TYPE_UNORM, 6, SWR_TYPE_UNORM, 5>, 1857 FormatSwizzle<2, 1, 0>, 1858 Defaults<0, 0, 0, 0x3f800000> 1859 { 1860 static const uint32_t bpp{ 16 }; 1861 static const uint32_t numComps{ 3 }; 1862 static const bool hasAlpha{ false }; 1863 static const uint32_t alphaComp{ 0 }; 1864 static const bool isSRGB{ true }; 1865 static const bool isBC{ false }; 1866 static const bool isSubsampled{ false }; 1867 static const uint32_t bcWidth{ 1 }; 1868 static const uint32_t bcHeight{ 1 }; 1869 1870 typedef Transpose5_6_5 TransposeT; 1871 typedef Format3<5, 6, 5> FormatT; 1872 }; 1873 1874 ////////////////////////////////////////////////////////////////////////// 1875 /// FormatTraits<B5G5R5A1_UNORM> - Format traits specialization for B5G5R5A1_UNORM 1876 ////////////////////////////////////////////////////////////////////////// 1877 template<> struct FormatTraits<B5G5R5A1_UNORM> : 1878 ComponentTraits<SWR_TYPE_UNORM, 5, SWR_TYPE_UNORM, 5, SWR_TYPE_UNORM, 5, SWR_TYPE_UNORM, 1>, 1879 FormatSwizzle<2, 1, 0, 3>, 1880 Defaults<0, 0, 0, 0x3f800000> 1881 { 1882 static const uint32_t bpp{ 16 }; 1883 static const uint32_t numComps{ 4 }; 1884 static const bool hasAlpha{ true }; 1885 static const uint32_t alphaComp{ 3 }; 1886 static const bool isSRGB{ false }; 1887 static const bool isBC{ false }; 1888 static const bool isSubsampled{ false }; 1889 static const uint32_t bcWidth{ 1 }; 1890 static const uint32_t bcHeight{ 1 }; 1891 1892 typedef Transpose5_5_5_1 TransposeT; 1893 typedef Format4<5, 5, 5, 1> FormatT; 1894 }; 1895 1896 ////////////////////////////////////////////////////////////////////////// 1897 /// FormatTraits<B5G5R5A1_UNORM_SRGB> - Format traits specialization for B5G5R5A1_UNORM_SRGB 1898 ////////////////////////////////////////////////////////////////////////// 1899 template<> struct FormatTraits<B5G5R5A1_UNORM_SRGB> : 1900 ComponentTraits<SWR_TYPE_UNORM, 5, SWR_TYPE_UNORM, 5, SWR_TYPE_UNORM, 5, SWR_TYPE_UNORM, 1>, 1901 FormatSwizzle<2, 1, 0, 3>, 1902 Defaults<0, 0, 0, 0x3f800000> 1903 { 1904 static const uint32_t bpp{ 16 }; 1905 static const uint32_t numComps{ 4 }; 1906 static const bool hasAlpha{ true }; 1907 static const uint32_t alphaComp{ 3 }; 1908 static const bool isSRGB{ true }; 1909 static const bool isBC{ false }; 1910 static const bool isSubsampled{ false }; 1911 static const uint32_t bcWidth{ 1 }; 1912 static const uint32_t bcHeight{ 1 }; 1913 1914 typedef Transpose5_5_5_1 TransposeT; 1915 typedef Format4<5, 5, 5, 1> FormatT; 1916 }; 1917 1918 ////////////////////////////////////////////////////////////////////////// 1919 /// FormatTraits<B4G4R4A4_UNORM> - Format traits specialization for B4G4R4A4_UNORM 1920 ////////////////////////////////////////////////////////////////////////// 1921 template<> struct FormatTraits<B4G4R4A4_UNORM> : 1922 ComponentTraits<SWR_TYPE_UNORM, 4, SWR_TYPE_UNORM, 4, SWR_TYPE_UNORM, 4, SWR_TYPE_UNORM, 4>, 1923 FormatSwizzle<2, 1, 0, 3>, 1924 Defaults<0, 0, 0, 0x3f800000> 1925 { 1926 static const uint32_t bpp{ 16 }; 1927 static const uint32_t numComps{ 4 }; 1928 static const bool hasAlpha{ true }; 1929 static const uint32_t alphaComp{ 3 }; 1930 static const bool isSRGB{ false }; 1931 static const bool isBC{ false }; 1932 static const bool isSubsampled{ false }; 1933 static const uint32_t bcWidth{ 1 }; 1934 static const uint32_t bcHeight{ 1 }; 1935 1936 typedef Transpose4_4_4_4 TransposeT; 1937 typedef Format4<4, 4, 4, 4> FormatT; 1938 }; 1939 1940 ////////////////////////////////////////////////////////////////////////// 1941 /// FormatTraits<B4G4R4A4_UNORM_SRGB> - Format traits specialization for B4G4R4A4_UNORM_SRGB 1942 ////////////////////////////////////////////////////////////////////////// 1943 template<> struct FormatTraits<B4G4R4A4_UNORM_SRGB> : 1944 ComponentTraits<SWR_TYPE_UNORM, 4, SWR_TYPE_UNORM, 4, SWR_TYPE_UNORM, 4, SWR_TYPE_UNORM, 4>, 1945 FormatSwizzle<2, 1, 0, 3>, 1946 Defaults<0, 0, 0, 0x3f800000> 1947 { 1948 static const uint32_t bpp{ 16 }; 1949 static const uint32_t numComps{ 4 }; 1950 static const bool hasAlpha{ true }; 1951 static const uint32_t alphaComp{ 3 }; 1952 static const bool isSRGB{ true }; 1953 static const bool isBC{ false }; 1954 static const bool isSubsampled{ false }; 1955 static const uint32_t bcWidth{ 1 }; 1956 static const uint32_t bcHeight{ 1 }; 1957 1958 typedef Transpose4_4_4_4 TransposeT; 1959 typedef Format4<4, 4, 4, 4> FormatT; 1960 }; 1961 1962 ////////////////////////////////////////////////////////////////////////// 1963 /// FormatTraits<R8G8_UNORM> - Format traits specialization for R8G8_UNORM 1964 ////////////////////////////////////////////////////////////////////////// 1965 template<> struct FormatTraits<R8G8_UNORM> : 1966 ComponentTraits<SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8>, 1967 FormatSwizzle<0, 1>, 1968 Defaults<0, 0, 0, 0x3f800000> 1969 { 1970 static const uint32_t bpp{ 16 }; 1971 static const uint32_t numComps{ 2 }; 1972 static const bool hasAlpha{ false }; 1973 static const uint32_t alphaComp{ 0 }; 1974 static const bool isSRGB{ false }; 1975 static const bool isBC{ false }; 1976 static const bool isSubsampled{ false }; 1977 static const uint32_t bcWidth{ 1 }; 1978 static const uint32_t bcHeight{ 1 }; 1979 1980 typedef Transpose8_8 TransposeT; 1981 typedef Format2<8, 8> FormatT; 1982 }; 1983 1984 ////////////////////////////////////////////////////////////////////////// 1985 /// FormatTraits<R8G8_SNORM> - Format traits specialization for R8G8_SNORM 1986 ////////////////////////////////////////////////////////////////////////// 1987 template<> struct FormatTraits<R8G8_SNORM> : 1988 ComponentTraits<SWR_TYPE_SNORM, 8, SWR_TYPE_SNORM, 8>, 1989 FormatSwizzle<0, 1>, 1990 Defaults<0, 0, 0, 0x3f800000> 1991 { 1992 static const uint32_t bpp{ 16 }; 1993 static const uint32_t numComps{ 2 }; 1994 static const bool hasAlpha{ false }; 1995 static const uint32_t alphaComp{ 0 }; 1996 static const bool isSRGB{ false }; 1997 static const bool isBC{ false }; 1998 static const bool isSubsampled{ false }; 1999 static const uint32_t bcWidth{ 1 }; 2000 static const uint32_t bcHeight{ 1 }; 2001 2002 typedef Transpose8_8 TransposeT; 2003 typedef Format2<8, 8> FormatT; 2004 }; 2005 2006 ////////////////////////////////////////////////////////////////////////// 2007 /// FormatTraits<R8G8_SINT> - Format traits specialization for R8G8_SINT 2008 ////////////////////////////////////////////////////////////////////////// 2009 template<> struct FormatTraits<R8G8_SINT> : 2010 ComponentTraits<SWR_TYPE_SINT, 8, SWR_TYPE_SINT, 8>, 2011 FormatSwizzle<0, 1>, 2012 Defaults<0, 0, 0, 0x1> 2013 { 2014 static const uint32_t bpp{ 16 }; 2015 static const uint32_t numComps{ 2 }; 2016 static const bool hasAlpha{ false }; 2017 static const uint32_t alphaComp{ 0 }; 2018 static const bool isSRGB{ false }; 2019 static const bool isBC{ false }; 2020 static const bool isSubsampled{ false }; 2021 static const uint32_t bcWidth{ 1 }; 2022 static const uint32_t bcHeight{ 1 }; 2023 2024 typedef Transpose8_8 TransposeT; 2025 typedef Format2<8, 8> FormatT; 2026 }; 2027 2028 ////////////////////////////////////////////////////////////////////////// 2029 /// FormatTraits<R8G8_UINT> - Format traits specialization for R8G8_UINT 2030 ////////////////////////////////////////////////////////////////////////// 2031 template<> struct FormatTraits<R8G8_UINT> : 2032 ComponentTraits<SWR_TYPE_UINT, 8, SWR_TYPE_UINT, 8>, 2033 FormatSwizzle<0, 1>, 2034 Defaults<0, 0, 0, 0x1> 2035 { 2036 static const uint32_t bpp{ 16 }; 2037 static const uint32_t numComps{ 2 }; 2038 static const bool hasAlpha{ false }; 2039 static const uint32_t alphaComp{ 0 }; 2040 static const bool isSRGB{ false }; 2041 static const bool isBC{ false }; 2042 static const bool isSubsampled{ false }; 2043 static const uint32_t bcWidth{ 1 }; 2044 static const uint32_t bcHeight{ 1 }; 2045 2046 typedef Transpose8_8 TransposeT; 2047 typedef Format2<8, 8> FormatT; 2048 }; 2049 2050 ////////////////////////////////////////////////////////////////////////// 2051 /// FormatTraits<R16_UNORM> - Format traits specialization for R16_UNORM 2052 ////////////////////////////////////////////////////////////////////////// 2053 template<> struct FormatTraits<R16_UNORM> : 2054 ComponentTraits<SWR_TYPE_UNORM, 16>, 2055 FormatSwizzle<0>, 2056 Defaults<0, 0, 0, 0x3f800000> 2057 { 2058 static const uint32_t bpp{ 16 }; 2059 static const uint32_t numComps{ 1 }; 2060 static const bool hasAlpha{ false }; 2061 static const uint32_t alphaComp{ 0 }; 2062 static const bool isSRGB{ false }; 2063 static const bool isBC{ false }; 2064 static const bool isSubsampled{ false }; 2065 static const uint32_t bcWidth{ 1 }; 2066 static const uint32_t bcHeight{ 1 }; 2067 2068 typedef TransposeSingleComponent<16> TransposeT; 2069 typedef Format1<16> FormatT; 2070 }; 2071 2072 ////////////////////////////////////////////////////////////////////////// 2073 /// FormatTraits<R16_SNORM> - Format traits specialization for R16_SNORM 2074 ////////////////////////////////////////////////////////////////////////// 2075 template<> struct FormatTraits<R16_SNORM> : 2076 ComponentTraits<SWR_TYPE_SNORM, 16>, 2077 FormatSwizzle<0>, 2078 Defaults<0, 0, 0, 0x3f800000> 2079 { 2080 static const uint32_t bpp{ 16 }; 2081 static const uint32_t numComps{ 1 }; 2082 static const bool hasAlpha{ false }; 2083 static const uint32_t alphaComp{ 0 }; 2084 static const bool isSRGB{ false }; 2085 static const bool isBC{ false }; 2086 static const bool isSubsampled{ false }; 2087 static const uint32_t bcWidth{ 1 }; 2088 static const uint32_t bcHeight{ 1 }; 2089 2090 typedef TransposeSingleComponent<16> TransposeT; 2091 typedef Format1<16> FormatT; 2092 }; 2093 2094 ////////////////////////////////////////////////////////////////////////// 2095 /// FormatTraits<R16_SINT> - Format traits specialization for R16_SINT 2096 ////////////////////////////////////////////////////////////////////////// 2097 template<> struct FormatTraits<R16_SINT> : 2098 ComponentTraits<SWR_TYPE_SINT, 16>, 2099 FormatSwizzle<0>, 2100 Defaults<0, 0, 0, 0x1> 2101 { 2102 static const uint32_t bpp{ 16 }; 2103 static const uint32_t numComps{ 1 }; 2104 static const bool hasAlpha{ false }; 2105 static const uint32_t alphaComp{ 0 }; 2106 static const bool isSRGB{ false }; 2107 static const bool isBC{ false }; 2108 static const bool isSubsampled{ false }; 2109 static const uint32_t bcWidth{ 1 }; 2110 static const uint32_t bcHeight{ 1 }; 2111 2112 typedef TransposeSingleComponent<16> TransposeT; 2113 typedef Format1<16> FormatT; 2114 }; 2115 2116 ////////////////////////////////////////////////////////////////////////// 2117 /// FormatTraits<R16_UINT> - Format traits specialization for R16_UINT 2118 ////////////////////////////////////////////////////////////////////////// 2119 template<> struct FormatTraits<R16_UINT> : 2120 ComponentTraits<SWR_TYPE_UINT, 16>, 2121 FormatSwizzle<0>, 2122 Defaults<0, 0, 0, 0x1> 2123 { 2124 static const uint32_t bpp{ 16 }; 2125 static const uint32_t numComps{ 1 }; 2126 static const bool hasAlpha{ false }; 2127 static const uint32_t alphaComp{ 0 }; 2128 static const bool isSRGB{ false }; 2129 static const bool isBC{ false }; 2130 static const bool isSubsampled{ false }; 2131 static const uint32_t bcWidth{ 1 }; 2132 static const uint32_t bcHeight{ 1 }; 2133 2134 typedef TransposeSingleComponent<16> TransposeT; 2135 typedef Format1<16> FormatT; 2136 }; 2137 2138 ////////////////////////////////////////////////////////////////////////// 2139 /// FormatTraits<R16_FLOAT> - Format traits specialization for R16_FLOAT 2140 ////////////////////////////////////////////////////////////////////////// 2141 template<> struct FormatTraits<R16_FLOAT> : 2142 ComponentTraits<SWR_TYPE_FLOAT, 16>, 2143 FormatSwizzle<0>, 2144 Defaults<0, 0, 0, 0x3f800000> 2145 { 2146 static const uint32_t bpp{ 16 }; 2147 static const uint32_t numComps{ 1 }; 2148 static const bool hasAlpha{ false }; 2149 static const uint32_t alphaComp{ 0 }; 2150 static const bool isSRGB{ false }; 2151 static const bool isBC{ false }; 2152 static const bool isSubsampled{ false }; 2153 static const uint32_t bcWidth{ 1 }; 2154 static const uint32_t bcHeight{ 1 }; 2155 2156 typedef TransposeSingleComponent<16> TransposeT; 2157 typedef Format1<16> FormatT; 2158 }; 2159 2160 ////////////////////////////////////////////////////////////////////////// 2161 /// FormatTraits<I16_UNORM> - Format traits specialization for I16_UNORM 2162 ////////////////////////////////////////////////////////////////////////// 2163 template<> struct FormatTraits<I16_UNORM> : 2164 ComponentTraits<SWR_TYPE_UNORM, 16>, 2165 FormatSwizzle<0>, 2166 Defaults<0, 0, 0, 0x3f800000> 2167 { 2168 static const uint32_t bpp{ 16 }; 2169 static const uint32_t numComps{ 1 }; 2170 static const bool hasAlpha{ false }; 2171 static const uint32_t alphaComp{ 0 }; 2172 static const bool isSRGB{ false }; 2173 static const bool isBC{ false }; 2174 static const bool isSubsampled{ false }; 2175 static const uint32_t bcWidth{ 1 }; 2176 static const uint32_t bcHeight{ 1 }; 2177 2178 typedef TransposeSingleComponent<16> TransposeT; 2179 typedef Format1<16> FormatT; 2180 }; 2181 2182 ////////////////////////////////////////////////////////////////////////// 2183 /// FormatTraits<L16_UNORM> - Format traits specialization for L16_UNORM 2184 ////////////////////////////////////////////////////////////////////////// 2185 template<> struct FormatTraits<L16_UNORM> : 2186 ComponentTraits<SWR_TYPE_UNORM, 16>, 2187 FormatSwizzle<0>, 2188 Defaults<0, 0, 0, 0x3f800000> 2189 { 2190 static const uint32_t bpp{ 16 }; 2191 static const uint32_t numComps{ 1 }; 2192 static const bool hasAlpha{ false }; 2193 static const uint32_t alphaComp{ 0 }; 2194 static const bool isSRGB{ false }; 2195 static const bool isBC{ false }; 2196 static const bool isSubsampled{ false }; 2197 static const uint32_t bcWidth{ 1 }; 2198 static const uint32_t bcHeight{ 1 }; 2199 2200 typedef TransposeSingleComponent<16> TransposeT; 2201 typedef Format1<16> FormatT; 2202 }; 2203 2204 ////////////////////////////////////////////////////////////////////////// 2205 /// FormatTraits<A16_UNORM> - Format traits specialization for A16_UNORM 2206 ////////////////////////////////////////////////////////////////////////// 2207 template<> struct FormatTraits<A16_UNORM> : 2208 ComponentTraits<SWR_TYPE_UNORM, 16>, 2209 FormatSwizzle<3>, 2210 Defaults<0, 0, 0, 0x3f800000> 2211 { 2212 static const uint32_t bpp{ 16 }; 2213 static const uint32_t numComps{ 1 }; 2214 static const bool hasAlpha{ true }; 2215 static const uint32_t alphaComp{ 0 }; 2216 static const bool isSRGB{ false }; 2217 static const bool isBC{ false }; 2218 static const bool isSubsampled{ false }; 2219 static const uint32_t bcWidth{ 1 }; 2220 static const uint32_t bcHeight{ 1 }; 2221 2222 typedef TransposeSingleComponent<16> TransposeT; 2223 typedef Format1<16> FormatT; 2224 }; 2225 2226 ////////////////////////////////////////////////////////////////////////// 2227 /// FormatTraits<L8A8_UNORM> - Format traits specialization for L8A8_UNORM 2228 ////////////////////////////////////////////////////////////////////////// 2229 template<> struct FormatTraits<L8A8_UNORM> : 2230 ComponentTraits<SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8>, 2231 FormatSwizzle<0, 3>, 2232 Defaults<0, 0, 0, 0x3f800000> 2233 { 2234 static const uint32_t bpp{ 16 }; 2235 static const uint32_t numComps{ 2 }; 2236 static const bool hasAlpha{ true }; 2237 static const uint32_t alphaComp{ 1 }; 2238 static const bool isSRGB{ false }; 2239 static const bool isBC{ false }; 2240 static const bool isSubsampled{ false }; 2241 static const uint32_t bcWidth{ 1 }; 2242 static const uint32_t bcHeight{ 1 }; 2243 2244 typedef Transpose8_8 TransposeT; 2245 typedef Format2<8, 8> FormatT; 2246 }; 2247 2248 ////////////////////////////////////////////////////////////////////////// 2249 /// FormatTraits<I16_FLOAT> - Format traits specialization for I16_FLOAT 2250 ////////////////////////////////////////////////////////////////////////// 2251 template<> struct FormatTraits<I16_FLOAT> : 2252 ComponentTraits<SWR_TYPE_FLOAT, 16>, 2253 FormatSwizzle<0>, 2254 Defaults<0, 0, 0, 0x3f800000> 2255 { 2256 static const uint32_t bpp{ 16 }; 2257 static const uint32_t numComps{ 1 }; 2258 static const bool hasAlpha{ false }; 2259 static const uint32_t alphaComp{ 0 }; 2260 static const bool isSRGB{ false }; 2261 static const bool isBC{ false }; 2262 static const bool isSubsampled{ false }; 2263 static const uint32_t bcWidth{ 1 }; 2264 static const uint32_t bcHeight{ 1 }; 2265 2266 typedef TransposeSingleComponent<16> TransposeT; 2267 typedef Format1<16> FormatT; 2268 }; 2269 2270 ////////////////////////////////////////////////////////////////////////// 2271 /// FormatTraits<L16_FLOAT> - Format traits specialization for L16_FLOAT 2272 ////////////////////////////////////////////////////////////////////////// 2273 template<> struct FormatTraits<L16_FLOAT> : 2274 ComponentTraits<SWR_TYPE_FLOAT, 16>, 2275 FormatSwizzle<0>, 2276 Defaults<0, 0, 0, 0x3f800000> 2277 { 2278 static const uint32_t bpp{ 16 }; 2279 static const uint32_t numComps{ 1 }; 2280 static const bool hasAlpha{ false }; 2281 static const uint32_t alphaComp{ 0 }; 2282 static const bool isSRGB{ false }; 2283 static const bool isBC{ false }; 2284 static const bool isSubsampled{ false }; 2285 static const uint32_t bcWidth{ 1 }; 2286 static const uint32_t bcHeight{ 1 }; 2287 2288 typedef TransposeSingleComponent<16> TransposeT; 2289 typedef Format1<16> FormatT; 2290 }; 2291 2292 ////////////////////////////////////////////////////////////////////////// 2293 /// FormatTraits<A16_FLOAT> - Format traits specialization for A16_FLOAT 2294 ////////////////////////////////////////////////////////////////////////// 2295 template<> struct FormatTraits<A16_FLOAT> : 2296 ComponentTraits<SWR_TYPE_FLOAT, 16>, 2297 FormatSwizzle<3>, 2298 Defaults<0, 0, 0, 0x3f800000> 2299 { 2300 static const uint32_t bpp{ 16 }; 2301 static const uint32_t numComps{ 1 }; 2302 static const bool hasAlpha{ true }; 2303 static const uint32_t alphaComp{ 0 }; 2304 static const bool isSRGB{ false }; 2305 static const bool isBC{ false }; 2306 static const bool isSubsampled{ false }; 2307 static const uint32_t bcWidth{ 1 }; 2308 static const uint32_t bcHeight{ 1 }; 2309 2310 typedef TransposeSingleComponent<16> TransposeT; 2311 typedef Format1<16> FormatT; 2312 }; 2313 2314 ////////////////////////////////////////////////////////////////////////// 2315 /// FormatTraits<L8A8_UNORM_SRGB> - Format traits specialization for L8A8_UNORM_SRGB 2316 ////////////////////////////////////////////////////////////////////////// 2317 template<> struct FormatTraits<L8A8_UNORM_SRGB> : 2318 ComponentTraits<SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8>, 2319 FormatSwizzle<0, 3>, 2320 Defaults<0, 0, 0, 0x3f800000> 2321 { 2322 static const uint32_t bpp{ 16 }; 2323 static const uint32_t numComps{ 2 }; 2324 static const bool hasAlpha{ true }; 2325 static const uint32_t alphaComp{ 1 }; 2326 static const bool isSRGB{ true }; 2327 static const bool isBC{ false }; 2328 static const bool isSubsampled{ false }; 2329 static const uint32_t bcWidth{ 1 }; 2330 static const uint32_t bcHeight{ 1 }; 2331 2332 typedef Transpose8_8 TransposeT; 2333 typedef Format2<8, 8> FormatT; 2334 }; 2335 2336 ////////////////////////////////////////////////////////////////////////// 2337 /// FormatTraits<B5G5R5X1_UNORM> - Format traits specialization for B5G5R5X1_UNORM 2338 ////////////////////////////////////////////////////////////////////////// 2339 template<> struct FormatTraits<B5G5R5X1_UNORM> : 2340 ComponentTraits<SWR_TYPE_UNORM, 5, SWR_TYPE_UNORM, 5, SWR_TYPE_UNORM, 5, SWR_TYPE_UNUSED, 1>, 2341 FormatSwizzle<2, 1, 0, 3>, 2342 Defaults<0, 0, 0, 0x3f800000> 2343 { 2344 static const uint32_t bpp{ 16 }; 2345 static const uint32_t numComps{ 3 }; 2346 static const bool hasAlpha{ false }; 2347 static const uint32_t alphaComp{ 0 }; 2348 static const bool isSRGB{ false }; 2349 static const bool isBC{ false }; 2350 static const bool isSubsampled{ false }; 2351 static const uint32_t bcWidth{ 1 }; 2352 static const uint32_t bcHeight{ 1 }; 2353 2354 typedef Transpose5_5_5_1 TransposeT; 2355 typedef Format4<5, 5, 5, 1> FormatT; 2356 }; 2357 2358 ////////////////////////////////////////////////////////////////////////// 2359 /// FormatTraits<B5G5R5X1_UNORM_SRGB> - Format traits specialization for B5G5R5X1_UNORM_SRGB 2360 ////////////////////////////////////////////////////////////////////////// 2361 template<> struct FormatTraits<B5G5R5X1_UNORM_SRGB> : 2362 ComponentTraits<SWR_TYPE_UNORM, 5, SWR_TYPE_UNORM, 5, SWR_TYPE_UNORM, 5, SWR_TYPE_UNUSED, 1>, 2363 FormatSwizzle<2, 1, 0, 3>, 2364 Defaults<0, 0, 0, 0x3f800000> 2365 { 2366 static const uint32_t bpp{ 16 }; 2367 static const uint32_t numComps{ 3 }; 2368 static const bool hasAlpha{ false }; 2369 static const uint32_t alphaComp{ 0 }; 2370 static const bool isSRGB{ true }; 2371 static const bool isBC{ false }; 2372 static const bool isSubsampled{ false }; 2373 static const uint32_t bcWidth{ 1 }; 2374 static const uint32_t bcHeight{ 1 }; 2375 2376 typedef Transpose5_5_5_1 TransposeT; 2377 typedef Format4<5, 5, 5, 1> FormatT; 2378 }; 2379 2380 ////////////////////////////////////////////////////////////////////////// 2381 /// FormatTraits<R8G8_SSCALED> - Format traits specialization for R8G8_SSCALED 2382 ////////////////////////////////////////////////////////////////////////// 2383 template<> struct FormatTraits<R8G8_SSCALED> : 2384 ComponentTraits<SWR_TYPE_SSCALED, 8, SWR_TYPE_SSCALED, 8>, 2385 FormatSwizzle<0, 1>, 2386 Defaults<0, 0, 0, 0x3f800000> 2387 { 2388 static const uint32_t bpp{ 16 }; 2389 static const uint32_t numComps{ 2 }; 2390 static const bool hasAlpha{ false }; 2391 static const uint32_t alphaComp{ 0 }; 2392 static const bool isSRGB{ false }; 2393 static const bool isBC{ false }; 2394 static const bool isSubsampled{ false }; 2395 static const uint32_t bcWidth{ 1 }; 2396 static const uint32_t bcHeight{ 1 }; 2397 2398 typedef Transpose8_8 TransposeT; 2399 typedef Format2<8, 8> FormatT; 2400 }; 2401 2402 ////////////////////////////////////////////////////////////////////////// 2403 /// FormatTraits<R8G8_USCALED> - Format traits specialization for R8G8_USCALED 2404 ////////////////////////////////////////////////////////////////////////// 2405 template<> struct FormatTraits<R8G8_USCALED> : 2406 ComponentTraits<SWR_TYPE_USCALED, 8, SWR_TYPE_USCALED, 8>, 2407 FormatSwizzle<0, 1>, 2408 Defaults<0, 0, 0, 0x3f800000> 2409 { 2410 static const uint32_t bpp{ 16 }; 2411 static const uint32_t numComps{ 2 }; 2412 static const bool hasAlpha{ false }; 2413 static const uint32_t alphaComp{ 0 }; 2414 static const bool isSRGB{ false }; 2415 static const bool isBC{ false }; 2416 static const bool isSubsampled{ false }; 2417 static const uint32_t bcWidth{ 1 }; 2418 static const uint32_t bcHeight{ 1 }; 2419 2420 typedef Transpose8_8 TransposeT; 2421 typedef Format2<8, 8> FormatT; 2422 }; 2423 2424 ////////////////////////////////////////////////////////////////////////// 2425 /// FormatTraits<R16_SSCALED> - Format traits specialization for R16_SSCALED 2426 ////////////////////////////////////////////////////////////////////////// 2427 template<> struct FormatTraits<R16_SSCALED> : 2428 ComponentTraits<SWR_TYPE_SSCALED, 16>, 2429 FormatSwizzle<0>, 2430 Defaults<0, 0, 0, 0x3f800000> 2431 { 2432 static const uint32_t bpp{ 16 }; 2433 static const uint32_t numComps{ 1 }; 2434 static const bool hasAlpha{ false }; 2435 static const uint32_t alphaComp{ 0 }; 2436 static const bool isSRGB{ false }; 2437 static const bool isBC{ false }; 2438 static const bool isSubsampled{ false }; 2439 static const uint32_t bcWidth{ 1 }; 2440 static const uint32_t bcHeight{ 1 }; 2441 2442 typedef TransposeSingleComponent<16> TransposeT; 2443 typedef Format1<16> FormatT; 2444 }; 2445 2446 ////////////////////////////////////////////////////////////////////////// 2447 /// FormatTraits<R16_USCALED> - Format traits specialization for R16_USCALED 2448 ////////////////////////////////////////////////////////////////////////// 2449 template<> struct FormatTraits<R16_USCALED> : 2450 ComponentTraits<SWR_TYPE_USCALED, 16>, 2451 FormatSwizzle<0>, 2452 Defaults<0, 0, 0, 0x3f800000> 2453 { 2454 static const uint32_t bpp{ 16 }; 2455 static const uint32_t numComps{ 1 }; 2456 static const bool hasAlpha{ false }; 2457 static const uint32_t alphaComp{ 0 }; 2458 static const bool isSRGB{ false }; 2459 static const bool isBC{ false }; 2460 static const bool isSubsampled{ false }; 2461 static const uint32_t bcWidth{ 1 }; 2462 static const uint32_t bcHeight{ 1 }; 2463 2464 typedef TransposeSingleComponent<16> TransposeT; 2465 typedef Format1<16> FormatT; 2466 }; 2467 2468 ////////////////////////////////////////////////////////////////////////// 2469 /// FormatTraits<A1B5G5R5_UNORM> - Format traits specialization for A1B5G5R5_UNORM 2470 ////////////////////////////////////////////////////////////////////////// 2471 template<> struct FormatTraits<A1B5G5R5_UNORM> : 2472 ComponentTraits<SWR_TYPE_UNORM, 1, SWR_TYPE_UNORM, 5, SWR_TYPE_UNORM, 5, SWR_TYPE_UNORM, 5>, 2473 FormatSwizzle<3, 2, 1, 0>, 2474 Defaults<0, 0, 0, 0x3f800000> 2475 { 2476 static const uint32_t bpp{ 16 }; 2477 static const uint32_t numComps{ 4 }; 2478 static const bool hasAlpha{ true }; 2479 static const uint32_t alphaComp{ 3 }; 2480 static const bool isSRGB{ false }; 2481 static const bool isBC{ false }; 2482 static const bool isSubsampled{ false }; 2483 static const uint32_t bcWidth{ 1 }; 2484 static const uint32_t bcHeight{ 1 }; 2485 2486 typedef Transpose1_5_5_5 TransposeT; 2487 typedef Format4<1, 5, 5, 5> FormatT; 2488 }; 2489 2490 ////////////////////////////////////////////////////////////////////////// 2491 /// FormatTraits<A4B4G4R4_UNORM> - Format traits specialization for A4B4G4R4_UNORM 2492 ////////////////////////////////////////////////////////////////////////// 2493 template<> struct FormatTraits<A4B4G4R4_UNORM> : 2494 ComponentTraits<SWR_TYPE_UNORM, 4, SWR_TYPE_UNORM, 4, SWR_TYPE_UNORM, 4, SWR_TYPE_UNORM, 4>, 2495 FormatSwizzle<3, 2, 1, 0>, 2496 Defaults<0, 0, 0, 0x3f800000> 2497 { 2498 static const uint32_t bpp{ 16 }; 2499 static const uint32_t numComps{ 4 }; 2500 static const bool hasAlpha{ true }; 2501 static const uint32_t alphaComp{ 3 }; 2502 static const bool isSRGB{ false }; 2503 static const bool isBC{ false }; 2504 static const bool isSubsampled{ false }; 2505 static const uint32_t bcWidth{ 1 }; 2506 static const uint32_t bcHeight{ 1 }; 2507 2508 typedef Transpose4_4_4_4 TransposeT; 2509 typedef Format4<4, 4, 4, 4> FormatT; 2510 }; 2511 2512 ////////////////////////////////////////////////////////////////////////// 2513 /// FormatTraits<L8A8_UINT> - Format traits specialization for L8A8_UINT 2514 ////////////////////////////////////////////////////////////////////////// 2515 template<> struct FormatTraits<L8A8_UINT> : 2516 ComponentTraits<SWR_TYPE_UINT, 8, SWR_TYPE_UINT, 8>, 2517 FormatSwizzle<0, 3>, 2518 Defaults<0, 0, 0, 0x1> 2519 { 2520 static const uint32_t bpp{ 16 }; 2521 static const uint32_t numComps{ 2 }; 2522 static const bool hasAlpha{ true }; 2523 static const uint32_t alphaComp{ 1 }; 2524 static const bool isSRGB{ false }; 2525 static const bool isBC{ false }; 2526 static const bool isSubsampled{ false }; 2527 static const uint32_t bcWidth{ 1 }; 2528 static const uint32_t bcHeight{ 1 }; 2529 2530 typedef Transpose8_8 TransposeT; 2531 typedef Format2<8, 8> FormatT; 2532 }; 2533 2534 ////////////////////////////////////////////////////////////////////////// 2535 /// FormatTraits<L8A8_SINT> - Format traits specialization for L8A8_SINT 2536 ////////////////////////////////////////////////////////////////////////// 2537 template<> struct FormatTraits<L8A8_SINT> : 2538 ComponentTraits<SWR_TYPE_SINT, 8, SWR_TYPE_SINT, 8>, 2539 FormatSwizzle<0, 3>, 2540 Defaults<0, 0, 0, 0x1> 2541 { 2542 static const uint32_t bpp{ 16 }; 2543 static const uint32_t numComps{ 2 }; 2544 static const bool hasAlpha{ true }; 2545 static const uint32_t alphaComp{ 1 }; 2546 static const bool isSRGB{ false }; 2547 static const bool isBC{ false }; 2548 static const bool isSubsampled{ false }; 2549 static const uint32_t bcWidth{ 1 }; 2550 static const uint32_t bcHeight{ 1 }; 2551 2552 typedef Transpose8_8 TransposeT; 2553 typedef Format2<8, 8> FormatT; 2554 }; 2555 2556 ////////////////////////////////////////////////////////////////////////// 2557 /// FormatTraits<R8_UNORM> - Format traits specialization for R8_UNORM 2558 ////////////////////////////////////////////////////////////////////////// 2559 template<> struct FormatTraits<R8_UNORM> : 2560 ComponentTraits<SWR_TYPE_UNORM, 8>, 2561 FormatSwizzle<0>, 2562 Defaults<0, 0, 0, 0x3f800000> 2563 { 2564 static const uint32_t bpp{ 8 }; 2565 static const uint32_t numComps{ 1 }; 2566 static const bool hasAlpha{ false }; 2567 static const uint32_t alphaComp{ 0 }; 2568 static const bool isSRGB{ false }; 2569 static const bool isBC{ false }; 2570 static const bool isSubsampled{ false }; 2571 static const uint32_t bcWidth{ 1 }; 2572 static const uint32_t bcHeight{ 1 }; 2573 2574 typedef TransposeSingleComponent<8> TransposeT; 2575 typedef Format1<8> FormatT; 2576 }; 2577 2578 ////////////////////////////////////////////////////////////////////////// 2579 /// FormatTraits<R8_SNORM> - Format traits specialization for R8_SNORM 2580 ////////////////////////////////////////////////////////////////////////// 2581 template<> struct FormatTraits<R8_SNORM> : 2582 ComponentTraits<SWR_TYPE_SNORM, 8>, 2583 FormatSwizzle<0>, 2584 Defaults<0, 0, 0, 0x3f800000> 2585 { 2586 static const uint32_t bpp{ 8 }; 2587 static const uint32_t numComps{ 1 }; 2588 static const bool hasAlpha{ false }; 2589 static const uint32_t alphaComp{ 0 }; 2590 static const bool isSRGB{ false }; 2591 static const bool isBC{ false }; 2592 static const bool isSubsampled{ false }; 2593 static const uint32_t bcWidth{ 1 }; 2594 static const uint32_t bcHeight{ 1 }; 2595 2596 typedef TransposeSingleComponent<8> TransposeT; 2597 typedef Format1<8> FormatT; 2598 }; 2599 2600 ////////////////////////////////////////////////////////////////////////// 2601 /// FormatTraits<R8_SINT> - Format traits specialization for R8_SINT 2602 ////////////////////////////////////////////////////////////////////////// 2603 template<> struct FormatTraits<R8_SINT> : 2604 ComponentTraits<SWR_TYPE_SINT, 8>, 2605 FormatSwizzle<0>, 2606 Defaults<0, 0, 0, 0x1> 2607 { 2608 static const uint32_t bpp{ 8 }; 2609 static const uint32_t numComps{ 1 }; 2610 static const bool hasAlpha{ false }; 2611 static const uint32_t alphaComp{ 0 }; 2612 static const bool isSRGB{ false }; 2613 static const bool isBC{ false }; 2614 static const bool isSubsampled{ false }; 2615 static const uint32_t bcWidth{ 1 }; 2616 static const uint32_t bcHeight{ 1 }; 2617 2618 typedef TransposeSingleComponent<8> TransposeT; 2619 typedef Format1<8> FormatT; 2620 }; 2621 2622 ////////////////////////////////////////////////////////////////////////// 2623 /// FormatTraits<R8_UINT> - Format traits specialization for R8_UINT 2624 ////////////////////////////////////////////////////////////////////////// 2625 template<> struct FormatTraits<R8_UINT> : 2626 ComponentTraits<SWR_TYPE_UINT, 8>, 2627 FormatSwizzle<0>, 2628 Defaults<0, 0, 0, 0x1> 2629 { 2630 static const uint32_t bpp{ 8 }; 2631 static const uint32_t numComps{ 1 }; 2632 static const bool hasAlpha{ false }; 2633 static const uint32_t alphaComp{ 0 }; 2634 static const bool isSRGB{ false }; 2635 static const bool isBC{ false }; 2636 static const bool isSubsampled{ false }; 2637 static const uint32_t bcWidth{ 1 }; 2638 static const uint32_t bcHeight{ 1 }; 2639 2640 typedef TransposeSingleComponent<8> TransposeT; 2641 typedef Format1<8> FormatT; 2642 }; 2643 2644 ////////////////////////////////////////////////////////////////////////// 2645 /// FormatTraits<A8_UNORM> - Format traits specialization for A8_UNORM 2646 ////////////////////////////////////////////////////////////////////////// 2647 template<> struct FormatTraits<A8_UNORM> : 2648 ComponentTraits<SWR_TYPE_UNORM, 8>, 2649 FormatSwizzle<3>, 2650 Defaults<0, 0, 0, 0x3f800000> 2651 { 2652 static const uint32_t bpp{ 8 }; 2653 static const uint32_t numComps{ 1 }; 2654 static const bool hasAlpha{ true }; 2655 static const uint32_t alphaComp{ 0 }; 2656 static const bool isSRGB{ false }; 2657 static const bool isBC{ false }; 2658 static const bool isSubsampled{ false }; 2659 static const uint32_t bcWidth{ 1 }; 2660 static const uint32_t bcHeight{ 1 }; 2661 2662 typedef TransposeSingleComponent<8> TransposeT; 2663 typedef Format1<8> FormatT; 2664 }; 2665 2666 ////////////////////////////////////////////////////////////////////////// 2667 /// FormatTraits<I8_UNORM> - Format traits specialization for I8_UNORM 2668 ////////////////////////////////////////////////////////////////////////// 2669 template<> struct FormatTraits<I8_UNORM> : 2670 ComponentTraits<SWR_TYPE_UNORM, 8>, 2671 FormatSwizzle<0>, 2672 Defaults<0, 0, 0, 0x3f800000> 2673 { 2674 static const uint32_t bpp{ 8 }; 2675 static const uint32_t numComps{ 1 }; 2676 static const bool hasAlpha{ false }; 2677 static const uint32_t alphaComp{ 0 }; 2678 static const bool isSRGB{ false }; 2679 static const bool isBC{ false }; 2680 static const bool isSubsampled{ false }; 2681 static const uint32_t bcWidth{ 1 }; 2682 static const uint32_t bcHeight{ 1 }; 2683 2684 typedef TransposeSingleComponent<8> TransposeT; 2685 typedef Format1<8> FormatT; 2686 }; 2687 2688 ////////////////////////////////////////////////////////////////////////// 2689 /// FormatTraits<L8_UNORM> - Format traits specialization for L8_UNORM 2690 ////////////////////////////////////////////////////////////////////////// 2691 template<> struct FormatTraits<L8_UNORM> : 2692 ComponentTraits<SWR_TYPE_UNORM, 8>, 2693 FormatSwizzle<0>, 2694 Defaults<0, 0, 0, 0x3f800000> 2695 { 2696 static const uint32_t bpp{ 8 }; 2697 static const uint32_t numComps{ 1 }; 2698 static const bool hasAlpha{ false }; 2699 static const uint32_t alphaComp{ 0 }; 2700 static const bool isSRGB{ false }; 2701 static const bool isBC{ false }; 2702 static const bool isSubsampled{ false }; 2703 static const uint32_t bcWidth{ 1 }; 2704 static const uint32_t bcHeight{ 1 }; 2705 2706 typedef TransposeSingleComponent<8> TransposeT; 2707 typedef Format1<8> FormatT; 2708 }; 2709 2710 ////////////////////////////////////////////////////////////////////////// 2711 /// FormatTraits<R8_SSCALED> - Format traits specialization for R8_SSCALED 2712 ////////////////////////////////////////////////////////////////////////// 2713 template<> struct FormatTraits<R8_SSCALED> : 2714 ComponentTraits<SWR_TYPE_SSCALED, 8>, 2715 FormatSwizzle<0>, 2716 Defaults<0, 0, 0, 0x3f800000> 2717 { 2718 static const uint32_t bpp{ 8 }; 2719 static const uint32_t numComps{ 1 }; 2720 static const bool hasAlpha{ false }; 2721 static const uint32_t alphaComp{ 0 }; 2722 static const bool isSRGB{ false }; 2723 static const bool isBC{ false }; 2724 static const bool isSubsampled{ false }; 2725 static const uint32_t bcWidth{ 1 }; 2726 static const uint32_t bcHeight{ 1 }; 2727 2728 typedef TransposeSingleComponent<8> TransposeT; 2729 typedef Format1<8> FormatT; 2730 }; 2731 2732 ////////////////////////////////////////////////////////////////////////// 2733 /// FormatTraits<R8_USCALED> - Format traits specialization for R8_USCALED 2734 ////////////////////////////////////////////////////////////////////////// 2735 template<> struct FormatTraits<R8_USCALED> : 2736 ComponentTraits<SWR_TYPE_USCALED, 8>, 2737 FormatSwizzle<0>, 2738 Defaults<0, 0, 0, 0x3f800000> 2739 { 2740 static const uint32_t bpp{ 8 }; 2741 static const uint32_t numComps{ 1 }; 2742 static const bool hasAlpha{ false }; 2743 static const uint32_t alphaComp{ 0 }; 2744 static const bool isSRGB{ false }; 2745 static const bool isBC{ false }; 2746 static const bool isSubsampled{ false }; 2747 static const uint32_t bcWidth{ 1 }; 2748 static const uint32_t bcHeight{ 1 }; 2749 2750 typedef TransposeSingleComponent<8> TransposeT; 2751 typedef Format1<8> FormatT; 2752 }; 2753 2754 ////////////////////////////////////////////////////////////////////////// 2755 /// FormatTraits<L8_UNORM_SRGB> - Format traits specialization for L8_UNORM_SRGB 2756 ////////////////////////////////////////////////////////////////////////// 2757 template<> struct FormatTraits<L8_UNORM_SRGB> : 2758 ComponentTraits<SWR_TYPE_UNORM, 8>, 2759 FormatSwizzle<0>, 2760 Defaults<0, 0, 0, 0x3f800000> 2761 { 2762 static const uint32_t bpp{ 8 }; 2763 static const uint32_t numComps{ 1 }; 2764 static const bool hasAlpha{ false }; 2765 static const uint32_t alphaComp{ 0 }; 2766 static const bool isSRGB{ true }; 2767 static const bool isBC{ false }; 2768 static const bool isSubsampled{ false }; 2769 static const uint32_t bcWidth{ 1 }; 2770 static const uint32_t bcHeight{ 1 }; 2771 2772 typedef TransposeSingleComponent<8> TransposeT; 2773 typedef Format1<8> FormatT; 2774 }; 2775 2776 ////////////////////////////////////////////////////////////////////////// 2777 /// FormatTraits<L8_UINT> - Format traits specialization for L8_UINT 2778 ////////////////////////////////////////////////////////////////////////// 2779 template<> struct FormatTraits<L8_UINT> : 2780 ComponentTraits<SWR_TYPE_UINT, 8>, 2781 FormatSwizzle<0>, 2782 Defaults<0, 0, 0, 0x1> 2783 { 2784 static const uint32_t bpp{ 8 }; 2785 static const uint32_t numComps{ 1 }; 2786 static const bool hasAlpha{ false }; 2787 static const uint32_t alphaComp{ 0 }; 2788 static const bool isSRGB{ false }; 2789 static const bool isBC{ false }; 2790 static const bool isSubsampled{ false }; 2791 static const uint32_t bcWidth{ 1 }; 2792 static const uint32_t bcHeight{ 1 }; 2793 2794 typedef TransposeSingleComponent<8> TransposeT; 2795 typedef Format1<8> FormatT; 2796 }; 2797 2798 ////////////////////////////////////////////////////////////////////////// 2799 /// FormatTraits<L8_SINT> - Format traits specialization for L8_SINT 2800 ////////////////////////////////////////////////////////////////////////// 2801 template<> struct FormatTraits<L8_SINT> : 2802 ComponentTraits<SWR_TYPE_SINT, 8>, 2803 FormatSwizzle<0>, 2804 Defaults<0, 0, 0, 0x1> 2805 { 2806 static const uint32_t bpp{ 8 }; 2807 static const uint32_t numComps{ 1 }; 2808 static const bool hasAlpha{ false }; 2809 static const uint32_t alphaComp{ 0 }; 2810 static const bool isSRGB{ false }; 2811 static const bool isBC{ false }; 2812 static const bool isSubsampled{ false }; 2813 static const uint32_t bcWidth{ 1 }; 2814 static const uint32_t bcHeight{ 1 }; 2815 2816 typedef TransposeSingleComponent<8> TransposeT; 2817 typedef Format1<8> FormatT; 2818 }; 2819 2820 ////////////////////////////////////////////////////////////////////////// 2821 /// FormatTraits<I8_UINT> - Format traits specialization for I8_UINT 2822 ////////////////////////////////////////////////////////////////////////// 2823 template<> struct FormatTraits<I8_UINT> : 2824 ComponentTraits<SWR_TYPE_UINT, 8>, 2825 FormatSwizzle<0>, 2826 Defaults<0, 0, 0, 0x1> 2827 { 2828 static const uint32_t bpp{ 8 }; 2829 static const uint32_t numComps{ 1 }; 2830 static const bool hasAlpha{ false }; 2831 static const uint32_t alphaComp{ 0 }; 2832 static const bool isSRGB{ false }; 2833 static const bool isBC{ false }; 2834 static const bool isSubsampled{ false }; 2835 static const uint32_t bcWidth{ 1 }; 2836 static const uint32_t bcHeight{ 1 }; 2837 2838 typedef TransposeSingleComponent<8> TransposeT; 2839 typedef Format1<8> FormatT; 2840 }; 2841 2842 ////////////////////////////////////////////////////////////////////////// 2843 /// FormatTraits<I8_SINT> - Format traits specialization for I8_SINT 2844 ////////////////////////////////////////////////////////////////////////// 2845 template<> struct FormatTraits<I8_SINT> : 2846 ComponentTraits<SWR_TYPE_SINT, 8>, 2847 FormatSwizzle<0>, 2848 Defaults<0, 0, 0, 0x1> 2849 { 2850 static const uint32_t bpp{ 8 }; 2851 static const uint32_t numComps{ 1 }; 2852 static const bool hasAlpha{ false }; 2853 static const uint32_t alphaComp{ 0 }; 2854 static const bool isSRGB{ false }; 2855 static const bool isBC{ false }; 2856 static const bool isSubsampled{ false }; 2857 static const uint32_t bcWidth{ 1 }; 2858 static const uint32_t bcHeight{ 1 }; 2859 2860 typedef TransposeSingleComponent<8> TransposeT; 2861 typedef Format1<8> FormatT; 2862 }; 2863 2864 ////////////////////////////////////////////////////////////////////////// 2865 /// FormatTraits<YCRCB_SWAPUVY> - Format traits specialization for YCRCB_SWAPUVY 2866 ////////////////////////////////////////////////////////////////////////// 2867 template<> struct FormatTraits<YCRCB_SWAPUVY> : 2868 ComponentTraits<SWR_TYPE_UINT, 8, SWR_TYPE_UINT, 8, SWR_TYPE_UINT, 8, SWR_TYPE_UINT, 8>, 2869 FormatSwizzle<0, 1, 2, 3>, 2870 Defaults<0, 0, 0, 0x1> 2871 { 2872 static const uint32_t bpp{ 32 }; 2873 static const uint32_t numComps{ 4 }; 2874 static const bool hasAlpha{ false }; 2875 static const uint32_t alphaComp{ 3 }; 2876 static const bool isSRGB{ false }; 2877 static const bool isBC{ false }; 2878 static const bool isSubsampled{ true }; 2879 static const uint32_t bcWidth{ 2 }; 2880 static const uint32_t bcHeight{ 1 }; 2881 2882 typedef Transpose8_8_8_8 TransposeT; 2883 typedef Format4<8, 8, 8, 8> FormatT; 2884 }; 2885 2886 ////////////////////////////////////////////////////////////////////////// 2887 /// FormatTraits<BC1_UNORM> - Format traits specialization for BC1_UNORM 2888 ////////////////////////////////////////////////////////////////////////// 2889 template<> struct FormatTraits<BC1_UNORM> : 2890 ComponentTraits<SWR_TYPE_UNORM, 8>, 2891 FormatSwizzle<0>, 2892 Defaults<0, 0, 0, 0x3f800000> 2893 { 2894 static const uint32_t bpp{ 64 }; 2895 static const uint32_t numComps{ 1 }; 2896 static const bool hasAlpha{ true }; 2897 static const uint32_t alphaComp{ 3 }; 2898 static const bool isSRGB{ false }; 2899 static const bool isBC{ true }; 2900 static const bool isSubsampled{ false }; 2901 static const uint32_t bcWidth{ 4 }; 2902 static const uint32_t bcHeight{ 4 }; 2903 2904 typedef TransposeSingleComponent<8> TransposeT; 2905 typedef Format1<8> FormatT; 2906 }; 2907 2908 ////////////////////////////////////////////////////////////////////////// 2909 /// FormatTraits<BC2_UNORM> - Format traits specialization for BC2_UNORM 2910 ////////////////////////////////////////////////////////////////////////// 2911 template<> struct FormatTraits<BC2_UNORM> : 2912 ComponentTraits<SWR_TYPE_UNORM, 8>, 2913 FormatSwizzle<0>, 2914 Defaults<0, 0, 0, 0x3f800000> 2915 { 2916 static const uint32_t bpp{ 128 }; 2917 static const uint32_t numComps{ 1 }; 2918 static const bool hasAlpha{ true }; 2919 static const uint32_t alphaComp{ 3 }; 2920 static const bool isSRGB{ false }; 2921 static const bool isBC{ true }; 2922 static const bool isSubsampled{ false }; 2923 static const uint32_t bcWidth{ 4 }; 2924 static const uint32_t bcHeight{ 4 }; 2925 2926 typedef TransposeSingleComponent<8> TransposeT; 2927 typedef Format1<8> FormatT; 2928 }; 2929 2930 ////////////////////////////////////////////////////////////////////////// 2931 /// FormatTraits<BC3_UNORM> - Format traits specialization for BC3_UNORM 2932 ////////////////////////////////////////////////////////////////////////// 2933 template<> struct FormatTraits<BC3_UNORM> : 2934 ComponentTraits<SWR_TYPE_UNORM, 8>, 2935 FormatSwizzle<0>, 2936 Defaults<0, 0, 0, 0x3f800000> 2937 { 2938 static const uint32_t bpp{ 128 }; 2939 static const uint32_t numComps{ 1 }; 2940 static const bool hasAlpha{ true }; 2941 static const uint32_t alphaComp{ 3 }; 2942 static const bool isSRGB{ false }; 2943 static const bool isBC{ true }; 2944 static const bool isSubsampled{ false }; 2945 static const uint32_t bcWidth{ 4 }; 2946 static const uint32_t bcHeight{ 4 }; 2947 2948 typedef TransposeSingleComponent<8> TransposeT; 2949 typedef Format1<8> FormatT; 2950 }; 2951 2952 ////////////////////////////////////////////////////////////////////////// 2953 /// FormatTraits<BC4_UNORM> - Format traits specialization for BC4_UNORM 2954 ////////////////////////////////////////////////////////////////////////// 2955 template<> struct FormatTraits<BC4_UNORM> : 2956 ComponentTraits<SWR_TYPE_UNORM, 8>, 2957 FormatSwizzle<0>, 2958 Defaults<0, 0, 0, 0x3f800000> 2959 { 2960 static const uint32_t bpp{ 64 }; 2961 static const uint32_t numComps{ 1 }; 2962 static const bool hasAlpha{ true }; 2963 static const uint32_t alphaComp{ 3 }; 2964 static const bool isSRGB{ false }; 2965 static const bool isBC{ true }; 2966 static const bool isSubsampled{ false }; 2967 static const uint32_t bcWidth{ 4 }; 2968 static const uint32_t bcHeight{ 4 }; 2969 2970 typedef TransposeSingleComponent<8> TransposeT; 2971 typedef Format1<8> FormatT; 2972 }; 2973 2974 ////////////////////////////////////////////////////////////////////////// 2975 /// FormatTraits<BC5_UNORM> - Format traits specialization for BC5_UNORM 2976 ////////////////////////////////////////////////////////////////////////// 2977 template<> struct FormatTraits<BC5_UNORM> : 2978 ComponentTraits<SWR_TYPE_UNORM, 8>, 2979 FormatSwizzle<0>, 2980 Defaults<0, 0, 0, 0x3f800000> 2981 { 2982 static const uint32_t bpp{ 128 }; 2983 static const uint32_t numComps{ 1 }; 2984 static const bool hasAlpha{ true }; 2985 static const uint32_t alphaComp{ 3 }; 2986 static const bool isSRGB{ false }; 2987 static const bool isBC{ true }; 2988 static const bool isSubsampled{ false }; 2989 static const uint32_t bcWidth{ 4 }; 2990 static const uint32_t bcHeight{ 4 }; 2991 2992 typedef TransposeSingleComponent<8> TransposeT; 2993 typedef Format1<8> FormatT; 2994 }; 2995 2996 ////////////////////////////////////////////////////////////////////////// 2997 /// FormatTraits<BC1_UNORM_SRGB> - Format traits specialization for BC1_UNORM_SRGB 2998 ////////////////////////////////////////////////////////////////////////// 2999 template<> struct FormatTraits<BC1_UNORM_SRGB> : 3000 ComponentTraits<SWR_TYPE_UNORM, 8>, 3001 FormatSwizzle<0>, 3002 Defaults<0, 0, 0, 0x3f800000> 3003 { 3004 static const uint32_t bpp{ 64 }; 3005 static const uint32_t numComps{ 1 }; 3006 static const bool hasAlpha{ true }; 3007 static const uint32_t alphaComp{ 3 }; 3008 static const bool isSRGB{ true }; 3009 static const bool isBC{ true }; 3010 static const bool isSubsampled{ false }; 3011 static const uint32_t bcWidth{ 4 }; 3012 static const uint32_t bcHeight{ 4 }; 3013 3014 typedef TransposeSingleComponent<8> TransposeT; 3015 typedef Format1<8> FormatT; 3016 }; 3017 3018 ////////////////////////////////////////////////////////////////////////// 3019 /// FormatTraits<BC2_UNORM_SRGB> - Format traits specialization for BC2_UNORM_SRGB 3020 ////////////////////////////////////////////////////////////////////////// 3021 template<> struct FormatTraits<BC2_UNORM_SRGB> : 3022 ComponentTraits<SWR_TYPE_UNORM, 8>, 3023 FormatSwizzle<0>, 3024 Defaults<0, 0, 0, 0x3f800000> 3025 { 3026 static const uint32_t bpp{ 128 }; 3027 static const uint32_t numComps{ 1 }; 3028 static const bool hasAlpha{ true }; 3029 static const uint32_t alphaComp{ 3 }; 3030 static const bool isSRGB{ true }; 3031 static const bool isBC{ true }; 3032 static const bool isSubsampled{ false }; 3033 static const uint32_t bcWidth{ 4 }; 3034 static const uint32_t bcHeight{ 4 }; 3035 3036 typedef TransposeSingleComponent<8> TransposeT; 3037 typedef Format1<8> FormatT; 3038 }; 3039 3040 ////////////////////////////////////////////////////////////////////////// 3041 /// FormatTraits<BC3_UNORM_SRGB> - Format traits specialization for BC3_UNORM_SRGB 3042 ////////////////////////////////////////////////////////////////////////// 3043 template<> struct FormatTraits<BC3_UNORM_SRGB> : 3044 ComponentTraits<SWR_TYPE_UNORM, 8>, 3045 FormatSwizzle<0>, 3046 Defaults<0, 0, 0, 0x3f800000> 3047 { 3048 static const uint32_t bpp{ 128 }; 3049 static const uint32_t numComps{ 1 }; 3050 static const bool hasAlpha{ true }; 3051 static const uint32_t alphaComp{ 3 }; 3052 static const bool isSRGB{ true }; 3053 static const bool isBC{ true }; 3054 static const bool isSubsampled{ false }; 3055 static const uint32_t bcWidth{ 4 }; 3056 static const uint32_t bcHeight{ 4 }; 3057 3058 typedef TransposeSingleComponent<8> TransposeT; 3059 typedef Format1<8> FormatT; 3060 }; 3061 3062 ////////////////////////////////////////////////////////////////////////// 3063 /// FormatTraits<YCRCB_SWAPUV> - Format traits specialization for YCRCB_SWAPUV 3064 ////////////////////////////////////////////////////////////////////////// 3065 template<> struct FormatTraits<YCRCB_SWAPUV> : 3066 ComponentTraits<SWR_TYPE_UINT, 8, SWR_TYPE_UINT, 8, SWR_TYPE_UINT, 8, SWR_TYPE_UINT, 8>, 3067 FormatSwizzle<0, 1, 2, 3>, 3068 Defaults<0, 0, 0, 0x1> 3069 { 3070 static const uint32_t bpp{ 32 }; 3071 static const uint32_t numComps{ 4 }; 3072 static const bool hasAlpha{ false }; 3073 static const uint32_t alphaComp{ 3 }; 3074 static const bool isSRGB{ false }; 3075 static const bool isBC{ false }; 3076 static const bool isSubsampled{ true }; 3077 static const uint32_t bcWidth{ 2 }; 3078 static const uint32_t bcHeight{ 1 }; 3079 3080 typedef Transpose8_8_8_8 TransposeT; 3081 typedef Format4<8, 8, 8, 8> FormatT; 3082 }; 3083 3084 ////////////////////////////////////////////////////////////////////////// 3085 /// FormatTraits<R8G8B8_UNORM> - Format traits specialization for R8G8B8_UNORM 3086 ////////////////////////////////////////////////////////////////////////// 3087 template<> struct FormatTraits<R8G8B8_UNORM> : 3088 ComponentTraits<SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8>, 3089 FormatSwizzle<0, 1, 2>, 3090 Defaults<0, 0, 0, 0x3f800000> 3091 { 3092 static const uint32_t bpp{ 24 }; 3093 static const uint32_t numComps{ 3 }; 3094 static const bool hasAlpha{ false }; 3095 static const uint32_t alphaComp{ 0 }; 3096 static const bool isSRGB{ false }; 3097 static const bool isBC{ false }; 3098 static const bool isSubsampled{ false }; 3099 static const uint32_t bcWidth{ 1 }; 3100 static const uint32_t bcHeight{ 1 }; 3101 3102 typedef Transpose8_8_8 TransposeT; 3103 typedef Format3<8, 8, 8> FormatT; 3104 }; 3105 3106 ////////////////////////////////////////////////////////////////////////// 3107 /// FormatTraits<R8G8B8_SNORM> - Format traits specialization for R8G8B8_SNORM 3108 ////////////////////////////////////////////////////////////////////////// 3109 template<> struct FormatTraits<R8G8B8_SNORM> : 3110 ComponentTraits<SWR_TYPE_SNORM, 8, SWR_TYPE_SNORM, 8, SWR_TYPE_SNORM, 8>, 3111 FormatSwizzle<0, 1, 2>, 3112 Defaults<0, 0, 0, 0x3f800000> 3113 { 3114 static const uint32_t bpp{ 24 }; 3115 static const uint32_t numComps{ 3 }; 3116 static const bool hasAlpha{ false }; 3117 static const uint32_t alphaComp{ 0 }; 3118 static const bool isSRGB{ false }; 3119 static const bool isBC{ false }; 3120 static const bool isSubsampled{ false }; 3121 static const uint32_t bcWidth{ 1 }; 3122 static const uint32_t bcHeight{ 1 }; 3123 3124 typedef Transpose8_8_8 TransposeT; 3125 typedef Format3<8, 8, 8> FormatT; 3126 }; 3127 3128 ////////////////////////////////////////////////////////////////////////// 3129 /// FormatTraits<R8G8B8_SSCALED> - Format traits specialization for R8G8B8_SSCALED 3130 ////////////////////////////////////////////////////////////////////////// 3131 template<> struct FormatTraits<R8G8B8_SSCALED> : 3132 ComponentTraits<SWR_TYPE_SSCALED, 8, SWR_TYPE_SSCALED, 8, SWR_TYPE_SSCALED, 8>, 3133 FormatSwizzle<0, 1, 2>, 3134 Defaults<0, 0, 0, 0x3f800000> 3135 { 3136 static const uint32_t bpp{ 24 }; 3137 static const uint32_t numComps{ 3 }; 3138 static const bool hasAlpha{ false }; 3139 static const uint32_t alphaComp{ 0 }; 3140 static const bool isSRGB{ false }; 3141 static const bool isBC{ false }; 3142 static const bool isSubsampled{ false }; 3143 static const uint32_t bcWidth{ 1 }; 3144 static const uint32_t bcHeight{ 1 }; 3145 3146 typedef Transpose8_8_8 TransposeT; 3147 typedef Format3<8, 8, 8> FormatT; 3148 }; 3149 3150 ////////////////////////////////////////////////////////////////////////// 3151 /// FormatTraits<R8G8B8_USCALED> - Format traits specialization for R8G8B8_USCALED 3152 ////////////////////////////////////////////////////////////////////////// 3153 template<> struct FormatTraits<R8G8B8_USCALED> : 3154 ComponentTraits<SWR_TYPE_USCALED, 8, SWR_TYPE_USCALED, 8, SWR_TYPE_USCALED, 8>, 3155 FormatSwizzle<0, 1, 2>, 3156 Defaults<0, 0, 0, 0x3f800000> 3157 { 3158 static const uint32_t bpp{ 24 }; 3159 static const uint32_t numComps{ 3 }; 3160 static const bool hasAlpha{ false }; 3161 static const uint32_t alphaComp{ 0 }; 3162 static const bool isSRGB{ false }; 3163 static const bool isBC{ false }; 3164 static const bool isSubsampled{ false }; 3165 static const uint32_t bcWidth{ 1 }; 3166 static const uint32_t bcHeight{ 1 }; 3167 3168 typedef Transpose8_8_8 TransposeT; 3169 typedef Format3<8, 8, 8> FormatT; 3170 }; 3171 3172 ////////////////////////////////////////////////////////////////////////// 3173 /// FormatTraits<R64G64B64A64_FLOAT> - Format traits specialization for R64G64B64A64_FLOAT 3174 ////////////////////////////////////////////////////////////////////////// 3175 template<> struct FormatTraits<R64G64B64A64_FLOAT> : 3176 ComponentTraits<SWR_TYPE_FLOAT, 64, SWR_TYPE_FLOAT, 64, SWR_TYPE_FLOAT, 64, SWR_TYPE_FLOAT, 64>, 3177 FormatSwizzle<0, 1, 2, 3>, 3178 Defaults<0, 0, 0, 0x3f800000> 3179 { 3180 static const uint32_t bpp{ 256 }; 3181 static const uint32_t numComps{ 4 }; 3182 static const bool hasAlpha{ true }; 3183 static const uint32_t alphaComp{ 3 }; 3184 static const bool isSRGB{ false }; 3185 static const bool isBC{ false }; 3186 static const bool isSubsampled{ false }; 3187 static const uint32_t bcWidth{ 1 }; 3188 static const uint32_t bcHeight{ 1 }; 3189 3190 typedef Transpose64_64_64_64 TransposeT; 3191 typedef Format4<64, 64, 64, 64> FormatT; 3192 }; 3193 3194 ////////////////////////////////////////////////////////////////////////// 3195 /// FormatTraits<R64G64B64_FLOAT> - Format traits specialization for R64G64B64_FLOAT 3196 ////////////////////////////////////////////////////////////////////////// 3197 template<> struct FormatTraits<R64G64B64_FLOAT> : 3198 ComponentTraits<SWR_TYPE_FLOAT, 64, SWR_TYPE_FLOAT, 64, SWR_TYPE_FLOAT, 64>, 3199 FormatSwizzle<0, 1, 2>, 3200 Defaults<0, 0, 0, 0x3f800000> 3201 { 3202 static const uint32_t bpp{ 192 }; 3203 static const uint32_t numComps{ 3 }; 3204 static const bool hasAlpha{ false }; 3205 static const uint32_t alphaComp{ 0 }; 3206 static const bool isSRGB{ false }; 3207 static const bool isBC{ false }; 3208 static const bool isSubsampled{ false }; 3209 static const uint32_t bcWidth{ 1 }; 3210 static const uint32_t bcHeight{ 1 }; 3211 3212 typedef Transpose64_64_64 TransposeT; 3213 typedef Format3<64, 64, 64> FormatT; 3214 }; 3215 3216 ////////////////////////////////////////////////////////////////////////// 3217 /// FormatTraits<BC4_SNORM> - Format traits specialization for BC4_SNORM 3218 ////////////////////////////////////////////////////////////////////////// 3219 template<> struct FormatTraits<BC4_SNORM> : 3220 ComponentTraits<SWR_TYPE_SNORM, 8>, 3221 FormatSwizzle<0>, 3222 Defaults<0, 0, 0, 0x3f800000> 3223 { 3224 static const uint32_t bpp{ 64 }; 3225 static const uint32_t numComps{ 1 }; 3226 static const bool hasAlpha{ true }; 3227 static const uint32_t alphaComp{ 3 }; 3228 static const bool isSRGB{ false }; 3229 static const bool isBC{ true }; 3230 static const bool isSubsampled{ false }; 3231 static const uint32_t bcWidth{ 4 }; 3232 static const uint32_t bcHeight{ 4 }; 3233 3234 typedef TransposeSingleComponent<8> TransposeT; 3235 typedef Format1<8> FormatT; 3236 }; 3237 3238 ////////////////////////////////////////////////////////////////////////// 3239 /// FormatTraits<BC5_SNORM> - Format traits specialization for BC5_SNORM 3240 ////////////////////////////////////////////////////////////////////////// 3241 template<> struct FormatTraits<BC5_SNORM> : 3242 ComponentTraits<SWR_TYPE_SNORM, 8>, 3243 FormatSwizzle<0>, 3244 Defaults<0, 0, 0, 0x3f800000> 3245 { 3246 static const uint32_t bpp{ 128 }; 3247 static const uint32_t numComps{ 1 }; 3248 static const bool hasAlpha{ true }; 3249 static const uint32_t alphaComp{ 3 }; 3250 static const bool isSRGB{ false }; 3251 static const bool isBC{ true }; 3252 static const bool isSubsampled{ false }; 3253 static const uint32_t bcWidth{ 4 }; 3254 static const uint32_t bcHeight{ 4 }; 3255 3256 typedef TransposeSingleComponent<8> TransposeT; 3257 typedef Format1<8> FormatT; 3258 }; 3259 3260 ////////////////////////////////////////////////////////////////////////// 3261 /// FormatTraits<R16G16B16_FLOAT> - Format traits specialization for R16G16B16_FLOAT 3262 ////////////////////////////////////////////////////////////////////////// 3263 template<> struct FormatTraits<R16G16B16_FLOAT> : 3264 ComponentTraits<SWR_TYPE_FLOAT, 16, SWR_TYPE_FLOAT, 16, SWR_TYPE_FLOAT, 16>, 3265 FormatSwizzle<0, 1, 2>, 3266 Defaults<0, 0, 0, 0x3f800000> 3267 { 3268 static const uint32_t bpp{ 48 }; 3269 static const uint32_t numComps{ 3 }; 3270 static const bool hasAlpha{ false }; 3271 static const uint32_t alphaComp{ 0 }; 3272 static const bool isSRGB{ false }; 3273 static const bool isBC{ false }; 3274 static const bool isSubsampled{ false }; 3275 static const uint32_t bcWidth{ 1 }; 3276 static const uint32_t bcHeight{ 1 }; 3277 3278 typedef Transpose16_16_16 TransposeT; 3279 typedef Format3<16, 16, 16> FormatT; 3280 }; 3281 3282 ////////////////////////////////////////////////////////////////////////// 3283 /// FormatTraits<R16G16B16_UNORM> - Format traits specialization for R16G16B16_UNORM 3284 ////////////////////////////////////////////////////////////////////////// 3285 template<> struct FormatTraits<R16G16B16_UNORM> : 3286 ComponentTraits<SWR_TYPE_UNORM, 16, SWR_TYPE_UNORM, 16, SWR_TYPE_UNORM, 16>, 3287 FormatSwizzle<0, 1, 2>, 3288 Defaults<0, 0, 0, 0x3f800000> 3289 { 3290 static const uint32_t bpp{ 48 }; 3291 static const uint32_t numComps{ 3 }; 3292 static const bool hasAlpha{ false }; 3293 static const uint32_t alphaComp{ 0 }; 3294 static const bool isSRGB{ false }; 3295 static const bool isBC{ false }; 3296 static const bool isSubsampled{ false }; 3297 static const uint32_t bcWidth{ 1 }; 3298 static const uint32_t bcHeight{ 1 }; 3299 3300 typedef Transpose16_16_16 TransposeT; 3301 typedef Format3<16, 16, 16> FormatT; 3302 }; 3303 3304 ////////////////////////////////////////////////////////////////////////// 3305 /// FormatTraits<R16G16B16_SNORM> - Format traits specialization for R16G16B16_SNORM 3306 ////////////////////////////////////////////////////////////////////////// 3307 template<> struct FormatTraits<R16G16B16_SNORM> : 3308 ComponentTraits<SWR_TYPE_SNORM, 16, SWR_TYPE_SNORM, 16, SWR_TYPE_SNORM, 16>, 3309 FormatSwizzle<0, 1, 2>, 3310 Defaults<0, 0, 0, 0x3f800000> 3311 { 3312 static const uint32_t bpp{ 48 }; 3313 static const uint32_t numComps{ 3 }; 3314 static const bool hasAlpha{ false }; 3315 static const uint32_t alphaComp{ 0 }; 3316 static const bool isSRGB{ false }; 3317 static const bool isBC{ false }; 3318 static const bool isSubsampled{ false }; 3319 static const uint32_t bcWidth{ 1 }; 3320 static const uint32_t bcHeight{ 1 }; 3321 3322 typedef Transpose16_16_16 TransposeT; 3323 typedef Format3<16, 16, 16> FormatT; 3324 }; 3325 3326 ////////////////////////////////////////////////////////////////////////// 3327 /// FormatTraits<R16G16B16_SSCALED> - Format traits specialization for R16G16B16_SSCALED 3328 ////////////////////////////////////////////////////////////////////////// 3329 template<> struct FormatTraits<R16G16B16_SSCALED> : 3330 ComponentTraits<SWR_TYPE_SSCALED, 16, SWR_TYPE_SSCALED, 16, SWR_TYPE_SSCALED, 16>, 3331 FormatSwizzle<0, 1, 2>, 3332 Defaults<0, 0, 0, 0x3f800000> 3333 { 3334 static const uint32_t bpp{ 48 }; 3335 static const uint32_t numComps{ 3 }; 3336 static const bool hasAlpha{ false }; 3337 static const uint32_t alphaComp{ 0 }; 3338 static const bool isSRGB{ false }; 3339 static const bool isBC{ false }; 3340 static const bool isSubsampled{ false }; 3341 static const uint32_t bcWidth{ 1 }; 3342 static const uint32_t bcHeight{ 1 }; 3343 3344 typedef Transpose16_16_16 TransposeT; 3345 typedef Format3<16, 16, 16> FormatT; 3346 }; 3347 3348 ////////////////////////////////////////////////////////////////////////// 3349 /// FormatTraits<R16G16B16_USCALED> - Format traits specialization for R16G16B16_USCALED 3350 ////////////////////////////////////////////////////////////////////////// 3351 template<> struct FormatTraits<R16G16B16_USCALED> : 3352 ComponentTraits<SWR_TYPE_USCALED, 16, SWR_TYPE_USCALED, 16, SWR_TYPE_USCALED, 16>, 3353 FormatSwizzle<0, 1, 2>, 3354 Defaults<0, 0, 0, 0x3f800000> 3355 { 3356 static const uint32_t bpp{ 48 }; 3357 static const uint32_t numComps{ 3 }; 3358 static const bool hasAlpha{ false }; 3359 static const uint32_t alphaComp{ 0 }; 3360 static const bool isSRGB{ false }; 3361 static const bool isBC{ false }; 3362 static const bool isSubsampled{ false }; 3363 static const uint32_t bcWidth{ 1 }; 3364 static const uint32_t bcHeight{ 1 }; 3365 3366 typedef Transpose16_16_16 TransposeT; 3367 typedef Format3<16, 16, 16> FormatT; 3368 }; 3369 3370 ////////////////////////////////////////////////////////////////////////// 3371 /// FormatTraits<BC6H_SF16> - Format traits specialization for BC6H_SF16 3372 ////////////////////////////////////////////////////////////////////////// 3373 template<> struct FormatTraits<BC6H_SF16> : 3374 ComponentTraits<SWR_TYPE_SNORM, 8>, 3375 FormatSwizzle<0>, 3376 Defaults<0, 0, 0, 0x3f800000> 3377 { 3378 static const uint32_t bpp{ 128 }; 3379 static const uint32_t numComps{ 1 }; 3380 static const bool hasAlpha{ true }; 3381 static const uint32_t alphaComp{ 3 }; 3382 static const bool isSRGB{ false }; 3383 static const bool isBC{ true }; 3384 static const bool isSubsampled{ false }; 3385 static const uint32_t bcWidth{ 4 }; 3386 static const uint32_t bcHeight{ 4 }; 3387 3388 typedef TransposeSingleComponent<8> TransposeT; 3389 typedef Format1<8> FormatT; 3390 }; 3391 3392 ////////////////////////////////////////////////////////////////////////// 3393 /// FormatTraits<BC7_UNORM> - Format traits specialization for BC7_UNORM 3394 ////////////////////////////////////////////////////////////////////////// 3395 template<> struct FormatTraits<BC7_UNORM> : 3396 ComponentTraits<SWR_TYPE_UNORM, 8>, 3397 FormatSwizzle<0>, 3398 Defaults<0, 0, 0, 0x3f800000> 3399 { 3400 static const uint32_t bpp{ 128 }; 3401 static const uint32_t numComps{ 1 }; 3402 static const bool hasAlpha{ true }; 3403 static const uint32_t alphaComp{ 3 }; 3404 static const bool isSRGB{ false }; 3405 static const bool isBC{ true }; 3406 static const bool isSubsampled{ false }; 3407 static const uint32_t bcWidth{ 4 }; 3408 static const uint32_t bcHeight{ 4 }; 3409 3410 typedef TransposeSingleComponent<8> TransposeT; 3411 typedef Format1<8> FormatT; 3412 }; 3413 3414 ////////////////////////////////////////////////////////////////////////// 3415 /// FormatTraits<BC7_UNORM_SRGB> - Format traits specialization for BC7_UNORM_SRGB 3416 ////////////////////////////////////////////////////////////////////////// 3417 template<> struct FormatTraits<BC7_UNORM_SRGB> : 3418 ComponentTraits<SWR_TYPE_UNORM, 8>, 3419 FormatSwizzle<0>, 3420 Defaults<0, 0, 0, 0x3f800000> 3421 { 3422 static const uint32_t bpp{ 128 }; 3423 static const uint32_t numComps{ 1 }; 3424 static const bool hasAlpha{ true }; 3425 static const uint32_t alphaComp{ 3 }; 3426 static const bool isSRGB{ true }; 3427 static const bool isBC{ true }; 3428 static const bool isSubsampled{ false }; 3429 static const uint32_t bcWidth{ 4 }; 3430 static const uint32_t bcHeight{ 4 }; 3431 3432 typedef TransposeSingleComponent<8> TransposeT; 3433 typedef Format1<8> FormatT; 3434 }; 3435 3436 ////////////////////////////////////////////////////////////////////////// 3437 /// FormatTraits<BC6H_UF16> - Format traits specialization for BC6H_UF16 3438 ////////////////////////////////////////////////////////////////////////// 3439 template<> struct FormatTraits<BC6H_UF16> : 3440 ComponentTraits<SWR_TYPE_UNORM, 8>, 3441 FormatSwizzle<0>, 3442 Defaults<0, 0, 0, 0x3f800000> 3443 { 3444 static const uint32_t bpp{ 128 }; 3445 static const uint32_t numComps{ 1 }; 3446 static const bool hasAlpha{ true }; 3447 static const uint32_t alphaComp{ 3 }; 3448 static const bool isSRGB{ false }; 3449 static const bool isBC{ true }; 3450 static const bool isSubsampled{ false }; 3451 static const uint32_t bcWidth{ 4 }; 3452 static const uint32_t bcHeight{ 4 }; 3453 3454 typedef TransposeSingleComponent<8> TransposeT; 3455 typedef Format1<8> FormatT; 3456 }; 3457 3458 ////////////////////////////////////////////////////////////////////////// 3459 /// FormatTraits<R8G8B8_UNORM_SRGB> - Format traits specialization for R8G8B8_UNORM_SRGB 3460 ////////////////////////////////////////////////////////////////////////// 3461 template<> struct FormatTraits<R8G8B8_UNORM_SRGB> : 3462 ComponentTraits<SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8, SWR_TYPE_UNORM, 8>, 3463 FormatSwizzle<0, 1, 2>, 3464 Defaults<0, 0, 0, 0x3f800000> 3465 { 3466 static const uint32_t bpp{ 24 }; 3467 static const uint32_t numComps{ 3 }; 3468 static const bool hasAlpha{ false }; 3469 static const uint32_t alphaComp{ 0 }; 3470 static const bool isSRGB{ true }; 3471 static const bool isBC{ false }; 3472 static const bool isSubsampled{ false }; 3473 static const uint32_t bcWidth{ 1 }; 3474 static const uint32_t bcHeight{ 1 }; 3475 3476 typedef Transpose8_8_8 TransposeT; 3477 typedef Format3<8, 8, 8> FormatT; 3478 }; 3479 3480 ////////////////////////////////////////////////////////////////////////// 3481 /// FormatTraits<R16G16B16_UINT> - Format traits specialization for R16G16B16_UINT 3482 ////////////////////////////////////////////////////////////////////////// 3483 template<> struct FormatTraits<R16G16B16_UINT> : 3484 ComponentTraits<SWR_TYPE_UINT, 16, SWR_TYPE_UINT, 16, SWR_TYPE_UINT, 16>, 3485 FormatSwizzle<0, 1, 2>, 3486 Defaults<0, 0, 0, 0x1> 3487 { 3488 static const uint32_t bpp{ 48 }; 3489 static const uint32_t numComps{ 3 }; 3490 static const bool hasAlpha{ false }; 3491 static const uint32_t alphaComp{ 0 }; 3492 static const bool isSRGB{ false }; 3493 static const bool isBC{ false }; 3494 static const bool isSubsampled{ false }; 3495 static const uint32_t bcWidth{ 1 }; 3496 static const uint32_t bcHeight{ 1 }; 3497 3498 typedef Transpose16_16_16 TransposeT; 3499 typedef Format3<16, 16, 16> FormatT; 3500 }; 3501 3502 ////////////////////////////////////////////////////////////////////////// 3503 /// FormatTraits<R16G16B16_SINT> - Format traits specialization for R16G16B16_SINT 3504 ////////////////////////////////////////////////////////////////////////// 3505 template<> struct FormatTraits<R16G16B16_SINT> : 3506 ComponentTraits<SWR_TYPE_SINT, 16, SWR_TYPE_SINT, 16, SWR_TYPE_SINT, 16>, 3507 FormatSwizzle<0, 1, 2>, 3508 Defaults<0, 0, 0, 0x1> 3509 { 3510 static const uint32_t bpp{ 48 }; 3511 static const uint32_t numComps{ 3 }; 3512 static const bool hasAlpha{ false }; 3513 static const uint32_t alphaComp{ 0 }; 3514 static const bool isSRGB{ false }; 3515 static const bool isBC{ false }; 3516 static const bool isSubsampled{ false }; 3517 static const uint32_t bcWidth{ 1 }; 3518 static const uint32_t bcHeight{ 1 }; 3519 3520 typedef Transpose16_16_16 TransposeT; 3521 typedef Format3<16, 16, 16> FormatT; 3522 }; 3523 3524 ////////////////////////////////////////////////////////////////////////// 3525 /// FormatTraits<R32_SFIXED> - Format traits specialization for R32_SFIXED 3526 ////////////////////////////////////////////////////////////////////////// 3527 template<> struct FormatTraits<R32_SFIXED> : 3528 ComponentTraits<SWR_TYPE_SFIXED, 32>, 3529 FormatSwizzle<0>, 3530 Defaults<0, 0, 0, 0x3f800000> 3531 { 3532 static const uint32_t bpp{ 32 }; 3533 static const uint32_t numComps{ 1 }; 3534 static const bool hasAlpha{ false }; 3535 static const uint32_t alphaComp{ 0 }; 3536 static const bool isSRGB{ false }; 3537 static const bool isBC{ false }; 3538 static const bool isSubsampled{ false }; 3539 static const uint32_t bcWidth{ 1 }; 3540 static const uint32_t bcHeight{ 1 }; 3541 3542 typedef TransposeSingleComponent<32> TransposeT; 3543 typedef Format1<32> FormatT; 3544 }; 3545 3546 ////////////////////////////////////////////////////////////////////////// 3547 /// FormatTraits<R10G10B10A2_SNORM> - Format traits specialization for R10G10B10A2_SNORM 3548 ////////////////////////////////////////////////////////////////////////// 3549 template<> struct FormatTraits<R10G10B10A2_SNORM> : 3550 ComponentTraits<SWR_TYPE_SNORM, 10, SWR_TYPE_SNORM, 10, SWR_TYPE_SNORM, 10, SWR_TYPE_SNORM, 2>, 3551 FormatSwizzle<0, 1, 2, 3>, 3552 Defaults<0, 0, 0, 0x3f800000> 3553 { 3554 static const uint32_t bpp{ 32 }; 3555 static const uint32_t numComps{ 4 }; 3556 static const bool hasAlpha{ true }; 3557 static const uint32_t alphaComp{ 3 }; 3558 static const bool isSRGB{ false }; 3559 static const bool isBC{ false }; 3560 static const bool isSubsampled{ false }; 3561 static const uint32_t bcWidth{ 1 }; 3562 static const uint32_t bcHeight{ 1 }; 3563 3564 typedef Transpose10_10_10_2 TransposeT; 3565 typedef Format4<10, 10, 10, 2> FormatT; 3566 }; 3567 3568 ////////////////////////////////////////////////////////////////////////// 3569 /// FormatTraits<R10G10B10A2_USCALED> - Format traits specialization for R10G10B10A2_USCALED 3570 ////////////////////////////////////////////////////////////////////////// 3571 template<> struct FormatTraits<R10G10B10A2_USCALED> : 3572 ComponentTraits<SWR_TYPE_USCALED, 10, SWR_TYPE_USCALED, 10, SWR_TYPE_USCALED, 10, SWR_TYPE_USCALED, 2>, 3573 FormatSwizzle<0, 1, 2, 3>, 3574 Defaults<0, 0, 0, 0x3f800000> 3575 { 3576 static const uint32_t bpp{ 32 }; 3577 static const uint32_t numComps{ 4 }; 3578 static const bool hasAlpha{ true }; 3579 static const uint32_t alphaComp{ 3 }; 3580 static const bool isSRGB{ false }; 3581 static const bool isBC{ false }; 3582 static const bool isSubsampled{ false }; 3583 static const uint32_t bcWidth{ 1 }; 3584 static const uint32_t bcHeight{ 1 }; 3585 3586 typedef Transpose10_10_10_2 TransposeT; 3587 typedef Format4<10, 10, 10, 2> FormatT; 3588 }; 3589 3590 ////////////////////////////////////////////////////////////////////////// 3591 /// FormatTraits<R10G10B10A2_SSCALED> - Format traits specialization for R10G10B10A2_SSCALED 3592 ////////////////////////////////////////////////////////////////////////// 3593 template<> struct FormatTraits<R10G10B10A2_SSCALED> : 3594 ComponentTraits<SWR_TYPE_SSCALED, 10, SWR_TYPE_SSCALED, 10, SWR_TYPE_SSCALED, 10, SWR_TYPE_SSCALED, 2>, 3595 FormatSwizzle<0, 1, 2, 3>, 3596 Defaults<0, 0, 0, 0x3f800000> 3597 { 3598 static const uint32_t bpp{ 32 }; 3599 static const uint32_t numComps{ 4 }; 3600 static const bool hasAlpha{ true }; 3601 static const uint32_t alphaComp{ 3 }; 3602 static const bool isSRGB{ false }; 3603 static const bool isBC{ false }; 3604 static const bool isSubsampled{ false }; 3605 static const uint32_t bcWidth{ 1 }; 3606 static const uint32_t bcHeight{ 1 }; 3607 3608 typedef Transpose10_10_10_2 TransposeT; 3609 typedef Format4<10, 10, 10, 2> FormatT; 3610 }; 3611 3612 ////////////////////////////////////////////////////////////////////////// 3613 /// FormatTraits<R10G10B10A2_SINT> - Format traits specialization for R10G10B10A2_SINT 3614 ////////////////////////////////////////////////////////////////////////// 3615 template<> struct FormatTraits<R10G10B10A2_SINT> : 3616 ComponentTraits<SWR_TYPE_SINT, 10, SWR_TYPE_SINT, 10, SWR_TYPE_SINT, 10, SWR_TYPE_SINT, 2>, 3617 FormatSwizzle<0, 1, 2, 3>, 3618 Defaults<0, 0, 0, 0x1> 3619 { 3620 static const uint32_t bpp{ 32 }; 3621 static const uint32_t numComps{ 4 }; 3622 static const bool hasAlpha{ true }; 3623 static const uint32_t alphaComp{ 3 }; 3624 static const bool isSRGB{ false }; 3625 static const bool isBC{ false }; 3626 static const bool isSubsampled{ false }; 3627 static const uint32_t bcWidth{ 1 }; 3628 static const uint32_t bcHeight{ 1 }; 3629 3630 typedef Transpose10_10_10_2 TransposeT; 3631 typedef Format4<10, 10, 10, 2> FormatT; 3632 }; 3633 3634 ////////////////////////////////////////////////////////////////////////// 3635 /// FormatTraits<B10G10R10A2_SNORM> - Format traits specialization for B10G10R10A2_SNORM 3636 ////////////////////////////////////////////////////////////////////////// 3637 template<> struct FormatTraits<B10G10R10A2_SNORM> : 3638 ComponentTraits<SWR_TYPE_SNORM, 10, SWR_TYPE_SNORM, 10, SWR_TYPE_SNORM, 10, SWR_TYPE_SNORM, 2>, 3639 FormatSwizzle<2, 1, 0, 3>, 3640 Defaults<0, 0, 0, 0x3f800000> 3641 { 3642 static const uint32_t bpp{ 32 }; 3643 static const uint32_t numComps{ 4 }; 3644 static const bool hasAlpha{ true }; 3645 static const uint32_t alphaComp{ 3 }; 3646 static const bool isSRGB{ false }; 3647 static const bool isBC{ false }; 3648 static const bool isSubsampled{ false }; 3649 static const uint32_t bcWidth{ 1 }; 3650 static const uint32_t bcHeight{ 1 }; 3651 3652 typedef Transpose10_10_10_2 TransposeT; 3653 typedef Format4<10, 10, 10, 2> FormatT; 3654 }; 3655 3656 ////////////////////////////////////////////////////////////////////////// 3657 /// FormatTraits<B10G10R10A2_USCALED> - Format traits specialization for B10G10R10A2_USCALED 3658 ////////////////////////////////////////////////////////////////////////// 3659 template<> struct FormatTraits<B10G10R10A2_USCALED> : 3660 ComponentTraits<SWR_TYPE_USCALED, 10, SWR_TYPE_USCALED, 10, SWR_TYPE_USCALED, 10, SWR_TYPE_USCALED, 2>, 3661 FormatSwizzle<2, 1, 0, 3>, 3662 Defaults<0, 0, 0, 0x3f800000> 3663 { 3664 static const uint32_t bpp{ 32 }; 3665 static const uint32_t numComps{ 4 }; 3666 static const bool hasAlpha{ true }; 3667 static const uint32_t alphaComp{ 3 }; 3668 static const bool isSRGB{ false }; 3669 static const bool isBC{ false }; 3670 static const bool isSubsampled{ false }; 3671 static const uint32_t bcWidth{ 1 }; 3672 static const uint32_t bcHeight{ 1 }; 3673 3674 typedef Transpose10_10_10_2 TransposeT; 3675 typedef Format4<10, 10, 10, 2> FormatT; 3676 }; 3677 3678 ////////////////////////////////////////////////////////////////////////// 3679 /// FormatTraits<B10G10R10A2_SSCALED> - Format traits specialization for B10G10R10A2_SSCALED 3680 ////////////////////////////////////////////////////////////////////////// 3681 template<> struct FormatTraits<B10G10R10A2_SSCALED> : 3682 ComponentTraits<SWR_TYPE_SSCALED, 10, SWR_TYPE_SSCALED, 10, SWR_TYPE_SSCALED, 10, SWR_TYPE_SSCALED, 2>, 3683 FormatSwizzle<2, 1, 0, 3>, 3684 Defaults<0, 0, 0, 0x3f800000> 3685 { 3686 static const uint32_t bpp{ 32 }; 3687 static const uint32_t numComps{ 4 }; 3688 static const bool hasAlpha{ true }; 3689 static const uint32_t alphaComp{ 3 }; 3690 static const bool isSRGB{ false }; 3691 static const bool isBC{ false }; 3692 static const bool isSubsampled{ false }; 3693 static const uint32_t bcWidth{ 1 }; 3694 static const uint32_t bcHeight{ 1 }; 3695 3696 typedef Transpose10_10_10_2 TransposeT; 3697 typedef Format4<10, 10, 10, 2> FormatT; 3698 }; 3699 3700 ////////////////////////////////////////////////////////////////////////// 3701 /// FormatTraits<B10G10R10A2_UINT> - Format traits specialization for B10G10R10A2_UINT 3702 ////////////////////////////////////////////////////////////////////////// 3703 template<> struct FormatTraits<B10G10R10A2_UINT> : 3704 ComponentTraits<SWR_TYPE_UINT, 10, SWR_TYPE_UINT, 10, SWR_TYPE_UINT, 10, SWR_TYPE_UINT, 2>, 3705 FormatSwizzle<2, 1, 0, 3>, 3706 Defaults<0, 0, 0, 0x1> 3707 { 3708 static const uint32_t bpp{ 32 }; 3709 static const uint32_t numComps{ 4 }; 3710 static const bool hasAlpha{ true }; 3711 static const uint32_t alphaComp{ 3 }; 3712 static const bool isSRGB{ false }; 3713 static const bool isBC{ false }; 3714 static const bool isSubsampled{ false }; 3715 static const uint32_t bcWidth{ 1 }; 3716 static const uint32_t bcHeight{ 1 }; 3717 3718 typedef Transpose10_10_10_2 TransposeT; 3719 typedef Format4<10, 10, 10, 2> FormatT; 3720 }; 3721 3722 ////////////////////////////////////////////////////////////////////////// 3723 /// FormatTraits<B10G10R10A2_SINT> - Format traits specialization for B10G10R10A2_SINT 3724 ////////////////////////////////////////////////////////////////////////// 3725 template<> struct FormatTraits<B10G10R10A2_SINT> : 3726 ComponentTraits<SWR_TYPE_SINT, 10, SWR_TYPE_SINT, 10, SWR_TYPE_SINT, 10, SWR_TYPE_SINT, 2>, 3727 FormatSwizzle<2, 1, 0, 3>, 3728 Defaults<0, 0, 0, 0x1> 3729 { 3730 static const uint32_t bpp{ 32 }; 3731 static const uint32_t numComps{ 4 }; 3732 static const bool hasAlpha{ true }; 3733 static const uint32_t alphaComp{ 3 }; 3734 static const bool isSRGB{ false }; 3735 static const bool isBC{ false }; 3736 static const bool isSubsampled{ false }; 3737 static const uint32_t bcWidth{ 1 }; 3738 static const uint32_t bcHeight{ 1 }; 3739 3740 typedef Transpose10_10_10_2 TransposeT; 3741 typedef Format4<10, 10, 10, 2> FormatT; 3742 }; 3743 3744 ////////////////////////////////////////////////////////////////////////// 3745 /// FormatTraits<R8G8B8_UINT> - Format traits specialization for R8G8B8_UINT 3746 ////////////////////////////////////////////////////////////////////////// 3747 template<> struct FormatTraits<R8G8B8_UINT> : 3748 ComponentTraits<SWR_TYPE_UINT, 8, SWR_TYPE_UINT, 8, SWR_TYPE_UINT, 8>, 3749 FormatSwizzle<0, 1, 2>, 3750 Defaults<0, 0, 0, 0x1> 3751 { 3752 static const uint32_t bpp{ 24 }; 3753 static const uint32_t numComps{ 3 }; 3754 static const bool hasAlpha{ false }; 3755 static const uint32_t alphaComp{ 0 }; 3756 static const bool isSRGB{ false }; 3757 static const bool isBC{ false }; 3758 static const bool isSubsampled{ false }; 3759 static const uint32_t bcWidth{ 1 }; 3760 static const uint32_t bcHeight{ 1 }; 3761 3762 typedef Transpose8_8_8 TransposeT; 3763 typedef Format3<8, 8, 8> FormatT; 3764 }; 3765 3766 ////////////////////////////////////////////////////////////////////////// 3767 /// FormatTraits<R8G8B8_SINT> - Format traits specialization for R8G8B8_SINT 3768 ////////////////////////////////////////////////////////////////////////// 3769 template<> struct FormatTraits<R8G8B8_SINT> : 3770 ComponentTraits<SWR_TYPE_SINT, 8, SWR_TYPE_SINT, 8, SWR_TYPE_SINT, 8>, 3771 FormatSwizzle<0, 1, 2>, 3772 Defaults<0, 0, 0, 0x1> 3773 { 3774 static const uint32_t bpp{ 24 }; 3775 static const uint32_t numComps{ 3 }; 3776 static const bool hasAlpha{ false }; 3777 static const uint32_t alphaComp{ 0 }; 3778 static const bool isSRGB{ false }; 3779 static const bool isBC{ false }; 3780 static const bool isSubsampled{ false }; 3781 static const uint32_t bcWidth{ 1 }; 3782 static const uint32_t bcHeight{ 1 }; 3783 3784 typedef Transpose8_8_8 TransposeT; 3785 typedef Format3<8, 8, 8> FormatT; 3786 }; 3787 3788 ////////////////////////////////////////////////////////////////////////// 3789 /// FormatTraits<RAW> - Format traits specialization for RAW 3790 ////////////////////////////////////////////////////////////////////////// 3791 template<> struct FormatTraits<RAW> : 3792 ComponentTraits<SWR_TYPE_UINT, 8>, 3793 FormatSwizzle<0>, 3794 Defaults<0, 0, 0, 0x1> 3795 { 3796 static const uint32_t bpp{ 8 }; 3797 static const uint32_t numComps{ 1 }; 3798 static const bool hasAlpha{ false }; 3799 static const uint32_t alphaComp{ 3 }; 3800 static const bool isSRGB{ false }; 3801 static const bool isBC{ false }; 3802 static const bool isSubsampled{ false }; 3803 static const uint32_t bcWidth{ 1 }; 3804 static const uint32_t bcHeight{ 1 }; 3805 3806 typedef TransposeSingleComponent<8> TransposeT; 3807 typedef Format1<8> FormatT; 3808 }; 3809