X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-scene-loader%2Fpublic-api%2Fktx-loader.cpp;h=a74c50cbced2c6ed8c806cb939c14e4fd3bc2f2f;hp=147b3fd7587a03b973b09249d0579e1f0f152e5d;hb=66ac5f38e4fc285c159381c80e5f1f25f07fba6d;hpb=f2039d47f9bed8104575da80a2ecf0bb6e37ff8d diff --git a/dali-scene-loader/public-api/ktx-loader.cpp b/dali-scene-loader/public-api/ktx-loader.cpp index 147b3fd..a74c50c 100644 --- a/dali-scene-loader/public-api/ktx-loader.cpp +++ b/dali-scene-loader/public-api/ktx-loader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,12 +16,12 @@ */ // FILE HEADER -#include "dali-scene-loader/public-api/ktx-loader.h" +#include // EXTERNAL INCLUDES #include #include -#include "dali/public-api/rendering/texture.h" +#include namespace Dali { @@ -161,7 +161,7 @@ bool ConvertPixelFormat(const uint32_t ktxPixelFormat, Pixel::Format& format) } case 0x8C3A: // GL_R11F_G11F_B10F { - format = Pixel::RGB32F; + format = Pixel::R11G11B10F; break; } case 0x8D7C: // GL_RGBA8UI @@ -183,22 +183,7 @@ bool ConvertPixelFormat(const uint32_t ktxPixelFormat, Pixel::Format& format) return true; } -Texture CubeData::CreateTexture() const -{ - Texture texture = Texture::New(TextureType::TEXTURE_CUBE, data[0][0].GetPixelFormat(), data[0][0].GetWidth(), data[0][0].GetHeight()); - for(size_t iSide = 0u, iEndSize = data.size(); iSide < iEndSize; ++iSide) - { - auto& side = data[iSide]; - for(size_t iMipLevel = 0u, iEndMipLevel = data[0].size(); iMipLevel < iEndMipLevel; ++iMipLevel) - { - texture.Upload(side[iMipLevel], CubeMapLayer::POSITIVE_X + iSide, iMipLevel, 0u, 0u, side[iMipLevel].GetWidth(), side[iMipLevel].GetHeight()); - } - } - - return texture; -} - -bool LoadCubeMapData(const std::string& path, CubeData& cubedata) +bool LoadKtxData(const std::string& path, CubeData& cubedata) { std::fstream fp(path, std::ios::in | std::ios::binary); if(fp.is_open() == false)