- 新增ShaderCompiler类,通过glslc工具实现GLSL到SPIR-V的编译。 - 实现构建glslc命令、运行编译器及从SPIR-V二进制文件提取反射数据的功能。 - 为SPIR-V指令集、装饰符、执行模型及存储类创建常量。 - 开发SPIR-V解析器以提取类型信息、变量细节及反射数据 - 引入类型映射函数实现SPIR-V类型到C++类型的转换,并计算std430内存布局 - 定义着色器元数据、编译结果及SPIR-V反射信息的数据类 - 添加着色器发现、分组及元数据加载的实用函数
48 lines
944 B
Python
48 lines
944 B
Python
#!/usr/bin/env python3
|
|
"""
|
|
GLSL Shader Compilation and C++ Binding Generation Tools
|
|
|
|
This package provides tools for compiling GLSL shaders to SPIR-V and generating
|
|
C++ bindings with automatic reflection and structure generation.
|
|
"""
|
|
|
|
from .compiler import ShaderCompiler
|
|
from .types import (
|
|
BindingInfo,
|
|
CompilationResult,
|
|
ShaderMetadata,
|
|
SPIRVReflection,
|
|
ToolError,
|
|
)
|
|
from .utils import (
|
|
DEFAULT_OUTPUT_DIR,
|
|
ROOT,
|
|
discover_shaders,
|
|
group_shader_files,
|
|
load_shader_metadata,
|
|
read_directory_list,
|
|
)
|
|
|
|
__all__ = [
|
|
# Main classes
|
|
"ShaderCompiler",
|
|
"ToolError",
|
|
|
|
# Data types
|
|
"BindingInfo",
|
|
"CompilationResult",
|
|
"ShaderMetadata",
|
|
"SPIRVReflection",
|
|
|
|
# Utility functions
|
|
"discover_shaders",
|
|
"group_shader_files",
|
|
"load_shader_metadata",
|
|
"read_directory_list",
|
|
|
|
# Constants
|
|
"ROOT",
|
|
"DEFAULT_OUTPUT_DIR",
|
|
]
|
|
|
|
__version__ = "1.0.0" |