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 position from vertex shader partially uninitialized #94629

Merged
merged 1 commit into from
Jul 24, 2024

Conversation

RandomShaper
Copy link
Member

A vertex shader in Godot can write to a subset of the fileds of POSITION, which would lead to the vec4 position being partially unitialized. The DirectX Shader Compiler will reject that. This PR initializes the variable to the most sensible value so the user can re-override whatever members they want. Shader optimization is expected to remove the redundant assignments.

A different fix may be put in place: that the Godot shader compiler rejects the shader unless it writes to the whole vector. This PR shouldn't be an obstacle to doing that later anyway.

@akien-mga akien-mga merged commit 139cf02 into godotengine:master Jul 24, 2024
18 checks passed
@akien-mga
Copy link
Member

Thanks!

@RandomShaper RandomShaper deleted the fix_undef_position branch July 25, 2024 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants