MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Copy

Method Copy

Source/Engine/Graphics/Textures/TextureBase.cpp:177–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177void TextureMipData::Copy(void* data, uint32 dataRowPitch, uint32 dataDepthPitch, uint32 dataDepthSlices, uint32 targetRowPitch)
178{
179 // Check if target row pitch is the same
180 if (targetRowPitch == dataRowPitch || targetRowPitch == 0)
181 {
182 Lines = dataDepthPitch / dataRowPitch;
183 DepthPitch = dataDepthPitch;
184 RowPitch = dataRowPitch;
185
186 // Single memory copy
187 Data.Copy((byte*)data, dataDepthPitch * dataDepthSlices);
188 }
189 else
190 {
191 Lines = dataDepthPitch / dataRowPitch;
192 DepthPitch = targetRowPitch * Lines;
193 RowPitch = targetRowPitch;
194
195 // Convert row by row
196 Data.Allocate(DepthPitch * dataDepthSlices);
197 for (uint32 depth = 0; depth < dataDepthSlices; depth++)
198 {
199 byte* src = (byte*)data + depth * dataDepthPitch;
200 byte* dst = Data.Get() + depth * DepthPitch;
201 for (uint32 row = 0; row < Lines; row++)
202 {
203 Platform::MemoryCopy(dst + row * RowPitch, src + row * dataRowPitch, RowPitch);
204 }
205 }
206 }
207}
208
209int32 TextureData::GetArraySize() const
210{

Callers 15

SendReplicationFunction · 0.45
SpawnObjectMethod · 0.45
DespawnObjectMethod · 0.45
EndInvokeRPCMethod · 0.45
LoadSurfaceMethod · 0.45
SaveSurfaceMethod · 0.45
GetDataMethod · 0.45
GetTextureDataMethod · 0.45
GetTextureMipDataMethod · 0.45
InitCSharpMethod · 0.45
LoadShaderCacheMethod · 0.45
SaveMethod · 0.45

Calls 2

AllocateMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected