diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2021-01-10 22:46:13 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2021-01-10 22:46:13 +0000 |
| commit | 18c0c9dea9ff73f1526473aacb85f9a6bb272b13 (patch) | |
| tree | 32e20e80f2ad8fb0f6798bfb6092e3239263674b /TextureLoader/src/TextureLoader.cpp | |
| parent | Minor fix in GLTF resource manager (diff) | |
| download | DiligentTools-18c0c9dea9ff73f1526473aacb85f9a6bb272b13.tar.gz DiligentTools-18c0c9dea9ff73f1526473aacb85f9a6bb272b13.zip | |
GLTF loader: reworked initial texture data to be stored as user data in the texture/allocation to make sure that GPU data is always initialized before the first use
Diffstat (limited to 'TextureLoader/src/TextureLoader.cpp')
| -rw-r--r-- | TextureLoader/src/TextureLoader.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/TextureLoader/src/TextureLoader.cpp b/TextureLoader/src/TextureLoader.cpp index d402fed..d0021f6 100644 --- a/TextureLoader/src/TextureLoader.cpp +++ b/TextureLoader/src/TextureLoader.cpp @@ -205,14 +205,15 @@ void CreateTextureFromImage(Image* pSrcImage, pDevice->CreateTexture(TexDesc, &TexData, ppTexture); } -void CreateTextureFromDDS(IDataBlob* pDDSData, +void CreateTextureFromDDS(const void* pDDSData, + size_t DataSize, const TextureLoadInfo& TexLoadInfo, IRenderDevice* pDevice, ITexture** ppTexture) { CreateDDSTextureFromMemoryEx(pDevice, - reinterpret_cast<const Uint8*>(pDDSData->GetDataPtr()), - static_cast<size_t>(pDDSData->GetSize()), + reinterpret_cast<const Uint8*>(pDDSData), + DataSize, 0, // maxSize TexLoadInfo.Usage, TexLoadInfo.Name, @@ -269,12 +270,13 @@ extern "C" Diligent::CreateTextureFromImage(pSrcImage, TexLoadInfo, pDevice, ppTexture); } - void Diligent_CreateTextureFromDDS(Diligent::IDataBlob* pDDSData, + void Diligent_CreateTextureFromDDS(const void* pDDSData, + size_t DataSize, const Diligent::TextureLoadInfo& TexLoadInfo, Diligent::IRenderDevice* pDevice, Diligent::ITexture** ppTexture) { - Diligent::CreateTextureFromDDS(pDDSData, TexLoadInfo, pDevice, ppTexture); + Diligent::CreateTextureFromDDS(pDDSData, DataSize, TexLoadInfo, pDevice, ppTexture); } -}
\ No newline at end of file +} |
