Refactoring KRTexture2D::uploadTexture, replacing with getLodData.
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, macos-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled

This commit is contained in:
2026-03-16 00:28:54 -07:00
parent 3914e917a1
commit 780d06883a
13 changed files with 79 additions and 124 deletions

View File

@@ -391,8 +391,9 @@ 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 premultiply_alpha)
bool KRTextureKTX::getLodData(void* buffer, int lod_max_dim)
{
unsigned char* converted_image = (unsigned char*)buffer;
int target_dim = lod_max_dim;
if (target_dim < (int)m_min_lod_max_dim) target_dim = m_min_lod_max_dim;
@@ -414,12 +415,14 @@ bool KRTextureKTX::uploadTexture(KRDevice& device, VkImage& image, int lod_max_d
Block* block = *itr;
if (width <= target_dim && height <= target_dim) {
/*
if (width > current_lod_max_dim) {
current_lod_max_dim = width;
}
if (height > current_lod_max_dim) {
current_lod_max_dim = height;
}
*/
block->lock();
/*