[Vulkan]: Implement MirrorOnceBorder and MirrorOnceClampOGL
This commit is contained in:
parent
6f4f73a59b
commit
ca1aec13f5
2 changed files with 27 additions and 2 deletions
|
|
@ -76,7 +76,18 @@ VkSamplerAddressMode WrapMode(const Device& device, Tegra::Texture::WrapMode wra
|
|||
case Tegra::Texture::WrapMode::MirrorOnceClampToEdge:
|
||||
return VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE;
|
||||
case Tegra::Texture::WrapMode::MirrorOnceBorder:
|
||||
UNIMPLEMENTED();
|
||||
// GL_MIRROR_CLAMP_TO_BORDER
|
||||
if (device.GetDriverID() == VK_DRIVER_ID_NVIDIA_PROPRIETARY) {
|
||||
return static_cast<VkSamplerAddressMode>(0x8912); // GL_MIRROR_CLAMP_TO_BORDER_EXT
|
||||
}
|
||||
// Fallback
|
||||
return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER;
|
||||
case Tegra::Texture::WrapMode::MirrorOnceClampOGL:
|
||||
// GL_MIRROR_CLAMP
|
||||
if (device.GetDriverID() == VK_DRIVER_ID_NVIDIA_PROPRIETARY) {
|
||||
return static_cast<VkSamplerAddressMode>(0x8742); // GL_MIRROR_CLAMP_EXT
|
||||
}
|
||||
// Fallback: MIRROR_CLAMP_TO_EDGE is the closest approximation
|
||||
return VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE;
|
||||
default:
|
||||
UNIMPLEMENTED_MSG("Unimplemented wrap mode={}", wrap_mode);
|
||||
|
|
|
|||
|
|
@ -1493,7 +1493,21 @@ ImageId TextureCache<P>::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, DA
|
|||
for (const ImageId overlap_id : join_ignore_textures) {
|
||||
Image& overlap = slot_images[overlap_id];
|
||||
if (True(overlap.flags & ImageFlagBits::GpuModified)) {
|
||||
UNIMPLEMENTED();
|
||||
new_image.flags |= ImageFlagBits::GpuModified;
|
||||
const auto base = new_image.TryFindBase(overlap.gpu_addr);
|
||||
if (base) {
|
||||
const auto& resolution = Settings::values.resolution_info;
|
||||
const u32 up_scale = can_rescale ? resolution.up_scale : 1;
|
||||
const u32 down_shift = can_rescale ? resolution.down_shift : 0;
|
||||
auto copies = MakeShrinkImageCopies(new_info, overlap.info, base.value(),
|
||||
up_scale, down_shift);
|
||||
if (overlap.info.num_samples != new_image.info.num_samples) {
|
||||
runtime.CopyImageMSAA(new_image, overlap, std::move(copies));
|
||||
} else {
|
||||
runtime.CopyImage(new_image, overlap, std::move(copies));
|
||||
}
|
||||
new_image.modification_tick = overlap.modification_tick;
|
||||
}
|
||||
}
|
||||
if (True(overlap.flags & ImageFlagBits::Tracked)) {
|
||||
UntrackImage(overlap, overlap_id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue