From 0d429fc7d748831ac0b43a65cb64d2c688cb5156 Mon Sep 17 00:00:00 2001 From: gibbed Date: Thu, 31 May 2018 23:00:11 -0500 Subject: [PATCH] [Vulkan] Disable texture mipmap watches by default. --- src/xenia/gpu/vulkan/texture_cache.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/xenia/gpu/vulkan/texture_cache.cc b/src/xenia/gpu/vulkan/texture_cache.cc index d589894e8..f61ddb893 100644 --- a/src/xenia/gpu/vulkan/texture_cache.cc +++ b/src/xenia/gpu/vulkan/texture_cache.cc @@ -27,6 +27,8 @@ namespace vulkan { using xe::ui::vulkan::CheckResult; +DEFINE_bool(enable_mip_watches, false, "Enable mipmap watches"); + constexpr uint32_t kMaxTextureSamplers = 32; constexpr VkDeviceSize kStagingBufferSize = 64 * 1024 * 1024; @@ -321,9 +323,9 @@ void TextureCache::WatchCallback(void* context_ptr, void* data_ptr, return; } + assert_not_zero(touched_texture->access_watch_handle); // Clear watch handle first so we don't redundantly // remove. - assert_not_zero(touched_texture->access_watch_handle); touched_texture->access_watch_handle = 0; touched_texture->pending_invalidation = true; @@ -383,7 +385,7 @@ TextureCache::Texture* TextureCache::DemandResolveTexture( get_dimension_name(texture_info.dimension))); // Setup an access watch. If this texture is touched, it is destroyed. - if (!texture_info.memory.mip_address) { + if (!FLAGS_enable_mip_watches || !texture_info.memory.mip_address) { texture->access_watch_handle = memory_->AddPhysicalAccessWatch( texture_info.memory.base_address, texture_info.memory.base_size, cpu::MMIOHandler::kWatchWrite, &WatchCallback, this, texture); @@ -494,7 +496,7 @@ TextureCache::Texture* TextureCache::Demand(const TextureInfo& texture_info, // Okay. Put a writewatch on it to tell us if it's been modified from the // guest. - if (!texture_info.memory.mip_address) { + if (!FLAGS_enable_mip_watches || !texture_info.memory.mip_address) { texture->access_watch_handle = memory_->AddPhysicalAccessWatch( texture_info.memory.base_address, texture_info.memory.base_size, cpu::MMIOHandler::kWatchWrite, &WatchCallback, this, texture);