Skip to content

Commit

Permalink
[debug] print what tex cache is resolving
Browse files Browse the repository at this point in the history
  • Loading branch information
psucien committed Nov 5, 2024
1 parent 2655855 commit 9e624e6
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
4 changes: 4 additions & 0 deletions src/video_core/texture_cache/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ Image::Image(const Vulkan::Instance& instance_, Vulkan::Scheduler& scheduler_,
return;
}

// TMP {
binding.just_created = 1u;
// }

mip_hashes.resize(info.resources.levels);
ASSERT(info.pixel_format != vk::Format::eUndefined);
// Here we force `eExtendedUsage` as don't know all image usage cases beforehand. In normal case
Expand Down
20 changes: 13 additions & 7 deletions src/video_core/texture_cache/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,16 @@ struct Image {
std::vector<ImageViewId> image_view_ids;

// Resource state tracking
struct {
u32 texture : 1;
u32 storage : 1;
u32 render_target : 1;
u32 depth_target : 1;
u32 stencil : 1;
u32 vo_surface : 1;
union {
struct {
u32 texture : 1;
u32 storage : 1;
u32 render_target : 1;
u32 depth_target : 1;
u32 stencil : 1;
u32 vo_surface : 1;
};
u32 raw{};
} usage{};
vk::ImageUsageFlags usage_flags;
vk::FormatFeatureFlags2 format_features;
Expand All @@ -139,6 +142,9 @@ struct Image {
u32 is_target : 1; // the image is bound as color/depth target
u32 needs_rebind : 1; // the image needs to be rebound
u32 force_general : 1; // the image needs to be used in general layout
// TMP {
u32 just_created : 1;
// }
};
u32 raw{};
};
Expand Down
11 changes: 11 additions & 0 deletions src/video_core/texture_cache/texture_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,17 @@ ImageId TextureCache::FindImage(BaseDesc& desc) {
Image& image = slot_images[image_id];
image.tick_accessed_last = scheduler.CurrentTick();

// TMP {
LOG_WARNING(Render_Vulkan, "{}:{:x}@[{}x{}:{}_{}:{}_{}:{}]->{:x}@[{}x{}:{}:{}:{}]({:x}_{:x})",
int(desc.type), info.guest_address, info.size.width, info.size.height,
desc.view_info.range.base.level, info.resources.levels,
desc.view_info.range.base.layer, info.resources.layers,
vk::to_string(info.pixel_format).c_str(), image.info.guest_address,
image.info.size.width, image.info.size.height, image.info.resources.levels,
image.info.resources.layers, vk::to_string(image.info.pixel_format).c_str(),
image.usage.raw, image.binding.raw);
// }

return image_id;
}

Expand Down

0 comments on commit 9e624e6

Please sign in to comment.