{"id":27940536,"url":"https://github.com/khronosgroup/glslang","last_synced_at":"2025-05-14T11:08:37.134Z","repository":{"id":34208085,"uuid":"38064932","full_name":"KhronosGroup/glslang","owner":"KhronosGroup","description":"Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.","archived":false,"fork":false,"pushed_at":"2025-05-05T21:37:22.000Z","size":78214,"stargazers_count":3262,"open_issues_count":384,"forks_count":887,"subscribers_count":120,"default_branch":"main","last_synced_at":"2025-05-07T10:18:06.880Z","etag":null,"topics":["compiler","essl","glsl","glslang","glslangvalidator","hlsl","shader","spir-v","validator"],"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/KhronosGroup.png","metadata":{"files":{"readme":"README-spirv-remap.txt","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-06-25T17:54:39.000Z","updated_at":"2025-05-04T17:15:49.000Z","dependencies_parsed_at":"2023-10-24T17:35:23.049Z","dependency_job_id":"8843b8cc-4b87-4b95-ba10-c5f1e0c08935","html_url":"https://github.com/KhronosGroup/glslang","commit_stats":{"total_commits":3670,"total_committers":348,"mean_commits":"10.545977011494253","dds":0.5485013623978201,"last_synced_commit":"4da479aa6afa43e5a2ce4c4148c572a03123faf3"},"previous_names":[],"tags_count":102,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2Fglslang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2Fglslang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2Fglslang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2Fglslang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KhronosGroup","download_url":"https://codeload.github.com/KhronosGroup/glslang/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254129488,"owners_count":22019628,"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","essl","glsl","glslang","glslangvalidator","hlsl","shader","spir-v","validator"],"created_at":"2025-05-07T10:18:04.414Z","updated_at":"2025-05-14T11:08:37.084Z","avatar_url":"https://github.com/KhronosGroup.png","language":"C++","readme":"\nVERSION\n--------------------------------------------------------------------------------\nspirv-remap 0.97\n\nINTRO:\n--------------------------------------------------------------------------------\nspirv-remap is a utility to improve compression of SPIR-V binary files via\nentropy reduction, plus optional stripping of debug information and\nload/store optimization.  It transforms SPIR-V to SPIR-V, remapping IDs.  The\nresulting modules have an increased ID range (IDs are not as tightly packed\naround zero), but will compress better when multiple modules are compressed\ntogether, since compressor's dictionary can find better cross module\ncommonality.\n\nRemapping is accomplished via canonicalization.  Thus, modules can be\ncompressed one at a time with no loss of quality relative to operating on\nmany modules at once.  The command line tool operates on multiple modules\nonly in the trivial repetition sense, for ease of use.  The remapper API\nonly accepts a single module at a time.\n\nThere are two modes of use: command line, and a C++11 API.  Both are\ndescribed below.\n\nspirv-remap is currently in an alpha state.  Although there are no known\nremapping defects, it has only been exercised on one real world game shader\nworkload.\n\n\nFEEDBACK\n---------------------------------------------------------------------------------\nReport defects, enhancement requests, code improvements, etc by creating\nissues in the glslang repository at https://github.com/KhronosGroup/glslang\n\nCOMMAND LINE USAGE:\n--------------------------------------------------------------------------------\nExamples are given with a verbosity of one (-v), but more verbosity can be\nhad via -vv, -vvv, etc, or an integer parameter to --verbose, such as\n\"--verbose 4\".  With no verbosity, the command is silent and returns 0 on\nsuccess, and a positive integer error on failure.\n\nPre-built binaries for several OSs are available.  Examples presented are\nfor Linux.  Command line arguments can be provided in any order.\n\n1. Basic ID remapping\n\nPerform ID remapping on all shaders in \"*.spv\", writing new files with\nthe same basenames to /tmp/out_dir.\n\n  spirv-remap -v --map all --input *.spv --output /tmp/out_dir\n\n2. Perform all possible size reductions\n\n  spirv-remap-linux-64 -v --do-everything --input *.spv --output /tmp/out_dir\n\nNote that --do-everything is a synonym for:\n\n  --map all --dce all --opt all --strip all\n\nAPI USAGE:\n--------------------------------------------------------------------------------\n\nThe public interface to the remapper is defined in SPIRV/SPVRemapper.h as follows:\n\nnamespace spv {\n\nclass spirvbin_t\n{\npublic:\n   enum Options { ... };\n   spirvbin_t(int verbose = 0);  // construct\n\n   // remap an existing binary in memory\n   void remap(std::vector\u003cstd::uint32_t\u003e\u0026 spv, std::uint32_t opts = DO_EVERYTHING);\n\n   // Type for error/log handler functions\n   typedef std::function\u003cvoid(const std::string\u0026)\u003e errorfn_t;\n   typedef std::function\u003cvoid(const std::string\u0026)\u003e logfn_t;\n\n   // Register error/log handling functions (can be c/c++ fn, lambda fn, or functor)\n   static void registerErrorHandler(errorfn_t handler) { errorHandler = handler; }\n   static void registerLogHandler(logfn_t handler)     { logHandler   = handler; }\n};\n\n} // namespace spv\n\nThe class definition is in SPVRemapper.cpp.\n\nremap() accepts an std::vector of SPIR-V words, modifies them per the\nrequest given in 'opts', and leaves the 'spv' container with the result.\nIt is safe to instantiate one spirvbin_t per thread and process a different\nSPIR-V in each.\n\nThe \"opts\" parameter to remap() accepts a bit mask of desired remapping\noptions.  See REMAPPING AND OPTIMIZATION OPTIONS.\n\nOn error, the function supplied to registerErrorHandler() will be invoked.\nThis can be a standard C/C++ function, a lambda function, or a functor.\nThe default handler simply calls exit(5); The error handler is a static\nmember, so need only be set up once, not once per spirvbin_t instance.\n\nLog messages are supplied to registerLogHandler().  By default, log\nmessages are eaten silently.  The log handler is also a static member.\n\nBUILD DEPENDENCIES:\n--------------------------------------------------------------------------------\n 1. C++11 compatible compiler\n 2. cmake\n 3. glslang\n\n\nBUILDING\n--------------------------------------------------------------------------------\nThe standalone remapper is built along side glslang through its\nnormal build process.\n\n\nREMAPPING AND OPTIMIZATION OPTIONS\n--------------------------------------------------------------------------------\nAPI:\n   These are bits defined under spv::spirvbin_t::, and can be\n   bitwise or-ed together as desired.\n\n   MAP_TYPES      = canonicalize type IDs\n   MAP_NAMES      = canonicalize named data\n   MAP_FUNCS      = canonicalize function bodies\n   DCE_FUNCS      = remove dead functions\n   DCE_VARS       = remove dead variables\n   DCE_TYPES      = remove dead types\n   OPT_LOADSTORE  = optimize unneeded load/stores\n   MAP_ALL        = (MAP_TYPES | MAP_NAMES | MAP_FUNCS)\n   DCE_ALL        = (DCE_FUNCS | DCE_VARS | DCE_TYPES)\n   OPT_ALL        = (OPT_LOADSTORE)\n   ALL_BUT_STRIP  = (MAP_ALL | DCE_ALL | OPT_ALL)\n   DO_EVERYTHING  = (STRIP | ALL_BUT_STRIP)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhronosgroup%2Fglslang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhronosgroup%2Fglslang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhronosgroup%2Fglslang/lists"}