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

Method UploadData

Source/Engine/Graphics/Textures/GPUTexture.cpp:683–698  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

681}
682
683bool GPUTexture::UploadData(TextureData& data, bool copyData)
684{
685 if (!IsAllocated())
686 return true;
687 if (data.Width != Width() || data.Height != Height() || data.Depth != Depth() || data.GetArraySize() != ArraySize() || data.Format != Format())
688 return true;
689 for (int32 arrayIndex = 0; arrayIndex < ArraySize(); arrayIndex++)
690 {
691 for (int32 mipLevel = 0; mipLevel < MipLevels(); mipLevel++)
692 {
693 TextureMipData* mip = data.GetData(arrayIndex, mipLevel);
694 UploadMipMapAsync(mip->Data, mipLevel, mip->RowPitch, mip->DepthPitch, copyData);
695 }
696 }
697 return false;
698}
699
700class TextureDownloadDataTask : public ThreadPoolTask
701{

Callers

nothing calls this directly

Calls 9

ArraySizeFunction · 0.85
MipLevelsFunction · 0.85
GetArraySizeMethod · 0.80
IsAllocatedFunction · 0.70
WidthFunction · 0.70
HeightFunction · 0.70
DepthFunction · 0.70
FormatFunction · 0.70
GetDataMethod · 0.45

Tested by

no test coverage detected