-
Notifications
You must be signed in to change notification settings - Fork 14k
[DXContainer] Update DXContainer to match D3D12 spec #143201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DXContainer] Update DXContainer to match D3D12 spec #143201
Conversation
@llvm/pr-subscribers-backend-directx @llvm/pr-subscribers-llvm-binary-utilities Author: None (joaosaffran) ChangesUpdate the descriptor range flag values in DXContainerConstants.def to match
This ensures better compatibility with the D3D12 API and makes the values Requested here: #138315 (comment) Full diff: https://github.com/llvm/llvm-project/pull/143201.diff 2 Files Affected:
diff --git a/llvm/include/llvm/BinaryFormat/DXContainer.h b/llvm/include/llvm/BinaryFormat/DXContainer.h
index 08949e39716d5..725c405b77e55 100644
--- a/llvm/include/llvm/BinaryFormat/DXContainer.h
+++ b/llvm/include/llvm/BinaryFormat/DXContainer.h
@@ -164,7 +164,7 @@ enum class RootDescriptorFlag : uint32_t {
#include "DXContainerConstants.def"
};
-#define DESCRIPTOR_RANGE_FLAG(Num, Val) Val = 1ull << Num,
+#define DESCRIPTOR_RANGE_FLAG(Num, Val) Val = Num,
enum class DescriptorRangeFlag : uint32_t {
#include "DXContainerConstants.def"
};
diff --git a/llvm/include/llvm/BinaryFormat/DXContainerConstants.def b/llvm/include/llvm/BinaryFormat/DXContainerConstants.def
index 501ef0c31cdd0..c4895ee8ed655 100644
--- a/llvm/include/llvm/BinaryFormat/DXContainerConstants.def
+++ b/llvm/include/llvm/BinaryFormat/DXContainerConstants.def
@@ -90,11 +90,11 @@ ROOT_DESCRIPTOR_FLAG(3, DATA_STATIC)
#ifdef DESCRIPTOR_RANGE_FLAG
DESCRIPTOR_RANGE_FLAG(0, NONE)
-DESCRIPTOR_RANGE_FLAG(1, DESCRIPTORS_VOLATILE)
-DESCRIPTOR_RANGE_FLAG(2, DATA_VOLATILE)
-DESCRIPTOR_RANGE_FLAG(3, DATA_STATIC_WHILE_SET_AT_EXECUTE)
-DESCRIPTOR_RANGE_FLAG(4, DATA_STATIC)
-DESCRIPTOR_RANGE_FLAG(16, DESCRIPTORS_STATIC_KEEPING_BUFFER_BOUNDS_CHECKS)
+DESCRIPTOR_RANGE_FLAG(0x1, DESCRIPTORS_VOLATILE)
+DESCRIPTOR_RANGE_FLAG(0x2, DATA_VOLATILE)
+DESCRIPTOR_RANGE_FLAG(0x4, DATA_STATIC_WHILE_SET_AT_EXECUTE)
+DESCRIPTOR_RANGE_FLAG(0x8, DATA_STATIC)
+DESCRIPTOR_RANGE_FLAG(0x10000, DESCRIPTORS_STATIC_KEEPING_BUFFER_BOUNDS_CHECKS)
#undef DESCRIPTOR_RANGE_FLAG
#endif // DESCRIPTOR_RANGE_FLAG
|
Update the descriptor range flag values in DXContainerConstants.def to match
the Direct3D12 specification. This changes two aspects:
bit shifts
D3D12_DESCRIPTOR_RANGE_FLAGS enumeration:
This ensures better compatibility with the D3D12 API and makes the values
more explicit in the code.
Requested here: #138315 (comment)