Any reference or pointer must be qualified with address space in MSL
| 319 | |
| 320 | // Any reference or pointer must be qualified with address space in MSL |
| 321 | const 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 | |
| 353 | bool MSLGenerator::Generate(HLSLTree* tree, HLSLTarget target, const char* entryName, const MSLOptions& options) |
| 354 | { |
nothing calls this directly
no test coverage detected