Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include macros #47

Open
cjhowedev opened this issue Oct 8, 2022 · 0 comments
Open

include macros #47

cjhowedev opened this issue Oct 8, 2022 · 0 comments

Comments

@cjhowedev
Copy link

Write function-like procedural macros to invoke compile_hlsl and validate_dxil at compile time. I think most users of this library will want to compile their shaders to SPIR-V/DXIL at compile time because it's unlikely that players will have dxil.dll available.

To kick off the conversation, I suggest we follow in the footsteps of inline-spirv in regards to the usage patterns:

let spirv = include_hlsl!(
    "shader_filename.hlsl",
    "entry",
    "cs_6_5",
    &vec!["-spirv"],
    &vec![
        ("MY_DEFINE", Some("Value")),
        ("OTHER_DEFINE", None)
    ],
);

let dxil= validate_dxil!(inline_hlsl!(
    r#"
        // your inline HLSL code here
    "#,
    "entry",
    "cs_6_5",
    &vec![],
    &vec![
        ("MY_DEFINE", Some("Value")),
        ("OTHER_DEFINE", None)
    ],
));

I'm not sure what the API for validation should look like or whether it's feasible, but we should consider whether we will need to validate DXIL at compile time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant