UpdateSubresource usage

Started by
-1 comments, last by alexisgreene 11 years, 5 months ago
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.

This topic is closed to new replies.

Advertisement