Code Monkey home page Code Monkey logo

Comments (6)

Novum avatar Novum commented on July 17, 2024

I'm not sure if I understand. The lightmap only needs to be uploaded before the command buffer is executing on the GPU in the next frame. Is that not the case?

from vkquake.

airlied avatar airlied commented on July 17, 2024

Oh so the lightmap update lags by a frame, oh if so then it it's fine, I though it was update the lightmap for the current frame and thus failing to actually upload it.

from vkquake.

Novum avatar Novum commented on July 17, 2024

Define "current frame"?

GPU rendering is inherently asynchronous. While the CPU is recording command buffers for the next frame, the GPU is executing the ones recorded a frame earlier.

This also includes the DMA transfers executed by the GPU to upload the lightmap. Essentially vkCmd* calls do nothing until vkQueueSubmit (and even then are only queued and might not execute immediately).

from vkquake.

airlied avatar airlied commented on July 17, 2024

So in this case you are preparing two command buffers, one staging to upload the lightmap, and one main command buffer. The staging command buffer doesn't get submitted before the main command buffer does. So current frame I mean what the CPU is going to submit next.

So current order is

  • frame 1
    Submit Staging
    Update Staging with lightmap
    Submit Main Command
  • frame 2
    Submit Staging

The staging lightmap update won't have any effect on the current main command buffer being uploaded.

If that is how quake works, that is fine, it just seemed confusing to be updating the lightmap mid-frame when the results aren't used until next frame.

from vkquake.

Novum avatar Novum commented on July 17, 2024

I will double check the logic if I find time. If there is an issue it would just delay the update by a frame.

from vkquake.

Novum avatar Novum commented on July 17, 2024

You are right, the buffer submit has to be done in end frame, not begin frame. No idea what I was thinking there. Fixed by a6dbe10

from vkquake.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.