MCPcopy Create free account
hub / github.com/alecazam/kram / GetAddressSpaceName

Method GetAddressSpaceName

hlslparser/src/MSLGenerator.cpp:321–351  ·  view source on GitHub ↗

Any reference or pointer must be qualified with address space in MSL

Source from the content-addressed store, hash-verified

319
320// Any reference or pointer must be qualified with address space in MSL
321const char* MSLGenerator::GetAddressSpaceName(HLSLBaseType baseType, HLSLAddressSpace addressSpace) const
322{
323 if (IsSamplerType(baseType)) {
324 return "thread";
325 }
326 if (IsTextureType(baseType)) {
327 return "thread";
328 }
329
330 // buffers also need to handle readonly (constant and const device) vs.
331 // readwrite (device).
332
333 switch (addressSpace) {
334 case HLSLAddressSpace_Constant:
335 return "constant";
336 case HLSLAddressSpace_Device:
337 return "device";
338 case HLSLAddressSpace_Thread:
339 return "thread";
340 case HLSLAddressSpace_Shared:
341 return "shared";
342 //case HLSLAddressSpace_Threadgroup: return "threadgroup_local";
343 //case HLSLAddressSpace_ThreadgroupImageblock: return "threadgroup_imageblock");
344
345 case HLSLAddressSpace_Undefined:
346 break;
347 }
348
349 Error("Unknown address space");
350 return "";
351}
352
353bool MSLGenerator::Generate(HLSLTree* tree, HLSLTarget target, const char* entryName, const MSLOptions& options)
354{

Callers

nothing calls this directly

Calls 2

IsSamplerTypeFunction · 0.85
IsTextureTypeFunction · 0.85

Tested by

no test coverage detected