mcpp index

compat.spirv-reflect

#include

Khronos SPIRV-Reflect — reflection of descriptor bindings and interfaces from SPIR-V modules

#include <spirv_reflect.h>
mcpp add compat.spirv-reflect@1.4.357.0

用法

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

// compat.spirv-reflect — reflect a REAL compute shader and assert the bindings
// come back with the values the shader declared.
//
// The module below is the SPIR-V that glslc emits for this GLSL:
//
//     #version 450
//     layout(set = 0, binding = 3, std430) buffer Data   { float values[]; } data;
//     layout(set = 1, binding = 0)         uniform Params { vec4 tint; }  params;
//     layout(push_constant)                uniform Push   { mat4 mvp;  }  push;
//     layout(local_size_x = 64) in;
//     void main() { data.values[gl_GlobalInvocationID.x] *= params.tint.x + push.mvp[0][0]; }
//
// It is embedded as words rather than compiled at test time so the test needs
// no shader compiler on the runner. Two sets, two different descriptor types, a
// non-zero binding number and a push-constant block mean a stub that returned
// zeroed structures could not pass.
#include <spirv_reflect.h>
import std;

namespace {
// glslc -fshader-stage=compute, SPIR-V 1.0 / Vulkan 1.0
constexpr std::uint32_t kComputeSpv[] = {
// …

tests/examples/spirv-reflect/tests/reflect.cpp · 项目 tests/examples/spirv-reflect

构建

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

源文件 (1)

  • */spirv_reflect.c

版本

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