@@ -45,6 +45,50 @@ impl BasicDataFormatDescriptor {
4545 samples,
4646 }
4747 }
48+ VkFormat :: R16G16B16A16_SFLOAT => {
49+ let samples = vec ! [
50+ // R
51+ DFDSampleType {
52+ row_0: 15 << 16 ,
53+ row_1: 0u32 ,
54+ row_2: 0xBF800000u32 , // IEEE 754 floating-point representation for -1.0f
55+ row_3: 0x3F800000u32 , // IEEE 754 floating-point representation for 1.0f
56+ } ,
57+ // G
58+ DFDSampleType {
59+ row_0: 16 | 15 << 16 | 0b0000_0001 << 24 ,
60+ row_1: 0u32 ,
61+ row_2: 0xBF800000u32 , // IEEE 754 floating-point representation for -1.0f
62+ row_3: 0x3F800000u32 , // IEEE 754 floating-point representation for 1.0f
63+ } ,
64+ // B
65+ DFDSampleType {
66+ row_0: 32 | 15 << 16 | 0b0000_0010 << 24 ,
67+ row_1: 0u32 ,
68+ row_2: 0xBF800000u32 , // IEEE 754 floating-point representation for -1.0f
69+ row_3: 0x3F800000u32 , // IEEE 754 floating-point representation for 1.0f
70+ } ,
71+ // A
72+ DFDSampleType {
73+ row_0: 48 | 15 << 16 | 0b0000_1111 << 24 ,
74+ row_1: 0u32 ,
75+ row_2: 0xBF800000u32 , // IEEE 754 floating-point representation for -1.0f
76+ row_3: 0x3F800000u32 , // IEEE 754 floating-point representation for 1.0f
77+ } ,
78+ ] ;
79+ let descriptor_block_size =
80+ ( 24 + std:: mem:: size_of :: < DFDSampleType > ( ) * samples. len ( ) ) as u32 ;
81+ BasicDataFormatDescriptor {
82+ dfd_total_size : descriptor_block_size + 4 ,
83+ row_0 : 0u32 ,
84+ row_1 : 2 | descriptor_block_size << 16 ,
85+ row_2 : 1 << 0 | 1 << 8 | 1 << 16 ,
86+ row_3 : 0u32 ,
87+ row_4 : get_format_pixel_size_bytes ( vk_format) as u32 ,
88+ row_5 : 0u32 ,
89+ samples,
90+ }
91+ }
4892 VkFormat :: R8G8B8A8_UNORM => {
4993 let samples = vec ! [
5094 // R
0 commit comments