mirror of
https://github.com/Eglantine-Community/Eglantine.git
synced 2026-11-23 05:39:37 -10:00
nvn: keep inline uniform updates coherent across flushes and GPU writes
Mario Kart World bakes three-layer RGBA16F animation curves (scale, rotation
quaternion, translation) into a shared 64 KiB UBO by recording four consecutive
nvnCommandBufferUpdateUniformBuffer calls per layer outside a render pass. On a
cold shader cache, pipeline compilation stalled past early_first_us and
MaybeSubmitEarly split the command stream between the layer index update and
later uniform updates. BuildDescriptors then fell back to copying stale guest
memory on the CPU before overlaying only the current inline_updates, leaving a
stale layer index (0 or 2) in Scale/Rotation and scaling Lakitu's cloud to fill
the depth buffer ("gray haze").
Fix the coherence bugs across all paths:
- Avoid splitting pending inline_updates in Recorder::MaybeSubmitEarly when no
render pass is open.
- Flush overlapping inline_updates directly to the pool buffer in
DrawContext::PrepareOutsidePass (BreakCause::InlineUpdate) when outside an
open pass, binding a DeviceLocal pool, overlapping a live storage shadow,
or overlapping uncompleted GPU writes from earlier submissions/non-inline ops.
- Track in-flight GPU pool writes per Context::Impl until gpu_completed_seq (set
in CompleteMain before completion callbacks), retaining exact inline-flushed
bytes for same-submission in-pass overlays across BuildDescriptors,
ReadUniformWord, FreezeOracle, DescribeInputs, AppendBindingDump, and
PathDiffUniformBytes.
- Clear stale MirrorPage::valid/checked state when GPU writes touch a
Pool::Backing::Mirror page so subsequent uploads do not skip pages whose
pre-GPU guest hash happens to match again.
Verified with new Catch2 regressions ([nvn][compute][inline]), existing NVN
draw/Vulkan/barrier/snapshot/sparse suites, 4 headless MKW cold runs + 1 warm
run (69/69 curve triples clean, zero gray haze).
This commit is contained in:
1 parent
6b57d583a2
commit
15b4bde789
15 files changed
+492
-29
No files matched your search
@@ -3875,6 +3875,7 @@ constexpr u64 PROGRAM_UNIFORM = 121; ///< x = c[3][0], the first uniform buffe
|
||||
constexpr u64 PROGRAM_RAW_STORE = 122; ///< stores 5.0f through the raw pointer of its push words
|
||||
constexpr u64 PROGRAM_RAW_ATOMIC = 123; ///< adds `ATOMIC_ADD` to the word of its raw push pointer
|
||||
constexpr u64 PROGRAM_STORAGE_RAW_ATOMIC = 124;
|
||||
constexpr u64 PROGRAM_UNIFORM_XY = 125; ///< x = c[3][0x00], y = c[3][0x10]
|
||||
/// 5.0f - 1/64: added to a vertex word that holds 1/64 it makes 5.0f (the point leaves the screen).
|
||||
constexpr u32 ATOMIC_ADD = 0x04200000;
|
||||
constexpr u32 F32_ONE_64TH = 0x3c800000;
|
||||
@@ -3898,9 +3899,12 @@ constexpr Inst AtomgAdd(u32 rd, u32 ra, u32 rb) {
|
||||
|
||||
struct VertexMirrorRig {
|
||||
VertexMirrorRig(HeadlessVulkan& vulkan, bool vtx_mirror, bool ubo_mirror, u32 vtxcov = 0,
|
||||
std::optional<u64> storage_vram_max_bytes = std::nullopt)
|
||||
std::optional<u64> storage_vram_max_bytes = std::nullopt,
|
||||
u32 vertex_pool_flags = static_cast<u32>(POOL_CPU_CACHED),
|
||||
bool early_submit = true)
|
||||
: context(*vulkan.device, vulkan.submit_mutex, nullptr,
|
||||
{.pool_mirror = 1,
|
||||
{.early_submit = early_submit,
|
||||
.pool_mirror = 1,
|
||||
.try_storage_vram_max_bytes = storage_vram_max_bytes,
|
||||
.vtx_mirror = vtx_mirror,
|
||||
.ubo_mirror = ubo_mirror,
|
||||
@@ -3914,14 +3918,18 @@ struct VertexMirrorRig {
|
||||
context.CreatePool({.serial = 1, .guest_address = POOL_VA, .size = 64_KiB,
|
||||
.flags = POOL_CPU_CACHED});
|
||||
context.CreatePool({.serial = 2, .guest_address = VERTEX_POOL_VA, .size = 64_KiB,
|
||||
.flags = POOL_CPU_CACHED});
|
||||
.flags = vertex_pool_flags});
|
||||
const std::array<Inst, 6> attribute{{AldAttribute(0, 0x80), AddImm(1, 255, 0),
|
||||
AddImm(2, 255, 0), AddImm(3, 255, F32_ONE),
|
||||
AstPositionWord, Exit}};
|
||||
const std::array<Inst, 6> uniform{{MovCb(0, 3, 0), AddImm(1, 255, 0), AddImm(2, 255, 0),
|
||||
AddImm(3, 255, F32_ONE), AstPositionWord, Exit}};
|
||||
const std::array<Inst, 6> uniform_xy{{MovCb(0, 3, 0x00), MovCb(1, 3, 0x10),
|
||||
AddImm(2, 255, 0), AddImm(3, 255, F32_ONE),
|
||||
AstPositionWord, Exit}};
|
||||
context.CreateProgram(MakeVertexProgram(PROGRAM_ATTRIBUTE, attribute));
|
||||
context.CreateProgram(MakeVertexProgram(PROGRAM_UNIFORM, uniform));
|
||||
context.CreateProgram(MakeVertexProgram(PROGRAM_UNIFORM_XY, uniform_xy));
|
||||
const std::array<Inst, 5> raw_store{{MovC0(2, 0x10), MovC0(3, 0x14),
|
||||
AddImm(6, 255, F32_FIVE), Stg(2, 6), Exit}};
|
||||
context.CreateProgram(MakeProgram(PROGRAM_RAW_STORE, raw_store,
|
||||
@@ -3999,6 +4007,36 @@ struct VertexMirrorRig {
|
||||
REQUIRE(context.Wait(seq, 60s));
|
||||
return WordAt(report, report_offset);
|
||||
}
|
||||
u32 SubmitAndCount(std::vector<u64>& list,
|
||||
std::initializer_list<u64> keep = {PROGRAM_UNIFORM_XY, PROGRAM_ATTRIBUTE,
|
||||
PROGRAM_UNIFORM, 1, 2}) {
|
||||
++seq;
|
||||
const u64 report_offset = 0x2000 + 16 * seq;
|
||||
Push(list, VC::Op::ReportCounter,
|
||||
VC::ReportCounterPayload{.address = POOL_VA + report_offset,
|
||||
.counter_type = SAMPLES_PASSED});
|
||||
PushEnd(list);
|
||||
std::vector<u64> ids(keep);
|
||||
context.Submit(MakeSubmission(seq, std::move(list), std::move(ids)));
|
||||
REQUIRE(context.Wait(seq, 60s));
|
||||
return WordAt(report, report_offset);
|
||||
}
|
||||
static void PushTargetSetup(std::vector<u64>& list, u64 program, u64 ubo_offset, u64 ubo_size) {
|
||||
Push(list, VC::Op::SetRenderTargets, VC::SetRenderTargetsPayload{0, 0}, {});
|
||||
const VC::ViewportRect viewport{0.0f, 0.0f, 64.0f, 64.0f};
|
||||
Push(list, VC::Op::SetViewports, VC::SetViewportsPayload{.first = 0, .count = 1},
|
||||
{reinterpret_cast<const u8*>(&viewport), sizeof(viewport)});
|
||||
Push(list, VC::Op::SetPointSize, VC::F32Payload{.value = 1.0f});
|
||||
Push(list, VC::Op::BindProgram,
|
||||
VC::BindProgramPayload{.program_serial = program, .stages = 1u << 0});
|
||||
BindUniform(list, ubo_offset, ubo_size);
|
||||
}
|
||||
static void PushInlineU32(std::vector<u64>& list, u64 address, u32 value) {
|
||||
std::array<u8, sizeof(u32)> bytes{};
|
||||
std::memcpy(bytes.data(), &value, sizeof(value));
|
||||
Push(list, VC::Op::UpdateUniformBuffer,
|
||||
VC::UpdateUniformBufferPayload{address, sizeof(u32)}, bytes);
|
||||
}
|
||||
/// One compute dispatch that stores 5.0f through a raw pointer to `address`.
|
||||
void RawStore(u64 address) {
|
||||
++seq;
|
||||
@@ -4619,3 +4657,185 @@ TEST_CASE("MKW split mirrors observe raw GPU stores before later descriptor read
|
||||
REQUIRE(context.Stats().ops_failed == 0);
|
||||
REQUIRE(context.Stats().ops_unsupported == 0);
|
||||
}
|
||||
|
||||
TEST_CASE("NVN inline uniform: flushed inline update plus later partial update stays coherent",
|
||||
"[nvn][compute][inline]") {
|
||||
auto vulkan = MakeHeadlessVulkan();
|
||||
if (!vulkan) {
|
||||
SKIP("no Vulkan device");
|
||||
}
|
||||
constexpr u64 UBO_OFFSET = 0x5000;
|
||||
constexpr u64 UBO_VA = VERTEX_POOL_VA + UBO_OFFSET;
|
||||
const bool ubo_mirror = GENERATE(false, true);
|
||||
INFO("ubo_mirror " << ubo_mirror);
|
||||
VertexMirrorRig rig(*vulkan, false, ubo_mirror, 0, std::nullopt, POOL_CPU_CACHED, false);
|
||||
|
||||
auto reset_ubo = [&]() {
|
||||
rig.CpuSetVertex(UBO_OFFSET + 0x00, F32_FIVE);
|
||||
rig.CpuSetVertex(UBO_OFFSET + 0x10, F32_FIVE);
|
||||
};
|
||||
|
||||
// Case 1: outside an open pass — flush first inline update mid-submission, then update a
|
||||
// different offset of the same UBO before drawing.
|
||||
reset_ubo();
|
||||
{
|
||||
std::vector<u64> list;
|
||||
VertexMirrorRig::PushTargetSetup(list, PROGRAM_UNIFORM_XY, UBO_OFFSET, 256);
|
||||
VertexMirrorRig::PushInlineU32(list, UBO_VA + 0x00, F32_ONE_64TH);
|
||||
Push(list, VC::Op::CopyBufferToBuffer,
|
||||
VC::CopyBufferToBufferPayload{.src = POOL_VA + 0x1000,
|
||||
.dst = POOL_VA + 0x1100,
|
||||
.size = 16});
|
||||
Push(list, VC::Op::ResetCounter, VC::ResetCounterPayload{.counter_type = SAMPLES_PASSED});
|
||||
VertexMirrorRig::PushInlineU32(list, UBO_VA + 0x10, F32_ONE_64TH);
|
||||
Push(list, VC::Op::Draw,
|
||||
VC::DrawPayload{.mode = 0, .first = 0, .count = 1, .instance_count = 1});
|
||||
CHECK(rig.SubmitAndCount(list) == 1);
|
||||
}
|
||||
|
||||
// Case 2: inside an open pass — first inline update was flushed before the pass, second
|
||||
// update arrives inside the pass; both apply without breaking the open pass.
|
||||
reset_ubo();
|
||||
{
|
||||
const auto break_count = [&]() {
|
||||
std::vector<VC::SinkStat> rows;
|
||||
rig.context.CollectStats(rows);
|
||||
const auto it = std::ranges::find(
|
||||
rows, std::string_view{"render_pass_break: inline uniform update flush"},
|
||||
&VC::SinkStat::reason);
|
||||
return it == rows.end() ? u64{0} : it->count;
|
||||
};
|
||||
const u64 inline_breaks_before = break_count();
|
||||
std::vector<u64> list;
|
||||
VertexMirrorRig::PushTargetSetup(list, PROGRAM_UNIFORM_XY, UBO_OFFSET, 256);
|
||||
VertexMirrorRig::PushInlineU32(list, UBO_VA + 0x00, F32_ONE_64TH);
|
||||
Push(list, VC::Op::CopyBufferToBuffer,
|
||||
VC::CopyBufferToBufferPayload{.src = POOL_VA + 0x1000,
|
||||
.dst = POOL_VA + 0x1100,
|
||||
.size = 16});
|
||||
Push(list, VC::Op::ResetCounter, VC::ResetCounterPayload{.counter_type = SAMPLES_PASSED});
|
||||
// Opens the render pass; +0x10 is still F32_FIVE so this first draw emits 0 samples.
|
||||
Push(list, VC::Op::Draw,
|
||||
VC::DrawPayload{.mode = 0, .first = 0, .count = 1, .instance_count = 1});
|
||||
VertexMirrorRig::PushInlineU32(list, UBO_VA + 0x10, F32_ONE_64TH);
|
||||
// Same open pass must see both +0x00 (flushed inline) and +0x10 (pending inline).
|
||||
Push(list, VC::Op::Draw,
|
||||
VC::DrawPayload{.mode = 0, .first = 0, .count = 1, .instance_count = 1});
|
||||
CHECK(rig.SubmitAndCount(list) == 1);
|
||||
CHECK(break_count() == inline_breaks_before);
|
||||
}
|
||||
|
||||
// Case 3: non-inline GPU write (ClearBuffer at +0x00) + partial UpdateUniformBuffer(+0x10),
|
||||
// both outside a pass and inside an open pass.
|
||||
reset_ubo();
|
||||
{
|
||||
std::vector<u64> list;
|
||||
VertexMirrorRig::PushTargetSetup(list, PROGRAM_UNIFORM_XY, UBO_OFFSET, 256);
|
||||
Push(list, VC::Op::ClearBuffer,
|
||||
VC::ClearBufferPayload{.address = UBO_VA + 0x00, .size = 4, .value = F32_ONE_64TH});
|
||||
Push(list, VC::Op::ResetCounter, VC::ResetCounterPayload{.counter_type = SAMPLES_PASSED});
|
||||
VertexMirrorRig::PushInlineU32(list, UBO_VA + 0x10, F32_ONE_64TH);
|
||||
Push(list, VC::Op::Draw,
|
||||
VC::DrawPayload{.mode = 0, .first = 0, .count = 1, .instance_count = 1});
|
||||
CHECK(rig.SubmitAndCount(list) == 1);
|
||||
}
|
||||
reset_ubo();
|
||||
{
|
||||
std::vector<u64> list;
|
||||
VertexMirrorRig::PushTargetSetup(list, PROGRAM_UNIFORM_XY, UBO_OFFSET, 256);
|
||||
Push(list, VC::Op::ClearBuffer,
|
||||
VC::ClearBufferPayload{.address = UBO_VA + 0x00, .size = 4, .value = F32_ONE_64TH});
|
||||
Push(list, VC::Op::ResetCounter, VC::ResetCounterPayload{.counter_type = SAMPLES_PASSED});
|
||||
Push(list, VC::Op::Draw,
|
||||
VC::DrawPayload{.mode = 0, .first = 0, .count = 1, .instance_count = 1});
|
||||
VertexMirrorRig::PushInlineU32(list, UBO_VA + 0x10, F32_ONE_64TH);
|
||||
Push(list, VC::Op::Draw,
|
||||
VC::DrawPayload{.mode = 0, .first = 0, .count = 1, .instance_count = 1});
|
||||
CHECK(rig.SubmitAndCount(list) == 1);
|
||||
}
|
||||
|
||||
CHECK(rig.context.Stats().ops_failed == 0);
|
||||
CHECK(rig.context.Stats().ops_unsupported == 0);
|
||||
}
|
||||
|
||||
TEST_CASE("NVN inline uniform: DeviceLocal UBO pool sees prior GPU write plus inline update",
|
||||
"[nvn][compute][inline]") {
|
||||
auto vulkan = MakeHeadlessVulkan();
|
||||
if (!vulkan) {
|
||||
SKIP("no Vulkan device");
|
||||
}
|
||||
constexpr u64 UBO_OFFSET = 0x5000;
|
||||
constexpr u64 UBO_VA = VERTEX_POOL_VA + UBO_OFFSET;
|
||||
VertexMirrorRig rig(*vulkan, false, false, 0, std::nullopt, 1 /* POOL_CPU_NO_ACCESS */, false);
|
||||
|
||||
// Outside a pass
|
||||
{
|
||||
std::vector<u64> list;
|
||||
VertexMirrorRig::PushTargetSetup(list, PROGRAM_UNIFORM_XY, UBO_OFFSET, 256);
|
||||
Push(list, VC::Op::ClearBuffer,
|
||||
VC::ClearBufferPayload{.address = UBO_VA + 0x00, .size = 256, .value = F32_FIVE});
|
||||
Push(list, VC::Op::ClearBuffer,
|
||||
VC::ClearBufferPayload{.address = UBO_VA + 0x00, .size = 4, .value = F32_ONE_64TH});
|
||||
Push(list, VC::Op::ResetCounter, VC::ResetCounterPayload{.counter_type = SAMPLES_PASSED});
|
||||
VertexMirrorRig::PushInlineU32(list, UBO_VA + 0x10, F32_ONE_64TH);
|
||||
Push(list, VC::Op::Draw,
|
||||
VC::DrawPayload{.mode = 0, .first = 0, .count = 1, .instance_count = 1});
|
||||
CHECK(rig.SubmitAndCount(list) == 1);
|
||||
}
|
||||
|
||||
// Inside an open pass (must flush inline updates to DeviceLocal buffer)
|
||||
{
|
||||
std::vector<u64> list;
|
||||
VertexMirrorRig::PushTargetSetup(list, PROGRAM_UNIFORM_XY, UBO_OFFSET, 256);
|
||||
Push(list, VC::Op::ClearBuffer,
|
||||
VC::ClearBufferPayload{.address = UBO_VA + 0x00, .size = 256, .value = F32_FIVE});
|
||||
Push(list, VC::Op::ClearBuffer,
|
||||
VC::ClearBufferPayload{.address = UBO_VA + 0x00, .size = 4, .value = F32_ONE_64TH});
|
||||
Push(list, VC::Op::ResetCounter, VC::ResetCounterPayload{.counter_type = SAMPLES_PASSED});
|
||||
Push(list, VC::Op::Draw,
|
||||
VC::DrawPayload{.mode = 0, .first = 0, .count = 1, .instance_count = 1});
|
||||
VertexMirrorRig::PushInlineU32(list, UBO_VA + 0x10, F32_ONE_64TH);
|
||||
Push(list, VC::Op::Draw,
|
||||
VC::DrawPayload{.mode = 0, .first = 0, .count = 1, .instance_count = 1});
|
||||
CHECK(rig.SubmitAndCount(list) == 1);
|
||||
}
|
||||
|
||||
CHECK(rig.context.Stats().ops_failed == 0);
|
||||
CHECK(rig.context.Stats().ops_unsupported == 0);
|
||||
}
|
||||
|
||||
TEST_CASE("NVN inline uniform: early submit does not split pending updates outside an open pass",
|
||||
"[nvn][compute][inline]") {
|
||||
auto vulkan = MakeHeadlessVulkan();
|
||||
if (!vulkan) {
|
||||
SKIP("no Vulkan device");
|
||||
}
|
||||
constexpr u64 UBO_OFFSET = 0x5000;
|
||||
constexpr u64 UBO_VA = VERTEX_POOL_VA + UBO_OFFSET;
|
||||
VertexMirrorRig rig(*vulkan, false, false, 0, std::nullopt, POOL_CPU_CACHED, true);
|
||||
rig.CpuSetVertex(UBO_OFFSET + 0x00, F32_FIVE);
|
||||
rig.CpuSetVertex(UBO_OFFSET + 0x10, F32_FIVE);
|
||||
|
||||
std::vector<u64> list;
|
||||
// Compile PROGRAM_ATTRIBUTE first so elapsed time passes early_first_us before the 32-op check,
|
||||
// then reset the occlusion counter to close the pass, queue one inline update, emit >32
|
||||
// harmless state ops (hitting MaybeSubmitEarly while !PassOpen() && HasInlineUpdates()), queue
|
||||
// the second inline update, and draw.
|
||||
VertexMirrorRig::PushTargetSetup(list, PROGRAM_ATTRIBUTE, UBO_OFFSET, 256);
|
||||
VertexMirrorRig::BindVertices(list);
|
||||
Push(list, VC::Op::Draw,
|
||||
VC::DrawPayload{.mode = 0, .first = 0, .count = 1, .instance_count = 1});
|
||||
Push(list, VC::Op::ResetCounter, VC::ResetCounterPayload{.counter_type = SAMPLES_PASSED});
|
||||
Push(list, VC::Op::BindProgram,
|
||||
VC::BindProgramPayload{.program_serial = PROGRAM_UNIFORM_XY, .stages = 1u << 0});
|
||||
VertexMirrorRig::PushInlineU32(list, UBO_VA + 0x00, F32_ONE_64TH);
|
||||
for (int i = 0; i < 40; ++i) {
|
||||
Push(list, VC::Op::SetPointSize, VC::F32Payload{.value = 1.0f});
|
||||
}
|
||||
VertexMirrorRig::PushInlineU32(list, UBO_VA + 0x10, F32_ONE_64TH);
|
||||
Push(list, VC::Op::Draw,
|
||||
VC::DrawPayload{.mode = 0, .first = 0, .count = 1, .instance_count = 1});
|
||||
CHECK(rig.SubmitAndCount(list) == 1);
|
||||
CHECK(rig.context.Stats().ops_failed == 0);
|
||||
CHECK(rig.context.Stats().ops_unsupported == 0);
|
||||
}
|
||||
@@ -1323,6 +1323,12 @@ void Context::Impl::CompleteMain() {
|
||||
}
|
||||
flight->download.reset();
|
||||
flight->keepalive.clear();
|
||||
{
|
||||
const u64 current = gpu_completed_seq.load(std::memory_order_relaxed);
|
||||
if (flight->seq > current) {
|
||||
gpu_completed_seq.store(flight->seq, std::memory_order_release);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
// Held while the callback runs: SetCompletionCallback({}) therefore waits for a running
|
||||
@@ -2318,4 +2324,130 @@ void Context::CollectStats(std::vector<VideoCommon::Nvn::SinkStat>& out) const {
|
||||
out.push_back({"raw_global_ranges_dropped", s.raw_global_ranges_dropped});
|
||||
}
|
||||
|
||||
static void CollapsePendingPoolWrites(std::vector<Context::Impl::PendingPoolWrite>& writes) {
|
||||
if (writes.size() < 4096) {
|
||||
return;
|
||||
}
|
||||
std::vector<Context::Impl::PendingPoolWrite> collapsed;
|
||||
for (const Context::Impl::PendingPoolWrite& write : writes) {
|
||||
const auto it = std::ranges::find_if(
|
||||
collapsed, [&](const auto& hull) { return hull.seq == write.seq; });
|
||||
if (it == collapsed.end()) {
|
||||
collapsed.push_back({write.begin, write.end, write.seq, {}});
|
||||
} else {
|
||||
it->begin = (std::min)(it->begin, write.begin);
|
||||
it->end = (std::max)(it->end, write.end);
|
||||
}
|
||||
}
|
||||
writes = std::move(collapsed);
|
||||
}
|
||||
|
||||
void Context::Impl::PrunePendingPoolWrites() {
|
||||
const u64 done = gpu_completed_seq.load(std::memory_order_acquire);
|
||||
std::erase_if(pending_pool_writes,
|
||||
[done](const PendingPoolWrite& write) { return write.seq <= done; });
|
||||
}
|
||||
|
||||
void Context::Impl::NoteFlushedInlinePoolWrite(u64 address, const u8* data, u64 size, u64 seq) {
|
||||
if (size == 0 || data == nullptr) {
|
||||
return;
|
||||
}
|
||||
PrunePendingPoolWrites();
|
||||
const u64 end = address + size;
|
||||
std::erase_if(pending_pool_writes, [address, end](const PendingPoolWrite& write) {
|
||||
return write.begin >= address && write.end <= end;
|
||||
});
|
||||
CollapsePendingPoolWrites(pending_pool_writes);
|
||||
pending_pool_writes.push_back(
|
||||
{address, end, seq, std::vector<u8>(data, data + static_cast<size_t>(size))});
|
||||
}
|
||||
|
||||
void Context::Impl::NoteNonInlinePoolWrite(u64 address, u64 size, u64 seq) {
|
||||
if (size == 0 || noting_inline_pool_write) {
|
||||
return;
|
||||
}
|
||||
PrunePendingPoolWrites();
|
||||
const u64 end = address + size;
|
||||
std::erase_if(pending_pool_writes, [address, end](const PendingPoolWrite& write) {
|
||||
return write.begin >= address && write.end <= end;
|
||||
});
|
||||
for (PendingPoolWrite& write : pending_pool_writes) {
|
||||
if (!write.inline_bytes.empty() && write.begin < end && address < write.end) {
|
||||
write.inline_bytes.clear();
|
||||
}
|
||||
}
|
||||
if (!pending_pool_writes.empty()) {
|
||||
PendingPoolWrite& last = pending_pool_writes.back();
|
||||
if (last.seq == seq && last.inline_bytes.empty() && address <= last.end &&
|
||||
last.begin <= end) {
|
||||
last.begin = (std::min)(last.begin, address);
|
||||
last.end = (std::max)(last.end, end);
|
||||
return;
|
||||
}
|
||||
}
|
||||
CollapsePendingPoolWrites(pending_pool_writes);
|
||||
pending_pool_writes.push_back({address, end, seq, {}});
|
||||
}
|
||||
|
||||
void Context::Impl::InvalidatePendingInlineBytes(u64 seq) {
|
||||
PrunePendingPoolWrites();
|
||||
for (PendingPoolWrite& write : pending_pool_writes) {
|
||||
if (seq == 0 || write.seq == seq) {
|
||||
write.inline_bytes.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Context::Impl::InvalidatePendingInlineBytesOverlapping(u64 address, u64 size) {
|
||||
if (size == 0 || pending_pool_writes.empty()) {
|
||||
return;
|
||||
}
|
||||
PrunePendingPoolWrites();
|
||||
const u64 end = address + size;
|
||||
for (PendingPoolWrite& write : pending_pool_writes) {
|
||||
if (!write.inline_bytes.empty() && write.begin < end && address < write.end) {
|
||||
write.inline_bytes.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Context::Impl::ErasePendingPoolWritesForSeq(u64 seq) {
|
||||
std::erase_if(pending_pool_writes,
|
||||
[seq](const PendingPoolWrite& write) { return write.seq == seq; });
|
||||
}
|
||||
|
||||
bool Context::Impl::NeedsGpuFlushForUniform(u64 begin, u64 end, u64 current_seq) {
|
||||
if (end <= begin || pending_pool_writes.empty()) {
|
||||
return false;
|
||||
}
|
||||
PrunePendingPoolWrites();
|
||||
for (const PendingPoolWrite& write : pending_pool_writes) {
|
||||
if (write.begin < end && begin < write.end &&
|
||||
(write.inline_bytes.empty() || write.seq != current_seq)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Context::Impl::ApplyPendingInlineWrites(u64 base_address, u8* dst, u64 size,
|
||||
u64 current_seq) const {
|
||||
if (size == 0 || dst == nullptr || pending_pool_writes.empty()) {
|
||||
return;
|
||||
}
|
||||
const u64 end = base_address + size;
|
||||
for (const PendingPoolWrite& write : pending_pool_writes) {
|
||||
if (write.seq != current_seq || write.inline_bytes.empty()) {
|
||||
continue;
|
||||
}
|
||||
const u64 lo = (std::max)(write.begin, base_address);
|
||||
const u64 hi = (std::min)(write.end, end);
|
||||
if (lo < hi) {
|
||||
std::memcpy(dst + (lo - base_address),
|
||||
write.inline_bytes.data() + (lo - write.begin),
|
||||
static_cast<size_t>(hi - lo));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Vulkan::Nvn
|
||||
@@ -1431,9 +1431,12 @@ void DrawContext::FlushInlineUpdates() {
|
||||
if (usnap.Active()) {
|
||||
++counters.uniform_snapshot_layers;
|
||||
}
|
||||
impl.uniform_snapshots.NoteInlineWrite(update.address, update.data, update.size,
|
||||
host->HostFlight().seq);
|
||||
const u64 seq = host->HostFlight().seq;
|
||||
impl.NoteFlushedInlinePoolWrite(update.address, update.data, update.size, seq);
|
||||
impl.uniform_snapshots.NoteInlineWrite(update.address, update.data, update.size, seq);
|
||||
impl.noting_inline_pool_write = true;
|
||||
host->HostNotePoolWrite(*target.pool, target.pool_offset, update.size);
|
||||
impl.noting_inline_pool_write = false;
|
||||
impl.uniform_snapshots.EndInlineWrite();
|
||||
}
|
||||
}
|
||||
@@ -2463,6 +2466,10 @@ std::optional<u32> DrawContext::ReadUniformWord(u32 stage, u32 slot, u32 byte_of
|
||||
if (!memory || !memory->Read(address, &value, sizeof(value))) {
|
||||
return std::nullopt;
|
||||
}
|
||||
if (host != nullptr) {
|
||||
impl.ApplyPendingInlineWrites(address, reinterpret_cast<u8*>(&value), sizeof(value),
|
||||
host->HostFlight().seq);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
@@ -381,6 +381,9 @@ public:
|
||||
[[nodiscard]] bool HasShadows() const noexcept {
|
||||
return !shadows.empty();
|
||||
}
|
||||
[[nodiscard]] bool HasInlineUpdates() const noexcept {
|
||||
return !inline_updates.empty();
|
||||
}
|
||||
/// UpdateUniformBuffer writes recorded but not copied yet (they land when the pass ends): true
|
||||
/// when one overlaps guest bytes [address, address + size).
|
||||
[[nodiscard]] bool InlineUpdatePending(u64 address, u64 size) const noexcept {
|
||||
@@ -395,6 +398,7 @@ public:
|
||||
/// mirror when it holds the bytes (`ref` is pointed at it), else from guest memory after the
|
||||
/// shadows over the range went back (NoteExtraRead).
|
||||
void ResolveIndirectSource(BufferRef& ref, u64 size);
|
||||
[[nodiscard]] bool HasOverlappingShadow(const Pool& pool, u64 begin, u64 end) const noexcept;
|
||||
|
||||
/// Reads a u32 of a uniform buffer bound to `stage`/`slot` as the draw would see it (inline
|
||||
/// updates applied; from the submission's uniform snapshot when it holds the word).
|
||||
|
||||
@@ -525,17 +525,25 @@ std::unique_ptr<TextureOracle> DrawContext::FreezeOracle(
|
||||
}
|
||||
uniform.bytes.resize(size);
|
||||
uniform.readable.assign((size + FROZEN_CHUNK - 1) / FROZEN_CHUNK, 0);
|
||||
if (ReadSnapshotBytes(binding.address, uniform.bytes.data(), size) ||
|
||||
memory->Read(binding.address, uniform.bytes.data(), size)) {
|
||||
if (ReadSnapshotBytes(binding.address, uniform.bytes.data(), size)) {
|
||||
std::fill(uniform.readable.begin(), uniform.readable.end(), u8{1});
|
||||
} else {
|
||||
for (u64 chunk = 0; chunk < uniform.readable.size(); ++chunk) {
|
||||
const u64 begin = chunk * FROZEN_CHUNK;
|
||||
const u64 length = (std::min)(FROZEN_CHUNK, size - begin);
|
||||
uniform.readable[chunk] =
|
||||
memory->Read(binding.address + begin, uniform.bytes.data() + begin, length)
|
||||
? 1
|
||||
: 0;
|
||||
if (memory->Read(binding.address, uniform.bytes.data(), size)) {
|
||||
std::fill(uniform.readable.begin(), uniform.readable.end(), u8{1});
|
||||
} else {
|
||||
for (u64 chunk = 0; chunk < uniform.readable.size(); ++chunk) {
|
||||
const u64 begin = chunk * FROZEN_CHUNK;
|
||||
const u64 length = (std::min)(FROZEN_CHUNK, size - begin);
|
||||
uniform.readable[chunk] =
|
||||
memory->Read(binding.address + begin, uniform.bytes.data() + begin,
|
||||
length)
|
||||
? 1
|
||||
: 0;
|
||||
}
|
||||
}
|
||||
if (host != nullptr) {
|
||||
impl.ApplyPendingInlineWrites(binding.address, uniform.bytes.data(), size,
|
||||
host->HostFlight().seq);
|
||||
}
|
||||
}
|
||||
// Inline updates of this submission are newer than guest memory; the last one wins.
|
||||
@@ -1037,11 +1045,23 @@ bool DrawContext::BuildDescriptors(PipelineBase& pipe, DrawPlan& plan, bool grap
|
||||
}
|
||||
}
|
||||
const bool misaligned = resolved && uniform && (ref.offset % 256) != 0;
|
||||
const u64 current_seq = host->HostFlight().seq;
|
||||
bool flush_inline_to_pool = false;
|
||||
if (overlaps && !misaligned && resolved && !write &&
|
||||
snapshot_range == UniformSnapshotView::npos) {
|
||||
if (!pass_open || ref.pool->backing == Pool::Backing::DeviceLocal ||
|
||||
HasOverlappingShadow(*ref.pool, ref.pool_offset, ref.pool_offset + size) ||
|
||||
impl.NeedsGpuFlushForUniform(binding.address, binding.address + size, current_seq)) {
|
||||
flush_inline_to_pool = true;
|
||||
plan.flush_inline = true;
|
||||
}
|
||||
}
|
||||
const bool use_private_copy = (overlaps && !flush_inline_to_pool) || misaligned;
|
||||
if (cs_mode != CostSplit::Mode::Count) [[unlikely]] {
|
||||
CostSplitNote(uniform ? CostSplit::Data::Uniform : CostSplit::Data::Storage, ref, size,
|
||||
overlaps || misaligned);
|
||||
use_private_copy);
|
||||
}
|
||||
if (overlaps || misaligned) {
|
||||
if (use_private_copy) {
|
||||
if (write) {
|
||||
host->HostUnsupported("Draw", "storage buffer under an inline uniform update");
|
||||
}
|
||||
@@ -1049,13 +1069,16 @@ bool DrawContext::BuildDescriptors(PipelineBase& pipe, DrawPlan& plan, bool grap
|
||||
u8* pointer = nullptr;
|
||||
const BufferRef copy = AllocArena(size, 256, &pointer);
|
||||
if (copy.buffer) {
|
||||
const u8* source = snapshot_range != UniformSnapshotView::npos
|
||||
? usnap.Bytes(snapshot_range, binding.address)
|
||||
: impl.GuestPointer(binding.address, size);
|
||||
if (source) {
|
||||
std::memcpy(pointer, source, size);
|
||||
if (snapshot_range != UniformSnapshotView::npos) {
|
||||
std::memcpy(pointer, usnap.Bytes(snapshot_range, binding.address), size);
|
||||
} else {
|
||||
std::memset(pointer, 0, size);
|
||||
if (const u8* source = impl.GuestPointer(binding.address, size)) {
|
||||
std::memcpy(pointer, source, size);
|
||||
} else if (VC::GuestMemory* memory = impl.guest.load(std::memory_order_acquire);
|
||||
!memory || !memory->Read(binding.address, pointer, size)) {
|
||||
std::memset(pointer, 0, size);
|
||||
}
|
||||
impl.ApplyPendingInlineWrites(binding.address, pointer, size, current_seq);
|
||||
}
|
||||
for (const InlineUpdate& update : inline_updates) {
|
||||
const u64 begin = (std::max)(update.address, binding.address);
|
||||
@@ -1760,6 +1783,12 @@ bool DrawContext::PrepareOutsidePass(DrawPlan& plan) {
|
||||
need = true;
|
||||
}
|
||||
}
|
||||
if (plan.flush_inline && !inline_updates.empty()) {
|
||||
if (!need) {
|
||||
cause = BreakCause::InlineUpdate;
|
||||
}
|
||||
need = true;
|
||||
}
|
||||
// Storage shadows: a use of the plan that the live shadows cannot serve ends the pass (the
|
||||
// shadow is copied back outside it).
|
||||
ShadowDecision shadow;
|
||||
@@ -1791,6 +1820,9 @@ bool DrawContext::PrepareOutsidePass(DrawPlan& plan) {
|
||||
EndPass(cause);
|
||||
}
|
||||
if (!pass_open) {
|
||||
if (plan.flush_inline && !inline_updates.empty()) {
|
||||
FlushInlineUpdates();
|
||||
}
|
||||
RecordFeedbackCopies(plan);
|
||||
transition_scratch.clear();
|
||||
for (DrawPlan::ImageUse& use : plan.images) {
|
||||
|
||||
@@ -186,6 +186,10 @@ std::string DrawContext::DescribeInputs(const PipelineBase* logged_pipeline, boo
|
||||
memory->Read(binding.address + begin, bytes.data() + begin, length) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
if (host != nullptr) {
|
||||
impl.ApplyPendingInlineWrites(binding.address, bytes.data(), want,
|
||||
host->HostFlight().seq);
|
||||
}
|
||||
for (const InlineUpdate& update : inline_updates) {
|
||||
const u64 lo = (std::max)(update.address, binding.address);
|
||||
const u64 hi = (std::min)(update.address + update.size, binding.address + want);
|
||||
|
||||
@@ -99,6 +99,8 @@ struct DrawPlan {
|
||||
bool raw_stores_written_through{false};
|
||||
/// The pipeline writes a bound storage image.
|
||||
bool image_writes{false};
|
||||
/// An overlapping inline uniform update must flush to the GPU pool before the draw.
|
||||
bool flush_inline{false};
|
||||
/// Resolution scaling: which texture and storage image descriptors (in the order of the
|
||||
/// pipeline's stages) the draw binds the scaled twin of (Rescale::Words).
|
||||
Rescale::Words rescale_words;
|
||||
@@ -115,6 +117,7 @@ struct DrawPlan {
|
||||
raw_global = false;
|
||||
shadow_candidates = false;
|
||||
image_writes = false;
|
||||
flush_inline = false;
|
||||
rescale_words.Clear();
|
||||
}
|
||||
void UseImage(const std::shared_ptr<Storage>& storage, VkImageLayout layout,
|
||||
|
||||
@@ -126,6 +126,10 @@ void DrawContext::AppendBindingDump(std::string& text, const PipelineBase& pipe)
|
||||
readable = true;
|
||||
} else {
|
||||
read_guest();
|
||||
if (host != nullptr) {
|
||||
impl.ApplyPendingInlineWrites(game.address, bytes.data(), bytes.size(),
|
||||
host->HostFlight().seq);
|
||||
}
|
||||
}
|
||||
const bool inline_updates_pending = InlineUpdatePending(game.address, size);
|
||||
const bool copied = inline_updates_pending || snapshot == UniformSnapshotView::npos;
|
||||
|
||||
@@ -173,6 +173,7 @@ enum class BreakCause : u32 {
|
||||
ShadowAlias, ///< a storage range shadowed in device memory is used another way (host copy stale)
|
||||
ReportRead, ///< a draw uses memory a counter report of the pass writes (in-pass queries)
|
||||
MeshIndirectConvert, ///< 1D mesh-task arguments are rewritten as VkDrawMeshTasksIndirectCommandEXT
|
||||
InlineUpdate, ///< pending inline uniform updates flushed to GPU pool memory
|
||||
SegmentEnd, ///< the command buffer ends
|
||||
Other,
|
||||
Count,
|
||||
@@ -218,6 +219,8 @@ enum class BreakCause : u32 {
|
||||
return "draw reads a counter report of its pass";
|
||||
case BreakCause::MeshIndirectConvert:
|
||||
return "mesh indirect argument conversion";
|
||||
case BreakCause::InlineUpdate:
|
||||
return "inline uniform update flush";
|
||||
default:
|
||||
return "other";
|
||||
}
|
||||
|
||||
@@ -864,6 +864,15 @@ void DrawContext::FlushShadowsOverlapping(const Pool& pool, u64 offset, u64 size
|
||||
}
|
||||
}
|
||||
|
||||
bool DrawContext::HasOverlappingShadow(const Pool& pool, u64 begin, u64 end) const noexcept {
|
||||
for (const Shadow& shadow : shadows) {
|
||||
if (shadow.pool == &pool && Overlaps(begin, end, shadow.begin, shadow.end)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void DrawContext::NoteExtraRead(const BufferRef& ref, u64 size) {
|
||||
if (ref.pool != nullptr && ref.pool->backing == Pool::Backing::Imported &&
|
||||
(Debug::Get().shadow_storage || impl.pool_mirror_mode != 0)) {
|
||||
|
||||
@@ -359,6 +359,7 @@ public:
|
||||
flight.seq);
|
||||
}
|
||||
void HostNoteShadowedWrite(const Pool& pool, u64 offset, u64 size) override {
|
||||
impl.NoteNonInlinePoolWrite(pool.address + offset, size, flight.seq);
|
||||
// The pool bytes take these writes when the shadow is copied back; a later condition on
|
||||
// them would copy it back first (ResolvePoolRange), a predicate computed now would not.
|
||||
condition_prefetch.Invalidate(pool, offset, size);
|
||||
@@ -1017,6 +1018,7 @@ void Recorder::Abort() {
|
||||
for (const auto& storage : touched) {
|
||||
storage->current_layout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||
}
|
||||
impl.ErasePendingPoolWritesForSeq(flight.seq);
|
||||
// Pool mirror pages this submission was to copy in (and GPU writes it was to make there and
|
||||
// merge back) never happened: no mirror page is known to be current.
|
||||
impl.MirrorInvalidateAll();
|
||||
@@ -1363,14 +1365,21 @@ void Recorder::UploadRange(Pool& pool, u64 offset, u64 size) {
|
||||
continue; // UploadRange would discard this whole page while the GPU owns it.
|
||||
}
|
||||
const bool settled = tracked && coverage == MirrorWriteCoverage::None;
|
||||
const bool partial_gpu = coverage == MirrorWriteCoverage::Partial;
|
||||
++hashed;
|
||||
const u64 hash = GuestPageHash(pool, index);
|
||||
const bool changed = !page.valid || page.hash != hash;
|
||||
page.hash = hash;
|
||||
page.valid = true;
|
||||
page.checked = stamp;
|
||||
page.raw_epoch = pool.split_raw_epoch_seen;
|
||||
page.trusted = settled;
|
||||
if (!partial_gpu) {
|
||||
page.hash = hash;
|
||||
page.valid = true;
|
||||
page.checked = stamp;
|
||||
page.raw_epoch = pool.split_raw_epoch_seen;
|
||||
page.trusted = settled;
|
||||
} else {
|
||||
page.valid = false;
|
||||
page.checked = 0;
|
||||
page.trusted = false;
|
||||
}
|
||||
if (!changed) {
|
||||
continue;
|
||||
}
|
||||
@@ -1446,6 +1455,7 @@ void Recorder::UploadRange(Pool& pool, u64 offset, u64 size) {
|
||||
}
|
||||
|
||||
void Recorder::NotePoolWrite(Pool& pool, u64 offset, u64 size, bool invalidate_mirror) {
|
||||
impl.NoteNonInlinePoolWrite(pool.address + offset, size, flight.seq);
|
||||
if (impl.invalidate_wait_ms != 0) {
|
||||
// Where a guest invalidate has to wait for this submission (nvn_gpu_writes.h).
|
||||
impl.gpu_writes.Note(pool.address + offset, pool.address + offset + size, flight.seq,
|
||||
@@ -1475,7 +1485,10 @@ void Recorder::NotePoolWrite(Pool& pool, u64 offset, u64 size, bool invalidate_m
|
||||
if (size != 0 && offset < pool.size) {
|
||||
const u64 end = (std::min)(offset + size, pool.size);
|
||||
for (u64 page = offset / Pool::MIRROR_PAGE; page * Pool::MIRROR_PAGE < end; ++page) {
|
||||
pool.mirror_pages[static_cast<size_t>(page)].trusted = false;
|
||||
Pool::MirrorPage& mirror_page = pool.mirror_pages[static_cast<size_t>(page)];
|
||||
mirror_page.trusted = false;
|
||||
mirror_page.valid = false;
|
||||
mirror_page.checked = 0;
|
||||
}
|
||||
}
|
||||
dirty_pool_set.insert(&pool);
|
||||
@@ -6369,7 +6382,8 @@ void Recorder::FlushAndWait() {
|
||||
|
||||
void Recorder::MaybeSubmitEarly() {
|
||||
const Debug::Config& config = Debug::Get();
|
||||
if (config.early_interval_us == 0 || !impl.options.early_submit || finished || condition_open) {
|
||||
if (config.early_interval_us == 0 || !impl.options.early_submit || finished || condition_open ||
|
||||
(!draw.PassOpen() && draw.HasInlineUpdates())) {
|
||||
return;
|
||||
}
|
||||
if (impl.mkw_coalesce_early_submit && early_pieces >= 2) {
|
||||
|
||||
@@ -846,6 +846,9 @@ struct Context::Impl {
|
||||
std::mutex failure_mutex; ///< Held while failure_callback runs (and while it is replaced).
|
||||
bool stopping{false};
|
||||
std::atomic<u64> completed_seq{0};
|
||||
/// Newest submission whose GPU commands and mirror readbacks have finished (published right
|
||||
/// before `completion_callback`, whereas `completed_seq` is published right after it).
|
||||
std::atomic<u64> gpu_completed_seq{0};
|
||||
/// What the replay thread is doing (diagnostics only).
|
||||
std::atomic<const char*> replay_stage{"starting"};
|
||||
std::atomic<u64> replay_seq{0};
|
||||
@@ -1011,6 +1014,27 @@ struct Context::Impl {
|
||||
/// GPU writes against the submit-time uniform copies (nvn_uniform_snapshot.h). Replay thread
|
||||
/// only; declared before the draw contexts and streams that refer to it.
|
||||
UniformSnapshotTracker uniform_snapshots;
|
||||
/// Uncompleted GPU buffer writes recorded on the replay thread, kept until `gpu_completed_seq`
|
||||
/// passes their submission. When `inline_bytes` is non-empty, it holds the exact bytes copied
|
||||
/// by `DrawContext::FlushInlineUpdates` so same-submission in-pass private uniform copies can
|
||||
/// overlay them without breaking the render pass; when empty, the write is non-inline (or
|
||||
/// invalidated by a CPU write / WaitEvent) and overlapping uniform draws flush on the GPU.
|
||||
struct PendingPoolWrite {
|
||||
u64 begin;
|
||||
u64 end;
|
||||
u64 seq;
|
||||
std::vector<u8> inline_bytes;
|
||||
};
|
||||
std::vector<PendingPoolWrite> pending_pool_writes;
|
||||
bool noting_inline_pool_write{false};
|
||||
void PrunePendingPoolWrites();
|
||||
void NoteFlushedInlinePoolWrite(u64 address, const u8* data, u64 size, u64 seq);
|
||||
void NoteNonInlinePoolWrite(u64 address, u64 size, u64 seq);
|
||||
void InvalidatePendingInlineBytes(u64 seq);
|
||||
void InvalidatePendingInlineBytesOverlapping(u64 address, u64 size);
|
||||
void ErasePendingPoolWritesForSeq(u64 seq);
|
||||
[[nodiscard]] bool NeedsGpuFlushForUniform(u64 begin, u64 end, u64 current_seq);
|
||||
void ApplyPendingInlineWrites(u64 base_address, u8* dst, u64 size, u64 current_seq) const;
|
||||
/// Draw state per NVN queue index (it persists across submissions on a queue).
|
||||
std::map<u32, std::unique_ptr<DrawContext>> draw_contexts;
|
||||
std::map<u32, QueueState> queues;
|
||||
|
||||
@@ -54,6 +54,9 @@ std::vector<u8> DrawContext::PathDiffUniformBytes(u64 address, u64 size) const {
|
||||
if (const u8* source = impl.GuestPointer(address, size)) {
|
||||
std::memcpy(bytes.data(), source, size);
|
||||
}
|
||||
if (host != nullptr) {
|
||||
impl.ApplyPendingInlineWrites(address, bytes.data(), size, host->HostFlight().seq);
|
||||
}
|
||||
for (const InlineUpdate& update : inline_updates) {
|
||||
const u64 begin = (std::max)(update.address, address);
|
||||
const u64 end = (std::min)(update.address + update.size, address + size);
|
||||
|
||||
@@ -846,6 +846,7 @@ void Context::Impl::NotifyCpuWriteNow(u64 address, u64 size, bool host_write) {
|
||||
}
|
||||
// Live storage shadows are normally authoritative until their segment ends. Refresh only the
|
||||
// CPU-written overlap before either a whole-shadow copy-back or a mirror word-merge.
|
||||
InvalidatePendingInlineBytesOverlapping(address, size);
|
||||
for (const auto& [run_begin, run_end] : runs) {
|
||||
for (auto& [owner_queue, draw] : draw_contexts) {
|
||||
static_cast<void>(owner_queue);
|
||||
|
||||
@@ -327,6 +327,9 @@ std::optional<VkDescriptorBufferInfo> DrawContext::SnapshotUniform(size_t index,
|
||||
|
||||
void DrawContext::OnEventWaitPassed(u64 event_address) {
|
||||
impl.uniform_snapshots.OnEventWait(usnap, event_address);
|
||||
if (host != nullptr) {
|
||||
impl.InvalidatePendingInlineBytes(host->HostFlight().seq);
|
||||
}
|
||||
}
|
||||
|
||||
bool DrawContext::ReadSnapshotBytes(u64 address, void* out, u64 size) const {
|
||||
|
||||
Reference in new issue
Block a user