select()
함수, 내장 함수 분류
select: the free-function form of ReadonlyNode.select.
import { select } from 'typeshade'
시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.
구문
function select(cond: ReadonlyNode<'bool'>, ifTrue: number, ifFalse: number): Node<'f32'>;function select<R extends string>( cond: ReadonlyNode<'bool'>, ifTrue: ReadonlyNode<R> | number, ifFalse: ReadonlyNode<R> | number,): Node<R>;매개변수
condReadonlyNode<'bool'>ifTruenumberifFalsenumber
반환값
Node<'f32'>
설명
select(cond, ifTrue, ifFalse): the free-function form of ReadonlyNode.select. Both
branches must share a key; two JS numbers give an f32 result.
대상별 지원
| 대상 | 지원 | 비고 |
|---|---|---|
| WGSL (WebGPU) | 지원 |
|
| GLSL ES 3.00 (WebGL2) | 지원 |
|
| CPU 오라클 | 지원 안 함 | The oracle has no implementation for it. |
관련 가이드
소스
src/core/ir/node.ts, 2261행, 커밋 c66579bf 기준