Commit 2052ba5
committed
vk_compute_demo: replace usage guards with #ifndef fallback defines
The #if defined(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME) guards
fixed the compile error on old Vulkan SDK headers but silently removed
the runtime portability detection on those headers — breaking macOS /
MoltenVK on any machine with an SDK older than 1.3.x.
The correct fix is to define local fallback constants when the header
doesn't provide them. Both values are fixed by the Vulkan spec, so
hardcoding them as fallbacks is safe across all SDK versions. The
runtime detection and flag assignment are now always compiled and
always run; on old-header Linux the strcmp never matches at runtime
(the extension isn't present there), so hasPortabilityEnum stays false
and behaviour is unchanged.
Also removes the (void)hasPortabilityEnum bandaid that the usage guards
had introduced.1 parent ca0518d commit 2052ba5
2 files changed
Lines changed: 20 additions & 16 deletions
File tree
- examples
- shader-coverage-bvh-traversal
- shader-coverage-image-pipeline
Lines changed: 10 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
9 | 19 | | |
10 | 20 | | |
11 | 21 | | |
| |||
18 | 28 | | |
19 | 29 | | |
20 | 30 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | 31 | | |
26 | 32 | | |
27 | 33 | | |
| |||
31 | 37 | | |
32 | 38 | | |
33 | 39 | | |
34 | | - | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
| |||
50 | 55 | | |
51 | 56 | | |
52 | 57 | | |
53 | | - | |
54 | 58 | | |
55 | 59 | | |
56 | | - | |
57 | | - | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| |||
Lines changed: 10 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
9 | 19 | | |
10 | 20 | | |
11 | 21 | | |
| |||
18 | 28 | | |
19 | 29 | | |
20 | 30 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | 31 | | |
26 | 32 | | |
27 | 33 | | |
| |||
31 | 37 | | |
32 | 38 | | |
33 | 39 | | |
34 | | - | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
| |||
50 | 55 | | |
51 | 56 | | |
52 | 57 | | |
53 | | - | |
54 | 58 | | |
55 | 59 | | |
56 | | - | |
57 | | - | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| |||
0 commit comments