Skip to content
Permalink
Browse files

- VkHardwareTexture needs to BFF with FTexture

  • Loading branch information...
dpjudas committed Mar 13, 2019
1 parent 83ee884 commit a585a90d810458110082f0d6dc27572dfa660c89
Showing with 5 additions and 4 deletions.
  1. +1 −0 src/gamedata/textures/textures.h
  2. +4 −4 src/rendering/vulkan/textures/vk_hwtexture.cpp
@@ -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 struct FTexCoordInfo;
friend class OpenGLRenderer::FHardwareTexture;
friend class VkHardwareTexture;
friend class FMultiPatchTexture;
friend class FSkyBox;
friend class FBrightmapTexture;
@@ -68,9 +68,9 @@ VulkanDescriptorSet *VkHardwareTexture::GetDescriptorSet(const FMaterialState &s
int clampmode = state.mClampMode;
int translation = state.mTranslation;

//if (tex->UseType == ETextureType::SWCanvas) clampmode = CLAMP_NOFILTER;
//if (tex->isHardwareCanvas()) clampmode = CLAMP_CAMTEX;
//else if ((tex->isWarped() || tex->shaderindex >= FIRST_USER_SHADER) && clampmode <= CLAMP_XY) clampmode = CLAMP_NONE;
if (tex->UseType == ETextureType::SWCanvas) clampmode = CLAMP_NOFILTER;
if (tex->isHardwareCanvas()) clampmode = CLAMP_CAMTEX;
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.
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;
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);
}

0 comments on commit a585a90

Please sign in to comment.
You can’t perform that action at this time.