# News
1. Visual Studio 2013 is no longer supported
[As scheduled](https://github.com/KhronosGroup/glslang/blob/9eef54b2513ca6b40b47b07d24f453848b65c0df/README.md#planned-deprecationsremovals),
Microsoft Visual Studio 2013 is no longer officially supported. \
Please upgrade to at least Visual Studio 2015.
2. The versioning scheme is being improved, and you might notice some differences. This is currently WIP, but will be coming soon. See, for example, PR #2277.
3. If you get a new **compilation error due to a missing header**, it might be caused by this planned removal:
**SPIRV Folder, 1-May, 2020.** Glslang, when installed through CMake,
will install a `SPIRV` folder into `${CMAKE_INSTALL_INCLUDEDIR}`.
This `SPIRV` folder is being moved to `glslang/SPIRV`.
During the transition the `SPIRV` folder will be installed into both locations.
The old install of `SPIRV/` will be removed as a CMake install target no sooner than May 1, 2020.
See issue #1964.
If people are only using this location to get spirv.hpp, I recommend they get that from [SPIRV-Headers](https://github.com/KhronosGroup/SPIRV-Headers) instead.
[![appveyor status](https://ci.appveyor.com/api/projects/status/q6fi9cb0qnhkla68/branch/master?svg=true)](https://ci.appveyor.com/project/Khronoswebmaster/glslang/branch/master)
![Continuous Deployment](https://github.com/KhronosGroup/glslang/actions/workflows/continuous_deployment.yml/badge.svg)
# Glslang Components and Status
There are several components:
### Reference Validator and GLSL/ESSL -> AST Front End
An OpenGL GLSL and OpenGL|ES GLSL (ESSL) front-end for reference validation and translation of GLSL/ESSL into an internal abstract syntax tree (AST).
**Status**: Virtually complete, with results carrying similar weight as the specifications.
### HLSL -> AST Front End
An HLSL front-end for translation of an approximation of HLSL to glslang's AST form.
**Status**: Partially complete. Semantics are not reference quality and input is not validated.
This is in contrast to the [DXC project](https://github.com/Microsoft/DirectXShaderCompiler), which receives a much larger investment and attempts to have definitive/reference-level semantics.
See [issue 362](https://github.com/KhronosGroup/glslang/issues/362) and [issue 701](https://github.com/KhronosGroup/glslang/issues/701) for current status.
### AST -> SPIR-V Back End
Translates glslang's AST to the Khronos-specified SPIR-V intermediate language.
**Status**: Virtually complete.
### Reflector
An API for getting reflection information from the AST, reflection types/variables/etc. from the HLL source (not the SPIR-V).
**Status**: There is a large amount of functionality present, but no specification/goal to measure completeness against. It is accurate for the input HLL and AST, but only approximate for what would later be emitted for SPIR-V.
### Standalone Wrapper
`glslangValidator` is command-line tool for accessing the functionality above.
Status: Complete.
Tasks waiting to be done are documented as GitHub issues.
## Other References
Also see the Khronos landing page for glslang as a reference front end:
https://www.khronos.org/opengles/sdk/tools/Reference-Compiler/
The above page, while not kept up to date, includes additional information regarding glslang as a reference validator.
# How to Use Glslang
## Execution of Standalone Wrapper
To use the standalone binary form, execute `glslangValidator`, and it will print
a usage statement. Basic operation is to give it a file containing a shader,
and it will print out warnings/errors and optionally an AST.
The applied stage-specific rules are based on the file extension:
* `.vert` for a vertex shader
* `.tesc` for a tessellation control shader
* `.tese` for a tessellation evaluation shader
* `.geom` for a geometry shader
* `.frag` for a fragment shader
* `.comp` for a compute shader
For ray tracing pipeline shaders:
* `.rgen` for a ray generation shader
* `.rint` for a ray intersection shader
* `.rahit` for a ray any-hit shader
* `.rchit` for a ray closest-hit shader
* `.rmiss` for a ray miss shader
* `.rcall` for a callable shader
There is also a non-shader extension:
* `.conf` for a configuration file of limits, see usage statement for example
## Building (CMake)
Instead of building manually, you can also download the binaries for your
platform directly from the [master-tot release][master-tot-release] on GitHub.
Those binaries are automatically uploaded by the buildbots after successful
testing and they always reflect the current top of the tree of the master
branch.
### Dependencies
* A C++11 compiler.
(For MSVS: use 2015 or later.)
* [CMake][cmake]: for generating compilation targets.
* make: _Linux_, ninja is an alternative, if configured.
* [Python 3.x][python]: for executing SPIRV-Tools scripts. (Optional if not using SPIRV-Tools and the 'External' subdirectory does not exist.)
* [bison][bison]: _optional_, but needed when changing the grammar (glslang.y).
* [googletest][googletest]: _optional_, but should use if making any changes to glslang.
### Build steps
The following steps assume a Bash shell. On Windows, that could be the Git Bash
shell or some other shell of your choosing.
#### 1) Check-Out this project
```bash
cd <parent of where you want glslang to be>
git clone https://github.com/KhronosGroup/glslang.git
```
#### 2) Check-Out External Projects
```bash
cd <the directory glslang was cloned to, "External" will be a subdirectory>
git clone https://github.com/google/googletest.git External/googletest
```
TEMPORARY NOTICE: additionally perform the following to avoid a current
breakage in googletest:
```bash
cd External/googletest
git checkout 0c400f67fcf305869c5fb113dd296eca266c9725
cd ../..
```
If you wish to assure that SPIR-V generated from HLSL is legal for Vulkan,
wish to invoke -Os to reduce SPIR-V size from HLSL or GLSL, or wish to run the
integrated test suite, install spirv-tools with this:
```bash
./update_glslang_sources.py
```
#### 3) Configure
Assume the source directory is `$SOURCE_DIR` and the build directory is
`$BUILD_DIR`. First ensure the build directory exists, then navigate to it:
```bash
mkdir -p $BUILD_DIR
cd $BUILD_DIR
```
For building on Linux:
```bash
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$(pwd)/install" $SOURCE_DIR
# "Release" (for CMAKE_BUILD_TYPE) could also be "Debug" or "RelWithDebInfo"
```
For building on Android:
```bash
cmake $SOURCE_DIR -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DANDROID_ABI=arm64-v8a -DCMAKE_BUILD_TYPE=Release -DANDROID_STL=c++_static -DANDROID_PLATFORM=android-24 -DCMAKE_SYSTEM_NAME=Android -DANDROID_TOOLCHAIN=clang -DANDROID_ARM_MODE=arm -DCMAKE_MAKE_PROGRAM=$ANDROID_NDK_HOME/prebuilt/linux-x86_64/bin/make -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake
# If on Windows will be -DCMAKE_MAKE_PROGRAM=%ANDROID_NDK_HOME%\prebuilt\windows-x86_64\bin\make.exe
# -G is needed for building on Windows
# -DANDROID_ABI can also be armeabi-v7a for 32 bit
```
For building on Windows:
```bash
cmake $SOURCE_DIR -DCMAKE_INSTALL_PREFIX="$(pwd)/install"
# The CMAKE_INSTALL_PREFIX part is for testing (explained later).
```
The CMake GUI also works for Windows (version 3.4.1 tested).
Also, consider using `git config --global core.fileMode false` (or with `--local`) on Windows
to prevent the addition of execution permission on files.
#### 4) Build and Install
```bash
# for Linux:
make -j4 install
# for Windows:
cmake --build . --config Release --target install
# "Release" (for --config) could also be "Debug", "MinSizeRel", or "RelWithDebInfo"
```
If using MSVC, after running CMake to configure, use the
Configuration Manager to check the `INSTALL` project.
### Building
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
qtshadertools-everywhere-src-6.6.0.zip (290个子文件)
changes-6.0.0 681B
testexternalsampler.bat 204B
Qt6ShaderToolsMacros.cmake 13KB
storagebuffer.comp 1KB
imageloadstore.comp 699B
comp_buffer.comp 422B
comp_image.comp 384B
.cmake.conf 221B
glslang_tab.cpp 640KB
spirv_msl.cpp 600KB
spirv_glsl.cpp 560KB
Initialize.cpp 505KB
hlslParseHelper.cpp 440KB
ParseHelper.cpp 432KB
GlslangToSpv.cpp 413KB
spirv_hlsl.cpp 186KB
spirv_cross.cpp 159KB
doc.cpp 154KB
Intermediate.cpp 138KB
hlslGrammar.cpp 133KB
SpvBuilder.cpp 115KB
linkValidate.cpp 105KB
intermOut.cpp 89KB
hlslParseables.cpp 85KB
spirv_cross_c.cpp 85KB
ShaderLang.cpp 84KB
iomapper.cpp 76KB
Scan.cpp 74KB
Versions.cpp 65KB
Constant.cpp 61KB
tst_qshaderbaker.cpp 58KB
reflection.cpp 56KB
SPVRemapper.cpp 55KB
PpScanner.cpp 52KB
qspirvshader.cpp 51KB
Pp.cpp 50KB
qsb.cpp 44KB
propagateNoContraction.cpp 41KB
hlslScanContext.cpp 36KB
spirv_parser.cpp 35KB
qshaderbaker.cpp 31KB
disassemble.cpp 30KB
ParseContextBase.cpp 27KB
spirv_cross_parsed_ir.cpp 25KB
spirv_reflect.cpp 22KB
SpvPostProcess.cpp 21KB
glslang_c_interface.cpp 17KB
SymbolTable.cpp 17KB
spirv_cpp.cpp 16KB
spirv_cfg.cpp 14KB
qspirvcompiler.cpp 13KB
attribute.cpp 12KB
SpirvIntrinsics.cpp 12KB
tst_buildtimeqsb.cpp 11KB
SpvTools.cpp 10KB
PoolAlloc.cpp 10KB
IntermTraverse.cpp 8KB
PpTokens.cpp 8KB
parseConst.cpp 8KB
hlslAttributes.cpp 7KB
PpAtom.cpp 7KB
limits.cpp 7KB
ossource.cpp 6KB
InReadableOrder.cpp 6KB
hlslOpMap.cpp 6KB
qshaderrewriter.cpp 5KB
PpContext.cpp 5KB
InitializeDll.cpp 5KB
hlslTokenStream.cpp 5KB
ossource.cpp 4KB
spirv_c_interface.cpp 4KB
InfoSink.cpp 3KB
RemoveTree.cpp 3KB
Link.cpp 3KB
CodeGen.cpp 3KB
Logger.cpp 3KB
spirv_cross_util.cpp 3KB
main.cpp 2KB
qspirvshaderremap.cpp 1KB
main.cpp 592B
array.frag 1KB
array_of_struct_in_ubuf.frag 1KB
hlsl_cbuf_error.frag 1KB
hlsl_cbuf_error.frag 1KB
color_phong.frag 1KB
manyresources.frag 872B
manyresources.frag 872B
arrays_of_samplers.frag 870B
sampler_arrays.frag 827B
arrays_of_samplers.frag 783B
defines.frag 545B
combined_and_separate_samplers.frag 529B
texture_sep.frag 497B
wobble.frag 494B
sgtexture.frag 406B
cbuf.frag 371B
texture_sep_arr.frag 369B
preamble.frag 327B
texturesize.frag 304B
cbuf_without_inst.frag 293B
共 290 条
- 1
- 2
- 3
资源评论
三雷科技
- 粉丝: 4w+
- 资源: 388
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功