Skip to content

Wrapper: Allow null src_lengths to be passed to shaderSource #17

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

Merged
merged 1 commit into from
Jun 24, 2025

Conversation

hazeycode
Copy link
Member

Fixes #13

@hazeycode hazeycode requested a review from Copilot June 24, 2025 23:47
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the shaderSource wrapper to accept an optional src_lengths array, allowing callers to pass null lengths and rely on null-terminated strings.

  • Change signature to maybe_src_lengths: ?[]const u32
  • Only assert length matching when lengths are provided
  • Pass null to binding when lengths are omitted
Comments suppressed due to low confidence (2)

src/wrapper.zig:2769

  • The commented signature above the function is now outdated; update it to mention that src_lengths is optional (?[]const u32) or remove it if no longer needed.
        ) void {

src/wrapper.zig:2765

  • Consider adding a unit or integration test for the new code path where maybe_src_lengths is null, to ensure the binding correctly handles null-terminated source strings.
        pub fn shaderSource(

@hazeycode hazeycode merged commit ec8886f into main Jun 24, 2025
3 checks passed
@hazeycode hazeycode deleted the wrapper-improvements branch June 24, 2025 23:50
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.

[Wrapper] Can't pass null to ShaderSource()
1 participant