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

[wgsl-in] Only splat 'scalar op vec', not '_ op vec' #2444

Merged
merged 1 commit into from
Aug 18, 2023

Conversation

fornwall
Copy link
Contributor

@fornwall fornwall commented Aug 18, 2023

Change binary_op_splat() from splatting:

    vec op scalar
    _ op vec

to only splat:

    vec op scalar
    scalar op vec

This fixes some confusing error messages. Example function:

fn main(mat: mat3x3<f32>) {
    let vec = vec3<f32>(1.0, 1.0, 1.0);
    let result = mat / vec;
}

Change binary_op_splat() from splatting:

        vec op scalar
        _ op vec

to only splat:

        vec op scalar
        scalar op vec
@fornwall
Copy link
Contributor Author

Error message before this change (note the Scalar type Matrix message):

Screenshot 2023-08-18 at 15 06 45

@fornwall
Copy link
Contributor Author

Error message after this change (in general formatting of validation errors needs improvement, but the underlying information is now correct):

Screenshot 2023-08-18 at 15 06 22

Copy link
Member

@teoxoy teoxoy left a comment

Choose a reason for hiding this comment

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

Makes sense, thanks!

@teoxoy teoxoy merged commit b001313 into gfx-rs:master Aug 18, 2023
6 checks passed
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