{"id":13713214,"url":"https://github.com/google/shaderc","last_synced_at":"2025-05-13T17:05:22.336Z","repository":{"id":35985517,"uuid":"40277133","full_name":"google/shaderc","owner":"google","description":"A collection of tools, libraries, and tests for Vulkan shader compilation.","archived":false,"fork":false,"pushed_at":"2025-04-23T18:11:29.000Z","size":2581,"stargazers_count":1955,"open_issues_count":153,"forks_count":382,"subscribers_count":65,"default_branch":"main","last_synced_at":"2025-05-09T19:52:33.674Z","etag":null,"topics":["compiler","glsl","glslang","graphics","hlsl","shaderc","spirv","spirv-cross","vulkan"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-08-06T01:17:42.000Z","updated_at":"2025-05-09T17:23:37.000Z","dependencies_parsed_at":"2023-10-13T17:14:26.940Z","dependency_job_id":"c963f64b-c35e-426a-a728-0c4bec2d653a","html_url":"https://github.com/google/shaderc","commit_stats":{"total_commits":1018,"total_committers":81,"mean_commits":"12.567901234567902","dds":0.6404715127701375,"last_synced_commit":"db94deb06894ddc30acc9c1e9988b2afd8c08315"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fshaderc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fshaderc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fshaderc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fshaderc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/shaderc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253990460,"owners_count":21995774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler","glsl","glslang","graphics","hlsl","shaderc","spirv","spirv-cross","vulkan"],"created_at":"2024-08-02T23:01:29.731Z","updated_at":"2025-05-13T17:05:22.314Z","avatar_url":"https://github.com/google.png","language":"C++","readme":"# Shaderc\n\nA collection of tools, libraries and tests for shader compilation.\nAt the moment it includes:\n\n- [`glslc`](glslc), a command line compiler for GLSL/HLSL to SPIR-V, and\n- [`libshaderc`](libshaderc), a library API for accessing `glslc` functionality.\n\n**Note:** The fact that that `libshaderc` is not named `libshaderc_glslc` is a\nquirk of history, and a known inconsistency. Changing it would require a\nsignificant amount of renaming and breaking of downstream projects, so it is\nbeing left as is.\n\n`glslc` wraps around core functionality in [glslang][khr-glslang]\nand [SPIRV-Tools][spirv-tools]. `glslc` and its library aims to\nto provide:\n* a command line compiler with GCC- and Clang-like usage, for better\n  integration with build systems\n* an API where functionality can be added without breaking existing clients\n* an API supporting standard concurrency patterns across multiple\n  operating systems\n* increased functionality such as file `#include` support\n\n## Downloads\n\n**Note: These binaries are just the artifacts of the builders and have not\n  undergone any QA, thus they should be considered unsupported.**\n\n\u003cimg alt=\"Linux\" src=\"kokoro/img/linux.png\" width=\"20px\" height=\"20px\" hspace=\"2px\"/\u003e[![Linux Build Status](https://storage.googleapis.com/shaderc/badges/build_status_linux_clang_release.svg)](https://storage.googleapis.com/shaderc/badges/build_link_linux_clang_release.html)\n\u003cimg alt=\"MacOS\" src=\"kokoro/img/macos.png\" width=\"20px\" height=\"20px\" hspace=\"2px\"/\u003e[![MacOS Build Status](https://storage.googleapis.com/shaderc/badges/build_status_macos_clang_release.svg)](https://storage.googleapis.com/shaderc/badges/build_link_macos_clang_release.html)\n\u003cimg alt=\"Windows\" src=\"kokoro/img/windows.png\" width=\"20px\" height=\"20px\" hspace=\"2px\"/\u003e[![Windows Build Status](https://storage.googleapis.com/shaderc/badges/build_status_windows_vs2019_release.svg)](https://storage.googleapis.com/shaderc/badges/build_link_windows_vs2019_release.html)\n\n[More downloads](downloads.md)\n\n## Status\n\nShaderc has maintained backward compatibility for quite some time, and we\ndon't anticipate any breaking changes.\nOngoing enhancements are described in the [CHANGES](CHANGES) file.\n\nShaderc has been shipping in the\n[Android NDK](https://developer.android.com/ndk/index.html) since version r12b.\n(The NDK build uses sources from https://android.googlesource.com/platform/external/shaderc/.\nThose repos are downstream from GitHub.)\nWe currently require r25c.\n\nFor licensing terms, please see the [`LICENSE`](LICENSE) file.  If interested in\ncontributing to this project, please see [`CONTRIBUTING.md`](CONTRIBUTING.md).\n\nThis is not an official Google product (experimental or otherwise), it is just\ncode that happens to be owned by Google.  That may change if Shaderc gains\ncontributions from others.  See the [`CONTRIBUTING.md`](CONTRIBUTING.md) file\nfor more information. See also the [`AUTHORS`](AUTHORS) and\n[`CONTRIBUTORS`](CONTRIBUTORS) files.\n\n## File organization\n\n- `android_test/` : a small Android application to verify compilation\n- `cmake/`: CMake utility functions and configuration for Shaderc\n- `examples/`: Example programs\n- `glslc/`: an executable to compile GLSL to SPIR-V\n- `libshaderc/`: a library for compiling shader strings into SPIR-V\n- `libshaderc_util/`: a utility library used by multiple shaderc components\n- `third_party/`: third party open source packages; see below\n- `utils/`: utility scripts for Shaderc\n\nShaderc depends on glslang, the Khronos reference compiler for GLSL.\n\nShaderc depends on [SPIRV-Tools][spirv-tools] for assembling, disassembling,\nand transforming SPIR-V binaries.\n\nFor testing, Shaderc depends on:\n| Library | URL | Description |\n| -- | -- | -- |\n| Googletest | https://github.com/google/googletest | Testing framework |\n| Effcee | https://github.com/google/effcee | Stateful pattern matcher inspired by LLVM's FileCheck |\n| RE2 | https://github.com/google/re2 | Regular expression matcher |\n| Abseil | https://github.com/abseil/abseil-cpp | Common basic utilities in C++ |\n\nIn the following sections, `$SOURCE_DIR` is the directory you intend to clone\nShaderc into.\n\n## Getting and building Shaderc\n\n**If you only want prebuilt executables or libraries, see the\n[Downloads](#downloads) section.**\n\nThe rest of this section describes how to build Shaderc from sources.\n\nNote: Shaderc assumes Glslang supports HLSL compilation.  The instructions\nbelow assume you're building Glslang from sources, and in a subtree\nof `shaderc/third_party`.  In that scenario, Glslang's HLSL support\nis automatically enabled.  Shaderc also can be built using a Glslang\nfrom outside the `shaderc/third_party` tree.  In that case you must\nensure that that external Glslang is built with HLSL functionality.\nSee Glslang's `ENABLE_HLSL` CMake setting.)\n\n1) Check out the source code:\n\n```sh\ngit clone https://github.com/google/shaderc $SOURCE_DIR\ncd $SOURCE_DIR\n./utils/git-sync-deps\n```\n\n**Note:** The [known-good](https://github.com/google/shaderc/tree/known-good)\nbranch of the repository contains a\n[known_good.json](https://github.com/google/shaderc/blob/known-good/known_good.json)\nfile describing a set of repo URLs and specific commits that have been\ntested together.  This information is updated periodically, and typically\nmatches the latest update of these sources in the development branch\nof the Android NDK.\nThe `known-good` branch also contains a\n[update_shaderc.py](https://github.com/google/shaderc/blob/known-good/update_shaderc_sources.py)\nscript that will read the JSON file and checkout those specific commits for you.\n\n2) Ensure you have the requisite tools -- see the tools subsection below.\n\n3) Decide where to place the build output. In the following steps, we'll call it\n   `$BUILD_DIR`. Any new directory should work. We recommend building outside\n   the source tree, but it is also common to build in a (new) subdirectory of\n   `$SOURCE_DIR`, such as `$SOURCE_DIR/build`.\n\n4a) Build (and test) with Ninja on Linux or Windows:\n\n```sh\ncd $BUILD_DIR\ncmake -GNinja -DCMAKE_BUILD_TYPE={Debug|Release|RelWithDebInfo} $SOURCE_DIR\nninja\nctest # optional\n```\n\n4b) Or build (and test) with MSVC on Windows:\n\n```sh\ncd $BUILD_DIR\ncmake $SOURCE_DIR\ncmake --build . --config {Release|Debug|MinSizeRel|RelWithDebInfo}\nctest -C {Release|Debug|MinSizeRel|RelWithDebInfo}\n```\n\n4c) Or build with MinGW on Linux for Windows:\n\n```sh\ncd $BUILD_DIR\ncmake -GNinja -DCMAKE_BUILD_TYPE={Debug|Release|RelWithDebInfo} $SOURCE_DIR \\\n   -DCMAKE_TOOLCHAIN_FILE=$SOURCE_DIR/cmake/linux-mingw-toolchain.cmake\nninja\n```\n\nAfter a successful build, you should have a `glslc` executable somewhere under\nthe `$BUILD_DIR/glslc/` directory, as well as a `libshaderc` library somewhere\nunder the `$BUILD_DIR/libshaderc/` directory.\n\nThe default behavior on MSVC is to link with the static CRT. If you would like\nto change this behavior `-DSHADERC_ENABLE_SHARED_CRT` may be passed on the\ncmake configure line.\n\nSee [the libshaderc README](libshaderc/README.md) for more on using the library\nAPI in your project.\n\n### Tools you'll need\n\nFor building, testing, and profiling Shaderc, the following tools should be\ninstalled regardless of your OS:\n\n- A C++17 compiler. Recent versions of Clang, GCC, and MSVC work.\n- [CMake](http://www.cmake.org/) 3.14 or later: for generating compilation targets.\n    - Shaderc is tested with cmake 3.17.2\n- [Python 3](http://www.python.org/): for utility scripts and running the test suite.\n\nOn Linux, if cross compiling to Windows:\n- [`mingw`](http://www.mingw.org): A GCC-based cross compiler targeting Windows\n    so that generated executables use the Microsoft C runtime libraries.\n    The MinGW compiler must support C++17.\n\nOn Windows, the following tools should be installed and available on your path:\n\n- Visual Studio 2019 or later. Previous versions of Visual Studio may work but\n  are untested and unsupported.\n- Git - including the associated tools, Bash, `diff`.\n\nOptionally, the following tools may be installed on any OS:\n\n - [`asciidoctor`](http://asciidoctor.org/): for generating documentation.\n   - [`pygments.rb`](https://rubygems.org/gems/pygments.rb) required by\n     `asciidoctor` for syntax highlighting.\n\n### Building and running Shaderc using Docker\n\nPlease make sure you have the Docker engine\n[installed](https://docs.docker.com/engine/installation/) on your machine.\n\nTo create a Docker image containing Shaderc command line tools, issue the\nfollowing command in `${SOURCE_DIR}`: `docker build -t \u003cIMAGE-NAME\u003e .`.\nThe created image will have all the command line tools installed at\n`/usr/local` internally, and a data volume mounted at `/code`.\n\nAssume `\u003cIMAGE-NAME\u003e` is `shaderc/shaderc` from now on.\n\nTo invoke a tool from the above created image in a Docker container:\n\n```bash\ndocker run shaderc/shaderc glslc --version\n```\n\nAlternatively, you can mount a host directory (e.g., `example`) containing\nthe shaders you want to manipulate and run different kinds of tools via\nan interactive shell in the container:\n\n```bash\n$ docker run -i -t -v `pwd`/example:/code shaderc/shaderc\n/code $ ls\ntest.vert\n/code $ glslc -c -o - test.vert | spirv-dis\n```\n\n## Bug tracking\n\nWe track bugs using GitHub -- click on the \"Issues\" button on\n[the project's GitHub page](https://github.com/google/shaderc).\n\n## Bindings\n\nBindings are maintained by third parties, may contain content\noffered under a different license, and may reference or contain\nolder versions of Shaderc and its dependencies.\n\n* **Python:** [pyshaderc][pyshaderc]\n* **Rust:** [shaderc-rs][shaderc-rs]\n* **Go:** [gshaderc][gshaderc]\n* **.NET:** [shaderc.net][shadercdotnet]\n* **Common Lisp:** [shadercl][shaderccommonlisp]\n\n[khr-glslang]: https://github.com/KhronosGroup/glslang\n[spirv-tools]: https://github.com/KhronosGroup/SPIRV-Tools\n[spirv-cross]: https://github.com/KhronosGroup/SPIRV-Cross\n[pyshaderc]: https://github.com/realitix/pyshaderc\n[shaderc-rs]: https://github.com/google/shaderc-rs\n[appveyor]: https://ci.appveyor.com/project/dneto0/shaderc\n[dawn]: https://dawn.googlesource.com/dawn\n[gshaderc]: https://github.com/celer/gshaderc\n[shadercdotnet]: https://github.com/jpbruyere/shaderc.net\n[shaderccommonlisp]: https://github.com/JolifantoBambla/shadercl\n","funding_links":[],"categories":["Graphic Libraries \u0026 Renderers","\u003ca id=\"8c5a692b5d26527ef346687e047c5c21\"\u003e\u003c/a\u003e收集","Tools"],"sub_categories":["Data Management"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fshaderc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fshaderc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fshaderc/lists"}