mcpp index

compat.spirv-headers

#include

Khronos SPIR-V headers (spirv/unified1)

#include <spirv/unified1/spirv.hpp>
mcpp add compat.spirv-headers@1.4.357.0

用法

来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。

// Behavioral test -- verify compat.spirv-headers delivers the Khronos include
// layout and definitions a SPIR-V READER needs.
//
// The criterion is deliberately not "the header compiles". A header-only
// package that resolves and exposes the wrong include root compiles nothing
// and fails at the consumer, so this test spells the include the way a
// consumer spells it and then decodes a module built by hand, which is the
// only thing that can tell a real header tree from an empty one.
#include <spirv/unified1/spirv.hpp>

import std;

int main() {
    // A minimal, well-formed SPIR-V module header: magic, version, generator,
    // bound, schema. Written as words rather than read from a file so the test
    // depends on nothing but the package under test.
    const std::uint32_t module_words[] = {
        spv::MagicNumber,
        spv::Version,
        0u,   // generator
        1u,   // bound
        0u,   // schema
// …

tests/examples/spirv-headers/tests/decode.cpp · 项目 tests/examples/spirv-headers

构建

targets
spirv-headers (lib)
language
c++23
C standard
c11
import std
no
include dirs
*/include

源文件 (1)

  • mcpp_generated/spirv_headers_anchor.c

生成的文件

  • mcpp_generated/spirv_headers_anchor.c

版本

版本平台 镜像sha256
1.4.357.0 最新 LinuxWindowsmacOS CN GLOBAL 4d703067a7e0…