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

Fix invalid HLSL for shader methods using custom types in signatures #728

Merged
merged 3 commits into from
Dec 21, 2023

Conversation

Sergio0694
Copy link
Owner

Closes #725

Description

This PR fixes the D2D generator producing invalid HLSL if a shader had a custom type and any static or instance methods on the shader type itself that then used that custom type in their signature. This was happening because D2D isn't using forward declarations for types (it can't, FXC doesn't support them), and the forward declarations for those methods were being generated before the actual type declarations for those custom types. This PR simply moves the type declarations to before that.

@Sergio0694 Sergio0694 added the bug fix ✅ A fix for a reported/discovered bug label Dec 18, 2023
@Sergio0694 Sergio0694 force-pushed the dev/fix-methods-forward-declarations branch from f677198 to 72d90c0 Compare December 18, 2023 19:49
@Sergio0694 Sergio0694 force-pushed the dev/fix-methods-forward-declarations branch from 72d90c0 to f9f619e Compare December 21, 2023 17:40
@Sergio0694 Sergio0694 force-pushed the dev/fix-methods-forward-declarations branch from f9f619e to 5f429df Compare December 21, 2023 17:50
@Sergio0694 Sergio0694 merged commit f5e182c into main Dec 21, 2023
24 checks passed
@Sergio0694 Sergio0694 deleted the dev/fix-methods-forward-declarations branch December 21, 2023 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix ✅ A fix for a reported/discovered bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't use a struct within a CS.D2D1 shader
1 participant