本文整理汇总了C++中FTexture::isHardwareCanvas方法的典型用法代码示例。如果您正苦于以下问题:C++ FTexture::isHardwareCanvas方法的具体用法?C++ FTexture::isHardwareCanvas怎么用?C++ FTexture::isHardwareCanvas使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FTexture
的用法示例。
在下文中一共展示了FTexture::isHardwareCanvas方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
VulkanDescriptorSet *VkHardwareTexture::GetDescriptorSet(const FMaterialState &state)
{
FMaterial *mat = state.mMaterial;
FTexture *tex = state.mMaterial->tex;
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;
// 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;
if (tex->isHardwareCanvas()) static_cast<FCanvasTexture*>(tex)->NeedUpdate();
for (auto &set : mDescriptorSets)
{
if (set.descriptor && set.clampmode == clampmode && set.flags == flags) return set.descriptor.get();
}
int numLayers = mat->GetLayers();
auto fb = GetVulkanFrameBuffer();
auto descriptor = fb->GetRenderPassManager()->AllocateTextureDescriptorSet(numLayers);
descriptor->SetDebugName("VkHardwareTexture.mDescriptorSets");
VulkanSampler *sampler = fb->GetSamplerManager()->Get(clampmode);
WriteDescriptors update;
update.addCombinedImageSampler(descriptor.get(), 0, GetImage(tex, translation, flags)->View.get(), sampler, mImage.Layout);
for (int i = 1; i < numLayers; i++)
{
FTexture *layer;
auto systex = static_cast<VkHardwareTexture*>(mat->GetLayer(i, 0, &layer));
update.addCombinedImageSampler(descriptor.get(), i, systex->GetImage(layer, 0, mat->isExpanded() ? CTF_Expand : 0)->View.get(), sampler, systex->mImage.Layout);
}
update.updateSets(fb->device);
mDescriptorSets.emplace_back(clampmode, flags, std::move(descriptor));
return mDescriptorSets.back().descriptor.get();
}