mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-05 11:45:54 +00:00
WGSL supports select() with vectors, where the condition is a scalar. To support this in SPIR-V versions older than 1.4, we need to splat the condition operand to a vector of the same size as the objects. Fixed: tint:933 Change-Id: I571af46e74cd7bb24093524ccfed25a3ed612676 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/56340 Auto-Submit: James Price <jrprice@google.com> Commit-Queue: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
20 lines
329 B
WebGPU Shading Language
20 lines
329 B
WebGPU Shading Language
fn select_ab069f() {
|
|
var res : vec4<i32> = select(vec4<i32>(), vec4<i32>(), bool());
|
|
}
|
|
|
|
[[stage(vertex)]]
|
|
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
|
select_ab069f();
|
|
return vec4<f32>();
|
|
}
|
|
|
|
[[stage(fragment)]]
|
|
fn fragment_main() {
|
|
select_ab069f();
|
|
}
|
|
|
|
[[stage(compute)]]
|
|
fn compute_main() {
|
|
select_ab069f();
|
|
}
|