Skip to content

Commit

Permalink
FindFlags moved back as argument
Browse files Browse the repository at this point in the history
  • Loading branch information
psucien committed Nov 12, 2024
1 parent 4711c55 commit 3c98534
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/video_core/buffer_cache/buffer_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,7 @@ bool BufferCache::SynchronizeBufferFromImage(Buffer& buffer, VAddr device_addr,
TextureCache::BaseDesc desc{};
desc.info.guest_address = device_addr;
desc.info.guest_size_bytes = size;
desc.flags = find_flags;
const ImageId image_id = texture_cache.FindImage(desc);
const ImageId image_id = texture_cache.FindImage(desc, find_flags);
if (!image_id) {
return false;
}
Expand Down
3 changes: 1 addition & 2 deletions src/video_core/texture_cache/texture_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,8 @@ ImageId TextureCache::ExpandImage(const ImageInfo& info, ImageId image_id) {
return new_image_id;
}

ImageId TextureCache::FindImage(BaseDesc& desc) {
ImageId TextureCache::FindImage(BaseDesc& desc, FindFlags flags) {
const auto& info = desc.info;
const auto& flags = desc.flags;

if (info.guest_address == 0) [[unlikely]] {
return NULL_IMAGE_ID;
Expand Down
3 changes: 1 addition & 2 deletions src/video_core/texture_cache/texture_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class TextureCache {
ImageInfo info;
ImageViewInfo view_info;
BindingType type{BindingType::Texture};
FindFlags flags{};

BaseDesc() = default;
BaseDesc(BindingType type_, ImageInfo info_, ImageViewInfo view_info_) noexcept
Expand Down Expand Up @@ -106,7 +105,7 @@ class TextureCache {
void UnmapMemory(VAddr cpu_addr, size_t size);

/// Retrieves the image handle of the image with the provided attributes.
[[nodiscard]] ImageId FindImage(BaseDesc& desc);
[[nodiscard]] ImageId FindImage(BaseDesc& desc, FindFlags flags = {});

/// Retrieves an image view with the properties of the specified image id.
[[nodiscard]] ImageView& FindTexture(ImageId image_id, const ImageViewInfo& view_info);
Expand Down

0 comments on commit 3c98534

Please sign in to comment.