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
Ptr::__subscript
to accept any integer index. (shader-slang#4100)
* Fix `Ptr::__subscript` to accept any integer index. * Fix `Ptr::__subscript` to allow 64bit indices.
- Loading branch information
Showing
4 changed files
with
19 additions
and
1 deletion.
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
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,12 @@ | ||
//TEST:SIMPLE(filecheck=CHECK): -target spirv -entry main -stage compute -emit-spirv-directly | ||
|
||
// CHECK: OpEntryPoint | ||
|
||
ConstantBuffer<Ptr<int>> cbPtr; | ||
void main(int id : SV_DispatchThreadID) | ||
{ | ||
// Check that the index operand is translated directly into a 64bit integer | ||
// in th resulting SPIR-V without any truncations. | ||
// CHECK: OpPtrAccessChain %_ptr_PhysicalStorageBuffer_int %{{.*}} %long_123 | ||
cbPtr[123ll] = 4; | ||
} |