From 18c0c9dea9ff73f1526473aacb85f9a6bb272b13 Mon Sep 17 00:00:00 2001 From: assiduous Date: Sun, 10 Jan 2021 14:46:13 -0800 Subject: 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 --- TextureLoader/interface/TextureLoader.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'TextureLoader/interface') diff --git a/TextureLoader/interface/TextureLoader.h b/TextureLoader/interface/TextureLoader.h index 72b0ebe..ebe81b4 100644 --- a/TextureLoader/interface/TextureLoader.h +++ b/TextureLoader/interface/TextureLoader.h @@ -104,11 +104,13 @@ void DILIGENT_GLOBAL_FUNCTION(CreateTextureFromImage)(struct Image* /// Creates a texture from DDS data blob -/// \param [in] pDDSData - Pointer to the DDS data blob +/// \param [in] pDDSData - Pointer to DDS data +/// \param [in] DataSize - DDS data size /// \param [in] TexLoadInfo - Texture loading information -/// \param [in] pDevice - Render device that will be used to create the texture -/// \param [out] ppTexture - Memory location where pointer to the created texture will be stored -void DILIGENT_GLOBAL_FUNCTION(CreateTextureFromDDS)(IDataBlob* pDDSData, +/// \param [in] pDevice - Render device that will be used to create the texture +/// \param [out] ppTexture - Memory location where pointer to the created texture will be stored +void DILIGENT_GLOBAL_FUNCTION(CreateTextureFromDDS)(const void* pDDSData, + size_t DataSize, const TextureLoadInfo REF TexLoadInfo, IRenderDevice* pDevice, ITexture** ppTexture); @@ -116,11 +118,13 @@ void DILIGENT_GLOBAL_FUNCTION(CreateTextureFromDDS)(IDataBlob* pD /// Creates a texture from KTX data blob -/// \param [in] pKTXData - Pointer to the KTX data blob +/// \param [in] pKTXData - Pointer to KTX data +/// \param [in] DataSize - KTX data size /// \param [in] TexLoadInfo - Texture loading information /// \param [in] pDevice - Render device that will be used to create the texture /// \param [out] ppTexture - Memory location where pointer to the created texture will be stored -void DILIGENT_GLOBAL_FUNCTION(CreateTextureFromKTX)(IDataBlob* pKTXData, +void DILIGENT_GLOBAL_FUNCTION(CreateTextureFromKTX)(const void* pKTXData, + size_t DataSize, const TextureLoadInfo REF TexLoadInfo, IRenderDevice* pDevice, ITexture** ppTexture); -- cgit v1.2.3