Remove from_compute check in texture cache invalidation (#665)
* Remove from_compute check in texture cache invalidation (hack) * Remove from_compute parameter --------- Co-authored-by: Adam Jones <a.c.jones@outlook.com>
This commit is contained in:
parent
68fa5e292f
commit
0f87d1e3d4
|
@ -127,7 +127,7 @@ bool ComputePipeline::BindResources(VideoCore::BufferCache& buffer_cache,
|
||||||
}
|
}
|
||||||
const u32 size = vsharp.GetSize();
|
const u32 size = vsharp.GetSize();
|
||||||
if (desc.is_written) {
|
if (desc.is_written) {
|
||||||
texture_cache.InvalidateMemory(address, size, true);
|
texture_cache.InvalidateMemory(address, size);
|
||||||
}
|
}
|
||||||
const u32 alignment =
|
const u32 alignment =
|
||||||
is_storage ? instance.StorageMinAlignment() : instance.UniformMinAlignment();
|
is_storage ? instance.StorageMinAlignment() : instance.UniformMinAlignment();
|
||||||
|
@ -167,7 +167,7 @@ bool ComputePipeline::BindResources(VideoCore::BufferCache& buffer_cache,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (desc.is_written) {
|
if (desc.is_written) {
|
||||||
texture_cache.InvalidateMemory(address, size, true);
|
texture_cache.InvalidateMemory(address, size);
|
||||||
}
|
}
|
||||||
const u32 alignment = instance.TexelBufferMinAlignment();
|
const u32 alignment = instance.TexelBufferMinAlignment();
|
||||||
const auto [vk_buffer, offset] =
|
const auto [vk_buffer, offset] =
|
||||||
|
|
|
@ -34,10 +34,10 @@ TextureCache::TextureCache(const Vulkan::Instance& instance_, Vulkan::Scheduler&
|
||||||
|
|
||||||
TextureCache::~TextureCache() = default;
|
TextureCache::~TextureCache() = default;
|
||||||
|
|
||||||
void TextureCache::InvalidateMemory(VAddr address, size_t size, bool from_compute) {
|
void TextureCache::InvalidateMemory(VAddr address, size_t size) {
|
||||||
std::unique_lock lock{mutex};
|
std::unique_lock lock{mutex};
|
||||||
ForEachImageInRegion(address, size, [&](ImageId image_id, Image& image) {
|
ForEachImageInRegion(address, size, [&](ImageId image_id, Image& image) {
|
||||||
if (from_compute && !image.Overlaps(address, size)) {
|
if (!image.Overlaps(address, size)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Ensure image is reuploaded when accessed again.
|
// Ensure image is reuploaded when accessed again.
|
||||||
|
|
|
@ -38,7 +38,7 @@ public:
|
||||||
~TextureCache();
|
~TextureCache();
|
||||||
|
|
||||||
/// Invalidates any image in the logical page range.
|
/// Invalidates any image in the logical page range.
|
||||||
void InvalidateMemory(VAddr address, size_t size, bool from_compute = false);
|
void InvalidateMemory(VAddr address, size_t size);
|
||||||
|
|
||||||
/// Evicts any images that overlap the unmapped range.
|
/// Evicts any images that overlap the unmapped range.
|
||||||
void UnmapMemory(VAddr cpu_addr, size_t size);
|
void UnmapMemory(VAddr cpu_addr, size_t size);
|
||||||
|
|
Loading…
Reference in New Issue