Skip to content

Commit 941a668

Browse files
committed
hot-fix: obtain cmdbuf for dispatches after cache ops
This fixes cmdbuf being in incorrect state after scheduler rotation on flush
1 parent 9524f94 commit 941a668

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/video_core/renderer_vulkan/vk_rasterizer.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@ void Rasterizer::DrawIndirect(bool is_indexed, VAddr arg_address, u32 offset, u3
312312
void Rasterizer::DispatchDirect() {
313313
RENDERER_TRACE;
314314

315-
const auto cmdbuf = scheduler.CommandBuffer();
316315
const auto& cs_program = liverpool->regs.cs_program;
317316
const ComputePipeline* pipeline = pipeline_cache.GetComputePipeline();
318317
if (!pipeline) {
@@ -324,6 +323,8 @@ void Rasterizer::DispatchDirect() {
324323
}
325324

326325
scheduler.EndRendering();
326+
327+
const auto cmdbuf = scheduler.CommandBuffer();
327328
cmdbuf.bindPipeline(vk::PipelineBindPoint::eCompute, pipeline->Handle());
328329
cmdbuf.dispatch(cs_program.dim_x, cs_program.dim_y, cs_program.dim_z);
329330

@@ -333,7 +334,6 @@ void Rasterizer::DispatchDirect() {
333334
void Rasterizer::DispatchIndirect(VAddr address, u32 offset, u32 size) {
334335
RENDERER_TRACE;
335336

336-
const auto cmdbuf = scheduler.CommandBuffer();
337337
const auto& cs_program = liverpool->regs.cs_program;
338338
const ComputePipeline* pipeline = pipeline_cache.GetComputePipeline();
339339
if (!pipeline) {
@@ -345,8 +345,11 @@ void Rasterizer::DispatchIndirect(VAddr address, u32 offset, u32 size) {
345345
}
346346

347347
scheduler.EndRendering();
348-
cmdbuf.bindPipeline(vk::PipelineBindPoint::eCompute, pipeline->Handle());
348+
349349
const auto [buffer, base] = buffer_cache.ObtainBuffer(address + offset, size, false);
350+
351+
const auto cmdbuf = scheduler.CommandBuffer();
352+
cmdbuf.bindPipeline(vk::PipelineBindPoint::eCompute, pipeline->Handle());
350353
cmdbuf.dispatchIndirect(buffer->Handle(), base);
351354

352355
ResetBindings();

0 commit comments

Comments
 (0)