diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2023-08-15 20:28:42 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-15 20:28:42 +0800 |
| commit | 00bd481e001e8c0b8008eaff5a38fa37963e6f99 (patch) | |
| tree | d068f0649167bff80b9cd3aa7d32d790540e9564 /tests | |
| parent | 113a257aafe4403c3ab905098d0560635ca94286 (diff) | |
SPIR-V WIP (#3064)
* Add type layout for structured buffer
* Default to generating spirv directly
* vk test for compute simple
* Add spirv-dis as a downstream compiler
* Emit Array types in SPIR-V
* makevector for spirv
* Dump whole spirv module on validation failure
* register array types
todo, use emitTypeInst
* Neater formatting for unhandled inst printing
* break out emitCompositeConstruct
* Correct array type generation
* neaten
* Allow getElement for vector
* Remove unused
* Allow predicating target intrinsics on types
* Consider functions with intrinsics to have definitions
We need to specialize these if they are predicated on types
* Correct array type generation
* makeArray for spir-v
* replace getElement with getElementPtr for spirv
* Correct translation of field access for spirv
* Push layouts to types for spirv
* Spirv intrinsics * operator now makes a pointer
* Add structured buffer of struct test
* Preserve type layout in spirv structured buffer legalization
* neaten
* makeVectorFromScalar for SPIRV
* placeholder for layouts on param groups
* More type safe spirv op construction
* Know that constants and types only go in one section
* Remove emitTypeInst
* Add todo for spirv sampling
* Add links to spirv documentation on emit functions
* OpTypeImage support for SPIR-V
* Add simpler texture test for spirv
* s/spirv_direct/spirv/g
* Allow several string literals in target_intrinsic
* Handle global params without a var layour for SPIR-V
For example groupshared vars
* uint spirv asm type
* Add todo for isDefinition
It is currently too broad
* Some atomic op spirv intrinsics
* Strip ConstantBuffer wrappers for spirv
* Add todo for matrix annotations
* Do not associate decorations insts with spirv counterparts
* Correct entry point parameter generation
* Spelling
* Assert that fieldAddress is returning a pointer
* Add error for existential type layout getting to spir-v emit
* Add IRTupleTypeLayout
Unused so far
* Allow getElementPtr to work with vectors
* Correct target name in test
* Hide default spirv direct behind a premake option --default-spirv-direct=true
* Do not insert space at start of intrinsic def
* Correct asm rendering in tests
* remove redundant option
* Emit directly from direct test
* Add source language options for spirv-dis
* Add comments to spirv dis
* Add dead debug print for before spirv module
* Correct asm rendering in tests
* s/spirv_direct/spirv/g
* Only specialize intrinsic functions with predicates
* regenerate vs projects
* squash warnings
* squash warnings
* remove duplication
* Silence warnings from msvc
* squash warnings
* Overload for zero sized array
* More msvc warnings
* warnings
* Add spirv-tools to path for tests
* Do not be specific about dxc version for diag test
* Normalize line endings from spirv-dis
* Correct filecheck matches
* Temporarily disable two spirv tests
Failing on CI, undebuggable hang :/
* Do not emit storage class more than once for spirv snippet
* Do not pass spir-v to spirv-dis by stdin
* Do not get spirv-dis output via stream, use file
* normalize file endings in spirv-dis output
Diffstat (limited to 'tests')
19 files changed, 147 insertions, 82 deletions
diff --git a/tests/autodiff/custom-intrinsic.slang b/tests/autodiff/custom-intrinsic.slang index dd122a674..1954c6f8d 100644 --- a/tests/autodiff/custom-intrinsic.slang +++ b/tests/autodiff/custom-intrinsic.slang @@ -15,7 +15,7 @@ namespace myintrinsiclib __target_intrinsic(glsl, "exp($0)") __target_intrinsic(cuda, "$P_exp($0)") __target_intrinsic(cpp, "$P_exp($0)") - __target_intrinsic(spirv_direct, "12 resultType resultId glsl450 27 _0") + __target_intrinsic(spirv, "12 resultType resultId glsl450 27 _0") [ForwardDerivative(d_myexp<T>)] T myexp(T x); @@ -34,7 +34,7 @@ namespace myintrinsiclib __target_intrinsic(glsl, "sin($0)") __target_intrinsic(cuda, "$P_sin($0)") __target_intrinsic(cpp, "$P_sin($0)") - __target_intrinsic(spirv_direct, "12 resultType resultId glsl450 13 _0") + __target_intrinsic(spirv, "12 resultType resultId glsl450 13 _0") [ForwardDerivative(d_mysin<T>)] T mysin(T x); @@ -52,7 +52,7 @@ namespace myintrinsiclib __target_intrinsic(glsl, "cos($0)") __target_intrinsic(cuda, "$P_cos($0)") __target_intrinsic(cpp, "$P_cos($0)") - __target_intrinsic(spirv_direct, "12 resultType resultId glsl450 14 _0") + __target_intrinsic(spirv, "12 resultType resultId glsl450 14 _0") [ForwardDerivative(d_mycos<T>)] T mycos(T x); diff --git a/tests/bugs/gh-3085.slang b/tests/bugs/gh-3085.slang index 9250d501d..86992aec6 100644 --- a/tests/bugs/gh-3085.slang +++ b/tests/bugs/gh-3085.slang @@ -1,5 +1,5 @@ //TEST:SIMPLE(filecheck=CHECK): -entry MainCs -stage compute -profile glsl_450 -target spirv -//CHECK: EntryPoint +//CHECK: OpEntryPoint RWTexture2D<float4> g_Test; @@ -26,4 +26,4 @@ void MainCs(uint3 groupID: SV_GroupID, uint3 groupThreadID: SV_GroupThreadID) // color+= LoadSourceColor ( pixelPos , int2 ( i%3 , i/3 ) , msaaSampleIndex ) . rgb ; //} g_Test[int2(pixelPos.x / 2, pixelPos.y + 0)] = float4(color, 1.0); -}
\ No newline at end of file +} diff --git a/tests/bugs/gh-841.slang b/tests/bugs/gh-841.slang index 8dc687e77..0608023e5 100644 --- a/tests/bugs/gh-841.slang +++ b/tests/bugs/gh-841.slang @@ -12,9 +12,9 @@ struct RasterVertex float4 c : COLOR; // Make sure that the input value in location 1 is decorated as Flat - // SPV-DAG: [[#VAL:]]{{.*}}:{{.*}} Variable Input - // SPV-DAG: Decorate [[#VAL]]{{.*}} Location 1 - // SPV-DAG: Decorate [[#VAL]]{{.*}} Flat + // SPV-DAG: [[VAL:%[_A-Za-z0-9]+]] = OpVariable {{.*}} Input + // SPV-DAG: OpDecorate [[VAL]] Location 1 + // SPV-DAG: OpDecorate [[VAL]] Flat // // Likewise for GLSL // GLSL: flat layout(location = 1) diff --git a/tests/bugs/interlocked-add-uint-int.slang b/tests/bugs/interlocked-add-uint-int.slang index 10baa7f17..4396a3dc5 100644 --- a/tests/bugs/interlocked-add-uint-int.slang +++ b/tests/bugs/interlocked-add-uint-int.slang @@ -1,5 +1,5 @@ //TEST:SIMPLE(filecheck=CHECK): -target spirv -profile glsl_450 -stage compute -entry MainCs -line-directive-mode none -//CHECK: {{.*}} AtomicIAdd +//CHECK: {{.*}} OpAtomicIAdd RWBuffer<uint> g_InterlockTest; [numthreads(1,1,1)] @@ -16,4 +16,4 @@ void MainCs( uint2 dispatchThreadID : SV_DispatchThreadID, uint2 groupThreadID : { InterlockedAdd( g_InterlockTest[ 0 ], -int(nVertexCount) ); } -}
\ No newline at end of file +} diff --git a/tests/bugs/texture-array-samplecmplevelzero.slang b/tests/bugs/texture-array-samplecmplevelzero.slang index 6176f74dc..c8afba603 100644 --- a/tests/bugs/texture-array-samplecmplevelzero.slang +++ b/tests/bugs/texture-array-samplecmplevelzero.slang @@ -1,5 +1,5 @@ //TEST_DISABLED:SIMPLE(filecheck=CHECK): -entry MainPs -stage fragment -profile glsl_450 -target spirv -//CHECK: EntryPoint +//CHECK: OpEntryPoint SamplerComparisonState g_tSFMShadowDepthTexture_sampler; Texture2DArray g_tSFMShadowDepthTexture; diff --git a/tests/compute/simple.slang b/tests/compute/simple.slang index 0d4efc2e2..96cccc090 100644 --- a/tests/compute/simple.slang +++ b/tests/compute/simple.slang @@ -1,6 +1,7 @@ //TEST(smoke,compute):COMPARE_COMPUTE:-shaderobj //TEST(smoke,compute):COMPARE_COMPUTE:-dx12 -use-dxil -shaderobj //TEST(smoke,compute):COMPARE_COMPUTE:-cpu -shaderobj +//TEST(smoke,compute):COMPARE_COMPUTE:-vk -shaderobj //TEST(smoke,compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -shaderobj // CHECK: 0 diff --git a/tests/compute/structured-buffer-of-struct.slang b/tests/compute/structured-buffer-of-struct.slang new file mode 100644 index 000000000..7bfb38df8 --- /dev/null +++ b/tests/compute/structured-buffer-of-struct.slang @@ -0,0 +1,37 @@ +//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -shaderobj + +// CHECK: 2 +// CHECK-NEXT: 1 +// CHECK-NEXT: 4 +// CHECK-NEXT: 3 +// CHECK-NEXT: 6 +// CHECK-NEXT: 5 +// CHECK-NEXT: 8 +// CHECK-NEXT: 7 + +struct S +{ + int a; + int b; +}; + +//TEST_INPUT:ubuffer(data=[1 2 3 4 5 6 7 8], stride=8):out,name=buf +RWStructuredBuffer<S> buf; + +S test(S s) +{ + s.a = s.a ^ s.b; + s.b = s.a ^ s.b; + s.a = s.a ^ s.b; + return s; +} + +[numthreads(4, 1, 1)] +// void computeMain(uint i : SV_GroupIndex) +// { +// buf[i] = test(buf[i]); +// } +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + buf[dispatchThreadID.x] = test(buf[dispatchThreadID.x]); +} diff --git a/tests/compute/texture-simpler.slang b/tests/compute/texture-simpler.slang new file mode 100644 index 000000000..ce4b76f77 --- /dev/null +++ b/tests/compute/texture-simpler.slang @@ -0,0 +1,16 @@ +//TEST(compute, vulkan):COMPARE_COMPUTE:-vk -compute -shaderobj -output-using-type + +//TEST_INPUT: Texture2D(size=4, content = one):name t2D +Texture2D<float> t2D; +//TEST_INPUT: Sampler:name samplerState +SamplerState samplerState; + +//TEST_INPUT: ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer +RWStructuredBuffer<float> outputBuffer; + +[numthreads(4, 1, 1)] +void computeMain(uint i : SV_GroupIndex) +{ + float u = i * 0.25; + outputBuffer[i] = t2D.SampleLevel(samplerState, float2(u, u), 0); +} diff --git a/tests/compute/texture-simpler.slang.expected.txt b/tests/compute/texture-simpler.slang.expected.txt new file mode 100644 index 000000000..334dd67a8 --- /dev/null +++ b/tests/compute/texture-simpler.slang.expected.txt @@ -0,0 +1,5 @@ +type: float +1.000000 +1.000000 +1.000000 +1.000000 diff --git a/tests/cross-compile/dxc-error.hlsl b/tests/cross-compile/dxc-error.hlsl index 0e6b6e489..8d73d7a1c 100644 --- a/tests/cross-compile/dxc-error.hlsl +++ b/tests/cross-compile/dxc-error.hlsl @@ -1,4 +1,4 @@ -//DIAGNOSTIC_TEST(dxc):SIMPLE:-pass-through dxc -target dxil -entry computeMain -stage compute -profile sm_6_1 +//DIAGNOSTIC_TEST(dxc):SIMPLE(filecheck=CHECK):-pass-through dxc -target dxil -entry computeMain -stage compute -profile sm_6_1 [numthreads(4, 1, 1)] void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) @@ -6,4 +6,7 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) uint tid = dispatchThreadID.x; // Error should be here... as gOutputBuffer is not defined... gOutputBuffer[tid] = dispatchThreadID.x * 0.5f; -}
\ No newline at end of file + // CHECK: : tests/cross-compile/dxc-error.hlsl([[#@LINE-1]]): error : use of undeclared identifier 'gOutputBuffer' + // CHECK-NEXT: : note : gOutputBuffer[tid] = dispatchThreadID.x * 0.5f; + // CHECK-NEXT: : note : ^ +} diff --git a/tests/cross-compile/dxc-error.hlsl.expected b/tests/cross-compile/dxc-error.hlsl.expected deleted file mode 100644 index c47ca80a6..000000000 --- a/tests/cross-compile/dxc-error.hlsl.expected +++ /dev/null @@ -1,8 +0,0 @@ -result code = -1 -standard error = { -dxc 1.7: tests/cross-compile/dxc-error.hlsl(8): error : use of undeclared identifier 'gOutputBuffer' -dxc 1.7: note : gOutputBuffer[tid] = dispatchThreadID.x * 0.5f; -dxc 1.7: note : ^ -} -standard output = { -} diff --git a/tests/gpu-feature/texture/query/footprint/nv-shader-texture-footprint-simple.slang b/tests/gpu-feature/texture/query/footprint/nv-shader-texture-footprint-simple.slang index b219ca829..782c7e7e5 100644 --- a/tests/gpu-feature/texture/query/footprint/nv-shader-texture-footprint-simple.slang +++ b/tests/gpu-feature/texture/query/footprint/nv-shader-texture-footprint-simple.slang @@ -1,7 +1,9 @@ -//TEST:SIMPLE(filecheck=SPIRV):-target spirv-assembly -entry fragmentMain -stage fragment +//DISABLED_TEST:SIMPLE(filecheck=SPIRV):-target spirv-assembly -entry fragmentMain -stage fragment //DISABLED_TEST:SIMPLE(filecheck=DXIL):-target dxil-assembly -entry fragmentMain -stage fragment //TEST:SIMPLE(filecheck=HLSL):-target hlsl -entry fragmentMain -stage fragment +// TODO: The SPIRV test is fine locally, but seems to lead to an impossible to debug hang in CI + //DISABLED_TEST:SIMPLE:-target spirv-assembly -entry fragmentMain -stage fragment //DISABLED_TEST:SIMPLE:-target dxil-assembly -entry fragmentMain -stage fragment //DISABLED_TEST:SIMPLE:-target hlsl -entry fragmentMain -stage fragment @@ -62,8 +64,8 @@ void fragmentMain( accumulate(r, texture.queryFootprintCoarse(granularity, sampler, coords)); -// SPIRV: Extension "SPV_NV_shader_image_footprint" -// SPIRV: ImageSampleFootprintNV +// SPIRV: OpExtension "SPV_NV_shader_image_footprint" +// SPIRV: OpImageSampleFootprintNV // HLSL: NvFootprintCoarse diff --git a/tests/gpu-feature/texture/query/footprint/nv-shader-texture-footprint.slang b/tests/gpu-feature/texture/query/footprint/nv-shader-texture-footprint.slang index 12ccd59fc..d5e406615 100644 --- a/tests/gpu-feature/texture/query/footprint/nv-shader-texture-footprint.slang +++ b/tests/gpu-feature/texture/query/footprint/nv-shader-texture-footprint.slang @@ -1,7 +1,9 @@ -//TEST:SIMPLE(filecheck=SPIRV):-target spirv-assembly -entry fragmentMain -stage fragment -DENABLE_CLAMP +//DISABLED_TEST:SIMPLE(filecheck=SPIRV):-target spirv-assembly -entry fragmentMain -stage fragment -DENABLE_CLAMP //DISABLED_TEST:SIMPLE(filecheck=DXIL):-target dxil-assembly -entry fragmentMain -stage fragment //TEST:SIMPLE(filecheck=HLSL):-target hlsl -entry fragmentMain -stage fragment +// TODO: The SPIRV test is fine locally, but seems to lead to an impossible to debug hang in CI + //DISABLED_TEST:SIMPLE:-target spirv-assembly -entry fragmentMain -stage fragment -DENABLE_CLAMP //DISABLED_TEST:SIMPLE:-target dxil-assembly -entry fragmentMain -stage fragment //DISABLED_TEST:SIMPLE:-target hlsl -entry fragmentMain -stage fragment @@ -74,19 +76,19 @@ void accumulate_3D(inout uint r, TextureFootprint3D f) accumulate(r, f.isSingleLevel); } -// SPRIV: Extension "SPV_NV_shader_image_footprint" +// SPRIV: OpExtension "SPV_NV_shader_image_footprint" void fragmentMain( float v : VARYING, uniform Texture2D texture_2D, -// SPIRV: TypeImage +// SPIRV: OpTypeImage // SPIRV-SAME: 2D // HLSL-DAG: Texture2D{{.*}}register(t0) uniform Texture3D texture_3D, -// SPIRV: TypeImage +// SPIRV: OpTypeImage // SPIRV-SAME: 3D // HLSL-DAG: Texture3D{{.*}}register(t1) @@ -135,8 +137,8 @@ CLAMP( accumulate##ND(r, texture##ND.queryFootprint##COARSE_OR_FINE##GradClamp TEST_COMMON(_3D, COARSE_OR_FINE) \ /* end */ -// SPIRV-DAG: [[TRUE:[0-9]+]]:{{.*}}ConstantTrue -// SPIRV-DAG: [[FALSE:[0-9]+]]:{{.*}}ConstantFalse +// SPIRV-DAG: [[TRUE:%[a-zA-Z0-9_]+]] = OpConstantTrue +// SPIRV-DAG: [[FALSE:%[a-zA-Z0-9_]+]] = OpConstantFalse { let coords = c.xy; @@ -145,57 +147,57 @@ CLAMP( accumulate##ND(r, texture##ND.queryFootprint##COARSE_OR_FINE##GradClamp TEST_2D(Coarse); -// SPIRV: ImageSampleFootprintNV +// SPIRV: OpImageSampleFootprintNV // SPIRV-SAME: [[TRUE]] // HLSL-DAG: NvFootprintCoarse{{.*}}NV_EXTN_TEXTURE_2D -// SPIRV: ImageSampleFootprintNV +// SPIRV: OpImageSampleFootprintNV // SPIRV-SAME: [[TRUE]] Bias // HLSL-DAG: NvFootprintCoarseBias{{.*}}NV_EXTN_TEXTURE_2D -// SPIRV: ImageSampleFootprintNV +// SPIRV: OpImageSampleFootprintNV // SPIRV-SAME: [[TRUE]] MinLod -// SPIRV: ImageSampleFootprintNV -// SPIRV-SAME: [[TRUE]] Bias MinLod +// SPIRV: OpImageSampleFootprintNV +// SPIRV-SAME: [[TRUE]] Bias|MinLod -// SPIRV: ImageSampleFootprintNV +// SPIRV: OpImageSampleFootprintNV // SPIRV-SAME: [[TRUE]] Lod // HLSL-DAG: NvFootprintCoarseLevel{{.*}}NV_EXTN_TEXTURE_2D -// SPIRV: ImageSampleFootprintNV +// SPIRV: OpImageSampleFootprintNV // SPIRV-SAME: [[TRUE]] Grad // HLSL-DAG: NvFootprintCoarseGrad{{.*}}NV_EXTN_TEXTURE_2D -// SPIRV: ImageSampleFootprintNV -// SPIRV-SAME: [[TRUE]] Grad MinLod +// SPIRV: OpImageSampleFootprintNV +// SPIRV-SAME: [[TRUE]] Grad|MinLod TEST_2D(Fine); -// SPIRV: ImageSampleFootprintNV +// SPIRV: OpImageSampleFootprintNV // SPIRV-SAME: [[FALSE]] // HLSL-DAG: NvFootprintFine{{.*}}NV_EXTN_TEXTURE_2D -// SPIRV: ImageSampleFootprintNV +// SPIRV: OpImageSampleFootprintNV // SPIRV-SAME: [[FALSE]] Bias // HLSL-DAG: NvFootprintFineBias{{.*}}NV_EXTN_TEXTURE_2D -// SPIRV: ImageSampleFootprintNV +// SPIRV: OpImageSampleFootprintNV // SPIRV-SAME: [[FALSE]] MinLod -// SPIRV: ImageSampleFootprintNV -// SPIRV-SAME: [[FALSE]] Bias MinLod +// SPIRV: OpImageSampleFootprintNV +// SPIRV-SAME: [[FALSE]] Bias|MinLod -// SPIRV: ImageSampleFootprintNV +// SPIRV: OpImageSampleFootprintNV // SPIRV-SAME: [[FALSE]] Lod // HLSL-DAG: NvFootprintFineLevel{{.*}}NV_EXTN_TEXTURE_2D -// SPIRV: ImageSampleFootprintNV +// SPIRV: OpImageSampleFootprintNV // SPIRV-SAME: [[FALSE]] Grad // HLSL-DAG: NvFootprintFineGrad{{.*}}NV_EXTN_TEXTURE_2D -// SPIRV: ImageSampleFootprintNV -// SPIRV-SAME: [[FALSE]] Grad MinLod +// SPIRV: OpImageSampleFootprintNV +// SPIRV-SAME: [[FALSE]] Grad|MinLod } @@ -206,41 +208,41 @@ CLAMP( accumulate##ND(r, texture##ND.queryFootprint##COARSE_OR_FINE##GradClamp TEST_3D(Coarse); -// SPIRV: ImageSampleFootprintNV +// SPIRV: OpImageSampleFootprintNV // SPIRV-SAME: [[TRUE]] // HLSL-DAG: NvFootprintCoarse{{.*}}NV_EXTN_TEXTURE_3D -// SPIRV: ImageSampleFootprintNV +// SPIRV: OpImageSampleFootprintNV // SPIRV-SAME: [[TRUE]] Bias // HLSL-DAG: NvFootprintCoarseBias{{.*}}NV_EXTN_TEXTURE_3D -// SPIRV: ImageSampleFootprintNV +// SPIRV: OpImageSampleFootprintNV // SPIRV-SAME: [[TRUE]] MinLod -// SPIRV: ImageSampleFootprintNV -// SPIRV-SAME: [[TRUE]] Bias MinLod +// SPIRV: OpImageSampleFootprintNV +// SPIRV-SAME: [[TRUE]] Bias|MinLod -// SPIRV: ImageSampleFootprintNV +// SPIRV: OpImageSampleFootprintNV // SPIRV-SAME: [[TRUE]] Lod // HLSL-DAG: NvFootprintCoarseLevel{{.*}}NV_EXTN_TEXTURE_3D TEST_3D(Fine); -// SPIRV: ImageSampleFootprintNV +// SPIRV: OpImageSampleFootprintNV // SPIRV-SAME: [[FALSE]] // HLSL-DAG: NvFootprintFine{{.*}}NV_EXTN_TEXTURE_3D -// SPIRV: ImageSampleFootprintNV +// SPIRV: OpImageSampleFootprintNV // SPIRV-SAME: [[FALSE]] Bias // HLSL-DAG: NvFootprintFineBias{{.*}}NV_EXTN_TEXTURE_3D -// SPIRV: ImageSampleFootprintNV +// SPIRV: OpImageSampleFootprintNV // SPIRV-SAME: [[FALSE]] MinLod -// SPIRV: ImageSampleFootprintNV -// SPIRV-SAME: [[FALSE]] Bias MinLod +// SPIRV: OpImageSampleFootprintNV +// SPIRV-SAME: [[FALSE]] Bias|MinLod -// SPIRV: ImageSampleFootprintNV +// SPIRV: OpImageSampleFootprintNV // SPIRV-SAME: [[FALSE]] Lod // HLSL-DAG: NvFootprintFineLevel{{.*}}NV_EXTN_TEXTURE_3D diff --git a/tests/hlsl-intrinsic/const-buffer-pointer.slang b/tests/hlsl-intrinsic/const-buffer-pointer.slang index 33b538a60..eddfc3be0 100644 --- a/tests/hlsl-intrinsic/const-buffer-pointer.slang +++ b/tests/hlsl-intrinsic/const-buffer-pointer.slang @@ -1,7 +1,7 @@ //TEST:SIMPLE(filecheck=CHECK):-target glsl -profile glsl_450 -entry main -stage compute //TEST:SIMPLE(filecheck=SPV):-target spirv -profile glsl_450 -entry main -stage compute -// SPV: EntryPoint GLCompute {{.*}} "main" {{.*}} +// SPV: OpEntryPoint GLCompute {{.*}} "main" {{.*}} struct MyStruct { @@ -36,4 +36,4 @@ void main(int3 tid: SV_DispatchThreadID) { MyStruct s = gGlobals.pStruct.get(); outputBuffer[tid.x] = uint(s.position.x); -}
\ No newline at end of file +} diff --git a/tests/hlsl-intrinsic/scalar-float.slang b/tests/hlsl-intrinsic/scalar-float.slang index bc9d24a0e..4623d4835 100644 --- a/tests/hlsl-intrinsic/scalar-float.slang +++ b/tests/hlsl-intrinsic/scalar-float.slang @@ -2,7 +2,7 @@ //TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj //TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12 -shaderobj //TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj -//DISABLED_TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj -emit-spirv-directly +//DISABLED_TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj //TEST(compute, vulkan):COMPARE_COMPUTE_EX:-cuda -compute -shaderobj //TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer diff --git a/tests/spirv/direct-spirv-compute-simple.slang b/tests/spirv/direct-spirv-compute-simple.slang index 2fa2798e5..4c33d8a72 100644 --- a/tests/spirv/direct-spirv-compute-simple.slang +++ b/tests/spirv/direct-spirv-compute-simple.slang @@ -1,6 +1,6 @@ // direct-spirv-compute-simple.slang -//TESTD:SIMPLE:-target spirv -entry computeMain -stage compute -emit-spirv-directly -//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -emit-spirv-directly +//TESTD:SIMPLE:-target spirv -entry computeMain -stage compute +//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute // Test runinng a shader generated from direct SPIR-V emit. diff --git a/tests/spirv/direct-spirv-control-flow-2.slang b/tests/spirv/direct-spirv-control-flow-2.slang index 7dd829bda..697125500 100644 --- a/tests/spirv/direct-spirv-control-flow-2.slang +++ b/tests/spirv/direct-spirv-control-flow-2.slang @@ -1,7 +1,7 @@ // direct-spirv-control-flow-2.slang -//TESTD:SIMPLE:-target spirv -entry computeMain -stage compute -emit-spirv-directly -//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -output-using-type -emit-spirv-directly +//TESTD:SIMPLE:-target spirv -entry computeMain -stage compute +//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -output-using-type // Test direct SPIR-V emit on control flows. diff --git a/tests/spirv/direct-spirv-control-flow.slang b/tests/spirv/direct-spirv-control-flow.slang index 10bee2522..744519438 100644 --- a/tests/spirv/direct-spirv-control-flow.slang +++ b/tests/spirv/direct-spirv-control-flow.slang @@ -1,6 +1,6 @@ // direct-spirv-control-flow.slang -//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -emit-spirv-directly +//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute // Test direct SPIRV emit on control fl. diff --git a/tests/spirv/direct-spirv-emit.slang.expected b/tests/spirv/direct-spirv-emit.slang.expected index aff2198be..55cc718a8 100644 --- a/tests/spirv/direct-spirv-emit.slang.expected +++ b/tests/spirv/direct-spirv-emit.slang.expected @@ -2,19 +2,26 @@ result code = 0 standard error = { } standard output = { -// Module Version 10500 -// Generated by (magic number): 0 -// Id's are bound by 5 +; SPIR-V +; Version: 1.5 +; Generator: Khronos; 0 +; Bound: 5 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %computeMain "computeMain" + OpExecutionMode %computeMain LocalSize 4 1 1 - Capability Shader - MemoryModel Logical GLSL450 - EntryPoint GLCompute 2 "computeMain" - ExecutionMode 2 LocalSize 4 1 1 - Name 2 "computeMain" - 1: TypeVoid - 3: TypeFunction 1 - 2(computeMain): 1 Function None 3 - 4: Label - Return - FunctionEnd + ; Debug Information + OpName %computeMain "computeMain" ; id %2 + + ; Types, variables and constants + %void = OpTypeVoid + %3 = OpTypeFunction %void + + ; Function computeMain +%computeMain = OpFunction %void None %3 + %4 = OpLabel + OpReturn + OpFunctionEnd } |
