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

Issue 204046: Review: improve adjust_varying (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 2 months ago by larrygritz
Modified:
14 years, 2 months ago
Reviewers:
solomon.boulos, ckulla
Base URL:
http://openshadinglanguage.googlecode.com/svn/trunk/
Visibility:
Public.

Description

adjust_varying is the function that doctors whether a variable is uniform or varying based on what is about to be assigned to it. But if a uniform is being assigned from within a conditional, it needs to be a varying assignment, since it should only happen on some shading points. A few days back, Chris Kulla observed that adjust_varying was making this decision based on all_points_on() as a proxy for whether we were in a conditional or not... BUT... with the "sparse" batches we are shading for secondary rays, all points are not turned on, even when we aren't inside a conditional! So in theory, we weren't taking nearly as much advantage of uniforms as we should be on secondary rays (and therefore not getting full performance from batching). The attached patch addresses this by directly tracking when we are in nested conditionals, and using that as the basis for the decision. Result: at least 25% rendering speedup on production assets! There's also a little bit of additional infrastructure to ensure we handle orig_runflags carefully, and optionally (by compile-time #define) gather stats about adjust_varying to verify that it works as expected.

Patch Set 1 #

Total comments: 6

Patch Set 2 : Addressed some comments by Chris and Solomon #

Patch Set 3 : One more update, remove dead code #

Unified diffs Side-by-side diffs Delta from patch set Stats (+92 lines, -3 lines) Patch
src/liboslexec/context.cpp View 1 chunk +10 lines, -0 lines 0 comments Download
src/liboslexec/exec.cpp View 1 2 6 chunks +28 lines, -2 lines 0 comments Download
src/liboslexec/opcontrol.cpp View 1 6 chunks +15 lines, -0 lines 0 comments Download
src/liboslexec/oslexec_pvt.h View 1 5 chunks +28 lines, -1 line 0 comments Download
src/liboslexec/shadingsys.cpp View 1 chunk +11 lines, -0 lines 0 comments Download

Messages

Total messages: 11
larrygritz
14 years, 2 months ago (2010-02-06 01:26:39 UTC) #1
ckulla
Seems like a good change. A few questions about the implementation: (maybe just needs more ...
14 years, 2 months ago (2010-02-06 02:48:40 UTC) #2
solomon.boulos
http://codereview.appspot.com/204046/diff/1/6 File src/liboslexec/exec.cpp (right): http://codereview.appspot.com/204046/diff/1/6#newcode704 src/liboslexec/exec.cpp:704: varying_assignment |= ! running_top_level(); running_top_level() suggests that you can't ...
14 years, 2 months ago (2010-02-06 04:04:07 UTC) #3
lg_imageworks.com
On Feb 5, 2010, at 6:48 PM, <ckulla@gmail.com> <ckulla@gmail.com> wrote: > http://codereview.appspot.com/204046/diff/1/6#newcode386 > src/liboslexec/exec.cpp:386: Runflag ...
14 years, 2 months ago (2010-02-06 06:43:56 UTC) #4
lg_imageworks.com
On Feb 5, 2010, at 8:04 PM, <solomon.boulos@gmail.com> <solomon.boulos@gmail.com> wrote: > http://codereview.appspot.com/204046/diff/1/6#newcode704 > src/liboslexec/exec.cpp:704: varying_assignment ...
14 years, 2 months ago (2010-02-06 06:58:24 UTC) #5
boulos_cs.stanford.edu
On Feb 5, 2010, at 10:58 PM, Larry Gritz wrote: > On Feb 5, 2010, ...
14 years, 2 months ago (2010-02-06 07:03:43 UTC) #6
lg_imageworks.com
On Feb 5, 2010, at 11:03 PM, Solomon Boulos wrote: > > I forgot to ...
14 years, 2 months ago (2010-02-06 07:17:49 UTC) #7
larrygritz
Addressed some comments by Chris and Solomon
14 years, 2 months ago (2010-02-07 22:10:29 UTC) #8
larrygritz
One more update, remove dead code
14 years, 2 months ago (2010-02-07 22:12:11 UTC) #9
larrygritz
On 2010/02/07 22:12:11, larrygritz wrote: > One more update, remove dead code OK, here's what ...
14 years, 2 months ago (2010-02-07 22:13:15 UTC) #10
ckulla
14 years, 2 months ago (2010-02-08 02:18:33 UTC) #11
LGTM
Sign in to reply to this message.

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