Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.

[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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants