Support raw buffer writes to sampled textures

This commit is contained in:
nmzik committed 2026-07-17 07:26:42 +02:00
1 parent 3726b0ae22
commit 13499502c9
3 files changed
+29 -9

No files matched your search

@@ -704,20 +704,20 @@ std::pair<VulkanBuffer*, uint64_t> BufferCache::ObtainBuffer(CommandBuffer* com
}
// Cache allocations are tracker-page aligned, but byte-disjoint buffers and images may share
// an edge page. Clean read-only buffer and image views may coexist; Kyty retains a hard failure
// when either cache owns newer GPU bytes. Only a formatted buffer write
// performs the image ownership transition below.
// when either cache owns newer GPU bytes. Writable buffers delegate the ownership transition
// to TextureCache, which distinguishes raw texture-data writes from formatted target paths.
if (m_texture_cache->HasPageOverlap(begin, end - begin) &&
m_texture_cache->HasRangeOverlap(vaddr, size)) {
const bool coherent_read = is_read && !is_written &&
!m_memory_tracker.IsRegionGpuModified(vaddr, size) &&
!m_texture_cache->HasGpuModifiedRangeOverlap(vaddr, size);
if (!coherent_read) {
if (!is_written || !is_formatted) {
if (!is_written) {
EXIT("BufferCache: unsupported buffer/image alias, addr=0x%016" PRIx64
" size=0x%016" PRIx64 " read=%d written=%d formatted=%d\n",
vaddr, size, is_read, is_written, is_formatted);
}
(void)m_texture_cache->InvalidateMemoryFromGPU(vaddr, size, true);
(void)m_texture_cache->InvalidateMemoryFromGPU(vaddr, size, is_formatted);
}
}
if (is_written) {