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

vec costructor arguments are not added to glsl #12

Open
arkanoid87 opened this issue Jan 21, 2023 · 2 comments
Open

vec costructor arguments are not added to glsl #12

arkanoid87 opened this issue Jan 21, 2023 · 2 comments

Comments

@arkanoid87
Copy link
Contributor

arkanoid87 commented Jan 21, 2023

var
    pixelSize: uint32 = 2
    icols: uint32 = 1024
    irows: uint32 = 1024
    ocols = icols * pixelSize
    orows = irows * pixelSize
    inputShape: UVec2 = uvec2(icols, irows)
    outputShape: UVec2 = uvec2(ocols, orows)
   

generates just

uvec2 outputShape = uvec2(ocols, orows);

that causes error

error C1503: undefined variable "ocols"

the only way I've found so far to pass vec2 vars to glsl via shady is using int literals as arguments

@treeform
Copy link
Owner

Is this in the outer scope? Outer scope is odd in that it only brings in vars that are mentioned.

It needs to do a better job at walking outputShape and finding all symbols it uses.

@arkanoid87
Copy link
Contributor Author

arkanoid87 commented Jan 21, 2023

yes, it's global scope

I have not yet wrapped anything as I've been following the pattern used in examples so far (and I am already dribbling the conversion limitations)

I'll try refactoring and cleaning up global scope

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

2 participants