intrinsics: Add missing select() overload
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>
This commit is contained in:
parent
c7aa21e265
commit
077fe64b11
File diff suppressed because it is too large
Load Diff
|
@ -359,6 +359,7 @@ fn reverseBits<N: num, T: iu32>(vec<N, T>) -> vec<N, T>
|
|||
fn round(f32) -> f32
|
||||
fn round<N: num>(vec<N, f32>) -> vec<N, f32>
|
||||
fn select<T: scalar>(T, T, bool) -> T
|
||||
fn select<T: scalar, N: num>(vec<N, T>, vec<N, T>, bool) -> vec<N, T>
|
||||
fn select<N: num, T: scalar>(vec<N, T>, vec<N, T>, vec<N, bool>) -> vec<N, T>
|
||||
fn sign(f32) -> f32
|
||||
fn sign<N: num>(vec<N, f32>) -> vec<N, f32>
|
||||
|
|
|
@ -468,8 +468,9 @@ TEST_F(ResolverIntrinsicTest, Select_Error_NoParams) {
|
|||
EXPECT_EQ(r()->error(),
|
||||
R"(error: no matching call to select()
|
||||
|
||||
2 candidate functions:
|
||||
3 candidate functions:
|
||||
select(T, T, bool) -> T where: T is f32, i32, u32 or bool
|
||||
select(vecN<T>, vecN<T>, bool) -> vecN<T> where: T is f32, i32, u32 or bool
|
||||
select(vecN<T>, vecN<T>, vecN<bool>) -> vecN<T> where: T is f32, i32, u32 or bool
|
||||
)");
|
||||
}
|
||||
|
@ -483,8 +484,9 @@ TEST_F(ResolverIntrinsicTest, Select_Error_SelectorInt) {
|
|||
EXPECT_EQ(r()->error(),
|
||||
R"(error: no matching call to select(i32, i32, i32)
|
||||
|
||||
2 candidate functions:
|
||||
3 candidate functions:
|
||||
select(T, T, bool) -> T where: T is f32, i32, u32 or bool
|
||||
select(vecN<T>, vecN<T>, bool) -> vecN<T> where: T is f32, i32, u32 or bool
|
||||
select(vecN<T>, vecN<T>, vecN<bool>) -> vecN<T> where: T is f32, i32, u32 or bool
|
||||
)");
|
||||
}
|
||||
|
@ -500,8 +502,9 @@ TEST_F(ResolverIntrinsicTest, Select_Error_Matrix) {
|
|||
EXPECT_EQ(r()->error(),
|
||||
R"(error: no matching call to select(mat2x2<f32>, mat2x2<f32>, bool)
|
||||
|
||||
2 candidate functions:
|
||||
3 candidate functions:
|
||||
select(T, T, bool) -> T where: T is f32, i32, u32 or bool
|
||||
select(vecN<T>, vecN<T>, bool) -> vecN<T> where: T is f32, i32, u32 or bool
|
||||
select(vecN<T>, vecN<T>, vecN<bool>) -> vecN<T> where: T is f32, i32, u32 or bool
|
||||
)");
|
||||
}
|
||||
|
@ -515,8 +518,9 @@ TEST_F(ResolverIntrinsicTest, Select_Error_MismatchTypes) {
|
|||
EXPECT_EQ(r()->error(),
|
||||
R"(error: no matching call to select(f32, vec2<f32>, bool)
|
||||
|
||||
2 candidate functions:
|
||||
3 candidate functions:
|
||||
select(T, T, bool) -> T where: T is f32, i32, u32 or bool
|
||||
select(vecN<T>, vecN<T>, bool) -> vecN<T> where: T is f32, i32, u32 or bool
|
||||
select(vecN<T>, vecN<T>, vecN<bool>) -> vecN<T> where: T is f32, i32, u32 or bool
|
||||
)");
|
||||
}
|
||||
|
@ -531,8 +535,9 @@ TEST_F(ResolverIntrinsicTest, Select_Error_MismatchVectorSize) {
|
|||
EXPECT_EQ(r()->error(),
|
||||
R"(error: no matching call to select(vec2<f32>, vec3<f32>, bool)
|
||||
|
||||
2 candidate functions:
|
||||
3 candidate functions:
|
||||
select(T, T, bool) -> T where: T is f32, i32, u32 or bool
|
||||
select(vecN<T>, vecN<T>, bool) -> vecN<T> where: T is f32, i32, u32 or bool
|
||||
select(vecN<T>, vecN<T>, vecN<bool>) -> vecN<T> where: T is f32, i32, u32 or bool
|
||||
)");
|
||||
}
|
||||
|
|
|
@ -2441,6 +2441,23 @@ uint32_t Builder::GenerateIntrinsic(ast::CallExpression* call,
|
|||
if (!cond_id || !true_id || !false_id) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// If the condition is scalar but the objects are vectors, we need to
|
||||
// splat the condition into a vector of the same size.
|
||||
// TODO(jrprice): If we're targeting SPIR-V 1.4, we don't need to do this.
|
||||
auto* result_vector_type = intrinsic->ReturnType()->As<sem::Vector>();
|
||||
if (result_vector_type && intrinsic->Parameters()[2].type->is_scalar()) {
|
||||
sem::Bool bool_type;
|
||||
sem::Vector bool_vec_type(&bool_type, result_vector_type->size());
|
||||
if (!GenerateTypeIfNeeded(&bool_vec_type)) {
|
||||
return 0;
|
||||
}
|
||||
cond_id = GenerateSplat(cond_id, &bool_vec_type);
|
||||
if (cond_id == 0) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (!push_function_inst(
|
||||
spv::Op::OpSelect,
|
||||
{Operand::Int(result_type_id), result, Operand::Int(cond_id),
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/intrinsics/intrinsics.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn select(vec<4, u32>, vec<4, u32>, bool) -> vec<4, u32>
|
||||
fn select_087ea4() {
|
||||
var res: vec4<u32> = select(vec4<u32>(), vec4<u32>(), bool());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
select_087ea4();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
select_087ea4();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
select_087ea4();
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
void select_087ea4() {
|
||||
uint4 res = (false ? uint4(0u, 0u, 0u, 0u) : uint4(0u, 0u, 0u, 0u));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
select_087ea4();
|
||||
const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
select_087ea4();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
select_087ea4();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
void select_087ea4() {
|
||||
uint4 res = select(uint4(), uint4(), bool());
|
||||
}
|
||||
|
||||
vertex tint_symbol vertex_main() {
|
||||
select_087ea4();
|
||||
tint_symbol const tint_symbol_1 = {.value=float4()};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
fragment void fragment_main() {
|
||||
select_087ea4();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
select_087ea4();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 41
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %tint_pointsize "tint_pointsize"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %select_087ea4 "select_087ea4"
|
||||
OpName %res "res"
|
||||
OpName %tint_symbol_2 "tint_symbol_2"
|
||||
OpName %tint_symbol "tint_symbol"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %tint_pointsize BuiltIn PointSize
|
||||
OpDecorate %tint_symbol_1 BuiltIn Position
|
||||
%float = OpTypeFloat 32
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%4 = OpConstantNull %float
|
||||
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%8 = OpConstantNull %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%v4uint = OpTypeVector %uint 4
|
||||
%bool = OpTypeBool
|
||||
%17 = OpConstantNull %bool
|
||||
%18 = OpConstantNull %v4uint
|
||||
%v4bool = OpTypeVector %bool 4
|
||||
%_ptr_Function_v4bool = OpTypePointer Function %v4bool
|
||||
%22 = OpConstantNull %v4bool
|
||||
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
|
||||
%26 = OpTypeFunction %void %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%select_087ea4 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%20 = OpVariable %_ptr_Function_v4bool Function %22
|
||||
%res = OpVariable %_ptr_Function_v4uint Function %18
|
||||
%23 = OpCompositeConstruct %v4bool %17 %17 %17 %17
|
||||
%13 = OpSelect %v4uint %23 %18 %18
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%tint_symbol_2 = OpFunction %void None %26
|
||||
%tint_symbol = OpFunctionParameter %v4float
|
||||
%29 = OpLabel
|
||||
OpStore %tint_symbol_1 %tint_symbol
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
OpStore %tint_pointsize %float_1
|
||||
%33 = OpFunctionCall %void %select_087ea4
|
||||
%34 = OpFunctionCall %void %tint_symbol_2 %8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%36 = OpLabel
|
||||
%37 = OpFunctionCall %void %select_087ea4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%39 = OpLabel
|
||||
%40 = OpFunctionCall %void %select_087ea4
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn select_087ea4() {
|
||||
var res : vec4<u32> = select(vec4<u32>(), vec4<u32>(), bool());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
select_087ea4();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
select_087ea4();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
select_087ea4();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/intrinsics/intrinsics.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn select(vec<3, bool>, vec<3, bool>, bool) -> vec<3, bool>
|
||||
fn select_3c25ce() {
|
||||
var res: vec3<bool> = select(vec3<bool>(), vec3<bool>(), bool());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
select_3c25ce();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
select_3c25ce();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
select_3c25ce();
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
void select_3c25ce() {
|
||||
bool3 res = (false ? bool3(false, false, false) : bool3(false, false, false));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
select_3c25ce();
|
||||
const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
select_3c25ce();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
select_3c25ce();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
void select_3c25ce() {
|
||||
bool3 res = select(bool3(), bool3(), bool());
|
||||
}
|
||||
|
||||
vertex tint_symbol vertex_main() {
|
||||
select_3c25ce();
|
||||
tint_symbol const tint_symbol_1 = {.value=float4()};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
fragment void fragment_main() {
|
||||
select_3c25ce();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
select_3c25ce();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 37
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %tint_pointsize "tint_pointsize"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %select_3c25ce "select_3c25ce"
|
||||
OpName %res "res"
|
||||
OpName %tint_symbol_2 "tint_symbol_2"
|
||||
OpName %tint_symbol "tint_symbol"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %tint_pointsize BuiltIn PointSize
|
||||
OpDecorate %tint_symbol_1 BuiltIn Position
|
||||
%float = OpTypeFloat 32
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%4 = OpConstantNull %float
|
||||
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%8 = OpConstantNull %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%bool = OpTypeBool
|
||||
%v3bool = OpTypeVector %bool 3
|
||||
%16 = OpConstantNull %bool
|
||||
%17 = OpConstantNull %v3bool
|
||||
%_ptr_Function_v3bool = OpTypePointer Function %v3bool
|
||||
%22 = OpTypeFunction %void %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%select_3c25ce = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%18 = OpVariable %_ptr_Function_v3bool Function %17
|
||||
%res = OpVariable %_ptr_Function_v3bool Function %17
|
||||
%20 = OpCompositeConstruct %v3bool %16 %16 %16
|
||||
%13 = OpSelect %v3bool %20 %17 %17
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%tint_symbol_2 = OpFunction %void None %22
|
||||
%tint_symbol = OpFunctionParameter %v4float
|
||||
%25 = OpLabel
|
||||
OpStore %tint_symbol_1 %tint_symbol
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
OpStore %tint_pointsize %float_1
|
||||
%29 = OpFunctionCall %void %select_3c25ce
|
||||
%30 = OpFunctionCall %void %tint_symbol_2 %8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %select_3c25ce
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%35 = OpLabel
|
||||
%36 = OpFunctionCall %void %select_3c25ce
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn select_3c25ce() {
|
||||
var res : vec3<bool> = select(vec3<bool>(), vec3<bool>(), bool());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
select_3c25ce();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
select_3c25ce();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
select_3c25ce();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/intrinsics/intrinsics.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn select(vec<2, u32>, vec<2, u32>, bool) -> vec<2, u32>
|
||||
fn select_51b047() {
|
||||
var res: vec2<u32> = select(vec2<u32>(), vec2<u32>(), bool());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
select_51b047();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
select_51b047();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
select_51b047();
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
void select_51b047() {
|
||||
uint2 res = (false ? uint2(0u, 0u) : uint2(0u, 0u));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
select_51b047();
|
||||
const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
select_51b047();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
select_51b047();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
void select_51b047() {
|
||||
uint2 res = select(uint2(), uint2(), bool());
|
||||
}
|
||||
|
||||
vertex tint_symbol vertex_main() {
|
||||
select_51b047();
|
||||
tint_symbol const tint_symbol_1 = {.value=float4()};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
fragment void fragment_main() {
|
||||
select_51b047();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
select_51b047();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 41
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %tint_pointsize "tint_pointsize"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %select_51b047 "select_51b047"
|
||||
OpName %res "res"
|
||||
OpName %tint_symbol_2 "tint_symbol_2"
|
||||
OpName %tint_symbol "tint_symbol"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %tint_pointsize BuiltIn PointSize
|
||||
OpDecorate %tint_symbol_1 BuiltIn Position
|
||||
%float = OpTypeFloat 32
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%4 = OpConstantNull %float
|
||||
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%8 = OpConstantNull %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%v2uint = OpTypeVector %uint 2
|
||||
%bool = OpTypeBool
|
||||
%17 = OpConstantNull %bool
|
||||
%18 = OpConstantNull %v2uint
|
||||
%v2bool = OpTypeVector %bool 2
|
||||
%_ptr_Function_v2bool = OpTypePointer Function %v2bool
|
||||
%22 = OpConstantNull %v2bool
|
||||
%_ptr_Function_v2uint = OpTypePointer Function %v2uint
|
||||
%26 = OpTypeFunction %void %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%select_51b047 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%20 = OpVariable %_ptr_Function_v2bool Function %22
|
||||
%res = OpVariable %_ptr_Function_v2uint Function %18
|
||||
%23 = OpCompositeConstruct %v2bool %17 %17
|
||||
%13 = OpSelect %v2uint %23 %18 %18
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%tint_symbol_2 = OpFunction %void None %26
|
||||
%tint_symbol = OpFunctionParameter %v4float
|
||||
%29 = OpLabel
|
||||
OpStore %tint_symbol_1 %tint_symbol
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
OpStore %tint_pointsize %float_1
|
||||
%33 = OpFunctionCall %void %select_51b047
|
||||
%34 = OpFunctionCall %void %tint_symbol_2 %8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%36 = OpLabel
|
||||
%37 = OpFunctionCall %void %select_51b047
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%39 = OpLabel
|
||||
%40 = OpFunctionCall %void %select_51b047
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn select_51b047() {
|
||||
var res : vec2<u32> = select(vec2<u32>(), vec2<u32>(), bool());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
select_51b047();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
select_51b047();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
select_51b047();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/intrinsics/intrinsics.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn select(vec<4, f32>, vec<4, f32>, bool) -> vec<4, f32>
|
||||
fn select_713567() {
|
||||
var res: vec4<f32> = select(vec4<f32>(), vec4<f32>(), bool());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
select_713567();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
select_713567();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
select_713567();
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
void select_713567() {
|
||||
float4 res = (false ? float4(0.0f, 0.0f, 0.0f, 0.0f) : float4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
select_713567();
|
||||
const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
select_713567();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
select_713567();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
void select_713567() {
|
||||
float4 res = select(float4(), float4(), bool());
|
||||
}
|
||||
|
||||
vertex tint_symbol vertex_main() {
|
||||
select_713567();
|
||||
tint_symbol const tint_symbol_1 = {.value=float4()};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
fragment void fragment_main() {
|
||||
select_713567();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
select_713567();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 38
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %tint_pointsize "tint_pointsize"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %select_713567 "select_713567"
|
||||
OpName %res "res"
|
||||
OpName %tint_symbol_2 "tint_symbol_2"
|
||||
OpName %tint_symbol "tint_symbol"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %tint_pointsize BuiltIn PointSize
|
||||
OpDecorate %tint_symbol_1 BuiltIn Position
|
||||
%float = OpTypeFloat 32
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%4 = OpConstantNull %float
|
||||
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%8 = OpConstantNull %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%bool = OpTypeBool
|
||||
%15 = OpConstantNull %bool
|
||||
%v4bool = OpTypeVector %bool 4
|
||||
%_ptr_Function_v4bool = OpTypePointer Function %v4bool
|
||||
%19 = OpConstantNull %v4bool
|
||||
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
||||
%23 = OpTypeFunction %void %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%select_713567 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%17 = OpVariable %_ptr_Function_v4bool Function %19
|
||||
%res = OpVariable %_ptr_Function_v4float Function %8
|
||||
%20 = OpCompositeConstruct %v4bool %15 %15 %15 %15
|
||||
%13 = OpSelect %v4float %20 %8 %8
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%tint_symbol_2 = OpFunction %void None %23
|
||||
%tint_symbol = OpFunctionParameter %v4float
|
||||
%26 = OpLabel
|
||||
OpStore %tint_symbol_1 %tint_symbol
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%28 = OpLabel
|
||||
OpStore %tint_pointsize %float_1
|
||||
%30 = OpFunctionCall %void %select_713567
|
||||
%31 = OpFunctionCall %void %tint_symbol_2 %8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%33 = OpLabel
|
||||
%34 = OpFunctionCall %void %select_713567
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%36 = OpLabel
|
||||
%37 = OpFunctionCall %void %select_713567
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn select_713567() {
|
||||
var res : vec4<f32> = select(vec4<f32>(), vec4<f32>(), bool());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
select_713567();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
select_713567();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
select_713567();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/intrinsics/intrinsics.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn select(vec<3, f32>, vec<3, f32>, bool) -> vec<3, f32>
|
||||
fn select_78be5f() {
|
||||
var res: vec3<f32> = select(vec3<f32>(), vec3<f32>(), bool());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
select_78be5f();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
select_78be5f();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
select_78be5f();
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
void select_78be5f() {
|
||||
float3 res = (false ? float3(0.0f, 0.0f, 0.0f) : float3(0.0f, 0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
select_78be5f();
|
||||
const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
select_78be5f();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
select_78be5f();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
void select_78be5f() {
|
||||
float3 res = select(float3(), float3(), bool());
|
||||
}
|
||||
|
||||
vertex tint_symbol vertex_main() {
|
||||
select_78be5f();
|
||||
tint_symbol const tint_symbol_1 = {.value=float4()};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
fragment void fragment_main() {
|
||||
select_78be5f();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
select_78be5f();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 40
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %tint_pointsize "tint_pointsize"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %select_78be5f "select_78be5f"
|
||||
OpName %res "res"
|
||||
OpName %tint_symbol_2 "tint_symbol_2"
|
||||
OpName %tint_symbol "tint_symbol"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %tint_pointsize BuiltIn PointSize
|
||||
OpDecorate %tint_symbol_1 BuiltIn Position
|
||||
%float = OpTypeFloat 32
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%4 = OpConstantNull %float
|
||||
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%8 = OpConstantNull %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%v3float = OpTypeVector %float 3
|
||||
%bool = OpTypeBool
|
||||
%16 = OpConstantNull %bool
|
||||
%17 = OpConstantNull %v3float
|
||||
%v3bool = OpTypeVector %bool 3
|
||||
%_ptr_Function_v3bool = OpTypePointer Function %v3bool
|
||||
%21 = OpConstantNull %v3bool
|
||||
%_ptr_Function_v3float = OpTypePointer Function %v3float
|
||||
%25 = OpTypeFunction %void %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%select_78be5f = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%19 = OpVariable %_ptr_Function_v3bool Function %21
|
||||
%res = OpVariable %_ptr_Function_v3float Function %17
|
||||
%22 = OpCompositeConstruct %v3bool %16 %16 %16
|
||||
%13 = OpSelect %v3float %22 %17 %17
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%tint_symbol_2 = OpFunction %void None %25
|
||||
%tint_symbol = OpFunctionParameter %v4float
|
||||
%28 = OpLabel
|
||||
OpStore %tint_symbol_1 %tint_symbol
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%30 = OpLabel
|
||||
OpStore %tint_pointsize %float_1
|
||||
%32 = OpFunctionCall %void %select_78be5f
|
||||
%33 = OpFunctionCall %void %tint_symbol_2 %8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%35 = OpLabel
|
||||
%36 = OpFunctionCall %void %select_78be5f
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%38 = OpLabel
|
||||
%39 = OpFunctionCall %void %select_78be5f
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn select_78be5f() {
|
||||
var res : vec3<f32> = select(vec3<f32>(), vec3<f32>(), bool());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
select_78be5f();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
select_78be5f();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
select_78be5f();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/intrinsics/intrinsics.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn select(vec<3, i32>, vec<3, i32>, bool) -> vec<3, i32>
|
||||
fn select_8fa62c() {
|
||||
var res: vec3<i32> = select(vec3<i32>(), vec3<i32>(), bool());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
select_8fa62c();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
select_8fa62c();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
select_8fa62c();
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
void select_8fa62c() {
|
||||
int3 res = (false ? int3(0, 0, 0) : int3(0, 0, 0));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
select_8fa62c();
|
||||
const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
select_8fa62c();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
select_8fa62c();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
void select_8fa62c() {
|
||||
int3 res = select(int3(), int3(), bool());
|
||||
}
|
||||
|
||||
vertex tint_symbol vertex_main() {
|
||||
select_8fa62c();
|
||||
tint_symbol const tint_symbol_1 = {.value=float4()};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
fragment void fragment_main() {
|
||||
select_8fa62c();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
select_8fa62c();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 41
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %tint_pointsize "tint_pointsize"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %select_8fa62c "select_8fa62c"
|
||||
OpName %res "res"
|
||||
OpName %tint_symbol_2 "tint_symbol_2"
|
||||
OpName %tint_symbol "tint_symbol"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %tint_pointsize BuiltIn PointSize
|
||||
OpDecorate %tint_symbol_1 BuiltIn Position
|
||||
%float = OpTypeFloat 32
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%4 = OpConstantNull %float
|
||||
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%8 = OpConstantNull %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%int = OpTypeInt 32 1
|
||||
%v3int = OpTypeVector %int 3
|
||||
%bool = OpTypeBool
|
||||
%17 = OpConstantNull %bool
|
||||
%18 = OpConstantNull %v3int
|
||||
%v3bool = OpTypeVector %bool 3
|
||||
%_ptr_Function_v3bool = OpTypePointer Function %v3bool
|
||||
%22 = OpConstantNull %v3bool
|
||||
%_ptr_Function_v3int = OpTypePointer Function %v3int
|
||||
%26 = OpTypeFunction %void %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%select_8fa62c = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%20 = OpVariable %_ptr_Function_v3bool Function %22
|
||||
%res = OpVariable %_ptr_Function_v3int Function %18
|
||||
%23 = OpCompositeConstruct %v3bool %17 %17 %17
|
||||
%13 = OpSelect %v3int %23 %18 %18
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%tint_symbol_2 = OpFunction %void None %26
|
||||
%tint_symbol = OpFunctionParameter %v4float
|
||||
%29 = OpLabel
|
||||
OpStore %tint_symbol_1 %tint_symbol
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
OpStore %tint_pointsize %float_1
|
||||
%33 = OpFunctionCall %void %select_8fa62c
|
||||
%34 = OpFunctionCall %void %tint_symbol_2 %8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%36 = OpLabel
|
||||
%37 = OpFunctionCall %void %select_8fa62c
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%39 = OpLabel
|
||||
%40 = OpFunctionCall %void %select_8fa62c
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn select_8fa62c() {
|
||||
var res : vec3<i32> = select(vec3<i32>(), vec3<i32>(), bool());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
select_8fa62c();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
select_8fa62c();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
select_8fa62c();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/intrinsics/intrinsics.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn select(vec<4, i32>, vec<4, i32>, bool) -> vec<4, i32>
|
||||
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();
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
void select_ab069f() {
|
||||
int4 res = (false ? int4(0, 0, 0, 0) : int4(0, 0, 0, 0));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
select_ab069f();
|
||||
const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
select_ab069f();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
select_ab069f();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
void select_ab069f() {
|
||||
int4 res = select(int4(), int4(), bool());
|
||||
}
|
||||
|
||||
vertex tint_symbol vertex_main() {
|
||||
select_ab069f();
|
||||
tint_symbol const tint_symbol_1 = {.value=float4()};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
fragment void fragment_main() {
|
||||
select_ab069f();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
select_ab069f();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 41
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %tint_pointsize "tint_pointsize"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %select_ab069f "select_ab069f"
|
||||
OpName %res "res"
|
||||
OpName %tint_symbol_2 "tint_symbol_2"
|
||||
OpName %tint_symbol "tint_symbol"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %tint_pointsize BuiltIn PointSize
|
||||
OpDecorate %tint_symbol_1 BuiltIn Position
|
||||
%float = OpTypeFloat 32
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%4 = OpConstantNull %float
|
||||
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%8 = OpConstantNull %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%int = OpTypeInt 32 1
|
||||
%v4int = OpTypeVector %int 4
|
||||
%bool = OpTypeBool
|
||||
%17 = OpConstantNull %bool
|
||||
%18 = OpConstantNull %v4int
|
||||
%v4bool = OpTypeVector %bool 4
|
||||
%_ptr_Function_v4bool = OpTypePointer Function %v4bool
|
||||
%22 = OpConstantNull %v4bool
|
||||
%_ptr_Function_v4int = OpTypePointer Function %v4int
|
||||
%26 = OpTypeFunction %void %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%select_ab069f = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%20 = OpVariable %_ptr_Function_v4bool Function %22
|
||||
%res = OpVariable %_ptr_Function_v4int Function %18
|
||||
%23 = OpCompositeConstruct %v4bool %17 %17 %17 %17
|
||||
%13 = OpSelect %v4int %23 %18 %18
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%tint_symbol_2 = OpFunction %void None %26
|
||||
%tint_symbol = OpFunctionParameter %v4float
|
||||
%29 = OpLabel
|
||||
OpStore %tint_symbol_1 %tint_symbol
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
OpStore %tint_pointsize %float_1
|
||||
%33 = OpFunctionCall %void %select_ab069f
|
||||
%34 = OpFunctionCall %void %tint_symbol_2 %8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%36 = OpLabel
|
||||
%37 = OpFunctionCall %void %select_ab069f
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%39 = OpLabel
|
||||
%40 = OpFunctionCall %void %select_ab069f
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
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();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/intrinsics/intrinsics.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn select(vec<3, u32>, vec<3, u32>, bool) -> vec<3, u32>
|
||||
fn select_b04721() {
|
||||
var res: vec3<u32> = select(vec3<u32>(), vec3<u32>(), bool());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
select_b04721();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
select_b04721();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
select_b04721();
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
void select_b04721() {
|
||||
uint3 res = (false ? uint3(0u, 0u, 0u) : uint3(0u, 0u, 0u));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
select_b04721();
|
||||
const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
select_b04721();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
select_b04721();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
void select_b04721() {
|
||||
uint3 res = select(uint3(), uint3(), bool());
|
||||
}
|
||||
|
||||
vertex tint_symbol vertex_main() {
|
||||
select_b04721();
|
||||
tint_symbol const tint_symbol_1 = {.value=float4()};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
fragment void fragment_main() {
|
||||
select_b04721();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
select_b04721();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 41
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %tint_pointsize "tint_pointsize"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %select_b04721 "select_b04721"
|
||||
OpName %res "res"
|
||||
OpName %tint_symbol_2 "tint_symbol_2"
|
||||
OpName %tint_symbol "tint_symbol"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %tint_pointsize BuiltIn PointSize
|
||||
OpDecorate %tint_symbol_1 BuiltIn Position
|
||||
%float = OpTypeFloat 32
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%4 = OpConstantNull %float
|
||||
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%8 = OpConstantNull %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%v3uint = OpTypeVector %uint 3
|
||||
%bool = OpTypeBool
|
||||
%17 = OpConstantNull %bool
|
||||
%18 = OpConstantNull %v3uint
|
||||
%v3bool = OpTypeVector %bool 3
|
||||
%_ptr_Function_v3bool = OpTypePointer Function %v3bool
|
||||
%22 = OpConstantNull %v3bool
|
||||
%_ptr_Function_v3uint = OpTypePointer Function %v3uint
|
||||
%26 = OpTypeFunction %void %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%select_b04721 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%20 = OpVariable %_ptr_Function_v3bool Function %22
|
||||
%res = OpVariable %_ptr_Function_v3uint Function %18
|
||||
%23 = OpCompositeConstruct %v3bool %17 %17 %17
|
||||
%13 = OpSelect %v3uint %23 %18 %18
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%tint_symbol_2 = OpFunction %void None %26
|
||||
%tint_symbol = OpFunctionParameter %v4float
|
||||
%29 = OpLabel
|
||||
OpStore %tint_symbol_1 %tint_symbol
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
OpStore %tint_pointsize %float_1
|
||||
%33 = OpFunctionCall %void %select_b04721
|
||||
%34 = OpFunctionCall %void %tint_symbol_2 %8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%36 = OpLabel
|
||||
%37 = OpFunctionCall %void %select_b04721
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%39 = OpLabel
|
||||
%40 = OpFunctionCall %void %select_b04721
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn select_b04721() {
|
||||
var res : vec3<u32> = select(vec3<u32>(), vec3<u32>(), bool());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
select_b04721();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
select_b04721();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
select_b04721();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/intrinsics/intrinsics.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn select(vec<2, i32>, vec<2, i32>, bool) -> vec<2, i32>
|
||||
fn select_bb447f() {
|
||||
var res: vec2<i32> = select(vec2<i32>(), vec2<i32>(), bool());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
select_bb447f();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
select_bb447f();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
select_bb447f();
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
void select_bb447f() {
|
||||
int2 res = (false ? int2(0, 0) : int2(0, 0));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
select_bb447f();
|
||||
const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
select_bb447f();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
select_bb447f();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
void select_bb447f() {
|
||||
int2 res = select(int2(), int2(), bool());
|
||||
}
|
||||
|
||||
vertex tint_symbol vertex_main() {
|
||||
select_bb447f();
|
||||
tint_symbol const tint_symbol_1 = {.value=float4()};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
fragment void fragment_main() {
|
||||
select_bb447f();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
select_bb447f();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 41
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %tint_pointsize "tint_pointsize"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %select_bb447f "select_bb447f"
|
||||
OpName %res "res"
|
||||
OpName %tint_symbol_2 "tint_symbol_2"
|
||||
OpName %tint_symbol "tint_symbol"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %tint_pointsize BuiltIn PointSize
|
||||
OpDecorate %tint_symbol_1 BuiltIn Position
|
||||
%float = OpTypeFloat 32
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%4 = OpConstantNull %float
|
||||
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%8 = OpConstantNull %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%int = OpTypeInt 32 1
|
||||
%v2int = OpTypeVector %int 2
|
||||
%bool = OpTypeBool
|
||||
%17 = OpConstantNull %bool
|
||||
%18 = OpConstantNull %v2int
|
||||
%v2bool = OpTypeVector %bool 2
|
||||
%_ptr_Function_v2bool = OpTypePointer Function %v2bool
|
||||
%22 = OpConstantNull %v2bool
|
||||
%_ptr_Function_v2int = OpTypePointer Function %v2int
|
||||
%26 = OpTypeFunction %void %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%select_bb447f = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%20 = OpVariable %_ptr_Function_v2bool Function %22
|
||||
%res = OpVariable %_ptr_Function_v2int Function %18
|
||||
%23 = OpCompositeConstruct %v2bool %17 %17
|
||||
%13 = OpSelect %v2int %23 %18 %18
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%tint_symbol_2 = OpFunction %void None %26
|
||||
%tint_symbol = OpFunctionParameter %v4float
|
||||
%29 = OpLabel
|
||||
OpStore %tint_symbol_1 %tint_symbol
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%31 = OpLabel
|
||||
OpStore %tint_pointsize %float_1
|
||||
%33 = OpFunctionCall %void %select_bb447f
|
||||
%34 = OpFunctionCall %void %tint_symbol_2 %8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%36 = OpLabel
|
||||
%37 = OpFunctionCall %void %select_bb447f
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%39 = OpLabel
|
||||
%40 = OpFunctionCall %void %select_bb447f
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn select_bb447f() {
|
||||
var res : vec2<i32> = select(vec2<i32>(), vec2<i32>(), bool());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
select_bb447f();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
select_bb447f();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
select_bb447f();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/intrinsics/intrinsics.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn select(vec<2, f32>, vec<2, f32>, bool) -> vec<2, f32>
|
||||
fn select_bf3d29() {
|
||||
var res: vec2<f32> = select(vec2<f32>(), vec2<f32>(), bool());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
select_bf3d29();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
select_bf3d29();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
select_bf3d29();
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
void select_bf3d29() {
|
||||
float2 res = (false ? float2(0.0f, 0.0f) : float2(0.0f, 0.0f));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
select_bf3d29();
|
||||
const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
select_bf3d29();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
select_bf3d29();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
void select_bf3d29() {
|
||||
float2 res = select(float2(), float2(), bool());
|
||||
}
|
||||
|
||||
vertex tint_symbol vertex_main() {
|
||||
select_bf3d29();
|
||||
tint_symbol const tint_symbol_1 = {.value=float4()};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
fragment void fragment_main() {
|
||||
select_bf3d29();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
select_bf3d29();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 40
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %tint_pointsize "tint_pointsize"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %select_bf3d29 "select_bf3d29"
|
||||
OpName %res "res"
|
||||
OpName %tint_symbol_2 "tint_symbol_2"
|
||||
OpName %tint_symbol "tint_symbol"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %tint_pointsize BuiltIn PointSize
|
||||
OpDecorate %tint_symbol_1 BuiltIn Position
|
||||
%float = OpTypeFloat 32
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%4 = OpConstantNull %float
|
||||
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%8 = OpConstantNull %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%v2float = OpTypeVector %float 2
|
||||
%bool = OpTypeBool
|
||||
%16 = OpConstantNull %bool
|
||||
%17 = OpConstantNull %v2float
|
||||
%v2bool = OpTypeVector %bool 2
|
||||
%_ptr_Function_v2bool = OpTypePointer Function %v2bool
|
||||
%21 = OpConstantNull %v2bool
|
||||
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
||||
%25 = OpTypeFunction %void %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%select_bf3d29 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%19 = OpVariable %_ptr_Function_v2bool Function %21
|
||||
%res = OpVariable %_ptr_Function_v2float Function %17
|
||||
%22 = OpCompositeConstruct %v2bool %16 %16
|
||||
%13 = OpSelect %v2float %22 %17 %17
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%tint_symbol_2 = OpFunction %void None %25
|
||||
%tint_symbol = OpFunctionParameter %v4float
|
||||
%28 = OpLabel
|
||||
OpStore %tint_symbol_1 %tint_symbol
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%30 = OpLabel
|
||||
OpStore %tint_pointsize %float_1
|
||||
%32 = OpFunctionCall %void %select_bf3d29
|
||||
%33 = OpFunctionCall %void %tint_symbol_2 %8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%35 = OpLabel
|
||||
%36 = OpFunctionCall %void %select_bf3d29
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%38 = OpLabel
|
||||
%39 = OpFunctionCall %void %select_bf3d29
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn select_bf3d29() {
|
||||
var res : vec2<f32> = select(vec2<f32>(), vec2<f32>(), bool());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
select_bf3d29();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
select_bf3d29();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
select_bf3d29();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/intrinsics/intrinsics.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn select(vec<4, bool>, vec<4, bool>, bool) -> vec<4, bool>
|
||||
fn select_c41bd1() {
|
||||
var res: vec4<bool> = select(vec4<bool>(), vec4<bool>(), bool());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
select_c41bd1();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
select_c41bd1();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
select_c41bd1();
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
void select_c41bd1() {
|
||||
bool4 res = (false ? bool4(false, false, false, false) : bool4(false, false, false, false));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
select_c41bd1();
|
||||
const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
select_c41bd1();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
select_c41bd1();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
void select_c41bd1() {
|
||||
bool4 res = select(bool4(), bool4(), bool());
|
||||
}
|
||||
|
||||
vertex tint_symbol vertex_main() {
|
||||
select_c41bd1();
|
||||
tint_symbol const tint_symbol_1 = {.value=float4()};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
fragment void fragment_main() {
|
||||
select_c41bd1();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
select_c41bd1();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 37
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %tint_pointsize "tint_pointsize"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %select_c41bd1 "select_c41bd1"
|
||||
OpName %res "res"
|
||||
OpName %tint_symbol_2 "tint_symbol_2"
|
||||
OpName %tint_symbol "tint_symbol"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %tint_pointsize BuiltIn PointSize
|
||||
OpDecorate %tint_symbol_1 BuiltIn Position
|
||||
%float = OpTypeFloat 32
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%4 = OpConstantNull %float
|
||||
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%8 = OpConstantNull %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%bool = OpTypeBool
|
||||
%v4bool = OpTypeVector %bool 4
|
||||
%16 = OpConstantNull %bool
|
||||
%17 = OpConstantNull %v4bool
|
||||
%_ptr_Function_v4bool = OpTypePointer Function %v4bool
|
||||
%22 = OpTypeFunction %void %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%select_c41bd1 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%18 = OpVariable %_ptr_Function_v4bool Function %17
|
||||
%res = OpVariable %_ptr_Function_v4bool Function %17
|
||||
%20 = OpCompositeConstruct %v4bool %16 %16 %16 %16
|
||||
%13 = OpSelect %v4bool %20 %17 %17
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%tint_symbol_2 = OpFunction %void None %22
|
||||
%tint_symbol = OpFunctionParameter %v4float
|
||||
%25 = OpLabel
|
||||
OpStore %tint_symbol_1 %tint_symbol
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
OpStore %tint_pointsize %float_1
|
||||
%29 = OpFunctionCall %void %select_c41bd1
|
||||
%30 = OpFunctionCall %void %tint_symbol_2 %8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %select_c41bd1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%35 = OpLabel
|
||||
%36 = OpFunctionCall %void %select_c41bd1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn select_c41bd1() {
|
||||
var res : vec4<bool> = select(vec4<bool>(), vec4<bool>(), bool());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
select_c41bd1();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
select_c41bd1();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
select_c41bd1();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2021 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// File generated by tools/intrinsic-gen
|
||||
// using the template:
|
||||
// test/intrinsics/intrinsics.wgsl.tmpl
|
||||
// and the intrinsic defintion file:
|
||||
// src/intrinsics.def
|
||||
//
|
||||
// Do not modify this file directly
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// fn select(vec<2, bool>, vec<2, bool>, bool) -> vec<2, bool>
|
||||
fn select_fb7e53() {
|
||||
var res: vec2<bool> = select(vec2<bool>(), vec2<bool>(), bool());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
select_fb7e53();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
select_fb7e53();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
select_fb7e53();
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
void select_fb7e53() {
|
||||
bool2 res = (false ? bool2(false, false) : bool2(false, false));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
select_fb7e53();
|
||||
const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
select_fb7e53();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
select_fb7e53();
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
#include <metal_stdlib>
|
||||
|
||||
using namespace metal;
|
||||
struct tint_symbol {
|
||||
float4 value [[position]];
|
||||
};
|
||||
|
||||
void select_fb7e53() {
|
||||
bool2 res = select(bool2(), bool2(), bool());
|
||||
}
|
||||
|
||||
vertex tint_symbol vertex_main() {
|
||||
select_fb7e53();
|
||||
tint_symbol const tint_symbol_1 = {.value=float4()};
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
fragment void fragment_main() {
|
||||
select_fb7e53();
|
||||
return;
|
||||
}
|
||||
|
||||
kernel void compute_main() {
|
||||
select_fb7e53();
|
||||
return;
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
; SPIR-V
|
||||
; Version: 1.3
|
||||
; Generator: Google Tint Compiler; 0
|
||||
; Bound: 37
|
||||
; Schema: 0
|
||||
OpCapability Shader
|
||||
OpMemoryModel Logical GLSL450
|
||||
OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1
|
||||
OpEntryPoint Fragment %fragment_main "fragment_main"
|
||||
OpEntryPoint GLCompute %compute_main "compute_main"
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %tint_pointsize "tint_pointsize"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %select_fb7e53 "select_fb7e53"
|
||||
OpName %res "res"
|
||||
OpName %tint_symbol_2 "tint_symbol_2"
|
||||
OpName %tint_symbol "tint_symbol"
|
||||
OpName %vertex_main "vertex_main"
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %tint_pointsize BuiltIn PointSize
|
||||
OpDecorate %tint_symbol_1 BuiltIn Position
|
||||
%float = OpTypeFloat 32
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
%4 = OpConstantNull %float
|
||||
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%8 = OpConstantNull %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %8
|
||||
%void = OpTypeVoid
|
||||
%9 = OpTypeFunction %void
|
||||
%bool = OpTypeBool
|
||||
%v2bool = OpTypeVector %bool 2
|
||||
%16 = OpConstantNull %bool
|
||||
%17 = OpConstantNull %v2bool
|
||||
%_ptr_Function_v2bool = OpTypePointer Function %v2bool
|
||||
%22 = OpTypeFunction %void %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%select_fb7e53 = OpFunction %void None %9
|
||||
%12 = OpLabel
|
||||
%18 = OpVariable %_ptr_Function_v2bool Function %17
|
||||
%res = OpVariable %_ptr_Function_v2bool Function %17
|
||||
%20 = OpCompositeConstruct %v2bool %16 %16
|
||||
%13 = OpSelect %v2bool %20 %17 %17
|
||||
OpStore %res %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%tint_symbol_2 = OpFunction %void None %22
|
||||
%tint_symbol = OpFunctionParameter %v4float
|
||||
%25 = OpLabel
|
||||
OpStore %tint_symbol_1 %tint_symbol
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%vertex_main = OpFunction %void None %9
|
||||
%27 = OpLabel
|
||||
OpStore %tint_pointsize %float_1
|
||||
%29 = OpFunctionCall %void %select_fb7e53
|
||||
%30 = OpFunctionCall %void %tint_symbol_2 %8
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %9
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %select_fb7e53
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %9
|
||||
%35 = OpLabel
|
||||
%36 = OpFunctionCall %void %select_fb7e53
|
||||
OpReturn
|
||||
OpFunctionEnd
|
|
@ -0,0 +1,19 @@
|
|||
fn select_fb7e53() {
|
||||
var res : vec2<bool> = select(vec2<bool>(), vec2<bool>(), bool());
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
select_fb7e53();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
select_fb7e53();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
select_fb7e53();
|
||||
}
|
Loading…
Reference in New Issue