forked from shader-slang/slang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the issue in resolving the overload functions (shader-slang#5060)
- Loading branch information
1 parent
9fd5381
commit 003df7e
Showing
2 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// https://github.com/shader-slang/slang/issues/4476 | ||
|
||
//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-cuda -compute -shaderobj | ||
//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-cpu -compute -shaderobj | ||
//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-slang -compute -shaderobj | ||
//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-slang -compute -dx12 -shaderobj | ||
//TEST(compute, vulkan):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-vk -compute -shaderobj | ||
|
||
//TEST_INPUT:ubuffer(data=[0 0], stride=4):out,name=outputBuffer | ||
RWStructuredBuffer<uint> outputBuffer; | ||
|
||
|
||
uint getData() | ||
{ | ||
return 1u; | ||
} | ||
|
||
struct DataObtainer | ||
{ | ||
uint data; | ||
uint getData() | ||
{ | ||
return data; | ||
} | ||
|
||
uint getValue() | ||
{ | ||
return getData(); // will call DataObtainer::getData() | ||
} | ||
|
||
uint getValue2() | ||
{ | ||
return ::getData(); // will call global getData() | ||
} | ||
} | ||
|
||
RWStructuredBuffer<uint> output; | ||
|
||
[numthreads(1, 1, 1)] | ||
[shader("compute")] | ||
void computeMain(uint3 threadID: SV_DispatchThreadID) | ||
{ | ||
DataObtainer obtainer = {2u}; | ||
outputBuffer[0] = obtainer.getValue(); | ||
outputBuffer[1] = obtainer.getValue2(); | ||
// BUF: 2 | ||
// BUF-NEXT: 1 | ||
} |