ppenenko / metashade

An experimental GPU shading DSL embedded in Python.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Suggestion] Enable CPython compatible function definitions

ItsCubeTime opened this issue · comments

Cool project! In the readme it says a function is defined using a with statement. Wouldnt it be better if function definitions were just regular Python definitions that you can compile to a shader target by sending it to a function? Like:

def add(a,b): # regular func def
    return a+b
sh.registerFunction(add) # Makes the function callable from shader code

That way it would be easier to reuse code between CPython & "metashade"