Sign in to follow this  
alexisgreene

UpdateSubresource usage

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, [url="http://msdn.microsoft.com/en-us/library/ff476486(VS.85).aspx"]UpdateSubresource[/url] is what I should use to accomplish this.

This is the function that is called when it is time to update the interface data:
[CODE]
void OnPaint(CefRefPtr<CefBrowser> Browser, PaintElementType Type, const RectList&amp; DirtyRects, const void* pBuffer)
[/CODE]

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 [url="http://msdn.microsoft.com/en-us/library/windows/desktop/bb173869(v=vs.85).aspx"]Map[/url]/[url="http://msdn.microsoft.com/en-us/library/windows/desktop/bb173870(v=vs.85).aspx"]Unmap[/url] 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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this