Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8513a3b613
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (g_ctx.cmd) { | ||
| SDL_GPUFence *fence = SDL_SubmitGPUCommandBufferAndAcquireFence(g_ctx.cmd); | ||
| SDL_WaitForGPUFences(g_ctx.device, true, &fence, 1); | ||
| SDL_ReleaseGPUFence(g_ctx.device, fence); | ||
| g_ctx.cmd = SDL_AcquireGPUCommandBuffer(g_ctx.device); |
There was a problem hiding this comment.
Wait for in-flight GPU work when no command buffer
On the SDL backend this sync path only blocks when g_ctx.cmd is non-null, but cf_sdlgpu_end_frame clears g_ctx.cmd after submitting the frame (src/cute_graphics_sdlgpu.cpp:884-885), so calling public cf_gpu_sync between frames becomes a no-op even though GPU work may still be running. That violates the documented "GPU/CPU serialization" behavior and can produce incorrect timing/synchronization results compared with the GLES path (glFinish).
Useful? React with 👍 / 👎.
Needed this while timing compute shader dispatches. It's not perfect, but, was useful for some basic wall-clock timing.