Add end-to-end corpus from Tint SPIR-V Reader

Add the unit tests samples from src/reader/spirv when:
- they are valid for Vulkan 1.0 (plus some common extensions)
- they should translate to valid WGSL

Bug: tint:1043
Change-Id: I40a01990dbc40aff5cf7ace0b1aabfd0e437f638
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/60000
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: David Neto <dneto@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
David Neto 2021-07-30 16:03:06 +00:00 committed by Tint LUCI CQ
parent 33c997b829
commit d1a026ecd0
5538 changed files with 177217 additions and 0 deletions

View File

@ -0,0 +1,121 @@
; Test: ConvertResultSignedness_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 100
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical Simple
OpEntryPoint Fragment %1 "main"
OpExecutionMode %1 OriginUpperLeft
OpName %f1 "f1"
OpName %vf12 "vf12"
OpName %vf21 "vf21"
OpName %vf123 "vf123"
OpName %vf1234 "vf1234"
OpName %u1 "u1"
OpName %vu12 "vu12"
OpName %vu123 "vu123"
OpName %vu1234 "vu1234"
OpName %i1 "i1"
OpName %vi12 "vi12"
OpName %vi123 "vi123"
OpName %vi1234 "vi1234"
OpName %coords1 "coords1"
OpName %coords12 "coords12"
OpName %coords123 "coords123"
OpName %coords1234 "coords1234"
OpName %offsets2d "offsets2d"
OpName %u_offsets2d "u_offsets2d"
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
OpDecorate %20 DescriptorSet 2
OpDecorate %20 Binding 1
OpDecorate %30 DescriptorSet 0
OpDecorate %30 Binding 1
%void = OpTypeVoid
%24 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_3 = OpConstant %uint 3
%uint_4 = OpConstant %uint 4
%uint_100 = OpConstant %uint 100
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%v4int = OpTypeVector %int 4
%v2uint = OpTypeVector %uint 2
%v3uint = OpTypeVector %uint 3
%v4uint = OpTypeVector %uint 4
%v2float = OpTypeVector %float 2
%v3float = OpTypeVector %float 3
%v4float = OpTypeVector %float 4
%49 = OpConstantNull %float
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%float_7 = OpConstant %float 7
%56 = OpConstantNull %v2float
%57 = OpConstantNull %v3float
%58 = OpConstantNull %v4float
%59 = OpConstantComposite %v2int %int_1 %int_2
%60 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%61 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%62 = OpConstantComposite %v2uint %uint_1 %uint_2
%63 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%64 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%65 = OpConstantComposite %v2float %float_1 %float_2
%66 = OpConstantComposite %v2float %float_2 %float_1
%67 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%68 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%float_0_200000003 = OpConstant %float 0.200000003
%70 = OpTypeSampler
%_ptr_UniformConstant_70 = OpTypePointer UniformConstant %70
%72 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_72 = OpTypePointer UniformConstant %72
%74 = OpTypeSampledImage %72
%10 = OpVariable %_ptr_UniformConstant_70 UniformConstant
%20 = OpVariable %_ptr_UniformConstant_72 UniformConstant
%30 = OpVariable %_ptr_UniformConstant_70 UniformConstant
%offsets2d = OpConstantComposite %v2int %int_3 %int_4
%u_offsets2d = OpConstantComposite %v2uint %uint_3 %uint_4
%1 = OpFunction %void None %24
%75 = OpLabel
%f1 = OpCopyObject %float %float_1
%vf12 = OpCopyObject %v2float %65
%vf21 = OpCopyObject %v2float %66
%vf123 = OpCopyObject %v3float %67
%vf1234 = OpCopyObject %v4float %68
%i1 = OpCopyObject %int %int_1
%vi12 = OpCopyObject %v2int %59
%vi123 = OpCopyObject %v3int %60
%vi1234 = OpCopyObject %v4int %61
%u1 = OpCopyObject %uint %uint_1
%vu12 = OpCopyObject %v2uint %62
%vu123 = OpCopyObject %v3uint %63
%vu1234 = OpCopyObject %v4uint %64
%coords1 = OpCopyObject %float %float_1
%coords12 = OpCopyObject %v2float %vf12
%coords123 = OpCopyObject %v3float %vf123
%coords1234 = OpCopyObject %v4float %vf1234
%76 = OpLoad %70 %10
%77 = OpLoad %72 %20
%78 = OpSampledImage %74 %77 %76
%99 = OpImageFetch %v4float %77 %vi12
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,30 @@
SamplerState x_10 : register(s0, space0);
Texture2D<float4> x_20 : register(t1, space2);
SamplerState x_30 : register(s1, space0);
void main_1() {
const float f1 = 1.0f;
const float2 vf12 = float2(1.0f, 2.0f);
const float2 vf21 = float2(2.0f, 1.0f);
const float3 vf123 = float3(1.0f, 2.0f, 3.0f);
const float4 vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
const int i1 = 1;
const int2 vi12 = int2(1, 2);
const int3 vi123 = int3(1, 2, 3);
const int4 vi1234 = int4(1, 2, 3, 4);
const uint u1 = 1u;
const uint2 vu12 = uint2(1u, 2u);
const uint3 vu123 = uint3(1u, 2u, 3u);
const uint4 vu1234 = uint4(1u, 2u, 3u, 4u);
const float coords1 = 1.0f;
const float2 coords12 = vf12;
const float3 coords123 = vf123;
const float4 coords1234 = vf1234;
const float4 x_99 = x_20.Load(int3(vi12, 0));
return;
}
void main() {
main_1();
return;
}

View File

@ -0,0 +1,30 @@
#include <metal_stdlib>
using namespace metal;
void main_1(texture2d<float, access::sample> tint_symbol_1) {
float const f1 = 1.0f;
float2 const vf12 = float2(1.0f, 2.0f);
float2 const vf21 = float2(2.0f, 1.0f);
float3 const vf123 = float3(1.0f, 2.0f, 3.0f);
float4 const vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
int const i1 = 1;
int2 const vi12 = int2(1, 2);
int3 const vi123 = int3(1, 2, 3);
int4 const vi1234 = int4(1, 2, 3, 4);
uint const u1 = 1u;
uint2 const vu12 = uint2(1u, 2u);
uint3 const vu123 = uint3(1u, 2u, 3u);
uint4 const vu1234 = uint4(1u, 2u, 3u, 4u);
float const coords1 = 1.0f;
float2 const coords12 = vf12;
float3 const coords123 = vf123;
float4 const coords1234 = vf1234;
float4 const x_99 = tint_symbol_1.read(uint2(vi12), 0);
return;
}
fragment void tint_symbol(texture2d<float, access::sample> tint_symbol_2 [[texture(1)]]) {
main_1(tint_symbol_2);
return;
}

View File

@ -0,0 +1,75 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 52
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %x_10 "x_10"
OpName %x_20 "x_20"
OpName %x_30 "x_30"
OpName %main_1 "main_1"
OpName %main "main"
OpDecorate %x_10 DescriptorSet 0
OpDecorate %x_10 Binding 0
OpDecorate %x_20 DescriptorSet 2
OpDecorate %x_20 Binding 1
OpDecorate %x_30 DescriptorSet 0
OpDecorate %x_30 Binding 1
%3 = OpTypeSampler
%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
%x_10 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%float = OpTypeFloat 32
%6 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6
%x_20 = OpVariable %_ptr_UniformConstant_6 UniformConstant
%x_30 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%void = OpTypeVoid
%9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%v2float = OpTypeVector %float 2
%float_2 = OpConstant %float 2
%16 = OpConstantComposite %v2float %float_1 %float_2
%17 = OpConstantComposite %v2float %float_2 %float_1
%v3float = OpTypeVector %float 3
%float_3 = OpConstant %float 3
%20 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%v4float = OpTypeVector %float 4
%float_4 = OpConstant %float 4
%23 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
%int_2 = OpConstant %int 2
%28 = OpConstantComposite %v2int %int_1 %int_2
%v3int = OpTypeVector %int 3
%int_3 = OpConstant %int 3
%31 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%v4int = OpTypeVector %int 4
%int_4 = OpConstant %int 4
%34 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%v2uint = OpTypeVector %uint 2
%uint_2 = OpConstant %uint 2
%39 = OpConstantComposite %v2uint %uint_1 %uint_2
%v3uint = OpTypeVector %uint 3
%uint_3 = OpConstant %uint 3
%42 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%v4uint = OpTypeVector %uint 4
%uint_4 = OpConstant %uint 4
%45 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%int_0 = OpConstant %int 0
%main_1 = OpFunction %void None %9
%12 = OpLabel
%47 = OpLoad %6 %x_20
%46 = OpImageFetch %v4float %47 %28 Lod %int_0
OpReturn
OpFunctionEnd
%main = OpFunction %void None %9
%50 = OpLabel
%51 = OpFunctionCall %void %main_1
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,32 @@
[[group(0), binding(0)]] var x_10 : sampler;
[[group(2), binding(1)]] var x_20 : texture_2d<f32>;
[[group(0), binding(1)]] var x_30 : sampler;
fn main_1() {
let f1 : f32 = 1.0;
let vf12 : vec2<f32> = vec2<f32>(1.0, 2.0);
let vf21 : vec2<f32> = vec2<f32>(2.0, 1.0);
let vf123 : vec3<f32> = vec3<f32>(1.0, 2.0, 3.0);
let vf1234 : vec4<f32> = vec4<f32>(1.0, 2.0, 3.0, 4.0);
let i1 : i32 = 1;
let vi12 : vec2<i32> = vec2<i32>(1, 2);
let vi123 : vec3<i32> = vec3<i32>(1, 2, 3);
let vi1234 : vec4<i32> = vec4<i32>(1, 2, 3, 4);
let u1 : u32 = 1u;
let vu12 : vec2<u32> = vec2<u32>(1u, 2u);
let vu123 : vec3<u32> = vec3<u32>(1u, 2u, 3u);
let vu1234 : vec4<u32> = vec4<u32>(1u, 2u, 3u, 4u);
let coords1 : f32 = 1.0;
let coords12 : vec2<f32> = vf12;
let coords123 : vec3<f32> = vf123;
let coords1234 : vec4<f32> = vf1234;
let x_99 : vec4<f32> = textureLoad(x_20, vi12, 0);
return;
}
[[stage(fragment)]]
fn main() {
main_1();
}

View File

@ -0,0 +1,121 @@
; Test: ConvertResultSignedness_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 100
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical Simple
OpEntryPoint Fragment %1 "main"
OpExecutionMode %1 OriginUpperLeft
OpName %f1 "f1"
OpName %vf12 "vf12"
OpName %vf21 "vf21"
OpName %vf123 "vf123"
OpName %vf1234 "vf1234"
OpName %u1 "u1"
OpName %vu12 "vu12"
OpName %vu123 "vu123"
OpName %vu1234 "vu1234"
OpName %i1 "i1"
OpName %vi12 "vi12"
OpName %vi123 "vi123"
OpName %vi1234 "vi1234"
OpName %coords1 "coords1"
OpName %coords12 "coords12"
OpName %coords123 "coords123"
OpName %coords1234 "coords1234"
OpName %offsets2d "offsets2d"
OpName %u_offsets2d "u_offsets2d"
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
OpDecorate %20 DescriptorSet 2
OpDecorate %20 Binding 1
OpDecorate %30 DescriptorSet 0
OpDecorate %30 Binding 1
%void = OpTypeVoid
%24 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_3 = OpConstant %uint 3
%uint_4 = OpConstant %uint 4
%uint_100 = OpConstant %uint 100
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%v4int = OpTypeVector %int 4
%v2uint = OpTypeVector %uint 2
%v3uint = OpTypeVector %uint 3
%v4uint = OpTypeVector %uint 4
%v2float = OpTypeVector %float 2
%v3float = OpTypeVector %float 3
%v4float = OpTypeVector %float 4
%49 = OpConstantNull %float
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%float_7 = OpConstant %float 7
%56 = OpConstantNull %v2float
%57 = OpConstantNull %v3float
%58 = OpConstantNull %v4float
%59 = OpConstantComposite %v2int %int_1 %int_2
%60 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%61 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%62 = OpConstantComposite %v2uint %uint_1 %uint_2
%63 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%64 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%65 = OpConstantComposite %v2float %float_1 %float_2
%66 = OpConstantComposite %v2float %float_2 %float_1
%67 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%68 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%float_0_200000003 = OpConstant %float 0.200000003
%70 = OpTypeSampler
%_ptr_UniformConstant_70 = OpTypePointer UniformConstant %70
%72 = OpTypeImage %uint 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_72 = OpTypePointer UniformConstant %72
%74 = OpTypeSampledImage %72
%10 = OpVariable %_ptr_UniformConstant_70 UniformConstant
%20 = OpVariable %_ptr_UniformConstant_72 UniformConstant
%30 = OpVariable %_ptr_UniformConstant_70 UniformConstant
%offsets2d = OpConstantComposite %v2int %int_3 %int_4
%u_offsets2d = OpConstantComposite %v2uint %uint_3 %uint_4
%1 = OpFunction %void None %24
%75 = OpLabel
%f1 = OpCopyObject %float %float_1
%vf12 = OpCopyObject %v2float %65
%vf21 = OpCopyObject %v2float %66
%vf123 = OpCopyObject %v3float %67
%vf1234 = OpCopyObject %v4float %68
%i1 = OpCopyObject %int %int_1
%vi12 = OpCopyObject %v2int %59
%vi123 = OpCopyObject %v3int %60
%vi1234 = OpCopyObject %v4int %61
%u1 = OpCopyObject %uint %uint_1
%vu12 = OpCopyObject %v2uint %62
%vu123 = OpCopyObject %v3uint %63
%vu1234 = OpCopyObject %v4uint %64
%coords1 = OpCopyObject %float %float_1
%coords12 = OpCopyObject %v2float %vf12
%coords123 = OpCopyObject %v3float %vf123
%coords1234 = OpCopyObject %v4float %vf1234
%76 = OpLoad %70 %10
%77 = OpLoad %72 %20
%78 = OpSampledImage %74 %77 %76
%99 = OpImageFetch %v4uint %77 %vi12
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,30 @@
SamplerState x_10 : register(s0, space0);
Texture2D<uint4> x_20 : register(t1, space2);
SamplerState x_30 : register(s1, space0);
void main_1() {
const float f1 = 1.0f;
const float2 vf12 = float2(1.0f, 2.0f);
const float2 vf21 = float2(2.0f, 1.0f);
const float3 vf123 = float3(1.0f, 2.0f, 3.0f);
const float4 vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
const int i1 = 1;
const int2 vi12 = int2(1, 2);
const int3 vi123 = int3(1, 2, 3);
const int4 vi1234 = int4(1, 2, 3, 4);
const uint u1 = 1u;
const uint2 vu12 = uint2(1u, 2u);
const uint3 vu123 = uint3(1u, 2u, 3u);
const uint4 vu1234 = uint4(1u, 2u, 3u, 4u);
const float coords1 = 1.0f;
const float2 coords12 = vf12;
const float3 coords123 = vf123;
const float4 coords1234 = vf1234;
const uint4 x_99 = x_20.Load(int3(vi12, 0));
return;
}
void main() {
main_1();
return;
}

View File

@ -0,0 +1,30 @@
#include <metal_stdlib>
using namespace metal;
void main_1(texture2d<uint, access::sample> tint_symbol_1) {
float const f1 = 1.0f;
float2 const vf12 = float2(1.0f, 2.0f);
float2 const vf21 = float2(2.0f, 1.0f);
float3 const vf123 = float3(1.0f, 2.0f, 3.0f);
float4 const vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
int const i1 = 1;
int2 const vi12 = int2(1, 2);
int3 const vi123 = int3(1, 2, 3);
int4 const vi1234 = int4(1, 2, 3, 4);
uint const u1 = 1u;
uint2 const vu12 = uint2(1u, 2u);
uint3 const vu123 = uint3(1u, 2u, 3u);
uint4 const vu1234 = uint4(1u, 2u, 3u, 4u);
float const coords1 = 1.0f;
float2 const coords12 = vf12;
float3 const coords123 = vf123;
float4 const coords1234 = vf1234;
uint4 const x_99 = tint_symbol_1.read(uint2(vi12), 0);
return;
}
fragment void tint_symbol(texture2d<uint, access::sample> tint_symbol_2 [[texture(1)]]) {
main_1(tint_symbol_2);
return;
}

View File

@ -0,0 +1,75 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 52
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %x_10 "x_10"
OpName %x_20 "x_20"
OpName %x_30 "x_30"
OpName %main_1 "main_1"
OpName %main "main"
OpDecorate %x_10 DescriptorSet 0
OpDecorate %x_10 Binding 0
OpDecorate %x_20 DescriptorSet 2
OpDecorate %x_20 Binding 1
OpDecorate %x_30 DescriptorSet 0
OpDecorate %x_30 Binding 1
%3 = OpTypeSampler
%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
%x_10 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%uint = OpTypeInt 32 0
%6 = OpTypeImage %uint 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6
%x_20 = OpVariable %_ptr_UniformConstant_6 UniformConstant
%x_30 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%void = OpTypeVoid
%9 = OpTypeFunction %void
%float = OpTypeFloat 32
%float_1 = OpConstant %float 1
%v2float = OpTypeVector %float 2
%float_2 = OpConstant %float 2
%17 = OpConstantComposite %v2float %float_1 %float_2
%18 = OpConstantComposite %v2float %float_2 %float_1
%v3float = OpTypeVector %float 3
%float_3 = OpConstant %float 3
%21 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%v4float = OpTypeVector %float 4
%float_4 = OpConstant %float 4
%24 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
%int_2 = OpConstant %int 2
%29 = OpConstantComposite %v2int %int_1 %int_2
%v3int = OpTypeVector %int 3
%int_3 = OpConstant %int 3
%32 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%v4int = OpTypeVector %int 4
%int_4 = OpConstant %int 4
%35 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%uint_1 = OpConstant %uint 1
%v2uint = OpTypeVector %uint 2
%uint_2 = OpConstant %uint 2
%39 = OpConstantComposite %v2uint %uint_1 %uint_2
%v3uint = OpTypeVector %uint 3
%uint_3 = OpConstant %uint 3
%42 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%v4uint = OpTypeVector %uint 4
%uint_4 = OpConstant %uint 4
%45 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%int_0 = OpConstant %int 0
%main_1 = OpFunction %void None %9
%12 = OpLabel
%47 = OpLoad %6 %x_20
%46 = OpImageFetch %v4uint %47 %29 Lod %int_0
OpReturn
OpFunctionEnd
%main = OpFunction %void None %9
%50 = OpLabel
%51 = OpFunctionCall %void %main_1
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,32 @@
[[group(0), binding(0)]] var x_10 : sampler;
[[group(2), binding(1)]] var x_20 : texture_2d<u32>;
[[group(0), binding(1)]] var x_30 : sampler;
fn main_1() {
let f1 : f32 = 1.0;
let vf12 : vec2<f32> = vec2<f32>(1.0, 2.0);
let vf21 : vec2<f32> = vec2<f32>(2.0, 1.0);
let vf123 : vec3<f32> = vec3<f32>(1.0, 2.0, 3.0);
let vf1234 : vec4<f32> = vec4<f32>(1.0, 2.0, 3.0, 4.0);
let i1 : i32 = 1;
let vi12 : vec2<i32> = vec2<i32>(1, 2);
let vi123 : vec3<i32> = vec3<i32>(1, 2, 3);
let vi1234 : vec4<i32> = vec4<i32>(1, 2, 3, 4);
let u1 : u32 = 1u;
let vu12 : vec2<u32> = vec2<u32>(1u, 2u);
let vu123 : vec3<u32> = vec3<u32>(1u, 2u, 3u);
let vu1234 : vec4<u32> = vec4<u32>(1u, 2u, 3u, 4u);
let coords1 : f32 = 1.0;
let coords12 : vec2<f32> = vf12;
let coords123 : vec3<f32> = vf123;
let coords1234 : vec4<f32> = vf1234;
let x_99 : vec4<u32> = textureLoad(x_20, vi12, 0);
return;
}
[[stage(fragment)]]
fn main() {
main_1();
}

View File

@ -0,0 +1,121 @@
; Test: ConvertResultSignedness_SpvParserHandleTest_SampledImageAccessTest_Variable_2.spvasm
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 100
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical Simple
OpEntryPoint Fragment %1 "main"
OpExecutionMode %1 OriginUpperLeft
OpName %f1 "f1"
OpName %vf12 "vf12"
OpName %vf21 "vf21"
OpName %vf123 "vf123"
OpName %vf1234 "vf1234"
OpName %u1 "u1"
OpName %vu12 "vu12"
OpName %vu123 "vu123"
OpName %vu1234 "vu1234"
OpName %i1 "i1"
OpName %vi12 "vi12"
OpName %vi123 "vi123"
OpName %vi1234 "vi1234"
OpName %coords1 "coords1"
OpName %coords12 "coords12"
OpName %coords123 "coords123"
OpName %coords1234 "coords1234"
OpName %offsets2d "offsets2d"
OpName %u_offsets2d "u_offsets2d"
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
OpDecorate %20 DescriptorSet 2
OpDecorate %20 Binding 1
OpDecorate %30 DescriptorSet 0
OpDecorate %30 Binding 1
%void = OpTypeVoid
%24 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_3 = OpConstant %uint 3
%uint_4 = OpConstant %uint 4
%uint_100 = OpConstant %uint 100
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%v4int = OpTypeVector %int 4
%v2uint = OpTypeVector %uint 2
%v3uint = OpTypeVector %uint 3
%v4uint = OpTypeVector %uint 4
%v2float = OpTypeVector %float 2
%v3float = OpTypeVector %float 3
%v4float = OpTypeVector %float 4
%49 = OpConstantNull %float
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%float_7 = OpConstant %float 7
%56 = OpConstantNull %v2float
%57 = OpConstantNull %v3float
%58 = OpConstantNull %v4float
%59 = OpConstantComposite %v2int %int_1 %int_2
%60 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%61 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%62 = OpConstantComposite %v2uint %uint_1 %uint_2
%63 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%64 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%65 = OpConstantComposite %v2float %float_1 %float_2
%66 = OpConstantComposite %v2float %float_2 %float_1
%67 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%68 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%float_0_200000003 = OpConstant %float 0.200000003
%70 = OpTypeSampler
%_ptr_UniformConstant_70 = OpTypePointer UniformConstant %70
%72 = OpTypeImage %int 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_72 = OpTypePointer UniformConstant %72
%74 = OpTypeSampledImage %72
%10 = OpVariable %_ptr_UniformConstant_70 UniformConstant
%20 = OpVariable %_ptr_UniformConstant_72 UniformConstant
%30 = OpVariable %_ptr_UniformConstant_70 UniformConstant
%offsets2d = OpConstantComposite %v2int %int_3 %int_4
%u_offsets2d = OpConstantComposite %v2uint %uint_3 %uint_4
%1 = OpFunction %void None %24
%75 = OpLabel
%f1 = OpCopyObject %float %float_1
%vf12 = OpCopyObject %v2float %65
%vf21 = OpCopyObject %v2float %66
%vf123 = OpCopyObject %v3float %67
%vf1234 = OpCopyObject %v4float %68
%i1 = OpCopyObject %int %int_1
%vi12 = OpCopyObject %v2int %59
%vi123 = OpCopyObject %v3int %60
%vi1234 = OpCopyObject %v4int %61
%u1 = OpCopyObject %uint %uint_1
%vu12 = OpCopyObject %v2uint %62
%vu123 = OpCopyObject %v3uint %63
%vu1234 = OpCopyObject %v4uint %64
%coords1 = OpCopyObject %float %float_1
%coords12 = OpCopyObject %v2float %vf12
%coords123 = OpCopyObject %v3float %vf123
%coords1234 = OpCopyObject %v4float %vf1234
%76 = OpLoad %70 %10
%77 = OpLoad %72 %20
%78 = OpSampledImage %74 %77 %76
%99 = OpImageFetch %v4int %77 %vi12
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,30 @@
SamplerState x_10 : register(s0, space0);
Texture2D<int4> x_20 : register(t1, space2);
SamplerState x_30 : register(s1, space0);
void main_1() {
const float f1 = 1.0f;
const float2 vf12 = float2(1.0f, 2.0f);
const float2 vf21 = float2(2.0f, 1.0f);
const float3 vf123 = float3(1.0f, 2.0f, 3.0f);
const float4 vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
const int i1 = 1;
const int2 vi12 = int2(1, 2);
const int3 vi123 = int3(1, 2, 3);
const int4 vi1234 = int4(1, 2, 3, 4);
const uint u1 = 1u;
const uint2 vu12 = uint2(1u, 2u);
const uint3 vu123 = uint3(1u, 2u, 3u);
const uint4 vu1234 = uint4(1u, 2u, 3u, 4u);
const float coords1 = 1.0f;
const float2 coords12 = vf12;
const float3 coords123 = vf123;
const float4 coords1234 = vf1234;
const int4 x_99 = x_20.Load(int3(vi12, 0));
return;
}
void main() {
main_1();
return;
}

View File

@ -0,0 +1,30 @@
#include <metal_stdlib>
using namespace metal;
void main_1(texture2d<int, access::sample> tint_symbol_1) {
float const f1 = 1.0f;
float2 const vf12 = float2(1.0f, 2.0f);
float2 const vf21 = float2(2.0f, 1.0f);
float3 const vf123 = float3(1.0f, 2.0f, 3.0f);
float4 const vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
int const i1 = 1;
int2 const vi12 = int2(1, 2);
int3 const vi123 = int3(1, 2, 3);
int4 const vi1234 = int4(1, 2, 3, 4);
uint const u1 = 1u;
uint2 const vu12 = uint2(1u, 2u);
uint3 const vu123 = uint3(1u, 2u, 3u);
uint4 const vu1234 = uint4(1u, 2u, 3u, 4u);
float const coords1 = 1.0f;
float2 const coords12 = vf12;
float3 const coords123 = vf123;
float4 const coords1234 = vf1234;
int4 const x_99 = tint_symbol_1.read(uint2(vi12), 0);
return;
}
fragment void tint_symbol(texture2d<int, access::sample> tint_symbol_2 [[texture(1)]]) {
main_1(tint_symbol_2);
return;
}

View File

@ -0,0 +1,75 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 52
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %x_10 "x_10"
OpName %x_20 "x_20"
OpName %x_30 "x_30"
OpName %main_1 "main_1"
OpName %main "main"
OpDecorate %x_10 DescriptorSet 0
OpDecorate %x_10 Binding 0
OpDecorate %x_20 DescriptorSet 2
OpDecorate %x_20 Binding 1
OpDecorate %x_30 DescriptorSet 0
OpDecorate %x_30 Binding 1
%3 = OpTypeSampler
%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
%x_10 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%int = OpTypeInt 32 1
%6 = OpTypeImage %int 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6
%x_20 = OpVariable %_ptr_UniformConstant_6 UniformConstant
%x_30 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%void = OpTypeVoid
%9 = OpTypeFunction %void
%float = OpTypeFloat 32
%float_1 = OpConstant %float 1
%v2float = OpTypeVector %float 2
%float_2 = OpConstant %float 2
%17 = OpConstantComposite %v2float %float_1 %float_2
%18 = OpConstantComposite %v2float %float_2 %float_1
%v3float = OpTypeVector %float 3
%float_3 = OpConstant %float 3
%21 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%v4float = OpTypeVector %float 4
%float_4 = OpConstant %float 4
%24 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
%int_2 = OpConstant %int 2
%28 = OpConstantComposite %v2int %int_1 %int_2
%v3int = OpTypeVector %int 3
%int_3 = OpConstant %int 3
%31 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%v4int = OpTypeVector %int 4
%int_4 = OpConstant %int 4
%34 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%v2uint = OpTypeVector %uint 2
%uint_2 = OpConstant %uint 2
%39 = OpConstantComposite %v2uint %uint_1 %uint_2
%v3uint = OpTypeVector %uint 3
%uint_3 = OpConstant %uint 3
%42 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%v4uint = OpTypeVector %uint 4
%uint_4 = OpConstant %uint 4
%45 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%int_0 = OpConstant %int 0
%main_1 = OpFunction %void None %9
%12 = OpLabel
%47 = OpLoad %6 %x_20
%46 = OpImageFetch %v4int %47 %28 Lod %int_0
OpReturn
OpFunctionEnd
%main = OpFunction %void None %9
%50 = OpLabel
%51 = OpFunctionCall %void %main_1
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,32 @@
[[group(0), binding(0)]] var x_10 : sampler;
[[group(2), binding(1)]] var x_20 : texture_2d<i32>;
[[group(0), binding(1)]] var x_30 : sampler;
fn main_1() {
let f1 : f32 = 1.0;
let vf12 : vec2<f32> = vec2<f32>(1.0, 2.0);
let vf21 : vec2<f32> = vec2<f32>(2.0, 1.0);
let vf123 : vec3<f32> = vec3<f32>(1.0, 2.0, 3.0);
let vf1234 : vec4<f32> = vec4<f32>(1.0, 2.0, 3.0, 4.0);
let i1 : i32 = 1;
let vi12 : vec2<i32> = vec2<i32>(1, 2);
let vi123 : vec3<i32> = vec3<i32>(1, 2, 3);
let vi1234 : vec4<i32> = vec4<i32>(1, 2, 3, 4);
let u1 : u32 = 1u;
let vu12 : vec2<u32> = vec2<u32>(1u, 2u);
let vu123 : vec3<u32> = vec3<u32>(1u, 2u, 3u);
let vu1234 : vec4<u32> = vec4<u32>(1u, 2u, 3u, 4u);
let coords1 : f32 = 1.0;
let coords12 : vec2<f32> = vf12;
let coords123 : vec3<f32> = vf123;
let coords1234 : vec4<f32> = vf1234;
let x_99 : vec4<i32> = textureLoad(x_20, vi12, 0);
return;
}
[[stage(fragment)]]
fn main() {
main_1();
}

View File

@ -0,0 +1,119 @@
; Test: ConvertResultSignedness_SpvParserHandleTest_SampledImageAccessTest_Variable_3.spvasm
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 100
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical Simple
OpEntryPoint Fragment %1 "main"
OpExecutionMode %1 OriginUpperLeft
OpName %f1 "f1"
OpName %vf12 "vf12"
OpName %vf21 "vf21"
OpName %vf123 "vf123"
OpName %vf1234 "vf1234"
OpName %u1 "u1"
OpName %vu12 "vu12"
OpName %vu123 "vu123"
OpName %vu1234 "vu1234"
OpName %i1 "i1"
OpName %vi12 "vi12"
OpName %vi123 "vi123"
OpName %vi1234 "vi1234"
OpName %coords1 "coords1"
OpName %coords12 "coords12"
OpName %coords123 "coords123"
OpName %coords1234 "coords1234"
OpName %offsets2d "offsets2d"
OpName %u_offsets2d "u_offsets2d"
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
OpDecorate %20 DescriptorSet 2
OpDecorate %20 Binding 1
OpDecorate %30 DescriptorSet 0
OpDecorate %30 Binding 1
%void = OpTypeVoid
%24 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_3 = OpConstant %uint 3
%uint_4 = OpConstant %uint 4
%uint_100 = OpConstant %uint 100
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%v4int = OpTypeVector %int 4
%v2uint = OpTypeVector %uint 2
%v3uint = OpTypeVector %uint 3
%v4uint = OpTypeVector %uint 4
%v2float = OpTypeVector %float 2
%v3float = OpTypeVector %float 3
%v4float = OpTypeVector %float 4
%49 = OpConstantNull %float
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%float_7 = OpConstant %float 7
%56 = OpConstantNull %v2float
%57 = OpConstantNull %v3float
%58 = OpConstantNull %v4float
%59 = OpConstantComposite %v2int %int_1 %int_2
%60 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%61 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%62 = OpConstantComposite %v2uint %uint_1 %uint_2
%63 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%64 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%65 = OpConstantComposite %v2float %float_1 %float_2
%66 = OpConstantComposite %v2float %float_2 %float_1
%67 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%68 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%float_0_200000003 = OpConstant %float 0.200000003
%70 = OpTypeSampler
%_ptr_UniformConstant_70 = OpTypePointer UniformConstant %70
%72 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
%_ptr_UniformConstant_72 = OpTypePointer UniformConstant %72
%10 = OpVariable %_ptr_UniformConstant_70 UniformConstant
%20 = OpVariable %_ptr_UniformConstant_72 UniformConstant
%30 = OpVariable %_ptr_UniformConstant_70 UniformConstant
%offsets2d = OpConstantComposite %v2int %int_3 %int_4
%u_offsets2d = OpConstantComposite %v2uint %uint_3 %uint_4
%1 = OpFunction %void None %24
%74 = OpLabel
%f1 = OpCopyObject %float %float_1
%vf12 = OpCopyObject %v2float %65
%vf21 = OpCopyObject %v2float %66
%vf123 = OpCopyObject %v3float %67
%vf1234 = OpCopyObject %v4float %68
%i1 = OpCopyObject %int %int_1
%vi12 = OpCopyObject %v2int %59
%vi123 = OpCopyObject %v3int %60
%vi1234 = OpCopyObject %v4int %61
%u1 = OpCopyObject %uint %uint_1
%vu12 = OpCopyObject %v2uint %62
%vu123 = OpCopyObject %v3uint %63
%vu1234 = OpCopyObject %v4uint %64
%coords1 = OpCopyObject %float %float_1
%coords12 = OpCopyObject %v2float %vf12
%coords123 = OpCopyObject %v3float %vf123
%coords1234 = OpCopyObject %v4float %vf1234
%75 = OpLoad %70 %10
%76 = OpLoad %72 %20
%99 = OpImageRead %v4float %76 %vi12
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,31 @@
warning: use of deprecated intrinsic
SamplerState x_10 : register(s0, space0);
Texture2D<float4> x_20 : register(t1, space2);
SamplerState x_30 : register(s1, space0);
void main_1() {
const float f1 = 1.0f;
const float2 vf12 = float2(1.0f, 2.0f);
const float2 vf21 = float2(2.0f, 1.0f);
const float3 vf123 = float3(1.0f, 2.0f, 3.0f);
const float4 vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
const int i1 = 1;
const int2 vi12 = int2(1, 2);
const int3 vi123 = int3(1, 2, 3);
const int4 vi1234 = int4(1, 2, 3, 4);
const uint u1 = 1u;
const uint2 vu12 = uint2(1u, 2u);
const uint3 vu123 = uint3(1u, 2u, 3u);
const uint4 vu1234 = uint4(1u, 2u, 3u, 4u);
const float coords1 = 1.0f;
const float2 coords12 = vf12;
const float3 coords123 = vf123;
const float4 coords1234 = vf1234;
const float4 x_99 = x_20.Load(int3(vi12, 0));
return;
}
void main() {
main_1();
return;
}

View File

@ -0,0 +1,31 @@
warning: use of deprecated intrinsic
#include <metal_stdlib>
using namespace metal;
void main_1(texture2d<float, access::read> tint_symbol_1) {
float const f1 = 1.0f;
float2 const vf12 = float2(1.0f, 2.0f);
float2 const vf21 = float2(2.0f, 1.0f);
float3 const vf123 = float3(1.0f, 2.0f, 3.0f);
float4 const vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
int const i1 = 1;
int2 const vi12 = int2(1, 2);
int3 const vi123 = int3(1, 2, 3);
int4 const vi1234 = int4(1, 2, 3, 4);
uint const u1 = 1u;
uint2 const vu12 = uint2(1u, 2u);
uint3 const vu123 = uint3(1u, 2u, 3u);
uint4 const vu1234 = uint4(1u, 2u, 3u, 4u);
float const coords1 = 1.0f;
float2 const coords12 = vf12;
float3 const coords123 = vf123;
float4 const coords1234 = vf1234;
float4 const x_99 = tint_symbol_1.read(uint2(vi12));
return;
}
fragment void tint_symbol(texture2d<float, access::read> tint_symbol_2 [[texture(1)]]) {
main_1(tint_symbol_2);
return;
}

View File

@ -0,0 +1,76 @@
warning: use of deprecated intrinsic
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 51
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %x_10 "x_10"
OpName %x_20 "x_20"
OpName %x_30 "x_30"
OpName %main_1 "main_1"
OpName %main "main"
OpDecorate %x_10 DescriptorSet 0
OpDecorate %x_10 Binding 0
OpDecorate %x_20 NonWritable
OpDecorate %x_20 DescriptorSet 2
OpDecorate %x_20 Binding 1
OpDecorate %x_30 DescriptorSet 0
OpDecorate %x_30 Binding 1
%3 = OpTypeSampler
%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
%x_10 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%float = OpTypeFloat 32
%6 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6
%x_20 = OpVariable %_ptr_UniformConstant_6 UniformConstant
%x_30 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%void = OpTypeVoid
%9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%v2float = OpTypeVector %float 2
%float_2 = OpConstant %float 2
%16 = OpConstantComposite %v2float %float_1 %float_2
%17 = OpConstantComposite %v2float %float_2 %float_1
%v3float = OpTypeVector %float 3
%float_3 = OpConstant %float 3
%20 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%v4float = OpTypeVector %float 4
%float_4 = OpConstant %float 4
%23 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
%int_2 = OpConstant %int 2
%28 = OpConstantComposite %v2int %int_1 %int_2
%v3int = OpTypeVector %int 3
%int_3 = OpConstant %int 3
%31 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%v4int = OpTypeVector %int 4
%int_4 = OpConstant %int 4
%34 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%v2uint = OpTypeVector %uint 2
%uint_2 = OpConstant %uint 2
%39 = OpConstantComposite %v2uint %uint_1 %uint_2
%v3uint = OpTypeVector %uint 3
%uint_3 = OpConstant %uint 3
%42 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%v4uint = OpTypeVector %uint 4
%uint_4 = OpConstant %uint 4
%45 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%main_1 = OpFunction %void None %9
%12 = OpLabel
%47 = OpLoad %6 %x_20
%46 = OpImageRead %v4float %47 %28
OpReturn
OpFunctionEnd
%main = OpFunction %void None %9
%49 = OpLabel
%50 = OpFunctionCall %void %main_1
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,33 @@
warning: use of deprecated intrinsic
[[group(0), binding(0)]] var x_10 : sampler;
[[group(2), binding(1)]] var x_20 : texture_storage_2d<rgba32float, read>;
[[group(0), binding(1)]] var x_30 : sampler;
fn main_1() {
let f1 : f32 = 1.0;
let vf12 : vec2<f32> = vec2<f32>(1.0, 2.0);
let vf21 : vec2<f32> = vec2<f32>(2.0, 1.0);
let vf123 : vec3<f32> = vec3<f32>(1.0, 2.0, 3.0);
let vf1234 : vec4<f32> = vec4<f32>(1.0, 2.0, 3.0, 4.0);
let i1 : i32 = 1;
let vi12 : vec2<i32> = vec2<i32>(1, 2);
let vi123 : vec3<i32> = vec3<i32>(1, 2, 3);
let vi1234 : vec4<i32> = vec4<i32>(1, 2, 3, 4);
let u1 : u32 = 1u;
let vu12 : vec2<u32> = vec2<u32>(1u, 2u);
let vu123 : vec3<u32> = vec3<u32>(1u, 2u, 3u);
let vu1234 : vec4<u32> = vec4<u32>(1u, 2u, 3u, 4u);
let coords1 : f32 = 1.0;
let coords12 : vec2<f32> = vf12;
let coords123 : vec3<f32> = vf123;
let coords1234 : vec4<f32> = vf1234;
let x_99 : vec4<f32> = textureLoad(x_20, vi12);
return;
}
[[stage(fragment)]]
fn main() {
main_1();
}

View File

@ -0,0 +1,119 @@
; Test: ConvertResultSignedness_SpvParserHandleTest_SampledImageAccessTest_Variable_4.spvasm
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 100
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical Simple
OpEntryPoint Fragment %1 "main"
OpExecutionMode %1 OriginUpperLeft
OpName %f1 "f1"
OpName %vf12 "vf12"
OpName %vf21 "vf21"
OpName %vf123 "vf123"
OpName %vf1234 "vf1234"
OpName %u1 "u1"
OpName %vu12 "vu12"
OpName %vu123 "vu123"
OpName %vu1234 "vu1234"
OpName %i1 "i1"
OpName %vi12 "vi12"
OpName %vi123 "vi123"
OpName %vi1234 "vi1234"
OpName %coords1 "coords1"
OpName %coords12 "coords12"
OpName %coords123 "coords123"
OpName %coords1234 "coords1234"
OpName %offsets2d "offsets2d"
OpName %u_offsets2d "u_offsets2d"
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
OpDecorate %20 DescriptorSet 2
OpDecorate %20 Binding 1
OpDecorate %30 DescriptorSet 0
OpDecorate %30 Binding 1
%void = OpTypeVoid
%24 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_3 = OpConstant %uint 3
%uint_4 = OpConstant %uint 4
%uint_100 = OpConstant %uint 100
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%v4int = OpTypeVector %int 4
%v2uint = OpTypeVector %uint 2
%v3uint = OpTypeVector %uint 3
%v4uint = OpTypeVector %uint 4
%v2float = OpTypeVector %float 2
%v3float = OpTypeVector %float 3
%v4float = OpTypeVector %float 4
%49 = OpConstantNull %float
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%float_7 = OpConstant %float 7
%56 = OpConstantNull %v2float
%57 = OpConstantNull %v3float
%58 = OpConstantNull %v4float
%59 = OpConstantComposite %v2int %int_1 %int_2
%60 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%61 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%62 = OpConstantComposite %v2uint %uint_1 %uint_2
%63 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%64 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%65 = OpConstantComposite %v2float %float_1 %float_2
%66 = OpConstantComposite %v2float %float_2 %float_1
%67 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%68 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%float_0_200000003 = OpConstant %float 0.200000003
%70 = OpTypeSampler
%_ptr_UniformConstant_70 = OpTypePointer UniformConstant %70
%72 = OpTypeImage %uint 2D 0 0 0 2 Rgba32ui
%_ptr_UniformConstant_72 = OpTypePointer UniformConstant %72
%10 = OpVariable %_ptr_UniformConstant_70 UniformConstant
%20 = OpVariable %_ptr_UniformConstant_72 UniformConstant
%30 = OpVariable %_ptr_UniformConstant_70 UniformConstant
%offsets2d = OpConstantComposite %v2int %int_3 %int_4
%u_offsets2d = OpConstantComposite %v2uint %uint_3 %uint_4
%1 = OpFunction %void None %24
%74 = OpLabel
%f1 = OpCopyObject %float %float_1
%vf12 = OpCopyObject %v2float %65
%vf21 = OpCopyObject %v2float %66
%vf123 = OpCopyObject %v3float %67
%vf1234 = OpCopyObject %v4float %68
%i1 = OpCopyObject %int %int_1
%vi12 = OpCopyObject %v2int %59
%vi123 = OpCopyObject %v3int %60
%vi1234 = OpCopyObject %v4int %61
%u1 = OpCopyObject %uint %uint_1
%vu12 = OpCopyObject %v2uint %62
%vu123 = OpCopyObject %v3uint %63
%vu1234 = OpCopyObject %v4uint %64
%coords1 = OpCopyObject %float %float_1
%coords12 = OpCopyObject %v2float %vf12
%coords123 = OpCopyObject %v3float %vf123
%coords1234 = OpCopyObject %v4float %vf1234
%75 = OpLoad %70 %10
%76 = OpLoad %72 %20
%99 = OpImageRead %v4uint %76 %vi12
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,31 @@
warning: use of deprecated intrinsic
SamplerState x_10 : register(s0, space0);
Texture2D<uint4> x_20 : register(t1, space2);
SamplerState x_30 : register(s1, space0);
void main_1() {
const float f1 = 1.0f;
const float2 vf12 = float2(1.0f, 2.0f);
const float2 vf21 = float2(2.0f, 1.0f);
const float3 vf123 = float3(1.0f, 2.0f, 3.0f);
const float4 vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
const int i1 = 1;
const int2 vi12 = int2(1, 2);
const int3 vi123 = int3(1, 2, 3);
const int4 vi1234 = int4(1, 2, 3, 4);
const uint u1 = 1u;
const uint2 vu12 = uint2(1u, 2u);
const uint3 vu123 = uint3(1u, 2u, 3u);
const uint4 vu1234 = uint4(1u, 2u, 3u, 4u);
const float coords1 = 1.0f;
const float2 coords12 = vf12;
const float3 coords123 = vf123;
const float4 coords1234 = vf1234;
const uint4 x_99 = x_20.Load(int3(vi12, 0));
return;
}
void main() {
main_1();
return;
}

View File

@ -0,0 +1,31 @@
warning: use of deprecated intrinsic
#include <metal_stdlib>
using namespace metal;
void main_1(texture2d<uint, access::read> tint_symbol_1) {
float const f1 = 1.0f;
float2 const vf12 = float2(1.0f, 2.0f);
float2 const vf21 = float2(2.0f, 1.0f);
float3 const vf123 = float3(1.0f, 2.0f, 3.0f);
float4 const vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
int const i1 = 1;
int2 const vi12 = int2(1, 2);
int3 const vi123 = int3(1, 2, 3);
int4 const vi1234 = int4(1, 2, 3, 4);
uint const u1 = 1u;
uint2 const vu12 = uint2(1u, 2u);
uint3 const vu123 = uint3(1u, 2u, 3u);
uint4 const vu1234 = uint4(1u, 2u, 3u, 4u);
float const coords1 = 1.0f;
float2 const coords12 = vf12;
float3 const coords123 = vf123;
float4 const coords1234 = vf1234;
uint4 const x_99 = tint_symbol_1.read(uint2(vi12));
return;
}
fragment void tint_symbol(texture2d<uint, access::read> tint_symbol_2 [[texture(1)]]) {
main_1(tint_symbol_2);
return;
}

View File

@ -0,0 +1,76 @@
warning: use of deprecated intrinsic
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 51
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %x_10 "x_10"
OpName %x_20 "x_20"
OpName %x_30 "x_30"
OpName %main_1 "main_1"
OpName %main "main"
OpDecorate %x_10 DescriptorSet 0
OpDecorate %x_10 Binding 0
OpDecorate %x_20 NonWritable
OpDecorate %x_20 DescriptorSet 2
OpDecorate %x_20 Binding 1
OpDecorate %x_30 DescriptorSet 0
OpDecorate %x_30 Binding 1
%3 = OpTypeSampler
%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
%x_10 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%uint = OpTypeInt 32 0
%6 = OpTypeImage %uint 2D 0 0 0 2 Rgba32ui
%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6
%x_20 = OpVariable %_ptr_UniformConstant_6 UniformConstant
%x_30 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%void = OpTypeVoid
%9 = OpTypeFunction %void
%float = OpTypeFloat 32
%float_1 = OpConstant %float 1
%v2float = OpTypeVector %float 2
%float_2 = OpConstant %float 2
%17 = OpConstantComposite %v2float %float_1 %float_2
%18 = OpConstantComposite %v2float %float_2 %float_1
%v3float = OpTypeVector %float 3
%float_3 = OpConstant %float 3
%21 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%v4float = OpTypeVector %float 4
%float_4 = OpConstant %float 4
%24 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
%int_2 = OpConstant %int 2
%29 = OpConstantComposite %v2int %int_1 %int_2
%v3int = OpTypeVector %int 3
%int_3 = OpConstant %int 3
%32 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%v4int = OpTypeVector %int 4
%int_4 = OpConstant %int 4
%35 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%uint_1 = OpConstant %uint 1
%v2uint = OpTypeVector %uint 2
%uint_2 = OpConstant %uint 2
%39 = OpConstantComposite %v2uint %uint_1 %uint_2
%v3uint = OpTypeVector %uint 3
%uint_3 = OpConstant %uint 3
%42 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%v4uint = OpTypeVector %uint 4
%uint_4 = OpConstant %uint 4
%45 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%main_1 = OpFunction %void None %9
%12 = OpLabel
%47 = OpLoad %6 %x_20
%46 = OpImageRead %v4uint %47 %29
OpReturn
OpFunctionEnd
%main = OpFunction %void None %9
%49 = OpLabel
%50 = OpFunctionCall %void %main_1
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,33 @@
warning: use of deprecated intrinsic
[[group(0), binding(0)]] var x_10 : sampler;
[[group(2), binding(1)]] var x_20 : texture_storage_2d<rgba32uint, read>;
[[group(0), binding(1)]] var x_30 : sampler;
fn main_1() {
let f1 : f32 = 1.0;
let vf12 : vec2<f32> = vec2<f32>(1.0, 2.0);
let vf21 : vec2<f32> = vec2<f32>(2.0, 1.0);
let vf123 : vec3<f32> = vec3<f32>(1.0, 2.0, 3.0);
let vf1234 : vec4<f32> = vec4<f32>(1.0, 2.0, 3.0, 4.0);
let i1 : i32 = 1;
let vi12 : vec2<i32> = vec2<i32>(1, 2);
let vi123 : vec3<i32> = vec3<i32>(1, 2, 3);
let vi1234 : vec4<i32> = vec4<i32>(1, 2, 3, 4);
let u1 : u32 = 1u;
let vu12 : vec2<u32> = vec2<u32>(1u, 2u);
let vu123 : vec3<u32> = vec3<u32>(1u, 2u, 3u);
let vu1234 : vec4<u32> = vec4<u32>(1u, 2u, 3u, 4u);
let coords1 : f32 = 1.0;
let coords12 : vec2<f32> = vf12;
let coords123 : vec3<f32> = vf123;
let coords1234 : vec4<f32> = vf1234;
let x_99 : vec4<u32> = textureLoad(x_20, vi12);
return;
}
[[stage(fragment)]]
fn main() {
main_1();
}

View File

@ -0,0 +1,119 @@
; Test: ConvertResultSignedness_SpvParserHandleTest_SampledImageAccessTest_Variable_5.spvasm
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 100
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical Simple
OpEntryPoint Fragment %1 "main"
OpExecutionMode %1 OriginUpperLeft
OpName %f1 "f1"
OpName %vf12 "vf12"
OpName %vf21 "vf21"
OpName %vf123 "vf123"
OpName %vf1234 "vf1234"
OpName %u1 "u1"
OpName %vu12 "vu12"
OpName %vu123 "vu123"
OpName %vu1234 "vu1234"
OpName %i1 "i1"
OpName %vi12 "vi12"
OpName %vi123 "vi123"
OpName %vi1234 "vi1234"
OpName %coords1 "coords1"
OpName %coords12 "coords12"
OpName %coords123 "coords123"
OpName %coords1234 "coords1234"
OpName %offsets2d "offsets2d"
OpName %u_offsets2d "u_offsets2d"
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
OpDecorate %20 DescriptorSet 2
OpDecorate %20 Binding 1
OpDecorate %30 DescriptorSet 0
OpDecorate %30 Binding 1
%void = OpTypeVoid
%24 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_3 = OpConstant %uint 3
%uint_4 = OpConstant %uint 4
%uint_100 = OpConstant %uint 100
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%v4int = OpTypeVector %int 4
%v2uint = OpTypeVector %uint 2
%v3uint = OpTypeVector %uint 3
%v4uint = OpTypeVector %uint 4
%v2float = OpTypeVector %float 2
%v3float = OpTypeVector %float 3
%v4float = OpTypeVector %float 4
%49 = OpConstantNull %float
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%float_7 = OpConstant %float 7
%56 = OpConstantNull %v2float
%57 = OpConstantNull %v3float
%58 = OpConstantNull %v4float
%59 = OpConstantComposite %v2int %int_1 %int_2
%60 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%61 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%62 = OpConstantComposite %v2uint %uint_1 %uint_2
%63 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%64 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%65 = OpConstantComposite %v2float %float_1 %float_2
%66 = OpConstantComposite %v2float %float_2 %float_1
%67 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%68 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%float_0_200000003 = OpConstant %float 0.200000003
%70 = OpTypeSampler
%_ptr_UniformConstant_70 = OpTypePointer UniformConstant %70
%72 = OpTypeImage %int 2D 0 0 0 2 Rgba32i
%_ptr_UniformConstant_72 = OpTypePointer UniformConstant %72
%10 = OpVariable %_ptr_UniformConstant_70 UniformConstant
%20 = OpVariable %_ptr_UniformConstant_72 UniformConstant
%30 = OpVariable %_ptr_UniformConstant_70 UniformConstant
%offsets2d = OpConstantComposite %v2int %int_3 %int_4
%u_offsets2d = OpConstantComposite %v2uint %uint_3 %uint_4
%1 = OpFunction %void None %24
%74 = OpLabel
%f1 = OpCopyObject %float %float_1
%vf12 = OpCopyObject %v2float %65
%vf21 = OpCopyObject %v2float %66
%vf123 = OpCopyObject %v3float %67
%vf1234 = OpCopyObject %v4float %68
%i1 = OpCopyObject %int %int_1
%vi12 = OpCopyObject %v2int %59
%vi123 = OpCopyObject %v3int %60
%vi1234 = OpCopyObject %v4int %61
%u1 = OpCopyObject %uint %uint_1
%vu12 = OpCopyObject %v2uint %62
%vu123 = OpCopyObject %v3uint %63
%vu1234 = OpCopyObject %v4uint %64
%coords1 = OpCopyObject %float %float_1
%coords12 = OpCopyObject %v2float %vf12
%coords123 = OpCopyObject %v3float %vf123
%coords1234 = OpCopyObject %v4float %vf1234
%75 = OpLoad %70 %10
%76 = OpLoad %72 %20
%99 = OpImageRead %v4int %76 %vi12
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,31 @@
warning: use of deprecated intrinsic
SamplerState x_10 : register(s0, space0);
Texture2D<int4> x_20 : register(t1, space2);
SamplerState x_30 : register(s1, space0);
void main_1() {
const float f1 = 1.0f;
const float2 vf12 = float2(1.0f, 2.0f);
const float2 vf21 = float2(2.0f, 1.0f);
const float3 vf123 = float3(1.0f, 2.0f, 3.0f);
const float4 vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
const int i1 = 1;
const int2 vi12 = int2(1, 2);
const int3 vi123 = int3(1, 2, 3);
const int4 vi1234 = int4(1, 2, 3, 4);
const uint u1 = 1u;
const uint2 vu12 = uint2(1u, 2u);
const uint3 vu123 = uint3(1u, 2u, 3u);
const uint4 vu1234 = uint4(1u, 2u, 3u, 4u);
const float coords1 = 1.0f;
const float2 coords12 = vf12;
const float3 coords123 = vf123;
const float4 coords1234 = vf1234;
const int4 x_99 = x_20.Load(int3(vi12, 0));
return;
}
void main() {
main_1();
return;
}

View File

@ -0,0 +1,31 @@
warning: use of deprecated intrinsic
#include <metal_stdlib>
using namespace metal;
void main_1(texture2d<int, access::read> tint_symbol_1) {
float const f1 = 1.0f;
float2 const vf12 = float2(1.0f, 2.0f);
float2 const vf21 = float2(2.0f, 1.0f);
float3 const vf123 = float3(1.0f, 2.0f, 3.0f);
float4 const vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
int const i1 = 1;
int2 const vi12 = int2(1, 2);
int3 const vi123 = int3(1, 2, 3);
int4 const vi1234 = int4(1, 2, 3, 4);
uint const u1 = 1u;
uint2 const vu12 = uint2(1u, 2u);
uint3 const vu123 = uint3(1u, 2u, 3u);
uint4 const vu1234 = uint4(1u, 2u, 3u, 4u);
float const coords1 = 1.0f;
float2 const coords12 = vf12;
float3 const coords123 = vf123;
float4 const coords1234 = vf1234;
int4 const x_99 = tint_symbol_1.read(uint2(vi12));
return;
}
fragment void tint_symbol(texture2d<int, access::read> tint_symbol_2 [[texture(1)]]) {
main_1(tint_symbol_2);
return;
}

View File

@ -0,0 +1,76 @@
warning: use of deprecated intrinsic
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 51
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %x_10 "x_10"
OpName %x_20 "x_20"
OpName %x_30 "x_30"
OpName %main_1 "main_1"
OpName %main "main"
OpDecorate %x_10 DescriptorSet 0
OpDecorate %x_10 Binding 0
OpDecorate %x_20 NonWritable
OpDecorate %x_20 DescriptorSet 2
OpDecorate %x_20 Binding 1
OpDecorate %x_30 DescriptorSet 0
OpDecorate %x_30 Binding 1
%3 = OpTypeSampler
%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
%x_10 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%int = OpTypeInt 32 1
%6 = OpTypeImage %int 2D 0 0 0 2 Rgba32i
%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6
%x_20 = OpVariable %_ptr_UniformConstant_6 UniformConstant
%x_30 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%void = OpTypeVoid
%9 = OpTypeFunction %void
%float = OpTypeFloat 32
%float_1 = OpConstant %float 1
%v2float = OpTypeVector %float 2
%float_2 = OpConstant %float 2
%17 = OpConstantComposite %v2float %float_1 %float_2
%18 = OpConstantComposite %v2float %float_2 %float_1
%v3float = OpTypeVector %float 3
%float_3 = OpConstant %float 3
%21 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%v4float = OpTypeVector %float 4
%float_4 = OpConstant %float 4
%24 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
%int_2 = OpConstant %int 2
%28 = OpConstantComposite %v2int %int_1 %int_2
%v3int = OpTypeVector %int 3
%int_3 = OpConstant %int 3
%31 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%v4int = OpTypeVector %int 4
%int_4 = OpConstant %int 4
%34 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%v2uint = OpTypeVector %uint 2
%uint_2 = OpConstant %uint 2
%39 = OpConstantComposite %v2uint %uint_1 %uint_2
%v3uint = OpTypeVector %uint 3
%uint_3 = OpConstant %uint 3
%42 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%v4uint = OpTypeVector %uint 4
%uint_4 = OpConstant %uint 4
%45 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%main_1 = OpFunction %void None %9
%12 = OpLabel
%47 = OpLoad %6 %x_20
%46 = OpImageRead %v4int %47 %28
OpReturn
OpFunctionEnd
%main = OpFunction %void None %9
%49 = OpLabel
%50 = OpFunctionCall %void %main_1
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,33 @@
warning: use of deprecated intrinsic
[[group(0), binding(0)]] var x_10 : sampler;
[[group(2), binding(1)]] var x_20 : texture_storage_2d<rgba32sint, read>;
[[group(0), binding(1)]] var x_30 : sampler;
fn main_1() {
let f1 : f32 = 1.0;
let vf12 : vec2<f32> = vec2<f32>(1.0, 2.0);
let vf21 : vec2<f32> = vec2<f32>(2.0, 1.0);
let vf123 : vec3<f32> = vec3<f32>(1.0, 2.0, 3.0);
let vf1234 : vec4<f32> = vec4<f32>(1.0, 2.0, 3.0, 4.0);
let i1 : i32 = 1;
let vi12 : vec2<i32> = vec2<i32>(1, 2);
let vi123 : vec3<i32> = vec3<i32>(1, 2, 3);
let vi1234 : vec4<i32> = vec4<i32>(1, 2, 3, 4);
let u1 : u32 = 1u;
let vu12 : vec2<u32> = vec2<u32>(1u, 2u);
let vu123 : vec3<u32> = vec3<u32>(1u, 2u, 3u);
let vu1234 : vec4<u32> = vec4<u32>(1u, 2u, 3u, 4u);
let coords1 : f32 = 1.0;
let coords12 : vec2<f32> = vf12;
let coords123 : vec3<f32> = vf123;
let coords1234 : vec4<f32> = vf1234;
let x_99 : vec4<i32> = textureLoad(x_20, vi12);
return;
}
[[stage(fragment)]]
fn main() {
main_1();
}

View File

@ -0,0 +1,121 @@
; Test: ConvertResultSignedness_SpvParserHandleTest_SampledImageAccessTest_Variable_6.spvasm
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 100
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical Simple
OpEntryPoint Fragment %1 "main"
OpExecutionMode %1 OriginUpperLeft
OpName %f1 "f1"
OpName %vf12 "vf12"
OpName %vf21 "vf21"
OpName %vf123 "vf123"
OpName %vf1234 "vf1234"
OpName %u1 "u1"
OpName %vu12 "vu12"
OpName %vu123 "vu123"
OpName %vu1234 "vu1234"
OpName %i1 "i1"
OpName %vi12 "vi12"
OpName %vi123 "vi123"
OpName %vi1234 "vi1234"
OpName %coords1 "coords1"
OpName %coords12 "coords12"
OpName %coords123 "coords123"
OpName %coords1234 "coords1234"
OpName %offsets2d "offsets2d"
OpName %u_offsets2d "u_offsets2d"
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
OpDecorate %20 DescriptorSet 2
OpDecorate %20 Binding 1
OpDecorate %30 DescriptorSet 0
OpDecorate %30 Binding 1
%void = OpTypeVoid
%24 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_3 = OpConstant %uint 3
%uint_4 = OpConstant %uint 4
%uint_100 = OpConstant %uint 100
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%v4int = OpTypeVector %int 4
%v2uint = OpTypeVector %uint 2
%v3uint = OpTypeVector %uint 3
%v4uint = OpTypeVector %uint 4
%v2float = OpTypeVector %float 2
%v3float = OpTypeVector %float 3
%v4float = OpTypeVector %float 4
%49 = OpConstantNull %float
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%float_7 = OpConstant %float 7
%56 = OpConstantNull %v2float
%57 = OpConstantNull %v3float
%58 = OpConstantNull %v4float
%59 = OpConstantComposite %v2int %int_1 %int_2
%60 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%61 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%62 = OpConstantComposite %v2uint %uint_1 %uint_2
%63 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%64 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%65 = OpConstantComposite %v2float %float_1 %float_2
%66 = OpConstantComposite %v2float %float_2 %float_1
%67 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%68 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%float_0_200000003 = OpConstant %float 0.200000003
%70 = OpTypeSampler
%_ptr_UniformConstant_70 = OpTypePointer UniformConstant %70
%72 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_72 = OpTypePointer UniformConstant %72
%74 = OpTypeSampledImage %72
%10 = OpVariable %_ptr_UniformConstant_70 UniformConstant
%20 = OpVariable %_ptr_UniformConstant_72 UniformConstant
%30 = OpVariable %_ptr_UniformConstant_70 UniformConstant
%offsets2d = OpConstantComposite %v2int %int_3 %int_4
%u_offsets2d = OpConstantComposite %v2uint %uint_3 %uint_4
%1 = OpFunction %void None %24
%75 = OpLabel
%f1 = OpCopyObject %float %float_1
%vf12 = OpCopyObject %v2float %65
%vf21 = OpCopyObject %v2float %66
%vf123 = OpCopyObject %v3float %67
%vf1234 = OpCopyObject %v4float %68
%i1 = OpCopyObject %int %int_1
%vi12 = OpCopyObject %v2int %59
%vi123 = OpCopyObject %v3int %60
%vi1234 = OpCopyObject %v4int %61
%u1 = OpCopyObject %uint %uint_1
%vu12 = OpCopyObject %v2uint %62
%vu123 = OpCopyObject %v3uint %63
%vu1234 = OpCopyObject %v4uint %64
%coords1 = OpCopyObject %float %float_1
%coords12 = OpCopyObject %v2float %vf12
%coords123 = OpCopyObject %v3float %vf123
%coords1234 = OpCopyObject %v4float %vf1234
%76 = OpLoad %70 %10
%77 = OpLoad %72 %20
%78 = OpSampledImage %74 %77 %76
%99 = OpImageSampleImplicitLod %v4float %78 %vf12
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,30 @@
SamplerState x_10 : register(s0, space0);
Texture2D<float4> x_20 : register(t1, space2);
SamplerState x_30 : register(s1, space0);
void main_1() {
const float f1 = 1.0f;
const float2 vf12 = float2(1.0f, 2.0f);
const float2 vf21 = float2(2.0f, 1.0f);
const float3 vf123 = float3(1.0f, 2.0f, 3.0f);
const float4 vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
const int i1 = 1;
const int2 vi12 = int2(1, 2);
const int3 vi123 = int3(1, 2, 3);
const int4 vi1234 = int4(1, 2, 3, 4);
const uint u1 = 1u;
const uint2 vu12 = uint2(1u, 2u);
const uint3 vu123 = uint3(1u, 2u, 3u);
const uint4 vu1234 = uint4(1u, 2u, 3u, 4u);
const float coords1 = 1.0f;
const float2 coords12 = vf12;
const float3 coords123 = vf123;
const float4 coords1234 = vf1234;
const float4 x_99 = x_20.Sample(x_10, vf12);
return;
}
void main() {
main_1();
return;
}

View File

@ -0,0 +1,30 @@
#include <metal_stdlib>
using namespace metal;
void main_1(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
float const f1 = 1.0f;
float2 const vf12 = float2(1.0f, 2.0f);
float2 const vf21 = float2(2.0f, 1.0f);
float3 const vf123 = float3(1.0f, 2.0f, 3.0f);
float4 const vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
int const i1 = 1;
int2 const vi12 = int2(1, 2);
int3 const vi123 = int3(1, 2, 3);
int4 const vi1234 = int4(1, 2, 3, 4);
uint const u1 = 1u;
uint2 const vu12 = uint2(1u, 2u);
uint3 const vu123 = uint3(1u, 2u, 3u);
uint4 const vu1234 = uint4(1u, 2u, 3u, 4u);
float const coords1 = 1.0f;
float2 const coords12 = vf12;
float3 const coords123 = vf123;
float4 const coords1234 = vf1234;
float4 const x_99 = tint_symbol_1.sample(tint_symbol_2, vf12);
return;
}
fragment void tint_symbol(texture2d<float, access::sample> tint_symbol_3 [[texture(1)]], sampler tint_symbol_4 [[sampler(0)]]) {
main_1(tint_symbol_3, tint_symbol_4);
return;
}

View File

@ -0,0 +1,77 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 54
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %x_10 "x_10"
OpName %x_20 "x_20"
OpName %x_30 "x_30"
OpName %main_1 "main_1"
OpName %main "main"
OpDecorate %x_10 DescriptorSet 0
OpDecorate %x_10 Binding 0
OpDecorate %x_20 DescriptorSet 2
OpDecorate %x_20 Binding 1
OpDecorate %x_30 DescriptorSet 0
OpDecorate %x_30 Binding 1
%3 = OpTypeSampler
%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
%x_10 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%float = OpTypeFloat 32
%6 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6
%x_20 = OpVariable %_ptr_UniformConstant_6 UniformConstant
%x_30 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%void = OpTypeVoid
%9 = OpTypeFunction %void
%float_1 = OpConstant %float 1
%v2float = OpTypeVector %float 2
%float_2 = OpConstant %float 2
%16 = OpConstantComposite %v2float %float_1 %float_2
%17 = OpConstantComposite %v2float %float_2 %float_1
%v3float = OpTypeVector %float 3
%float_3 = OpConstant %float 3
%20 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%v4float = OpTypeVector %float 4
%float_4 = OpConstant %float 4
%23 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
%int_2 = OpConstant %int 2
%28 = OpConstantComposite %v2int %int_1 %int_2
%v3int = OpTypeVector %int 3
%int_3 = OpConstant %int 3
%31 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%v4int = OpTypeVector %int 4
%int_4 = OpConstant %int 4
%34 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%v2uint = OpTypeVector %uint 2
%uint_2 = OpConstant %uint 2
%39 = OpConstantComposite %v2uint %uint_1 %uint_2
%v3uint = OpTypeVector %uint 3
%uint_3 = OpConstant %uint 3
%42 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%v4uint = OpTypeVector %uint 4
%uint_4 = OpConstant %uint 4
%45 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%49 = OpTypeSampledImage %6
%main_1 = OpFunction %void None %9
%12 = OpLabel
%47 = OpLoad %3 %x_10
%48 = OpLoad %6 %x_20
%50 = OpSampledImage %49 %48 %47
%46 = OpImageSampleImplicitLod %v4float %50 %16
OpReturn
OpFunctionEnd
%main = OpFunction %void None %9
%52 = OpLabel
%53 = OpFunctionCall %void %main_1
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,32 @@
[[group(0), binding(0)]] var x_10 : sampler;
[[group(2), binding(1)]] var x_20 : texture_2d<f32>;
[[group(0), binding(1)]] var x_30 : sampler;
fn main_1() {
let f1 : f32 = 1.0;
let vf12 : vec2<f32> = vec2<f32>(1.0, 2.0);
let vf21 : vec2<f32> = vec2<f32>(2.0, 1.0);
let vf123 : vec3<f32> = vec3<f32>(1.0, 2.0, 3.0);
let vf1234 : vec4<f32> = vec4<f32>(1.0, 2.0, 3.0, 4.0);
let i1 : i32 = 1;
let vi12 : vec2<i32> = vec2<i32>(1, 2);
let vi123 : vec3<i32> = vec3<i32>(1, 2, 3);
let vi1234 : vec4<i32> = vec4<i32>(1, 2, 3, 4);
let u1 : u32 = 1u;
let vu12 : vec2<u32> = vec2<u32>(1u, 2u);
let vu123 : vec3<u32> = vec3<u32>(1u, 2u, 3u);
let vu1234 : vec4<u32> = vec4<u32>(1u, 2u, 3u, 4u);
let coords1 : f32 = 1.0;
let coords12 : vec2<f32> = vf12;
let coords123 : vec3<f32> = vf123;
let coords1234 : vec4<f32> = vf1234;
let x_99 : vec4<f32> = textureSample(x_20, x_10, vf12);
return;
}
[[stage(fragment)]]
fn main() {
main_1();
}

View File

@ -0,0 +1,112 @@
; Test: ConvertUintCoords_NonArrayed_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_0.spvasm
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 1001
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical Simple
OpEntryPoint Fragment %100 "main"
OpExecutionMode %100 OriginUpperLeft
OpName %float_var "float_var"
OpName %ptr_float "ptr_float"
OpName %i1 "i1"
OpName %vi12 "vi12"
OpName %vi123 "vi123"
OpName %vi1234 "vi1234"
OpName %u1 "u1"
OpName %vu12 "vu12"
OpName %vu123 "vu123"
OpName %vu1234 "vu1234"
OpName %f1 "f1"
OpName %vf12 "vf12"
OpName %vf123 "vf123"
OpName %vf1234 "vf1234"
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
OpDecorate %20 DescriptorSet 2
OpDecorate %20 Binding 1
OpDecorate %30 DescriptorSet 0
OpDecorate %30 Binding 1
%void = OpTypeVoid
%17 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_3 = OpConstant %uint 3
%uint_4 = OpConstant %uint 4
%uint_100 = OpConstant %uint 100
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%v4int = OpTypeVector %int 4
%v2uint = OpTypeVector %uint 2
%v3uint = OpTypeVector %uint 3
%v4uint = OpTypeVector %uint 4
%v2float = OpTypeVector %float 2
%v3float = OpTypeVector %float 3
%v4float = OpTypeVector %float 4
%43 = OpConstantNull %float
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%float_7 = OpConstant %float 7
%50 = OpConstantNull %v2float
%51 = OpConstantNull %v3float
%52 = OpConstantNull %v4float
%53 = OpConstantComposite %v2int %int_1 %int_2
%54 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%55 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%56 = OpConstantComposite %v2uint %uint_1 %uint_2
%57 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%58 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%59 = OpConstantComposite %v2float %float_1 %float_2
%60 = OpConstantComposite %v2float %float_2 %float_1
%61 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%62 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%float_0_200000003 = OpConstant %float 0.200000003
%64 = OpTypeSampler
%_ptr_UniformConstant_64 = OpTypePointer UniformConstant %64
%66 = OpTypeImage %float 1D 0 0 0 1 Unknown
%_ptr_UniformConstant_66 = OpTypePointer UniformConstant %66
%68 = OpTypeSampledImage %66
%ptr_float = OpTypePointer Function %float
%10 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%20 = OpVariable %_ptr_UniformConstant_66 UniformConstant
%30 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%100 = OpFunction %void None %17
%69 = OpLabel
%float_var = OpVariable %ptr_float Function
%i1 = OpCopyObject %int %int_1
%vi12 = OpCopyObject %v2int %53
%vi123 = OpCopyObject %v3int %54
%vi1234 = OpCopyObject %v4int %55
%u1 = OpCopyObject %uint %uint_1
%vu12 = OpCopyObject %v2uint %56
%vu123 = OpCopyObject %v3uint %57
%vu1234 = OpCopyObject %v4uint %58
%f1 = OpCopyObject %float %float_1
%vf12 = OpCopyObject %v2float %59
%vf123 = OpCopyObject %v3float %61
%vf1234 = OpCopyObject %v4float %62
%70 = OpLoad %64 %10
%71 = OpLoad %66 %20
%72 = OpSampledImage %68 %71 %70
%73 = OpImageFetch %v4float %71 %u1
%1000 = OpCopyObject %uint %uint_0
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,27 @@
SamplerState x_10 : register(s0, space0);
Texture1D<float4> x_20 : register(t1, space2);
SamplerState x_30 : register(s1, space0);
void main_1() {
float float_var = 0.0f;
const int i1 = 1;
const int2 vi12 = int2(1, 2);
const int3 vi123 = int3(1, 2, 3);
const int4 vi1234 = int4(1, 2, 3, 4);
const uint u1 = 1u;
const uint2 vu12 = uint2(1u, 2u);
const uint3 vu123 = uint3(1u, 2u, 3u);
const uint4 vu1234 = uint4(1u, 2u, 3u, 4u);
const float f1 = 1.0f;
const float2 vf12 = float2(1.0f, 2.0f);
const float3 vf123 = float3(1.0f, 2.0f, 3.0f);
const float4 vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
const float4 x_73 = x_20.Load(int2(int(u1), 0));
const uint x_1000 = 0u;
return;
}
void main() {
main_1();
return;
}

View File

@ -0,0 +1,27 @@
#include <metal_stdlib>
using namespace metal;
void main_1(texture1d<float, access::sample> tint_symbol_1) {
float float_var = 0.0f;
int const i1 = 1;
int2 const vi12 = int2(1, 2);
int3 const vi123 = int3(1, 2, 3);
int4 const vi1234 = int4(1, 2, 3, 4);
uint const u1 = 1u;
uint2 const vu12 = uint2(1u, 2u);
uint3 const vu123 = uint3(1u, 2u, 3u);
uint4 const vu1234 = uint4(1u, 2u, 3u, 4u);
float const f1 = 1.0f;
float2 const vf12 = float2(1.0f, 2.0f);
float3 const vf123 = float3(1.0f, 2.0f, 3.0f);
float4 const vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
float4 const x_73 = tint_symbol_1.read(uint(int(u1)), 0);
uint const x_1000 = 0u;
return;
}
fragment void tint_symbol(texture1d<float, access::sample> tint_symbol_2 [[texture(1)]]) {
main_1(tint_symbol_2);
return;
}

View File

@ -0,0 +1,81 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 56
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %x_10 "x_10"
OpName %x_20 "x_20"
OpName %x_30 "x_30"
OpName %main_1 "main_1"
OpName %float_var "float_var"
OpName %main "main"
OpDecorate %x_10 DescriptorSet 0
OpDecorate %x_10 Binding 0
OpDecorate %x_20 DescriptorSet 2
OpDecorate %x_20 Binding 1
OpDecorate %x_30 DescriptorSet 0
OpDecorate %x_30 Binding 1
%3 = OpTypeSampler
%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
%x_10 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%float = OpTypeFloat 32
%6 = OpTypeImage %float 1D 0 0 0 1 Unknown
%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6
%x_20 = OpVariable %_ptr_UniformConstant_6 UniformConstant
%x_30 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%void = OpTypeVoid
%9 = OpTypeFunction %void
%_ptr_Function_float = OpTypePointer Function %float
%15 = OpConstantNull %float
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
%int_2 = OpConstant %int 2
%20 = OpConstantComposite %v2int %int_1 %int_2
%v3int = OpTypeVector %int 3
%int_3 = OpConstant %int 3
%23 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%v4int = OpTypeVector %int 4
%int_4 = OpConstant %int 4
%26 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%v2uint = OpTypeVector %uint 2
%uint_2 = OpConstant %uint 2
%31 = OpConstantComposite %v2uint %uint_1 %uint_2
%v3uint = OpTypeVector %uint 3
%uint_3 = OpConstant %uint 3
%34 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%v4uint = OpTypeVector %uint 4
%uint_4 = OpConstant %uint 4
%37 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%float_1 = OpConstant %float 1
%v2float = OpTypeVector %float 2
%float_2 = OpConstant %float 2
%41 = OpConstantComposite %v2float %float_1 %float_2
%v3float = OpTypeVector %float 3
%float_3 = OpConstant %float 3
%44 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%v4float = OpTypeVector %float 4
%float_4 = OpConstant %float 4
%47 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%int_0 = OpConstant %int 0
%uint_0 = OpConstant %uint 0
%main_1 = OpFunction %void None %9
%12 = OpLabel
%float_var = OpVariable %_ptr_Function_float Function %15
%49 = OpLoad %6 %x_20
%50 = OpBitcast %int %uint_1
%48 = OpImageFetch %v4float %49 %50 Lod %int_0
OpReturn
OpFunctionEnd
%main = OpFunction %void None %9
%54 = OpLabel
%55 = OpFunctionCall %void %main_1
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,29 @@
[[group(0), binding(0)]] var x_10 : sampler;
[[group(2), binding(1)]] var x_20 : texture_1d<f32>;
[[group(0), binding(1)]] var x_30 : sampler;
fn main_1() {
var float_var : f32;
let i1 : i32 = 1;
let vi12 : vec2<i32> = vec2<i32>(1, 2);
let vi123 : vec3<i32> = vec3<i32>(1, 2, 3);
let vi1234 : vec4<i32> = vec4<i32>(1, 2, 3, 4);
let u1 : u32 = 1u;
let vu12 : vec2<u32> = vec2<u32>(1u, 2u);
let vu123 : vec3<u32> = vec3<u32>(1u, 2u, 3u);
let vu1234 : vec4<u32> = vec4<u32>(1u, 2u, 3u, 4u);
let f1 : f32 = 1.0;
let vf12 : vec2<f32> = vec2<f32>(1.0, 2.0);
let vf123 : vec3<f32> = vec3<f32>(1.0, 2.0, 3.0);
let vf1234 : vec4<f32> = vec4<f32>(1.0, 2.0, 3.0, 4.0);
let x_73 : vec4<f32> = textureLoad(x_20, i32(u1), 0);
let x_1000 : u32 = 0u;
return;
}
[[stage(fragment)]]
fn main() {
main_1();
}

View File

@ -0,0 +1,110 @@
; Test: ConvertUintCoords_NonArrayed_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_1.spvasm
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 1001
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical Simple
OpEntryPoint Fragment %100 "main"
OpExecutionMode %100 OriginUpperLeft
OpName %float_var "float_var"
OpName %ptr_float "ptr_float"
OpName %i1 "i1"
OpName %vi12 "vi12"
OpName %vi123 "vi123"
OpName %vi1234 "vi1234"
OpName %u1 "u1"
OpName %vu12 "vu12"
OpName %vu123 "vu123"
OpName %vu1234 "vu1234"
OpName %f1 "f1"
OpName %vf12 "vf12"
OpName %vf123 "vf123"
OpName %vf1234 "vf1234"
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
OpDecorate %20 DescriptorSet 2
OpDecorate %20 Binding 1
OpDecorate %30 DescriptorSet 0
OpDecorate %30 Binding 1
%void = OpTypeVoid
%17 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_3 = OpConstant %uint 3
%uint_4 = OpConstant %uint 4
%uint_100 = OpConstant %uint 100
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%v4int = OpTypeVector %int 4
%v2uint = OpTypeVector %uint 2
%v3uint = OpTypeVector %uint 3
%v4uint = OpTypeVector %uint 4
%v2float = OpTypeVector %float 2
%v3float = OpTypeVector %float 3
%v4float = OpTypeVector %float 4
%43 = OpConstantNull %float
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%float_7 = OpConstant %float 7
%50 = OpConstantNull %v2float
%51 = OpConstantNull %v3float
%52 = OpConstantNull %v4float
%53 = OpConstantComposite %v2int %int_1 %int_2
%54 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%55 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%56 = OpConstantComposite %v2uint %uint_1 %uint_2
%57 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%58 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%59 = OpConstantComposite %v2float %float_1 %float_2
%60 = OpConstantComposite %v2float %float_2 %float_1
%61 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%62 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%float_0_200000003 = OpConstant %float 0.200000003
%64 = OpTypeSampler
%_ptr_UniformConstant_64 = OpTypePointer UniformConstant %64
%66 = OpTypeImage %float 1D 0 0 0 2 R32f
%_ptr_UniformConstant_66 = OpTypePointer UniformConstant %66
%ptr_float = OpTypePointer Function %float
%10 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%20 = OpVariable %_ptr_UniformConstant_66 UniformConstant
%30 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%100 = OpFunction %void None %17
%68 = OpLabel
%float_var = OpVariable %ptr_float Function
%i1 = OpCopyObject %int %int_1
%vi12 = OpCopyObject %v2int %53
%vi123 = OpCopyObject %v3int %54
%vi1234 = OpCopyObject %v4int %55
%u1 = OpCopyObject %uint %uint_1
%vu12 = OpCopyObject %v2uint %56
%vu123 = OpCopyObject %v3uint %57
%vu1234 = OpCopyObject %v4uint %58
%f1 = OpCopyObject %float %float_1
%vf12 = OpCopyObject %v2float %59
%vf123 = OpCopyObject %v3float %61
%vf1234 = OpCopyObject %v4float %62
%69 = OpLoad %64 %10
%70 = OpLoad %66 %20
%71 = OpImageRead %v4float %70 %u1
%1000 = OpCopyObject %uint %uint_0
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,28 @@
warning: use of deprecated intrinsic
SamplerState x_10 : register(s0, space0);
Texture1D<float4> x_20 : register(t1, space2);
SamplerState x_30 : register(s1, space0);
void main_1() {
float float_var = 0.0f;
const int i1 = 1;
const int2 vi12 = int2(1, 2);
const int3 vi123 = int3(1, 2, 3);
const int4 vi1234 = int4(1, 2, 3, 4);
const uint u1 = 1u;
const uint2 vu12 = uint2(1u, 2u);
const uint3 vu123 = uint3(1u, 2u, 3u);
const uint4 vu1234 = uint4(1u, 2u, 3u, 4u);
const float f1 = 1.0f;
const float2 vf12 = float2(1.0f, 2.0f);
const float3 vf123 = float3(1.0f, 2.0f, 3.0f);
const float4 vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
const float4 x_71 = x_20.Load(int2(int(u1), 0));
const uint x_1000 = 0u;
return;
}
void main() {
main_1();
return;
}

View File

@ -0,0 +1,28 @@
warning: use of deprecated intrinsic
#include <metal_stdlib>
using namespace metal;
void main_1(texture1d<float, access::read> tint_symbol_1) {
float float_var = 0.0f;
int const i1 = 1;
int2 const vi12 = int2(1, 2);
int3 const vi123 = int3(1, 2, 3);
int4 const vi1234 = int4(1, 2, 3, 4);
uint const u1 = 1u;
uint2 const vu12 = uint2(1u, 2u);
uint3 const vu123 = uint3(1u, 2u, 3u);
uint4 const vu1234 = uint4(1u, 2u, 3u, 4u);
float const f1 = 1.0f;
float2 const vf12 = float2(1.0f, 2.0f);
float3 const vf123 = float3(1.0f, 2.0f, 3.0f);
float4 const vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
float4 const x_71 = tint_symbol_1.read(uint(int(u1)));
uint const x_1000 = 0u;
return;
}
fragment void tint_symbol(texture1d<float, access::read> tint_symbol_2 [[texture(1)]]) {
main_1(tint_symbol_2);
return;
}

View File

@ -0,0 +1,82 @@
warning: use of deprecated intrinsic
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 55
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %x_10 "x_10"
OpName %x_20 "x_20"
OpName %x_30 "x_30"
OpName %main_1 "main_1"
OpName %float_var "float_var"
OpName %main "main"
OpDecorate %x_10 DescriptorSet 0
OpDecorate %x_10 Binding 0
OpDecorate %x_20 NonWritable
OpDecorate %x_20 DescriptorSet 2
OpDecorate %x_20 Binding 1
OpDecorate %x_30 DescriptorSet 0
OpDecorate %x_30 Binding 1
%3 = OpTypeSampler
%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
%x_10 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%float = OpTypeFloat 32
%6 = OpTypeImage %float 1D 0 0 0 2 R32f
%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6
%x_20 = OpVariable %_ptr_UniformConstant_6 UniformConstant
%x_30 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%void = OpTypeVoid
%9 = OpTypeFunction %void
%_ptr_Function_float = OpTypePointer Function %float
%15 = OpConstantNull %float
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
%int_2 = OpConstant %int 2
%20 = OpConstantComposite %v2int %int_1 %int_2
%v3int = OpTypeVector %int 3
%int_3 = OpConstant %int 3
%23 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%v4int = OpTypeVector %int 4
%int_4 = OpConstant %int 4
%26 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%v2uint = OpTypeVector %uint 2
%uint_2 = OpConstant %uint 2
%31 = OpConstantComposite %v2uint %uint_1 %uint_2
%v3uint = OpTypeVector %uint 3
%uint_3 = OpConstant %uint 3
%34 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%v4uint = OpTypeVector %uint 4
%uint_4 = OpConstant %uint 4
%37 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%float_1 = OpConstant %float 1
%v2float = OpTypeVector %float 2
%float_2 = OpConstant %float 2
%41 = OpConstantComposite %v2float %float_1 %float_2
%v3float = OpTypeVector %float 3
%float_3 = OpConstant %float 3
%44 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%v4float = OpTypeVector %float 4
%float_4 = OpConstant %float 4
%47 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%uint_0 = OpConstant %uint 0
%main_1 = OpFunction %void None %9
%12 = OpLabel
%float_var = OpVariable %_ptr_Function_float Function %15
%49 = OpLoad %6 %x_20
%50 = OpBitcast %int %uint_1
%48 = OpImageRead %v4float %49 %50
OpReturn
OpFunctionEnd
%main = OpFunction %void None %9
%53 = OpLabel
%54 = OpFunctionCall %void %main_1
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,30 @@
warning: use of deprecated intrinsic
[[group(0), binding(0)]] var x_10 : sampler;
[[group(2), binding(1)]] var x_20 : texture_storage_1d<r32float, read>;
[[group(0), binding(1)]] var x_30 : sampler;
fn main_1() {
var float_var : f32;
let i1 : i32 = 1;
let vi12 : vec2<i32> = vec2<i32>(1, 2);
let vi123 : vec3<i32> = vec3<i32>(1, 2, 3);
let vi1234 : vec4<i32> = vec4<i32>(1, 2, 3, 4);
let u1 : u32 = 1u;
let vu12 : vec2<u32> = vec2<u32>(1u, 2u);
let vu123 : vec3<u32> = vec3<u32>(1u, 2u, 3u);
let vu1234 : vec4<u32> = vec4<u32>(1u, 2u, 3u, 4u);
let f1 : f32 = 1.0;
let vf12 : vec2<f32> = vec2<f32>(1.0, 2.0);
let vf123 : vec3<f32> = vec3<f32>(1.0, 2.0, 3.0);
let vf1234 : vec4<f32> = vec4<f32>(1.0, 2.0, 3.0, 4.0);
let x_71 : vec4<f32> = textureLoad(x_20, i32(u1));
let x_1000 : u32 = 0u;
return;
}
[[stage(fragment)]]
fn main() {
main_1();
}

View File

@ -0,0 +1,110 @@
; Test: ConvertUintCoords_NonArrayed_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_2.spvasm
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 1001
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical Simple
OpEntryPoint Fragment %100 "main"
OpExecutionMode %100 OriginUpperLeft
OpName %float_var "float_var"
OpName %ptr_float "ptr_float"
OpName %i1 "i1"
OpName %vi12 "vi12"
OpName %vi123 "vi123"
OpName %vi1234 "vi1234"
OpName %u1 "u1"
OpName %vu12 "vu12"
OpName %vu123 "vu123"
OpName %vu1234 "vu1234"
OpName %f1 "f1"
OpName %vf12 "vf12"
OpName %vf123 "vf123"
OpName %vf1234 "vf1234"
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
OpDecorate %20 DescriptorSet 2
OpDecorate %20 Binding 1
OpDecorate %30 DescriptorSet 0
OpDecorate %30 Binding 1
%void = OpTypeVoid
%17 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_3 = OpConstant %uint 3
%uint_4 = OpConstant %uint 4
%uint_100 = OpConstant %uint 100
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%v4int = OpTypeVector %int 4
%v2uint = OpTypeVector %uint 2
%v3uint = OpTypeVector %uint 3
%v4uint = OpTypeVector %uint 4
%v2float = OpTypeVector %float 2
%v3float = OpTypeVector %float 3
%v4float = OpTypeVector %float 4
%43 = OpConstantNull %float
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%float_7 = OpConstant %float 7
%50 = OpConstantNull %v2float
%51 = OpConstantNull %v3float
%52 = OpConstantNull %v4float
%53 = OpConstantComposite %v2int %int_1 %int_2
%54 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%55 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%56 = OpConstantComposite %v2uint %uint_1 %uint_2
%57 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%58 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%59 = OpConstantComposite %v2float %float_1 %float_2
%60 = OpConstantComposite %v2float %float_2 %float_1
%61 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%62 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%float_0_200000003 = OpConstant %float 0.200000003
%64 = OpTypeSampler
%_ptr_UniformConstant_64 = OpTypePointer UniformConstant %64
%66 = OpTypeImage %float 1D 0 0 0 2 R32f
%_ptr_UniformConstant_66 = OpTypePointer UniformConstant %66
%ptr_float = OpTypePointer Function %float
%10 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%20 = OpVariable %_ptr_UniformConstant_66 UniformConstant
%30 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%100 = OpFunction %void None %17
%68 = OpLabel
%float_var = OpVariable %ptr_float Function
%i1 = OpCopyObject %int %int_1
%vi12 = OpCopyObject %v2int %53
%vi123 = OpCopyObject %v3int %54
%vi1234 = OpCopyObject %v4int %55
%u1 = OpCopyObject %uint %uint_1
%vu12 = OpCopyObject %v2uint %56
%vu123 = OpCopyObject %v3uint %57
%vu1234 = OpCopyObject %v4uint %58
%f1 = OpCopyObject %float %float_1
%vf12 = OpCopyObject %v2float %59
%vf123 = OpCopyObject %v3float %61
%vf1234 = OpCopyObject %v4float %62
%69 = OpLoad %64 %10
%70 = OpLoad %66 %20
OpImageWrite %70 %u1 %vf1234
%1000 = OpCopyObject %uint %uint_0
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,27 @@
SamplerState x_10 : register(s0, space0);
RWTexture1D<float4> x_20 : register(u1, space2);
SamplerState x_30 : register(s1, space0);
void main_1() {
float float_var = 0.0f;
const int i1 = 1;
const int2 vi12 = int2(1, 2);
const int3 vi123 = int3(1, 2, 3);
const int4 vi1234 = int4(1, 2, 3, 4);
const uint u1 = 1u;
const uint2 vu12 = uint2(1u, 2u);
const uint3 vu123 = uint3(1u, 2u, 3u);
const uint4 vu1234 = uint4(1u, 2u, 3u, 4u);
const float f1 = 1.0f;
const float2 vf12 = float2(1.0f, 2.0f);
const float3 vf123 = float3(1.0f, 2.0f, 3.0f);
const float4 vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
x_20[int(u1)] = vf1234;
const uint x_1000 = 0u;
return;
}
void main() {
main_1();
return;
}

View File

@ -0,0 +1,27 @@
#include <metal_stdlib>
using namespace metal;
void main_1(texture1d<float, access::write> tint_symbol_1) {
float float_var = 0.0f;
int const i1 = 1;
int2 const vi12 = int2(1, 2);
int3 const vi123 = int3(1, 2, 3);
int4 const vi1234 = int4(1, 2, 3, 4);
uint const u1 = 1u;
uint2 const vu12 = uint2(1u, 2u);
uint3 const vu123 = uint3(1u, 2u, 3u);
uint4 const vu1234 = uint4(1u, 2u, 3u, 4u);
float const f1 = 1.0f;
float2 const vf12 = float2(1.0f, 2.0f);
float3 const vf123 = float3(1.0f, 2.0f, 3.0f);
float4 const vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
tint_symbol_1.write(vf1234, uint(int(u1)));
uint const x_1000 = 0u;
return;
}
fragment void tint_symbol(texture1d<float, access::write> tint_symbol_2 [[texture(1)]]) {
main_1(tint_symbol_2);
return;
}

View File

@ -0,0 +1,81 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 55
; Schema: 0
OpCapability Shader
OpCapability Image1D
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %x_10 "x_10"
OpName %x_20 "x_20"
OpName %x_30 "x_30"
OpName %main_1 "main_1"
OpName %float_var "float_var"
OpName %main "main"
OpDecorate %x_10 DescriptorSet 0
OpDecorate %x_10 Binding 0
OpDecorate %x_20 NonReadable
OpDecorate %x_20 DescriptorSet 2
OpDecorate %x_20 Binding 1
OpDecorate %x_30 DescriptorSet 0
OpDecorate %x_30 Binding 1
%3 = OpTypeSampler
%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
%x_10 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%float = OpTypeFloat 32
%6 = OpTypeImage %float 1D 0 0 0 2 R32f
%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6
%x_20 = OpVariable %_ptr_UniformConstant_6 UniformConstant
%x_30 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%void = OpTypeVoid
%9 = OpTypeFunction %void
%_ptr_Function_float = OpTypePointer Function %float
%15 = OpConstantNull %float
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
%int_2 = OpConstant %int 2
%20 = OpConstantComposite %v2int %int_1 %int_2
%v3int = OpTypeVector %int 3
%int_3 = OpConstant %int 3
%23 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%v4int = OpTypeVector %int 4
%int_4 = OpConstant %int 4
%26 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%v2uint = OpTypeVector %uint 2
%uint_2 = OpConstant %uint 2
%31 = OpConstantComposite %v2uint %uint_1 %uint_2
%v3uint = OpTypeVector %uint 3
%uint_3 = OpConstant %uint 3
%34 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%v4uint = OpTypeVector %uint 4
%uint_4 = OpConstant %uint 4
%37 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%float_1 = OpConstant %float 1
%v2float = OpTypeVector %float 2
%float_2 = OpConstant %float 2
%41 = OpConstantComposite %v2float %float_1 %float_2
%v3float = OpTypeVector %float 3
%float_3 = OpConstant %float 3
%44 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%v4float = OpTypeVector %float 4
%float_4 = OpConstant %float 4
%47 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%uint_0 = OpConstant %uint 0
%main_1 = OpFunction %void None %9
%12 = OpLabel
%float_var = OpVariable %_ptr_Function_float Function %15
%49 = OpLoad %6 %x_20
%50 = OpBitcast %int %uint_1
OpImageWrite %49 %50 %47
OpReturn
OpFunctionEnd
%main = OpFunction %void None %9
%53 = OpLabel
%54 = OpFunctionCall %void %main_1
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,29 @@
[[group(0), binding(0)]] var x_10 : sampler;
[[group(2), binding(1)]] var x_20 : texture_storage_1d<r32float, write>;
[[group(0), binding(1)]] var x_30 : sampler;
fn main_1() {
var float_var : f32;
let i1 : i32 = 1;
let vi12 : vec2<i32> = vec2<i32>(1, 2);
let vi123 : vec3<i32> = vec3<i32>(1, 2, 3);
let vi1234 : vec4<i32> = vec4<i32>(1, 2, 3, 4);
let u1 : u32 = 1u;
let vu12 : vec2<u32> = vec2<u32>(1u, 2u);
let vu123 : vec3<u32> = vec3<u32>(1u, 2u, 3u);
let vu1234 : vec4<u32> = vec4<u32>(1u, 2u, 3u, 4u);
let f1 : f32 = 1.0;
let vf12 : vec2<f32> = vec2<f32>(1.0, 2.0);
let vf123 : vec3<f32> = vec3<f32>(1.0, 2.0, 3.0);
let vf1234 : vec4<f32> = vec4<f32>(1.0, 2.0, 3.0, 4.0);
textureStore(x_20, i32(u1), vf1234);
let x_1000 : u32 = 0u;
return;
}
[[stage(fragment)]]
fn main() {
main_1();
}

View File

@ -0,0 +1,112 @@
; Test: ConvertUintCoords_NonArrayed_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_3.spvasm
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 1001
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical Simple
OpEntryPoint Fragment %100 "main"
OpExecutionMode %100 OriginUpperLeft
OpName %float_var "float_var"
OpName %ptr_float "ptr_float"
OpName %i1 "i1"
OpName %vi12 "vi12"
OpName %vi123 "vi123"
OpName %vi1234 "vi1234"
OpName %u1 "u1"
OpName %vu12 "vu12"
OpName %vu123 "vu123"
OpName %vu1234 "vu1234"
OpName %f1 "f1"
OpName %vf12 "vf12"
OpName %vf123 "vf123"
OpName %vf1234 "vf1234"
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
OpDecorate %20 DescriptorSet 2
OpDecorate %20 Binding 1
OpDecorate %30 DescriptorSet 0
OpDecorate %30 Binding 1
%void = OpTypeVoid
%17 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_3 = OpConstant %uint 3
%uint_4 = OpConstant %uint 4
%uint_100 = OpConstant %uint 100
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%v4int = OpTypeVector %int 4
%v2uint = OpTypeVector %uint 2
%v3uint = OpTypeVector %uint 3
%v4uint = OpTypeVector %uint 4
%v2float = OpTypeVector %float 2
%v3float = OpTypeVector %float 3
%v4float = OpTypeVector %float 4
%43 = OpConstantNull %float
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%float_7 = OpConstant %float 7
%50 = OpConstantNull %v2float
%51 = OpConstantNull %v3float
%52 = OpConstantNull %v4float
%53 = OpConstantComposite %v2int %int_1 %int_2
%54 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%55 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%56 = OpConstantComposite %v2uint %uint_1 %uint_2
%57 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%58 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%59 = OpConstantComposite %v2float %float_1 %float_2
%60 = OpConstantComposite %v2float %float_2 %float_1
%61 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%62 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%float_0_200000003 = OpConstant %float 0.200000003
%64 = OpTypeSampler
%_ptr_UniformConstant_64 = OpTypePointer UniformConstant %64
%66 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_66 = OpTypePointer UniformConstant %66
%68 = OpTypeSampledImage %66
%ptr_float = OpTypePointer Function %float
%10 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%20 = OpVariable %_ptr_UniformConstant_66 UniformConstant
%30 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%100 = OpFunction %void None %17
%69 = OpLabel
%float_var = OpVariable %ptr_float Function
%i1 = OpCopyObject %int %int_1
%vi12 = OpCopyObject %v2int %53
%vi123 = OpCopyObject %v3int %54
%vi1234 = OpCopyObject %v4int %55
%u1 = OpCopyObject %uint %uint_1
%vu12 = OpCopyObject %v2uint %56
%vu123 = OpCopyObject %v3uint %57
%vu1234 = OpCopyObject %v4uint %58
%f1 = OpCopyObject %float %float_1
%vf12 = OpCopyObject %v2float %59
%vf123 = OpCopyObject %v3float %61
%vf1234 = OpCopyObject %v4float %62
%70 = OpLoad %64 %10
%71 = OpLoad %66 %20
%72 = OpSampledImage %68 %71 %70
%73 = OpImageFetch %v4float %71 %vu12
%1000 = OpCopyObject %uint %uint_0
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,27 @@
#include <metal_stdlib>
using namespace metal;
void main_1(texture2d<float, access::sample> tint_symbol_1) {
float float_var = 0.0f;
int const i1 = 1;
int2 const vi12 = int2(1, 2);
int3 const vi123 = int3(1, 2, 3);
int4 const vi1234 = int4(1, 2, 3, 4);
uint const u1 = 1u;
uint2 const vu12 = uint2(1u, 2u);
uint3 const vu123 = uint3(1u, 2u, 3u);
uint4 const vu1234 = uint4(1u, 2u, 3u, 4u);
float const f1 = 1.0f;
float2 const vf12 = float2(1.0f, 2.0f);
float3 const vf123 = float3(1.0f, 2.0f, 3.0f);
float4 const vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
float4 const x_73 = tint_symbol_1.read(uint2(int2(vu12)), 0);
uint const x_1000 = 0u;
return;
}
fragment void tint_symbol(texture2d<float, access::sample> tint_symbol_2 [[texture(1)]]) {
main_1(tint_symbol_2);
return;
}

View File

@ -0,0 +1,80 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 56
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %x_10 "x_10"
OpName %x_20 "x_20"
OpName %x_30 "x_30"
OpName %main_1 "main_1"
OpName %float_var "float_var"
OpName %main "main"
OpDecorate %x_10 DescriptorSet 0
OpDecorate %x_10 Binding 0
OpDecorate %x_20 DescriptorSet 2
OpDecorate %x_20 Binding 1
OpDecorate %x_30 DescriptorSet 0
OpDecorate %x_30 Binding 1
%3 = OpTypeSampler
%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
%x_10 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%float = OpTypeFloat 32
%6 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6
%x_20 = OpVariable %_ptr_UniformConstant_6 UniformConstant
%x_30 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%void = OpTypeVoid
%9 = OpTypeFunction %void
%_ptr_Function_float = OpTypePointer Function %float
%15 = OpConstantNull %float
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
%int_2 = OpConstant %int 2
%20 = OpConstantComposite %v2int %int_1 %int_2
%v3int = OpTypeVector %int 3
%int_3 = OpConstant %int 3
%23 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%v4int = OpTypeVector %int 4
%int_4 = OpConstant %int 4
%26 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%v2uint = OpTypeVector %uint 2
%uint_2 = OpConstant %uint 2
%31 = OpConstantComposite %v2uint %uint_1 %uint_2
%v3uint = OpTypeVector %uint 3
%uint_3 = OpConstant %uint 3
%34 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%v4uint = OpTypeVector %uint 4
%uint_4 = OpConstant %uint 4
%37 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%float_1 = OpConstant %float 1
%v2float = OpTypeVector %float 2
%float_2 = OpConstant %float 2
%41 = OpConstantComposite %v2float %float_1 %float_2
%v3float = OpTypeVector %float 3
%float_3 = OpConstant %float 3
%44 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%v4float = OpTypeVector %float 4
%float_4 = OpConstant %float 4
%47 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%int_0 = OpConstant %int 0
%uint_0 = OpConstant %uint 0
%main_1 = OpFunction %void None %9
%12 = OpLabel
%float_var = OpVariable %_ptr_Function_float Function %15
%49 = OpLoad %6 %x_20
%50 = OpBitcast %v2int %31
%48 = OpImageFetch %v4float %49 %50 Lod %int_0
OpReturn
OpFunctionEnd
%main = OpFunction %void None %9
%54 = OpLabel
%55 = OpFunctionCall %void %main_1
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,29 @@
[[group(0), binding(0)]] var x_10 : sampler;
[[group(2), binding(1)]] var x_20 : texture_2d<f32>;
[[group(0), binding(1)]] var x_30 : sampler;
fn main_1() {
var float_var : f32;
let i1 : i32 = 1;
let vi12 : vec2<i32> = vec2<i32>(1, 2);
let vi123 : vec3<i32> = vec3<i32>(1, 2, 3);
let vi1234 : vec4<i32> = vec4<i32>(1, 2, 3, 4);
let u1 : u32 = 1u;
let vu12 : vec2<u32> = vec2<u32>(1u, 2u);
let vu123 : vec3<u32> = vec3<u32>(1u, 2u, 3u);
let vu1234 : vec4<u32> = vec4<u32>(1u, 2u, 3u, 4u);
let f1 : f32 = 1.0;
let vf12 : vec2<f32> = vec2<f32>(1.0, 2.0);
let vf123 : vec3<f32> = vec3<f32>(1.0, 2.0, 3.0);
let vf1234 : vec4<f32> = vec4<f32>(1.0, 2.0, 3.0, 4.0);
let x_73 : vec4<f32> = textureLoad(x_20, vec2<i32>(vu12), 0);
let x_1000 : u32 = 0u;
return;
}
[[stage(fragment)]]
fn main() {
main_1();
}

View File

@ -0,0 +1,110 @@
; Test: ConvertUintCoords_NonArrayed_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_4.spvasm
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 1001
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical Simple
OpEntryPoint Fragment %100 "main"
OpExecutionMode %100 OriginUpperLeft
OpName %float_var "float_var"
OpName %ptr_float "ptr_float"
OpName %i1 "i1"
OpName %vi12 "vi12"
OpName %vi123 "vi123"
OpName %vi1234 "vi1234"
OpName %u1 "u1"
OpName %vu12 "vu12"
OpName %vu123 "vu123"
OpName %vu1234 "vu1234"
OpName %f1 "f1"
OpName %vf12 "vf12"
OpName %vf123 "vf123"
OpName %vf1234 "vf1234"
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
OpDecorate %20 DescriptorSet 2
OpDecorate %20 Binding 1
OpDecorate %30 DescriptorSet 0
OpDecorate %30 Binding 1
%void = OpTypeVoid
%17 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_3 = OpConstant %uint 3
%uint_4 = OpConstant %uint 4
%uint_100 = OpConstant %uint 100
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%v4int = OpTypeVector %int 4
%v2uint = OpTypeVector %uint 2
%v3uint = OpTypeVector %uint 3
%v4uint = OpTypeVector %uint 4
%v2float = OpTypeVector %float 2
%v3float = OpTypeVector %float 3
%v4float = OpTypeVector %float 4
%43 = OpConstantNull %float
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%float_7 = OpConstant %float 7
%50 = OpConstantNull %v2float
%51 = OpConstantNull %v3float
%52 = OpConstantNull %v4float
%53 = OpConstantComposite %v2int %int_1 %int_2
%54 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%55 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%56 = OpConstantComposite %v2uint %uint_1 %uint_2
%57 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%58 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%59 = OpConstantComposite %v2float %float_1 %float_2
%60 = OpConstantComposite %v2float %float_2 %float_1
%61 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%62 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%float_0_200000003 = OpConstant %float 0.200000003
%64 = OpTypeSampler
%_ptr_UniformConstant_64 = OpTypePointer UniformConstant %64
%66 = OpTypeImage %float 2D 0 0 0 2 R32f
%_ptr_UniformConstant_66 = OpTypePointer UniformConstant %66
%ptr_float = OpTypePointer Function %float
%10 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%20 = OpVariable %_ptr_UniformConstant_66 UniformConstant
%30 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%100 = OpFunction %void None %17
%68 = OpLabel
%float_var = OpVariable %ptr_float Function
%i1 = OpCopyObject %int %int_1
%vi12 = OpCopyObject %v2int %53
%vi123 = OpCopyObject %v3int %54
%vi1234 = OpCopyObject %v4int %55
%u1 = OpCopyObject %uint %uint_1
%vu12 = OpCopyObject %v2uint %56
%vu123 = OpCopyObject %v3uint %57
%vu1234 = OpCopyObject %v4uint %58
%f1 = OpCopyObject %float %float_1
%vf12 = OpCopyObject %v2float %59
%vf123 = OpCopyObject %v3float %61
%vf1234 = OpCopyObject %v4float %62
%69 = OpLoad %64 %10
%70 = OpLoad %66 %20
%71 = OpImageRead %v4float %70 %vu12
%1000 = OpCopyObject %uint %uint_0
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,28 @@
warning: use of deprecated intrinsic
#include <metal_stdlib>
using namespace metal;
void main_1(texture2d<float, access::read> tint_symbol_1) {
float float_var = 0.0f;
int const i1 = 1;
int2 const vi12 = int2(1, 2);
int3 const vi123 = int3(1, 2, 3);
int4 const vi1234 = int4(1, 2, 3, 4);
uint const u1 = 1u;
uint2 const vu12 = uint2(1u, 2u);
uint3 const vu123 = uint3(1u, 2u, 3u);
uint4 const vu1234 = uint4(1u, 2u, 3u, 4u);
float const f1 = 1.0f;
float2 const vf12 = float2(1.0f, 2.0f);
float3 const vf123 = float3(1.0f, 2.0f, 3.0f);
float4 const vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
float4 const x_71 = tint_symbol_1.read(uint2(int2(vu12)));
uint const x_1000 = 0u;
return;
}
fragment void tint_symbol(texture2d<float, access::read> tint_symbol_2 [[texture(1)]]) {
main_1(tint_symbol_2);
return;
}

View File

@ -0,0 +1,81 @@
warning: use of deprecated intrinsic
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 55
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %x_10 "x_10"
OpName %x_20 "x_20"
OpName %x_30 "x_30"
OpName %main_1 "main_1"
OpName %float_var "float_var"
OpName %main "main"
OpDecorate %x_10 DescriptorSet 0
OpDecorate %x_10 Binding 0
OpDecorate %x_20 NonWritable
OpDecorate %x_20 DescriptorSet 2
OpDecorate %x_20 Binding 1
OpDecorate %x_30 DescriptorSet 0
OpDecorate %x_30 Binding 1
%3 = OpTypeSampler
%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
%x_10 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%float = OpTypeFloat 32
%6 = OpTypeImage %float 2D 0 0 0 2 R32f
%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6
%x_20 = OpVariable %_ptr_UniformConstant_6 UniformConstant
%x_30 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%void = OpTypeVoid
%9 = OpTypeFunction %void
%_ptr_Function_float = OpTypePointer Function %float
%15 = OpConstantNull %float
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
%int_2 = OpConstant %int 2
%20 = OpConstantComposite %v2int %int_1 %int_2
%v3int = OpTypeVector %int 3
%int_3 = OpConstant %int 3
%23 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%v4int = OpTypeVector %int 4
%int_4 = OpConstant %int 4
%26 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%v2uint = OpTypeVector %uint 2
%uint_2 = OpConstant %uint 2
%31 = OpConstantComposite %v2uint %uint_1 %uint_2
%v3uint = OpTypeVector %uint 3
%uint_3 = OpConstant %uint 3
%34 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%v4uint = OpTypeVector %uint 4
%uint_4 = OpConstant %uint 4
%37 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%float_1 = OpConstant %float 1
%v2float = OpTypeVector %float 2
%float_2 = OpConstant %float 2
%41 = OpConstantComposite %v2float %float_1 %float_2
%v3float = OpTypeVector %float 3
%float_3 = OpConstant %float 3
%44 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%v4float = OpTypeVector %float 4
%float_4 = OpConstant %float 4
%47 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%uint_0 = OpConstant %uint 0
%main_1 = OpFunction %void None %9
%12 = OpLabel
%float_var = OpVariable %_ptr_Function_float Function %15
%49 = OpLoad %6 %x_20
%50 = OpBitcast %v2int %31
%48 = OpImageRead %v4float %49 %50
OpReturn
OpFunctionEnd
%main = OpFunction %void None %9
%53 = OpLabel
%54 = OpFunctionCall %void %main_1
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,30 @@
warning: use of deprecated intrinsic
[[group(0), binding(0)]] var x_10 : sampler;
[[group(2), binding(1)]] var x_20 : texture_storage_2d<r32float, read>;
[[group(0), binding(1)]] var x_30 : sampler;
fn main_1() {
var float_var : f32;
let i1 : i32 = 1;
let vi12 : vec2<i32> = vec2<i32>(1, 2);
let vi123 : vec3<i32> = vec3<i32>(1, 2, 3);
let vi1234 : vec4<i32> = vec4<i32>(1, 2, 3, 4);
let u1 : u32 = 1u;
let vu12 : vec2<u32> = vec2<u32>(1u, 2u);
let vu123 : vec3<u32> = vec3<u32>(1u, 2u, 3u);
let vu1234 : vec4<u32> = vec4<u32>(1u, 2u, 3u, 4u);
let f1 : f32 = 1.0;
let vf12 : vec2<f32> = vec2<f32>(1.0, 2.0);
let vf123 : vec3<f32> = vec3<f32>(1.0, 2.0, 3.0);
let vf1234 : vec4<f32> = vec4<f32>(1.0, 2.0, 3.0, 4.0);
let x_71 : vec4<f32> = textureLoad(x_20, vec2<i32>(vu12));
let x_1000 : u32 = 0u;
return;
}
[[stage(fragment)]]
fn main() {
main_1();
}

View File

@ -0,0 +1,110 @@
; Test: ConvertUintCoords_NonArrayed_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_5.spvasm
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 1001
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical Simple
OpEntryPoint Fragment %100 "main"
OpExecutionMode %100 OriginUpperLeft
OpName %float_var "float_var"
OpName %ptr_float "ptr_float"
OpName %i1 "i1"
OpName %vi12 "vi12"
OpName %vi123 "vi123"
OpName %vi1234 "vi1234"
OpName %u1 "u1"
OpName %vu12 "vu12"
OpName %vu123 "vu123"
OpName %vu1234 "vu1234"
OpName %f1 "f1"
OpName %vf12 "vf12"
OpName %vf123 "vf123"
OpName %vf1234 "vf1234"
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
OpDecorate %20 DescriptorSet 2
OpDecorate %20 Binding 1
OpDecorate %30 DescriptorSet 0
OpDecorate %30 Binding 1
%void = OpTypeVoid
%17 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_3 = OpConstant %uint 3
%uint_4 = OpConstant %uint 4
%uint_100 = OpConstant %uint 100
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%v4int = OpTypeVector %int 4
%v2uint = OpTypeVector %uint 2
%v3uint = OpTypeVector %uint 3
%v4uint = OpTypeVector %uint 4
%v2float = OpTypeVector %float 2
%v3float = OpTypeVector %float 3
%v4float = OpTypeVector %float 4
%43 = OpConstantNull %float
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%float_7 = OpConstant %float 7
%50 = OpConstantNull %v2float
%51 = OpConstantNull %v3float
%52 = OpConstantNull %v4float
%53 = OpConstantComposite %v2int %int_1 %int_2
%54 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%55 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%56 = OpConstantComposite %v2uint %uint_1 %uint_2
%57 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%58 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%59 = OpConstantComposite %v2float %float_1 %float_2
%60 = OpConstantComposite %v2float %float_2 %float_1
%61 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%62 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%float_0_200000003 = OpConstant %float 0.200000003
%64 = OpTypeSampler
%_ptr_UniformConstant_64 = OpTypePointer UniformConstant %64
%66 = OpTypeImage %float 2D 0 0 0 2 R32f
%_ptr_UniformConstant_66 = OpTypePointer UniformConstant %66
%ptr_float = OpTypePointer Function %float
%10 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%20 = OpVariable %_ptr_UniformConstant_66 UniformConstant
%30 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%100 = OpFunction %void None %17
%68 = OpLabel
%float_var = OpVariable %ptr_float Function
%i1 = OpCopyObject %int %int_1
%vi12 = OpCopyObject %v2int %53
%vi123 = OpCopyObject %v3int %54
%vi1234 = OpCopyObject %v4int %55
%u1 = OpCopyObject %uint %uint_1
%vu12 = OpCopyObject %v2uint %56
%vu123 = OpCopyObject %v3uint %57
%vu1234 = OpCopyObject %v4uint %58
%f1 = OpCopyObject %float %float_1
%vf12 = OpCopyObject %v2float %59
%vf123 = OpCopyObject %v3float %61
%vf1234 = OpCopyObject %v4float %62
%69 = OpLoad %64 %10
%70 = OpLoad %66 %20
OpImageWrite %70 %vu12 %vf1234
%1000 = OpCopyObject %uint %uint_0
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,27 @@
SamplerState x_10 : register(s0, space0);
RWTexture2D<float4> x_20 : register(u1, space2);
SamplerState x_30 : register(s1, space0);
void main_1() {
float float_var = 0.0f;
const int i1 = 1;
const int2 vi12 = int2(1, 2);
const int3 vi123 = int3(1, 2, 3);
const int4 vi1234 = int4(1, 2, 3, 4);
const uint u1 = 1u;
const uint2 vu12 = uint2(1u, 2u);
const uint3 vu123 = uint3(1u, 2u, 3u);
const uint4 vu1234 = uint4(1u, 2u, 3u, 4u);
const float f1 = 1.0f;
const float2 vf12 = float2(1.0f, 2.0f);
const float3 vf123 = float3(1.0f, 2.0f, 3.0f);
const float4 vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
x_20[int2(vu12)] = vf1234;
const uint x_1000 = 0u;
return;
}
void main() {
main_1();
return;
}

View File

@ -0,0 +1,27 @@
#include <metal_stdlib>
using namespace metal;
void main_1(texture2d<float, access::write> tint_symbol_1) {
float float_var = 0.0f;
int const i1 = 1;
int2 const vi12 = int2(1, 2);
int3 const vi123 = int3(1, 2, 3);
int4 const vi1234 = int4(1, 2, 3, 4);
uint const u1 = 1u;
uint2 const vu12 = uint2(1u, 2u);
uint3 const vu123 = uint3(1u, 2u, 3u);
uint4 const vu1234 = uint4(1u, 2u, 3u, 4u);
float const f1 = 1.0f;
float2 const vf12 = float2(1.0f, 2.0f);
float3 const vf123 = float3(1.0f, 2.0f, 3.0f);
float4 const vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
tint_symbol_1.write(vf1234, uint2(int2(vu12)));
uint const x_1000 = 0u;
return;
}
fragment void tint_symbol(texture2d<float, access::write> tint_symbol_2 [[texture(1)]]) {
main_1(tint_symbol_2);
return;
}

View File

@ -0,0 +1,80 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 55
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %x_10 "x_10"
OpName %x_20 "x_20"
OpName %x_30 "x_30"
OpName %main_1 "main_1"
OpName %float_var "float_var"
OpName %main "main"
OpDecorate %x_10 DescriptorSet 0
OpDecorate %x_10 Binding 0
OpDecorate %x_20 NonReadable
OpDecorate %x_20 DescriptorSet 2
OpDecorate %x_20 Binding 1
OpDecorate %x_30 DescriptorSet 0
OpDecorate %x_30 Binding 1
%3 = OpTypeSampler
%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
%x_10 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%float = OpTypeFloat 32
%6 = OpTypeImage %float 2D 0 0 0 2 R32f
%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6
%x_20 = OpVariable %_ptr_UniformConstant_6 UniformConstant
%x_30 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%void = OpTypeVoid
%9 = OpTypeFunction %void
%_ptr_Function_float = OpTypePointer Function %float
%15 = OpConstantNull %float
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
%int_2 = OpConstant %int 2
%20 = OpConstantComposite %v2int %int_1 %int_2
%v3int = OpTypeVector %int 3
%int_3 = OpConstant %int 3
%23 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%v4int = OpTypeVector %int 4
%int_4 = OpConstant %int 4
%26 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%v2uint = OpTypeVector %uint 2
%uint_2 = OpConstant %uint 2
%31 = OpConstantComposite %v2uint %uint_1 %uint_2
%v3uint = OpTypeVector %uint 3
%uint_3 = OpConstant %uint 3
%34 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%v4uint = OpTypeVector %uint 4
%uint_4 = OpConstant %uint 4
%37 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%float_1 = OpConstant %float 1
%v2float = OpTypeVector %float 2
%float_2 = OpConstant %float 2
%41 = OpConstantComposite %v2float %float_1 %float_2
%v3float = OpTypeVector %float 3
%float_3 = OpConstant %float 3
%44 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%v4float = OpTypeVector %float 4
%float_4 = OpConstant %float 4
%47 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%uint_0 = OpConstant %uint 0
%main_1 = OpFunction %void None %9
%12 = OpLabel
%float_var = OpVariable %_ptr_Function_float Function %15
%49 = OpLoad %6 %x_20
%50 = OpBitcast %v2int %31
OpImageWrite %49 %50 %47
OpReturn
OpFunctionEnd
%main = OpFunction %void None %9
%53 = OpLabel
%54 = OpFunctionCall %void %main_1
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,29 @@
[[group(0), binding(0)]] var x_10 : sampler;
[[group(2), binding(1)]] var x_20 : texture_storage_2d<r32float, write>;
[[group(0), binding(1)]] var x_30 : sampler;
fn main_1() {
var float_var : f32;
let i1 : i32 = 1;
let vi12 : vec2<i32> = vec2<i32>(1, 2);
let vi123 : vec3<i32> = vec3<i32>(1, 2, 3);
let vi1234 : vec4<i32> = vec4<i32>(1, 2, 3, 4);
let u1 : u32 = 1u;
let vu12 : vec2<u32> = vec2<u32>(1u, 2u);
let vu123 : vec3<u32> = vec3<u32>(1u, 2u, 3u);
let vu1234 : vec4<u32> = vec4<u32>(1u, 2u, 3u, 4u);
let f1 : f32 = 1.0;
let vf12 : vec2<f32> = vec2<f32>(1.0, 2.0);
let vf123 : vec3<f32> = vec3<f32>(1.0, 2.0, 3.0);
let vf1234 : vec4<f32> = vec4<f32>(1.0, 2.0, 3.0, 4.0);
textureStore(x_20, vec2<i32>(vu12), vf1234);
let x_1000 : u32 = 0u;
return;
}
[[stage(fragment)]]
fn main() {
main_1();
}

View File

@ -0,0 +1,112 @@
; Test: Good_1D_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_0.spvasm
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 1001
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical Simple
OpEntryPoint Fragment %100 "main"
OpExecutionMode %100 OriginUpperLeft
OpName %float_var "float_var"
OpName %ptr_float "ptr_float"
OpName %i1 "i1"
OpName %vi12 "vi12"
OpName %vi123 "vi123"
OpName %vi1234 "vi1234"
OpName %u1 "u1"
OpName %vu12 "vu12"
OpName %vu123 "vu123"
OpName %vu1234 "vu1234"
OpName %f1 "f1"
OpName %vf12 "vf12"
OpName %vf123 "vf123"
OpName %vf1234 "vf1234"
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
OpDecorate %20 DescriptorSet 2
OpDecorate %20 Binding 1
OpDecorate %30 DescriptorSet 0
OpDecorate %30 Binding 1
%void = OpTypeVoid
%17 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_3 = OpConstant %uint 3
%uint_4 = OpConstant %uint 4
%uint_100 = OpConstant %uint 100
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%v4int = OpTypeVector %int 4
%v2uint = OpTypeVector %uint 2
%v3uint = OpTypeVector %uint 3
%v4uint = OpTypeVector %uint 4
%v2float = OpTypeVector %float 2
%v3float = OpTypeVector %float 3
%v4float = OpTypeVector %float 4
%43 = OpConstantNull %float
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%float_7 = OpConstant %float 7
%50 = OpConstantNull %v2float
%51 = OpConstantNull %v3float
%52 = OpConstantNull %v4float
%53 = OpConstantComposite %v2int %int_1 %int_2
%54 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%55 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%56 = OpConstantComposite %v2uint %uint_1 %uint_2
%57 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%58 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%59 = OpConstantComposite %v2float %float_1 %float_2
%60 = OpConstantComposite %v2float %float_2 %float_1
%61 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%62 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%float_0_200000003 = OpConstant %float 0.200000003
%64 = OpTypeSampler
%_ptr_UniformConstant_64 = OpTypePointer UniformConstant %64
%66 = OpTypeImage %float 1D 0 0 0 1 Unknown
%_ptr_UniformConstant_66 = OpTypePointer UniformConstant %66
%68 = OpTypeSampledImage %66
%ptr_float = OpTypePointer Function %float
%10 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%20 = OpVariable %_ptr_UniformConstant_66 UniformConstant
%30 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%100 = OpFunction %void None %17
%69 = OpLabel
%float_var = OpVariable %ptr_float Function
%i1 = OpCopyObject %int %int_1
%vi12 = OpCopyObject %v2int %53
%vi123 = OpCopyObject %v3int %54
%vi1234 = OpCopyObject %v4int %55
%u1 = OpCopyObject %uint %uint_1
%vu12 = OpCopyObject %v2uint %56
%vu123 = OpCopyObject %v3uint %57
%vu1234 = OpCopyObject %v4uint %58
%f1 = OpCopyObject %float %float_1
%vf12 = OpCopyObject %v2float %59
%vf123 = OpCopyObject %v3float %61
%vf1234 = OpCopyObject %v4float %62
%70 = OpLoad %64 %10
%71 = OpLoad %66 %20
%72 = OpSampledImage %68 %71 %70
%73 = OpImageSampleImplicitLod %v4float %72 %f1
%1000 = OpCopyObject %uint %uint_0
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,27 @@
SamplerState x_10 : register(s0, space0);
Texture1D<float4> x_20 : register(t1, space2);
SamplerState x_30 : register(s1, space0);
void main_1() {
float float_var = 0.0f;
const int i1 = 1;
const int2 vi12 = int2(1, 2);
const int3 vi123 = int3(1, 2, 3);
const int4 vi1234 = int4(1, 2, 3, 4);
const uint u1 = 1u;
const uint2 vu12 = uint2(1u, 2u);
const uint3 vu123 = uint3(1u, 2u, 3u);
const uint4 vu1234 = uint4(1u, 2u, 3u, 4u);
const float f1 = 1.0f;
const float2 vf12 = float2(1.0f, 2.0f);
const float3 vf123 = float3(1.0f, 2.0f, 3.0f);
const float4 vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
const float4 x_73 = x_20.Sample(x_10, f1);
const uint x_1000 = 0u;
return;
}
void main() {
main_1();
return;
}

View File

@ -0,0 +1,27 @@
#include <metal_stdlib>
using namespace metal;
void main_1(texture1d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
float float_var = 0.0f;
int const i1 = 1;
int2 const vi12 = int2(1, 2);
int3 const vi123 = int3(1, 2, 3);
int4 const vi1234 = int4(1, 2, 3, 4);
uint const u1 = 1u;
uint2 const vu12 = uint2(1u, 2u);
uint3 const vu123 = uint3(1u, 2u, 3u);
uint4 const vu1234 = uint4(1u, 2u, 3u, 4u);
float const f1 = 1.0f;
float2 const vf12 = float2(1.0f, 2.0f);
float3 const vf123 = float3(1.0f, 2.0f, 3.0f);
float4 const vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
float4 const x_73 = tint_symbol_1.sample(tint_symbol_2, f1);
uint const x_1000 = 0u;
return;
}
fragment void tint_symbol(texture1d<float, access::sample> tint_symbol_3 [[texture(1)]], sampler tint_symbol_4 [[sampler(0)]]) {
main_1(tint_symbol_3, tint_symbol_4);
return;
}

View File

@ -0,0 +1,82 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 57
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %x_10 "x_10"
OpName %x_20 "x_20"
OpName %x_30 "x_30"
OpName %main_1 "main_1"
OpName %float_var "float_var"
OpName %main "main"
OpDecorate %x_10 DescriptorSet 0
OpDecorate %x_10 Binding 0
OpDecorate %x_20 DescriptorSet 2
OpDecorate %x_20 Binding 1
OpDecorate %x_30 DescriptorSet 0
OpDecorate %x_30 Binding 1
%3 = OpTypeSampler
%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
%x_10 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%float = OpTypeFloat 32
%6 = OpTypeImage %float 1D 0 0 0 1 Unknown
%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6
%x_20 = OpVariable %_ptr_UniformConstant_6 UniformConstant
%x_30 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%void = OpTypeVoid
%9 = OpTypeFunction %void
%_ptr_Function_float = OpTypePointer Function %float
%15 = OpConstantNull %float
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
%int_2 = OpConstant %int 2
%20 = OpConstantComposite %v2int %int_1 %int_2
%v3int = OpTypeVector %int 3
%int_3 = OpConstant %int 3
%23 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%v4int = OpTypeVector %int 4
%int_4 = OpConstant %int 4
%26 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%v2uint = OpTypeVector %uint 2
%uint_2 = OpConstant %uint 2
%31 = OpConstantComposite %v2uint %uint_1 %uint_2
%v3uint = OpTypeVector %uint 3
%uint_3 = OpConstant %uint 3
%34 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%v4uint = OpTypeVector %uint 4
%uint_4 = OpConstant %uint 4
%37 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%float_1 = OpConstant %float 1
%v2float = OpTypeVector %float 2
%float_2 = OpConstant %float 2
%41 = OpConstantComposite %v2float %float_1 %float_2
%v3float = OpTypeVector %float 3
%float_3 = OpConstant %float 3
%44 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%v4float = OpTypeVector %float 4
%float_4 = OpConstant %float 4
%47 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%51 = OpTypeSampledImage %6
%uint_0 = OpConstant %uint 0
%main_1 = OpFunction %void None %9
%12 = OpLabel
%float_var = OpVariable %_ptr_Function_float Function %15
%49 = OpLoad %3 %x_10
%50 = OpLoad %6 %x_20
%52 = OpSampledImage %51 %50 %49
%48 = OpImageSampleImplicitLod %v4float %52 %float_1
OpReturn
OpFunctionEnd
%main = OpFunction %void None %9
%55 = OpLabel
%56 = OpFunctionCall %void %main_1
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,29 @@
[[group(0), binding(0)]] var x_10 : sampler;
[[group(2), binding(1)]] var x_20 : texture_1d<f32>;
[[group(0), binding(1)]] var x_30 : sampler;
fn main_1() {
var float_var : f32;
let i1 : i32 = 1;
let vi12 : vec2<i32> = vec2<i32>(1, 2);
let vi123 : vec3<i32> = vec3<i32>(1, 2, 3);
let vi1234 : vec4<i32> = vec4<i32>(1, 2, 3, 4);
let u1 : u32 = 1u;
let vu12 : vec2<u32> = vec2<u32>(1u, 2u);
let vu123 : vec3<u32> = vec3<u32>(1u, 2u, 3u);
let vu1234 : vec4<u32> = vec4<u32>(1u, 2u, 3u, 4u);
let f1 : f32 = 1.0;
let vf12 : vec2<f32> = vec2<f32>(1.0, 2.0);
let vf123 : vec3<f32> = vec3<f32>(1.0, 2.0, 3.0);
let vf1234 : vec4<f32> = vec4<f32>(1.0, 2.0, 3.0, 4.0);
let x_73 : vec4<f32> = textureSample(x_20, x_10, f1);
let x_1000 : u32 = 0u;
return;
}
[[stage(fragment)]]
fn main() {
main_1();
}

View File

@ -0,0 +1,112 @@
; Test: Good_1D_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_1.spvasm
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 1001
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical Simple
OpEntryPoint Fragment %100 "main"
OpExecutionMode %100 OriginUpperLeft
OpName %float_var "float_var"
OpName %ptr_float "ptr_float"
OpName %i1 "i1"
OpName %vi12 "vi12"
OpName %vi123 "vi123"
OpName %vi1234 "vi1234"
OpName %u1 "u1"
OpName %vu12 "vu12"
OpName %vu123 "vu123"
OpName %vu1234 "vu1234"
OpName %f1 "f1"
OpName %vf12 "vf12"
OpName %vf123 "vf123"
OpName %vf1234 "vf1234"
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
OpDecorate %20 DescriptorSet 2
OpDecorate %20 Binding 1
OpDecorate %30 DescriptorSet 0
OpDecorate %30 Binding 1
%void = OpTypeVoid
%17 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_3 = OpConstant %uint 3
%uint_4 = OpConstant %uint 4
%uint_100 = OpConstant %uint 100
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%v4int = OpTypeVector %int 4
%v2uint = OpTypeVector %uint 2
%v3uint = OpTypeVector %uint 3
%v4uint = OpTypeVector %uint 4
%v2float = OpTypeVector %float 2
%v3float = OpTypeVector %float 3
%v4float = OpTypeVector %float 4
%43 = OpConstantNull %float
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%float_7 = OpConstant %float 7
%50 = OpConstantNull %v2float
%51 = OpConstantNull %v3float
%52 = OpConstantNull %v4float
%53 = OpConstantComposite %v2int %int_1 %int_2
%54 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%55 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%56 = OpConstantComposite %v2uint %uint_1 %uint_2
%57 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%58 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%59 = OpConstantComposite %v2float %float_1 %float_2
%60 = OpConstantComposite %v2float %float_2 %float_1
%61 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%62 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%float_0_200000003 = OpConstant %float 0.200000003
%64 = OpTypeSampler
%_ptr_UniformConstant_64 = OpTypePointer UniformConstant %64
%66 = OpTypeImage %float 1D 0 0 0 1 Unknown
%_ptr_UniformConstant_66 = OpTypePointer UniformConstant %66
%68 = OpTypeSampledImage %66
%ptr_float = OpTypePointer Function %float
%10 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%20 = OpVariable %_ptr_UniformConstant_66 UniformConstant
%30 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%100 = OpFunction %void None %17
%69 = OpLabel
%float_var = OpVariable %ptr_float Function
%i1 = OpCopyObject %int %int_1
%vi12 = OpCopyObject %v2int %53
%vi123 = OpCopyObject %v3int %54
%vi1234 = OpCopyObject %v4int %55
%u1 = OpCopyObject %uint %uint_1
%vu12 = OpCopyObject %v2uint %56
%vu123 = OpCopyObject %v3uint %57
%vu1234 = OpCopyObject %v4uint %58
%f1 = OpCopyObject %float %float_1
%vf12 = OpCopyObject %v2float %59
%vf123 = OpCopyObject %v3float %61
%vf1234 = OpCopyObject %v4float %62
%70 = OpLoad %64 %10
%71 = OpLoad %66 %20
%72 = OpSampledImage %68 %71 %70
%73 = OpImageSampleImplicitLod %v4float %72 %vf12
%1000 = OpCopyObject %uint %uint_0
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,27 @@
SamplerState x_10 : register(s0, space0);
Texture1D<float4> x_20 : register(t1, space2);
SamplerState x_30 : register(s1, space0);
void main_1() {
float float_var = 0.0f;
const int i1 = 1;
const int2 vi12 = int2(1, 2);
const int3 vi123 = int3(1, 2, 3);
const int4 vi1234 = int4(1, 2, 3, 4);
const uint u1 = 1u;
const uint2 vu12 = uint2(1u, 2u);
const uint3 vu123 = uint3(1u, 2u, 3u);
const uint4 vu1234 = uint4(1u, 2u, 3u, 4u);
const float f1 = 1.0f;
const float2 vf12 = float2(1.0f, 2.0f);
const float3 vf123 = float3(1.0f, 2.0f, 3.0f);
const float4 vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
const float4 x_73 = x_20.Sample(x_10, vf12.x);
const uint x_1000 = 0u;
return;
}
void main() {
main_1();
return;
}

View File

@ -0,0 +1,27 @@
#include <metal_stdlib>
using namespace metal;
void main_1(texture1d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
float float_var = 0.0f;
int const i1 = 1;
int2 const vi12 = int2(1, 2);
int3 const vi123 = int3(1, 2, 3);
int4 const vi1234 = int4(1, 2, 3, 4);
uint const u1 = 1u;
uint2 const vu12 = uint2(1u, 2u);
uint3 const vu123 = uint3(1u, 2u, 3u);
uint4 const vu1234 = uint4(1u, 2u, 3u, 4u);
float const f1 = 1.0f;
float2 const vf12 = float2(1.0f, 2.0f);
float3 const vf123 = float3(1.0f, 2.0f, 3.0f);
float4 const vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
float4 const x_73 = tint_symbol_1.sample(tint_symbol_2, vf12.x);
uint const x_1000 = 0u;
return;
}
fragment void tint_symbol(texture1d<float, access::sample> tint_symbol_3 [[texture(1)]], sampler tint_symbol_4 [[sampler(0)]]) {
main_1(tint_symbol_3, tint_symbol_4);
return;
}

View File

@ -0,0 +1,83 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 58
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %x_10 "x_10"
OpName %x_20 "x_20"
OpName %x_30 "x_30"
OpName %main_1 "main_1"
OpName %float_var "float_var"
OpName %main "main"
OpDecorate %x_10 DescriptorSet 0
OpDecorate %x_10 Binding 0
OpDecorate %x_20 DescriptorSet 2
OpDecorate %x_20 Binding 1
OpDecorate %x_30 DescriptorSet 0
OpDecorate %x_30 Binding 1
%3 = OpTypeSampler
%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
%x_10 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%float = OpTypeFloat 32
%6 = OpTypeImage %float 1D 0 0 0 1 Unknown
%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6
%x_20 = OpVariable %_ptr_UniformConstant_6 UniformConstant
%x_30 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%void = OpTypeVoid
%9 = OpTypeFunction %void
%_ptr_Function_float = OpTypePointer Function %float
%15 = OpConstantNull %float
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
%int_2 = OpConstant %int 2
%20 = OpConstantComposite %v2int %int_1 %int_2
%v3int = OpTypeVector %int 3
%int_3 = OpConstant %int 3
%23 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%v4int = OpTypeVector %int 4
%int_4 = OpConstant %int 4
%26 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%v2uint = OpTypeVector %uint 2
%uint_2 = OpConstant %uint 2
%31 = OpConstantComposite %v2uint %uint_1 %uint_2
%v3uint = OpTypeVector %uint 3
%uint_3 = OpConstant %uint 3
%34 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%v4uint = OpTypeVector %uint 4
%uint_4 = OpConstant %uint 4
%37 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%float_1 = OpConstant %float 1
%v2float = OpTypeVector %float 2
%float_2 = OpConstant %float 2
%41 = OpConstantComposite %v2float %float_1 %float_2
%v3float = OpTypeVector %float 3
%float_3 = OpConstant %float 3
%44 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%v4float = OpTypeVector %float 4
%float_4 = OpConstant %float 4
%47 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%51 = OpTypeSampledImage %6
%uint_0 = OpConstant %uint 0
%main_1 = OpFunction %void None %9
%12 = OpLabel
%float_var = OpVariable %_ptr_Function_float Function %15
%49 = OpLoad %3 %x_10
%50 = OpLoad %6 %x_20
%52 = OpSampledImage %51 %50 %49
%53 = OpCompositeExtract %float %41 0
%48 = OpImageSampleImplicitLod %v4float %52 %53
OpReturn
OpFunctionEnd
%main = OpFunction %void None %9
%56 = OpLabel
%57 = OpFunctionCall %void %main_1
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,29 @@
[[group(0), binding(0)]] var x_10 : sampler;
[[group(2), binding(1)]] var x_20 : texture_1d<f32>;
[[group(0), binding(1)]] var x_30 : sampler;
fn main_1() {
var float_var : f32;
let i1 : i32 = 1;
let vi12 : vec2<i32> = vec2<i32>(1, 2);
let vi123 : vec3<i32> = vec3<i32>(1, 2, 3);
let vi1234 : vec4<i32> = vec4<i32>(1, 2, 3, 4);
let u1 : u32 = 1u;
let vu12 : vec2<u32> = vec2<u32>(1u, 2u);
let vu123 : vec3<u32> = vec3<u32>(1u, 2u, 3u);
let vu1234 : vec4<u32> = vec4<u32>(1u, 2u, 3u, 4u);
let f1 : f32 = 1.0;
let vf12 : vec2<f32> = vec2<f32>(1.0, 2.0);
let vf123 : vec3<f32> = vec3<f32>(1.0, 2.0, 3.0);
let vf1234 : vec4<f32> = vec4<f32>(1.0, 2.0, 3.0, 4.0);
let x_73 : vec4<f32> = textureSample(x_20, x_10, vf12.x);
let x_1000 : u32 = 0u;
return;
}
[[stage(fragment)]]
fn main() {
main_1();
}

View File

@ -0,0 +1,112 @@
; Test: Good_1D_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_2.spvasm
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 1001
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical Simple
OpEntryPoint Fragment %100 "main"
OpExecutionMode %100 OriginUpperLeft
OpName %float_var "float_var"
OpName %ptr_float "ptr_float"
OpName %i1 "i1"
OpName %vi12 "vi12"
OpName %vi123 "vi123"
OpName %vi1234 "vi1234"
OpName %u1 "u1"
OpName %vu12 "vu12"
OpName %vu123 "vu123"
OpName %vu1234 "vu1234"
OpName %f1 "f1"
OpName %vf12 "vf12"
OpName %vf123 "vf123"
OpName %vf1234 "vf1234"
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
OpDecorate %20 DescriptorSet 2
OpDecorate %20 Binding 1
OpDecorate %30 DescriptorSet 0
OpDecorate %30 Binding 1
%void = OpTypeVoid
%17 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_3 = OpConstant %uint 3
%uint_4 = OpConstant %uint 4
%uint_100 = OpConstant %uint 100
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%v4int = OpTypeVector %int 4
%v2uint = OpTypeVector %uint 2
%v3uint = OpTypeVector %uint 3
%v4uint = OpTypeVector %uint 4
%v2float = OpTypeVector %float 2
%v3float = OpTypeVector %float 3
%v4float = OpTypeVector %float 4
%43 = OpConstantNull %float
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%float_7 = OpConstant %float 7
%50 = OpConstantNull %v2float
%51 = OpConstantNull %v3float
%52 = OpConstantNull %v4float
%53 = OpConstantComposite %v2int %int_1 %int_2
%54 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%55 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%56 = OpConstantComposite %v2uint %uint_1 %uint_2
%57 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%58 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%59 = OpConstantComposite %v2float %float_1 %float_2
%60 = OpConstantComposite %v2float %float_2 %float_1
%61 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%62 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%float_0_200000003 = OpConstant %float 0.200000003
%64 = OpTypeSampler
%_ptr_UniformConstant_64 = OpTypePointer UniformConstant %64
%66 = OpTypeImage %float 1D 0 0 0 1 Unknown
%_ptr_UniformConstant_66 = OpTypePointer UniformConstant %66
%68 = OpTypeSampledImage %66
%ptr_float = OpTypePointer Function %float
%10 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%20 = OpVariable %_ptr_UniformConstant_66 UniformConstant
%30 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%100 = OpFunction %void None %17
%69 = OpLabel
%float_var = OpVariable %ptr_float Function
%i1 = OpCopyObject %int %int_1
%vi12 = OpCopyObject %v2int %53
%vi123 = OpCopyObject %v3int %54
%vi1234 = OpCopyObject %v4int %55
%u1 = OpCopyObject %uint %uint_1
%vu12 = OpCopyObject %v2uint %56
%vu123 = OpCopyObject %v3uint %57
%vu1234 = OpCopyObject %v4uint %58
%f1 = OpCopyObject %float %float_1
%vf12 = OpCopyObject %v2float %59
%vf123 = OpCopyObject %v3float %61
%vf1234 = OpCopyObject %v4float %62
%70 = OpLoad %64 %10
%71 = OpLoad %66 %20
%72 = OpSampledImage %68 %71 %70
%73 = OpImageSampleImplicitLod %v4float %72 %vf123
%1000 = OpCopyObject %uint %uint_0
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,27 @@
SamplerState x_10 : register(s0, space0);
Texture1D<float4> x_20 : register(t1, space2);
SamplerState x_30 : register(s1, space0);
void main_1() {
float float_var = 0.0f;
const int i1 = 1;
const int2 vi12 = int2(1, 2);
const int3 vi123 = int3(1, 2, 3);
const int4 vi1234 = int4(1, 2, 3, 4);
const uint u1 = 1u;
const uint2 vu12 = uint2(1u, 2u);
const uint3 vu123 = uint3(1u, 2u, 3u);
const uint4 vu1234 = uint4(1u, 2u, 3u, 4u);
const float f1 = 1.0f;
const float2 vf12 = float2(1.0f, 2.0f);
const float3 vf123 = float3(1.0f, 2.0f, 3.0f);
const float4 vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
const float4 x_73 = x_20.Sample(x_10, vf123.x);
const uint x_1000 = 0u;
return;
}
void main() {
main_1();
return;
}

View File

@ -0,0 +1,27 @@
#include <metal_stdlib>
using namespace metal;
void main_1(texture1d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
float float_var = 0.0f;
int const i1 = 1;
int2 const vi12 = int2(1, 2);
int3 const vi123 = int3(1, 2, 3);
int4 const vi1234 = int4(1, 2, 3, 4);
uint const u1 = 1u;
uint2 const vu12 = uint2(1u, 2u);
uint3 const vu123 = uint3(1u, 2u, 3u);
uint4 const vu1234 = uint4(1u, 2u, 3u, 4u);
float const f1 = 1.0f;
float2 const vf12 = float2(1.0f, 2.0f);
float3 const vf123 = float3(1.0f, 2.0f, 3.0f);
float4 const vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
float4 const x_73 = tint_symbol_1.sample(tint_symbol_2, vf123.x);
uint const x_1000 = 0u;
return;
}
fragment void tint_symbol(texture1d<float, access::sample> tint_symbol_3 [[texture(1)]], sampler tint_symbol_4 [[sampler(0)]]) {
main_1(tint_symbol_3, tint_symbol_4);
return;
}

View File

@ -0,0 +1,83 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 58
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %x_10 "x_10"
OpName %x_20 "x_20"
OpName %x_30 "x_30"
OpName %main_1 "main_1"
OpName %float_var "float_var"
OpName %main "main"
OpDecorate %x_10 DescriptorSet 0
OpDecorate %x_10 Binding 0
OpDecorate %x_20 DescriptorSet 2
OpDecorate %x_20 Binding 1
OpDecorate %x_30 DescriptorSet 0
OpDecorate %x_30 Binding 1
%3 = OpTypeSampler
%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
%x_10 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%float = OpTypeFloat 32
%6 = OpTypeImage %float 1D 0 0 0 1 Unknown
%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6
%x_20 = OpVariable %_ptr_UniformConstant_6 UniformConstant
%x_30 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%void = OpTypeVoid
%9 = OpTypeFunction %void
%_ptr_Function_float = OpTypePointer Function %float
%15 = OpConstantNull %float
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
%int_2 = OpConstant %int 2
%20 = OpConstantComposite %v2int %int_1 %int_2
%v3int = OpTypeVector %int 3
%int_3 = OpConstant %int 3
%23 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%v4int = OpTypeVector %int 4
%int_4 = OpConstant %int 4
%26 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%v2uint = OpTypeVector %uint 2
%uint_2 = OpConstant %uint 2
%31 = OpConstantComposite %v2uint %uint_1 %uint_2
%v3uint = OpTypeVector %uint 3
%uint_3 = OpConstant %uint 3
%34 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%v4uint = OpTypeVector %uint 4
%uint_4 = OpConstant %uint 4
%37 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%float_1 = OpConstant %float 1
%v2float = OpTypeVector %float 2
%float_2 = OpConstant %float 2
%41 = OpConstantComposite %v2float %float_1 %float_2
%v3float = OpTypeVector %float 3
%float_3 = OpConstant %float 3
%44 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%v4float = OpTypeVector %float 4
%float_4 = OpConstant %float 4
%47 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%51 = OpTypeSampledImage %6
%uint_0 = OpConstant %uint 0
%main_1 = OpFunction %void None %9
%12 = OpLabel
%float_var = OpVariable %_ptr_Function_float Function %15
%49 = OpLoad %3 %x_10
%50 = OpLoad %6 %x_20
%52 = OpSampledImage %51 %50 %49
%53 = OpCompositeExtract %float %44 0
%48 = OpImageSampleImplicitLod %v4float %52 %53
OpReturn
OpFunctionEnd
%main = OpFunction %void None %9
%56 = OpLabel
%57 = OpFunctionCall %void %main_1
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,29 @@
[[group(0), binding(0)]] var x_10 : sampler;
[[group(2), binding(1)]] var x_20 : texture_1d<f32>;
[[group(0), binding(1)]] var x_30 : sampler;
fn main_1() {
var float_var : f32;
let i1 : i32 = 1;
let vi12 : vec2<i32> = vec2<i32>(1, 2);
let vi123 : vec3<i32> = vec3<i32>(1, 2, 3);
let vi1234 : vec4<i32> = vec4<i32>(1, 2, 3, 4);
let u1 : u32 = 1u;
let vu12 : vec2<u32> = vec2<u32>(1u, 2u);
let vu123 : vec3<u32> = vec3<u32>(1u, 2u, 3u);
let vu1234 : vec4<u32> = vec4<u32>(1u, 2u, 3u, 4u);
let f1 : f32 = 1.0;
let vf12 : vec2<f32> = vec2<f32>(1.0, 2.0);
let vf123 : vec3<f32> = vec3<f32>(1.0, 2.0, 3.0);
let vf1234 : vec4<f32> = vec4<f32>(1.0, 2.0, 3.0, 4.0);
let x_73 : vec4<f32> = textureSample(x_20, x_10, vf123.x);
let x_1000 : u32 = 0u;
return;
}
[[stage(fragment)]]
fn main() {
main_1();
}

View File

@ -0,0 +1,112 @@
; Test: Good_1D_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_3.spvasm
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 1001
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical Simple
OpEntryPoint Fragment %100 "main"
OpExecutionMode %100 OriginUpperLeft
OpName %float_var "float_var"
OpName %ptr_float "ptr_float"
OpName %i1 "i1"
OpName %vi12 "vi12"
OpName %vi123 "vi123"
OpName %vi1234 "vi1234"
OpName %u1 "u1"
OpName %vu12 "vu12"
OpName %vu123 "vu123"
OpName %vu1234 "vu1234"
OpName %f1 "f1"
OpName %vf12 "vf12"
OpName %vf123 "vf123"
OpName %vf1234 "vf1234"
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
OpDecorate %20 DescriptorSet 2
OpDecorate %20 Binding 1
OpDecorate %30 DescriptorSet 0
OpDecorate %30 Binding 1
%void = OpTypeVoid
%17 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_3 = OpConstant %uint 3
%uint_4 = OpConstant %uint 4
%uint_100 = OpConstant %uint 100
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%v4int = OpTypeVector %int 4
%v2uint = OpTypeVector %uint 2
%v3uint = OpTypeVector %uint 3
%v4uint = OpTypeVector %uint 4
%v2float = OpTypeVector %float 2
%v3float = OpTypeVector %float 3
%v4float = OpTypeVector %float 4
%43 = OpConstantNull %float
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%float_7 = OpConstant %float 7
%50 = OpConstantNull %v2float
%51 = OpConstantNull %v3float
%52 = OpConstantNull %v4float
%53 = OpConstantComposite %v2int %int_1 %int_2
%54 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%55 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%56 = OpConstantComposite %v2uint %uint_1 %uint_2
%57 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%58 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%59 = OpConstantComposite %v2float %float_1 %float_2
%60 = OpConstantComposite %v2float %float_2 %float_1
%61 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%62 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%float_0_200000003 = OpConstant %float 0.200000003
%64 = OpTypeSampler
%_ptr_UniformConstant_64 = OpTypePointer UniformConstant %64
%66 = OpTypeImage %float 1D 0 0 0 1 Unknown
%_ptr_UniformConstant_66 = OpTypePointer UniformConstant %66
%68 = OpTypeSampledImage %66
%ptr_float = OpTypePointer Function %float
%10 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%20 = OpVariable %_ptr_UniformConstant_66 UniformConstant
%30 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%100 = OpFunction %void None %17
%69 = OpLabel
%float_var = OpVariable %ptr_float Function
%i1 = OpCopyObject %int %int_1
%vi12 = OpCopyObject %v2int %53
%vi123 = OpCopyObject %v3int %54
%vi1234 = OpCopyObject %v4int %55
%u1 = OpCopyObject %uint %uint_1
%vu12 = OpCopyObject %v2uint %56
%vu123 = OpCopyObject %v3uint %57
%vu1234 = OpCopyObject %v4uint %58
%f1 = OpCopyObject %float %float_1
%vf12 = OpCopyObject %v2float %59
%vf123 = OpCopyObject %v3float %61
%vf1234 = OpCopyObject %v4float %62
%70 = OpLoad %64 %10
%71 = OpLoad %66 %20
%72 = OpSampledImage %68 %71 %70
%73 = OpImageSampleImplicitLod %v4float %72 %vf1234
%1000 = OpCopyObject %uint %uint_0
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,27 @@
SamplerState x_10 : register(s0, space0);
Texture1D<float4> x_20 : register(t1, space2);
SamplerState x_30 : register(s1, space0);
void main_1() {
float float_var = 0.0f;
const int i1 = 1;
const int2 vi12 = int2(1, 2);
const int3 vi123 = int3(1, 2, 3);
const int4 vi1234 = int4(1, 2, 3, 4);
const uint u1 = 1u;
const uint2 vu12 = uint2(1u, 2u);
const uint3 vu123 = uint3(1u, 2u, 3u);
const uint4 vu1234 = uint4(1u, 2u, 3u, 4u);
const float f1 = 1.0f;
const float2 vf12 = float2(1.0f, 2.0f);
const float3 vf123 = float3(1.0f, 2.0f, 3.0f);
const float4 vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
const float4 x_73 = x_20.Sample(x_10, vf1234.x);
const uint x_1000 = 0u;
return;
}
void main() {
main_1();
return;
}

View File

@ -0,0 +1,27 @@
#include <metal_stdlib>
using namespace metal;
void main_1(texture1d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
float float_var = 0.0f;
int const i1 = 1;
int2 const vi12 = int2(1, 2);
int3 const vi123 = int3(1, 2, 3);
int4 const vi1234 = int4(1, 2, 3, 4);
uint const u1 = 1u;
uint2 const vu12 = uint2(1u, 2u);
uint3 const vu123 = uint3(1u, 2u, 3u);
uint4 const vu1234 = uint4(1u, 2u, 3u, 4u);
float const f1 = 1.0f;
float2 const vf12 = float2(1.0f, 2.0f);
float3 const vf123 = float3(1.0f, 2.0f, 3.0f);
float4 const vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
float4 const x_73 = tint_symbol_1.sample(tint_symbol_2, vf1234.x);
uint const x_1000 = 0u;
return;
}
fragment void tint_symbol(texture1d<float, access::sample> tint_symbol_3 [[texture(1)]], sampler tint_symbol_4 [[sampler(0)]]) {
main_1(tint_symbol_3, tint_symbol_4);
return;
}

View File

@ -0,0 +1,83 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 58
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %x_10 "x_10"
OpName %x_20 "x_20"
OpName %x_30 "x_30"
OpName %main_1 "main_1"
OpName %float_var "float_var"
OpName %main "main"
OpDecorate %x_10 DescriptorSet 0
OpDecorate %x_10 Binding 0
OpDecorate %x_20 DescriptorSet 2
OpDecorate %x_20 Binding 1
OpDecorate %x_30 DescriptorSet 0
OpDecorate %x_30 Binding 1
%3 = OpTypeSampler
%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
%x_10 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%float = OpTypeFloat 32
%6 = OpTypeImage %float 1D 0 0 0 1 Unknown
%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6
%x_20 = OpVariable %_ptr_UniformConstant_6 UniformConstant
%x_30 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%void = OpTypeVoid
%9 = OpTypeFunction %void
%_ptr_Function_float = OpTypePointer Function %float
%15 = OpConstantNull %float
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
%int_2 = OpConstant %int 2
%20 = OpConstantComposite %v2int %int_1 %int_2
%v3int = OpTypeVector %int 3
%int_3 = OpConstant %int 3
%23 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%v4int = OpTypeVector %int 4
%int_4 = OpConstant %int 4
%26 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%v2uint = OpTypeVector %uint 2
%uint_2 = OpConstant %uint 2
%31 = OpConstantComposite %v2uint %uint_1 %uint_2
%v3uint = OpTypeVector %uint 3
%uint_3 = OpConstant %uint 3
%34 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%v4uint = OpTypeVector %uint 4
%uint_4 = OpConstant %uint 4
%37 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%float_1 = OpConstant %float 1
%v2float = OpTypeVector %float 2
%float_2 = OpConstant %float 2
%41 = OpConstantComposite %v2float %float_1 %float_2
%v3float = OpTypeVector %float 3
%float_3 = OpConstant %float 3
%44 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%v4float = OpTypeVector %float 4
%float_4 = OpConstant %float 4
%47 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%51 = OpTypeSampledImage %6
%uint_0 = OpConstant %uint 0
%main_1 = OpFunction %void None %9
%12 = OpLabel
%float_var = OpVariable %_ptr_Function_float Function %15
%49 = OpLoad %3 %x_10
%50 = OpLoad %6 %x_20
%52 = OpSampledImage %51 %50 %49
%53 = OpCompositeExtract %float %47 0
%48 = OpImageSampleImplicitLod %v4float %52 %53
OpReturn
OpFunctionEnd
%main = OpFunction %void None %9
%56 = OpLabel
%57 = OpFunctionCall %void %main_1
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,29 @@
[[group(0), binding(0)]] var x_10 : sampler;
[[group(2), binding(1)]] var x_20 : texture_1d<f32>;
[[group(0), binding(1)]] var x_30 : sampler;
fn main_1() {
var float_var : f32;
let i1 : i32 = 1;
let vi12 : vec2<i32> = vec2<i32>(1, 2);
let vi123 : vec3<i32> = vec3<i32>(1, 2, 3);
let vi1234 : vec4<i32> = vec4<i32>(1, 2, 3, 4);
let u1 : u32 = 1u;
let vu12 : vec2<u32> = vec2<u32>(1u, 2u);
let vu123 : vec3<u32> = vec3<u32>(1u, 2u, 3u);
let vu1234 : vec4<u32> = vec4<u32>(1u, 2u, 3u, 4u);
let f1 : f32 = 1.0;
let vf12 : vec2<f32> = vec2<f32>(1.0, 2.0);
let vf123 : vec3<f32> = vec3<f32>(1.0, 2.0, 3.0);
let vf1234 : vec4<f32> = vec4<f32>(1.0, 2.0, 3.0, 4.0);
let x_73 : vec4<f32> = textureSample(x_20, x_10, vf1234.x);
let x_1000 : u32 = 0u;
return;
}
[[stage(fragment)]]
fn main() {
main_1();
}

View File

@ -0,0 +1,112 @@
; Test: Good_2DArray_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_0.spvasm
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 1001
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical Simple
OpEntryPoint Fragment %100 "main"
OpExecutionMode %100 OriginUpperLeft
OpName %float_var "float_var"
OpName %ptr_float "ptr_float"
OpName %i1 "i1"
OpName %vi12 "vi12"
OpName %vi123 "vi123"
OpName %vi1234 "vi1234"
OpName %u1 "u1"
OpName %vu12 "vu12"
OpName %vu123 "vu123"
OpName %vu1234 "vu1234"
OpName %f1 "f1"
OpName %vf12 "vf12"
OpName %vf123 "vf123"
OpName %vf1234 "vf1234"
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
OpDecorate %20 DescriptorSet 2
OpDecorate %20 Binding 1
OpDecorate %30 DescriptorSet 0
OpDecorate %30 Binding 1
%void = OpTypeVoid
%17 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_3 = OpConstant %uint 3
%uint_4 = OpConstant %uint 4
%uint_100 = OpConstant %uint 100
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%v4int = OpTypeVector %int 4
%v2uint = OpTypeVector %uint 2
%v3uint = OpTypeVector %uint 3
%v4uint = OpTypeVector %uint 4
%v2float = OpTypeVector %float 2
%v3float = OpTypeVector %float 3
%v4float = OpTypeVector %float 4
%43 = OpConstantNull %float
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%float_7 = OpConstant %float 7
%50 = OpConstantNull %v2float
%51 = OpConstantNull %v3float
%52 = OpConstantNull %v4float
%53 = OpConstantComposite %v2int %int_1 %int_2
%54 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%55 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%56 = OpConstantComposite %v2uint %uint_1 %uint_2
%57 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%58 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%59 = OpConstantComposite %v2float %float_1 %float_2
%60 = OpConstantComposite %v2float %float_2 %float_1
%61 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%62 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%float_0_200000003 = OpConstant %float 0.200000003
%64 = OpTypeSampler
%_ptr_UniformConstant_64 = OpTypePointer UniformConstant %64
%66 = OpTypeImage %float 2D 0 1 0 1 Unknown
%_ptr_UniformConstant_66 = OpTypePointer UniformConstant %66
%68 = OpTypeSampledImage %66
%ptr_float = OpTypePointer Function %float
%10 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%20 = OpVariable %_ptr_UniformConstant_66 UniformConstant
%30 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%100 = OpFunction %void None %17
%69 = OpLabel
%float_var = OpVariable %ptr_float Function
%i1 = OpCopyObject %int %int_1
%vi12 = OpCopyObject %v2int %53
%vi123 = OpCopyObject %v3int %54
%vi1234 = OpCopyObject %v4int %55
%u1 = OpCopyObject %uint %uint_1
%vu12 = OpCopyObject %v2uint %56
%vu123 = OpCopyObject %v3uint %57
%vu1234 = OpCopyObject %v4uint %58
%f1 = OpCopyObject %float %float_1
%vf12 = OpCopyObject %v2float %59
%vf123 = OpCopyObject %v3float %61
%vf1234 = OpCopyObject %v4float %62
%70 = OpLoad %64 %10
%71 = OpLoad %66 %20
%72 = OpSampledImage %68 %71 %70
%73 = OpImageSampleImplicitLod %v4float %72 %vf123
%1000 = OpCopyObject %uint %uint_0
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,27 @@
SamplerState x_10 : register(s0, space0);
Texture2DArray<float4> x_20 : register(t1, space2);
SamplerState x_30 : register(s1, space0);
void main_1() {
float float_var = 0.0f;
const int i1 = 1;
const int2 vi12 = int2(1, 2);
const int3 vi123 = int3(1, 2, 3);
const int4 vi1234 = int4(1, 2, 3, 4);
const uint u1 = 1u;
const uint2 vu12 = uint2(1u, 2u);
const uint3 vu123 = uint3(1u, 2u, 3u);
const uint4 vu1234 = uint4(1u, 2u, 3u, 4u);
const float f1 = 1.0f;
const float2 vf12 = float2(1.0f, 2.0f);
const float3 vf123 = float3(1.0f, 2.0f, 3.0f);
const float4 vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
const float4 x_73 = x_20.Sample(x_10, float3(vf123.xy, float(int(vf123.z))));
const uint x_1000 = 0u;
return;
}
void main() {
main_1();
return;
}

View File

@ -0,0 +1,27 @@
#include <metal_stdlib>
using namespace metal;
void main_1(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
float float_var = 0.0f;
int const i1 = 1;
int2 const vi12 = int2(1, 2);
int3 const vi123 = int3(1, 2, 3);
int4 const vi1234 = int4(1, 2, 3, 4);
uint const u1 = 1u;
uint2 const vu12 = uint2(1u, 2u);
uint3 const vu123 = uint3(1u, 2u, 3u);
uint4 const vu1234 = uint4(1u, 2u, 3u, 4u);
float const f1 = 1.0f;
float2 const vf12 = float2(1.0f, 2.0f);
float3 const vf123 = float3(1.0f, 2.0f, 3.0f);
float4 const vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
float4 const x_73 = tint_symbol_1.sample(tint_symbol_2, vf123.xy, int(vf123.z));
uint const x_1000 = 0u;
return;
}
fragment void tint_symbol(texture2d_array<float, access::sample> tint_symbol_3 [[texture(1)]], sampler tint_symbol_4 [[sampler(0)]]) {
main_1(tint_symbol_3, tint_symbol_4);
return;
}

View File

@ -0,0 +1,88 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 64
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %x_10 "x_10"
OpName %x_20 "x_20"
OpName %x_30 "x_30"
OpName %main_1 "main_1"
OpName %float_var "float_var"
OpName %main "main"
OpDecorate %x_10 DescriptorSet 0
OpDecorate %x_10 Binding 0
OpDecorate %x_20 DescriptorSet 2
OpDecorate %x_20 Binding 1
OpDecorate %x_30 DescriptorSet 0
OpDecorate %x_30 Binding 1
%3 = OpTypeSampler
%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
%x_10 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%float = OpTypeFloat 32
%6 = OpTypeImage %float 2D 0 1 0 1 Unknown
%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6
%x_20 = OpVariable %_ptr_UniformConstant_6 UniformConstant
%x_30 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%void = OpTypeVoid
%9 = OpTypeFunction %void
%_ptr_Function_float = OpTypePointer Function %float
%15 = OpConstantNull %float
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
%int_2 = OpConstant %int 2
%20 = OpConstantComposite %v2int %int_1 %int_2
%v3int = OpTypeVector %int 3
%int_3 = OpConstant %int 3
%23 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%v4int = OpTypeVector %int 4
%int_4 = OpConstant %int 4
%26 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%v2uint = OpTypeVector %uint 2
%uint_2 = OpConstant %uint 2
%31 = OpConstantComposite %v2uint %uint_1 %uint_2
%v3uint = OpTypeVector %uint 3
%uint_3 = OpConstant %uint 3
%34 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%v4uint = OpTypeVector %uint 4
%uint_4 = OpConstant %uint 4
%37 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%float_1 = OpConstant %float 1
%v2float = OpTypeVector %float 2
%float_2 = OpConstant %float 2
%41 = OpConstantComposite %v2float %float_1 %float_2
%v3float = OpTypeVector %float 3
%float_3 = OpConstant %float 3
%44 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%v4float = OpTypeVector %float 4
%float_4 = OpConstant %float 4
%47 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%51 = OpTypeSampledImage %6
%uint_0 = OpConstant %uint 0
%main_1 = OpFunction %void None %9
%12 = OpLabel
%float_var = OpVariable %_ptr_Function_float Function %15
%49 = OpLoad %3 %x_10
%50 = OpLoad %6 %x_20
%52 = OpSampledImage %51 %50 %49
%53 = OpVectorShuffle %v2float %44 %44 0 1
%54 = OpCompositeExtract %float %53 0
%55 = OpCompositeExtract %float %53 1
%58 = OpCompositeExtract %float %44 2
%57 = OpConvertFToS %int %58
%56 = OpConvertSToF %float %57
%59 = OpCompositeConstruct %v3float %54 %55 %56
%48 = OpImageSampleImplicitLod %v4float %52 %59
OpReturn
OpFunctionEnd
%main = OpFunction %void None %9
%62 = OpLabel
%63 = OpFunctionCall %void %main_1
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,29 @@
[[group(0), binding(0)]] var x_10 : sampler;
[[group(2), binding(1)]] var x_20 : texture_2d_array<f32>;
[[group(0), binding(1)]] var x_30 : sampler;
fn main_1() {
var float_var : f32;
let i1 : i32 = 1;
let vi12 : vec2<i32> = vec2<i32>(1, 2);
let vi123 : vec3<i32> = vec3<i32>(1, 2, 3);
let vi1234 : vec4<i32> = vec4<i32>(1, 2, 3, 4);
let u1 : u32 = 1u;
let vu12 : vec2<u32> = vec2<u32>(1u, 2u);
let vu123 : vec3<u32> = vec3<u32>(1u, 2u, 3u);
let vu1234 : vec4<u32> = vec4<u32>(1u, 2u, 3u, 4u);
let f1 : f32 = 1.0;
let vf12 : vec2<f32> = vec2<f32>(1.0, 2.0);
let vf123 : vec3<f32> = vec3<f32>(1.0, 2.0, 3.0);
let vf1234 : vec4<f32> = vec4<f32>(1.0, 2.0, 3.0, 4.0);
let x_73 : vec4<f32> = textureSample(x_20, x_10, vf123.xy, i32(vf123.z));
let x_1000 : u32 = 0u;
return;
}
[[stage(fragment)]]
fn main() {
main_1();
}

View File

@ -0,0 +1,112 @@
; Test: Good_2DArray_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_1.spvasm
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 1001
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical Simple
OpEntryPoint Fragment %100 "main"
OpExecutionMode %100 OriginUpperLeft
OpName %float_var "float_var"
OpName %ptr_float "ptr_float"
OpName %i1 "i1"
OpName %vi12 "vi12"
OpName %vi123 "vi123"
OpName %vi1234 "vi1234"
OpName %u1 "u1"
OpName %vu12 "vu12"
OpName %vu123 "vu123"
OpName %vu1234 "vu1234"
OpName %f1 "f1"
OpName %vf12 "vf12"
OpName %vf123 "vf123"
OpName %vf1234 "vf1234"
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
OpDecorate %20 DescriptorSet 2
OpDecorate %20 Binding 1
OpDecorate %30 DescriptorSet 0
OpDecorate %30 Binding 1
%void = OpTypeVoid
%17 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_3 = OpConstant %uint 3
%uint_4 = OpConstant %uint 4
%uint_100 = OpConstant %uint 100
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%v4int = OpTypeVector %int 4
%v2uint = OpTypeVector %uint 2
%v3uint = OpTypeVector %uint 3
%v4uint = OpTypeVector %uint 4
%v2float = OpTypeVector %float 2
%v3float = OpTypeVector %float 3
%v4float = OpTypeVector %float 4
%43 = OpConstantNull %float
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%float_7 = OpConstant %float 7
%50 = OpConstantNull %v2float
%51 = OpConstantNull %v3float
%52 = OpConstantNull %v4float
%53 = OpConstantComposite %v2int %int_1 %int_2
%54 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%55 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%56 = OpConstantComposite %v2uint %uint_1 %uint_2
%57 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%58 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%59 = OpConstantComposite %v2float %float_1 %float_2
%60 = OpConstantComposite %v2float %float_2 %float_1
%61 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%62 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%float_0_200000003 = OpConstant %float 0.200000003
%64 = OpTypeSampler
%_ptr_UniformConstant_64 = OpTypePointer UniformConstant %64
%66 = OpTypeImage %float 2D 0 1 0 1 Unknown
%_ptr_UniformConstant_66 = OpTypePointer UniformConstant %66
%68 = OpTypeSampledImage %66
%ptr_float = OpTypePointer Function %float
%10 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%20 = OpVariable %_ptr_UniformConstant_66 UniformConstant
%30 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%100 = OpFunction %void None %17
%69 = OpLabel
%float_var = OpVariable %ptr_float Function
%i1 = OpCopyObject %int %int_1
%vi12 = OpCopyObject %v2int %53
%vi123 = OpCopyObject %v3int %54
%vi1234 = OpCopyObject %v4int %55
%u1 = OpCopyObject %uint %uint_1
%vu12 = OpCopyObject %v2uint %56
%vu123 = OpCopyObject %v3uint %57
%vu1234 = OpCopyObject %v4uint %58
%f1 = OpCopyObject %float %float_1
%vf12 = OpCopyObject %v2float %59
%vf123 = OpCopyObject %v3float %61
%vf1234 = OpCopyObject %v4float %62
%70 = OpLoad %64 %10
%71 = OpLoad %66 %20
%72 = OpSampledImage %68 %71 %70
%73 = OpImageSampleImplicitLod %v4float %72 %vf1234
%1000 = OpCopyObject %uint %uint_0
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,27 @@
SamplerState x_10 : register(s0, space0);
Texture2DArray<float4> x_20 : register(t1, space2);
SamplerState x_30 : register(s1, space0);
void main_1() {
float float_var = 0.0f;
const int i1 = 1;
const int2 vi12 = int2(1, 2);
const int3 vi123 = int3(1, 2, 3);
const int4 vi1234 = int4(1, 2, 3, 4);
const uint u1 = 1u;
const uint2 vu12 = uint2(1u, 2u);
const uint3 vu123 = uint3(1u, 2u, 3u);
const uint4 vu1234 = uint4(1u, 2u, 3u, 4u);
const float f1 = 1.0f;
const float2 vf12 = float2(1.0f, 2.0f);
const float3 vf123 = float3(1.0f, 2.0f, 3.0f);
const float4 vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
const float4 x_73 = x_20.Sample(x_10, float3(vf1234.xy, float(int(vf1234.z))));
const uint x_1000 = 0u;
return;
}
void main() {
main_1();
return;
}

View File

@ -0,0 +1,27 @@
#include <metal_stdlib>
using namespace metal;
void main_1(texture2d_array<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
float float_var = 0.0f;
int const i1 = 1;
int2 const vi12 = int2(1, 2);
int3 const vi123 = int3(1, 2, 3);
int4 const vi1234 = int4(1, 2, 3, 4);
uint const u1 = 1u;
uint2 const vu12 = uint2(1u, 2u);
uint3 const vu123 = uint3(1u, 2u, 3u);
uint4 const vu1234 = uint4(1u, 2u, 3u, 4u);
float const f1 = 1.0f;
float2 const vf12 = float2(1.0f, 2.0f);
float3 const vf123 = float3(1.0f, 2.0f, 3.0f);
float4 const vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
float4 const x_73 = tint_symbol_1.sample(tint_symbol_2, vf1234.xy, int(vf1234.z));
uint const x_1000 = 0u;
return;
}
fragment void tint_symbol(texture2d_array<float, access::sample> tint_symbol_3 [[texture(1)]], sampler tint_symbol_4 [[sampler(0)]]) {
main_1(tint_symbol_3, tint_symbol_4);
return;
}

View File

@ -0,0 +1,88 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 64
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %x_10 "x_10"
OpName %x_20 "x_20"
OpName %x_30 "x_30"
OpName %main_1 "main_1"
OpName %float_var "float_var"
OpName %main "main"
OpDecorate %x_10 DescriptorSet 0
OpDecorate %x_10 Binding 0
OpDecorate %x_20 DescriptorSet 2
OpDecorate %x_20 Binding 1
OpDecorate %x_30 DescriptorSet 0
OpDecorate %x_30 Binding 1
%3 = OpTypeSampler
%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
%x_10 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%float = OpTypeFloat 32
%6 = OpTypeImage %float 2D 0 1 0 1 Unknown
%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6
%x_20 = OpVariable %_ptr_UniformConstant_6 UniformConstant
%x_30 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%void = OpTypeVoid
%9 = OpTypeFunction %void
%_ptr_Function_float = OpTypePointer Function %float
%15 = OpConstantNull %float
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
%int_2 = OpConstant %int 2
%20 = OpConstantComposite %v2int %int_1 %int_2
%v3int = OpTypeVector %int 3
%int_3 = OpConstant %int 3
%23 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%v4int = OpTypeVector %int 4
%int_4 = OpConstant %int 4
%26 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%v2uint = OpTypeVector %uint 2
%uint_2 = OpConstant %uint 2
%31 = OpConstantComposite %v2uint %uint_1 %uint_2
%v3uint = OpTypeVector %uint 3
%uint_3 = OpConstant %uint 3
%34 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%v4uint = OpTypeVector %uint 4
%uint_4 = OpConstant %uint 4
%37 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%float_1 = OpConstant %float 1
%v2float = OpTypeVector %float 2
%float_2 = OpConstant %float 2
%41 = OpConstantComposite %v2float %float_1 %float_2
%v3float = OpTypeVector %float 3
%float_3 = OpConstant %float 3
%44 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%v4float = OpTypeVector %float 4
%float_4 = OpConstant %float 4
%47 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%51 = OpTypeSampledImage %6
%uint_0 = OpConstant %uint 0
%main_1 = OpFunction %void None %9
%12 = OpLabel
%float_var = OpVariable %_ptr_Function_float Function %15
%49 = OpLoad %3 %x_10
%50 = OpLoad %6 %x_20
%52 = OpSampledImage %51 %50 %49
%53 = OpVectorShuffle %v2float %47 %47 0 1
%54 = OpCompositeExtract %float %53 0
%55 = OpCompositeExtract %float %53 1
%58 = OpCompositeExtract %float %47 2
%57 = OpConvertFToS %int %58
%56 = OpConvertSToF %float %57
%59 = OpCompositeConstruct %v3float %54 %55 %56
%48 = OpImageSampleImplicitLod %v4float %52 %59
OpReturn
OpFunctionEnd
%main = OpFunction %void None %9
%62 = OpLabel
%63 = OpFunctionCall %void %main_1
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,29 @@
[[group(0), binding(0)]] var x_10 : sampler;
[[group(2), binding(1)]] var x_20 : texture_2d_array<f32>;
[[group(0), binding(1)]] var x_30 : sampler;
fn main_1() {
var float_var : f32;
let i1 : i32 = 1;
let vi12 : vec2<i32> = vec2<i32>(1, 2);
let vi123 : vec3<i32> = vec3<i32>(1, 2, 3);
let vi1234 : vec4<i32> = vec4<i32>(1, 2, 3, 4);
let u1 : u32 = 1u;
let vu12 : vec2<u32> = vec2<u32>(1u, 2u);
let vu123 : vec3<u32> = vec3<u32>(1u, 2u, 3u);
let vu1234 : vec4<u32> = vec4<u32>(1u, 2u, 3u, 4u);
let f1 : f32 = 1.0;
let vf12 : vec2<f32> = vec2<f32>(1.0, 2.0);
let vf123 : vec3<f32> = vec3<f32>(1.0, 2.0, 3.0);
let vf1234 : vec4<f32> = vec4<f32>(1.0, 2.0, 3.0, 4.0);
let x_73 : vec4<f32> = textureSample(x_20, x_10, vf1234.xy, i32(vf1234.z));
let x_1000 : u32 = 0u;
return;
}
[[stage(fragment)]]
fn main() {
main_1();
}

View File

@ -0,0 +1,112 @@
; Test: Good_2D_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_0.spvasm
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 1001
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical Simple
OpEntryPoint Fragment %100 "main"
OpExecutionMode %100 OriginUpperLeft
OpName %float_var "float_var"
OpName %ptr_float "ptr_float"
OpName %i1 "i1"
OpName %vi12 "vi12"
OpName %vi123 "vi123"
OpName %vi1234 "vi1234"
OpName %u1 "u1"
OpName %vu12 "vu12"
OpName %vu123 "vu123"
OpName %vu1234 "vu1234"
OpName %f1 "f1"
OpName %vf12 "vf12"
OpName %vf123 "vf123"
OpName %vf1234 "vf1234"
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
OpDecorate %20 DescriptorSet 2
OpDecorate %20 Binding 1
OpDecorate %30 DescriptorSet 0
OpDecorate %30 Binding 1
%void = OpTypeVoid
%17 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_3 = OpConstant %uint 3
%uint_4 = OpConstant %uint 4
%uint_100 = OpConstant %uint 100
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%v4int = OpTypeVector %int 4
%v2uint = OpTypeVector %uint 2
%v3uint = OpTypeVector %uint 3
%v4uint = OpTypeVector %uint 4
%v2float = OpTypeVector %float 2
%v3float = OpTypeVector %float 3
%v4float = OpTypeVector %float 4
%43 = OpConstantNull %float
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%float_7 = OpConstant %float 7
%50 = OpConstantNull %v2float
%51 = OpConstantNull %v3float
%52 = OpConstantNull %v4float
%53 = OpConstantComposite %v2int %int_1 %int_2
%54 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%55 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%56 = OpConstantComposite %v2uint %uint_1 %uint_2
%57 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%58 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%59 = OpConstantComposite %v2float %float_1 %float_2
%60 = OpConstantComposite %v2float %float_2 %float_1
%61 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%62 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%float_0_200000003 = OpConstant %float 0.200000003
%64 = OpTypeSampler
%_ptr_UniformConstant_64 = OpTypePointer UniformConstant %64
%66 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_66 = OpTypePointer UniformConstant %66
%68 = OpTypeSampledImage %66
%ptr_float = OpTypePointer Function %float
%10 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%20 = OpVariable %_ptr_UniformConstant_66 UniformConstant
%30 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%100 = OpFunction %void None %17
%69 = OpLabel
%float_var = OpVariable %ptr_float Function
%i1 = OpCopyObject %int %int_1
%vi12 = OpCopyObject %v2int %53
%vi123 = OpCopyObject %v3int %54
%vi1234 = OpCopyObject %v4int %55
%u1 = OpCopyObject %uint %uint_1
%vu12 = OpCopyObject %v2uint %56
%vu123 = OpCopyObject %v3uint %57
%vu1234 = OpCopyObject %v4uint %58
%f1 = OpCopyObject %float %float_1
%vf12 = OpCopyObject %v2float %59
%vf123 = OpCopyObject %v3float %61
%vf1234 = OpCopyObject %v4float %62
%70 = OpLoad %64 %10
%71 = OpLoad %66 %20
%72 = OpSampledImage %68 %71 %70
%73 = OpImageSampleImplicitLod %v4float %72 %vf12
%1000 = OpCopyObject %uint %uint_0
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,27 @@
SamplerState x_10 : register(s0, space0);
Texture2D<float4> x_20 : register(t1, space2);
SamplerState x_30 : register(s1, space0);
void main_1() {
float float_var = 0.0f;
const int i1 = 1;
const int2 vi12 = int2(1, 2);
const int3 vi123 = int3(1, 2, 3);
const int4 vi1234 = int4(1, 2, 3, 4);
const uint u1 = 1u;
const uint2 vu12 = uint2(1u, 2u);
const uint3 vu123 = uint3(1u, 2u, 3u);
const uint4 vu1234 = uint4(1u, 2u, 3u, 4u);
const float f1 = 1.0f;
const float2 vf12 = float2(1.0f, 2.0f);
const float3 vf123 = float3(1.0f, 2.0f, 3.0f);
const float4 vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
const float4 x_73 = x_20.Sample(x_10, vf12);
const uint x_1000 = 0u;
return;
}
void main() {
main_1();
return;
}

View File

@ -0,0 +1,27 @@
#include <metal_stdlib>
using namespace metal;
void main_1(texture2d<float, access::sample> tint_symbol_1, sampler tint_symbol_2) {
float float_var = 0.0f;
int const i1 = 1;
int2 const vi12 = int2(1, 2);
int3 const vi123 = int3(1, 2, 3);
int4 const vi1234 = int4(1, 2, 3, 4);
uint const u1 = 1u;
uint2 const vu12 = uint2(1u, 2u);
uint3 const vu123 = uint3(1u, 2u, 3u);
uint4 const vu1234 = uint4(1u, 2u, 3u, 4u);
float const f1 = 1.0f;
float2 const vf12 = float2(1.0f, 2.0f);
float3 const vf123 = float3(1.0f, 2.0f, 3.0f);
float4 const vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
float4 const x_73 = tint_symbol_1.sample(tint_symbol_2, vf12);
uint const x_1000 = 0u;
return;
}
fragment void tint_symbol(texture2d<float, access::sample> tint_symbol_3 [[texture(1)]], sampler tint_symbol_4 [[sampler(0)]]) {
main_1(tint_symbol_3, tint_symbol_4);
return;
}

View File

@ -0,0 +1,81 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 57
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main"
OpExecutionMode %main OriginUpperLeft
OpName %x_10 "x_10"
OpName %x_20 "x_20"
OpName %x_30 "x_30"
OpName %main_1 "main_1"
OpName %float_var "float_var"
OpName %main "main"
OpDecorate %x_10 DescriptorSet 0
OpDecorate %x_10 Binding 0
OpDecorate %x_20 DescriptorSet 2
OpDecorate %x_20 Binding 1
OpDecorate %x_30 DescriptorSet 0
OpDecorate %x_30 Binding 1
%3 = OpTypeSampler
%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3
%x_10 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%float = OpTypeFloat 32
%6 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_6 = OpTypePointer UniformConstant %6
%x_20 = OpVariable %_ptr_UniformConstant_6 UniformConstant
%x_30 = OpVariable %_ptr_UniformConstant_3 UniformConstant
%void = OpTypeVoid
%9 = OpTypeFunction %void
%_ptr_Function_float = OpTypePointer Function %float
%15 = OpConstantNull %float
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%v2int = OpTypeVector %int 2
%int_2 = OpConstant %int 2
%20 = OpConstantComposite %v2int %int_1 %int_2
%v3int = OpTypeVector %int 3
%int_3 = OpConstant %int 3
%23 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%v4int = OpTypeVector %int 4
%int_4 = OpConstant %int 4
%26 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%uint = OpTypeInt 32 0
%uint_1 = OpConstant %uint 1
%v2uint = OpTypeVector %uint 2
%uint_2 = OpConstant %uint 2
%31 = OpConstantComposite %v2uint %uint_1 %uint_2
%v3uint = OpTypeVector %uint 3
%uint_3 = OpConstant %uint 3
%34 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%v4uint = OpTypeVector %uint 4
%uint_4 = OpConstant %uint 4
%37 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%float_1 = OpConstant %float 1
%v2float = OpTypeVector %float 2
%float_2 = OpConstant %float 2
%41 = OpConstantComposite %v2float %float_1 %float_2
%v3float = OpTypeVector %float 3
%float_3 = OpConstant %float 3
%44 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%v4float = OpTypeVector %float 4
%float_4 = OpConstant %float 4
%47 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%51 = OpTypeSampledImage %6
%uint_0 = OpConstant %uint 0
%main_1 = OpFunction %void None %9
%12 = OpLabel
%float_var = OpVariable %_ptr_Function_float Function %15
%49 = OpLoad %3 %x_10
%50 = OpLoad %6 %x_20
%52 = OpSampledImage %51 %50 %49
%48 = OpImageSampleImplicitLod %v4float %52 %41
OpReturn
OpFunctionEnd
%main = OpFunction %void None %9
%55 = OpLabel
%56 = OpFunctionCall %void %main_1
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,29 @@
[[group(0), binding(0)]] var x_10 : sampler;
[[group(2), binding(1)]] var x_20 : texture_2d<f32>;
[[group(0), binding(1)]] var x_30 : sampler;
fn main_1() {
var float_var : f32;
let i1 : i32 = 1;
let vi12 : vec2<i32> = vec2<i32>(1, 2);
let vi123 : vec3<i32> = vec3<i32>(1, 2, 3);
let vi1234 : vec4<i32> = vec4<i32>(1, 2, 3, 4);
let u1 : u32 = 1u;
let vu12 : vec2<u32> = vec2<u32>(1u, 2u);
let vu123 : vec3<u32> = vec3<u32>(1u, 2u, 3u);
let vu1234 : vec4<u32> = vec4<u32>(1u, 2u, 3u, 4u);
let f1 : f32 = 1.0;
let vf12 : vec2<f32> = vec2<f32>(1.0, 2.0);
let vf123 : vec3<f32> = vec3<f32>(1.0, 2.0, 3.0);
let vf1234 : vec4<f32> = vec4<f32>(1.0, 2.0, 3.0, 4.0);
let x_73 : vec4<f32> = textureSample(x_20, x_10, vf12);
let x_1000 : u32 = 0u;
return;
}
[[stage(fragment)]]
fn main() {
main_1();
}

View File

@ -0,0 +1,112 @@
; Test: Good_2D_SpvParserHandleTest_ImageCoordsTest_MakeCoordinateOperandsForImageAccess_1.spvasm
; SPIR-V
; Version: 1.0
; Generator: Khronos SPIR-V Tools Assembler; 0
; Bound: 1001
; Schema: 0
OpCapability Shader
OpCapability Sampled1D
OpCapability Image1D
OpCapability StorageImageExtendedFormats
OpCapability ImageQuery
OpMemoryModel Logical Simple
OpEntryPoint Fragment %100 "main"
OpExecutionMode %100 OriginUpperLeft
OpName %float_var "float_var"
OpName %ptr_float "ptr_float"
OpName %i1 "i1"
OpName %vi12 "vi12"
OpName %vi123 "vi123"
OpName %vi1234 "vi1234"
OpName %u1 "u1"
OpName %vu12 "vu12"
OpName %vu123 "vu123"
OpName %vu1234 "vu1234"
OpName %f1 "f1"
OpName %vf12 "vf12"
OpName %vf123 "vf123"
OpName %vf1234 "vf1234"
OpDecorate %10 DescriptorSet 0
OpDecorate %10 Binding 0
OpDecorate %20 DescriptorSet 2
OpDecorate %20 Binding 1
OpDecorate %30 DescriptorSet 0
OpDecorate %30 Binding 1
%void = OpTypeVoid
%17 = OpTypeFunction %void
%float = OpTypeFloat 32
%uint = OpTypeInt 32 0
%int = OpTypeInt 32 1
%int_0 = OpConstant %int 0
%int_1 = OpConstant %int 1
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_4 = OpConstant %int 4
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%uint_3 = OpConstant %uint 3
%uint_4 = OpConstant %uint 4
%uint_100 = OpConstant %uint 100
%v2int = OpTypeVector %int 2
%v3int = OpTypeVector %int 3
%v4int = OpTypeVector %int 4
%v2uint = OpTypeVector %uint 2
%v3uint = OpTypeVector %uint 3
%v4uint = OpTypeVector %uint 4
%v2float = OpTypeVector %float 2
%v3float = OpTypeVector %float 3
%v4float = OpTypeVector %float 4
%43 = OpConstantNull %float
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%float_2 = OpConstant %float 2
%float_3 = OpConstant %float 3
%float_4 = OpConstant %float 4
%float_7 = OpConstant %float 7
%50 = OpConstantNull %v2float
%51 = OpConstantNull %v3float
%52 = OpConstantNull %v4float
%53 = OpConstantComposite %v2int %int_1 %int_2
%54 = OpConstantComposite %v3int %int_1 %int_2 %int_3
%55 = OpConstantComposite %v4int %int_1 %int_2 %int_3 %int_4
%56 = OpConstantComposite %v2uint %uint_1 %uint_2
%57 = OpConstantComposite %v3uint %uint_1 %uint_2 %uint_3
%58 = OpConstantComposite %v4uint %uint_1 %uint_2 %uint_3 %uint_4
%59 = OpConstantComposite %v2float %float_1 %float_2
%60 = OpConstantComposite %v2float %float_2 %float_1
%61 = OpConstantComposite %v3float %float_1 %float_2 %float_3
%62 = OpConstantComposite %v4float %float_1 %float_2 %float_3 %float_4
%float_0_200000003 = OpConstant %float 0.200000003
%64 = OpTypeSampler
%_ptr_UniformConstant_64 = OpTypePointer UniformConstant %64
%66 = OpTypeImage %float 2D 0 0 0 1 Unknown
%_ptr_UniformConstant_66 = OpTypePointer UniformConstant %66
%68 = OpTypeSampledImage %66
%ptr_float = OpTypePointer Function %float
%10 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%20 = OpVariable %_ptr_UniformConstant_66 UniformConstant
%30 = OpVariable %_ptr_UniformConstant_64 UniformConstant
%100 = OpFunction %void None %17
%69 = OpLabel
%float_var = OpVariable %ptr_float Function
%i1 = OpCopyObject %int %int_1
%vi12 = OpCopyObject %v2int %53
%vi123 = OpCopyObject %v3int %54
%vi1234 = OpCopyObject %v4int %55
%u1 = OpCopyObject %uint %uint_1
%vu12 = OpCopyObject %v2uint %56
%vu123 = OpCopyObject %v3uint %57
%vu1234 = OpCopyObject %v4uint %58
%f1 = OpCopyObject %float %float_1
%vf12 = OpCopyObject %v2float %59
%vf123 = OpCopyObject %v3float %61
%vf1234 = OpCopyObject %v4float %62
%70 = OpLoad %64 %10
%71 = OpLoad %66 %20
%72 = OpSampledImage %68 %71 %70
%73 = OpImageSampleImplicitLod %v4float %72 %vf123
%1000 = OpCopyObject %uint %uint_0
OpReturn
OpFunctionEnd

View File

@ -0,0 +1,27 @@
SamplerState x_10 : register(s0, space0);
Texture2D<float4> x_20 : register(t1, space2);
SamplerState x_30 : register(s1, space0);
void main_1() {
float float_var = 0.0f;
const int i1 = 1;
const int2 vi12 = int2(1, 2);
const int3 vi123 = int3(1, 2, 3);
const int4 vi1234 = int4(1, 2, 3, 4);
const uint u1 = 1u;
const uint2 vu12 = uint2(1u, 2u);
const uint3 vu123 = uint3(1u, 2u, 3u);
const uint4 vu1234 = uint4(1u, 2u, 3u, 4u);
const float f1 = 1.0f;
const float2 vf12 = float2(1.0f, 2.0f);
const float3 vf123 = float3(1.0f, 2.0f, 3.0f);
const float4 vf1234 = float4(1.0f, 2.0f, 3.0f, 4.0f);
const float4 x_73 = x_20.Sample(x_10, vf123.xy);
const uint x_1000 = 0u;
return;
}
void main() {
main_1();
return;
}

Some files were not shown because too many files have changed in this diff Show More