Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4125)

Issue 3038042: Resize surface on the first draw call to the surface rather than just-before ... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 5 months ago by nduca
Modified:
13 years, 5 months ago
Reviewers:
dgkoch, apatrick1
CC:
angleproject-review_googlegroups.com
Base URL:
http://angleproject.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Resize surface on the first draw call to the surface rather than just-before present. This avoids corruption during resize.

Patch Set 1 #

Total comments: 19

Patch Set 2 : '' #

Total comments: 10

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+76 lines, -35 lines) Patch
M samples/gles2_book/Common/Win32/esUtil_win32.c View 1 2 3 chunks +13 lines, -2 lines 0 comments Download
M src/libEGL/Surface.h View 1 2 3 chunks +4 lines, -4 lines 0 comments Download
M src/libEGL/Surface.cpp View 1 2 9 chunks +34 lines, -28 lines 0 comments Download
M src/libGLESv2/Context.h View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M src/libGLESv2/Context.cpp View 1 2 7 chunks +23 lines, -1 line 0 comments Download

Messages

Total messages: 9
nduca
13 years, 5 months ago (2010-11-11 19:16:12 UTC) #1
apatrick1
Can you add an explanation of what the corruption issue is to the description? http://codereview.appspot.com/3038042/diff/1/src/libEGL/Surface.cpp ...
13 years, 5 months ago (2010-11-11 21:23:54 UTC) #2
nduca
http://codereview.appspot.com/3038042/diff/1/src/libEGL/Surface.cpp File src/libEGL/Surface.cpp (right): http://codereview.appspot.com/3038042/diff/1/src/libEGL/Surface.cpp#newcode100 src/libEGL/Surface.cpp:100: resetSwapChain(windowRect.right - windowRect.left, On 2010/11/11 21:23:54, apatrick1 wrote: > ...
13 years, 5 months ago (2010-11-11 21:36:16 UTC) #3
apatrick1
Hi Daniel, Nat has made some changes to avoid a rendering artifact during window resizing. ...
13 years, 5 months ago (2010-11-11 22:05:59 UTC) #4
dgkoch
Hi Nat, Can you please add yourself to the following groups so that your comments ...
13 years, 5 months ago (2010-11-12 20:52:20 UTC) #5
nduca
> Perhaps I'm missing something, but can you explain why this can't be solved just ...
13 years, 5 months ago (2010-11-12 21:01:29 UTC) #6
nduca
http://codereview.appspot.com/3038042/diff/9001/src/libEGL/Surface.cpp File src/libEGL/Surface.cpp (right): http://codereview.appspot.com/3038042/diff/9001/src/libEGL/Surface.cpp#newcode345 src/libEGL/Surface.cpp:345: bool Surface::checkForResizedWindowAndUpdateInterval() Good point! Silly me. On 2010/11/12 20:52:20, ...
13 years, 5 months ago (2010-11-12 21:18:43 UTC) #7
dgkoch
On 2010/11/12 21:01:29, nduca wrote: > > Perhaps I'm missing something, but can you explain ...
13 years, 5 months ago (2010-11-12 21:22:29 UTC) #8
nduca
13 years, 5 months ago (2010-11-15 20:55:51 UTC) #9
OK, I have a new approach figured out where we trap the WM_SIZE command directly
using window subclassing rather than polling for it. This avoids your concerns
about the timing of the WM_SIZE relative to draw calls, but still avoids
artifacts.

Unfortunately, I seem to have confused gcl by removing files from the
changelist. So I'm going to create a new issue for the new approach.

On 2010/11/12 21:22:29, dgkoch wrote:
> On 2010/11/12 21:01:29, nduca wrote:
> > > Perhaps I'm missing something, but can you explain why this can't be
solved
> > just
> > > by re-ordering the operations in Surface::swap()?  
> > 
> > Consider the following sequence:
> > 1- glDraw 1... N assuming w0,h0
> > 2- glSwap
> > 3- WM_SIZE to w1,h1
> > 4- glDRaw 1... N assumign w1,h1
> > 5- glSwap
> > 
> > The problem with doing the checkFor in glSwap is that you wont' see w1,h1
> until
> > step 5. For cases where w1 > w0 || h1 > h0 (eg growing window), this leads
to
> us
> > losing pixels.
> 
> But that'll only work if you get the WM_SIZE message before the first draw
call.
>  You added a limiter so that the resize check can only happen once per-frame.
> As your patch is -- if the WM_SIZE message comes in sometime between glDraw
2…N,
> the resize won't get noticed until the first draw call after the next swap. 
So
> you might as well just move the checkForOutOfDateSwapChain further down in the
> swap function immediately after the d3d->present call.   
> 
> If you don't have a limiter in, and check *every* draw call, I believe you'll
> *still* have lost pixels unless you force a redraw of anything pending when we
> get the resize.  But that won't work either since it will likely only be a
part
> of a scene.  
> 
> I believe the only reasonable options are:
> 1) draw the scene at the old size (with either stretching, scaling or
clamping)
> 2) discard the frame that is being rendered when the window resizes.
> 
> > 
> > >  - If that doesn't work, the other idea would be to do the resize in two
> > steps. 
> > Perhaps I'm running low on caffiene, but doesn't this approach still drop
> pixels
> > because of the above issue? Sorry if I'm missing something…
> 
> It all comes back to suddenly adding pixels to the framebuffer in the middle
of
> the frame -- it isn't well-defined how that should work.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b