|
1266 | 1266 | }
|
1267 | 1267 | case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: {
|
1268 | 1268 | auto* sampLocnProps = (VkPhysicalDeviceSampleLocationsPropertiesEXT*)next;
|
1269 |
| - sampLocnProps->sampleLocationSampleCounts = _metalFeatures.supportedSampleCounts; |
| 1269 | + sampLocnProps->sampleLocationSampleCounts = _metalFeatures.supportedSamplePosCounts; |
1270 | 1270 | sampLocnProps->maxSampleLocationGridSize = kMVKSampleLocationPixelGridSize;
|
1271 | 1271 | sampLocnProps->sampleLocationCoordinateRange[0] = kMVKMinSampleLocationCoordinate;
|
1272 | 1272 | sampLocnProps->sampleLocationCoordinateRange[1] = kMVKMaxSampleLocationCoordinate;
|
|
1473 | 1473 | void MVKPhysicalDevice::getMultisampleProperties(VkSampleCountFlagBits samples,
|
1474 | 1474 | VkMultisamplePropertiesEXT* pMultisampleProperties) {
|
1475 | 1475 | if (pMultisampleProperties) {
|
1476 |
| - pMultisampleProperties->maxSampleLocationGridSize = (mvkIsOnlyAnyFlagEnabled(samples, _metalFeatures.supportedSampleCounts) |
| 1476 | + pMultisampleProperties->maxSampleLocationGridSize = (mvkIsOnlyAnyFlagEnabled(samples, _metalFeatures.supportedSamplePosCounts) |
1477 | 1477 | ? kMVKSampleLocationPixelGridSize
|
1478 | 1478 | : kMVKSampleLocationPixelGridSizeNotSupported);
|
1479 | 1479 | }
|
|
1521 | 1521 | }
|
1522 | 1522 | }
|
1523 | 1523 |
|
1524 |
| - // Metal does not support creating uncompressed views of compressed formats. |
| 1524 | + // These features require placement heaps to alias textures. |
| 1525 | + const auto placementHeapFlags = VK_IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT | |
| 1526 | + VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT | |
| 1527 | + VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT; |
| 1528 | + if (!getMVKConfig().useMTLHeap && mvkIsAnyFlagEnabled(flags, placementHeapFlags)) { |
| 1529 | + return VK_ERROR_FORMAT_NOT_SUPPORTED; |
| 1530 | + } |
| 1531 | + |
1525 | 1532 | // Metal does not support split-instance images.
|
1526 |
| - if (mvkIsAnyFlagEnabled(flags, VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT | VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT)) { |
| 1533 | + if (mvkIsAnyFlagEnabled(flags, VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT)) { |
1527 | 1534 | return VK_ERROR_FORMAT_NOT_SUPPORTED;
|
1528 | 1535 | }
|
1529 | 1536 |
|
|
2834 | 2841 | for (uint32_t sc = VK_SAMPLE_COUNT_1_BIT; sc <= VK_SAMPLE_COUNT_64_BIT; sc <<= 1) {
|
2835 | 2842 | if ([_mtlDevice supportsTextureSampleCount: mvkSampleCountFromVkSampleCountFlagBits((VkSampleCountFlagBits)sc)]) {
|
2836 | 2843 | _metalFeatures.supportedSampleCounts |= sc;
|
| 2844 | + |
| 2845 | + // Metal asserts: "count (1) is not a supported sample count for custom positions." |
| 2846 | + if (sc != VK_SAMPLE_COUNT_1_BIT) { |
| 2847 | + _metalFeatures.supportedSamplePosCounts |= sc; |
| 2848 | + } |
2837 | 2849 | }
|
2838 | 2850 | }
|
2839 | 2851 |
|
|
0 commit comments