@@ -13,25 +13,31 @@ module VX_tex_format #(
13
13
14
14
always @ (* ) begin
15
15
case (format)
16
- `TEX_FORMAT_R8G8B8A8 : begin
16
+ `TEX_FORMAT_A8R8G8B8 : begin
17
17
texel_out_r[07 : 00 ] = texel_in[7 : 0 ];
18
18
texel_out_r[15 : 08 ] = texel_in[15 : 8 ];
19
19
texel_out_r[23 : 16 ] = texel_in[23 : 16 ];
20
20
texel_out_r[31 : 24 ] = texel_in[31 : 24 ];
21
21
end
22
22
`TEX_FORMAT_R5G6B5 : begin
23
- texel_out_r[07 : 00 ] = { texel_in[15 : 11 ], texel_in[15 : 13 ]} ;
23
+ texel_out_r[07 : 00 ] = { texel_in[4 : 0 ], texel_in[4 : 2 ]} ;
24
24
texel_out_r[15 : 08 ] = { texel_in[10 : 5 ], texel_in[10 : 9 ]} ;
25
- texel_out_r[23 : 16 ] = { texel_in[4 : 0 ], texel_in[4 : 2 ]} ;
25
+ texel_out_r[23 : 16 ] = { texel_in[15 : 11 ], texel_in[15 : 13 ]} ;
26
26
texel_out_r[31 : 24 ] = 8'hff ;
27
27
end
28
- `TEX_FORMAT_R4G4B4A4 : begin
29
- texel_out_r[07 : 00 ] = { texel_in[11 : 8 ], texel_in[15 : 12 ]} ;
28
+ `TEX_FORMAT_A1R5G5B5 : begin
29
+ texel_out_r[07 : 00 ] = { texel_in[4 : 0 ], texel_in[4 : 2 ]} ;
30
+ texel_out_r[15 : 08 ] = { texel_in[9 : 5 ], texel_in[9 : 7 ]} ;
31
+ texel_out_r[23 : 16 ] = { texel_in[14 : 10 ], texel_in[14 : 12 ]} ;
32
+ texel_out_r[31 : 24 ] = { 8 { texel_in[15 ]}} ;
33
+ end
34
+ `TEX_FORMAT_A4R4G4B4 : begin
35
+ texel_out_r[07 : 00 ] = { 2 { texel_in[3 : 0 ]}} ;
30
36
texel_out_r[15 : 08 ] = { 2 { texel_in[7 : 4 ]}} ;
31
- texel_out_r[23 : 16 ] = { 2 { texel_in[3 : 0 ]}} ;
37
+ texel_out_r[23 : 16 ] = { 2 { texel_in[11 : 8 ]}} ;
32
38
texel_out_r[31 : 24 ] = { 2 { texel_in[15 : 12 ]}} ;
33
39
end
34
- `TEX_FORMAT_L8A8 : begin
40
+ `TEX_FORMAT_A8L8 : begin
35
41
texel_out_r[07 : 00 ] = texel_in[7 : 0 ];
36
42
texel_out_r[15 : 08 ] = texel_in[7 : 0 ];
37
43
texel_out_r[23 : 16 ] = texel_in[7 : 0 ];
@@ -45,9 +51,9 @@ module VX_tex_format #(
45
51
end
46
52
// `TEX_FORMAT_A8
47
53
default : begin
48
- texel_out_r[07 : 00 ] = 0 ;
49
- texel_out_r[15 : 08 ] = 0 ;
50
- texel_out_r[23 : 16 ] = 0 ;
54
+ texel_out_r[07 : 00 ] = 8'hff ;
55
+ texel_out_r[15 : 08 ] = 8'hff ;
56
+ texel_out_r[23 : 16 ] = 8'hff ;
51
57
texel_out_r[31 : 24 ] = texel_in[7 : 0 ];
52
58
end
53
59
endcase
0 commit comments