Skip to content
This repository has been archived by the owner on Oct 11, 2021. It is now read-only.

Add support for runtime constants (specialization)? #25

Open
almarklein opened this issue Mar 27, 2020 · 1 comment
Open

Add support for runtime constants (specialization)? #25

almarklein opened this issue Mar 27, 2020 · 1 comment

Comments

@almarklein
Copy link
Member

SpirV supports specialization: setting constants at runtime, can be useful?

@axsaucedo
Copy link

+1 on this, it would be great if it could be defined similar to the parameters, as:

@python2shader
def compute_shader_multiply(
        index: ("input", "GlobalInvocationId", ivec3),
        data1: ("buffer", 0, Array(f32)),
        data2: ("buffer", 1, Array(f32)),
        data3: ("buffer", 2, Array(f32)),
        constants=[Constant("LEN_VAR", 0, )]):
    i = index.x
    data3[i] = data1[i] * data2[i]

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

No branches or pull requests

2 participants