sierra/
format.rs

1/// Texel format.
2/// Images can have different texel formats.
3/// Some of which are color or depth and/or stencil.
4/// Format defines components, number of bits, layout and representation of
5/// texels.
6#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
7#[cfg_attr(feature = "serde-1", derive(serde::Serialize, serde::Deserialize))]
8pub enum Format {
9    R8Unorm,
10    R8Snorm,
11    R8Uscaled,
12    R8Sscaled,
13    R8Uint,
14    R8Sint,
15    R8Srgb,
16    RG8Unorm,
17    RG8Snorm,
18    RG8Uscaled,
19    RG8Sscaled,
20    RG8Uint,
21    RG8Sint,
22    RG8Srgb,
23    RGB8Unorm,
24    RGB8Snorm,
25    RGB8Uscaled,
26    RGB8Sscaled,
27    RGB8Uint,
28    RGB8Sint,
29    RGB8Srgb,
30    BGR8Unorm,
31    BGR8Snorm,
32    BGR8Uscaled,
33    BGR8Sscaled,
34    BGR8Uint,
35    BGR8Sint,
36    BGR8Srgb,
37    RGBA8Unorm,
38    RGBA8Snorm,
39    RGBA8Uscaled,
40    RGBA8Sscaled,
41    RGBA8Uint,
42    RGBA8Sint,
43    RGBA8Srgb,
44    BGRA8Unorm,
45    BGRA8Snorm,
46    BGRA8Uscaled,
47    BGRA8Sscaled,
48    BGRA8Uint,
49    BGRA8Sint,
50    BGRA8Srgb,
51    R16Unorm,
52    R16Snorm,
53    R16Uscaled,
54    R16Sscaled,
55    R16Uint,
56    R16Sint,
57    R16Sfloat,
58    RG16Unorm,
59    RG16Snorm,
60    RG16Uscaled,
61    RG16Sscaled,
62    RG16Uint,
63    RG16Sint,
64    RG16Sfloat,
65    RGB16Unorm,
66    RGB16Snorm,
67    RGB16Uscaled,
68    RGB16Sscaled,
69    RGB16Uint,
70    RGB16Sint,
71    RGB16Sfloat,
72    RGBA16Unorm,
73    RGBA16Snorm,
74    RGBA16Uscaled,
75    RGBA16Sscaled,
76    RGBA16Uint,
77    RGBA16Sint,
78    RGBA16Sfloat,
79    R32Uint,
80    R32Sint,
81    R32Sfloat,
82    RG32Uint,
83    RG32Sint,
84    RG32Sfloat,
85    RGB32Uint,
86    RGB32Sint,
87    RGB32Sfloat,
88    RGBA32Uint,
89    RGBA32Sint,
90    RGBA32Sfloat,
91    R64Uint,
92    R64Sint,
93    R64Sfloat,
94    RG64Uint,
95    RG64Sint,
96    RG64Sfloat,
97    RGB64Uint,
98    RGB64Sint,
99    RGB64Sfloat,
100    RGBA64Uint,
101    RGBA64Sint,
102    RGBA64Sfloat,
103    D16Unorm,
104    D32Sfloat,
105    S8Uint,
106    D16UnormS8Uint,
107    D24UnormS8Uint,
108    D32SfloatS8Uint,
109}
110
111#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
112#[cfg_attr(feature = "serde-1", derive(serde::Serialize, serde::Deserialize))]
113pub enum Type {
114    Uint,
115    Sint,
116    Srgb,
117    Unorm,
118    Snorm,
119    Uscaled,
120    Sscaled,
121    Sfloat,
122}
123
124#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
125#[cfg_attr(feature = "serde-1", derive(serde::Serialize, serde::Deserialize))]
126pub enum Channels {
127    R,
128    RG,
129    RGB,
130    BGR,
131    RGBA,
132    BGRA,
133    D,
134    S,
135    DS,
136}
137
138#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
139#[cfg_attr(feature = "serde-1", derive(serde::Serialize, serde::Deserialize))]
140pub struct FormatDescription<C, B, T> {
141    pub channels: C,
142    pub bits: B,
143    pub ty: T,
144}
145
146bitflags::bitflags! {
147    #[cfg_attr(feature = "serde-1", derive(serde::Serialize, serde::Deserialize))]
148    pub struct AspectFlags: u8 {
149        const COLOR = 0x1;
150        const DEPTH = 0x2;
151        const STENCIL = 0x4;
152    }
153}
154
155impl Format {
156    pub fn aspect_flags(&self) -> AspectFlags {
157        let mut flags = AspectFlags::empty();
158
159        if self.is_color() {
160            flags |= AspectFlags::COLOR;
161        }
162
163        if self.is_depth() {
164            flags |= AspectFlags::DEPTH;
165        }
166
167        if self.is_stencil() {
168            flags |= AspectFlags::STENCIL;
169        }
170
171        flags
172    }
173
174    pub fn is_color(&self) -> bool {
175        !matches!(
176            self,
177            Self::D16Unorm
178                | Self::D32Sfloat
179                | Self::S8Uint
180                | Self::D16UnormS8Uint
181                | Self::D24UnormS8Uint
182                | Self::D32SfloatS8Uint
183        )
184    }
185
186    pub fn is_depth(&self) -> bool {
187        matches!(
188            self,
189            Self::D16Unorm
190                | Self::D32Sfloat
191                | Self::D16UnormS8Uint
192                | Self::D24UnormS8Uint
193                | Self::D32SfloatS8Uint
194        )
195    }
196
197    pub fn is_stencil(&self) -> bool {
198        matches!(
199            self,
200            Self::S8Uint | Self::D16UnormS8Uint | Self::D24UnormS8Uint | Self::D32SfloatS8Uint
201        )
202    }
203
204    pub fn description(&self) -> FormatDescription<Channels, u32, Type> {
205        match self {
206            Self::R8Unorm => FormatDescription {
207                channels: Channels::R,
208                ty: Type::Unorm,
209                bits: 8,
210            },
211            Self::R8Snorm => FormatDescription {
212                channels: Channels::R,
213                ty: Type::Snorm,
214                bits: 8,
215            },
216            Self::R8Uscaled => FormatDescription {
217                channels: Channels::R,
218                ty: Type::Uscaled,
219                bits: 8,
220            },
221            Self::R8Sscaled => FormatDescription {
222                channels: Channels::R,
223                ty: Type::Sscaled,
224                bits: 8,
225            },
226            Self::R8Uint => FormatDescription {
227                channels: Channels::R,
228                ty: Type::Uint,
229                bits: 8,
230            },
231            Self::R8Sint => FormatDescription {
232                channels: Channels::R,
233                ty: Type::Sint,
234                bits: 8,
235            },
236            Self::R8Srgb => FormatDescription {
237                channels: Channels::R,
238                ty: Type::Srgb,
239                bits: 8,
240            },
241            Self::RG8Unorm => FormatDescription {
242                channels: Channels::RG,
243                ty: Type::Unorm,
244                bits: 8,
245            },
246            Self::RG8Snorm => FormatDescription {
247                channels: Channels::RG,
248                ty: Type::Snorm,
249                bits: 8,
250            },
251            Self::RG8Uscaled => FormatDescription {
252                channels: Channels::RG,
253                ty: Type::Uscaled,
254                bits: 8,
255            },
256            Self::RG8Sscaled => FormatDescription {
257                channels: Channels::RG,
258                ty: Type::Sscaled,
259                bits: 8,
260            },
261            Self::RG8Uint => FormatDescription {
262                channels: Channels::RG,
263                ty: Type::Uint,
264                bits: 8,
265            },
266            Self::RG8Sint => FormatDescription {
267                channels: Channels::RG,
268                ty: Type::Sint,
269                bits: 8,
270            },
271            Self::RG8Srgb => FormatDescription {
272                channels: Channels::RG,
273                ty: Type::Srgb,
274                bits: 8,
275            },
276            Self::RGB8Unorm => FormatDescription {
277                channels: Channels::RGB,
278                ty: Type::Unorm,
279                bits: 8,
280            },
281            Self::RGB8Snorm => FormatDescription {
282                channels: Channels::RGB,
283                ty: Type::Snorm,
284                bits: 8,
285            },
286            Self::RGB8Uscaled => FormatDescription {
287                channels: Channels::RGB,
288                ty: Type::Uscaled,
289                bits: 8,
290            },
291            Self::RGB8Sscaled => FormatDescription {
292                channels: Channels::RGB,
293                ty: Type::Sscaled,
294                bits: 8,
295            },
296            Self::RGB8Uint => FormatDescription {
297                channels: Channels::RGB,
298                ty: Type::Uint,
299                bits: 8,
300            },
301            Self::RGB8Sint => FormatDescription {
302                channels: Channels::RGB,
303                ty: Type::Sint,
304                bits: 8,
305            },
306            Self::RGB8Srgb => FormatDescription {
307                channels: Channels::RGB,
308                ty: Type::Srgb,
309                bits: 8,
310            },
311            Self::BGR8Unorm => FormatDescription {
312                channels: Channels::BGR,
313                ty: Type::Unorm,
314                bits: 8,
315            },
316            Self::BGR8Snorm => FormatDescription {
317                channels: Channels::BGR,
318                ty: Type::Snorm,
319                bits: 8,
320            },
321            Self::BGR8Uscaled => FormatDescription {
322                channels: Channels::BGR,
323                ty: Type::Uscaled,
324                bits: 8,
325            },
326            Self::BGR8Sscaled => FormatDescription {
327                channels: Channels::BGR,
328                ty: Type::Sscaled,
329                bits: 8,
330            },
331            Self::BGR8Uint => FormatDescription {
332                channels: Channels::BGR,
333                ty: Type::Uint,
334                bits: 8,
335            },
336            Self::BGR8Sint => FormatDescription {
337                channels: Channels::BGR,
338                ty: Type::Sint,
339                bits: 8,
340            },
341            Self::BGR8Srgb => FormatDescription {
342                channels: Channels::BGR,
343                ty: Type::Srgb,
344                bits: 8,
345            },
346            Self::RGBA8Unorm => FormatDescription {
347                channels: Channels::RGBA,
348                ty: Type::Unorm,
349                bits: 8,
350            },
351            Self::RGBA8Snorm => FormatDescription {
352                channels: Channels::RGBA,
353                ty: Type::Snorm,
354                bits: 8,
355            },
356            Self::RGBA8Uscaled => FormatDescription {
357                channels: Channels::RGBA,
358                ty: Type::Uscaled,
359                bits: 8,
360            },
361            Self::RGBA8Sscaled => FormatDescription {
362                channels: Channels::RGBA,
363                ty: Type::Sscaled,
364                bits: 8,
365            },
366            Self::RGBA8Uint => FormatDescription {
367                channels: Channels::RGBA,
368                ty: Type::Uint,
369                bits: 8,
370            },
371            Self::RGBA8Sint => FormatDescription {
372                channels: Channels::RGBA,
373                ty: Type::Sint,
374                bits: 8,
375            },
376            Self::RGBA8Srgb => FormatDescription {
377                channels: Channels::RGBA,
378                ty: Type::Srgb,
379                bits: 8,
380            },
381            Self::BGRA8Unorm => FormatDescription {
382                channels: Channels::BGRA,
383                ty: Type::Unorm,
384                bits: 8,
385            },
386            Self::BGRA8Snorm => FormatDescription {
387                channels: Channels::BGRA,
388                ty: Type::Snorm,
389                bits: 8,
390            },
391            Self::BGRA8Uscaled => FormatDescription {
392                channels: Channels::BGRA,
393                ty: Type::Uscaled,
394                bits: 8,
395            },
396            Self::BGRA8Sscaled => FormatDescription {
397                channels: Channels::BGRA,
398                ty: Type::Sscaled,
399                bits: 8,
400            },
401            Self::BGRA8Uint => FormatDescription {
402                channels: Channels::BGRA,
403                ty: Type::Uint,
404                bits: 8,
405            },
406            Self::BGRA8Sint => FormatDescription {
407                channels: Channels::BGRA,
408                ty: Type::Sint,
409                bits: 8,
410            },
411            Self::BGRA8Srgb => FormatDescription {
412                channels: Channels::BGRA,
413                ty: Type::Srgb,
414                bits: 8,
415            },
416            Self::R16Unorm => FormatDescription {
417                channels: Channels::R,
418                ty: Type::Unorm,
419                bits: 16,
420            },
421            Self::R16Snorm => FormatDescription {
422                channels: Channels::R,
423                ty: Type::Snorm,
424                bits: 16,
425            },
426            Self::R16Uscaled => FormatDescription {
427                channels: Channels::R,
428                ty: Type::Uscaled,
429                bits: 16,
430            },
431            Self::R16Sscaled => FormatDescription {
432                channels: Channels::R,
433                ty: Type::Sscaled,
434                bits: 16,
435            },
436            Self::R16Uint => FormatDescription {
437                channels: Channels::R,
438                ty: Type::Uint,
439                bits: 16,
440            },
441            Self::R16Sint => FormatDescription {
442                channels: Channels::R,
443                ty: Type::Sint,
444                bits: 16,
445            },
446            Self::R16Sfloat => FormatDescription {
447                channels: Channels::R,
448                ty: Type::Sfloat,
449                bits: 16,
450            },
451            Self::RG16Unorm => FormatDescription {
452                channels: Channels::RG,
453                ty: Type::Unorm,
454                bits: 16,
455            },
456            Self::RG16Snorm => FormatDescription {
457                channels: Channels::RG,
458                ty: Type::Snorm,
459                bits: 16,
460            },
461            Self::RG16Uscaled => FormatDescription {
462                channels: Channels::RG,
463                ty: Type::Uscaled,
464                bits: 16,
465            },
466            Self::RG16Sscaled => FormatDescription {
467                channels: Channels::RG,
468                ty: Type::Sscaled,
469                bits: 16,
470            },
471            Self::RG16Uint => FormatDescription {
472                channels: Channels::RG,
473                ty: Type::Uint,
474                bits: 16,
475            },
476            Self::RG16Sint => FormatDescription {
477                channels: Channels::RG,
478                ty: Type::Sint,
479                bits: 16,
480            },
481            Self::RG16Sfloat => FormatDescription {
482                channels: Channels::RG,
483                ty: Type::Sfloat,
484                bits: 16,
485            },
486            Self::RGB16Unorm => FormatDescription {
487                channels: Channels::RGB,
488                ty: Type::Unorm,
489                bits: 16,
490            },
491            Self::RGB16Snorm => FormatDescription {
492                channels: Channels::RGB,
493                ty: Type::Snorm,
494                bits: 16,
495            },
496            Self::RGB16Uscaled => FormatDescription {
497                channels: Channels::RGB,
498                ty: Type::Uscaled,
499                bits: 16,
500            },
501            Self::RGB16Sscaled => FormatDescription {
502                channels: Channels::RGB,
503                ty: Type::Sscaled,
504                bits: 16,
505            },
506            Self::RGB16Uint => FormatDescription {
507                channels: Channels::RGB,
508                ty: Type::Uint,
509                bits: 16,
510            },
511            Self::RGB16Sint => FormatDescription {
512                channels: Channels::RGB,
513                ty: Type::Sint,
514                bits: 16,
515            },
516            Self::RGB16Sfloat => FormatDescription {
517                channels: Channels::RGB,
518                ty: Type::Sfloat,
519                bits: 16,
520            },
521            Self::RGBA16Unorm => FormatDescription {
522                channels: Channels::RGBA,
523                ty: Type::Unorm,
524                bits: 16,
525            },
526            Self::RGBA16Snorm => FormatDescription {
527                channels: Channels::RGBA,
528                ty: Type::Snorm,
529                bits: 16,
530            },
531            Self::RGBA16Uscaled => FormatDescription {
532                channels: Channels::RGBA,
533                ty: Type::Uscaled,
534                bits: 16,
535            },
536            Self::RGBA16Sscaled => FormatDescription {
537                channels: Channels::RGBA,
538                ty: Type::Sscaled,
539                bits: 16,
540            },
541            Self::RGBA16Uint => FormatDescription {
542                channels: Channels::RGBA,
543                ty: Type::Uint,
544                bits: 16,
545            },
546            Self::RGBA16Sint => FormatDescription {
547                channels: Channels::RGBA,
548                ty: Type::Sint,
549                bits: 16,
550            },
551            Self::RGBA16Sfloat => FormatDescription {
552                channels: Channels::RGBA,
553                ty: Type::Sfloat,
554                bits: 16,
555            },
556            Self::R32Uint => FormatDescription {
557                channels: Channels::R,
558                ty: Type::Uint,
559                bits: 32,
560            },
561            Self::R32Sint => FormatDescription {
562                channels: Channels::R,
563                ty: Type::Sint,
564                bits: 32,
565            },
566            Self::R32Sfloat => FormatDescription {
567                channels: Channels::R,
568                ty: Type::Sfloat,
569                bits: 32,
570            },
571            Self::RG32Uint => FormatDescription {
572                channels: Channels::RG,
573                ty: Type::Uint,
574                bits: 32,
575            },
576            Self::RG32Sint => FormatDescription {
577                channels: Channels::RG,
578                ty: Type::Sint,
579                bits: 32,
580            },
581            Self::RG32Sfloat => FormatDescription {
582                channels: Channels::RG,
583                ty: Type::Sfloat,
584                bits: 32,
585            },
586            Self::RGB32Uint => FormatDescription {
587                channels: Channels::RGB,
588                ty: Type::Uint,
589                bits: 32,
590            },
591            Self::RGB32Sint => FormatDescription {
592                channels: Channels::RGB,
593                ty: Type::Sint,
594                bits: 32,
595            },
596            Self::RGB32Sfloat => FormatDescription {
597                channels: Channels::RGB,
598                ty: Type::Sfloat,
599                bits: 32,
600            },
601            Self::RGBA32Uint => FormatDescription {
602                channels: Channels::RGBA,
603                ty: Type::Uint,
604                bits: 32,
605            },
606            Self::RGBA32Sint => FormatDescription {
607                channels: Channels::RGBA,
608                ty: Type::Sint,
609                bits: 32,
610            },
611            Self::RGBA32Sfloat => FormatDescription {
612                channels: Channels::RGBA,
613                ty: Type::Sfloat,
614                bits: 32,
615            },
616            Self::R64Uint => FormatDescription {
617                channels: Channels::R,
618                ty: Type::Uint,
619                bits: 64,
620            },
621            Self::R64Sint => FormatDescription {
622                channels: Channels::R,
623                ty: Type::Sint,
624                bits: 64,
625            },
626            Self::R64Sfloat => FormatDescription {
627                channels: Channels::R,
628                ty: Type::Sfloat,
629                bits: 64,
630            },
631            Self::RG64Uint => FormatDescription {
632                channels: Channels::RG,
633                ty: Type::Uint,
634                bits: 64,
635            },
636            Self::RG64Sint => FormatDescription {
637                channels: Channels::RG,
638                ty: Type::Sint,
639                bits: 64,
640            },
641            Self::RG64Sfloat => FormatDescription {
642                channels: Channels::RG,
643                ty: Type::Sfloat,
644                bits: 64,
645            },
646            Self::RGB64Uint => FormatDescription {
647                channels: Channels::RGB,
648                ty: Type::Uint,
649                bits: 64,
650            },
651            Self::RGB64Sint => FormatDescription {
652                channels: Channels::RGB,
653                ty: Type::Sint,
654                bits: 64,
655            },
656            Self::RGB64Sfloat => FormatDescription {
657                channels: Channels::RGB,
658                ty: Type::Sfloat,
659                bits: 64,
660            },
661            Self::RGBA64Uint => FormatDescription {
662                channels: Channels::RGBA,
663                ty: Type::Uint,
664                bits: 64,
665            },
666            Self::RGBA64Sint => FormatDescription {
667                channels: Channels::RGBA,
668                ty: Type::Sint,
669                bits: 64,
670            },
671            Self::RGBA64Sfloat => FormatDescription {
672                channels: Channels::RGBA,
673                ty: Type::Sfloat,
674                bits: 64,
675            },
676            Self::D16Unorm => FormatDescription {
677                channels: Channels::D,
678                ty: Type::Unorm,
679                bits: 16,
680            },
681            Self::D32Sfloat => FormatDescription {
682                channels: Channels::D,
683                ty: Type::Sfloat,
684                bits: 32,
685            },
686            Self::S8Uint => FormatDescription {
687                channels: Channels::S,
688                ty: Type::Uint,
689                bits: 8,
690            },
691            Self::D16UnormS8Uint => FormatDescription {
692                channels: Channels::DS,
693                ty: Type::Unorm,
694                bits: 16,
695            },
696            Self::D24UnormS8Uint => FormatDescription {
697                channels: Channels::DS,
698                bits: 24,
699                ty: Type::Unorm,
700            },
701            Self::D32SfloatS8Uint => FormatDescription {
702                channels: Channels::DS,
703                bits: 32,
704                ty: Type::Sfloat,
705            },
706        }
707    }
708}
709
710#[derive(Clone, Copy, Debug)]
711pub enum R {}
712
713#[derive(Clone, Copy, Debug)]
714pub enum RG {}
715
716#[derive(Clone, Copy, Debug)]
717pub enum RGB {}
718
719#[derive(Clone, Copy, Debug)]
720pub enum BGR {}
721
722#[derive(Clone, Copy, Debug)]
723pub enum RGBA {}
724
725#[derive(Clone, Copy, Debug)]
726pub enum BGRA {}
727
728#[derive(Clone, Copy, Debug)]
729pub enum D {}
730
731#[derive(Clone, Copy, Debug)]
732pub enum S {}
733
734#[derive(Clone, Copy, Debug)]
735pub enum DS {}
736
737#[derive(Clone, Copy, Debug)]
738pub enum Uint {}
739
740#[derive(Clone, Copy, Debug)]
741pub enum Sint {}
742
743#[derive(Clone, Copy, Debug)]
744pub enum Srgb {}
745
746#[derive(Clone, Copy, Debug)]
747pub enum Unorm {}
748
749#[derive(Clone, Copy, Debug)]
750pub enum Snorm {}
751
752#[derive(Clone, Copy, Debug)]
753pub enum Uscaled {}
754
755#[derive(Clone, Copy, Debug)]
756pub enum Sscaled {}
757
758#[derive(Clone, Copy, Debug)]
759pub enum Sfloat {}
760
761#[derive(Clone, Copy, Debug)]
762pub enum ConstBits<const BITS: u32> {}
763
764pub trait StaticFormat {
765    const FORMAT: Format;
766}
767
768impl StaticFormat for FormatDescription<R, ConstBits<8>, Unorm> {
769    const FORMAT: Format = Format::R8Unorm;
770}
771impl StaticFormat for FormatDescription<R, ConstBits<8>, Snorm> {
772    const FORMAT: Format = Format::R8Snorm;
773}
774impl StaticFormat for FormatDescription<R, ConstBits<8>, Uscaled> {
775    const FORMAT: Format = Format::R8Uscaled;
776}
777impl StaticFormat for FormatDescription<R, ConstBits<8>, Sscaled> {
778    const FORMAT: Format = Format::R8Sscaled;
779}
780impl StaticFormat for FormatDescription<R, ConstBits<8>, Uint> {
781    const FORMAT: Format = Format::R8Uint;
782}
783impl StaticFormat for FormatDescription<R, ConstBits<8>, Sint> {
784    const FORMAT: Format = Format::R8Sint;
785}
786impl StaticFormat for FormatDescription<R, ConstBits<8>, Srgb> {
787    const FORMAT: Format = Format::R8Srgb;
788}
789impl StaticFormat for FormatDescription<RG, ConstBits<8>, Unorm> {
790    const FORMAT: Format = Format::RG8Unorm;
791}
792impl StaticFormat for FormatDescription<RG, ConstBits<8>, Snorm> {
793    const FORMAT: Format = Format::RG8Snorm;
794}
795impl StaticFormat for FormatDescription<RG, ConstBits<8>, Uscaled> {
796    const FORMAT: Format = Format::RG8Uscaled;
797}
798impl StaticFormat for FormatDescription<RG, ConstBits<8>, Sscaled> {
799    const FORMAT: Format = Format::RG8Sscaled;
800}
801impl StaticFormat for FormatDescription<RG, ConstBits<8>, Uint> {
802    const FORMAT: Format = Format::RG8Uint;
803}
804impl StaticFormat for FormatDescription<RG, ConstBits<8>, Sint> {
805    const FORMAT: Format = Format::RG8Sint;
806}
807impl StaticFormat for FormatDescription<RG, ConstBits<8>, Srgb> {
808    const FORMAT: Format = Format::RG8Srgb;
809}
810impl StaticFormat for FormatDescription<RGB, ConstBits<8>, Unorm> {
811    const FORMAT: Format = Format::RGB8Unorm;
812}
813impl StaticFormat for FormatDescription<RGB, ConstBits<8>, Snorm> {
814    const FORMAT: Format = Format::RGB8Snorm;
815}
816impl StaticFormat for FormatDescription<RGB, ConstBits<8>, Uscaled> {
817    const FORMAT: Format = Format::RGB8Uscaled;
818}
819impl StaticFormat for FormatDescription<RGB, ConstBits<8>, Sscaled> {
820    const FORMAT: Format = Format::RGB8Sscaled;
821}
822impl StaticFormat for FormatDescription<RGB, ConstBits<8>, Uint> {
823    const FORMAT: Format = Format::RGB8Uint;
824}
825impl StaticFormat for FormatDescription<RGB, ConstBits<8>, Sint> {
826    const FORMAT: Format = Format::RGB8Sint;
827}
828impl StaticFormat for FormatDescription<RGB, ConstBits<8>, Srgb> {
829    const FORMAT: Format = Format::RGB8Srgb;
830}
831impl StaticFormat for FormatDescription<BGR, ConstBits<8>, Unorm> {
832    const FORMAT: Format = Format::BGR8Unorm;
833}
834impl StaticFormat for FormatDescription<BGR, ConstBits<8>, Snorm> {
835    const FORMAT: Format = Format::BGR8Snorm;
836}
837impl StaticFormat for FormatDescription<BGR, ConstBits<8>, Uscaled> {
838    const FORMAT: Format = Format::BGR8Uscaled;
839}
840impl StaticFormat for FormatDescription<BGR, ConstBits<8>, Sscaled> {
841    const FORMAT: Format = Format::BGR8Sscaled;
842}
843impl StaticFormat for FormatDescription<BGR, ConstBits<8>, Uint> {
844    const FORMAT: Format = Format::BGR8Uint;
845}
846impl StaticFormat for FormatDescription<BGR, ConstBits<8>, Sint> {
847    const FORMAT: Format = Format::BGR8Sint;
848}
849impl StaticFormat for FormatDescription<BGR, ConstBits<8>, Srgb> {
850    const FORMAT: Format = Format::BGR8Srgb;
851}
852impl StaticFormat for FormatDescription<RGBA, ConstBits<8>, Unorm> {
853    const FORMAT: Format = Format::RGBA8Unorm;
854}
855impl StaticFormat for FormatDescription<RGBA, ConstBits<8>, Snorm> {
856    const FORMAT: Format = Format::RGBA8Snorm;
857}
858impl StaticFormat for FormatDescription<RGBA, ConstBits<8>, Uscaled> {
859    const FORMAT: Format = Format::RGBA8Uscaled;
860}
861impl StaticFormat for FormatDescription<RGBA, ConstBits<8>, Sscaled> {
862    const FORMAT: Format = Format::RGBA8Sscaled;
863}
864impl StaticFormat for FormatDescription<RGBA, ConstBits<8>, Uint> {
865    const FORMAT: Format = Format::RGBA8Uint;
866}
867impl StaticFormat for FormatDescription<RGBA, ConstBits<8>, Sint> {
868    const FORMAT: Format = Format::RGBA8Sint;
869}
870impl StaticFormat for FormatDescription<RGBA, ConstBits<8>, Srgb> {
871    const FORMAT: Format = Format::RGBA8Srgb;
872}
873impl StaticFormat for FormatDescription<BGRA, ConstBits<8>, Unorm> {
874    const FORMAT: Format = Format::BGRA8Unorm;
875}
876impl StaticFormat for FormatDescription<BGRA, ConstBits<8>, Snorm> {
877    const FORMAT: Format = Format::BGRA8Snorm;
878}
879impl StaticFormat for FormatDescription<BGRA, ConstBits<8>, Uscaled> {
880    const FORMAT: Format = Format::BGRA8Uscaled;
881}
882impl StaticFormat for FormatDescription<BGRA, ConstBits<8>, Sscaled> {
883    const FORMAT: Format = Format::BGRA8Sscaled;
884}
885impl StaticFormat for FormatDescription<BGRA, ConstBits<8>, Uint> {
886    const FORMAT: Format = Format::BGRA8Uint;
887}
888impl StaticFormat for FormatDescription<BGRA, ConstBits<8>, Sint> {
889    const FORMAT: Format = Format::BGRA8Sint;
890}
891impl StaticFormat for FormatDescription<BGRA, ConstBits<8>, Srgb> {
892    const FORMAT: Format = Format::BGRA8Srgb;
893}
894impl StaticFormat for FormatDescription<R, ConstBits<16>, Unorm> {
895    const FORMAT: Format = Format::R16Unorm;
896}
897impl StaticFormat for FormatDescription<R, ConstBits<16>, Snorm> {
898    const FORMAT: Format = Format::R16Snorm;
899}
900impl StaticFormat for FormatDescription<R, ConstBits<16>, Uscaled> {
901    const FORMAT: Format = Format::R16Uscaled;
902}
903impl StaticFormat for FormatDescription<R, ConstBits<16>, Sscaled> {
904    const FORMAT: Format = Format::R16Sscaled;
905}
906impl StaticFormat for FormatDescription<R, ConstBits<16>, Uint> {
907    const FORMAT: Format = Format::R16Uint;
908}
909impl StaticFormat for FormatDescription<R, ConstBits<16>, Sint> {
910    const FORMAT: Format = Format::R16Sint;
911}
912impl StaticFormat for FormatDescription<R, ConstBits<16>, Sfloat> {
913    const FORMAT: Format = Format::R16Sfloat;
914}
915impl StaticFormat for FormatDescription<RG, ConstBits<16>, Unorm> {
916    const FORMAT: Format = Format::RG16Unorm;
917}
918impl StaticFormat for FormatDescription<RG, ConstBits<16>, Snorm> {
919    const FORMAT: Format = Format::RG16Snorm;
920}
921impl StaticFormat for FormatDescription<RG, ConstBits<16>, Uscaled> {
922    const FORMAT: Format = Format::RG16Uscaled;
923}
924impl StaticFormat for FormatDescription<RG, ConstBits<16>, Sscaled> {
925    const FORMAT: Format = Format::RG16Sscaled;
926}
927impl StaticFormat for FormatDescription<RG, ConstBits<16>, Uint> {
928    const FORMAT: Format = Format::RG16Uint;
929}
930impl StaticFormat for FormatDescription<RG, ConstBits<16>, Sint> {
931    const FORMAT: Format = Format::RG16Sint;
932}
933impl StaticFormat for FormatDescription<RG, ConstBits<16>, Sfloat> {
934    const FORMAT: Format = Format::RG16Sfloat;
935}
936impl StaticFormat for FormatDescription<RGB, ConstBits<16>, Unorm> {
937    const FORMAT: Format = Format::RGB16Unorm;
938}
939impl StaticFormat for FormatDescription<RGB, ConstBits<16>, Snorm> {
940    const FORMAT: Format = Format::RGB16Snorm;
941}
942impl StaticFormat for FormatDescription<RGB, ConstBits<16>, Uscaled> {
943    const FORMAT: Format = Format::RGB16Uscaled;
944}
945impl StaticFormat for FormatDescription<RGB, ConstBits<16>, Sscaled> {
946    const FORMAT: Format = Format::RGB16Sscaled;
947}
948impl StaticFormat for FormatDescription<RGB, ConstBits<16>, Uint> {
949    const FORMAT: Format = Format::RGB16Uint;
950}
951impl StaticFormat for FormatDescription<RGB, ConstBits<16>, Sint> {
952    const FORMAT: Format = Format::RGB16Sint;
953}
954impl StaticFormat for FormatDescription<RGB, ConstBits<16>, Sfloat> {
955    const FORMAT: Format = Format::RGB16Sfloat;
956}
957impl StaticFormat for FormatDescription<RGBA, ConstBits<16>, Unorm> {
958    const FORMAT: Format = Format::RGBA16Unorm;
959}
960impl StaticFormat for FormatDescription<RGBA, ConstBits<16>, Snorm> {
961    const FORMAT: Format = Format::RGBA16Snorm;
962}
963impl StaticFormat for FormatDescription<RGBA, ConstBits<16>, Uscaled> {
964    const FORMAT: Format = Format::RGBA16Uscaled;
965}
966impl StaticFormat for FormatDescription<RGBA, ConstBits<16>, Sscaled> {
967    const FORMAT: Format = Format::RGBA16Sscaled;
968}
969impl StaticFormat for FormatDescription<RGBA, ConstBits<16>, Uint> {
970    const FORMAT: Format = Format::RGBA16Uint;
971}
972impl StaticFormat for FormatDescription<RGBA, ConstBits<16>, Sint> {
973    const FORMAT: Format = Format::RGBA16Sint;
974}
975impl StaticFormat for FormatDescription<RGBA, ConstBits<16>, Sfloat> {
976    const FORMAT: Format = Format::RGBA16Sfloat;
977}
978impl StaticFormat for FormatDescription<R, ConstBits<32>, Uint> {
979    const FORMAT: Format = Format::R32Uint;
980}
981impl StaticFormat for FormatDescription<R, ConstBits<32>, Sint> {
982    const FORMAT: Format = Format::R32Sint;
983}
984impl StaticFormat for FormatDescription<R, ConstBits<32>, Sfloat> {
985    const FORMAT: Format = Format::R32Sfloat;
986}
987impl StaticFormat for FormatDescription<RG, ConstBits<32>, Uint> {
988    const FORMAT: Format = Format::RG32Uint;
989}
990impl StaticFormat for FormatDescription<RG, ConstBits<32>, Sint> {
991    const FORMAT: Format = Format::RG32Sint;
992}
993impl StaticFormat for FormatDescription<RG, ConstBits<32>, Sfloat> {
994    const FORMAT: Format = Format::RG32Sfloat;
995}
996impl StaticFormat for FormatDescription<RGB, ConstBits<32>, Uint> {
997    const FORMAT: Format = Format::RGB32Uint;
998}
999impl StaticFormat for FormatDescription<RGB, ConstBits<32>, Sint> {
1000    const FORMAT: Format = Format::RGB32Sint;
1001}
1002impl StaticFormat for FormatDescription<RGB, ConstBits<32>, Sfloat> {
1003    const FORMAT: Format = Format::RGB32Sfloat;
1004}
1005impl StaticFormat for FormatDescription<RGBA, ConstBits<32>, Uint> {
1006    const FORMAT: Format = Format::RGBA32Uint;
1007}
1008impl StaticFormat for FormatDescription<RGBA, ConstBits<32>, Sint> {
1009    const FORMAT: Format = Format::RGBA32Sint;
1010}
1011impl StaticFormat for FormatDescription<RGBA, ConstBits<32>, Sfloat> {
1012    const FORMAT: Format = Format::RGBA32Sfloat;
1013}
1014impl StaticFormat for FormatDescription<R, ConstBits<64>, Uint> {
1015    const FORMAT: Format = Format::R64Uint;
1016}
1017impl StaticFormat for FormatDescription<R, ConstBits<64>, Sint> {
1018    const FORMAT: Format = Format::R64Sint;
1019}
1020impl StaticFormat for FormatDescription<R, ConstBits<64>, Sfloat> {
1021    const FORMAT: Format = Format::R64Sfloat;
1022}
1023impl StaticFormat for FormatDescription<RG, ConstBits<64>, Uint> {
1024    const FORMAT: Format = Format::RG64Uint;
1025}
1026impl StaticFormat for FormatDescription<RG, ConstBits<64>, Sint> {
1027    const FORMAT: Format = Format::RG64Sint;
1028}
1029impl StaticFormat for FormatDescription<RG, ConstBits<64>, Sfloat> {
1030    const FORMAT: Format = Format::RG64Sfloat;
1031}
1032impl StaticFormat for FormatDescription<RGB, ConstBits<64>, Uint> {
1033    const FORMAT: Format = Format::RGB64Uint;
1034}
1035impl StaticFormat for FormatDescription<RGB, ConstBits<64>, Sint> {
1036    const FORMAT: Format = Format::RGB64Sint;
1037}
1038impl StaticFormat for FormatDescription<RGB, ConstBits<64>, Sfloat> {
1039    const FORMAT: Format = Format::RGB64Sfloat;
1040}
1041impl StaticFormat for FormatDescription<RGBA, ConstBits<64>, Uint> {
1042    const FORMAT: Format = Format::RGBA64Uint;
1043}
1044impl StaticFormat for FormatDescription<RGBA, ConstBits<64>, Sint> {
1045    const FORMAT: Format = Format::RGBA64Sint;
1046}
1047impl StaticFormat for FormatDescription<RGBA, ConstBits<64>, Sfloat> {
1048    const FORMAT: Format = Format::RGBA64Sfloat;
1049}
1050impl StaticFormat for FormatDescription<D, ConstBits<16>, Unorm> {
1051    const FORMAT: Format = Format::D16Unorm;
1052}
1053impl StaticFormat for FormatDescription<D, ConstBits<32>, Sfloat> {
1054    const FORMAT: Format = Format::D32Sfloat;
1055}
1056impl StaticFormat for FormatDescription<S, ConstBits<8>, Uint> {
1057    const FORMAT: Format = Format::S8Uint;
1058}
1059impl StaticFormat for FormatDescription<DS, ConstBits<16>, Unorm> {
1060    const FORMAT: Format = Format::D16UnormS8Uint;
1061}
1062impl StaticFormat for FormatDescription<DS, ConstBits<24>, Unorm> {
1063    const FORMAT: Format = Format::D24UnormS8Uint;
1064}
1065impl StaticFormat for FormatDescription<DS, ConstBits<32>, Sfloat> {
1066    const FORMAT: Format = Format::D32SfloatS8Uint;
1067}