From 3b49496db2ef8ba2ee37c19a623878e0f39ea3e9 Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Fri, 1 Sep 2023 12:45:35 -0600 Subject: [PATCH] Add type punning rules to vk::BufferPointer (#55) * Add type punning rules to vk::BufferPointer Fixes #43 * Clarify that type punning with buffer pointers leads to undefined behavior. --- proposals/0010-vk-buffer-ref.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/proposals/0010-vk-buffer-ref.md b/proposals/0010-vk-buffer-ref.md index d6e5a493..1058c928 100644 --- a/proposals/0010-vk-buffer-ref.md +++ b/proposals/0010-vk-buffer-ref.md @@ -175,6 +175,10 @@ A vk::BufferPointer can otherwise be used whereever the HLSL spec does not other Applying HLSL semantic annotations to objects of type vk::BufferPointer is disallowed. +### Buffer Pointers and Type Punning Through Unions + +While buffer pointer types are allowed in unions, type punning with buffer pointer types is disallowed as it is with all other types in HLSL. Specifically, when a member of a union is defined, all other members become undefined, no matter the types. + ## SPIR-V Appendices ### Appendix A: SPIR-V for RawBufferLoad