@@ -146,7 +146,7 @@ def gen(grammer_path, output_path):
146
146
processInst (writer , instruction , InstOptions (shape = Shape .PTR_TEMPLATE ))
147
147
case "Memory" :
148
148
processInst (writer , instruction , InstOptions (shape = Shape .PTR_TEMPLATE ))
149
- processInst (writer , instruction , InstOptions (shape = Shape .PSB_RT ))
149
+ processInst (writer , instruction , InstOptions (shape = Shape .BDA ))
150
150
case "Barrier" | "Bit" :
151
151
processInst (writer , instruction , InstOptions ())
152
152
case "Reserved" :
@@ -171,7 +171,7 @@ def gen(grammer_path, output_path):
171
171
class Shape (Enum ):
172
172
DEFAULT = 0 ,
173
173
PTR_TEMPLATE = 1 , # TODO: this is a DXC Workaround
174
- PSB_RT = 2 , # PhysicalStorageBuffer Result Type
174
+ BDA = 2 , # PhysicalStorageBuffer Result Type
175
175
176
176
class InstOptions (NamedTuple ):
177
177
shape : Shape = Shape .DEFAULT
@@ -257,9 +257,10 @@ def processInst(writer: io.TextIOWrapper, instruction, options: InstOptions):
257
257
case "'Pointer'" :
258
258
if options .shape == Shape .PTR_TEMPLATE :
259
259
args .append ("P " + operand_name )
260
- elif options .shape == Shape .PSB_RT :
260
+ elif options .shape == Shape .BDA :
261
261
if (not "typename T" in templates ) and (rt == "T" or op_ty == "T" ):
262
262
templates = ["typename T" ] + templates
263
+ overload_caps .append ("PhysicalStorageBufferAddresses" )
263
264
args .append ("pointer_t<spv::StorageClassPhysicalStorageBuffer, " + op_ty + "> " + operand_name )
264
265
else :
265
266
if (not "typename T" in templates ) and (rt == "T" or op_ty == "T" ):
@@ -280,8 +281,9 @@ def processInst(writer: io.TextIOWrapper, instruction, options: InstOptions):
280
281
case "IdMemorySemantics" : args .append (" uint32_t " + operand_name )
281
282
case "GroupOperation" : args .append ("[[vk::ext_literal]] uint32_t " + operand_name )
282
283
case "MemoryAccess" :
283
- writeInst (writer , templates , overload_caps , op_name , fn_name , conds , rt , args + ["[[vk::ext_literal]] uint32_t memoryAccess" ])
284
- writeInst (writer , templates , overload_caps , op_name , fn_name , conds , rt , args + ["[[vk::ext_literal]] uint32_t memoryAccess, [[vk::ext_literal]] uint32_t memoryAccessParam" ])
284
+ if options .shape != Shape .BDA :
285
+ writeInst (writer , templates , overload_caps , op_name , fn_name , conds , rt , args + ["[[vk::ext_literal]] uint32_t memoryAccess" ])
286
+ writeInst (writer , templates , overload_caps , op_name , fn_name , conds , rt , args + ["[[vk::ext_literal]] uint32_t memoryAccess, [[vk::ext_literal]] uint32_t memoryAccessParam" ])
285
287
writeInst (writer , templates + ["uint32_t alignment" ], overload_caps , op_name , fn_name , conds , rt , args + ["[[vk::ext_literal]] uint32_t __aligned = /*Aligned*/0x00000002" , "[[vk::ext_literal]] uint32_t __alignment = alignment" ])
286
288
case _: return # TODO
287
289
0 commit comments