- VkHardwareTexture needs to BFF with FTexture

This commit is contained in:
Magnus Norddahl 2019-03-13 01:15:50 +01:00
parent 83ee884ffc
commit a585a90d81
2 changed files with 5 additions and 4 deletions

View file

@ -295,6 +295,7 @@ class FTexture
friend class OpenGLRenderer::FGLRenderState; // For now this needs access to some fields in ApplyMaterial. This should be rerouted through the Material class friend class OpenGLRenderer::FGLRenderState; // For now this needs access to some fields in ApplyMaterial. This should be rerouted through the Material class
friend struct FTexCoordInfo; friend struct FTexCoordInfo;
friend class OpenGLRenderer::FHardwareTexture; friend class OpenGLRenderer::FHardwareTexture;
friend class VkHardwareTexture;
friend class FMultiPatchTexture; friend class FMultiPatchTexture;
friend class FSkyBox; friend class FSkyBox;
friend class FBrightmapTexture; friend class FBrightmapTexture;

View file

@ -68,9 +68,9 @@ VulkanDescriptorSet *VkHardwareTexture::GetDescriptorSet(const FMaterialState &s
int clampmode = state.mClampMode; int clampmode = state.mClampMode;
int translation = state.mTranslation; int translation = state.mTranslation;
//if (tex->UseType == ETextureType::SWCanvas) clampmode = CLAMP_NOFILTER; if (tex->UseType == ETextureType::SWCanvas) clampmode = CLAMP_NOFILTER;
//if (tex->isHardwareCanvas()) clampmode = CLAMP_CAMTEX; if (tex->isHardwareCanvas()) clampmode = CLAMP_CAMTEX;
//else if ((tex->isWarped() || tex->shaderindex >= FIRST_USER_SHADER) && clampmode <= CLAMP_XY) clampmode = CLAMP_NONE; else if ((tex->isWarped() || tex->shaderindex >= FIRST_USER_SHADER) && clampmode <= CLAMP_XY) clampmode = CLAMP_NONE;
// Textures that are already scaled in the texture lump will not get replaced by hires textures. // Textures that are already scaled in the texture lump will not get replaced by hires textures.
int flags = state.mMaterial->isExpanded() ? CTF_Expand : (gl_texture_usehires && !tex->isScaled() && clampmode <= CLAMP_XY) ? CTF_CheckHires : 0; int flags = state.mMaterial->isExpanded() ? CTF_Expand : (gl_texture_usehires && !tex->isScaled() && clampmode <= CLAMP_XY) ? CTF_CheckHires : 0;
@ -96,7 +96,7 @@ VulkanDescriptorSet *VkHardwareTexture::GetDescriptorSet(const FMaterialState &s
{ {
FTexture *layer; FTexture *layer;
auto systex = static_cast<VkHardwareTexture*>(mat->GetLayer(i, 0, &layer)); auto systex = static_cast<VkHardwareTexture*>(mat->GetLayer(i, 0, &layer));
update.addCombinedImageSampler(descriptorSet.get(), i, systex->GetImageView(layer, clampmode, 0, mat->isExpanded() ? CTF_Expand : 0), sampler, mImageLayout); update.addCombinedImageSampler(descriptorSet.get(), i, systex->GetImageView(layer, clampmode, 0, mat->isExpanded() ? CTF_Expand : 0), sampler, systex->mImageLayout);
} }
update.updateSets(fb->device); update.updateSets(fb->device);
} }