Skip to content

[wgsl] i32 constructor needs to support abstract floats #7312

@teoxoy

Description

@teoxoy

https://threejs.org/examples/?q=webgpu#webgpu_lights_tiled uses this functionality. naga currently errors with:

Shader 'fragment' parsing error: abstract floating-point values cannot be automatically converted to integers
    ┌─ wgsl:142:192
    │
142 │         nodeVar13 = textureLoad( nodeUniform13, vec2<i32>( ( lightIndexes.value[ u32( ( ( ( nodeVar2.x + ( nodeVar2.y * 46.0 ) ) * 2.0 ) + f32( ( ( i ) / 4 ) ) ) ) ][ u32( ( ( i ) % 4 ) ) ] - 1 ), i32( 0.0 ) ), u32( 0u ) );
    │                                                                                                                                                                                                      ^^^^^^^^^^ see msg

Part of https://bugzilla.mozilla.org/show_bug.cgi?id=1916072#c5.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions