Skip to content

TSL: Creating vec* with ivec* results in compilation errors #31791

@shotamatsuda

Description

@shotamatsuda

Description

Creating vec2, vec3, vec4 with ivec2, ivec3, ivec4 as part of the arguments, such as:

vec4(ivec3(), 1)    // Transpiled to: vec4<f32>( f32( vec3<i32>( 0, 0, 0 ) ), 1.0 )
vec3(ivec2(), 1)    // Transpiled to: vec3<f32>( f32( vec2<i32>( 0, 0 ) ), 1.0 )
vec3(1, ivec3().xy) // Transpiled to: vec3<f32>( 1.0, f32( vec3<i32>( 0, 0, 0 ).xy ) )

results in compilation errors.

This reproduced when using Texture.load() with ivec2 and updateMatrix = true.

Reproduction steps

  1. Create a vec3 with an ivec2 as an argument.

Code

// Actual: vec3<f32>( f32( vec2<i32>( 0, 0 ) ), 1.0 )
// Expected: vec3<f32>( vec2<f32>( vec2<i32>( 0, 0 ) ), 1.0 )
vec3(ivec2(), 1)

Live example

https://jsfiddle.net/shotamatsuda/8764h35q/

Screenshots

No response

Version

r179 (also dev)

Device

Desktop

Browser

Chrome

OS

MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugTSLThree.js Shading Language

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions