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 anyvalue marshalling for matrix and 64 bit types. (shader-slang#5827
) * Fix anyvalue marshalling for matrix types. * Add support for 64bit types marshalling. --------- Co-authored-by: Ellie Hermaszewska <[email protected]>
- Loading branch information
1 parent
f687688
commit f573c15
Showing
4 changed files
with
186 additions
and
14 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
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,44 @@ | ||
//TEST:COMPARE_COMPUTE(filecheck-buffer=CHECK): -dx12 -use-dxil -profile cs_6_1 -output-using-type | ||
//TEST:COMPARE_COMPUTE(filecheck-buffer=CHECK): -vk -output-using-type | ||
|
||
interface IFoo | ||
{ | ||
float getVal(); | ||
uint64_t getPtrVal(); | ||
} | ||
|
||
struct Foo : IFoo | ||
{ | ||
column_major float3x2 m; | ||
int x; | ||
uint64_t ptr; | ||
float getVal() | ||
{ | ||
return m[2][0]; | ||
} | ||
uint64_t getPtrVal() | ||
{ | ||
return ptr; | ||
} | ||
} | ||
|
||
//TEST_INPUT: type_conformance Foo:IFoo = 0 | ||
|
||
//TEST_INPUT: set gFoo = ubuffer(data=[0 0 0 0 1.0 2.0 3.0 4.0 5.0 6.0 0 0 1 2], stride=4) | ||
RWStructuredBuffer<IFoo> gFoo; | ||
|
||
//TEST_INPUT: set outputBuffer = out ubuffer(data=[0 0 0 0], stride=4) | ||
RWStructuredBuffer<float> outputBuffer; | ||
|
||
[numthreads(1,1,1)] | ||
void computeMain() | ||
{ | ||
// CHECK: 3.0 | ||
outputBuffer[0] = gFoo[0].getVal(); | ||
|
||
// CHECK: 1.0 | ||
outputBuffer[1] = gFoo[0].getPtrVal()&0xFFFFFFFF; | ||
|
||
// CHECK: 2.0 | ||
outputBuffer[2] = gFoo[0].getPtrVal()>>32; | ||
} |
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,30 @@ | ||
//TEST:COMPARE_COMPUTE(filecheck-buffer=CHECK): -output-using-type | ||
|
||
interface IFoo | ||
{ | ||
float getVal(); | ||
} | ||
|
||
struct Foo : IFoo | ||
{ | ||
column_major float3x2 m; | ||
float getVal() | ||
{ | ||
return m[2][0]; | ||
} | ||
} | ||
|
||
//TEST_INPUT: type_conformance Foo:IFoo = 0 | ||
|
||
//TEST_INPUT: set gFoo = ubuffer(data=[0 0 0 0 1.0 2.0 3.0 4.0 5.0 6.0], stride=4) | ||
RWStructuredBuffer<IFoo> gFoo; | ||
|
||
//TEST_INPUT: set outputBuffer = out ubuffer(data=[0 0 0 0], stride=4) | ||
RWStructuredBuffer<float> outputBuffer; | ||
|
||
[numthreads(1,1,1)] | ||
void computeMain() | ||
{ | ||
// CHECK: 3.0 | ||
outputBuffer[0] = gFoo[0].getVal(); | ||
} |