diff --git a/kraken/KRTexture2D.h b/kraken/KRTexture2D.h index f789717..720d022 100755 --- a/kraken/KRTexture2D.h +++ b/kraken/KRTexture2D.h @@ -48,7 +48,7 @@ public: virtual bool save(const std::string& path); virtual bool save(KRDataBlock& data); - virtual bool uploadTexture(KRDevice& device, VkImage& image, int lod_max_dim, int& current_lod_max_dim, bool compress = false, bool premultiply_alpha = false) = 0; + virtual bool uploadTexture(KRDevice& device, VkImage& image, int lod_max_dim, int& current_lod_max_dim, bool premultiply_alpha = false) = 0; virtual Vector2i getDimensions() const = 0; protected: diff --git a/kraken/KRTextureKTX.cpp b/kraken/KRTextureKTX.cpp index b1d121c..f4e3a89 100755 --- a/kraken/KRTextureKTX.cpp +++ b/kraken/KRTextureKTX.cpp @@ -160,7 +160,7 @@ long KRTextureKTX::getMemRequiredForSize(int max_dim) return memoryRequired; } -bool KRTextureKTX::uploadTexture(KRDevice& device, VkImage& image, int lod_max_dim, int& current_lod_max_dim, bool compress, bool premultiply_alpha) +bool KRTextureKTX::uploadTexture(KRDevice& device, VkImage& image, int lod_max_dim, int& current_lod_max_dim, bool premultiply_alpha) { int target_dim = lod_max_dim; if (target_dim < (int)m_min_lod_max_dim) target_dim = m_min_lod_max_dim; diff --git a/kraken/KRTextureKTX.h b/kraken/KRTextureKTX.h index e5336d0..a7243c7 100755 --- a/kraken/KRTextureKTX.h +++ b/kraken/KRTextureKTX.h @@ -41,7 +41,7 @@ public: virtual ~KRTextureKTX(); virtual std::string getExtension(); - bool uploadTexture(KRDevice& device, VkImage& image, int lod_max_dim, int& current_lod_max_dim, bool compress = false, bool premultiply_alpha = false) override; + bool uploadTexture(KRDevice& device, VkImage& image, int lod_max_dim, int& current_lod_max_dim, bool premultiply_alpha = false) override; virtual long getMemRequiredForSize(int max_dim); virtual Vector2i getDimensions() const override; diff --git a/kraken/KRTexturePVR.cpp b/kraken/KRTexturePVR.cpp index 7b6648f..dbda456 100755 --- a/kraken/KRTexturePVR.cpp +++ b/kraken/KRTexturePVR.cpp @@ -180,7 +180,7 @@ long KRTexturePVR::getMemRequiredForSize(int max_dim) return memoryRequired; } -bool KRTexturePVR::uploadTexture(KRDevice& device, VkImage& image, int lod_max_dim, int& current_lod_max_dim, bool compress, bool premultiply_alpha) +bool KRTexturePVR::uploadTexture(KRDevice& device, VkImage& image, int lod_max_dim, int& current_lod_max_dim, bool premultiply_alpha) { int target_dim = lod_max_dim; if (target_dim < (int)m_min_lod_max_dim) target_dim = m_min_lod_max_dim; diff --git a/kraken/KRTexturePVR.h b/kraken/KRTexturePVR.h index a448df1..bca4852 100755 --- a/kraken/KRTexturePVR.h +++ b/kraken/KRTexturePVR.h @@ -40,7 +40,7 @@ public: virtual ~KRTexturePVR(); virtual std::string getExtension(); - bool uploadTexture(KRDevice& device, VkImage& image, int lod_max_dim, int& current_lod_max_dim, bool compress = false, bool premultiply_alpha = false) override; + bool uploadTexture(KRDevice& device, VkImage& image, int lod_max_dim, int& current_lod_max_dim, bool premultiply_alpha = false) override; virtual long getMemRequiredForSize(int max_dim); virtual Vector2i getDimensions() const override; diff --git a/kraken/KRTextureTGA.cpp b/kraken/KRTextureTGA.cpp index b34958c..ff013b0 100755 --- a/kraken/KRTextureTGA.cpp +++ b/kraken/KRTextureTGA.cpp @@ -116,7 +116,7 @@ KRTextureTGA::~KRTextureTGA() } -bool KRTextureTGA::uploadTexture(KRDevice& device, VkImage& image, int lod_max_dim, int& current_lod_max_dim, bool compress, bool premultiply_alpha) +bool KRTextureTGA::uploadTexture(KRDevice& device, VkImage& image, int lod_max_dim, int& current_lod_max_dim, bool premultiply_alpha) { // TODO - Vulkan Refactoring - Perhaps it would be more efficient to reformat the color channels during the copy to the staging buffer. @@ -124,14 +124,6 @@ bool KRTextureTGA::uploadTexture(KRDevice& device, VkImage& image, int lod_max_d TGA_HEADER* pHeader = (TGA_HEADER*)m_pData->getStart(); unsigned char* pData = (unsigned char*)pHeader + (long)pHeader->idlength + (long)pHeader->colourmaplength * (long)pHeader->colourmaptype + sizeof(TGA_HEADER); - /* - * TODO - Vulkan refactoring to support compressing textures on load - unsigned int internal_format = GL_RGBA; - if(compress) { - internal_format = pHeader->bitsperpixel == 24 ? GL_COMPRESSED_RGB_S3TC_DXT1_EXT : GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; - } - */ - if (pHeader->colourmaptype != 0) { m_pData->unlock(); return false; // Mapped colors not supported @@ -347,7 +339,7 @@ KRTexture* KRTextureTGA::compress(bool premultiply_alpha) GLDEBUG(glBindTexture(GL_TEXTURE_2D, compressed_handle)); int current_max_dim = 0; - if(!uploadTexture(m_max_lod_max_dim, current_max_dim, true, premultiply_alpha)) { + if(!uploadTexture(m_max_lod_max_dim, current_max_dim, premultiply_alpha)) { assert(false); // Failed to upload the texture } GLDEBUG(glGenerateMipmap(GL_TEXTURE_2D)); diff --git a/kraken/KRTextureTGA.h b/kraken/KRTextureTGA.h index def7891..f65c868 100755 --- a/kraken/KRTextureTGA.h +++ b/kraken/KRTextureTGA.h @@ -40,7 +40,7 @@ public: virtual ~KRTextureTGA(); virtual std::string getExtension(); - bool uploadTexture(KRDevice& device, VkImage& image, int lod_max_dim, int& current_lod_max_dim, bool compress = false, bool premultiply_alpha = false) override; + bool uploadTexture(KRDevice& device, VkImage& image, int lod_max_dim, int& current_lod_max_dim, bool premultiply_alpha = false) override; #if !TARGET_OS_IPHONE && !defined(ANDROID) virtual KRTexture* compress(bool premultiply_alpha = false);