[clang] [llvm] [HLSL][SPIRV] Reject textures and typed buffers with 16-bit or double elements on Vulkan (PR #243566)
Justin Bogner via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 25 12:03:43 PST 2026
================
@@ -9370,6 +9370,9 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) {
}
}
+ if (getLangOpts().HLSL)
+ HLSL().DiagnoseVulkanResourceElementTypes(NewVD);
----------------
bogner wrote:
This feels like the wrong place to do this, and I wonder if this is just the wrong approach.
Instead of doing custom diagnosis after the fact, what if we were to adjust the concept on the resource type in the first place? Instead of `__is_typed_resource_element_compatible`, we could have a vulkan specific variant and choose by `#ifdef __SPIRV__` or something along those lines.
https://github.com/llvm/llvm-project/pull/243566
More information about the cfe-commits
mailing list