- more texture cleanup.

It is now in a state where FTexture really needs to be separated from FGameTexture.
This commit is contained in:
Christoph Oelckers 2020-04-15 18:59:14 +02:00
commit 83817080bb
21 changed files with 91 additions and 103 deletions

View file

@ -112,19 +112,15 @@ void VkHardwareTexture::ResetAllDescriptors()
VulkanDescriptorSet *VkHardwareTexture::GetDescriptorSet(const FMaterialState &state)
{
FMaterial *mat = state.mMaterial;
FTexture *base = state.mMaterial->Source();
auto base = state.mMaterial->Source();
int clampmode = state.mClampMode;
int translation = state.mTranslation;
if (base->UseType == ETextureType::SWCanvas) clampmode = CLAMP_NOFILTER;
if (base->isHardwareCanvas()) clampmode = CLAMP_CAMTEX;
else if ((base->isWarped() || base->shaderindex >= FIRST_USER_SHADER) && clampmode <= CLAMP_XY) clampmode = CLAMP_NONE;
clampmode = base->GetClampMode(clampmode);
// Textures that are already scaled in the texture lump will not get replaced by hires textures.
int flags = state.mMaterial->isExpanded() ? CTF_Expand : 0;
if (base->isHardwareCanvas()) static_cast<FCanvasTexture*>(base)->NeedUpdate();
for (auto &set : mDescriptorSets)
{
if (set.descriptor && set.clampmode == clampmode && set.flags == flags) return set.descriptor.get();