Skip to content

Commit dc5b856

Browse files
vk_compute_pipeline: Add missed meta check
1 parent 7702ceb commit dc5b856

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ endif()
3333

3434
option(ENABLE_QT_GUI "Enable the Qt GUI. If not selected then the emulator uses a minimal SDL-based UI instead" OFF)
3535
option(ENABLE_DISCORD_RPC "Enable the Discord RPC integration" ON)
36-
CMAKE_DEPENDENT_OPTION(ENABLE_USERFAULTFD "Enable write tracking using userfaultfd on unix" ON "NOT LINUX OR APPLE" OFF)
36+
option(ENABLE_USERFAULTFD "Enable write tracking using userfaultfd on unix" OFF)
3737

3838
# First, determine whether to use CMAKE_OSX_ARCHITECTURES or CMAKE_SYSTEM_PROCESSOR.
3939
if (APPLE AND CMAKE_OSX_ARCHITECTURES)

src/video_core/renderer_vulkan/vk_compute_pipeline.cpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,18 +127,33 @@ bool ComputePipeline::BindResources(VideoCore::BufferCache& buffer_cache,
127127
// we can skip the whole dispatch and update the tracked state instead. Also, it is not
128128
// intended to be consumed and in such rare cases (e.g. HTile introspection, CRAA) we
129129
// will need its full emulation anyways. For cases of metadata read a warning will be logged.
130-
for (const auto& desc : info->texture_buffers) {
130+
const auto IsMetaUpdate = [&](const auto& desc) {
131131
const VAddr address = desc.GetSharp(*info).base_address;
132132
if (desc.is_written) {
133133
if (texture_cache.TouchMeta(address, true)) {
134134
LOG_TRACE(Render_Vulkan, "Metadata update skipped");
135-
return false;
135+
return true;
136136
}
137137
} else {
138138
if (texture_cache.IsMeta(address)) {
139139
LOG_WARNING(Render_Vulkan, "Unexpected metadata read by a CS shader (buffer)");
140140
}
141141
}
142+
return false;
143+
};
144+
145+
for (const auto& desc : info->buffers) {
146+
if (desc.is_gds_buffer) {
147+
continue;
148+
}
149+
if (IsMetaUpdate(desc)) {
150+
return false;
151+
}
152+
}
153+
for (const auto& desc : info->texture_buffers) {
154+
if (IsMetaUpdate(desc)) {
155+
return false;
156+
}
142157
}
143158

144159
BindBuffers(buffer_cache, texture_cache, *info, binding, push_data, set_writes,

0 commit comments

Comments
 (0)