metashade
metashade copied to clipboard
An experimental GPU shading DSL embedded in Python.
https://github.com/ppenenko/metashade/tree/issues/32/gltf_shadow_maps implements most of the shader code required (without filtering) but the glTFSample host code needs to be fixed first - see #31
Currently, every expression generated by an arithmetic operator is wrapped in parentheses in the generated code, as a low-tech way to ensure the preservation of the evaluation order from the...
There don't seem to be any assets supporting this workflow in Cauldron-Media, so it wouldn't be testable ATM, so I'm deferring it till later.
As of v1.4.5, https://github.com/GPUOpen-LibrariesAndSDKs/Cauldron provides its own CLI parsing mechanism. https://github.com/ppenenko/glTFSample/tree/metashade_demo OTOH earlier implemented its own, based on `Boost.Program_options`. The two are incompatible, so after updating to the latest Cauldron...
Currently, for the purposes of the glTF Demo, the HLSL generator exposes a method to define a "combined" 2D sampler together with a texture: https://github.com/ppenenko/metashade/blob/ae028edbe865ffa7fdb35d187352959eea622474/metashade/hlsl/sm6/profile.py#L102 DX12's native textures and samplers,...
HLSL intrinsics are a big part of HLSL functionality currently missing from Metashade. Fortunately, they are defined exhaustively in DXC, with some of the infrastructure written in Python: https://github.com/microsoft/DirectXShaderCompiler/blob/main/utils/hct/hctdb.py https://github.com/microsoft/DirectXShaderCompiler/blob/main/utils/hct/gen_intrin_main.txt...
E.g. a += b Currently, attempting this in Python code generates invalid HLSL. New operator overloading tricks are likely required.
The current implementation of function calls relies on Metashade's implementations of expressions and assignments: the function call with the arguments is just an expression, which may become part of a...
```Python with sh.for_(...): pass ``` Details TBD. Should probably follow #5 because conditions need to be figured out first.
Should look something like ```Python with sh.if_( sh.a < sh.b ): sh.c = sh.a with sh.else_: sh.c = sh.b ``` Scopes of the branches should be easy to implement similar...