Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. did u use video memory before?

did u use video memory before?

Scheduled Pinned Locked Moved C / C++ / MFC
questiongraphicsgame-devperformancehelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    includeh10
    wrote on last edited by
    #1

    there are 2 buffers (size= 1 MB) in my app. one buffer is in video memory (get by DirectX), another one is in system memory (by new). if copy from system buffer -> video buffer, time=15 ms if copy from video buffer -> system buffer, time=180 ms my question is: why is it so slow from video to system memory? how to solve the problem? thanks includeh10

    A 1 Reply Last reply
    0
    • I includeh10

      there are 2 buffers (size= 1 MB) in my app. one buffer is in video memory (get by DirectX), another one is in system memory (by new). if copy from system buffer -> video buffer, time=15 ms if copy from video buffer -> system buffer, time=180 ms my question is: why is it so slow from video to system memory? how to solve the problem? thanks includeh10

      A Offline
      A Offline
      antlers
      wrote on last edited by
      #2

      It's very common for reads from the video buffer to be slow. The details of why depends on your specific hardware and directx driver. In general terms the video buffer is not just another block of RAM; after you are done writing to it, it may not contain exactly what you put in yet (or ever). DirectX tries to hide these details, but when you read from video memory it has to make everything synch up so it behaves like you expected it to. The most common workaround is to rework your application so it does not have to read from the video buffer. It's seldom absolutely necessary.

      I 1 Reply Last reply
      0
      • A antlers

        It's very common for reads from the video buffer to be slow. The details of why depends on your specific hardware and directx driver. In general terms the video buffer is not just another block of RAM; after you are done writing to it, it may not contain exactly what you put in yet (or ever). DirectX tries to hide these details, but when you read from video memory it has to make everything synch up so it behaves like you expected it to. The most common workaround is to rework your application so it does not have to read from the video buffer. It's seldom absolutely necessary.

        I Offline
        I Offline
        includeh10
        wrote on last edited by
        #3

        Hi antlers, what i need is just "read from video memory". i don't need 'write to video memory'. it can be assumed as a screen capture. my process is 1. use surface->Lock to get video buffer 2. copy the buffer to system memory u say 'it does not have to read from the video buffer', could u give me some details for re-working my app? (the app is in realtime, speed is important, so i use DirectX) thanks. includeh10

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups