summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYilong Li <liyl@google.com>2022-01-04 02:18:20 -0800
committerYilong Li <liyl@google.com>2022-01-04 15:02:04 -0800
commitf5ce3cee359635c7a493e18f058d3f080426881e (patch)
treec02012676d7706ba23e243b0a0292edb31ae2422
parente22c148f2c13328c6e504419f630aa0032f76c7c (diff)
downloadgfxstream-protocols-f5ce3cee359635c7a493e18f058d3f080426881e.tar.gz
vulkan-198[3]: Add 1.2.198 structs for special handling
Some structs in Vulkan 1.2.198 contains bitfields and need special handling when marshaling / unmarshaling the structs. Bug: 187216205 Change-Id: Iad30ec94a1cd0e3a22d40d743f9f4f98a2edd2db
-rw-r--r--registry/vulkan/xml/cereal/marshalingdefs.py102
1 files changed, 102 insertions, 0 deletions
diff --git a/registry/vulkan/xml/cereal/marshalingdefs.py b/registry/vulkan/xml/cereal/marshalingdefs.py
index a351d86d..19b08d12 100644
--- a/registry/vulkan/xml/cereal/marshalingdefs.py
+++ b/registry/vulkan/xml/cereal/marshalingdefs.py
@@ -404,6 +404,108 @@ memcpy((uint64_t*)&{newInputVarName}->accelerationStructureReference, *ptr, size
*ptr += sizeof(uint64_t);
""",
},
+ "VkAccelerationStructureMatrixMotionInstanceNV": {
+ "common": """
+typedef struct VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields {
+ VkTransformMatrixKHR transformT0;
+ VkTransformMatrixKHR transformT1;
+ uint32_t dwords[2];
+ uint64_t accelerationStructureReference;
+} VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields;
+""",
+ "marshaling": """
+const VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields* {newInputVarName} = (const VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields*)({inputVarName});
+marshal_VkTransformMatrixKHR({streamVarName}, {rootTypeVarName}, (VkTransformMatrixKHR*)(&{newInputVarName}->transformT0));
+marshal_VkTransformMatrixKHR({streamVarName}, {rootTypeVarName}, (VkTransformMatrixKHR*)(&{newInputVarName}->transformT1));
+for (uint32_t i = 0; i < 2; i++) {{
+ {streamVarName}->write((uint32_t*)&({newInputVarName}->dwords[i]), sizeof(uint32_t));
+}}
+{streamVarName}->write((uint64_t*)&{newInputVarName}->accelerationStructureReference, sizeof(uint64_t));
+""",
+ "unmarshaling": """
+VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields* {newInputVarName} = (VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields*)({inputVarName});
+unmarshal_VkTransformMatrixKHR({streamVarName}, {rootTypeVarName}, (VkTransformMatrixKHR*)(&{newInputVarName}->transformT0));
+unmarshal_VkTransformMatrixKHR({streamVarName}, {rootTypeVarName}, (VkTransformMatrixKHR*)(&{newInputVarName}->transformT1));
+for (uint32_t i = 0; i < 2; i++) {{
+ {streamVarName}->read((uint32_t*)&({newInputVarName}->dwords[i]), sizeof(uint32_t));
+}}
+{streamVarName}->read((uint64_t*)&{newInputVarName}->accelerationStructureReference, sizeof(uint64_t));
+""",
+ "reservedmarshaling": """
+(void)vkStream;
+const VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields* {newInputVarName} = (const VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields*)({inputVarName});
+reservedmarshal_VkTransformMatrixKHR({streamVarName}, {rootTypeVarName}, (VkTransformMatrixKHR*)(&{newInputVarName}->transformT0), ptr);
+reservedmarshal_VkTransformMatrixKHR({streamVarName}, {rootTypeVarName}, (VkTransformMatrixKHR*)(&{newInputVarName}->transformT1), ptr);
+for (uint32_t i = 0; i < 2; i++) {{
+ memcpy(*ptr, (uint32_t*)&({newInputVarName}->dwords[i]), sizeof(uint32_t));
+ *ptr += sizeof(uint32_t);
+}}
+memcpy(*ptr, (uint64_t*)&{newInputVarName}->accelerationStructureReference, sizeof(uint64_t));
+*ptr += sizeof(uint64_t);
+""",
+ "reservedunmarshaling": """
+VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields* {newInputVarName} = (VkAccelerationStructureMatrixMotionInstanceNVWithoutBitFields*)({inputVarName});
+reservedunmarshal_VkTransformMatrixKHR({streamVarName}, {rootTypeVarName}, (VkTransformMatrixKHR*)(&{newInputVarName}->transformT0), ptr);
+reservedunmarshal_VkTransformMatrixKHR({streamVarName}, {rootTypeVarName}, (VkTransformMatrixKHR*)(&{newInputVarName}->transformT1), ptr);
+for (uint32_t i = 0; i < 2; i++) {{
+ memcpy((uint32_t*)&({newInputVarName}->dwords[i]), *ptr, sizeof(uint32_t));
+ *ptr += sizeof(uint32_t);
+}}
+memcpy((uint64_t*)&{newInputVarName}->accelerationStructureReference, *ptr, sizeof(uint64_t));
+*ptr += sizeof(uint64_t);
+""",
+ },
+ "VkAccelerationStructureSRTMotionInstanceNV": {
+ "common": """
+typedef struct VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields {
+ VkSRTDataNV transformT0;
+ VkSRTDataNV transformT1;
+ uint32_t dwords[2];
+ uint64_t accelerationStructureReference;
+} VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields;
+""",
+ "marshaling": """
+const VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields* {newInputVarName} = (const VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields*)({inputVarName});
+marshal_VkSRTDataNV({streamVarName}, {rootTypeVarName}, (VkSRTDataNV*)(&{newInputVarName}->transformT0));
+marshal_VkSRTDataNV({streamVarName}, {rootTypeVarName}, (VkSRTDataNV*)(&{newInputVarName}->transformT1));
+for (uint32_t i = 0; i < 2; i++) {{
+ {streamVarName}->write((uint32_t*)&({newInputVarName}->dwords[i]), sizeof(uint32_t));
+}}
+{streamVarName}->write((uint64_t*)&{newInputVarName}->accelerationStructureReference, sizeof(uint64_t));
+""",
+ "unmarshaling": """
+VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields* {newInputVarName} = (VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields*)({inputVarName});
+unmarshal_VkSRTDataNV({streamVarName}, {rootTypeVarName}, (VkSRTDataNV*)(&{newInputVarName}->transformT0));
+unmarshal_VkSRTDataNV({streamVarName}, {rootTypeVarName}, (VkSRTDataNV*)(&{newInputVarName}->transformT1));
+for (uint32_t i = 0; i < 2; i++) {{
+ {streamVarName}->read((uint32_t*)&({newInputVarName}->dwords[i]), sizeof(uint32_t));
+}}
+{streamVarName}->read((uint64_t*)&{newInputVarName}->accelerationStructureReference, sizeof(uint64_t));
+""",
+ "reservedmarshaling": """
+(void)vkStream;
+const VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields* {newInputVarName} = (const VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields*)({inputVarName});
+reservedmarshal_VkSRTDataNV({streamVarName}, {rootTypeVarName}, (VkSRTDataNV*)(&{newInputVarName}->transformT0), ptr);
+reservedmarshal_VkSRTDataNV({streamVarName}, {rootTypeVarName}, (VkSRTDataNV*)(&{newInputVarName}->transformT1), ptr);
+for (uint32_t i = 0; i < 2; i++) {{
+ memcpy(*ptr, (uint32_t*)&({newInputVarName}->dwords[i]), sizeof(uint32_t));
+ *ptr += sizeof(uint32_t);
+}}
+memcpy(*ptr, (uint64_t*)&{newInputVarName}->accelerationStructureReference, sizeof(uint64_t));
+*ptr += sizeof(uint64_t);
+""",
+ "reservedunmarshaling": """
+VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields* {newInputVarName} = (VkAccelerationStructureSRTMotionInstanceNVWithoutBitFields*)({inputVarName});
+reservedunmarshal_VkSRTDataNV({streamVarName}, {rootTypeVarName}, (VkSRTDataNV*)(&{newInputVarName}->transformT0), ptr);
+reservedunmarshal_VkSRTDataNV({streamVarName}, {rootTypeVarName}, (VkSRTDataNV*)(&{newInputVarName}->transformT1), ptr);
+for (uint32_t i = 0; i < 2; i++) {{
+ memcpy((uint32_t*)&({newInputVarName}->dwords[i]), *ptr, sizeof(uint32_t));
+ *ptr += sizeof(uint32_t);
+}}
+memcpy((uint64_t*)&{newInputVarName}->accelerationStructureReference, *ptr, sizeof(uint64_t));
+*ptr += sizeof(uint64_t);
+""",
+ },
"VkXcbSurfaceCreateInfoKHR": {
"common": """
// This struct should never be marshaled / unmarshaled.