Skip to content

Commit 08ff532

Browse files
author
hartsantler
committed
webCLgl backend: fixed functions with no arguments.
1 parent a073ac7 commit 08ff532

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

pythonjs/pythonjs.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,11 @@ def _visit_function(self, node):
256256

257257
if is_main:
258258
lines.append( 'var __shader__ = [];') ## each call to the wrapper function recompiles the shader
259-
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.
259+
if x:
260+
lines.append( '__shader__.push("void main(%s) {");' %','.join(x) )
261+
else:
262+
lines.append( '__shader__.push("void main( ) {");') ## WebCLGL parser requires the space in `main( )`
263+
260264
elif return_type:
261265
lines.append( '__shader_header__.push("%s %s( %s ) {");' %(return_type, node.name, ', '.join(x)) )
262266
else:

0 commit comments

Comments
 (0)