• Advertisement
Sign in to follow this  

UpdateSubresource usage

This topic is 1883 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am using Chromium Embedded Framework (CEF1) to run my user interface. I have a 2D texture, it's size matching the screen resolution, that will be updated at a constant rate (30 times per second) regardless of framerate. I will then render a quad on top of the scene with this "interface texture". From the reading and research I have done, UpdateSubresource is what I should use to accomplish this.

This is the function that is called when it is time to update the interface data:

void OnPaint(CefRefPtr<CefBrowser> Browser, PaintElementType Type, const RectList&amp; DirtyRects, const void* pBuffer)


pBuffer is the entire updated image data. DirtyRects is a list of the pixels that have changed since the last call to this function.

Is it wise to make multiple calls to UpdateSubresource() per update to change just the DirtyRects, or should I just make one call to UpdateSubresource() and update the entire texture with pBuffer? Would Map/Unmap be a better option for handling the DirtyRects option?

I ask this because the size of the list of DirtyRects will obviously vary widely per call. Thanks in advance. Edited by Deortuka

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement