[spirv] Fix issues of RWByteAddressBuffer in the InitList#3145
Merged
jaebaek merged 1 commit intomicrosoft:masterfrom Oct 1, 2020
Merged
[spirv] Fix issues of RWByteAddressBuffer in the InitList#3145jaebaek merged 1 commit intomicrosoft:masterfrom
jaebaek merged 1 commit intomicrosoft:masterfrom
Conversation
|
✅ Build DirectXShaderCompiler 1.0.3642 completed (commit 423ae96695 by @jiaolu) |
jaebaek
reviewed
Sep 30, 2020
Collaborator
jaebaek
left a comment
There was a problem hiding this comment.
Could you please add the following code?
diff --git a/tools/clang/unittests/SPIRV/CodeGenSpirvTest.cpp b/tools/clang/unittests/SPIRV/CodeGenSpirvTest.cpp
index 5baa27086..660d4243c 100644
--- a/tools/clang/unittests/SPIRV/CodeGenSpirvTest.cpp
+++ b/tools/clang/unittests/SPIRV/CodeGenSpirvTest.cpp
@@ -983,6 +983,11 @@ TEST_F(FileTest, RWByteAddressBufferAtomicMethods) {
runFileTest("method.rw-byte-address-buffer.atomic.hlsl");
}
+TEST_F(FileTest, InitializeListRWByteAddressBuffer) {
+ runFileTest("initializelist.rwbyteaddressbuffer.hlsl", Expect::Success,
+ /* runValidation */ false);
+}
+
// For Buffer/RWBuffer methods
TEST_F(FileTest, BufferLoad) { runFileTest("method.buffer.load.hlsl"); }
TEST_F(FileTest, BufferGetDimensions) {
Collaborator
There was a problem hiding this comment.
I think we have to use the following code for this unit test.
// Run: %dxc -T cs_6_0 -E main
RWBuffer<int> buffer1 : register(u1);
RWByteAddressBuffer buffer2 : register(u2);
// CHECK: [[Resource:%\w+]] = OpTypeStruct %type_RWByteAddressBuffer %uint
struct Resource {
RWByteAddressBuffer rwbuffer;
uint offset;
};
[numthreads(8, 1, 1)]
void main(uint globalId : SV_DispatchThreadID,
uint localId : SV_GroupThreadID,
uint groupId : SV_GroupID) {
// CHECK: [[buffer2:%\w+]] = OpVariable %_ptr_Uniform_type_RWByteAddressBuffer Uniform
Resource resourceInfo2 = {buffer2, 2};
// CHECK: OpCompositeConstruct [[Resource]] [[buffer2]] %uint_2
buffer1[0] = resourceInfo2.rwbuffer.Load(0);
}
RWByteAddressBuffer object in the initList should be handled like OpaqueType RWBuffer or Texture2D.
|
✅ Build DirectXShaderCompiler 1.0.3685 completed (commit ce4d343a17 by @jiaolu) |
jaebaek
approved these changes
Oct 1, 2020
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RWByteAddressBuffer object in the initList should be handled like
OpaqueType RWBuffer or Texture2D.