diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/language-feature/resource-specialization-nested-specialization.slang | 58 | ||||
| -rw-r--r-- | tests/language-feature/resource-specialization-struct-out.slang (renamed from tests/current-bugs/resource-struct-out.slang) | 9 | ||||
| -rw-r--r-- | tests/language-feature/resource-specialization-struct-return.slang (renamed from tests/current-bugs/resource-struct-return.slang) | 9 |
3 files changed, 68 insertions, 8 deletions
diff --git a/tests/language-feature/resource-specialization-nested-specialization.slang b/tests/language-feature/resource-specialization-nested-specialization.slang new file mode 100644 index 000000000..2b88e7611 --- /dev/null +++ b/tests/language-feature/resource-specialization-nested-specialization.slang @@ -0,0 +1,58 @@ +//TEST:SIMPLE(filecheck=CHECK_DXIL): -target dxil -profile sm_6_0 -entry computeMain -stage compute -DMEMBER_FUNCTION_CALL +//TEST:SIMPLE(filecheck=CHECK_DXIL): -target dxil -profile sm_6_0 -entry computeMain -stage compute + +//CHECK_DXIL: computeMain + +struct Grid +{ + uint bufSize; + StructuredBuffer<uint> buf; +}; + +struct GridGeo +{ + Grid grids[2]; + + void getGrid(uint index, out Grid grid) + { + grid = grids[index]; + } +}; + +struct Scene +{ + GridGeo gridGeo; + + void getGrid_BAD(uint index, out Grid grid) + { + gridGeo.getGrid(index, grid); + } + + void getGrid_GOOD(uint index, out Grid grid) + { + grid = gridGeo.grids[index]; + } +}; + +ParameterBlock<Scene> gScene; +RWStructuredBuffer<uint> gridBuffers[2]; +RWStructuredBuffer<uint> outputBuffer; + +void direct_getGrid_BAD(uint index, out Grid grid) +{ + gScene.gridGeo.getGrid(index, grid); +} + +[numthreads(1, 1, 1)] +void computeMain(uint3 threadId: SV_DispatchThreadID) +{ + + Grid grid; + +#ifdef MEMBER_FUNCTION_CALL + direct_getGrid_BAD(1, grid); +#else + gScene.getGrid_BAD(1, grid); +#endif + gridBuffers[0][1] = grid.buf[1]; +} diff --git a/tests/current-bugs/resource-struct-out.slang b/tests/language-feature/resource-specialization-struct-out.slang index d47b2ec7c..b525dafb9 100644 --- a/tests/current-bugs/resource-struct-out.slang +++ b/tests/language-feature/resource-specialization-struct-out.slang @@ -1,15 +1,16 @@ -//DISABLE_TEST:SIMPLE:-target hlsl -entry computeMain -profile cs_6_2 +//TEST:SIMPLE(filecheck=CHECK_DXIL):-target dxil -entry computeMain -profile cs_6_2 +//CHECK_DXIL: computeMain -// This test demonstrates out parameter with a struct & resource type crashes +// This test demonstrates out parameter with a struct & resource type. -RWTexture1D<float> g_t; +RWTexture1D<int> g_t; RWStructuredBuffer<int> outputBuffer; struct Thing { int a; - RWTexture1D<float> t; + RWTexture1D<int> t; }; void setThing(out Thing t) diff --git a/tests/current-bugs/resource-struct-return.slang b/tests/language-feature/resource-specialization-struct-return.slang index 8d0508097..ca01f55d2 100644 --- a/tests/current-bugs/resource-struct-return.slang +++ b/tests/language-feature/resource-specialization-struct-return.slang @@ -1,14 +1,15 @@ -//DISABLE_TEST:SIMPLE:-target hlsl -entry computeMain -profile cs_6_2 +//TEST:SIMPLE(filecheck=CHECK_DXIL):-target dxil -entry computeMain -profile cs_6_2 +//CHECK_DXIL: computeMain -// This test demonstrates returning struct with resource causes internal compiler error +// This test demonstrates returning struct with resource. -RWTexture1D<float> g_t; +RWTexture1D<int> g_t; RWStructuredBuffer<int> outputBuffer; struct Thing { int a; - RWTexture1D<float> t; + RWTexture1D<int> t; }; Thing makeThing() |
