Comments (9)
BTW: keeping WASL somewhat alive (or making a start on WSL) is still interesting to force us to keep the abstractions right; if we had only one path (Python->bytecode->spirv) it might be tempting to make shortcuts.
from pyshader.
No objections from my end. "Do One Thing And Do It Well"!
from pyshader.
@windelbouwman we can still continue with WASL (within this project), but we should probably just rename it to WSL and adopt the corresponding syntax ;)
from pyshader.
What exactly are WSL and WASL? I only know WSL as the Windows Subsystem for Linux. :')
from pyshader.
WASL stands for "Windel Almar Shading Language", proposed as an alternative to coding shaders in some dialect of C, which might suck :). WSL I also know as Windows Subsystem for Linux, but also appears to be WebGPU Shading Language (https://gpuweb.github.io/WSL/).
from pyshader.
@almarklein WSL looks interesting, also interesting we missed it and invented our own language :). Is it an improvement over C based shader language?
If you want to write a compiler for WSL, you might want to switch from textx to lark: https://github.com/lark-parser/lark
from pyshader.
Is it an improvement over C based shader language?
I have not looked into it much yet. I suspect that it will look similar to GLSL. Though there are e.g. keywords vertex
, fragment
and compute
to mark functions as entry point for these shader stages.
from pyshader.
Just so I understand it right, this library (spirv-py) would go from python code to spir-v, right? So then, GLSL, WSL and WASL would be alternatives to python as input for the front-end of this library.
Seems like it would be nice to have a uniform Python API for all shader formats users might bring, but on the other hand, there already are conversion tools being developed for these other formats externally right? Like the vulkan-sdk!
Perhaps it would be better to write an "umbrella" python library separately later, and have it treat spirv-py as an optional front-end just like the other external tools?
[Edit] that might be a nice visvis2 module, actually :)
from pyshader.
Yeah, in theory we can add a front-end that can consume GLSL. But writing this in Python is quite an effort, and using the Vulkan SDK gets us an annoying dependency. Therefore I want to keep GLSL out of the scope of this project.
If WSL is a well defined format, it may be worth looking into compiling that to the bytecode that we use internally as an IR.
On the backend, we now generate SpirV from our bytecode. If WebGPU turns out not to consume SpirV but another format, we can add a generator for that. A GLSL generator would also be feasible, actually.
Perhaps it would be better to write an "umbrella" python library separately later, and have it treat spirv-py as an optional front-end just like the other external tools?
Yeah, perhaps. I guess it depends a lot on what WebGPU will look like in terms of shaders.
from pyshader.
Related Issues (20)
- Syntax for defining input and output HOT 10
- First release to PyPi HOT 1
- pypi package is broken because readme is not included in the package. HOT 4
- Implicit type conversions HOT 4
- Trace debug info so we can produce more useful error messages. HOT 1
- Be more consistent about exception types raised by the parsers
- Add support for runtime constants (specialization)? HOT 1
- WebGPU shading language (WGSL) HOT 5
- Option to spell co_select in Python?
- Is our use of annotations ok? HOT 6
- Support shaders with jumps in bytecode >255 bytes
- Compute example crashes in create_compute_pipeline HOT 19
- Support some form of templating of entry points? HOT 2
- Compiling to file HOT 2
- Error processing resulting SPIR-V shader in Vulkan 1.2.x (Kompute v0.4.2) HOT 2
- [FEATURE] Add support for layout local size(s) HOT 4
- Document math / built-in functions HOT 5
- Support for Python 3.9
- Is this worth it? HOT 9
- Archive this repo
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyshader.