test/tint/builtins/gen: Use returned value

It appears that FXC and DXC do some validation post dead-code-elimination.
These tests have been updated so that the return value is assigned to a storage buffer, ensuring that all validation is performed.

Many DXC tests are affected by https://github.com/microsoft/DirectXShaderCompiler/issues/5082, which have been SKIP'ed.

Fixed: tint:1859
Change-Id: I0001a9a9821846cd0855c3d8ce2bec79ab8e64ef
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122662
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: James Price <jrprice@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton
2023-03-06 18:25:08 +00:00
committed by Dawn LUCI CQ
parent a753ad47a4
commit 77a90cb796
15767 changed files with 166376 additions and 76950 deletions

View File

@@ -28,7 +28,9 @@ struct SB_RO {
// fn arrayLength(ptr<storage, array<i32>, read>) -> u32
fn arrayLength_1588cd() {
var res: u32 = arrayLength(&sb_ro.arg_0);
prevent_dce = res;
}
@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {

View File

@@ -1,10 +1,12 @@
ByteAddressBuffer sb_ro : register(t1, space0);
RWByteAddressBuffer prevent_dce : register(u0, space2);
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;
prevent_dce.Store(0u, asuint(res));
}
struct tint_symbol {

View File

@@ -1,10 +1,12 @@
ByteAddressBuffer sb_ro : register(t1, space0);
RWByteAddressBuffer prevent_dce : register(u0, space2);
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;
prevent_dce.Store(0u, asuint(res));
}
struct tint_symbol {

View File

@@ -4,8 +4,13 @@ layout(binding = 1, std430) buffer SB_RO_ssbo {
int arg_0[];
} sb_ro;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_1588cd() {
uint res = uint(sb_ro.arg_0.length());
prevent_dce.inner = res;
}
vec4 vertex_main() {
@@ -28,8 +33,13 @@ layout(binding = 1, std430) buffer SB_RO_ssbo {
int arg_0[];
} sb_ro;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_1588cd() {
uint res = uint(sb_ro.arg_0.length());
prevent_dce.inner = res;
}
void fragment_main() {
@@ -46,8 +56,13 @@ layout(binding = 1, std430) buffer SB_RO_ssbo {
int arg_0[];
} sb_ro;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_1588cd() {
uint res = uint(sb_ro.arg_0.length());
prevent_dce.inner = res;
}
void compute_main() {

View File

@@ -22,33 +22,34 @@ struct SB_RO {
tint_array<int, 1> arg_0;
};
void arrayLength_1588cd(const constant tint_symbol_1* const tint_symbol_3) {
uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
void arrayLength_1588cd(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
uint res = (((*(tint_symbol_3)).buffer_size[0u][1u] - 0u) / 4u);
*(tint_symbol_4) = res;
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
arrayLength_1588cd(tint_symbol_4);
float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
arrayLength_1588cd(tint_symbol_5, tint_symbol_6);
return float4(0.0f);
}
vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
float4 const inner_result = vertex_main_inner(tint_symbol_5);
vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(0)]]) {
float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
arrayLength_1588cd(tint_symbol_6);
fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(0)]]) {
arrayLength_1588cd(tint_symbol_9, tint_symbol_10);
return;
}
kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
arrayLength_1588cd(tint_symbol_7);
kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(0)]]) {
arrayLength_1588cd(tint_symbol_11, tint_symbol_12);
return;
}

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 37
; Bound: 44
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -15,6 +15,9 @@
OpName %SB_RO "SB_RO"
OpMemberName %SB_RO 0 "arg_0"
OpName %sb_ro "sb_ro"
OpName %prevent_dce_block "prevent_dce_block"
OpMemberName %prevent_dce_block 0 "inner"
OpName %prevent_dce "prevent_dce"
OpName %arrayLength_1588cd "arrayLength_1588cd"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
@@ -29,6 +32,10 @@
OpDecorate %sb_ro NonWritable
OpDecorate %sb_ro DescriptorSet 0
OpDecorate %sb_ro Binding 1
OpDecorate %prevent_dce_block Block
OpMemberDecorate %prevent_dce_block 0 Offset 0
OpDecorate %prevent_dce DescriptorSet 2
OpDecorate %prevent_dce Binding 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,39 +49,47 @@
%SB_RO = OpTypeStruct %_runtimearr_int
%_ptr_StorageBuffer_SB_RO = OpTypePointer StorageBuffer %SB_RO
%sb_ro = OpVariable %_ptr_StorageBuffer_SB_RO StorageBuffer
%void = OpTypeVoid
%14 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%prevent_dce_block = OpTypeStruct %uint
%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
%void = OpTypeVoid
%18 = OpTypeFunction %void
%_ptr_Function_uint = OpTypePointer Function %uint
%22 = OpConstantNull %uint
%23 = OpTypeFunction %v4float
%25 = OpConstantNull %uint
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%30 = OpTypeFunction %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
%arrayLength_1588cd = OpFunction %void None %18
%21 = OpLabel
%res = OpVariable %_ptr_Function_uint Function %25
%22 = OpArrayLength %uint %sb_ro 0
OpStore %res %22
%28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
%29 = OpLoad %uint %res
OpStore %28 %29
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %23
%25 = OpLabel
%26 = OpFunctionCall %void %arrayLength_1588cd
%vertex_main_inner = OpFunction %v4float None %30
%32 = OpLabel
%33 = OpFunctionCall %void %arrayLength_1588cd
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %14
%28 = OpLabel
%29 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %29
%vertex_main = OpFunction %void None %18
%35 = OpLabel
%36 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %36
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %14
%32 = OpLabel
%33 = OpFunctionCall %void %arrayLength_1588cd
%fragment_main = OpFunction %void None %18
%39 = OpLabel
%40 = OpFunctionCall %void %arrayLength_1588cd
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %14
%35 = OpLabel
%36 = OpFunctionCall %void %arrayLength_1588cd
%compute_main = OpFunction %void None %18
%42 = OpLabel
%43 = OpFunctionCall %void %arrayLength_1588cd
OpReturn
OpFunctionEnd

View File

@@ -6,8 +6,11 @@ struct SB_RO {
fn arrayLength_1588cd() {
var res : u32 = arrayLength(&(sb_ro.arg_0));
prevent_dce = res;
}
@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
arrayLength_1588cd();

View File

@@ -28,7 +28,9 @@ struct SB_RW {
// fn arrayLength(ptr<storage, array<i32>, read_write>) -> u32
fn arrayLength_61b1c7() {
var res: u32 = arrayLength(&sb_rw.arg_0);
prevent_dce = res;
}
@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {

View File

@@ -1,10 +1,12 @@
RWByteAddressBuffer sb_rw : register(u0, space0);
RWByteAddressBuffer prevent_dce : register(u0, space2);
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;
prevent_dce.Store(0u, asuint(res));
}
struct tint_symbol {

View File

@@ -1,10 +1,12 @@
RWByteAddressBuffer sb_rw : register(u0, space0);
RWByteAddressBuffer prevent_dce : register(u0, space2);
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;
prevent_dce.Store(0u, asuint(res));
}
struct tint_symbol {

View File

@@ -4,8 +4,13 @@ layout(binding = 0, std430) buffer SB_RW_ssbo {
int arg_0[];
} sb_rw;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_61b1c7() {
uint res = uint(sb_rw.arg_0.length());
prevent_dce.inner = res;
}
vec4 vertex_main() {
@@ -28,8 +33,13 @@ layout(binding = 0, std430) buffer SB_RW_ssbo {
int arg_0[];
} sb_rw;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_61b1c7() {
uint res = uint(sb_rw.arg_0.length());
prevent_dce.inner = res;
}
void fragment_main() {
@@ -46,8 +56,13 @@ layout(binding = 0, std430) buffer SB_RW_ssbo {
int arg_0[];
} sb_rw;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_61b1c7() {
uint res = uint(sb_rw.arg_0.length());
prevent_dce.inner = res;
}
void compute_main() {

View File

@@ -22,33 +22,34 @@ struct SB_RW {
tint_array<int, 1> arg_0;
};
void arrayLength_61b1c7(const constant tint_symbol_1* const tint_symbol_3) {
void arrayLength_61b1c7(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
*(tint_symbol_4) = res;
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
arrayLength_61b1c7(tint_symbol_4);
float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
arrayLength_61b1c7(tint_symbol_5, tint_symbol_6);
return float4(0.0f);
}
vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
float4 const inner_result = vertex_main_inner(tint_symbol_5);
vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(1)]]) {
float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
arrayLength_61b1c7(tint_symbol_6);
fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(1)]]) {
arrayLength_61b1c7(tint_symbol_9, tint_symbol_10);
return;
}
kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
arrayLength_61b1c7(tint_symbol_7);
kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(1)]]) {
arrayLength_61b1c7(tint_symbol_11, tint_symbol_12);
return;
}

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 37
; Bound: 44
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -15,6 +15,9 @@
OpName %SB_RW "SB_RW"
OpMemberName %SB_RW 0 "arg_0"
OpName %sb_rw "sb_rw"
OpName %prevent_dce_block "prevent_dce_block"
OpMemberName %prevent_dce_block 0 "inner"
OpName %prevent_dce "prevent_dce"
OpName %arrayLength_61b1c7 "arrayLength_61b1c7"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
@@ -28,6 +31,10 @@
OpDecorate %_runtimearr_int ArrayStride 4
OpDecorate %sb_rw DescriptorSet 0
OpDecorate %sb_rw Binding 0
OpDecorate %prevent_dce_block Block
OpMemberDecorate %prevent_dce_block 0 Offset 0
OpDecorate %prevent_dce DescriptorSet 2
OpDecorate %prevent_dce Binding 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,39 +48,47 @@
%SB_RW = OpTypeStruct %_runtimearr_int
%_ptr_StorageBuffer_SB_RW = OpTypePointer StorageBuffer %SB_RW
%sb_rw = OpVariable %_ptr_StorageBuffer_SB_RW StorageBuffer
%void = OpTypeVoid
%14 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%prevent_dce_block = OpTypeStruct %uint
%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
%void = OpTypeVoid
%18 = OpTypeFunction %void
%_ptr_Function_uint = OpTypePointer Function %uint
%22 = OpConstantNull %uint
%23 = OpTypeFunction %v4float
%25 = OpConstantNull %uint
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%30 = OpTypeFunction %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
%arrayLength_61b1c7 = OpFunction %void None %18
%21 = OpLabel
%res = OpVariable %_ptr_Function_uint Function %25
%22 = OpArrayLength %uint %sb_rw 0
OpStore %res %22
%28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
%29 = OpLoad %uint %res
OpStore %28 %29
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %23
%25 = OpLabel
%26 = OpFunctionCall %void %arrayLength_61b1c7
%vertex_main_inner = OpFunction %v4float None %30
%32 = OpLabel
%33 = OpFunctionCall %void %arrayLength_61b1c7
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %14
%28 = OpLabel
%29 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %29
%vertex_main = OpFunction %void None %18
%35 = OpLabel
%36 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %36
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %14
%32 = OpLabel
%33 = OpFunctionCall %void %arrayLength_61b1c7
%fragment_main = OpFunction %void None %18
%39 = OpLabel
%40 = OpFunctionCall %void %arrayLength_61b1c7
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %14
%35 = OpLabel
%36 = OpFunctionCall %void %arrayLength_61b1c7
%compute_main = OpFunction %void None %18
%42 = OpLabel
%43 = OpFunctionCall %void %arrayLength_61b1c7
OpReturn
OpFunctionEnd

View File

@@ -6,8 +6,11 @@ struct SB_RW {
fn arrayLength_61b1c7() {
var res : u32 = arrayLength(&(sb_rw.arg_0));
prevent_dce = res;
}
@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
arrayLength_61b1c7();

View File

@@ -30,7 +30,9 @@ struct SB_RO {
// fn arrayLength(ptr<storage, array<f16>, read>) -> u32
fn arrayLength_8421b9() {
var res: u32 = arrayLength(&sb_ro.arg_0);
prevent_dce = res;
}
@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {

View File

@@ -1,10 +1,12 @@
ByteAddressBuffer sb_ro : register(t1, space0);
RWByteAddressBuffer prevent_dce : register(u0, space2);
void arrayLength_8421b9() {
uint tint_symbol_2 = 0u;
sb_ro.GetDimensions(tint_symbol_2);
const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 2u);
uint res = tint_symbol_3;
prevent_dce.Store(0u, asuint(res));
}
struct tint_symbol {

View File

@@ -1,10 +1,12 @@
ByteAddressBuffer sb_ro : register(t1, space0);
RWByteAddressBuffer prevent_dce : register(u0, space2);
void arrayLength_8421b9() {
uint tint_symbol_2 = 0u;
sb_ro.GetDimensions(tint_symbol_2);
const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 2u);
uint res = tint_symbol_3;
prevent_dce.Store(0u, asuint(res));
}
struct tint_symbol {

View File

@@ -5,8 +5,13 @@ layout(binding = 1, std430) buffer SB_RO_ssbo {
float16_t arg_0[];
} sb_ro;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_8421b9() {
uint res = uint(sb_ro.arg_0.length());
prevent_dce.inner = res;
}
vec4 vertex_main() {
@@ -30,8 +35,13 @@ layout(binding = 1, std430) buffer SB_RO_ssbo {
float16_t arg_0[];
} sb_ro;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_8421b9() {
uint res = uint(sb_ro.arg_0.length());
prevent_dce.inner = res;
}
void fragment_main() {
@@ -49,8 +59,13 @@ layout(binding = 1, std430) buffer SB_RO_ssbo {
float16_t arg_0[];
} sb_ro;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_8421b9() {
uint res = uint(sb_ro.arg_0.length());
prevent_dce.inner = res;
}
void compute_main() {

View File

@@ -22,33 +22,34 @@ struct SB_RO {
tint_array<half, 1> arg_0;
};
void arrayLength_8421b9(const constant tint_symbol_1* const tint_symbol_3) {
uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 2u);
void arrayLength_8421b9(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
uint res = (((*(tint_symbol_3)).buffer_size[0u][1u] - 0u) / 2u);
*(tint_symbol_4) = res;
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
arrayLength_8421b9(tint_symbol_4);
float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
arrayLength_8421b9(tint_symbol_5, tint_symbol_6);
return float4(0.0f);
}
vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
float4 const inner_result = vertex_main_inner(tint_symbol_5);
vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(0)]]) {
float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
arrayLength_8421b9(tint_symbol_6);
fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(0)]]) {
arrayLength_8421b9(tint_symbol_9, tint_symbol_10);
return;
}
kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
arrayLength_8421b9(tint_symbol_7);
kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(0)]]) {
arrayLength_8421b9(tint_symbol_11, tint_symbol_12);
return;
}

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 37
; Bound: 44
; Schema: 0
OpCapability Shader
OpCapability Float16
@@ -19,6 +19,9 @@
OpName %SB_RO "SB_RO"
OpMemberName %SB_RO 0 "arg_0"
OpName %sb_ro "sb_ro"
OpName %prevent_dce_block "prevent_dce_block"
OpMemberName %prevent_dce_block 0 "inner"
OpName %prevent_dce "prevent_dce"
OpName %arrayLength_8421b9 "arrayLength_8421b9"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
@@ -33,6 +36,10 @@
OpDecorate %sb_ro NonWritable
OpDecorate %sb_ro DescriptorSet 0
OpDecorate %sb_ro Binding 1
OpDecorate %prevent_dce_block Block
OpMemberDecorate %prevent_dce_block 0 Offset 0
OpDecorate %prevent_dce DescriptorSet 2
OpDecorate %prevent_dce Binding 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -46,39 +53,47 @@
%SB_RO = OpTypeStruct %_runtimearr_half
%_ptr_StorageBuffer_SB_RO = OpTypePointer StorageBuffer %SB_RO
%sb_ro = OpVariable %_ptr_StorageBuffer_SB_RO StorageBuffer
%void = OpTypeVoid
%14 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%prevent_dce_block = OpTypeStruct %uint
%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
%void = OpTypeVoid
%18 = OpTypeFunction %void
%_ptr_Function_uint = OpTypePointer Function %uint
%22 = OpConstantNull %uint
%23 = OpTypeFunction %v4float
%25 = OpConstantNull %uint
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%30 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%arrayLength_8421b9 = OpFunction %void None %14
%17 = OpLabel
%res = OpVariable %_ptr_Function_uint Function %22
%18 = OpArrayLength %uint %sb_ro 0
OpStore %res %18
%arrayLength_8421b9 = OpFunction %void None %18
%21 = OpLabel
%res = OpVariable %_ptr_Function_uint Function %25
%22 = OpArrayLength %uint %sb_ro 0
OpStore %res %22
%28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
%29 = OpLoad %uint %res
OpStore %28 %29
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %23
%25 = OpLabel
%26 = OpFunctionCall %void %arrayLength_8421b9
%vertex_main_inner = OpFunction %v4float None %30
%32 = OpLabel
%33 = OpFunctionCall %void %arrayLength_8421b9
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %14
%28 = OpLabel
%29 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %29
%vertex_main = OpFunction %void None %18
%35 = OpLabel
%36 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %36
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %14
%32 = OpLabel
%33 = OpFunctionCall %void %arrayLength_8421b9
%fragment_main = OpFunction %void None %18
%39 = OpLabel
%40 = OpFunctionCall %void %arrayLength_8421b9
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %14
%35 = OpLabel
%36 = OpFunctionCall %void %arrayLength_8421b9
%compute_main = OpFunction %void None %18
%42 = OpLabel
%43 = OpFunctionCall %void %arrayLength_8421b9
OpReturn
OpFunctionEnd

View File

@@ -8,8 +8,11 @@ struct SB_RO {
fn arrayLength_8421b9() {
var res : u32 = arrayLength(&(sb_ro.arg_0));
prevent_dce = res;
}
@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
arrayLength_8421b9();

View File

@@ -28,7 +28,9 @@ struct SB_RO {
// fn arrayLength(ptr<storage, array<f32>, read>) -> u32
fn arrayLength_a0f5ca() {
var res: u32 = arrayLength(&sb_ro.arg_0);
prevent_dce = res;
}
@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {

View File

@@ -1,10 +1,12 @@
ByteAddressBuffer sb_ro : register(t1, space0);
RWByteAddressBuffer prevent_dce : register(u0, space2);
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;
prevent_dce.Store(0u, asuint(res));
}
struct tint_symbol {

View File

@@ -1,10 +1,12 @@
ByteAddressBuffer sb_ro : register(t1, space0);
RWByteAddressBuffer prevent_dce : register(u0, space2);
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;
prevent_dce.Store(0u, asuint(res));
}
struct tint_symbol {

View File

@@ -4,8 +4,13 @@ layout(binding = 1, std430) buffer SB_RO_ssbo {
float arg_0[];
} sb_ro;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_a0f5ca() {
uint res = uint(sb_ro.arg_0.length());
prevent_dce.inner = res;
}
vec4 vertex_main() {
@@ -28,8 +33,13 @@ layout(binding = 1, std430) buffer SB_RO_ssbo {
float arg_0[];
} sb_ro;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_a0f5ca() {
uint res = uint(sb_ro.arg_0.length());
prevent_dce.inner = res;
}
void fragment_main() {
@@ -46,8 +56,13 @@ layout(binding = 1, std430) buffer SB_RO_ssbo {
float arg_0[];
} sb_ro;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_a0f5ca() {
uint res = uint(sb_ro.arg_0.length());
prevent_dce.inner = res;
}
void compute_main() {

View File

@@ -22,33 +22,34 @@ struct SB_RO {
tint_array<float, 1> arg_0;
};
void arrayLength_a0f5ca(const constant tint_symbol_1* const tint_symbol_3) {
uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
void arrayLength_a0f5ca(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
uint res = (((*(tint_symbol_3)).buffer_size[0u][1u] - 0u) / 4u);
*(tint_symbol_4) = res;
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
arrayLength_a0f5ca(tint_symbol_4);
float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
arrayLength_a0f5ca(tint_symbol_5, tint_symbol_6);
return float4(0.0f);
}
vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
float4 const inner_result = vertex_main_inner(tint_symbol_5);
vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(0)]]) {
float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
arrayLength_a0f5ca(tint_symbol_6);
fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(0)]]) {
arrayLength_a0f5ca(tint_symbol_9, tint_symbol_10);
return;
}
kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
arrayLength_a0f5ca(tint_symbol_7);
kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(0)]]) {
arrayLength_a0f5ca(tint_symbol_11, tint_symbol_12);
return;
}

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 36
; Bound: 43
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -15,6 +15,9 @@
OpName %SB_RO "SB_RO"
OpMemberName %SB_RO 0 "arg_0"
OpName %sb_ro "sb_ro"
OpName %prevent_dce_block "prevent_dce_block"
OpMemberName %prevent_dce_block 0 "inner"
OpName %prevent_dce "prevent_dce"
OpName %arrayLength_a0f5ca "arrayLength_a0f5ca"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
@@ -29,6 +32,10 @@
OpDecorate %sb_ro NonWritable
OpDecorate %sb_ro DescriptorSet 0
OpDecorate %sb_ro Binding 1
OpDecorate %prevent_dce_block Block
OpMemberDecorate %prevent_dce_block 0 Offset 0
OpDecorate %prevent_dce DescriptorSet 2
OpDecorate %prevent_dce Binding 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,39 +48,47 @@
%SB_RO = OpTypeStruct %_runtimearr_float
%_ptr_StorageBuffer_SB_RO = OpTypePointer StorageBuffer %SB_RO
%sb_ro = OpVariable %_ptr_StorageBuffer_SB_RO StorageBuffer
%void = OpTypeVoid
%13 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%prevent_dce_block = OpTypeStruct %uint
%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
%void = OpTypeVoid
%17 = OpTypeFunction %void
%_ptr_Function_uint = OpTypePointer Function %uint
%21 = OpConstantNull %uint
%22 = OpTypeFunction %v4float
%24 = OpConstantNull %uint
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%29 = OpTypeFunction %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
%arrayLength_a0f5ca = OpFunction %void None %17
%20 = OpLabel
%res = OpVariable %_ptr_Function_uint Function %24
%21 = OpArrayLength %uint %sb_ro 0
OpStore %res %21
%27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
%28 = OpLoad %uint %res
OpStore %27 %28
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %22
%24 = OpLabel
%25 = OpFunctionCall %void %arrayLength_a0f5ca
%vertex_main_inner = OpFunction %v4float None %29
%31 = OpLabel
%32 = OpFunctionCall %void %arrayLength_a0f5ca
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %13
%27 = OpLabel
%28 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %28
%vertex_main = OpFunction %void None %17
%34 = OpLabel
%35 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %35
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %13
%31 = OpLabel
%32 = OpFunctionCall %void %arrayLength_a0f5ca
%fragment_main = OpFunction %void None %17
%38 = OpLabel
%39 = OpFunctionCall %void %arrayLength_a0f5ca
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %13
%34 = OpLabel
%35 = OpFunctionCall %void %arrayLength_a0f5ca
%compute_main = OpFunction %void None %17
%41 = OpLabel
%42 = OpFunctionCall %void %arrayLength_a0f5ca
OpReturn
OpFunctionEnd

View File

@@ -6,8 +6,11 @@ struct SB_RO {
fn arrayLength_a0f5ca() {
var res : u32 = arrayLength(&(sb_ro.arg_0));
prevent_dce = res;
}
@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
arrayLength_a0f5ca();

View File

@@ -30,7 +30,9 @@ struct SB_RW {
// fn arrayLength(ptr<storage, array<f16>, read_write>) -> u32
fn arrayLength_cbd6b5() {
var res: u32 = arrayLength(&sb_rw.arg_0);
prevent_dce = res;
}
@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {

View File

@@ -1,10 +1,12 @@
RWByteAddressBuffer sb_rw : register(u0, space0);
RWByteAddressBuffer prevent_dce : register(u0, space2);
void arrayLength_cbd6b5() {
uint tint_symbol_2 = 0u;
sb_rw.GetDimensions(tint_symbol_2);
const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 2u);
uint res = tint_symbol_3;
prevent_dce.Store(0u, asuint(res));
}
struct tint_symbol {

View File

@@ -1,10 +1,12 @@
RWByteAddressBuffer sb_rw : register(u0, space0);
RWByteAddressBuffer prevent_dce : register(u0, space2);
void arrayLength_cbd6b5() {
uint tint_symbol_2 = 0u;
sb_rw.GetDimensions(tint_symbol_2);
const uint tint_symbol_3 = ((tint_symbol_2 - 0u) / 2u);
uint res = tint_symbol_3;
prevent_dce.Store(0u, asuint(res));
}
struct tint_symbol {

View File

@@ -5,8 +5,13 @@ layout(binding = 0, std430) buffer SB_RW_ssbo {
float16_t arg_0[];
} sb_rw;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_cbd6b5() {
uint res = uint(sb_rw.arg_0.length());
prevent_dce.inner = res;
}
vec4 vertex_main() {
@@ -30,8 +35,13 @@ layout(binding = 0, std430) buffer SB_RW_ssbo {
float16_t arg_0[];
} sb_rw;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_cbd6b5() {
uint res = uint(sb_rw.arg_0.length());
prevent_dce.inner = res;
}
void fragment_main() {
@@ -49,8 +59,13 @@ layout(binding = 0, std430) buffer SB_RW_ssbo {
float16_t arg_0[];
} sb_rw;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_cbd6b5() {
uint res = uint(sb_rw.arg_0.length());
prevent_dce.inner = res;
}
void compute_main() {

View File

@@ -22,33 +22,34 @@ struct SB_RW {
tint_array<half, 1> arg_0;
};
void arrayLength_cbd6b5(const constant tint_symbol_1* const tint_symbol_3) {
void arrayLength_cbd6b5(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 2u);
*(tint_symbol_4) = res;
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
arrayLength_cbd6b5(tint_symbol_4);
float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
arrayLength_cbd6b5(tint_symbol_5, tint_symbol_6);
return float4(0.0f);
}
vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
float4 const inner_result = vertex_main_inner(tint_symbol_5);
vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(1)]]) {
float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
arrayLength_cbd6b5(tint_symbol_6);
fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(1)]]) {
arrayLength_cbd6b5(tint_symbol_9, tint_symbol_10);
return;
}
kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
arrayLength_cbd6b5(tint_symbol_7);
kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(1)]]) {
arrayLength_cbd6b5(tint_symbol_11, tint_symbol_12);
return;
}

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 37
; Bound: 44
; Schema: 0
OpCapability Shader
OpCapability Float16
@@ -19,6 +19,9 @@
OpName %SB_RW "SB_RW"
OpMemberName %SB_RW 0 "arg_0"
OpName %sb_rw "sb_rw"
OpName %prevent_dce_block "prevent_dce_block"
OpMemberName %prevent_dce_block 0 "inner"
OpName %prevent_dce "prevent_dce"
OpName %arrayLength_cbd6b5 "arrayLength_cbd6b5"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
@@ -32,6 +35,10 @@
OpDecorate %_runtimearr_half ArrayStride 2
OpDecorate %sb_rw DescriptorSet 0
OpDecorate %sb_rw Binding 0
OpDecorate %prevent_dce_block Block
OpMemberDecorate %prevent_dce_block 0 Offset 0
OpDecorate %prevent_dce DescriptorSet 2
OpDecorate %prevent_dce Binding 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -45,39 +52,47 @@
%SB_RW = OpTypeStruct %_runtimearr_half
%_ptr_StorageBuffer_SB_RW = OpTypePointer StorageBuffer %SB_RW
%sb_rw = OpVariable %_ptr_StorageBuffer_SB_RW StorageBuffer
%void = OpTypeVoid
%14 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%prevent_dce_block = OpTypeStruct %uint
%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
%void = OpTypeVoid
%18 = OpTypeFunction %void
%_ptr_Function_uint = OpTypePointer Function %uint
%22 = OpConstantNull %uint
%23 = OpTypeFunction %v4float
%25 = OpConstantNull %uint
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%30 = OpTypeFunction %v4float
%float_1 = OpConstant %float 1
%arrayLength_cbd6b5 = OpFunction %void None %14
%17 = OpLabel
%res = OpVariable %_ptr_Function_uint Function %22
%18 = OpArrayLength %uint %sb_rw 0
OpStore %res %18
%arrayLength_cbd6b5 = OpFunction %void None %18
%21 = OpLabel
%res = OpVariable %_ptr_Function_uint Function %25
%22 = OpArrayLength %uint %sb_rw 0
OpStore %res %22
%28 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
%29 = OpLoad %uint %res
OpStore %28 %29
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %23
%25 = OpLabel
%26 = OpFunctionCall %void %arrayLength_cbd6b5
%vertex_main_inner = OpFunction %v4float None %30
%32 = OpLabel
%33 = OpFunctionCall %void %arrayLength_cbd6b5
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %14
%28 = OpLabel
%29 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %29
%vertex_main = OpFunction %void None %18
%35 = OpLabel
%36 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %36
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %14
%32 = OpLabel
%33 = OpFunctionCall %void %arrayLength_cbd6b5
%fragment_main = OpFunction %void None %18
%39 = OpLabel
%40 = OpFunctionCall %void %arrayLength_cbd6b5
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %14
%35 = OpLabel
%36 = OpFunctionCall %void %arrayLength_cbd6b5
%compute_main = OpFunction %void None %18
%42 = OpLabel
%43 = OpFunctionCall %void %arrayLength_cbd6b5
OpReturn
OpFunctionEnd

View File

@@ -8,8 +8,11 @@ struct SB_RW {
fn arrayLength_cbd6b5() {
var res : u32 = arrayLength(&(sb_rw.arg_0));
prevent_dce = res;
}
@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
arrayLength_cbd6b5();

View File

@@ -28,7 +28,9 @@ struct SB_RW {
// fn arrayLength(ptr<storage, array<f32>, read_write>) -> u32
fn arrayLength_cdd123() {
var res: u32 = arrayLength(&sb_rw.arg_0);
prevent_dce = res;
}
@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {

View File

@@ -1,10 +1,12 @@
RWByteAddressBuffer sb_rw : register(u0, space0);
RWByteAddressBuffer prevent_dce : register(u0, space2);
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;
prevent_dce.Store(0u, asuint(res));
}
struct tint_symbol {

View File

@@ -1,10 +1,12 @@
RWByteAddressBuffer sb_rw : register(u0, space0);
RWByteAddressBuffer prevent_dce : register(u0, space2);
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;
prevent_dce.Store(0u, asuint(res));
}
struct tint_symbol {

View File

@@ -4,8 +4,13 @@ layout(binding = 0, std430) buffer SB_RW_ssbo {
float arg_0[];
} sb_rw;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_cdd123() {
uint res = uint(sb_rw.arg_0.length());
prevent_dce.inner = res;
}
vec4 vertex_main() {
@@ -28,8 +33,13 @@ layout(binding = 0, std430) buffer SB_RW_ssbo {
float arg_0[];
} sb_rw;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_cdd123() {
uint res = uint(sb_rw.arg_0.length());
prevent_dce.inner = res;
}
void fragment_main() {
@@ -46,8 +56,13 @@ layout(binding = 0, std430) buffer SB_RW_ssbo {
float arg_0[];
} sb_rw;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_cdd123() {
uint res = uint(sb_rw.arg_0.length());
prevent_dce.inner = res;
}
void compute_main() {

View File

@@ -22,33 +22,34 @@ struct SB_RW {
tint_array<float, 1> arg_0;
};
void arrayLength_cdd123(const constant tint_symbol_1* const tint_symbol_3) {
void arrayLength_cdd123(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
*(tint_symbol_4) = res;
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
arrayLength_cdd123(tint_symbol_4);
float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
arrayLength_cdd123(tint_symbol_5, tint_symbol_6);
return float4(0.0f);
}
vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
float4 const inner_result = vertex_main_inner(tint_symbol_5);
vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(1)]]) {
float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
arrayLength_cdd123(tint_symbol_6);
fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(1)]]) {
arrayLength_cdd123(tint_symbol_9, tint_symbol_10);
return;
}
kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
arrayLength_cdd123(tint_symbol_7);
kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(1)]]) {
arrayLength_cdd123(tint_symbol_11, tint_symbol_12);
return;
}

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 36
; Bound: 43
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -15,6 +15,9 @@
OpName %SB_RW "SB_RW"
OpMemberName %SB_RW 0 "arg_0"
OpName %sb_rw "sb_rw"
OpName %prevent_dce_block "prevent_dce_block"
OpMemberName %prevent_dce_block 0 "inner"
OpName %prevent_dce "prevent_dce"
OpName %arrayLength_cdd123 "arrayLength_cdd123"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
@@ -28,6 +31,10 @@
OpDecorate %_runtimearr_float ArrayStride 4
OpDecorate %sb_rw DescriptorSet 0
OpDecorate %sb_rw Binding 0
OpDecorate %prevent_dce_block Block
OpMemberDecorate %prevent_dce_block 0 Offset 0
OpDecorate %prevent_dce DescriptorSet 2
OpDecorate %prevent_dce Binding 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -40,39 +47,47 @@
%SB_RW = OpTypeStruct %_runtimearr_float
%_ptr_StorageBuffer_SB_RW = OpTypePointer StorageBuffer %SB_RW
%sb_rw = OpVariable %_ptr_StorageBuffer_SB_RW StorageBuffer
%void = OpTypeVoid
%13 = OpTypeFunction %void
%uint = OpTypeInt 32 0
%prevent_dce_block = OpTypeStruct %uint
%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
%void = OpTypeVoid
%17 = OpTypeFunction %void
%_ptr_Function_uint = OpTypePointer Function %uint
%21 = OpConstantNull %uint
%22 = OpTypeFunction %v4float
%24 = OpConstantNull %uint
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%29 = OpTypeFunction %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
%arrayLength_cdd123 = OpFunction %void None %17
%20 = OpLabel
%res = OpVariable %_ptr_Function_uint Function %24
%21 = OpArrayLength %uint %sb_rw 0
OpStore %res %21
%27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
%28 = OpLoad %uint %res
OpStore %27 %28
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %22
%24 = OpLabel
%25 = OpFunctionCall %void %arrayLength_cdd123
%vertex_main_inner = OpFunction %v4float None %29
%31 = OpLabel
%32 = OpFunctionCall %void %arrayLength_cdd123
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %13
%27 = OpLabel
%28 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %28
%vertex_main = OpFunction %void None %17
%34 = OpLabel
%35 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %35
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %13
%31 = OpLabel
%32 = OpFunctionCall %void %arrayLength_cdd123
%fragment_main = OpFunction %void None %17
%38 = OpLabel
%39 = OpFunctionCall %void %arrayLength_cdd123
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %13
%34 = OpLabel
%35 = OpFunctionCall %void %arrayLength_cdd123
%compute_main = OpFunction %void None %17
%41 = OpLabel
%42 = OpFunctionCall %void %arrayLength_cdd123
OpReturn
OpFunctionEnd

View File

@@ -6,8 +6,11 @@ struct SB_RW {
fn arrayLength_cdd123() {
var res : u32 = arrayLength(&(sb_rw.arg_0));
prevent_dce = res;
}
@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
arrayLength_cdd123();

View File

@@ -28,7 +28,9 @@ struct SB_RO {
// fn arrayLength(ptr<storage, array<u32>, read>) -> u32
fn arrayLength_cfca0a() {
var res: u32 = arrayLength(&sb_ro.arg_0);
prevent_dce = res;
}
@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {

View File

@@ -1,10 +1,12 @@
ByteAddressBuffer sb_ro : register(t1, space0);
RWByteAddressBuffer prevent_dce : register(u0, space2);
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;
prevent_dce.Store(0u, asuint(res));
}
struct tint_symbol {

View File

@@ -1,10 +1,12 @@
ByteAddressBuffer sb_ro : register(t1, space0);
RWByteAddressBuffer prevent_dce : register(u0, space2);
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;
prevent_dce.Store(0u, asuint(res));
}
struct tint_symbol {

View File

@@ -4,8 +4,13 @@ layout(binding = 1, std430) buffer SB_RO_ssbo {
uint arg_0[];
} sb_ro;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_cfca0a() {
uint res = uint(sb_ro.arg_0.length());
prevent_dce.inner = res;
}
vec4 vertex_main() {
@@ -28,8 +33,13 @@ layout(binding = 1, std430) buffer SB_RO_ssbo {
uint arg_0[];
} sb_ro;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_cfca0a() {
uint res = uint(sb_ro.arg_0.length());
prevent_dce.inner = res;
}
void fragment_main() {
@@ -46,8 +56,13 @@ layout(binding = 1, std430) buffer SB_RO_ssbo {
uint arg_0[];
} sb_ro;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_cfca0a() {
uint res = uint(sb_ro.arg_0.length());
prevent_dce.inner = res;
}
void compute_main() {

View File

@@ -22,33 +22,34 @@ struct SB_RO {
tint_array<uint, 1> arg_0;
};
void arrayLength_cfca0a(const constant tint_symbol_1* const tint_symbol_3) {
uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
void arrayLength_cfca0a(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
uint res = (((*(tint_symbol_3)).buffer_size[0u][1u] - 0u) / 4u);
*(tint_symbol_4) = res;
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
arrayLength_cfca0a(tint_symbol_4);
float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
arrayLength_cfca0a(tint_symbol_5, tint_symbol_6);
return float4(0.0f);
}
vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
float4 const inner_result = vertex_main_inner(tint_symbol_5);
vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(0)]]) {
float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
arrayLength_cfca0a(tint_symbol_6);
fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(0)]]) {
arrayLength_cfca0a(tint_symbol_9, tint_symbol_10);
return;
}
kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
arrayLength_cfca0a(tint_symbol_7);
kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(0)]]) {
arrayLength_cfca0a(tint_symbol_11, tint_symbol_12);
return;
}

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 36
; Bound: 43
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -15,6 +15,9 @@
OpName %SB_RO "SB_RO"
OpMemberName %SB_RO 0 "arg_0"
OpName %sb_ro "sb_ro"
OpName %prevent_dce_block "prevent_dce_block"
OpMemberName %prevent_dce_block 0 "inner"
OpName %prevent_dce "prevent_dce"
OpName %arrayLength_cfca0a "arrayLength_cfca0a"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
@@ -29,6 +32,10 @@
OpDecorate %sb_ro NonWritable
OpDecorate %sb_ro DescriptorSet 0
OpDecorate %sb_ro Binding 1
OpDecorate %prevent_dce_block Block
OpMemberDecorate %prevent_dce_block 0 Offset 0
OpDecorate %prevent_dce DescriptorSet 2
OpDecorate %prevent_dce Binding 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -42,38 +49,46 @@
%SB_RO = OpTypeStruct %_runtimearr_uint
%_ptr_StorageBuffer_SB_RO = OpTypePointer StorageBuffer %SB_RO
%sb_ro = OpVariable %_ptr_StorageBuffer_SB_RO StorageBuffer
%prevent_dce_block = OpTypeStruct %uint
%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
%void = OpTypeVoid
%14 = OpTypeFunction %void
%17 = OpTypeFunction %void
%_ptr_Function_uint = OpTypePointer Function %uint
%21 = OpConstantNull %uint
%22 = OpTypeFunction %v4float
%24 = OpConstantNull %uint
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%29 = OpTypeFunction %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
%arrayLength_cfca0a = OpFunction %void None %17
%20 = OpLabel
%res = OpVariable %_ptr_Function_uint Function %24
%21 = OpArrayLength %uint %sb_ro 0
OpStore %res %21
%27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
%28 = OpLoad %uint %res
OpStore %27 %28
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %22
%24 = OpLabel
%25 = OpFunctionCall %void %arrayLength_cfca0a
%vertex_main_inner = OpFunction %v4float None %29
%31 = OpLabel
%32 = OpFunctionCall %void %arrayLength_cfca0a
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %14
%27 = OpLabel
%28 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %28
%vertex_main = OpFunction %void None %17
%34 = OpLabel
%35 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %35
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %14
%31 = OpLabel
%32 = OpFunctionCall %void %arrayLength_cfca0a
%fragment_main = OpFunction %void None %17
%38 = OpLabel
%39 = OpFunctionCall %void %arrayLength_cfca0a
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %14
%34 = OpLabel
%35 = OpFunctionCall %void %arrayLength_cfca0a
%compute_main = OpFunction %void None %17
%41 = OpLabel
%42 = OpFunctionCall %void %arrayLength_cfca0a
OpReturn
OpFunctionEnd

View File

@@ -6,8 +6,11 @@ struct SB_RO {
fn arrayLength_cfca0a() {
var res : u32 = arrayLength(&(sb_ro.arg_0));
prevent_dce = res;
}
@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
arrayLength_cfca0a();

View File

@@ -28,7 +28,9 @@ struct SB_RW {
// fn arrayLength(ptr<storage, array<u32>, read_write>) -> u32
fn arrayLength_eb510f() {
var res: u32 = arrayLength(&sb_rw.arg_0);
prevent_dce = res;
}
@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {

View File

@@ -1,10 +1,12 @@
RWByteAddressBuffer sb_rw : register(u0, space0);
RWByteAddressBuffer prevent_dce : register(u0, space2);
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;
prevent_dce.Store(0u, asuint(res));
}
struct tint_symbol {

View File

@@ -1,10 +1,12 @@
RWByteAddressBuffer sb_rw : register(u0, space0);
RWByteAddressBuffer prevent_dce : register(u0, space2);
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;
prevent_dce.Store(0u, asuint(res));
}
struct tint_symbol {

View File

@@ -4,8 +4,13 @@ layout(binding = 0, std430) buffer SB_RW_ssbo {
uint arg_0[];
} sb_rw;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_eb510f() {
uint res = uint(sb_rw.arg_0.length());
prevent_dce.inner = res;
}
vec4 vertex_main() {
@@ -28,8 +33,13 @@ layout(binding = 0, std430) buffer SB_RW_ssbo {
uint arg_0[];
} sb_rw;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_eb510f() {
uint res = uint(sb_rw.arg_0.length());
prevent_dce.inner = res;
}
void fragment_main() {
@@ -46,8 +56,13 @@ layout(binding = 0, std430) buffer SB_RW_ssbo {
uint arg_0[];
} sb_rw;
layout(binding = 0, std430) buffer prevent_dce_block_ssbo {
uint inner;
} prevent_dce;
void arrayLength_eb510f() {
uint res = uint(sb_rw.arg_0.length());
prevent_dce.inner = res;
}
void compute_main() {

View File

@@ -22,33 +22,34 @@ struct SB_RW {
tint_array<uint, 1> arg_0;
};
void arrayLength_eb510f(const constant tint_symbol_1* const tint_symbol_3) {
void arrayLength_eb510f(const constant tint_symbol_1* const tint_symbol_3, device uint* const tint_symbol_4) {
uint res = (((*(tint_symbol_3)).buffer_size[0u][0u] - 0u) / 4u);
*(tint_symbol_4) = res;
}
struct tint_symbol {
float4 value [[position]];
};
float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_4) {
arrayLength_eb510f(tint_symbol_4);
float4 vertex_main_inner(const constant tint_symbol_1* const tint_symbol_5, device uint* const tint_symbol_6) {
arrayLength_eb510f(tint_symbol_5, tint_symbol_6);
return float4(0.0f);
}
vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_5 [[buffer(30)]]) {
float4 const inner_result = vertex_main_inner(tint_symbol_5);
vertex tint_symbol vertex_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]], device uint* tint_symbol_8 [[buffer(1)]]) {
float4 const inner_result = vertex_main_inner(tint_symbol_7, tint_symbol_8);
tint_symbol wrapper_result = {};
wrapper_result.value = inner_result;
return wrapper_result;
}
fragment void fragment_main(const constant tint_symbol_1* tint_symbol_6 [[buffer(30)]]) {
arrayLength_eb510f(tint_symbol_6);
fragment void fragment_main(const constant tint_symbol_1* tint_symbol_9 [[buffer(30)]], device uint* tint_symbol_10 [[buffer(1)]]) {
arrayLength_eb510f(tint_symbol_9, tint_symbol_10);
return;
}
kernel void compute_main(const constant tint_symbol_1* tint_symbol_7 [[buffer(30)]]) {
arrayLength_eb510f(tint_symbol_7);
kernel void compute_main(const constant tint_symbol_1* tint_symbol_11 [[buffer(30)]], device uint* tint_symbol_12 [[buffer(1)]]) {
arrayLength_eb510f(tint_symbol_11, tint_symbol_12);
return;
}

View File

@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 36
; Bound: 43
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
@@ -15,6 +15,9 @@
OpName %SB_RW "SB_RW"
OpMemberName %SB_RW 0 "arg_0"
OpName %sb_rw "sb_rw"
OpName %prevent_dce_block "prevent_dce_block"
OpMemberName %prevent_dce_block 0 "inner"
OpName %prevent_dce "prevent_dce"
OpName %arrayLength_eb510f "arrayLength_eb510f"
OpName %res "res"
OpName %vertex_main_inner "vertex_main_inner"
@@ -28,6 +31,10 @@
OpDecorate %_runtimearr_uint ArrayStride 4
OpDecorate %sb_rw DescriptorSet 0
OpDecorate %sb_rw Binding 0
OpDecorate %prevent_dce_block Block
OpMemberDecorate %prevent_dce_block 0 Offset 0
OpDecorate %prevent_dce DescriptorSet 2
OpDecorate %prevent_dce Binding 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
@@ -41,38 +48,46 @@
%SB_RW = OpTypeStruct %_runtimearr_uint
%_ptr_StorageBuffer_SB_RW = OpTypePointer StorageBuffer %SB_RW
%sb_rw = OpVariable %_ptr_StorageBuffer_SB_RW StorageBuffer
%prevent_dce_block = OpTypeStruct %uint
%_ptr_StorageBuffer_prevent_dce_block = OpTypePointer StorageBuffer %prevent_dce_block
%prevent_dce = OpVariable %_ptr_StorageBuffer_prevent_dce_block StorageBuffer
%void = OpTypeVoid
%14 = OpTypeFunction %void
%17 = OpTypeFunction %void
%_ptr_Function_uint = OpTypePointer Function %uint
%21 = OpConstantNull %uint
%22 = OpTypeFunction %v4float
%24 = OpConstantNull %uint
%uint_0 = OpConstant %uint 0
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
%29 = OpTypeFunction %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
%arrayLength_eb510f = OpFunction %void None %17
%20 = OpLabel
%res = OpVariable %_ptr_Function_uint Function %24
%21 = OpArrayLength %uint %sb_rw 0
OpStore %res %21
%27 = OpAccessChain %_ptr_StorageBuffer_uint %prevent_dce %uint_0
%28 = OpLoad %uint %res
OpStore %27 %28
OpReturn
OpFunctionEnd
%vertex_main_inner = OpFunction %v4float None %22
%24 = OpLabel
%25 = OpFunctionCall %void %arrayLength_eb510f
%vertex_main_inner = OpFunction %v4float None %29
%31 = OpLabel
%32 = OpFunctionCall %void %arrayLength_eb510f
OpReturnValue %5
OpFunctionEnd
%vertex_main = OpFunction %void None %14
%27 = OpLabel
%28 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %28
%vertex_main = OpFunction %void None %17
%34 = OpLabel
%35 = OpFunctionCall %v4float %vertex_main_inner
OpStore %value %35
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %14
%31 = OpLabel
%32 = OpFunctionCall %void %arrayLength_eb510f
%fragment_main = OpFunction %void None %17
%38 = OpLabel
%39 = OpFunctionCall %void %arrayLength_eb510f
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %14
%34 = OpLabel
%35 = OpFunctionCall %void %arrayLength_eb510f
%compute_main = OpFunction %void None %17
%41 = OpLabel
%42 = OpFunctionCall %void %arrayLength_eb510f
OpReturn
OpFunctionEnd

View File

@@ -6,8 +6,11 @@ struct SB_RW {
fn arrayLength_eb510f() {
var res : u32 = arrayLength(&(sb_rw.arg_0));
prevent_dce = res;
}
@group(2) @binding(0) var<storage, read_write> prevent_dce : u32;
@vertex
fn vertex_main() -> @builtin(position) vec4<f32> {
arrayLength_eb510f();