百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

smol-v

> 编程语言
开源

SMOL-V: 类似于 Vulkan/Khronos SPIR-V,但体积更小。

353 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

SMOL-V: 类似于 Vulkan/Khronos SPIR-V,但体积更小。

SMOL-V: like Vulkan/Khronos SPIR-V, but smaller.

TL;DR: makes your SPIR-V shaders about 3x smaller, and decodes very fast. If you like to compress them with regular compressor like zlib/lz4/zstd, then smol-v before the compression can still make them 2x smaller.

Overview

SMOL-V encodes Vulkan/Khronos SPIR-V format programs into a form that is smoller, and is more compressible. Normally no changes to the programs are done; they decode into exactly same program as what was encoded. Optionally, debug information can be removed too.

SPIR-V is a very verbose format, several times larger than same programs expressed in other shader formats (e.g. DX11 bytecode, GLSL, DX9 bytecode etc.). The SSA-form with ever increasing IDs is not very appreciated by regular data compressors either. SMOL-V does several things to improve this:

  • Many words, especially ones that most often have small values, are encoded using "varint" scheme (1-5 bytes per word, with just one byte for values in 0..127 range).
  • Some IDs used in the program are delta-encoded, relative to previously seen IDs (e.g. Result IDs). Often instructions reference things that were computed just before, so this results in small deltas. These values are also encoded using "varint" scheme.
  • Reordering instruction opcodes so that the most common ones are the smallest values, for smaller varint encoding.
  • Encoding several instructions in a more compact form, e.g. the "typical DX11 bytecode -> HLSLcc -> glslang toolchain.

Results

As of 2024 Sep 23, results on 383 shaders (under tests/spirv-dumps) are:

Compressed with :
Raw        5948.7KB 100.0%
Remapper   5602.9KB  94.2%
SmolV      2020.9KB  34.0%
Compressed with zlib:
Raw        1550.6KB  26.1%
Remapper   1419.2KB  23.9%
SmolV       790.6KB  13.3%
Compressed with LZ4 HC:
Raw        1769.6KB  29.7%
Remapper   1551.1KB  26.1%
SmolV       823.1KB  13.8%
Compressed with Zstandard:
Raw        1125.5KB  18.9%
Remapper    887.4KB  14.9%
SmolV       573.1KB   9.6%
Compressed with Zstandard 20:
Raw         834.5KB  14.0%
Remapper    666.7KB  11.2%
SmolV       497.4KB   8.4%

Decoding these 383 shaders from SMOL-V back into SPIR-V takes 10.1ms (VS2022, x64 Release, AMD Ryzen 5950X, one thread).

  • "Raw" is just raw SPIR-V, with no extra processing.
  • "Remapper" is spirv-remap from glslang, with debug info stripping.
  • SmolV is what you're looking at, with debug info stripping too.
  • zlib, LZ4HC and Zstd are general compression algorithms at default settings (Zstd20 is Zstd compression with almost max setting of 20).
  • Compression is done on the whole blob of all the test programs (not individually for each program).

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C++compressionspir-vvulkan

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言