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

How can i get uniform buffer members? #49

Closed
amerkoleci opened this issue Sep 14, 2016 · 3 comments
Closed

How can i get uniform buffer members? #49

amerkoleci opened this issue Sep 14, 2016 · 3 comments

Comments

@amerkoleci
Copy link
Contributor

I'm accessing the shader_resources uniform_buffers members, how can I get members of given uniform buffer? How about type, size etc?

Thanks

@HansKristian-Work
Copy link
Contributor

Hi, you can use

const SPIRType &type = compiler.get_type(resource.base_type_id);

to get the underlying UBO type. For names,

compiler.get_member_name(resource.base_type, member_index);

@grovesNL
Copy link
Contributor

@HansKristian-ARM How do we know how many members exist (i.e. if we wanted to iterate over all members)? I don't see members.size() exposed anywhere, but I'm not sure if this is intentional or if there is another way.

@HansKristian-Work
Copy link
Contributor

member_types.size() should do it.

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

3 participants