[lit][SPIRV] convert runFileTest shaders to lit FileCheck test (36 left to go) (#6065)
Convert from bottom of CodeGenSpirvTest.cpp Skipped FileTest::CompatibilityWithVk1p1 as barrier for runCodeTest.
This commit is contained in:
Коммит
14b0da7b2e
|
@ -1,23 +0,0 @@
|
|||
// RUN: %dxc -T ps_6_0 -E main -fspv-target-env=universal1.5
|
||||
|
||||
struct Foo {
|
||||
float4 a;
|
||||
int2 b;
|
||||
};
|
||||
|
||||
// CHECK: [[s01:%\w+]] = OpTypeStruct %v4float %v2int
|
||||
// CHECK: [[s02:%\w+]] = OpTypeArray [[s01]] %uint_3
|
||||
// CHECK: [[s03:%\w+]] = OpTypeArray [[s02]] %uint_2
|
||||
// CHECK: [[s04:%\w+]] = OpTypePointer Uniform [[s03]]
|
||||
ConstantBuffer<Foo> myCB2[2][3] : register(b0, space1);
|
||||
|
||||
struct VSOutput {
|
||||
float2 TexCoord : TEXCOORD;
|
||||
};
|
||||
|
||||
float4 main(VSOutput input) : SV_TARGET {
|
||||
// CHECK: [[s05:%\w+]] = OpTypePointer Uniform %v4float
|
||||
// CHECK: [[s06:%\w+]] = OpVariable [[s04:%\w+]] Uniform
|
||||
// CHECK: OpAccessChain [[s05]] [[s06]] %int_1 %int_0 %int_0
|
||||
return float4(1.0, 1.0, 1.0, 1.0) * myCB2[1][0].a;
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
// RUN: %dxc -T cs_6_0 -E main
|
||||
|
||||
// CHECK: {{%\d+}} = OpString "first string"
|
||||
string first = "first string";
|
||||
// CHECK: {{%\d+}} = OpString "second string"
|
||||
string second = "second string";
|
||||
// CHECK: {{%\d+}} = OpString "third string"
|
||||
const string third = "third string";
|
||||
// CHECK-NOT: {{%\d+}} = OpString "first string"
|
||||
const string a = "first string";
|
||||
|
||||
[numthreads(1,1,1)]
|
||||
void main() {
|
||||
}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
// RUN: %dxc -T ps_6_2 -E PSMain
|
||||
// RUN: %dxc -T ps_6_2 -E PSMain -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
// The value for the enum is stored in a variable, which will be optimized
|
||||
// away when optimizations are enabled.
|
||||
// CHECK: [[enum_var:%\w+]] = OpVariable %_ptr_Private_int Private %int_1
|
||||
// CHECK: [[enum_var:%[a-zA-Z0-9_]+]] = OpVariable %_ptr_Private_int Private %int_1
|
||||
struct TestStruct {
|
||||
enum EnumInTestStruct {
|
||||
A = 1,
|
||||
|
@ -11,7 +11,7 @@ struct TestStruct {
|
|||
|
||||
// CHECK: %testFunc = OpFunction %int
|
||||
// CHECK-NEXT: OpLabel
|
||||
// CHECK-NEXT: [[ld:%\w+]] = OpLoad %int [[enum_var]]
|
||||
// CHECK-NEXT: [[ld:%[a-zA-Z0-9_]+]] = OpLoad %int [[enum_var]]
|
||||
// CHECK-NEXT: OpReturnValue [[ld]]
|
||||
TestStruct::EnumInTestStruct testFunc() {
|
||||
return TestStruct::A;
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %dxc -T vs_6_0 -E main
|
||||
// RUN: %dxc -T vs_6_0 -E main -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
// CHECK: %_arr_uint_uint_4 = OpTypeArray %uint %uint_4
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %dxc -T ps_6_0 -E main
|
||||
// RUN: %dxc -T ps_6_0 -E main -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
// CHECK: OpCapability SampledBuffer
|
||||
// CHECK: OpCapability StorageImageExtendedFormats
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %dxc -T vs_6_0 -E main
|
||||
// RUN: %dxc -T vs_6_0 -E main -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
// CHECK: OpName %type_MyCbuffer "type.MyCbuffer"
|
||||
// CHECK-NEXT: OpMemberName %type_MyCbuffer 0 "a"
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %dxc -T ps_6_0 -E main
|
||||
// RUN: %dxc -T ps_6_0 -E main -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
// CHECK-NOT: OpDecorate %buf3
|
||||
|
||||
|
@ -42,19 +42,19 @@ cbuffer buf3 : register(b2) {
|
|||
}
|
||||
|
||||
float4 main(float2 uv : TEXCOORD) : SV_TARGET {
|
||||
// CHECK: [[ptr_x:%\d+]] = OpAccessChain %_ptr_Uniform_v4float %buf2 %int_0
|
||||
// CHECK: [[x:%\d+]] = OpLoad %v4float [[ptr_x]]
|
||||
// CHECK: [[ptr_x:%[0-9]+]] = OpAccessChain %_ptr_Uniform_v4float %buf2 %int_0
|
||||
// CHECK: [[x:%[0-9]+]] = OpLoad %v4float [[ptr_x]]
|
||||
|
||||
// CHECK: [[y:%\d+]] = OpLoad %type_2d_image %y
|
||||
// CHECK: [[z:%\d+]] = OpLoad %type_sampler %z
|
||||
// CHECK: [[yz:%\d+]] = OpSampledImage %type_sampled_image [[y]] [[z]]
|
||||
// CHECK: [[sample0:%\d+]] = OpImageSampleImplicitLod %v4float [[yz]]
|
||||
// CHECK: [[add0:%\d+]] = OpFAdd %v4float [[x]] [[sample0]]
|
||||
// CHECK: [[y:%[0-9]+]] = OpLoad %type_2d_image %y
|
||||
// CHECK: [[z:%[0-9]+]] = OpLoad %type_sampler %z
|
||||
// CHECK: [[yz:%[0-9]+]] = OpSampledImage %type_sampled_image [[y]] [[z]]
|
||||
// CHECK: [[sample0:%[0-9]+]] = OpImageSampleImplicitLod %v4float [[yz]]
|
||||
// CHECK: [[add0:%[0-9]+]] = OpFAdd %v4float [[x]] [[sample0]]
|
||||
|
||||
// CHECK: [[y:%\d+]] = OpLoad %type_2d_image %y
|
||||
// CHECK: [[w:%\d+]] = OpLoad %type_sampler %w
|
||||
// CHECK: [[yw:%\d+]] = OpSampledImage %type_sampled_image [[y]] [[w]]
|
||||
// CHECK: [[sample1:%\d+]] = OpImageSampleImplicitLod %v4float [[yw]]
|
||||
// CHECK: [[y_0:%[0-9]+]] = OpLoad %type_2d_image %y
|
||||
// CHECK: [[w:%[0-9]+]] = OpLoad %type_sampler %w
|
||||
// CHECK: [[yw:%[0-9]+]] = OpSampledImage %type_sampled_image [[y_0]] [[w]]
|
||||
// CHECK: [[sample1:%[0-9]+]] = OpImageSampleImplicitLod %v4float [[yw]]
|
||||
// CHECK: OpFAdd %v4float [[add0]] [[sample1]]
|
||||
return x + y.Sample(z, uv) + y.Sample(w, uv);
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %dxc -T vs_6_0 -E main
|
||||
// RUN: %dxc -T vs_6_0 -E main -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
// CHECK: OpName %N "N"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %dxc -T vs_6_0 -E main
|
||||
// RUN: %dxc -T vs_6_0 -E main -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
// CHECK: OpName %type_ConstantBuffer_S "type.ConstantBuffer.S"
|
||||
// CHECK-NEXT: OpMemberName %type_ConstantBuffer_S 0 "someFloat"
|
||||
|
@ -24,7 +24,7 @@ void main()
|
|||
{
|
||||
// CHECK: %local = OpVariable %_ptr_Function_type_ConstantBuffer_S Function
|
||||
|
||||
// CHECK: [[val:%\d+]] = OpLoad %type_ConstantBuffer_S %buffer
|
||||
// CHECK: [[val:%[0-9]+]] = OpLoad %type_ConstantBuffer_S %buffer
|
||||
// CHECK: OpStore %local [[val]]
|
||||
ConstantBuffer<S> local;
|
||||
local = buffer;
|
|
@ -1,15 +1,15 @@
|
|||
// RUN: %dxc -T vs_6_0 -E main
|
||||
// RUN: %dxc -T vs_6_0 -E main -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
// Used for ConstantBuffer definition.
|
||||
// CHECK: [[type_CB_PerDraw:%\w+]] = OpTypeStruct %mat4v4float
|
||||
// CHECK: [[type_CB_PerDraw:%[a-zA-Z0-9_]+]] = OpTypeStruct %mat4v4float
|
||||
// Used for PerDraw local variable.
|
||||
// CHECK: [[type_PerDraw:%\w+]] = OpTypeStruct %mat4v4float
|
||||
// CHECK: [[type_PerDraw:%[a-zA-Z0-9_]+]] = OpTypeStruct %mat4v4float
|
||||
|
||||
struct PerDraw {
|
||||
float4x4 Transform;
|
||||
};
|
||||
|
||||
// CHECK: [[ptr_type_CB_PerDraw:%\w+]] = OpTypePointer Uniform [[type_CB_PerDraw]]
|
||||
// CHECK: [[ptr_type_CB_PerDraw:%[a-zA-Z0-9_]+]] = OpTypePointer Uniform [[type_CB_PerDraw]]
|
||||
// Used for ConstantBuffer to PerDraw type cast.
|
||||
|
||||
|
||||
|
@ -23,9 +23,9 @@ struct VSInput {
|
|||
};
|
||||
|
||||
float4 main(in VSInput input) : SV_POSITION {
|
||||
// CHECK: [[ptr:%\w+]] = OpAccessChain [[ptr_type_CB_PerDraw]] %PerDraws
|
||||
// CHECK: [[cb_PerDraw:%\w+]] = OpLoad [[type_CB_PerDraw]] [[ptr]]
|
||||
// CHECK: [[float4x4:%\w+]] = OpCompositeExtract %mat4v4float [[cb_PerDraw]] 0
|
||||
// CHECK: [[ptr:%[a-zA-Z0-9_]+]] = OpAccessChain [[ptr_type_CB_PerDraw]] %PerDraws
|
||||
// CHECK: [[cb_PerDraw:%[a-zA-Z0-9_]+]] = OpLoad [[type_CB_PerDraw]] [[ptr]]
|
||||
// CHECK: [[float4x4:%[a-zA-Z0-9_]+]] = OpCompositeExtract %mat4v4float [[cb_PerDraw]] 0
|
||||
// CHECK: OpCompositeConstruct [[type_PerDraw]] [[float4x4]]
|
||||
const PerDraw perDraw = PerDraws[input.DrawIdx];
|
||||
return mul(float4(input.Position, 1.0f), perDraw.Transform);
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %dxc -T vs_6_0 -E main
|
||||
// RUN: %dxc -T vs_6_0 -E main -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
// CHECK: OpName %type_ConstantBuffer_T "type.ConstantBuffer.T"
|
||||
// CHECK-NEXT: OpMemberName %type_ConstantBuffer_T 0 "a"
|
|
@ -0,0 +1,23 @@
|
|||
// RUN: %dxc -T ps_6_0 -E main -fspv-target-env=universal1.5 -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
struct Foo {
|
||||
float4 a;
|
||||
int2 b;
|
||||
};
|
||||
|
||||
// CHECK: [[s01:%[a-zA-Z0-9_]+]] = OpTypeStruct %v4float %v2int
|
||||
// CHECK: [[s02:%[a-zA-Z0-9_]+]] = OpTypeArray [[s01]] %uint_3
|
||||
// CHECK: [[s03:%[a-zA-Z0-9_]+]] = OpTypeArray [[s02]] %uint_2
|
||||
// CHECK: [[s04:%[a-zA-Z0-9_]+]] = OpTypePointer Uniform [[s03]]
|
||||
ConstantBuffer<Foo> myCB2[2][3] : register(b0, space1);
|
||||
|
||||
struct VSOutput {
|
||||
float2 TexCoord : TEXCOORD;
|
||||
};
|
||||
|
||||
float4 main(VSOutput input) : SV_TARGET {
|
||||
// CHECK: [[s05:%[a-zA-Z0-9_]+]] = OpTypePointer Uniform %v4float
|
||||
// CHECK: [[s06:%[a-zA-Z0-9_]+]] = OpVariable [[s04_0:%[a-zA-Z0-9_]+]] Uniform
|
||||
// CHECK: OpAccessChain [[s05]] [[s06]] %int_1 %int_0 %int_0
|
||||
return float4(1.0, 1.0, 1.0, 1.0) * myCB2[1][0].a;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %dxc -T vs_6_0 -E main
|
||||
// RUN: %dxc -T vs_6_0 -E main -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
// CHECK: OpName %type_ConstantBuffer_S "type.ConstantBuffer.S"
|
||||
// CHECK-NEXT: OpMemberName %type_ConstantBuffer_S 0 "someFloat"
|
||||
|
@ -17,7 +17,7 @@ struct S
|
|||
// CHECK: %_runtimearr_type_ConstantBuffer_S = OpTypeRuntimeArray %type_ConstantBuffer_S
|
||||
// CHECK: %_ptr_Uniform__runtimearr_type_ConstantBuffer_S = OpTypePointer Uniform %_runtimearr_type_ConstantBuffer_S
|
||||
|
||||
// CHECK: [[fnType:%\d+]] = OpTypeFunction %type_ConstantBuffer_S %_ptr_Function_uint
|
||||
// CHECK: [[fnType:%[0-9]+]] = OpTypeFunction %type_ConstantBuffer_S %_ptr_Function_uint
|
||||
|
||||
// CHECK: %buffers = OpVariable %_ptr_Uniform__runtimearr_type_ConstantBuffer_S Uniform
|
||||
ConstantBuffer<S> buffers[];
|
||||
|
@ -26,14 +26,14 @@ ConstantBuffer<S> buffers[];
|
|||
ConstantBuffer<S> getBuf(uint indx)
|
||||
{
|
||||
// CHECK-DAG: %temp_var_ret = OpVariable %_ptr_Function_type_ConstantBuffer_S Function
|
||||
// CHECK-DAG: [[bufPtr:%\d+]] = OpAccessChain %_ptr_Uniform_type_ConstantBuffer_S %buffers [[indx:%\d+]]
|
||||
// CHECK-DAG: [[bufVal:%\d+]] = OpLoad %type_ConstantBuffer_S [[bufPtr]]
|
||||
// CHECK-DAG: [[bufPtr:%[0-9]+]] = OpAccessChain %_ptr_Uniform_type_ConstantBuffer_S %buffers [[indx:%[0-9]+]]
|
||||
// CHECK-DAG: [[bufVal:%[0-9]+]] = OpLoad %type_ConstantBuffer_S [[bufPtr]]
|
||||
// CHECK-DAG: OpStore %temp_var_ret [[bufVal]]
|
||||
return buffers[indx];
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
// CHECK-DAG: [[val:%\d+]] = OpFunctionCall %type_ConstantBuffer_S %getBuf %param_var_indx
|
||||
// CHECK-DAG: [[val:%[0-9]+]] = OpFunctionCall %type_ConstantBuffer_S %getBuf %param_var_indx
|
||||
getBuf(1);
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %dxc -T cs_6_0 -E main
|
||||
// RUN: %dxc -T cs_6_0 -E main -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
//CHECK: %First = OpVariable %_ptr_Private_int Private %int_0
|
||||
//CHECK-NEXT: %Second = OpVariable %_ptr_Private_int Private %int_1
|
||||
|
@ -15,7 +15,7 @@ enum Number {
|
|||
//CHECK-NEXT: %b = OpVariable %_ptr_Workgroup_int Workgroup
|
||||
//CHECK-NEXT: %c = OpVariable %_ptr_Uniform_type_AppendStructuredBuffer_ Uniform
|
||||
|
||||
//CHECK: [[second:%\d+]] = OpLoad %int %Second
|
||||
//CHECK: [[second:%[0-9]+]] = OpLoad %int %Second
|
||||
//CHECK-NEXT: OpStore %a [[second]]
|
||||
static ::Number a = Second;
|
||||
groupshared Number b;
|
||||
|
@ -26,26 +26,26 @@ void testParamTypeCast(int param) {}
|
|||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main() {
|
||||
//CHECK: [[a:%\d+]] = OpLoad %int %a
|
||||
//CHECK: [[a:%[0-9]+]] = OpLoad %int %a
|
||||
//CHECK-NEXT: OpStore %foo [[a]]
|
||||
int foo = a;
|
||||
|
||||
//CHECK: [[fourth:%\d+]] = OpLoad %int %Fourth
|
||||
//CHECK: [[fourth:%[0-9]+]] = OpLoad %int %Fourth
|
||||
//CHECK-NEXT: OpStore %b [[fourth]]
|
||||
b = Fourth;
|
||||
|
||||
//CHECK: [[c:%\d+]] = OpAccessChain %_ptr_Uniform_int %c %uint_0
|
||||
//CHECK-NEXT: [[third:%\d+]] = OpLoad %int %Third
|
||||
//CHECK: [[c:%[0-9]+]] = OpAccessChain %_ptr_Uniform_int %c %uint_0
|
||||
//CHECK-NEXT: [[third:%[0-9]+]] = OpLoad %int %Third
|
||||
//CHECK-NEXT: OpStore [[c]] [[third]]
|
||||
c.Append(Third);
|
||||
|
||||
//CHECK: [[c:%\d+]] = OpAccessChain %_ptr_Uniform_int %c %uint_0 %57
|
||||
//CHECK-NEXT: [[third:%\d+]] = OpLoad %int %Third
|
||||
//CHECK-NEXT: OpStore [[c]] [[third]]
|
||||
//CHECK: [[c_0:%[0-9]+]] = OpAccessChain %_ptr_Uniform_int %c %uint_0 %57
|
||||
//CHECK-NEXT: [[third_0:%[0-9]+]] = OpLoad %int %Third
|
||||
//CHECK-NEXT: OpStore [[c_0]] [[third_0]]
|
||||
c.Append(Number::Third);
|
||||
|
||||
Number d;
|
||||
//CHECK: [[d:%\d+]] = OpLoad %int %d
|
||||
//CHECK: [[d:%[0-9]+]] = OpLoad %int %d
|
||||
//CHECK-NEXT: OpSelectionMerge %switch_merge None
|
||||
//CHECK-NEXT: OpSwitch [[d]] %switch_default 0 %switch_0 1 %switch_1
|
||||
switch (d) {
|
||||
|
@ -60,39 +60,39 @@ void main() {
|
|||
break;
|
||||
}
|
||||
|
||||
//CHECK: [[fourth:%\d+]] = OpLoad %int %Fourth
|
||||
//CHECK-NEXT: OpStore %e [[fourth]]
|
||||
//CHECK: [[fourth_0:%[0-9]+]] = OpLoad %int %Fourth
|
||||
//CHECK-NEXT: OpStore %e [[fourth_0]]
|
||||
static ::Number e = Fourth;
|
||||
|
||||
//CHECK: [[d:%\d+]] = OpLoad %int %d
|
||||
//CHECK-NEXT: [[third:%\d+]] = OpLoad %int %Third
|
||||
//CHECK-NEXT: OpSLessThan %bool [[d]] [[third]]
|
||||
//CHECK: [[d_0:%[0-9]+]] = OpLoad %int %d
|
||||
//CHECK-NEXT: [[third_1:%[0-9]+]] = OpLoad %int %Third
|
||||
//CHECK-NEXT: OpSLessThan %bool [[d_0]] [[third_1]]
|
||||
if (d < Third) {
|
||||
//CHECK: [[first:%\d+]] = OpLoad %int %First
|
||||
//CHECK-NEXT: [[second:%\d+]] = OpLoad %int %Second
|
||||
//CHECK-NEXT: [[add:%\d+]] = OpIAdd %int [[first]] [[second]]
|
||||
//CHECK: [[first:%[0-9]+]] = OpLoad %int %First
|
||||
//CHECK-NEXT: [[second_0:%[0-9]+]] = OpLoad %int %Second
|
||||
//CHECK-NEXT: [[add:%[0-9]+]] = OpIAdd %int [[first]] [[second_0]]
|
||||
//CHECK-NEXT: OpStore %d [[add]]
|
||||
d = First + Second;
|
||||
}
|
||||
|
||||
//CHECK: [[foo:%\d+]] = OpLoad %int %foo
|
||||
//CHECK-NEXT: [[foo:%\d+]] = OpBitcast %int [[foo]]
|
||||
//CHECK-NEXT: OpStore %d [[foo]]
|
||||
//CHECK: [[foo:%[0-9]+]] = OpLoad %int %foo
|
||||
//CHECK-NEXT: [[foo_0:%[0-9]+]] = OpBitcast %int [[foo]]
|
||||
//CHECK-NEXT: OpStore %d [[foo_0]]
|
||||
if (First < Third)
|
||||
d = (Number)foo;
|
||||
|
||||
//CHECK: [[a:%\d+]] = OpLoad %int %a
|
||||
//CHECK-NEXT: OpStore %param_var_param [[a]]
|
||||
//CHECK: [[a_0:%[0-9]+]] = OpLoad %int %a
|
||||
//CHECK-NEXT: OpStore %param_var_param [[a_0]]
|
||||
//CHECK-NEXT: OpFunctionCall %void %testParam %param_var_param
|
||||
testParam(a);
|
||||
|
||||
//CHECK: [[second:%\d+]] = OpLoad %int %Second
|
||||
//CHECK-NEXT: OpStore %param_var_param_0 [[second]]
|
||||
//CHECK: [[second_1:%[0-9]+]] = OpLoad %int %Second
|
||||
//CHECK-NEXT: OpStore %param_var_param_0 [[second_1]]
|
||||
//CHECK-NEXT: OpFunctionCall %void %testParam %param_var_param_0
|
||||
testParam(Second);
|
||||
|
||||
//CHECK: [[a:%\d+]] = OpLoad %int %a
|
||||
//CHECK-NEXT: OpStore %param_var_param_1 [[a]]
|
||||
//CHECK: [[a_1:%[0-9]+]] = OpLoad %int %a
|
||||
//CHECK-NEXT: OpStore %param_var_param_1 [[a_1]]
|
||||
//CHECK-NEXT: OpFunctionCall %void %testParamTypeCast %param_var_param_1
|
||||
testParamTypeCast(a);
|
||||
|
||||
|
@ -100,9 +100,9 @@ void main() {
|
|||
//CHECK-NEXT: OpFunctionCall %void %testParamTypeCast %param_var_param_2
|
||||
testParamTypeCast(Second);
|
||||
|
||||
//CHECK: [[a:%\d+]] = OpLoad %int %a
|
||||
//CHECK-NEXT: [[a:%\d+]] = OpBitcast %float [[a]]
|
||||
//CHECK-NEXT: [[sin:%\d+]] = OpExtInst %float {{%\d+}} Sin [[a]]
|
||||
//CHECK: [[a_2:%[0-9]+]] = OpLoad %int %a
|
||||
//CHECK-NEXT: [[a_3:%[0-9]+]] = OpBitcast %float [[a_2]]
|
||||
//CHECK-NEXT: [[sin:%[0-9]+]] = OpExtInst %float {{%[0-9]+}} Sin [[a_3]]
|
||||
//CHECK-NEXT: OpStore %bar [[sin]]
|
||||
float bar = sin(a);
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %dxc -T ps_6_0 -E main
|
||||
// RUN: %dxc -T ps_6_0 -E main -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
// CHECK: OpCapability RuntimeDescriptorArray
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %dxc -T cs_6_0 -E main
|
||||
// RUN: %dxc -T cs_6_0 -E main -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
// CHECK: %type_buffer_image = OpTypeImage %float Buffer 2 0 0 2 Rgba16f
|
||||
// CHECK: %_ptr_UniformConstant_type_buffer_image = OpTypePointer UniformConstant %type_buffer_image
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %dxc -T vs_6_0 -E main
|
||||
// RUN: %dxc -T vs_6_0 -E main -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
// CHECK: OpCapability Image1D
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %dxc -T cs_6_0 -E main
|
||||
// RUN: %dxc -T cs_6_0 -E main -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
// CHECK: %type_2d_image = OpTypeImage %ulong 2D 2 0 0 2 R64ui
|
||||
// CHECK: %_ptr_UniformConstant_type_2d_image = OpTypePointer UniformConstant %type_2d_image
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %dxc -T cs_6_0 -E main
|
||||
// RUN: %dxc -T cs_6_0 -E main -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
// CHECK: %type_2d_image = OpTypeImage %float 2D 2 0 0 2 Rgba16f
|
||||
// CHECK: %_ptr_UniformConstant_type_2d_image = OpTypePointer UniformConstant %type_2d_image
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %dxc -T vs_6_0 -E main
|
||||
// RUN: %dxc -T vs_6_0 -E main -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
// CHECK: %type_sampler = OpTypeSampler
|
||||
// CHECK: %_ptr_UniformConstant_type_sampler = OpTypePointer UniformConstant %type_sampler
|
|
@ -0,0 +1,15 @@
|
|||
// RUN: %dxc -T cs_6_0 -E main -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
// CHECK: {{%[0-9]+}} = OpString "first string"
|
||||
string first = "first string";
|
||||
// CHECK: {{%[0-9]+}} = OpString "second string"
|
||||
string second = "second string";
|
||||
// CHECK: {{%[0-9]+}} = OpString "third string"
|
||||
const string third = "third string";
|
||||
// CHECK-NOT: {{%[0-9]+}} = OpString "first string"
|
||||
const string a = "first string";
|
||||
|
||||
[numthreads(1,1,1)]
|
||||
void main() {
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %dxc -T ps_6_0 -E main -fspv-reflect
|
||||
// RUN: %dxc -T ps_6_0 -E main -fspv-reflect -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
// CHECK: OpExtension "SPV_GOOGLE_hlsl_functionality1"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %dxc -T ps_6_0 -E main
|
||||
// RUN: %dxc -T ps_6_0 -E main -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
// CHECK: OpDecorate %_runtimearr_v3uint ArrayStride 16
|
||||
// CHECK: OpDecorate %type_StructuredBuffer_v3uint BufferBlock
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %dxc -T vs_6_0 -E main
|
||||
// RUN: %dxc -T vs_6_0 -E main -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
// CHECK: OpName %type_MyTbuffer "type.MyTbuffer"
|
||||
// CHECK-NEXT: OpMemberName %type_MyTbuffer 0 "a"
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %dxc -T vs_6_0 -E main
|
||||
// RUN: %dxc -T vs_6_0 -E main -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
// CHECK: OpName %type_TextureBuffer_T "type.TextureBuffer.T"
|
||||
// CHECK-NEXT: OpMemberName %type_TextureBuffer_T 0 "a"
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %dxc -T vs_6_0 -E main
|
||||
// RUN: %dxc -T vs_6_0 -E main -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
// CHECK: OpCapability Sampled1D
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %dxc -T vs_6_0 -E main
|
||||
// RUN: %dxc -T vs_6_0 -E main -fcgl %s -spirv | FileCheck %s
|
||||
|
||||
typedef int myInt;
|
||||
typedef const uint myConstUint;
|
|
@ -24,54 +24,6 @@ TEST_F(FileTest, StructTypeEmptyStructArrayStride) {
|
|||
TEST_F(FileTest, StructTypeUniqueness) {
|
||||
runFileTest("type.struct.uniqueness.hlsl");
|
||||
}
|
||||
TEST_F(FileTest, StringTypes) { runFileTest("type.string.hlsl"); }
|
||||
TEST_F(FileTest, ClassTypes) { runFileTest("type.class.hlsl"); }
|
||||
TEST_F(FileTest, ArrayTypes) { runFileTest("type.array.hlsl"); }
|
||||
TEST_F(FileTest, RuntimeArrayTypes) { runFileTest("type.runtime-array.hlsl"); }
|
||||
TEST_F(FileTest, TypedefTypes) { runFileTest("type.typedef.hlsl"); }
|
||||
TEST_F(FileTest, SamplerTypes) { runFileTest("type.sampler.hlsl"); }
|
||||
TEST_F(FileTest, TextureTypes) { runFileTest("type.texture.hlsl"); }
|
||||
TEST_F(FileTest, RWTextureTypes) { runFileTest("type.rwtexture.hlsl"); }
|
||||
TEST_F(FileTest, RWTextureTypesWithMinPrecisionScalarTypes) {
|
||||
runFileTest("type.rwtexture.with.min.precision.scalar.hlsl");
|
||||
}
|
||||
TEST_F(FileTest, RWTextureTypesWith64bitsScalarTypes) {
|
||||
runFileTest("type.rwtexture.with.64bit.scalar.hlsl");
|
||||
}
|
||||
TEST_F(FileTest, BufferType) { runFileTest("type.buffer.hlsl"); }
|
||||
|
||||
TEST_F(FileTest, RWBufferTypeHalfElementType) {
|
||||
runFileTest("type.rwbuffer.half.hlsl");
|
||||
}
|
||||
TEST_F(FileTest, CBufferType) { runFileTest("type.cbuffer.hlsl"); }
|
||||
TEST_F(FileTest, TypeCBufferIncludingResource) {
|
||||
runFileTest("type.cbuffer.including.resource.hlsl");
|
||||
}
|
||||
TEST_F(FileTest, ConstantBufferType) {
|
||||
runFileTest("type.constant-buffer.hlsl");
|
||||
}
|
||||
TEST_F(FileTest, ConstantBufferTypeAssign) {
|
||||
runFileTest("type.constant-buffer.assign.hlsl");
|
||||
}
|
||||
TEST_F(FileTest, ConstantBufferTypeReturn) {
|
||||
runFileTest("type.constant-buffer.return.hlsl");
|
||||
}
|
||||
TEST_F(FileTest, ConstantBufferTypeMultiDimensionalArray) {
|
||||
runFileTest("type.constant-buffer.multiple-dimensions.hlsl");
|
||||
}
|
||||
TEST_F(FileTest, BindlessConstantBufferArrayType) {
|
||||
runFileTest("type.constant-buffer.bindless.array.hlsl");
|
||||
}
|
||||
TEST_F(FileTest, EnumType) { runFileTest("type.enum.hlsl"); }
|
||||
TEST_F(FileTest, ClassEnumType) { runFileTest("class.enum.hlsl"); }
|
||||
TEST_F(FileTest, TBufferType) { runFileTest("type.tbuffer.hlsl"); }
|
||||
TEST_F(FileTest, TextureBufferType) { runFileTest("type.texture-buffer.hlsl"); }
|
||||
TEST_F(FileTest, StructuredBufferType) {
|
||||
runFileTest("type.structured-buffer.hlsl");
|
||||
}
|
||||
TEST_F(FileTest, StructuredBufferTypeWithVector) {
|
||||
runFileTest("type.structured-buffer.vector.hlsl");
|
||||
}
|
||||
|
||||
// Test shaders that require Vulkan1.1 support with
|
||||
// -fspv-target-env=vulkan1.2 option to make sure that enabling
|
||||
|
|
Загрузка…
Ссылка в новой задаче