mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 23:58:50 +00:00
Merge pull request #3813 from tadeohepperle/fix-vulkan-codegen-arrays-as-proc-args
Fix `vender:vulkan` codegen for procedures with fixed size arrays are arguments
This commit is contained in:
+10
-10
@@ -94,15 +94,13 @@ def convert_type(t, prev_name, curr_name):
|
|||||||
if t == "":
|
if t == "":
|
||||||
return t
|
return t
|
||||||
|
|
||||||
|
if t.startswith("const"):
|
||||||
|
t = convert_type(t[6:], prev_name, curr_name)
|
||||||
|
|
||||||
elif t.endswith("*"):
|
elif t.endswith("*"):
|
||||||
elem = ""
|
|
||||||
pointer = "^"
|
pointer = "^"
|
||||||
if t.startswith("const"):
|
ttype = t[:len(t)-1]
|
||||||
ttype = t[6:len(t)-1]
|
elem = convert_type(ttype, prev_name, curr_name)
|
||||||
elem = convert_type(ttype, prev_name, curr_name)
|
|
||||||
else:
|
|
||||||
ttype = t[:len(t)-1]
|
|
||||||
elem = convert_type(ttype, prev_name, curr_name)
|
|
||||||
|
|
||||||
if curr_name.endswith("s") or curr_name.endswith("Table"):
|
if curr_name.endswith("s") or curr_name.endswith("Table"):
|
||||||
if prev_name.endswith("Count") or prev_name.endswith("Counts"):
|
if prev_name.endswith("Count") or prev_name.endswith("Counts"):
|
||||||
@@ -625,12 +623,14 @@ def parse_procedures(f):
|
|||||||
|
|
||||||
for rt, name, fields in data:
|
for rt, name, fields in data:
|
||||||
proc_name = no_vk(name)
|
proc_name = no_vk(name)
|
||||||
|
|
||||||
pf = []
|
pf = []
|
||||||
prev_name = ""
|
prev_name = ""
|
||||||
for type_, fname in re.findall(r"(?:\s*|)(.+?)\s*(\w+)(?:,|$)", fields):
|
for type_, fname, array_len in re.findall(r"(?:\s*|)(.+?)\s*(\w+)(?:\[(\d+)\])?(?:,|$)", fields):
|
||||||
curr_name = fix_arg(fname)
|
curr_name = fix_arg(fname)
|
||||||
pf.append((do_type(type_, prev_name, curr_name), curr_name))
|
ty = do_type(type_, prev_name, curr_name)
|
||||||
|
if array_len != "":
|
||||||
|
ty = f"^[{array_len}]{ty}"
|
||||||
|
pf.append((ty, curr_name))
|
||||||
prev_name = curr_name
|
prev_name = curr_name
|
||||||
|
|
||||||
data_fields = ', '.join(["{}: {}".format(n, t) for t, n in pf if t != ""])
|
data_fields = ', '.join(["{}: {}".format(n, t) for t, n in pf if t != ""])
|
||||||
|
|||||||
Vendored
+3
-3
@@ -259,7 +259,7 @@ ProcCmdResolveImage2KHR :: #type proc "system
|
|||||||
ProcCmdSetAlphaToCoverageEnableEXT :: #type proc "system" (commandBuffer: CommandBuffer, alphaToCoverageEnable: b32)
|
ProcCmdSetAlphaToCoverageEnableEXT :: #type proc "system" (commandBuffer: CommandBuffer, alphaToCoverageEnable: b32)
|
||||||
ProcCmdSetAlphaToOneEnableEXT :: #type proc "system" (commandBuffer: CommandBuffer, alphaToOneEnable: b32)
|
ProcCmdSetAlphaToOneEnableEXT :: #type proc "system" (commandBuffer: CommandBuffer, alphaToOneEnable: b32)
|
||||||
ProcCmdSetAttachmentFeedbackLoopEnableEXT :: #type proc "system" (commandBuffer: CommandBuffer, aspectMask: ImageAspectFlags)
|
ProcCmdSetAttachmentFeedbackLoopEnableEXT :: #type proc "system" (commandBuffer: CommandBuffer, aspectMask: ImageAspectFlags)
|
||||||
ProcCmdSetBlendConstants :: #type proc "system" (commandBuffer: CommandBuffer)
|
ProcCmdSetBlendConstants :: #type proc "system" (commandBuffer: CommandBuffer, blendConstants: ^[4]f32)
|
||||||
ProcCmdSetCheckpointNV :: #type proc "system" (commandBuffer: CommandBuffer, pCheckpointMarker: rawptr)
|
ProcCmdSetCheckpointNV :: #type proc "system" (commandBuffer: CommandBuffer, pCheckpointMarker: rawptr)
|
||||||
ProcCmdSetCoarseSampleOrderNV :: #type proc "system" (commandBuffer: CommandBuffer, sampleOrderType: CoarseSampleOrderTypeNV, customSampleOrderCount: u32, pCustomSampleOrders: [^]CoarseSampleOrderCustomNV)
|
ProcCmdSetCoarseSampleOrderNV :: #type proc "system" (commandBuffer: CommandBuffer, sampleOrderType: CoarseSampleOrderTypeNV, customSampleOrderCount: u32, pCustomSampleOrders: [^]CoarseSampleOrderCustomNV)
|
||||||
ProcCmdSetColorBlendAdvancedEXT :: #type proc "system" (commandBuffer: CommandBuffer, firstAttachment: u32, attachmentCount: u32, pColorBlendAdvanced: ^ColorBlendAdvancedEXT)
|
ProcCmdSetColorBlendAdvancedEXT :: #type proc "system" (commandBuffer: CommandBuffer, firstAttachment: u32, attachmentCount: u32, pColorBlendAdvanced: ^ColorBlendAdvancedEXT)
|
||||||
@@ -302,8 +302,8 @@ ProcCmdSetEvent2KHR :: #type proc "system
|
|||||||
ProcCmdSetExclusiveScissorEnableNV :: #type proc "system" (commandBuffer: CommandBuffer, firstExclusiveScissor: u32, exclusiveScissorCount: u32, pExclusiveScissorEnables: [^]b32)
|
ProcCmdSetExclusiveScissorEnableNV :: #type proc "system" (commandBuffer: CommandBuffer, firstExclusiveScissor: u32, exclusiveScissorCount: u32, pExclusiveScissorEnables: [^]b32)
|
||||||
ProcCmdSetExclusiveScissorNV :: #type proc "system" (commandBuffer: CommandBuffer, firstExclusiveScissor: u32, exclusiveScissorCount: u32, pExclusiveScissors: [^]Rect2D)
|
ProcCmdSetExclusiveScissorNV :: #type proc "system" (commandBuffer: CommandBuffer, firstExclusiveScissor: u32, exclusiveScissorCount: u32, pExclusiveScissors: [^]Rect2D)
|
||||||
ProcCmdSetExtraPrimitiveOverestimationSizeEXT :: #type proc "system" (commandBuffer: CommandBuffer, extraPrimitiveOverestimationSize: f32)
|
ProcCmdSetExtraPrimitiveOverestimationSizeEXT :: #type proc "system" (commandBuffer: CommandBuffer, extraPrimitiveOverestimationSize: f32)
|
||||||
ProcCmdSetFragmentShadingRateEnumNV :: #type proc "system" (commandBuffer: CommandBuffer, shadingRate: FragmentShadingRateNV)
|
ProcCmdSetFragmentShadingRateEnumNV :: #type proc "system" (commandBuffer: CommandBuffer, shadingRate: FragmentShadingRateNV, combinerOps: ^[2]FragmentShadingRateCombinerOpKHR)
|
||||||
ProcCmdSetFragmentShadingRateKHR :: #type proc "system" (commandBuffer: CommandBuffer, pFragmentSize: ^Extent2D)
|
ProcCmdSetFragmentShadingRateKHR :: #type proc "system" (commandBuffer: CommandBuffer, pFragmentSize: ^Extent2D, combinerOps: ^[2]FragmentShadingRateCombinerOpKHR)
|
||||||
ProcCmdSetFrontFace :: #type proc "system" (commandBuffer: CommandBuffer, frontFace: FrontFace)
|
ProcCmdSetFrontFace :: #type proc "system" (commandBuffer: CommandBuffer, frontFace: FrontFace)
|
||||||
ProcCmdSetFrontFaceEXT :: #type proc "system" (commandBuffer: CommandBuffer, frontFace: FrontFace)
|
ProcCmdSetFrontFaceEXT :: #type proc "system" (commandBuffer: CommandBuffer, frontFace: FrontFace)
|
||||||
ProcCmdSetLineRasterizationModeEXT :: #type proc "system" (commandBuffer: CommandBuffer, lineRasterizationMode: LineRasterizationModeEXT)
|
ProcCmdSetLineRasterizationModeEXT :: #type proc "system" (commandBuffer: CommandBuffer, lineRasterizationMode: LineRasterizationModeEXT)
|
||||||
|
|||||||
Reference in New Issue
Block a user