Skip to content

Commit db616fb

Browse files
committed
fix(vulkan): make VK_NO_PROTOTYPES only apply to upstream Vulkan headers
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
1 parent 872b322 commit db616fb

2 files changed

Lines changed: 1 addition & 10 deletions

File tree

src/generator/c/templates/header.h.j2

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,9 +464,7 @@ extern {{ fs.context_name }} gloam_{{ fs.spec_name }}_context;
464464
{% if fs.is_vulkan -%}
465465
{# Vulkan: force-inlined function wrappers that dispatch through the global
466466
context struct. Unlike #define macros, these don't pollute the preprocessor
467-
namespace (avoids collisions with VMA, etc.). Guarded by VK_NO_PROTOTYPES
468-
so users who want raw PFN access can suppress them. #}
469-
#ifndef VK_NO_PROTOTYPES
467+
namespace (avoids collisions with VMA, etc.). #}
470468
{% for group in fs.cmd_pfn_groups -%}
471469
{% if group.protect | length > 0 -%}
472470
#if defined({{ group.protect | join(") && defined(") }})
@@ -480,7 +478,6 @@ GLOAM_FORCE_INLINE {{ cmd.return_type }} {{ cmd.name }}({{ cmd.params_str }}) {
480478
#endif
481479
{% endif -%}
482480
{% endfor -%}
483-
#endif /* VK_NO_PROTOTYPES */
484481
{% else -%}
485482
{# GL/EGL/GLX/WGL: macro dispatch with IntelliSense prototypes for IDE support. #}
486483
#ifdef __INTELLISENSE__

tests/generate_vulkan.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -395,12 +395,6 @@ fn vulkan_header_uses_inline_dispatch() {
395395
!header.contains("#define vkCreateInstance (gloam_vk_context."),
396396
"should not use #define macro dispatch for Vulkan"
397397
);
398-
399-
// VK_NO_PROTOTYPES guard.
400-
assert!(
401-
header.contains("#ifndef VK_NO_PROTOTYPES"),
402-
"dispatch wrappers should be guarded by VK_NO_PROTOTYPES"
403-
);
404398
}
405399

406400
// ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)