texture import BC conversion fix: do block alignment after format was determined

This commit is contained in:
Turánszki János
2023-06-02 08:52:57 +02:00
parent 853dcedda8
commit 66bdda7521
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -853,9 +853,6 @@ namespace wi
Texture uncompressed_src = std::move(resource->texture);
resource->srgb_subresource = -1;
desc.width = AlignTo(desc.width, GetFormatBlockSize(desc.format));
desc.height = AlignTo(desc.height, GetFormatBlockSize(desc.format));
desc.format = Format::BC1_UNORM;
if (has_flag(flags, Flags::IMPORT_NORMALMAP))
{
@@ -900,6 +897,9 @@ namespace wi
}
desc.bind_flags = BindFlag::SHADER_RESOURCE;
desc.width = AlignTo(desc.width, GetFormatBlockSize(desc.format));
desc.height = AlignTo(desc.height, GetFormatBlockSize(desc.format));
success = device->CreateTexture(&desc, nullptr, &resource->texture);
device->SetName(&resource->texture, name.c_str());
+1 -1
View File
@@ -9,7 +9,7 @@ namespace wi::version
// minor features, major updates, breaking compatibility changes
const int minor = 71;
// minor bug fixes, alterations, refactors, updates
const int revision = 217;
const int revision = 218;
const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);