Skip to content
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

[Sema] Prevent unwanted conversions related to ResourceDescriptorHeap/SamplerDescriptorHeap #6779

Closed
wants to merge 7 commits into from

Conversation

mateeeeeee
Copy link

@mateeeeeee mateeeeeee commented Jul 13, 2024

Prevents unwanted conversions between ResourceDescriptorHeap elements and Sampler objects, and SamplerDescriptorHeap and other types of resources besides Samplers.

@mateeeeeee mateeeeeee requested a review from a team as a code owner July 13, 2024 13:07
Copy link
Contributor

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff a54abe841e8f637ed8da7e9e94c40c5207a7c590 c37e23c82e67e20a29261740bb624274e5a43b08 -- lib/DxcSupport/HLSLOptions.cpp tools/clang/include/clang/AST/HlslTypes.h tools/clang/lib/AST/HlslTypes.cpp tools/clang/lib/Parse/ParseDecl.cpp tools/clang/lib/Sema/SemaHLSL.cpp tools/clang/tools/dxcompiler/dxcutil.cpp
View the diff from clang-format here.
diff --git a/tools/clang/lib/AST/HlslTypes.cpp b/tools/clang/lib/AST/HlslTypes.cpp
index 73d27bee7..374c17f32 100644
--- a/tools/clang/lib/AST/HlslTypes.cpp
+++ b/tools/clang/lib/AST/HlslTypes.cpp
@@ -709,8 +709,7 @@ bool IsHLSLNodeOutputType(clang::QualType type) {
          static_cast<uint32_t>(DXIL::NodeIOFlags::Output);
 }
 
-bool IsHLSLSamplerType(clang::QualType type)
-{
+bool IsHLSLSamplerType(clang::QualType type) {
   if (const RecordType *RT = type->getAs<RecordType>()) {
     StringRef name = RT->getDecl()->getName();
 
diff --git a/tools/clang/lib/Sema/SemaHLSL.cpp b/tools/clang/lib/Sema/SemaHLSL.cpp
index cf29156d7..0341c2e98 100644
--- a/tools/clang/lib/Sema/SemaHLSL.cpp
+++ b/tools/clang/lib/Sema/SemaHLSL.cpp
@@ -9555,7 +9555,6 @@ bool HLSLExternalSource::CanConvert(SourceLocation loc, Expr *sourceExpr,
     goto lSuccess;
   }
 
-
   if (SourceInfo.EltKind == AR_OBJECT_HEAP_SAMPLER) {
     if (TargetInfo.ShapeKind == AR_TOBJ_OBJECT &&
         hlsl::IsHLSLSamplerType(target)) {
  • Check this box to apply formatting changes to this branch.

@mateeeeeee mateeeeeee closed this Jul 13, 2024
@mateeeeeee mateeeeeee deleted the bug-6649 branch July 13, 2024 13:11
@mateeeeeee mateeeeeee restored the bug-6649 branch July 13, 2024 13:14
@mateeeeeee mateeeeeee deleted the bug-6649 branch July 13, 2024 13:22
@mateeeeeee
Copy link
Author

mateeeeeee commented Jul 13, 2024

I've accidentally checked-out the branch from another branch that contained some changes from before. Sorry for inconvenience. I've opened a correct pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant