A collection of tools, libraries, and tests for Vulkan shader compilation.

Overview

Shaderc

A collection of tools, libraries and tests for shader compilation. At the moment it includes:

  • glslc, a command line compiler for GLSL/HLSL to SPIR-V, and
  • libshaderc, a library API for accessing glslc functionality.

Note: The fact that that libshaderc is not named libshaderc_glslc is a quirk of history, and a known inconsistency. Changing it would require a significant amount of renaming and breaking of downstream projects, so it is being left as is.

glslc wraps around core functionality in glslang and SPIRV-Tools. glslc and its library aims to to provide:

  • a command line compiler with GCC- and Clang-like usage, for better integration with build systems
  • an API where functionality can be added without breaking existing clients
  • an API supporting standard concurrency patterns across multiple operating systems
  • increased functionality such as file #include support

Downloads

Note: These binaries are just the artifacts of the builders and have not undergone any QA, thus they should be considered unsupported.

LinuxLinux Build Status MacOSMacOS Build Status WindowsWindows Build Status

More downloads

Status

Shaderc has maintained backward compatibility for quite some time, and we don't anticipate any breaking changes. Ongoing enhancements are described in the CHANGES file.

Shaderc has been shipping in the Android NDK since version r12b. (The NDK build uses sources from https://android.googlesource.com/platform/external/shaderc/. Those repos are downstream from GitHub.) We currently require r18b.

For licensing terms, please see the LICENSE file. If interested in contributing to this project, please see CONTRIBUTING.md.

This is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google. That may change if Shaderc gains contributions from others. See the CONTRIBUTING.md file for more information. See also the AUTHORS and CONTRIBUTORS files.

File organization

  • android_test/ : a small Android application to verify compilation
  • cmake/: CMake utility functions and configuration for Shaderc
  • examples/: Example programs
  • glslc/: an executable to compile GLSL to SPIR-V
  • libshaderc/: a library for compiling shader strings into SPIR-V
  • libshaderc_util/: a utility library used by multiple shaderc components
  • third_party/: third party open source packages; see below
  • utils/: utility scripts for Shaderc

Shaderc depends on glslang, the Khronos reference compiler for GLSL.

Shaderc depends on SPIRV-Tools for assembling, disassembling, and transforming SPIR-V binaries.

Shaderc depends on the Google Test testing framework.

In the following sections, $SOURCE_DIR is the directory you intend to clone Shaderc into.

Getting and building Shaderc

If you only want prebuilt executables or libraries, see the Downloads section.

The rest of this section describes how to build Shaderc from sources.

Note: Shaderc assumes Glslang supports HLSL compilation. The instructions below assume you're building Glslang from sources, and in a subtree of shaderc/third_party. In that scenario, Glslang's HLSL support is automatically enabled. Shaderc also can be built using a Glslang from outside the shaderc/third_party tree. In that case you must ensure that that external Glslang is built with HLSL functionality. See Glslang's ENABLE_HLSL CMake setting.)

  1. Check out the source code:
git clone https://github.com/google/shaderc $SOURCE_DIR
cd $SOURCE_DIR
./utils/git-sync-deps

Note: The known-good branch of the repository contains a known_good.json file describing a set of repo URLs and specific commits that have been tested together. This information is updated periodically, and typically matches the latest update of these sources in the development branch of the Android NDK. The known-good branch also contains a update_shaderc.py script that will read the JSON file and checkout those specific commits for you.

  1. Ensure you have the requisite tools -- see the tools subsection below.

  2. Decide where to place the build output. In the following steps, we'll call it $BUILD_DIR. Any new directory should work. We recommend building outside the source tree, but it is also common to build in a (new) subdirectory of $SOURCE_DIR, such as $SOURCE_DIR/build.

4a) Build (and test) with Ninja on Linux or Windows:

cd $BUILD_DIR
cmake -GNinja -DCMAKE_BUILD_TYPE={Debug|Release|RelWithDebInfo} $SOURCE_DIR
ninja
ctest # optional

4b) Or build (and test) with MSVC on Windows:

cd $BUILD_DIR
cmake $SOURCE_DIR
cmake --build . --config {Release|Debug|MinSizeRel|RelWithDebInfo}
ctest -C {Release|Debug|MinSizeRel|RelWithDebInfo}

4c) Or build with MinGW on Linux for Windows: (Skip building threaded unit tests due to Googletest bug 606)

cd $BUILD_DIR
cmake -GNinja -DCMAKE_BUILD_TYPE={Debug|Release|RelWithDebInfo} $SOURCE_DIR \
   -DCMAKE_TOOLCHAIN_FILE=$SOURCE_DIR/cmake/linux-mingw-toolchain.cmake \
   -Dgtest_disable_pthreads=ON
ninja

After a successful build, you should have a glslc executable somewhere under the $BUILD_DIR/glslc/ directory, as well as a libshaderc library somewhere under the $BUILD_DIR/libshaderc/ directory.

The default behavior on MSVC is to link with the static CRT. If you would like to change this behavior -DSHADERC_ENABLE_SHARED_CRT may be passed on the cmake configure line.

See the libshaderc README for more on using the library API in your project.

Tools you'll need

For building, testing, and profiling Shaderc, the following tools should be installed regardless of your OS:

  • CMake: for generating compilation targets.
  • Python 3: for utility scripts and running the test suite.

On Linux, the following tools should be installed:

  • gcov: for testing code coverage, provided by the gcc package on Ubuntu.
  • lcov: a graphical frontend for gcov, provided by the lcov package on Ubuntu.
  • genhtml: for creating reports in html format from lcov output, provided by the lcov package on Ubuntu.

On Linux, if cross compiling to Windows:

  • mingw: A GCC-based cross compiler targeting Windows so that generated executables use the Microsoft C runtime libraries.

On Windows, the following tools should be installed and available on your path:

  • Visual Studio 2015 or later. Previous versions of Visual Studio may work but are untested and unsupported.
  • Git - including the associated tools, Bash, diff.

Optionally, the following tools may be installed on any OS:

Building and running Shaderc using Docker

Please make sure you have the Docker engine installed on your machine.

To create a Docker image containing Shaderc command line tools, issue the following command in ${SOURCE_DIR}: docker build -t <IMAGE-NAME> .. The created image will have all the command line tools installed at /usr/local internally, and a data volume mounted at /code.

Assume <IMAGE-NAME> is shaderc/shaderc from now on.

To invoke a tool from the above created image in a Docker container:

docker run shaderc/shaderc glslc --version

Alternatively, you can mount a host directory (e.g., example) containing the shaders you want to manipulate and run different kinds of tools via an interactive shell in the container:

$ docker run -i -t -v `pwd`/example:/code shaderc/shaderc
/code $ ls
test.vert
/code $ glslc -c -o - test.vert | spirv-dis

Bug tracking

We track bugs using GitHub -- click on the "Issues" button on the project's GitHub page.

Test coverage

On Linux, you can obtain test coverage as follows:

cd $BUILD_DIR
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DENABLE_CODE_COVERAGE=ON $SOURCE_DIR
ninja
ninja report-coverage

Then the coverage report can be found under the $BUILD_DIR/coverage-report directory.

Bindings

Bindings are maintained by third parties, may contain content offered under a different license, and may reference or contain older versions of Shaderc and its dependencies.

Issues
  • Roll third_party/googletest 176eccfb8f42..d7003576dd13 (2 commits)

    Roll third_party/googletest 176eccfb8f42..d7003576dd13 (2 commits)

    https://github.com/google/googletest.git /compare/176eccfb8f42..d7003576dd13

    git log 176eccfb8f42339b8ea2341e926f6835f7932bc4..d7003576dd133856432e2e07340f45926242cc3a --date=short --no-merges --format=%ad %ae %s 2019-06-17 [email protected] Googletest export 2019-06-17 [email protected] Googletest export

    The AutoRoll server is located here: https://autoroll.skia.org/r/googletest-shaderc-autoroll

    Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

    If the roll is causing failures, please contact the current sheriff ([email protected]), and stop the roller if necessary.

    autoroller: commit 
    opened by google-shaderc-autoroll 456
  • Roll third_party/re2 0c95bcce2f1f..848dfb7e1d7b (2 commits)

    Roll third_party/re2 0c95bcce2f1f..848dfb7e1d7b (2 commits)

    https://github.com/google/re2.git /compare/0c95bcce2f1f..848dfb7e1d7b

    git log 0c95bcce2f1f0f071a786ca2c42384b211b8caba..848dfb7e1d7ba641d598cb66f81590f3999a555a --date=short --no-merges --format=%ad %ae %s 2019-06-13 [email protected] Don't let DFA execution bail when slow for RE2::Set. 2019-06-13 [email protected] Expose FilteredRE2::GetRE2() as public.

    The AutoRoll server is located here: https://autoroll.skia.org/r/re2-shaderc-autoroll

    Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

    If the roll is causing failures, please contact the current sheriff ([email protected]), and stop the roller if necessary.

    autoroller: commit 
    opened by google-shaderc-autoroll 92
  • Use SHADERC_BUILD_SHARED to control static/shared library

    Use SHADERC_BUILD_SHARED to control static/shared library

    Previously we build both static and shared library at the same time. Because of that, we cannot name both the static and shared library as shaderc.

    This commit stops compiling both static and shared library. Instead we let the user choose now.

    kokoro:run 
    opened by antiagainst 23
  • Add pkg-config (.pc) file

    Add pkg-config (.pc) file

    pkg-config is the standard way to find C libraries on Linux and related systems. It's typical of libraries that intend to be used on Linux to package a pkg-config file.

    As far as I can tell, shaderc doesn't seem to include one.

    enhancement 
    opened by haasn 17
  • Fixing duplicate absolute install paths when using Visual Studio generators

    Fixing duplicate absolute install paths when using Visual Studio generators

    A slight bug occurs when running a cmake install on shaderc when using Visual Studio as a generator, where the source install file paths are incorrect. They contain a duplicate absolute path.

    This issue occurred when a pull request was merged in order to fix the Ninja build system back in this PR https://github.com/google/shaderc/pull/570

    The issue is fixed by relying on the shaderc_combine_static_lib() function to properly set an absolute path on the location of the shaderc_combined custom target.

    You can verify that this install behavior now works properly by running this on a Windows machine, generating for VS2017:

    git clone https://github.com/RikoOphorst/shaderc
    cd shaderc
    mkdir build
    cd build
    cmake ../ -G"Visual Studio 15 2017 Win64"
    cmake --build . --target install
    

    Apologies if I'm submitting this pull request incorrectly, this is the first time I've made a pull request in any repo.

    opened by RikoOphorst 14
  • Roll third_party/spirv-cross fce83b7e8b0f..5e9e8918f9a2 (37 commits)

    Roll third_party/spirv-cross fce83b7e8b0f..5e9e8918f9a2 (37 commits)

    https://github.com/KhronosGroup/SPIRV-Cross.git /compare/fce83b7e8b0f..5e9e8918f9a2

    git log fce83b7e8b0f6599efd4481992b2eb30f69f21de..5e9e8918f9a22d488811c575a97ccda2d8a8726d --date=short --no-merges --format=%ad %ae %s 2019-06-10 [email protected] Expand constexpr sampler sanity check. 2019-06-10 [email protected] MSL: Support remapping constexpr samplers by set/binding. 2019-06-10 [email protected] Employ heuristics to figure out how to emit SSBO/UAV reflection names. 2019-06-06 [email protected] Deal with nested loops. 2019-06-06 [email protected] Use the existing loop dominator when doing loop variable preservation. 2019-06-06 [email protected] Rewrite how loop dominators are propagated. 2019-06-06 [email protected] Deal with case where a variable is dominated by inner part of a loop. 2019-06-05 [email protected] Fix storage packing qualifiers missing on "shaderRecordNV" buffers 2019-06-05 [email protected] Add test for callable data 2019-06-05 [email protected] Fix callable data variables 2019-06-03 [email protected] Add support for "shaderRecordNV" qualifier 2019-06-05 [email protected] Deal with case where a block is somehow emitted in a duplicated fashion. 2019-06-02 [email protected] Fix erronous default for emit_line_directives. 2019-05-31 [email protected] MSL: Fix declaration of unused input variables. 2019-05-28 [email protected] Fixup OpLine parsing comments. 2019-05-28 [email protected] Support emitting OpLine directive. 2019-05-28 [email protected] GLSL: Support std430 in UBOs with scalar layout. 2019-05-27 [email protected] Run format_all.sh. 2019-05-27 [email protected] MSL: Use correct address space when passing array-of-buffers. 2019-05-27 [email protected]ntzen-software.no OpArrayLength must trigger active variables. 2019-05-27 [email protected] MSL: Implement OpArrayLength. 2019-05-24 [email protected] Add Git/timestamp --revision support. 2019-05-23 [email protected] MSL: Add test case for complex type alias. 2019-05-23 [email protected] MSL: Fix struct declaration order with complex type aliases. 2019-05-18 [email protected] Fix formatting, update C ABI version. 2019-05-09 [email protected] MSL: Support argument buffers and image swizzling. 2019-05-08 [email protected] Add get_member_name and active_buffer_ranges to C APIs 2019-05-17 [email protected] Fix spvc_type_get_vector_size C function. 2019-05-16 [email protected] Remove fallback for OpGroupNonUniformElect. 2019-05-15 [email protected] MSL: Add support for subgroup operations. 2019-05-14 [email protected] Only deploy on new tags. 2019-05-14 [email protected] Add setup for Github releases via Travis. 2019-05-14 [email protected] Validate that C ABI in CMakeLists.txt matches code. 2019-05-14 [email protected] Run format_all.sh. 2019-05-11 [email protected] GLSL: Add option to disable buffer blocks regardless of version 2019-05-13 [email protected] Fix nonuniform test for MSL. 2019-05-13 [email protected] HLSL/MSL: Deal correctly with nonuniformEXT qualifier.

    The AutoRoll server is located here: https://autoroll.skia.org/r/spirv-cross-shaderc-autoroll

    Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

    If the roll is causing failures, please contact the current sheriff ([email protected]), and stop the roller if necessary.

    autoroller: commit 
    opened by google-shaderc-autoroll 12
  • CMakeLists: enable CMAKE_MSVC_RUNTIME_LIBRARY property

    CMakeLists: enable CMAKE_MSVC_RUNTIME_LIBRARY property

    Support for different MSVC Runtime Library options. Example (when doing cmake setup): cmake -S ... -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL

    May also need to pass additional params to cmake setup: -DLLVM_USE_CRT_RELEASE=MD etc.

    This is used by glslang (3rd party lib) to configure the MSVC Runtime Library

    opened by jmoguillansky-gpsw 11
  • Roll third_party/re2 90970542fe95..0c95bcce2f1f (47 commits)

    Roll third_party/re2 90970542fe95..0c95bcce2f1f (47 commits)

    https://github.com/google/re2.git /compare/90970542fe95..0c95bcce2f1f

    git log 90970542fe952602f42150c6e71d086f5afebcb3..0c95bcce2f1f0f071a786ca2c42384b211b8caba --date=short --no-merges --format=%ad %ae %s 2019-05-22 [email protected] Add GCC 9.x to the Travis CI matrix. 2019-05-05 [email protected] Fix the bug in Regexp::ToString() that emitted [^]. 2019-04-19 [email protected] Set an ALIAS and a NAMESPACE in the CMake configuration. 2019-04-18 [email protected] Configure CMake to install the re2Config "export". 2019-04-17 [email protected] Address some clang-tidy gripes. 2019-04-11 [email protected] Update Consume's method comment re: empty matches. 2019-04-09 [email protected] Make the fuzzer check for large substrings as soon as possible. 2019-03-18 [email protected] Get rid of using std::string;. (part 7 of 7) 2019-03-18 [email protected] Get rid of using std::string;. (part 6 of N) 2019-03-18 [email protected] Get rid of using std::string;. (part 5 of N) 2019-03-18 [email protected] Get rid of using std::string;. (part 4 of N) 2019-03-18 [email protected] Get rid of using std::string;. (part 3 of N) 2019-03-18 [email protected] Get rid of using std::string;. (part 2 of N) 2019-03-18 [email protected] Get rid of using std::string;. (part 1 of N) 2019-03-14 [email protected] Make the BitState bitmap use list heads. 2019-03-13 [email protected] Make NFA use hints. 2019-03-11 [email protected] Avoid touching the bitmap even more. 2019-03-11 [email protected] Make BitState avoid touching the bitmap unnecessarily. 2019-03-10 [email protected] Give foldcase 1 bit and hint 15 bits. 2019-03-08 [email protected] Remove a bogus comment. 2019-03-08 [email protected] Handle foldcase when computing hints. Mea culpa. 2019-03-08 [email protected] Compute hints for ByteRange instructions. Make BitState use them. 2019-03-06 [email protected] Tidy up a call to fullrune(). 2019-03-05 [email protected] Fix a silly buffer underflow. 2019-03-05 [email protected] Implement run length encoding for BitState. 2019-03-04 [email protected] Simplify AltMatch and Capture handling in BitState. 2019-02-25 [email protected] Make the fuzzer handle \p and \P specially. 2019-02-25 [email protected] Check onepass_nodes_.data(), not .size(). 2019-02-25 [email protected] Use PODArray<> for OnePass nodes. 2019-02-13 [email protected] Update the Erlang wrapper URL. 2019-02-10 [email protected] Tidy up semicolons (mostly macro-related) in re2.h. 2019-01-31 [email protected] Clarify the scope of a comment. 2019-01-31 [email protected] Work around a bug in older versions of bash. :/ 2019-01-31 [email protected] Refactor the CMake scripts. 2019-01-31 [email protected] Use bash on Windows since Kokoro offers it. 2019-01-31 [email protected] Refactor the Bazel scripts. 2019-01-29 [email protected] Try using bash on Windows since Kokoro offers it. 2019-01-25 [email protected] Crudely limit the use of various character classes when fuzzing. 2019-01-21 [email protected] Oops, std::string_view requires C++17. 2019-01-21 [email protected] Support constructing StringPiece from std::string_view. 2019-01-21 [email protected] Add Clang 8 to the Travis CI matrix. 2019-01-11 [email protected] Avoid null PODArray<> issues in SparseSet and SparseArray<>. 2019-01-11 [email protected] Use PODArray<> in SparseArray<>. 2019-01-10 [email protected] Simplify SparseArray<> significantly. 2019-01-10 [email protected] Ensure we succeed at constructing new sparse and dense arrays. 2019-01-09 [email protected] Ensure we succeed at constructing new sparse and dense arrays. 2019-01-09 [email protected] Use PODArray<> in SparseSet.

    The AutoRoll server is located here: https://autoroll.skia.org/r/re2-shaderc-autoroll

    Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

    If the roll is causing failures, please contact the current sheriff ([email protected]), and stop the roller if necessary.

    autoroller: commit 
    opened by google-shaderc-autoroll 11
  • Roll third_party/glslang f88e5824d2cf..9866ad9195ce (33 commits)

    Roll third_party/glslang f88e5824d2cf..9866ad9195ce (33 commits)

    https://github.com/KhronosGroup/glslang.git /compare/f88e5824d2cf..9866ad9195ce

    git log f88e5824d2cfca5edc58c7c2101ec9a4ec36afac..9866ad9195cec8f266f16191fb4ec2ce4896e5c0 --date=short --no-merges --format=%ad %ae %s 2019-06-04 [email protected] Add support for GL_NV_shader_sm_builtins 2019-06-08 [email protected] GLSL: Revert f6873f7 to fix #1764. 2019-06-07 [email protected] Use spvValidatorOptionsSetBeforeHlslLegalization for pre-legalized HLSL 2019-06-06 [email protected] Uppdate spirv-tools known-good 2019-06-05 [email protected] Remove unused parameter 2019-06-04 [email protected] Add missing NV_EXTENSIONS ifdef 2019-06-03 [email protected] Support GL_ARB_fragment_shader_interlock 2019-05-27 [email protected] Fix subgroup support for ray tracing 2019-05-30 [email protected] Add AST tests for ray tracing shaders 2019-05-30 [email protected] Add AST tests for mesh and task shaders 2019-05-30 [email protected] Add more subgroup testing 2019-05-30 [email protected] Allow runtime-sized arrays of acceleration structures 2019-05-28 [email protected] Fix include guard for GL_EXT_multiview 2019-05-28 [email protected] Return consistent names from CapabilityString 2019-05-23 [email protected] Fixed .dll install on MSVC. 2019-05-17 [email protected] Remove non-source sources from binary targets 2019-05-16 [email protected] Build.gn: allow optimization in glslang lib and standalone 2019-05-16 [email protected] Update SPIRV-Tools, SPIRV-Headers 2019-05-10 [email protected] Build: Fix 3 warnings. 2019-05-10 [email protected] Bump version and revision. 2019-05-09 [email protected] SPV 1.4: Move to 1.4 validation, removing all 1.4 validation failures. 2019-03-31 [email protected] SPV 1.4: Emit SignExtend and ZeroExtend for integer image reads/writes. 2019-02-07 [email protected] SPV 1.4: Lookup tables: Use variable initializer and NonWritable... 2019-01-15 [email protected] SPV 1.4: Add support for OpCopyLogical, careful of Boolean differences. 2019-01-12 [email protected] SPV 1.4: Implement the 5 new loop controls. 2019-01-10 [email protected] SPV 1.4: Use OpSelect for trivial typed non-scalar/vector expressions. 2019-01-04 [email protected] SPV 1.4: Add testing infrastructure for SPV 1.4 tests. 2019-01-04 [email protected] SPV 1.4: Generate all globals on OpEntryPoint interface list. 2019-05-09 [email protected] SPV: Move to the SPIR-V 1.4 header. 2019-05-09 [email protected] Latest known-good SPIRV-Tools: WARNING: Needs python 3.x. 2019-05-09 [email protected] Bump revision. 2019-05-08 [email protected] For nonuniformEXT constructor, make a copy of the node to decorate 2019-03-08 [email protected] Add support for GL_EXT_buffer_reference2

    The AutoRoll server is located here: https://autoroll.skia.org/r/glslang-shaderc-autoroll

    Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

    If the roll is causing failures, please contact the current sheriff ([email protected]), and stop the roller if necessary.

    autoroller: commit 
    opened by google-shaderc-autoroll 11
  • Issue with scalers in the mpv project related to shaderc

    Issue with scalers in the mpv project related to shaderc

    I'm not sure how related this is to shaderc or spirv-tools, but users have reported that reverting to this commit of shaderc: https://github.com/google/shaderc/commit/583fb1326b02c9bec31096b93bf5938e0d16346b, fixes the issue, so I posted the initial issue report here.

    See https://github.com/mpv-player/mpv/issues/5695, for more details.

    opened by PapricaJim 11
  • Fix the link order of libglslang and libHLSL

    Fix the link order of libglslang and libHLSL

    libglslang depends on libHLSL, so the latter needs to be specified last. This fixes an issue when trying to build shaderc against system-wide versions of libglslang/libHLSL, rather than the in-tree versions from third_party.

    opened by haasn 10
  • shaderc_sharedd.dll

    shaderc_sharedd.dll

    I am running a program that has Vulkan and OpenGL installed as graphics libraries. When I run the program, I get an error that says shaderc_sharedd.dll not found. Not sure what this means.

    opened by TnVolsFan82 0
  • How to build shared library?

    How to build shared library?

    i compiled shardc from source in NDK r22b,and followed official guide below: https://developer.android.com/ndk/guides/graphics/shader-compilers

    CLI: step1: cd ${NDK_ROOT}/sources/third_party/shaderc/ step2: ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=Android.mk APP_STL:=c++_shared APP_ABI=all libshaderc_combined

    after a long time building ,i just got arm64\arm32 & x86\x64 static lib: libsharedc.a

    Dir tree of shaderc/libs is: image

    What's wrong with my CLI param ? or dynamic lib is unsupported? i tried to read Android.mk but it's a little bit complex to me.

    opened by FdyCN 0
  • Incorrect structure field in function call argument not reported

    Incorrect structure field in function call argument not reported

    Hello!

    I was refactoring a shader, made a mistake and stumbled on this behavior in glslc which I think is probably a bug.

    Consider the following small example code:

    #version 450
    
    struct S {
      uint x;
    };
    
    void f(uint a) { }
    
    void main() {
      S q = { 1 };
      f(q.y); // Field name is wrong.
    }
    

    Compiling this program produces no output warning or error from the glslc compiler. Currently using the following versions on Windows 10, version 21H2.

    • shaderc v2021.3 v2021.3
    • spirv-tools v2021.4 v2021.4
    • glslang 11.1.0-316-g600c5037
    • Target: SPIR-V 1.0

    (Since I am in the middle of some performance profiling and do not wish to change compiler versions right now I will try again with more up to date versions later and report back here.)

    So, is this expected behavior? Or have I misunderstood something about GLSL? (This is my first project using shaderc for separate compilation, so that may be the case.) I did some quick searching amongst the issues of this repo but I did not find anything that seemed related.

    Best wishes, Jon

    opened by jdyb 0
  • Assembly and source code interleaved

    Assembly and source code interleaved

    Any way to produce the assembly language listing with the original code lines also? Currently it's just the assembly and a bit hard to see where you are at in the code.

    I remember C compilers doing this by default. They'd have the source code line then a few assembly instructions for it below.

    opened by MattJohns 0
  • ./utils/git-sync-deps - non-zero exit status 128

    ./utils/git-sync-deps - non-zero exit status 128

    Tried to build on Ubuntu using /utils/git-sync-deps but the process produced some errors:

    root [projects] $ git clone [email protected]:google/shaderc.git
    Cloning into 'shaderc'...
    remote: Enumerating objects: 6768, done.
    remote: Counting objects: 100% (367/367), done.
    remote: Compressing objects: 100% (169/169), done.
    remote: Total 6768 (delta 205), reused 284 (delta 181), pack-reused 6401
    Receiving objects: 100% (6768/6768), 2.36 MiB | 6.03 MiB/s, done.
    Resolving deltas: 100% (4595/4595), done.
    root [projects] $ cd shaderc/
    root [shaderc] (main)$ ./utils/git-sync-deps
    third_party/effcee                   @ 2ec8f8738118cc483b67c04a759fee53496c5659
    fatal: reference is not a tree: b930e734ea198b7aabbbf04ee1562cf6f57962f0
    Exception in thread Thread-5:
    Traceback (most recent call last):
      File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
        self.run()
      File "/usr/lib/python3.8/threading.py", line 870, in run
        self._target(*self._args, **self._kwargs)
      File "./utils/git-sync-deps", line 186, in git_checkout_to_directory
        subprocess.check_call([git, 'checkout', '--quiet', checkoutable], cwd=directory)
      File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['git', 'checkout', '--quiet', 'b930e734ea198b7aabbbf04ee1562cf6f57962f0']' returned non-zero exit status 128.
    third_party/re2                      @ 7107ebc4fbf7205151d8d2a57b2fc6e7853125d4
    third_party/googletest               @ 389cb68b87193358358ae87cc56d257fd0d80189
    third_party/spirv-tools              @ b930e734ea198b7aabbbf04ee1562cf6f57962f0
    third_party/glslang                  @ 4c3e00bf960121c9a1729f1935ab7912b7f651a8
    
    opened by sylwesterdigital 0
Owner
Google
Google ❤️ Open Source
Google
A cross platform shader language with multi-threaded offline compilation or platform shader source code generation

A cross platform shader language with multi-threaded offline compilation or platform shader source code generation. Output json reflection info and c++ header with your shaders structs, fx-like techniques and compile time branch evaluation via (uber-shader) "permutations".

Alex Dixon 275 Jul 18, 2022
Shader cross compiler to translate HLSL (Shader Model 4 and 5) to GLSL

XShaderCompiler ("Cross Shader Compiler") Features Cross compiles HLSL shader code (Shader Model 4 and 5) into GLSL Simple to integrate into other pro

Lukas Hermanns 343 Aug 4, 2022
Shader Playground is a website for exploring shader compilers.

Shader Playground is a website for exploring shader compilers. Visit website Supported backends Compilers ANGLE Clspv DXC FXC Glslan

Tim Jones 421 Aug 4, 2022
GraphicsFuzz provides tools for automatically finding and simplifying bugs in graphics drivers, specifically graphics shader compilers.

GraphicsFuzz GraphicsFuzz is a set of tools for testing shader compilers GraphicsFuzz provides tools for automatically finding and simplifying bugs in

Google 502 Jul 27, 2022
Collection of Vulkan samples

This repository holds many samples, showing various aspect of Vulkan, debugging tips and usage of other Nvidia tools.

NVIDIA DesignWorks Samples 51 May 2, 2022
POCO C++ Libraries are powerful cross-platform C++ libraries for building network

The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems.

POCO C++ Libraries 6.2k Aug 2, 2022
Ziggified GLFW bindings with 100% API coverage, zero-fuss installation, cross compilation, and more.

mach/glfw - Ziggified GLFW bindings Ziggified GLFW bindings that Mach engine uses, with 100% API coverage, zero-fuss installation, cross compilation,

Hexops 171 Aug 8, 2022
This is a compilation of the code and images for all Arduino code in the Robotics 11 class.

Robotics 11 - Arduino This is a compilation of the code and images for all Arduino code in the Robotics 11 class. All code can be viewed in each proje

GuhBean 1 Oct 29, 2021
This is the source code for Mirai. The compilation method has been simplified a little and some modifications have been made.

Mirai BotNet to Tashiro(未来砲) Leaked Linux.Mirai Source Code for Research/IoT Development Purposes Uploaded for research purposes and so we can develop

われ 28 Jul 30, 2022
"Zero setup" cross-compilation for a wide variety of architectures.

"Zero setup" cross-compilation for a wide variety of architectures. xcross includes compact docker images and a build utility for minimal setup C/C++ cross-compiling, inspired by rust-embedded/cross

Alexander Huszagh 24 May 20, 2022
Fluid Visualization - The code compilation is only tested on Arch Linux x86_64

Fluid Visualization The code compilation is only tested on Arch Linux x86_64, Linux kernel 5.15.13-arch1, with gcc 11.1.0, CMake 3.22.1, Xorg X server

krr 2 Jan 30, 2022
Collection of cross-platform single-header C libraries for doing a lot of stuff! (Still WIP)

ice_libs Collection of cross-platform single-header C libraries for doing a lot of stuff! (Still WIP) Brief ice_libs is collection of Single-Header C

Rabia Alhaffar 115 Jul 18, 2022
Cloud Native Data Plane (CNDP) is a collection of user space libraries to accelerate packet processing for cloud applications.

CNDP - Cloud Native Data Plane Overview Cloud Native Data Plane (CNDP) is a collection of userspace libraries for accelerating packet processing for c

Cloud Native Data Plane 22 Jul 27, 2022
sbase is a collection of unix tools that are inherently portable across UNIX and UNIX-like systems.

sbase is a collection of unix tools that are inherently portable across UNIX and UNIX-like systems.

Anton Samokhvalov 1 Nov 1, 2021
An open collection of tools and experiments for rendering wide-gamut scene-linear data into an image for an SDR or HDR display device.

Open Display Transform An open collection of tools and experiments for rendering wide-gamut scene-linear data into an image for an SDR or HDR display

Jed Smith 121 Aug 8, 2022
CSE-7th-Semester-IIT-KGP - Tests, programming assignments and their solution for some courses offered by Department of Computer Science and Engineering, IIT Kharagpur

CSE-7th-Semester-IIT-KGP Disclaimer: Do not copy codes though. Heavy penalization for plagiarism. Programming assignments and their solution for some

Siba Smarak Panigrahi 2 Dec 30, 2021
Suckless-tools - My fork of suckless tools.

suckless-tools Here is my fork of suckless tools. I didn't include tabbed, i was using but not actively. I am using xfce4-terminal instead of st. Beca

null 2 Jan 7, 2022
A collection of tools made by the nerds @ axial

Tools created by Nerds @ AXIAL Tool Name: Vichiti Author: 0x9747 Domain: Open-source Intelligence Tool Name: FLAMES Author: Devisha Rochlani Domain: M

AXIAL 16 Oct 31, 2021
A collection of individual tools to randomize bdsp sheets

BDSP_Randomisers A collection of tools to randomize BDSP assets Setup (Windows 10 only) Install Ubuntu 18.04 via WSL1 (plenty of tutorials on that) In

null 6 Mar 1, 2022