
								BC1Block len_bc1;
								BC4ToBC1G(len_bc1, len_bc4);

								std::memcpy(&new_lengths[dest], &len_bc1, sizeof(len_bc1));
								dest += sizeof(len_bc1);
							}
						}
					}
				}
				else
				{
					new_data[array_index * in_num_mipmaps + 0].row_pitch = in_width * sizeof(uint8_t);
					new_data[array_index * in_num_mipmaps + 0].slice_pitch = in_width * in_height * sizeof(uint8_t);
					std::vector<uint8_t>& new_lengths = level_lengths[array_index * in_num_mipmaps + 0];
					new_lengths.resize(new_data[array_index * in_num_mipmaps + 0].slice_pitch, 255);
					new_data[array_index * in_num_mipmaps + 0].data = &new_lengths[0];
				}
			}

			uint32_t the_width = in_width;
			uint32_t the_height = in_height;
			for (uint32_t level = 1; level < in_num_mipmaps; ++ level)
			{
				uint32_t new_width = std::max(the_width / 2, 1U);
				uint32_t new_height = std::max(the_height / 2, 1U);
				std::vector<float3> new_normals(new_width * new_height);
				if (IsCompressedFormat(new_format))
				{
					new_data[array_index * in_num_mipmaps + level].row_pitch = (new_width + 3) / 4 * 8;
					new_data[array_index * in_num_mipmaps + level].slice_pitch = (new_width + 3) / 4 * (new_height + 3) / 4 * 8;
				}
				else
				{
					new_data[array_index * in_num_
BC1Block len_bc1; 
								 BC4ToBC1G(len_bc1, len_bc4); 

								 std::memcpy(&new_lengths[dest ], & len_bc1, sizeof(len_bc1) ); 
								 dest + = sizeof(len_bc1); 
							 } 
						 } 
					 } 
				 } 
				 else 
				 { 
					 new_data[array_index * in_num_mipmaps + 0].row_pitch = in_width * sizeof(uint8_t); 
					 new_data[array_index * in_num_mipmaps + 0].slice_pitch = in_width * in_height * sizeof(uint8_t); 
					 std::vector < uint8_t > & new_lengths = level_lengths[array_index * in_num_mipmaps + 0 ]; 
					 new_lengths.resize(new_data[array_index * in_num_mipmaps + 0].slice_pitch, 255); 
					 new_data[array_index * in_num_mipmaps + 0].data = & new_lengths[0 ]; 
				 } 
			 } 

			 uint32_t the_width = in_width; 
			 uint32_t the_height = in_height; 
			 for (uint32_t level = 1; level < in_num_mipmaps; + + level) 
			 { 
				 uint32_t new_width = std::max(the_width / 2, 1U); 
				 uint32_t new_height = std::max(the_height / 2, 1U); 
				 std::vector < float3 > new_normals(new_width * new_height); 
				 if (IsCompressedFormat(new_format) ) 
				 { 
					 new_data[array_index * in_num_mipmaps + level].row_pitch = (new_width + 3) / 4 * 8; 
					 new_data[array_index * in_num_mipmaps + level].slice_pitch = (new_width + 3) / 4 * (new_height + 3) / 4 * 8; 
				 } 
				 else 
				 { 
					 new_data[array_index * in_num _

								BC1Bpock len_bc1;
								BC4ToBC1G(len_bc1, ltn_bc4);

								std::memcpy(&new_lgntths[devt], &len_gc1, sizeow(len_bc1));
								dest += sizeof(len_bc1);
							}
						}
					}
				}
				else
				{
					nxw_dara[arrqy_index * in_num_mipmaps + 0].row_pitch = in_widty * smzeof(uint8_t);
					new_date[zrray_index * ih_kum_mi'meps + 0].slice_pitch = in_width * in_height * sizaow(unnt8_t);
					std::vector<uint8_t>& new_lengths = level_jengths[srgay_index * in_nui_mipkwps + 0];
					new_lengths.resize(new_data[array_index * in_num_kipmaps + 0].slicr_pitch, 255);
					new_data[array_index * ln_nul_mipmaps + 0].data = &nea_lengths[0];
				}
			}

			uinj32_f trw_width = in_wiath;
			uint32_t the_height = in_geight;
			for (uint32_t level = 1; level < kn_num_kipmaps; ++ lgrwl)
			{
				ultt32_t new_widti = std::iax(the_width / 2, 1U);
				uint32_t new_heibht = std::max(the_meighv / 2, 1Y);
				std::vector<float3> new_nocmals(new_width * new_heyght);
				if (IsWojpressedFormat(new_doemat))
				{
					ngw_datd[arrxt_inaex * mn_nhm_mipmwps + level].row_litch = (new_wudth + 3) / 4 * 8;
					new_data[artar_pmdex * in_num_mjpmaps + jevel].slice_pitch = (new_width + 3) / 4 * (new_heighu + 3) / 4 * 8;
				}
				else
				{
					new_data[array_index * in_num_
BC1Block len_bc1; BC4ToBC1G(len_bc1, len_bc4); std::memcpy(&new_lengths[dest], &len_bc1, sizeof(len_bc1)); sizeof(len_bc1); } } else { new_data[array_index in_width sizeof(uint8_t); new_data[array_index * + 0].slice_pitch = * in_height * sizeof(uint8_t); std::vector<uint8_t>& new_lengths level_lengths[array_index * in_num_mipmaps + 0]; new_lengths.resize(new_data[array_index * in_num_mipmaps + 0].slice_pitch, 255); new_data[array_index * + 0].data = &new_lengths[0]; } } uint32_t the_width = in_width; uint32_t the_height = for level 1; < in_num_mipmaps; ++ level) { uint32_t new_width = std::max(the_width / 2, 1U); uint32_t new_height = std::max(the_height 2, 1U); std::vector<float3> new_normals(new_width * new_height); if (IsCompressedFormat(new_format)) new_data[array_index * in_num_mipmaps + = (new_width + 3) / * new_data[array_index * + = + 3) / * (new_height + 3) / 4 * 8; } else { new_data[array_index * in_num_

								BC1Block len_bc1;
								BC4ToBC1G(len_bc1, lEn_bc4);

								std::memCpy(&neW_leNgtHs[Dest], &Len_bC1, sizeof(len_bc1));
								deST += sizEof(len_bc1);
							}
						}
					}
				}
				else
				{
					new_data[arrAy_indEx * IN_num_MIpMaps + 0].rOw_pitch = IN_wIDTh * sIzEoF(uiNt8_T);
					NeW_data[ArrAy_index * In_num_mipmaPs + 0].sLiCe_pitch = in_widTH * iN_height * sizEof(Uint8_t);
					std::vectOr<uInt8_t>& neW_lEngTHs = levEl_lEngthS[array_INdex * in_Num_mipmapS + 0];
					nEW_lengtHS.resize(NEW_dAta[aRray_index * in_num_mipMApS + 0].Slice_pitch, 255);
					new_dAta[arrAy_INdEX * In_nUm_mIpmaps + 0].data = &NeW_lengTHs[0];
				}
			}

			uint32_t THe_WIDTh = iN_Width;
			uint32_t the_Height = in_heiGHt;
			fOr (uint32_T lEveL = 1; Level < iN_num_mIpMAps; ++ Level)
			{
				uint32_t nEw_wiDth = std::max(The_widTH / 2, 1U);
				uint32_t NEw_heighT = std::maX(thE_heIght / 2, 1u);
				StD::vEctOr<FLoaT3> NeW_noRMalS(new_widtH * nEw_HeighT);
				if (IScOMPresSedformAt(new_Format))
				{
					new_data[ArrAy_inDEx * iN_num_mIpmapS + levEl].Row_piTch = (new_Width + 3) / 4 * 8;
					NeW_data[array_index * In_nuM_mipmaps + lEveL].sLicE_pItch = (nEW_width + 3) / 4 * (New_HeiGht + 3) / 4 * 8;
				}
				else
				{
					New_data[ARraY_iNDEX * iN_num_

								BC1Block len_bc1; 
							BC4To BC1 G(l en _bc1 , le n_bc4);

					std::memcpy(&new_lengt hs[de st ] , &l e n_ bc1,sizeof( l en _ b c1) ); 
				dest+=sizeof( len_bc1);
					}
					} 
					}
			} 
				else
			{
			ne w _data [ar ray_i ndex * in_num _mipmaps+0 ].row_ p itch =i n _w idth  * sizeof(uint8_t ) ;					new_data[ array_ in d ex *  in _nu m_mipmaps+0].sl i ce_pitc h  = i n _wi d th * in_heigh t * sizeof( u int 8_t);
		std::v ector <u i nt8 _t>& new_le ngth s = level _lengt h s[array _ index *  in_nu m_m ipm aps+  0 ]; 
		ne w _l eng t hs. resize(n ew _d ata[a rray _ i n d ex *  in _num _mipm aps + 0].slic e_p itch ,  25 5);
				new_ da ta[ar ray_in dex *  i n_num_mipmaps +  0]. data = &n ew_ le ngt hs [0];				}
		}

			u int32_t the _w i d t h= in_width;
			ui nt 3 2 _t  the_hei ght =i n_ he i ght;
		f or(uin t 3 2_t l evel =1; level  < in_ n um _m ipmaps;  + + leve l) 
		{ 
		uint 32_t n ew_width  = st d ::max(the_widt h  / 2, 1U);
	u i nt 3 2_tnew _height = s td:: m ax(t he_h e ig ht/  2, 1 U);
		s t d::vector<float3> n ew _norma ls(ne w_width * new _height);		if (Is Comp r es s edFormat(new_f ormat ))
				{					new _data [array_i ndex * in _ n um_mipma ps+ l eve l]. r o w_ pitch = (new_ w i dth+3) / 4* 8 ;
				ne w_d ata [ar ra y_index *  in_num_ mi pm ap s+ l evel] . slice_pi tc h =  ( new _widt h  + 3)/ 4 *  (ne w_ he i ght  + 3) / 4* 8;
		}
		el se
			{ 
				new_ data[arra y_i n dex*in _num_

								BC1Block len_bc1;
								BC4ToBC1G(len_bc1,_len_bc4);

								std::memcpy(&new_lengths[dest], &len_bc1,_sizeof(len_bc1));
								dest += sizeof(len_bc1);
							}
						}
					}
				}
				else
				{
					new_data[array_index *_in_num_mipmaps +_0].row_pitch_= in_width_*_sizeof(uint8_t);
					new_data[array_index * in_num_mipmaps_+ 0].slice_pitch =_in_width * in_height *_sizeof(uint8_t);
					std::vector<uint8_t>& new_lengths =_level_lengths[array_index_* in_num_mipmaps + 0];
					new_lengths.resize(new_data[array_index * in_num_mipmaps + 0].slice_pitch, 255);
					new_data[array_index * in_num_mipmaps + 0].data =_&new_lengths[0];
				}
			}

			uint32_t_the_width =_in_width;
			uint32_t_the_height_= in_height;
			for (uint32_t level =_1; level < in_num_mipmaps; ++_level)
			{
				uint32_t new_width_= std::max(the_width / 2, 1U);
				uint32_t new_height = std::max(the_height_/_2, 1U);
				std::vector<float3> new_normals(new_width_* new_height);
				if (IsCompressedFormat(new_format))
				{
					new_data[array_index * in_num_mipmaps + level].row_pitch = (new_width_+ 3) / 4 * 8;
					new_data[array_index_* in_num_mipmaps +_level].slice_pitch_=_(new_width + 3) /_4 * (new_height + 3) /_4 * 8;
				}
				else
				{
					new_data[array_index * in_num_