mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-10 14:08:04 +00:00
test: Generate more permutations for pointers
Instead of just generating pointers to functions, generate pointers to all permuted storage types and accesses. Change-Id: I930b20150d823877eaf72dd7cac850078fe22f35 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/54656 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: James Price <jrprice@google.com> Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
50
test/intrinsics/gen/arrayLength/1588cd.wgsl
Normal file
50
test/intrinsics/gen/arrayLength/1588cd.wgsl
Normal file
@@ -0,0 +1,50 @@
|
||||
// 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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
[[block]]
|
||||
struct SB_RO {
|
||||
arg_0: array<i32>;
|
||||
};
|
||||
[[group(0), binding(1)]] var<storage, read> sb_ro : SB_RO;
|
||||
|
||||
// fn arrayLength(ptr<storage, array<i32>, read>) -> u32
|
||||
fn arrayLength_1588cd() {
|
||||
var res: u32 = arrayLength(&sb_ro.arg_0);
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
arrayLength_1588cd();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
arrayLength_1588cd();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
arrayLength_1588cd();
|
||||
}
|
||||
29
test/intrinsics/gen/arrayLength/1588cd.wgsl.expected.hlsl
Normal file
29
test/intrinsics/gen/arrayLength/1588cd.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,29 @@
|
||||
ByteAddressBuffer sb_ro : register(t1, space0);
|
||||
|
||||
void arrayLength_1588cd() {
|
||||
uint tint_symbol_2 = 0u;
|
||||
sb_ro.GetDimensions(tint_symbol_2);
|
||||
const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
|
||||
uint res = tint_symbol_3;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
arrayLength_1588cd();
|
||||
const tint_symbol tint_symbol_4 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
|
||||
return tint_symbol_4;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
arrayLength_1588cd();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
arrayLength_1588cd();
|
||||
return;
|
||||
}
|
||||
37
test/intrinsics/gen/arrayLength/1588cd.wgsl.expected.msl
Normal file
37
test/intrinsics/gen/arrayLength/1588cd.wgsl.expected.msl
Normal file
@@ -0,0 +1,37 @@
|
||||
SKIP: FAILED
|
||||
|
||||
|
||||
[[block]]
|
||||
struct SB_RO {
|
||||
arg_0 : array<i32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(1)]] var<storage, read> sb_ro : SB_RO;
|
||||
|
||||
fn arrayLength_1588cd() {
|
||||
var res : u32 = arrayLength(&(sb_ro.arg_0));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
[[builtin(position)]]
|
||||
value : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> tint_symbol {
|
||||
arrayLength_1588cd();
|
||||
let tint_symbol_1 : tint_symbol = tint_symbol(vec4<f32>());
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
arrayLength_1588cd();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
arrayLength_1588cd();
|
||||
}
|
||||
|
||||
Failed to generate: error: Unknown import method: arrayLength
|
||||
82
test/intrinsics/gen/arrayLength/1588cd.wgsl.expected.spvasm
Normal file
82
test/intrinsics/gen/arrayLength/1588cd.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,82 @@
|
||||
; 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 %SB_RO "SB_RO"
|
||||
OpMemberName %SB_RO 0 "arg_0"
|
||||
OpName %sb_ro "sb_ro"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %arrayLength_1588cd "arrayLength_1588cd"
|
||||
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 %SB_RO Block
|
||||
OpMemberDecorate %SB_RO 0 Offset 0
|
||||
OpDecorate %_runtimearr_int ArrayStride 4
|
||||
OpDecorate %sb_ro NonWritable
|
||||
OpDecorate %sb_ro DescriptorSet 0
|
||||
OpDecorate %sb_ro Binding 1
|
||||
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
|
||||
%int = OpTypeInt 32 1
|
||||
%_runtimearr_int = OpTypeRuntimeArray %int
|
||||
%SB_RO = OpTypeStruct %_runtimearr_int
|
||||
%_ptr_StorageBuffer_SB_RO = OpTypePointer StorageBuffer %SB_RO
|
||||
%sb_ro = OpVariable %_ptr_StorageBuffer_SB_RO StorageBuffer
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%13 = OpConstantNull %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %13
|
||||
%void = OpTypeVoid
|
||||
%14 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%_ptr_Function_uint = OpTypePointer Function %uint
|
||||
%22 = OpConstantNull %uint
|
||||
%23 = OpTypeFunction %void %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%arrayLength_1588cd = OpFunction %void None %14
|
||||
%17 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_uint Function %22
|
||||
%18 = OpArrayLength %uint %sb_ro 0
|
||||
OpStore %res %18
|
||||
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 %14
|
||||
%28 = OpLabel
|
||||
OpStore %tint_pointsize %float_1
|
||||
%30 = OpFunctionCall %void %arrayLength_1588cd
|
||||
%31 = OpFunctionCall %void %tint_symbol_2 %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %14
|
||||
%33 = OpLabel
|
||||
%34 = OpFunctionCall %void %arrayLength_1588cd
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %14
|
||||
%36 = OpLabel
|
||||
%37 = OpFunctionCall %void %arrayLength_1588cd
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
26
test/intrinsics/gen/arrayLength/1588cd.wgsl.expected.wgsl
Normal file
26
test/intrinsics/gen/arrayLength/1588cd.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,26 @@
|
||||
[[block]]
|
||||
struct SB_RO {
|
||||
arg_0 : array<i32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(1)]] var<storage, read> sb_ro : SB_RO;
|
||||
|
||||
fn arrayLength_1588cd() {
|
||||
var res : u32 = arrayLength(&(sb_ro.arg_0));
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
arrayLength_1588cd();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
arrayLength_1588cd();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
arrayLength_1588cd();
|
||||
}
|
||||
50
test/intrinsics/gen/arrayLength/61b1c7.wgsl
Normal file
50
test/intrinsics/gen/arrayLength/61b1c7.wgsl
Normal file
@@ -0,0 +1,50 @@
|
||||
// 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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
[[block]]
|
||||
struct SB_RW {
|
||||
arg_0: array<i32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<storage, read_write> sb_rw : SB_RW;
|
||||
|
||||
// fn arrayLength(ptr<storage, array<i32>, read_write>) -> u32
|
||||
fn arrayLength_61b1c7() {
|
||||
var res: u32 = arrayLength(&sb_rw.arg_0);
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
arrayLength_61b1c7();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
arrayLength_61b1c7();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
arrayLength_61b1c7();
|
||||
}
|
||||
29
test/intrinsics/gen/arrayLength/61b1c7.wgsl.expected.hlsl
Normal file
29
test/intrinsics/gen/arrayLength/61b1c7.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,29 @@
|
||||
RWByteAddressBuffer sb_rw : register(u0, space0);
|
||||
|
||||
void arrayLength_61b1c7() {
|
||||
uint tint_symbol_2 = 0u;
|
||||
sb_rw.GetDimensions(tint_symbol_2);
|
||||
const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
|
||||
uint res = tint_symbol_3;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
arrayLength_61b1c7();
|
||||
const tint_symbol tint_symbol_4 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
|
||||
return tint_symbol_4;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
arrayLength_61b1c7();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
arrayLength_61b1c7();
|
||||
return;
|
||||
}
|
||||
37
test/intrinsics/gen/arrayLength/61b1c7.wgsl.expected.msl
Normal file
37
test/intrinsics/gen/arrayLength/61b1c7.wgsl.expected.msl
Normal file
@@ -0,0 +1,37 @@
|
||||
SKIP: FAILED
|
||||
|
||||
|
||||
[[block]]
|
||||
struct SB_RW {
|
||||
arg_0 : array<i32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]] var<storage, read_write> sb_rw : SB_RW;
|
||||
|
||||
fn arrayLength_61b1c7() {
|
||||
var res : u32 = arrayLength(&(sb_rw.arg_0));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
[[builtin(position)]]
|
||||
value : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> tint_symbol {
|
||||
arrayLength_61b1c7();
|
||||
let tint_symbol_1 : tint_symbol = tint_symbol(vec4<f32>());
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
arrayLength_61b1c7();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
arrayLength_61b1c7();
|
||||
}
|
||||
|
||||
Failed to generate: error: Unknown import method: arrayLength
|
||||
81
test/intrinsics/gen/arrayLength/61b1c7.wgsl.expected.spvasm
Normal file
81
test/intrinsics/gen/arrayLength/61b1c7.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,81 @@
|
||||
; 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 %SB_RW "SB_RW"
|
||||
OpMemberName %SB_RW 0 "arg_0"
|
||||
OpName %sb_rw "sb_rw"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %arrayLength_61b1c7 "arrayLength_61b1c7"
|
||||
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 %SB_RW Block
|
||||
OpMemberDecorate %SB_RW 0 Offset 0
|
||||
OpDecorate %_runtimearr_int ArrayStride 4
|
||||
OpDecorate %sb_rw DescriptorSet 0
|
||||
OpDecorate %sb_rw Binding 0
|
||||
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
|
||||
%int = OpTypeInt 32 1
|
||||
%_runtimearr_int = OpTypeRuntimeArray %int
|
||||
%SB_RW = OpTypeStruct %_runtimearr_int
|
||||
%_ptr_StorageBuffer_SB_RW = OpTypePointer StorageBuffer %SB_RW
|
||||
%sb_rw = OpVariable %_ptr_StorageBuffer_SB_RW StorageBuffer
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%13 = OpConstantNull %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %13
|
||||
%void = OpTypeVoid
|
||||
%14 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%_ptr_Function_uint = OpTypePointer Function %uint
|
||||
%22 = OpConstantNull %uint
|
||||
%23 = OpTypeFunction %void %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%arrayLength_61b1c7 = OpFunction %void None %14
|
||||
%17 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_uint Function %22
|
||||
%18 = OpArrayLength %uint %sb_rw 0
|
||||
OpStore %res %18
|
||||
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 %14
|
||||
%28 = OpLabel
|
||||
OpStore %tint_pointsize %float_1
|
||||
%30 = OpFunctionCall %void %arrayLength_61b1c7
|
||||
%31 = OpFunctionCall %void %tint_symbol_2 %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %14
|
||||
%33 = OpLabel
|
||||
%34 = OpFunctionCall %void %arrayLength_61b1c7
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %14
|
||||
%36 = OpLabel
|
||||
%37 = OpFunctionCall %void %arrayLength_61b1c7
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
26
test/intrinsics/gen/arrayLength/61b1c7.wgsl.expected.wgsl
Normal file
26
test/intrinsics/gen/arrayLength/61b1c7.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,26 @@
|
||||
[[block]]
|
||||
struct SB_RW {
|
||||
arg_0 : array<i32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]] var<storage, read_write> sb_rw : SB_RW;
|
||||
|
||||
fn arrayLength_61b1c7() {
|
||||
var res : u32 = arrayLength(&(sb_rw.arg_0));
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
arrayLength_61b1c7();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
arrayLength_61b1c7();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
arrayLength_61b1c7();
|
||||
}
|
||||
@@ -23,14 +23,14 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
[[block]]
|
||||
struct SB {
|
||||
struct SB_RO {
|
||||
arg_0: array<u32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<storage, read> sb : SB;
|
||||
[[group(0), binding(1)]] var<storage, read> sb_ro : SB_RO;
|
||||
|
||||
// fn arrayLength(array<u32>) -> u32
|
||||
fn arrayLength_647a40() {
|
||||
var res: u32 = arrayLength(sb.arg_0);
|
||||
var res: u32 = arrayLength(sb_ro.arg_0);
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
intrinsics/gen/arrayLength/647a40.wgsl:33:18 warning: use of deprecated intrinsic
|
||||
var res: u32 = arrayLength(sb.arg_0);
|
||||
var res: u32 = arrayLength(sb_ro.arg_0);
|
||||
^^^^^^^^^^^
|
||||
|
||||
ByteAddressBuffer sb : register(t0, space0);
|
||||
ByteAddressBuffer sb_ro : register(t1, space0);
|
||||
|
||||
void arrayLength_647a40() {
|
||||
uint tint_symbol_2 = 0u;
|
||||
sb.GetDimensions(tint_symbol_2);
|
||||
sb_ro.GetDimensions(tint_symbol_2);
|
||||
const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
|
||||
uint res = tint_symbol_3;
|
||||
}
|
||||
|
||||
@@ -1,20 +1,31 @@
|
||||
SKIP: FAILED
|
||||
|
||||
intrinsics/gen/arrayLength/647a40.wgsl:33:18 warning: use of deprecated intrinsic
|
||||
var res: u32 = arrayLength(sb_ro.arg_0);
|
||||
^^^^^^^^^^^
|
||||
|
||||
|
||||
[[block]]
|
||||
struct SB {
|
||||
struct SB_RO {
|
||||
arg_0 : array<u32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]] var<storage> sb : [[access(read)]] SB;
|
||||
[[group(0), binding(1)]] var<storage, read> sb_ro : SB_RO;
|
||||
|
||||
fn arrayLength_647a40() {
|
||||
var res : u32 = arrayLength(sb.arg_0);
|
||||
var res : u32 = arrayLength(sb_ro.arg_0);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
[[builtin(position)]]
|
||||
value : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() {
|
||||
fn vertex_main() -> tint_symbol {
|
||||
arrayLength_647a40();
|
||||
let tint_symbol_1 : tint_symbol = tint_symbol(vec4<f32>());
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
intrinsics/gen/arrayLength/647a40.wgsl:33:18 warning: use of deprecated intrinsic
|
||||
var res: u32 = arrayLength(sb.arg_0);
|
||||
var res: u32 = arrayLength(sb_ro.arg_0);
|
||||
^^^^^^^^^^^
|
||||
|
||||
; SPIR-V
|
||||
@@ -15,9 +15,9 @@ intrinsics/gen/arrayLength/647a40.wgsl:33:18 warning: use of deprecated intrinsi
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %tint_pointsize "tint_pointsize"
|
||||
OpName %SB "SB"
|
||||
OpMemberName %SB 0 "arg_0"
|
||||
OpName %sb "sb"
|
||||
OpName %SB_RO "SB_RO"
|
||||
OpMemberName %SB_RO 0 "arg_0"
|
||||
OpName %sb_ro "sb_ro"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %arrayLength_647a40 "arrayLength_647a40"
|
||||
OpName %res "res"
|
||||
@@ -27,12 +27,12 @@ intrinsics/gen/arrayLength/647a40.wgsl:33:18 warning: use of deprecated intrinsi
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %tint_pointsize BuiltIn PointSize
|
||||
OpDecorate %SB Block
|
||||
OpMemberDecorate %SB 0 Offset 0
|
||||
OpDecorate %SB_RO Block
|
||||
OpMemberDecorate %SB_RO 0 Offset 0
|
||||
OpDecorate %_runtimearr_uint ArrayStride 4
|
||||
OpDecorate %sb NonWritable
|
||||
OpDecorate %sb DescriptorSet 0
|
||||
OpDecorate %sb Binding 0
|
||||
OpDecorate %sb_ro NonWritable
|
||||
OpDecorate %sb_ro DescriptorSet 0
|
||||
OpDecorate %sb_ro Binding 1
|
||||
OpDecorate %tint_symbol_1 BuiltIn Position
|
||||
%float = OpTypeFloat 32
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
@@ -40,9 +40,9 @@ intrinsics/gen/arrayLength/647a40.wgsl:33:18 warning: use of deprecated intrinsi
|
||||
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
|
||||
%uint = OpTypeInt 32 0
|
||||
%_runtimearr_uint = OpTypeRuntimeArray %uint
|
||||
%SB = OpTypeStruct %_runtimearr_uint
|
||||
%_ptr_StorageBuffer_SB = OpTypePointer StorageBuffer %SB
|
||||
%sb = OpVariable %_ptr_StorageBuffer_SB StorageBuffer
|
||||
%SB_RO = OpTypeStruct %_runtimearr_uint
|
||||
%_ptr_StorageBuffer_SB_RO = OpTypePointer StorageBuffer %SB_RO
|
||||
%sb_ro = OpVariable %_ptr_StorageBuffer_SB_RO StorageBuffer
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%13 = OpConstantNull %v4float
|
||||
@@ -56,7 +56,7 @@ intrinsics/gen/arrayLength/647a40.wgsl:33:18 warning: use of deprecated intrinsi
|
||||
%arrayLength_647a40 = OpFunction %void None %14
|
||||
%17 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_uint Function %21
|
||||
%18 = OpArrayLength %uint %sb 0
|
||||
%18 = OpArrayLength %uint %sb_ro 0
|
||||
OpStore %res %18
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
intrinsics/gen/arrayLength/647a40.wgsl:33:18 warning: use of deprecated intrinsic
|
||||
var res: u32 = arrayLength(sb.arg_0);
|
||||
var res: u32 = arrayLength(sb_ro.arg_0);
|
||||
^^^^^^^^^^^
|
||||
|
||||
[[block]]
|
||||
struct SB {
|
||||
struct SB_RO {
|
||||
arg_0 : array<u32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]] var<storage, read> sb : SB;
|
||||
[[group(0), binding(1)]] var<storage, read> sb_ro : SB_RO;
|
||||
|
||||
fn arrayLength_647a40() {
|
||||
var res : u32 = arrayLength(sb.arg_0);
|
||||
var res : u32 = arrayLength(sb_ro.arg_0);
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
|
||||
@@ -23,14 +23,14 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
[[block]]
|
||||
struct SB {
|
||||
struct SB_RO {
|
||||
arg_0: array<i32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<storage, read> sb : SB;
|
||||
[[group(0), binding(1)]] var<storage, read> sb_ro : SB_RO;
|
||||
|
||||
// fn arrayLength(array<i32>) -> u32
|
||||
fn arrayLength_721c9d() {
|
||||
var res: u32 = arrayLength(sb.arg_0);
|
||||
var res: u32 = arrayLength(sb_ro.arg_0);
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
intrinsics/gen/arrayLength/721c9d.wgsl:33:18 warning: use of deprecated intrinsic
|
||||
var res: u32 = arrayLength(sb.arg_0);
|
||||
var res: u32 = arrayLength(sb_ro.arg_0);
|
||||
^^^^^^^^^^^
|
||||
|
||||
ByteAddressBuffer sb : register(t0, space0);
|
||||
ByteAddressBuffer sb_ro : register(t1, space0);
|
||||
|
||||
void arrayLength_721c9d() {
|
||||
uint tint_symbol_2 = 0u;
|
||||
sb.GetDimensions(tint_symbol_2);
|
||||
sb_ro.GetDimensions(tint_symbol_2);
|
||||
const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
|
||||
uint res = tint_symbol_3;
|
||||
}
|
||||
|
||||
@@ -1,20 +1,31 @@
|
||||
SKIP: FAILED
|
||||
|
||||
intrinsics/gen/arrayLength/721c9d.wgsl:33:18 warning: use of deprecated intrinsic
|
||||
var res: u32 = arrayLength(sb_ro.arg_0);
|
||||
^^^^^^^^^^^
|
||||
|
||||
|
||||
[[block]]
|
||||
struct SB {
|
||||
struct SB_RO {
|
||||
arg_0 : array<i32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]] var<storage> sb : [[access(read)]] SB;
|
||||
[[group(0), binding(1)]] var<storage, read> sb_ro : SB_RO;
|
||||
|
||||
fn arrayLength_721c9d() {
|
||||
var res : u32 = arrayLength(sb.arg_0);
|
||||
var res : u32 = arrayLength(sb_ro.arg_0);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
[[builtin(position)]]
|
||||
value : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() {
|
||||
fn vertex_main() -> tint_symbol {
|
||||
arrayLength_721c9d();
|
||||
let tint_symbol_1 : tint_symbol = tint_symbol(vec4<f32>());
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
intrinsics/gen/arrayLength/721c9d.wgsl:33:18 warning: use of deprecated intrinsic
|
||||
var res: u32 = arrayLength(sb.arg_0);
|
||||
var res: u32 = arrayLength(sb_ro.arg_0);
|
||||
^^^^^^^^^^^
|
||||
|
||||
; SPIR-V
|
||||
@@ -15,9 +15,9 @@ intrinsics/gen/arrayLength/721c9d.wgsl:33:18 warning: use of deprecated intrinsi
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %tint_pointsize "tint_pointsize"
|
||||
OpName %SB "SB"
|
||||
OpMemberName %SB 0 "arg_0"
|
||||
OpName %sb "sb"
|
||||
OpName %SB_RO "SB_RO"
|
||||
OpMemberName %SB_RO 0 "arg_0"
|
||||
OpName %sb_ro "sb_ro"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %arrayLength_721c9d "arrayLength_721c9d"
|
||||
OpName %res "res"
|
||||
@@ -27,12 +27,12 @@ intrinsics/gen/arrayLength/721c9d.wgsl:33:18 warning: use of deprecated intrinsi
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %tint_pointsize BuiltIn PointSize
|
||||
OpDecorate %SB Block
|
||||
OpMemberDecorate %SB 0 Offset 0
|
||||
OpDecorate %SB_RO Block
|
||||
OpMemberDecorate %SB_RO 0 Offset 0
|
||||
OpDecorate %_runtimearr_int ArrayStride 4
|
||||
OpDecorate %sb NonWritable
|
||||
OpDecorate %sb DescriptorSet 0
|
||||
OpDecorate %sb Binding 0
|
||||
OpDecorate %sb_ro NonWritable
|
||||
OpDecorate %sb_ro DescriptorSet 0
|
||||
OpDecorate %sb_ro Binding 1
|
||||
OpDecorate %tint_symbol_1 BuiltIn Position
|
||||
%float = OpTypeFloat 32
|
||||
%_ptr_Output_float = OpTypePointer Output %float
|
||||
@@ -40,9 +40,9 @@ intrinsics/gen/arrayLength/721c9d.wgsl:33:18 warning: use of deprecated intrinsi
|
||||
%tint_pointsize = OpVariable %_ptr_Output_float Output %4
|
||||
%int = OpTypeInt 32 1
|
||||
%_runtimearr_int = OpTypeRuntimeArray %int
|
||||
%SB = OpTypeStruct %_runtimearr_int
|
||||
%_ptr_StorageBuffer_SB = OpTypePointer StorageBuffer %SB
|
||||
%sb = OpVariable %_ptr_StorageBuffer_SB StorageBuffer
|
||||
%SB_RO = OpTypeStruct %_runtimearr_int
|
||||
%_ptr_StorageBuffer_SB_RO = OpTypePointer StorageBuffer %SB_RO
|
||||
%sb_ro = OpVariable %_ptr_StorageBuffer_SB_RO StorageBuffer
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%13 = OpConstantNull %v4float
|
||||
@@ -57,7 +57,7 @@ intrinsics/gen/arrayLength/721c9d.wgsl:33:18 warning: use of deprecated intrinsi
|
||||
%arrayLength_721c9d = OpFunction %void None %14
|
||||
%17 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_uint Function %22
|
||||
%18 = OpArrayLength %uint %sb 0
|
||||
%18 = OpArrayLength %uint %sb_ro 0
|
||||
OpStore %res %18
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
intrinsics/gen/arrayLength/721c9d.wgsl:33:18 warning: use of deprecated intrinsic
|
||||
var res: u32 = arrayLength(sb.arg_0);
|
||||
var res: u32 = arrayLength(sb_ro.arg_0);
|
||||
^^^^^^^^^^^
|
||||
|
||||
[[block]]
|
||||
struct SB {
|
||||
struct SB_RO {
|
||||
arg_0 : array<i32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]] var<storage, read> sb : SB;
|
||||
[[group(0), binding(1)]] var<storage, read> sb_ro : SB_RO;
|
||||
|
||||
fn arrayLength_721c9d() {
|
||||
var res : u32 = arrayLength(sb.arg_0);
|
||||
var res : u32 = arrayLength(sb_ro.arg_0);
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
|
||||
50
test/intrinsics/gen/arrayLength/a0f5ca.wgsl
Normal file
50
test/intrinsics/gen/arrayLength/a0f5ca.wgsl
Normal file
@@ -0,0 +1,50 @@
|
||||
// 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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
[[block]]
|
||||
struct SB_RO {
|
||||
arg_0: array<f32>;
|
||||
};
|
||||
[[group(0), binding(1)]] var<storage, read> sb_ro : SB_RO;
|
||||
|
||||
// fn arrayLength(ptr<storage, array<f32>, read>) -> u32
|
||||
fn arrayLength_a0f5ca() {
|
||||
var res: u32 = arrayLength(&sb_ro.arg_0);
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
arrayLength_a0f5ca();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
arrayLength_a0f5ca();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
arrayLength_a0f5ca();
|
||||
}
|
||||
29
test/intrinsics/gen/arrayLength/a0f5ca.wgsl.expected.hlsl
Normal file
29
test/intrinsics/gen/arrayLength/a0f5ca.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,29 @@
|
||||
ByteAddressBuffer sb_ro : register(t1, space0);
|
||||
|
||||
void arrayLength_a0f5ca() {
|
||||
uint tint_symbol_2 = 0u;
|
||||
sb_ro.GetDimensions(tint_symbol_2);
|
||||
const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
|
||||
uint res = tint_symbol_3;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
arrayLength_a0f5ca();
|
||||
const tint_symbol tint_symbol_4 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
|
||||
return tint_symbol_4;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
arrayLength_a0f5ca();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
arrayLength_a0f5ca();
|
||||
return;
|
||||
}
|
||||
37
test/intrinsics/gen/arrayLength/a0f5ca.wgsl.expected.msl
Normal file
37
test/intrinsics/gen/arrayLength/a0f5ca.wgsl.expected.msl
Normal file
@@ -0,0 +1,37 @@
|
||||
SKIP: FAILED
|
||||
|
||||
|
||||
[[block]]
|
||||
struct SB_RO {
|
||||
arg_0 : array<f32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(1)]] var<storage, read> sb_ro : SB_RO;
|
||||
|
||||
fn arrayLength_a0f5ca() {
|
||||
var res : u32 = arrayLength(&(sb_ro.arg_0));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
[[builtin(position)]]
|
||||
value : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> tint_symbol {
|
||||
arrayLength_a0f5ca();
|
||||
let tint_symbol_1 : tint_symbol = tint_symbol(vec4<f32>());
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
arrayLength_a0f5ca();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
arrayLength_a0f5ca();
|
||||
}
|
||||
|
||||
Failed to generate: error: Unknown import method: arrayLength
|
||||
81
test/intrinsics/gen/arrayLength/a0f5ca.wgsl.expected.spvasm
Normal file
81
test/intrinsics/gen/arrayLength/a0f5ca.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,81 @@
|
||||
; 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 %SB_RO "SB_RO"
|
||||
OpMemberName %SB_RO 0 "arg_0"
|
||||
OpName %sb_ro "sb_ro"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %arrayLength_a0f5ca "arrayLength_a0f5ca"
|
||||
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 %SB_RO Block
|
||||
OpMemberDecorate %SB_RO 0 Offset 0
|
||||
OpDecorate %_runtimearr_float ArrayStride 4
|
||||
OpDecorate %sb_ro NonWritable
|
||||
OpDecorate %sb_ro DescriptorSet 0
|
||||
OpDecorate %sb_ro Binding 1
|
||||
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
|
||||
%_runtimearr_float = OpTypeRuntimeArray %float
|
||||
%SB_RO = OpTypeStruct %_runtimearr_float
|
||||
%_ptr_StorageBuffer_SB_RO = OpTypePointer StorageBuffer %SB_RO
|
||||
%sb_ro = OpVariable %_ptr_StorageBuffer_SB_RO StorageBuffer
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%12 = OpConstantNull %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
|
||||
%void = OpTypeVoid
|
||||
%13 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%_ptr_Function_uint = OpTypePointer Function %uint
|
||||
%21 = OpConstantNull %uint
|
||||
%22 = OpTypeFunction %void %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%arrayLength_a0f5ca = OpFunction %void None %13
|
||||
%16 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_uint Function %21
|
||||
%17 = OpArrayLength %uint %sb_ro 0
|
||||
OpStore %res %17
|
||||
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 %13
|
||||
%27 = OpLabel
|
||||
OpStore %tint_pointsize %float_1
|
||||
%29 = OpFunctionCall %void %arrayLength_a0f5ca
|
||||
%30 = OpFunctionCall %void %tint_symbol_2 %12
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %13
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %arrayLength_a0f5ca
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %13
|
||||
%35 = OpLabel
|
||||
%36 = OpFunctionCall %void %arrayLength_a0f5ca
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
26
test/intrinsics/gen/arrayLength/a0f5ca.wgsl.expected.wgsl
Normal file
26
test/intrinsics/gen/arrayLength/a0f5ca.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,26 @@
|
||||
[[block]]
|
||||
struct SB_RO {
|
||||
arg_0 : array<f32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(1)]] var<storage, read> sb_ro : SB_RO;
|
||||
|
||||
fn arrayLength_a0f5ca() {
|
||||
var res : u32 = arrayLength(&(sb_ro.arg_0));
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
arrayLength_a0f5ca();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
arrayLength_a0f5ca();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
arrayLength_a0f5ca();
|
||||
}
|
||||
@@ -23,14 +23,14 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
[[block]]
|
||||
struct SB {
|
||||
struct SB_RO {
|
||||
arg_0: array<f32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<storage, read> sb : SB;
|
||||
[[group(0), binding(1)]] var<storage, read> sb_ro : SB_RO;
|
||||
|
||||
// fn arrayLength(array<f32>) -> u32
|
||||
fn arrayLength_b083be() {
|
||||
var res: u32 = arrayLength(sb.arg_0);
|
||||
var res: u32 = arrayLength(sb_ro.arg_0);
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
intrinsics/gen/arrayLength/b083be.wgsl:33:18 warning: use of deprecated intrinsic
|
||||
var res: u32 = arrayLength(sb.arg_0);
|
||||
var res: u32 = arrayLength(sb_ro.arg_0);
|
||||
^^^^^^^^^^^
|
||||
|
||||
ByteAddressBuffer sb : register(t0, space0);
|
||||
ByteAddressBuffer sb_ro : register(t1, space0);
|
||||
|
||||
void arrayLength_b083be() {
|
||||
uint tint_symbol_2 = 0u;
|
||||
sb.GetDimensions(tint_symbol_2);
|
||||
sb_ro.GetDimensions(tint_symbol_2);
|
||||
const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
|
||||
uint res = tint_symbol_3;
|
||||
}
|
||||
|
||||
@@ -1,20 +1,31 @@
|
||||
SKIP: FAILED
|
||||
|
||||
intrinsics/gen/arrayLength/b083be.wgsl:33:18 warning: use of deprecated intrinsic
|
||||
var res: u32 = arrayLength(sb_ro.arg_0);
|
||||
^^^^^^^^^^^
|
||||
|
||||
|
||||
[[block]]
|
||||
struct SB {
|
||||
struct SB_RO {
|
||||
arg_0 : array<f32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]] var<storage> sb : [[access(read)]] SB;
|
||||
[[group(0), binding(1)]] var<storage, read> sb_ro : SB_RO;
|
||||
|
||||
fn arrayLength_b083be() {
|
||||
var res : u32 = arrayLength(sb.arg_0);
|
||||
var res : u32 = arrayLength(sb_ro.arg_0);
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
[[builtin(position)]]
|
||||
value : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() {
|
||||
fn vertex_main() -> tint_symbol {
|
||||
arrayLength_b083be();
|
||||
let tint_symbol_1 : tint_symbol = tint_symbol(vec4<f32>());
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
intrinsics/gen/arrayLength/b083be.wgsl:33:18 warning: use of deprecated intrinsic
|
||||
var res: u32 = arrayLength(sb.arg_0);
|
||||
var res: u32 = arrayLength(sb_ro.arg_0);
|
||||
^^^^^^^^^^^
|
||||
|
||||
; SPIR-V
|
||||
@@ -15,9 +15,9 @@ intrinsics/gen/arrayLength/b083be.wgsl:33:18 warning: use of deprecated intrinsi
|
||||
OpExecutionMode %fragment_main OriginUpperLeft
|
||||
OpExecutionMode %compute_main LocalSize 1 1 1
|
||||
OpName %tint_pointsize "tint_pointsize"
|
||||
OpName %SB "SB"
|
||||
OpMemberName %SB 0 "arg_0"
|
||||
OpName %sb "sb"
|
||||
OpName %SB_RO "SB_RO"
|
||||
OpMemberName %SB_RO 0 "arg_0"
|
||||
OpName %sb_ro "sb_ro"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %arrayLength_b083be "arrayLength_b083be"
|
||||
OpName %res "res"
|
||||
@@ -27,21 +27,21 @@ intrinsics/gen/arrayLength/b083be.wgsl:33:18 warning: use of deprecated intrinsi
|
||||
OpName %fragment_main "fragment_main"
|
||||
OpName %compute_main "compute_main"
|
||||
OpDecorate %tint_pointsize BuiltIn PointSize
|
||||
OpDecorate %SB Block
|
||||
OpMemberDecorate %SB 0 Offset 0
|
||||
OpDecorate %SB_RO Block
|
||||
OpMemberDecorate %SB_RO 0 Offset 0
|
||||
OpDecorate %_runtimearr_float ArrayStride 4
|
||||
OpDecorate %sb NonWritable
|
||||
OpDecorate %sb DescriptorSet 0
|
||||
OpDecorate %sb Binding 0
|
||||
OpDecorate %sb_ro NonWritable
|
||||
OpDecorate %sb_ro DescriptorSet 0
|
||||
OpDecorate %sb_ro Binding 1
|
||||
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
|
||||
%_runtimearr_float = OpTypeRuntimeArray %float
|
||||
%SB = OpTypeStruct %_runtimearr_float
|
||||
%_ptr_StorageBuffer_SB = OpTypePointer StorageBuffer %SB
|
||||
%sb = OpVariable %_ptr_StorageBuffer_SB StorageBuffer
|
||||
%SB_RO = OpTypeStruct %_runtimearr_float
|
||||
%_ptr_StorageBuffer_SB_RO = OpTypePointer StorageBuffer %SB_RO
|
||||
%sb_ro = OpVariable %_ptr_StorageBuffer_SB_RO StorageBuffer
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%12 = OpConstantNull %v4float
|
||||
@@ -56,7 +56,7 @@ intrinsics/gen/arrayLength/b083be.wgsl:33:18 warning: use of deprecated intrinsi
|
||||
%arrayLength_b083be = OpFunction %void None %13
|
||||
%16 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_uint Function %21
|
||||
%17 = OpArrayLength %uint %sb 0
|
||||
%17 = OpArrayLength %uint %sb_ro 0
|
||||
OpStore %res %17
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
intrinsics/gen/arrayLength/b083be.wgsl:33:18 warning: use of deprecated intrinsic
|
||||
var res: u32 = arrayLength(sb.arg_0);
|
||||
var res: u32 = arrayLength(sb_ro.arg_0);
|
||||
^^^^^^^^^^^
|
||||
|
||||
[[block]]
|
||||
struct SB {
|
||||
struct SB_RO {
|
||||
arg_0 : array<f32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]] var<storage, read> sb : SB;
|
||||
[[group(0), binding(1)]] var<storage, read> sb_ro : SB_RO;
|
||||
|
||||
fn arrayLength_b083be() {
|
||||
var res : u32 = arrayLength(sb.arg_0);
|
||||
var res : u32 = arrayLength(sb_ro.arg_0);
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
|
||||
50
test/intrinsics/gen/arrayLength/cdd123.wgsl
Normal file
50
test/intrinsics/gen/arrayLength/cdd123.wgsl
Normal file
@@ -0,0 +1,50 @@
|
||||
// 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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
[[block]]
|
||||
struct SB_RW {
|
||||
arg_0: array<f32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<storage, read_write> sb_rw : SB_RW;
|
||||
|
||||
// fn arrayLength(ptr<storage, array<f32>, read_write>) -> u32
|
||||
fn arrayLength_cdd123() {
|
||||
var res: u32 = arrayLength(&sb_rw.arg_0);
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
arrayLength_cdd123();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
arrayLength_cdd123();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
arrayLength_cdd123();
|
||||
}
|
||||
29
test/intrinsics/gen/arrayLength/cdd123.wgsl.expected.hlsl
Normal file
29
test/intrinsics/gen/arrayLength/cdd123.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,29 @@
|
||||
RWByteAddressBuffer sb_rw : register(u0, space0);
|
||||
|
||||
void arrayLength_cdd123() {
|
||||
uint tint_symbol_2 = 0u;
|
||||
sb_rw.GetDimensions(tint_symbol_2);
|
||||
const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
|
||||
uint res = tint_symbol_3;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
arrayLength_cdd123();
|
||||
const tint_symbol tint_symbol_4 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
|
||||
return tint_symbol_4;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
arrayLength_cdd123();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
arrayLength_cdd123();
|
||||
return;
|
||||
}
|
||||
37
test/intrinsics/gen/arrayLength/cdd123.wgsl.expected.msl
Normal file
37
test/intrinsics/gen/arrayLength/cdd123.wgsl.expected.msl
Normal file
@@ -0,0 +1,37 @@
|
||||
SKIP: FAILED
|
||||
|
||||
|
||||
[[block]]
|
||||
struct SB_RW {
|
||||
arg_0 : array<f32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]] var<storage, read_write> sb_rw : SB_RW;
|
||||
|
||||
fn arrayLength_cdd123() {
|
||||
var res : u32 = arrayLength(&(sb_rw.arg_0));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
[[builtin(position)]]
|
||||
value : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> tint_symbol {
|
||||
arrayLength_cdd123();
|
||||
let tint_symbol_1 : tint_symbol = tint_symbol(vec4<f32>());
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
arrayLength_cdd123();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
arrayLength_cdd123();
|
||||
}
|
||||
|
||||
Failed to generate: error: Unknown import method: arrayLength
|
||||
80
test/intrinsics/gen/arrayLength/cdd123.wgsl.expected.spvasm
Normal file
80
test/intrinsics/gen/arrayLength/cdd123.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,80 @@
|
||||
; 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 %SB_RW "SB_RW"
|
||||
OpMemberName %SB_RW 0 "arg_0"
|
||||
OpName %sb_rw "sb_rw"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %arrayLength_cdd123 "arrayLength_cdd123"
|
||||
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 %SB_RW Block
|
||||
OpMemberDecorate %SB_RW 0 Offset 0
|
||||
OpDecorate %_runtimearr_float ArrayStride 4
|
||||
OpDecorate %sb_rw DescriptorSet 0
|
||||
OpDecorate %sb_rw Binding 0
|
||||
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
|
||||
%_runtimearr_float = OpTypeRuntimeArray %float
|
||||
%SB_RW = OpTypeStruct %_runtimearr_float
|
||||
%_ptr_StorageBuffer_SB_RW = OpTypePointer StorageBuffer %SB_RW
|
||||
%sb_rw = OpVariable %_ptr_StorageBuffer_SB_RW StorageBuffer
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%12 = OpConstantNull %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12
|
||||
%void = OpTypeVoid
|
||||
%13 = OpTypeFunction %void
|
||||
%uint = OpTypeInt 32 0
|
||||
%_ptr_Function_uint = OpTypePointer Function %uint
|
||||
%21 = OpConstantNull %uint
|
||||
%22 = OpTypeFunction %void %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%arrayLength_cdd123 = OpFunction %void None %13
|
||||
%16 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_uint Function %21
|
||||
%17 = OpArrayLength %uint %sb_rw 0
|
||||
OpStore %res %17
|
||||
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 %13
|
||||
%27 = OpLabel
|
||||
OpStore %tint_pointsize %float_1
|
||||
%29 = OpFunctionCall %void %arrayLength_cdd123
|
||||
%30 = OpFunctionCall %void %tint_symbol_2 %12
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %13
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %arrayLength_cdd123
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %13
|
||||
%35 = OpLabel
|
||||
%36 = OpFunctionCall %void %arrayLength_cdd123
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
26
test/intrinsics/gen/arrayLength/cdd123.wgsl.expected.wgsl
Normal file
26
test/intrinsics/gen/arrayLength/cdd123.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,26 @@
|
||||
[[block]]
|
||||
struct SB_RW {
|
||||
arg_0 : array<f32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]] var<storage, read_write> sb_rw : SB_RW;
|
||||
|
||||
fn arrayLength_cdd123() {
|
||||
var res : u32 = arrayLength(&(sb_rw.arg_0));
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
arrayLength_cdd123();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
arrayLength_cdd123();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
arrayLength_cdd123();
|
||||
}
|
||||
50
test/intrinsics/gen/arrayLength/cfca0a.wgsl
Normal file
50
test/intrinsics/gen/arrayLength/cfca0a.wgsl
Normal file
@@ -0,0 +1,50 @@
|
||||
// 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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
[[block]]
|
||||
struct SB_RO {
|
||||
arg_0: array<u32>;
|
||||
};
|
||||
[[group(0), binding(1)]] var<storage, read> sb_ro : SB_RO;
|
||||
|
||||
// fn arrayLength(ptr<storage, array<u32>, read>) -> u32
|
||||
fn arrayLength_cfca0a() {
|
||||
var res: u32 = arrayLength(&sb_ro.arg_0);
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
arrayLength_cfca0a();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
arrayLength_cfca0a();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
arrayLength_cfca0a();
|
||||
}
|
||||
29
test/intrinsics/gen/arrayLength/cfca0a.wgsl.expected.hlsl
Normal file
29
test/intrinsics/gen/arrayLength/cfca0a.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,29 @@
|
||||
ByteAddressBuffer sb_ro : register(t1, space0);
|
||||
|
||||
void arrayLength_cfca0a() {
|
||||
uint tint_symbol_2 = 0u;
|
||||
sb_ro.GetDimensions(tint_symbol_2);
|
||||
const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
|
||||
uint res = tint_symbol_3;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
arrayLength_cfca0a();
|
||||
const tint_symbol tint_symbol_4 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
|
||||
return tint_symbol_4;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
arrayLength_cfca0a();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
arrayLength_cfca0a();
|
||||
return;
|
||||
}
|
||||
37
test/intrinsics/gen/arrayLength/cfca0a.wgsl.expected.msl
Normal file
37
test/intrinsics/gen/arrayLength/cfca0a.wgsl.expected.msl
Normal file
@@ -0,0 +1,37 @@
|
||||
SKIP: FAILED
|
||||
|
||||
|
||||
[[block]]
|
||||
struct SB_RO {
|
||||
arg_0 : array<u32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(1)]] var<storage, read> sb_ro : SB_RO;
|
||||
|
||||
fn arrayLength_cfca0a() {
|
||||
var res : u32 = arrayLength(&(sb_ro.arg_0));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
[[builtin(position)]]
|
||||
value : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> tint_symbol {
|
||||
arrayLength_cfca0a();
|
||||
let tint_symbol_1 : tint_symbol = tint_symbol(vec4<f32>());
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
arrayLength_cfca0a();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
arrayLength_cfca0a();
|
||||
}
|
||||
|
||||
Failed to generate: error: Unknown import method: arrayLength
|
||||
81
test/intrinsics/gen/arrayLength/cfca0a.wgsl.expected.spvasm
Normal file
81
test/intrinsics/gen/arrayLength/cfca0a.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,81 @@
|
||||
; 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 %SB_RO "SB_RO"
|
||||
OpMemberName %SB_RO 0 "arg_0"
|
||||
OpName %sb_ro "sb_ro"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %arrayLength_cfca0a "arrayLength_cfca0a"
|
||||
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 %SB_RO Block
|
||||
OpMemberDecorate %SB_RO 0 Offset 0
|
||||
OpDecorate %_runtimearr_uint ArrayStride 4
|
||||
OpDecorate %sb_ro NonWritable
|
||||
OpDecorate %sb_ro DescriptorSet 0
|
||||
OpDecorate %sb_ro Binding 1
|
||||
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
|
||||
%uint = OpTypeInt 32 0
|
||||
%_runtimearr_uint = OpTypeRuntimeArray %uint
|
||||
%SB_RO = OpTypeStruct %_runtimearr_uint
|
||||
%_ptr_StorageBuffer_SB_RO = OpTypePointer StorageBuffer %SB_RO
|
||||
%sb_ro = OpVariable %_ptr_StorageBuffer_SB_RO StorageBuffer
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%13 = OpConstantNull %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %13
|
||||
%void = OpTypeVoid
|
||||
%14 = OpTypeFunction %void
|
||||
%_ptr_Function_uint = OpTypePointer Function %uint
|
||||
%21 = OpConstantNull %uint
|
||||
%22 = OpTypeFunction %void %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%arrayLength_cfca0a = OpFunction %void None %14
|
||||
%17 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_uint Function %21
|
||||
%18 = OpArrayLength %uint %sb_ro 0
|
||||
OpStore %res %18
|
||||
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 %14
|
||||
%27 = OpLabel
|
||||
OpStore %tint_pointsize %float_1
|
||||
%29 = OpFunctionCall %void %arrayLength_cfca0a
|
||||
%30 = OpFunctionCall %void %tint_symbol_2 %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %14
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %arrayLength_cfca0a
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %14
|
||||
%35 = OpLabel
|
||||
%36 = OpFunctionCall %void %arrayLength_cfca0a
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
26
test/intrinsics/gen/arrayLength/cfca0a.wgsl.expected.wgsl
Normal file
26
test/intrinsics/gen/arrayLength/cfca0a.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,26 @@
|
||||
[[block]]
|
||||
struct SB_RO {
|
||||
arg_0 : array<u32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(1)]] var<storage, read> sb_ro : SB_RO;
|
||||
|
||||
fn arrayLength_cfca0a() {
|
||||
var res : u32 = arrayLength(&(sb_ro.arg_0));
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
arrayLength_cfca0a();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
arrayLength_cfca0a();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
arrayLength_cfca0a();
|
||||
}
|
||||
50
test/intrinsics/gen/arrayLength/eb510f.wgsl
Normal file
50
test/intrinsics/gen/arrayLength/eb510f.wgsl
Normal file
@@ -0,0 +1,50 @@
|
||||
// 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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
[[block]]
|
||||
struct SB_RW {
|
||||
arg_0: array<u32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<storage, read_write> sb_rw : SB_RW;
|
||||
|
||||
// fn arrayLength(ptr<storage, array<u32>, read_write>) -> u32
|
||||
fn arrayLength_eb510f() {
|
||||
var res: u32 = arrayLength(&sb_rw.arg_0);
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
arrayLength_eb510f();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
arrayLength_eb510f();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
arrayLength_eb510f();
|
||||
}
|
||||
29
test/intrinsics/gen/arrayLength/eb510f.wgsl.expected.hlsl
Normal file
29
test/intrinsics/gen/arrayLength/eb510f.wgsl.expected.hlsl
Normal file
@@ -0,0 +1,29 @@
|
||||
RWByteAddressBuffer sb_rw : register(u0, space0);
|
||||
|
||||
void arrayLength_eb510f() {
|
||||
uint tint_symbol_2 = 0u;
|
||||
sb_rw.GetDimensions(tint_symbol_2);
|
||||
const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 4u);
|
||||
uint res = tint_symbol_3;
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
float4 value : SV_Position;
|
||||
};
|
||||
|
||||
tint_symbol vertex_main() {
|
||||
arrayLength_eb510f();
|
||||
const tint_symbol tint_symbol_4 = {float4(0.0f, 0.0f, 0.0f, 0.0f)};
|
||||
return tint_symbol_4;
|
||||
}
|
||||
|
||||
void fragment_main() {
|
||||
arrayLength_eb510f();
|
||||
return;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void compute_main() {
|
||||
arrayLength_eb510f();
|
||||
return;
|
||||
}
|
||||
37
test/intrinsics/gen/arrayLength/eb510f.wgsl.expected.msl
Normal file
37
test/intrinsics/gen/arrayLength/eb510f.wgsl.expected.msl
Normal file
@@ -0,0 +1,37 @@
|
||||
SKIP: FAILED
|
||||
|
||||
|
||||
[[block]]
|
||||
struct SB_RW {
|
||||
arg_0 : array<u32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]] var<storage, read_write> sb_rw : SB_RW;
|
||||
|
||||
fn arrayLength_eb510f() {
|
||||
var res : u32 = arrayLength(&(sb_rw.arg_0));
|
||||
}
|
||||
|
||||
struct tint_symbol {
|
||||
[[builtin(position)]]
|
||||
value : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> tint_symbol {
|
||||
arrayLength_eb510f();
|
||||
let tint_symbol_1 : tint_symbol = tint_symbol(vec4<f32>());
|
||||
return tint_symbol_1;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
arrayLength_eb510f();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
arrayLength_eb510f();
|
||||
}
|
||||
|
||||
Failed to generate: error: Unknown import method: arrayLength
|
||||
80
test/intrinsics/gen/arrayLength/eb510f.wgsl.expected.spvasm
Normal file
80
test/intrinsics/gen/arrayLength/eb510f.wgsl.expected.spvasm
Normal file
@@ -0,0 +1,80 @@
|
||||
; 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 %SB_RW "SB_RW"
|
||||
OpMemberName %SB_RW 0 "arg_0"
|
||||
OpName %sb_rw "sb_rw"
|
||||
OpName %tint_symbol_1 "tint_symbol_1"
|
||||
OpName %arrayLength_eb510f "arrayLength_eb510f"
|
||||
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 %SB_RW Block
|
||||
OpMemberDecorate %SB_RW 0 Offset 0
|
||||
OpDecorate %_runtimearr_uint ArrayStride 4
|
||||
OpDecorate %sb_rw DescriptorSet 0
|
||||
OpDecorate %sb_rw Binding 0
|
||||
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
|
||||
%uint = OpTypeInt 32 0
|
||||
%_runtimearr_uint = OpTypeRuntimeArray %uint
|
||||
%SB_RW = OpTypeStruct %_runtimearr_uint
|
||||
%_ptr_StorageBuffer_SB_RW = OpTypePointer StorageBuffer %SB_RW
|
||||
%sb_rw = OpVariable %_ptr_StorageBuffer_SB_RW StorageBuffer
|
||||
%v4float = OpTypeVector %float 4
|
||||
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
||||
%13 = OpConstantNull %v4float
|
||||
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %13
|
||||
%void = OpTypeVoid
|
||||
%14 = OpTypeFunction %void
|
||||
%_ptr_Function_uint = OpTypePointer Function %uint
|
||||
%21 = OpConstantNull %uint
|
||||
%22 = OpTypeFunction %void %v4float
|
||||
%float_1 = OpConstant %float 1
|
||||
%arrayLength_eb510f = OpFunction %void None %14
|
||||
%17 = OpLabel
|
||||
%res = OpVariable %_ptr_Function_uint Function %21
|
||||
%18 = OpArrayLength %uint %sb_rw 0
|
||||
OpStore %res %18
|
||||
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 %14
|
||||
%27 = OpLabel
|
||||
OpStore %tint_pointsize %float_1
|
||||
%29 = OpFunctionCall %void %arrayLength_eb510f
|
||||
%30 = OpFunctionCall %void %tint_symbol_2 %13
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%fragment_main = OpFunction %void None %14
|
||||
%32 = OpLabel
|
||||
%33 = OpFunctionCall %void %arrayLength_eb510f
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
%compute_main = OpFunction %void None %14
|
||||
%35 = OpLabel
|
||||
%36 = OpFunctionCall %void %arrayLength_eb510f
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
26
test/intrinsics/gen/arrayLength/eb510f.wgsl.expected.wgsl
Normal file
26
test/intrinsics/gen/arrayLength/eb510f.wgsl.expected.wgsl
Normal file
@@ -0,0 +1,26 @@
|
||||
[[block]]
|
||||
struct SB_RW {
|
||||
arg_0 : array<u32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]] var<storage, read_write> sb_rw : SB_RW;
|
||||
|
||||
fn arrayLength_eb510f() {
|
||||
var res : u32 = arrayLength(&(sb_rw.arg_0));
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn vertex_main() -> [[builtin(position)]] vec4<f32> {
|
||||
arrayLength_eb510f();
|
||||
return vec4<f32>();
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn fragment_main() {
|
||||
arrayLength_eb510f();
|
||||
}
|
||||
|
||||
[[stage(compute)]]
|
||||
fn compute_main() {
|
||||
arrayLength_eb510f();
|
||||
}
|
||||
Reference in New Issue
Block a user