Skip to content

Commit

Permalink
vk_compute_pipeline: Add missed meta check
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelthegreat committed Oct 26, 2024
1 parent 7702ceb commit 47e9977
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/video_core/renderer_vulkan/vk_compute_pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,33 @@ bool ComputePipeline::BindResources(VideoCore::BufferCache& buffer_cache,
// we can skip the whole dispatch and update the tracked state instead. Also, it is not
// intended to be consumed and in such rare cases (e.g. HTile introspection, CRAA) we
// will need its full emulation anyways. For cases of metadata read a warning will be logged.
for (const auto& desc : info->texture_buffers) {
const auto IsMetaUpdate = [&](const auto& desc) {
const VAddr address = desc.GetSharp(*info).base_address;
if (desc.is_written) {
if (texture_cache.TouchMeta(address, true)) {
LOG_TRACE(Render_Vulkan, "Metadata update skipped");
return false;
return true;
}
} else {
if (texture_cache.IsMeta(address)) {
LOG_WARNING(Render_Vulkan, "Unexpected metadata read by a CS shader (buffer)");
}
}
return false;
};

for (const auto& desc : info->buffers) {
if (desc.is_gds_buffer) {
continue;
}
if (IsMetaUpdate(desc)) {
return false;
}
}
for (const auto& desc : info->texture_buffers) {
if (IsMetaUpdate(desc)) {
return false;
}
}

BindBuffers(buffer_cache, texture_cache, *info, binding, push_data, set_writes,
Expand Down

0 comments on commit 47e9977

Please sign in to comment.