Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1751)

Issue 1773008: Added more logic to cg_to_glsl converter to find cgc in o3d/third_party/cgc/... (Closed)

Created:
10 years, 8 months ago by Ken Russell (switch to Gerrit)
Modified:
9 years, 7 months ago
Reviewers:
Alexey Marinichev
CC:
o3d-review_googlegroups.com
Visibility:
Public.

Description

Added more logic to cg_to_glsl converter to find cgc in o3d/third_party/cgc/ as a last resort. This will allow the converter to always be run as part of the build process. BUG=none TEST=manual testing on Mac and Windows TBR=amarinichev Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=45737

Patch Set 1 #

Total comments: 13
Unified diffs Side-by-side diffs Delta from patch set Stats (+56 lines, -23 lines) Patch
M cg_to_glsl/convert.py View 6 chunks +56 lines, -23 lines 13 comments Download

Messages

Total messages: 4 (0 generated)
Ken Russell (switch to Gerrit)
Please review. Thanks.
10 years, 8 months ago (2010-04-27 20:47:18 UTC) #1
Alexey Marinichev
http://codereview.chromium.org/1773008/diff/1/2 File cg_to_glsl/convert.py (right): http://codereview.chromium.org/1773008/diff/1/2#newcode33 cg_to_glsl/convert.py:33: for i in range(0, 5): range(5) http://codereview.chromium.org/1773008/diff/1/2#newcode41 cg_to_glsl/convert.py:41: paths ...
10 years, 8 months ago (2010-04-27 21:28:16 UTC) #2
Alexey Marinichev
http://codereview.chromium.org/1773008/diff/1/2 File cg_to_glsl/convert.py (right): http://codereview.chromium.org/1773008/diff/1/2#newcode65 cg_to_glsl/convert.py:65: for exe in exes: Um, that's not exactly what ...
10 years, 8 months ago (2010-04-27 23:24:09 UTC) #3
Ken Russell (switch to Gerrit)
10 years, 8 months ago (2010-04-28 02:30:49 UTC) #4
http://codereview.chromium.org/1773008/diff/1/2
File cg_to_glsl/convert.py (right):

http://codereview.chromium.org/1773008/diff/1/2#newcode33
cg_to_glsl/convert.py:33: for i in range(0, 5):
On 2010/04/27 21:28:16, Alexey Marinichev wrote:
> range(5)

Done. Will send you a separate CL with this and the other changes.

http://codereview.chromium.org/1773008/diff/1/2#newcode41
cg_to_glsl/convert.py:41: paths = [ '/usr/bin/cgc',
On 2010/04/27 21:28:16, Alexey Marinichev wrote:
> Does chrome style prefer "[ x ]" over "[x]"?

Not sure. I'll get rid of the surrounding spaces.

http://codereview.chromium.org/1773008/diff/1/2#newcode60
cg_to_glsl/convert.py:60: cg_root = os.path.join(o3d_root, 'third_party', 'cg',
'files')
On 2010/04/27 21:28:16, Alexey Marinichev wrote:
> 'third_party/cg/files' would be more readable.

Unclear to me whether that is guaranteed to be functionally equivalent.

http://codereview.chromium.org/1773008/diff/1/2#newcode65
cg_to_glsl/convert.py:65: for exe in exes:
On 2010/04/27 23:24:09, Alexey Marinichev wrote:
> Um, that's not exactly what I meant...  You can call os.path.join inside the
> loop.
> On 2010/04/27 21:28:16, Alexey Marinichev wrote:
> > relative_paths = ['linux/bin/cgc', ....]
> > for exe in (os.path.join(cgc_root, relative_paths)):
> >  ...

See above regarding my concern about funcional equivalence in particular on
non-Cygwin versions of Python on Windows.

http://codereview.chromium.org/1773008/diff/1/2#newcode69
cg_to_glsl/convert.py:69: stderr=open(os.devnull, 'w'))
On 2010/04/27 21:28:16, Alexey Marinichev wrote:
> Is checking if the path exists not enough?  Do you really have to try to
execute
> it?

Unfortunately it's not enough. All three versions live in workspaces checked out
on any of these three platforms.

http://codereview.chromium.org/1773008/diff/1/2#newcode245
cg_to_glsl/convert.py:245: def main(cg_shader, CGC):
On 2010/04/27 21:28:16, Alexey Marinichev wrote:
> I used all caps CGC to show it's a constant that's never supposed to change. 
I
> think it would make sense to either leave it as CGC and not pass it as an
extra
> argument, or rename it to cgc_path and drag it along.  I'd prefer to keep it
> global.

I like to avoid globals so I've changed it to cgc_path everywhere.

Powered by Google App Engine
This is Rietveld 408576698