Skip to content

Commit fff9f60

Browse files
author
hartsantler
committed
webCLgl: fixed args passed to gpu main (webclgl parser is white space sensitive)
1 parent c4cd822 commit fff9f60

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

pythonjs/pythonjs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def _visit_function(self, node):
250250

251251
if is_main:
252252
lines.append( 'var __shader__ = [];') ## dynamic
253-
lines.append( '__shader__.push("void main( %s ) {");' %', '.join(x) )
253+
lines.append( '__shader__.push("void main(%s) {");' %','.join(x) ) ## if shader failed to compile with error like "uniform float float" syntax error something likely went wrong here.
254254
elif return_type:
255255
lines.append( '__shader_header__.push("%s %s( %s ) {");' %(return_type, node.name, ', '.join(x)) )
256256
else:

regtests/webclgl/inline_objects.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"""inline dynamic object data"""
22
class A:
33
def __init__(self):
4-
self.myattr = 0.4
4+
self.myattr = 22/7.0
55

66
def main():
77
def my_wrapper(a,b, x,y,z,w):
88

9-
@returns( vec4=[32,32] )
9+
@returns( array=[32,32] )
1010
@gpu.main
1111
def gpufunc(x,y,z,w):
1212
float x
@@ -15,9 +15,9 @@ def gpufunc(x,y,z,w):
1515
float w
1616
float D = a.myattr
1717
vec4 V = vec4( x+D, y+D,z,w)
18-
return V
18+
return x+y+z+w+D
1919

20-
return gpufunc( x,y,z,w )
20+
return gpufunc(x,y,z,w)
2121

2222
ai = A()
2323
bi = A()

0 commit comments

Comments
 (0)