HLSLcc
所属分类:DirectX
开发工具:C++
文件大小:339KB
下载次数:0
上传日期:2022-07-31 17:59:25
上 传 者:
sh-1993
说明: DirectX着色器字节码交叉编译器
(DirectX shader bytecode cross compiler)
文件列表:
.editorconfig (2333, 2020-09-24)
CMakeLists.txt (1868, 2020-09-24)
include (0, 2020-09-24)
include\ShaderInfo.h (14725, 2020-09-24)
include\UnityInstancingFlexibleArraySize.h (963, 2020-09-24)
include\growing_array.h (1140, 2020-09-24)
include\hlslcc.h (31232, 2020-09-24)
include\hlslcc.hpp (35, 2020-09-24)
include\pstdint.h (26183, 2020-09-24)
license.txt (2777, 2020-09-24)
src (0, 2020-09-24)
src\ControlFlowGraph.cpp (28798, 2020-09-24)
src\ControlFlowGraphUtils.cpp (4943, 2020-09-24)
src\DataTypeAnalysis.cpp (31859, 2020-09-24)
src\Declaration.cpp (43, 2020-09-24)
src\HLSLCrossCompilerContext.cpp (13207, 2020-09-24)
src\HLSLcc.cpp (6907, 2020-09-24)
src\HLSLccToolkit.cpp (19590, 2020-09-24)
src\HLSLccTypes.natvis (393, 2020-09-24)
src\Instruction.cpp (11051, 2020-09-24)
src\LoopTransform.cpp (16200, 2020-09-24)
src\Operand.cpp (21663, 2020-09-24)
src\Shader.cpp (37618, 2020-09-24)
src\ShaderInfo.cpp (18704, 2020-09-24)
src\UseDefineChains.cpp (30145, 2020-09-24)
src\cbstring (0, 2020-09-24)
src\cbstring\bsafe.c (2355, 2020-09-24)
src\cbstring\bsafe.h (1222, 2020-09-24)
src\cbstring\bstraux.c (35228, 2020-09-24)
src\cbstring\bstraux.h (4972, 2020-09-24)
src\cbstring\bstrlib.c (97901, 2020-09-24)
src\cbstring\bstrlib.h (14388, 2020-09-24)
src\cbstring\bstrlib.txt (155250, 2020-09-24)
src\cbstring\license.txt (1514, 2020-09-24)
src\cbstring\porting.txt (7358, 2020-09-24)
src\cbstring\security.txt (10728, 2020-09-24)
src\decode.cpp (57889, 2020-09-24)
... ...
# HLSLcc
DirectX shader bytecode cross compiler.
Originally based on https://github.com/James-Jones/HLSLCrossCompiler.
This library takes DirectX bytecode as input, and translates it into the following languages:
- GLSL (OpenGL 3.2 and later)
- GLSL ES (OpenGL ES 2.0 and later)
- GLSL for Vulkan consumption (as input for Glslang to generate SPIR-V)
- Metal Shading Language
This library is used to generate all shaders in Unity for OpenGL, OpenGL ES 3.0+, Metal and Vulkan.
Changes from original HLSLCrossCompiler:
- Codebase changed to C++11, with major code reorganizations.
- Support for multiple language output backends (currently ToGLSL and ToMetal)
- Metal language output support
- Temp register type analysis: In DX bytecode the registers are typeless 32-bit 4-vectors. We do code analysis to infer the actual data types (to prevent the need for tons of bitcasts).
- Loop transformation: Detect constructs that look like for-loops and transform them back to their original form
- Support for partial precision variables in HLSL (min16float etc). Do extra analysis pass to infer the intended precision of samplers.
- Reflection interface to retrieve the shader inputs and their types.
- Lots of workarounds for various driver/shader compiler bugs.
- Lots of minor fixes and improvements for correctness
- Lots of Unity-specific tweaks to allow extending HLSL without having to change the D3D compiler itself.
## Note
This project is originally integrated into the Unity build systems. However, building this library should be fairly straightforward: just compile `src/*.cpp` (in C++11 mode!) and `src/cbstring/*.c` with the following include paths:
- include
- src/internal_includes
- src/cbstrinc
- src
Alternatively, a CMakeLists.txt is provided to build the project using cmake.
The main entry point is TranslateHLSLFromMem() function in HLSLcc.cpp (taking DX bytecode as input).
## Contributors
- Mikko Strandborg
- Juho Oravainen
- David Rogers
- Marton Ekler
- Antti Tapaninen
- Florian Penzkofer
- Alexey Orlov
- Povilas Kanapickas
- Aleksandr Kirillov
- Kay Chang
## License
MIT license for HLSLcc itself, BSD license for the bstring library. See license.txt.
近期下载者:
相关文件:
收藏者: