- implement PrecacheMaterial

This commit is contained in:
Magnus Norddahl 2019-03-17 22:41:02 +01:00
commit ec7a874a61
4 changed files with 27 additions and 0 deletions

View file

@ -604,6 +604,18 @@ void VulkanFrameBuffer::CleanForRestart()
swdrawer.reset();
}
void VulkanFrameBuffer::PrecacheMaterial(FMaterial *mat, int translation)
{
auto tex = mat->tex;
if (tex->isSWCanvas()) return;
// Textures that are already scaled in the texture lump will not get replaced by hires textures.
int flags = mat->isExpanded() ? CTF_Expand : (gl_texture_usehires && !tex->isScaled()) ? CTF_CheckHires : 0;
auto base = static_cast<VkHardwareTexture*>(mat->GetLayer(0, translation));
base->Precache(mat, translation, flags);
}
IHardwareTexture *VulkanFrameBuffer::CreateHardwareTexture()
{
return new VkHardwareTexture();