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

Fixes needed by screen-13 #114

Merged
merged 2 commits into from
Dec 18, 2023
Merged

Conversation

attackgoat
Copy link
Contributor

I found these two issues testing attackgoat/screen-13#68, however I'm not sure they are done in the best way yet.

Commit e8c5d00

Fixes a panic at spirq/src/reflect.rs:621.

Valid SPIR-V may list function body instructions after their first call. The function type declaration of course always happens before the first call. This can be reproduced with the following shader using shader-reflect:

#version 460 core

vec4 a() {
    return vec4(0);
}

void main() {
    gl_Position = a();
}

Commit 7ee6d99

Specialization constants that are found via ReflectConfig::specialize(..) are ConstantValue::Typeless(_) and remain untyped after processing their spec-const instructions. The typeless state is helpful because Vulkan doesn't require that information from users and so it is very handy to let spirq reflect that info automatically.

@PENGUINLIONG
Copy link
Owner

Thank you! For the first problem we might better track function calls in an independent dictionary. I can work on that in another PR. Let's merge this first. :)

@PENGUINLIONG PENGUINLIONG merged commit 07a37d7 into PENGUINLIONG:master Dec 18, 2023
1 check passed
@PENGUINLIONG
Copy link
Owner

Turns out the function call logic is wrong. Gonna fix it right away. 🙃

@attackgoat attackgoat deleted the misc_fixes branch December 18, 2023 13:53
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

Successfully merging this pull request may close these issues.

2 participants