本页内容

QShader::NativeShaderInfo Struct

struct QShader::NativeShaderInfo

关于原生着色器代码的附加元数据。更多内容...

公共变量

QMap<int, int> extraBufferBindings
int flags

详细描述

描述有关原生着色器代码的信息(如适用)。当从 SPIR-V 转换时,如果生成的着色器中引入了额外的“魔法”输入、输出或资源,这在某些着色器语言的特定着色器阶段中就变得尤为重要。 此类添加可能取决于原始源代码(即各种 GLSL 语言结构或内置函数的使用),因此,如果某些功能被添加到生成的着色器代码中,则需要以动态方式进行标注。

例如,考虑一个具有按补丁(而非按顶点)输出变量的细分控制着色器。该着色器会被编译为一个 Metal 计算着色器,其输出(除其他内容外)包含一个 spvPatchOut 缓冲区。但如果未使用按补丁的输出变量,则该缓冲区将完全不存在。 该结构体中的数据可表明着色器代码依赖于该缓冲区的存在。

注意:这是一个 兼容性保证有限的 RHI API,详情请参阅QShader 。

成员变量文档

QMap<int, int> NativeShaderInfo::extraBufferBindings

int NativeShaderInfo::flags

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.