aboutsummaryrefslogtreecommitdiff
path: root/tools/gen_spirv_spec.zig
AgeCommit message (Collapse)Author
2025-10-30std.debug.lockStderrWriter: also return ttyconfMatthew Lugg
`std.Io.tty.Config.detect` may be an expensive check (e.g. involving syscalls), and doing it every time we need to print isn't really necessary; under normal usage, we can compute the value once and cache it for the whole program's execution. Since anyone outputting to stderr may reasonably want this information (in fact they are very likely to), it makes sense to cache it and return it from `lockStderrWriter`. Call sites who do not need it will experience no significant overhead, and can just ignore the TTY config with a `const w, _` destructure.
2025-08-30update tools and other miscellaneous things to new APIsAndrew Kelley
2025-08-28update more to avoid GenericWriterAndrew Kelley
2025-08-11std.ArrayList: make unmanaged the defaultAndrew Kelley
2025-08-08zig std: fix build failuresAndrew Kelley
2025-08-04spirv: define and use extended instruction set opcodesAli Cheraghi
2025-08-02spirv: refactorAli Cheraghi
2025-07-16update compilerAndrew Kelley
2025-07-14spirv: snake-case the specAli Cheraghi
2025-07-07update standalone and incremental tests to new APIAndrew Kelley
2024-04-22ComptimeStringMap: return a regular struct and optimizeTravis Staloch
this patch renames ComptimeStringMap to StaticStringMap, makes it accept only a single type parameter, and return a known struct type instead of an anonymous struct. initial motivation for these changes was to reduce the 'very long type names' issue described here https://github.com/ziglang/zig/pull/19682. this breaks the previous API. users will now need to write: `const map = std.StaticStringMap(T).initComptime(kvs_list);` * move `kvs_list` param from type param to an `initComptime()` param * new public methods * `keys()`, `values()` helpers * `init(allocator)`, `deinit(allocator)` for runtime data * `getLongestPrefix(str)`, `getLongestPrefixIndex(str)` - i'm not sure these belong but have left in for now incase they are deemed useful * performance notes: * i posted some benchmarking results here: https://github.com/travisstaloch/comptime-string-map-revised/issues/1 * i noticed a speedup reducing the size of the struct from 48 to 32 bytes and thus use u32s instead of usize for all length fields * i noticed speedup storing KVs as a struct of arrays * latest benchmark shows these wall_time improvements for debug/safe/small/fast builds: -6.6% / -10.2% / -19.1% / -8.9%. full output in link above.
2024-04-07Update usages of `fmtId`/`isValidId`Carl Åstholm
`{}` for decls `{p}` for enum fields `{p_}` for struct fields and in contexts following a `.` Elsewhere, `{p}` was used since it's equivalent to the old behavior.
2024-03-18spirv: make generic globals invocation-localRobin Voetter
2024-03-18spirv: add zig-specific ext instRobin Voetter
This may be removed again in the future...
2024-03-18spirv: make IdResult an enumRobin Voetter
2024-03-18spirv: update spec generatorRobin Voetter
For module parsing and assembling, we will also need to know all of the SPIR-V extensions and their instructions. This commit updates the generator to generate those. Because there are multiple instruction sets that each have a separate list of Opcodes, no separate enum is generated for these opcodes. Additionally, the previous mechanism for runtime instruction information, `Opcode`'s `fn operands()`, has been removed in favor for `InstructionSet.core.instructions()`. Any mapping from operand to instruction is to be done at runtime. Using a runtime populated hashmap should also be more efficient than the previous mechanism using `stringToEnum`.
2024-02-05spirv: basic shader supportAli Chraghi
2023-11-22tools/gen_spirv_spec: fix wrong use of BoundedArrayAndrew Kelley
It incorrectly, was returning an error, when it actually wanted to assert that the array bounds were not exceeded. Fixed by using ArrayList instead.
2023-11-19tools: correct unnecessary uses of 'var'mlugg
2023-06-24all: migrate code to new cast builtin syntaxmlugg
Most of this migration was performed automatically with `zig fmt`. There were a few exceptions which I had to manually fix: * `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten * `@truncate`'s fixup is incorrect for vectors * Test cases are not formatted, and their error locations change
2023-06-19std: Support user-provided jsonParse method. Unify json.Parser and ↵Josh Wolfe
json.parse* (#15705)
2023-06-17std: replace builtin.Version with SemanticVersionr00ster91
2023-05-13std: Rewrite low-level json api to support streaming (#15602)Josh Wolfe
2023-04-09spirv: make IdResultType and IdRef weak aliases of IdResultRobin Voetter
Previously they were strong aliases, but as these types are used quite intermittendly it resulted in a lot of toRef() calls. Removing them improves readability a bit.
2023-02-18update std lib and compiler sources to new for loop syntaxAndrew Kelley
2022-11-23spirv: assemblerRobin Voetter
spirv: introduce SpvModule.Fn to generate function code into spirv: assembler error message setup spirv: runtime spec info spirv: inline assembly tokenizer spirv: inline assembly lhs result/opcode parsing spirv: forgot to fmt spirv: tokenize opcodes and assigned result-ids spirv: operand parsing setup spirv: assembler string literals spirv: assembler integer literals spirv: assembler value enums spirv: assembler bit masks spirv: update assembler to new asm air format spirv: target 1.5 for now Current vulkan sdk version (1.3.204) ships spirv tools targetting 1.5, and so these do not work with binaries targetting 1.6 yet. In the future, this version number should be decided by the target. spirv: store operands in flat arraylist. Instead of having dedicated Operand variants for variadic operands, just flatten them and store them in the normal inst.operands list. This is a little simpler, but is not easily decodable in the operand data representation. spirv: parse variadic assembly operands spirv: improve assembler result-id tokenization spirv: begin instruction processing spirv: only remove decl if it was actually allocated spirv: work around weird miscompilation Seems like there are problems with switch in anonymous struct literals. spirv: begin resolving some types in assembler spirv: improve instruction processing spirv: rename some types + process OpTypeInt spirv: process OpTypeVector spirv: process OpTypeMatrix and OpTypeSampler spirv: add opcode class to spec, remove @exclude'd instructions spirv: process more type instructions spirv: OpTypeFunction spirv: OpTypeOpaque spirv: parse LiteralContextDependentNumber operands spirv: emit assembly instruction into right section spirv: parse OpPhi parameters spirv: inline assembly inputs spirv: also copy air types spirv: inline assembly outputs spirv: spir-v address spaces spirv: basic vector constants/types and shuffle spirv: assembler OpTypeImage spirv: some stuff spirv: remove spirv address spaces for now
2022-11-18run zig fmt on everything checked by CIStevie Hryciw
2022-08-22stage2+stage1: remove type parameter from bit builtinsVeikka Tuominen
Closes #12529 Closes #12511 Closes #6835
2022-02-24spirv spec: do not align packed struct fieldsVeikka Tuominen
2022-01-28spirv: improve generatorRobin Voetter
The spirv spec generator now also generates some support information: Opcode gains a function to query a Zig type representing the operands of the opcode. The idea is that this will enable a richer interface for emitting spirv instructions.
2021-11-30allocgate: renamed getAllocator function to allocatorLee Cannon
2021-11-30allocgate: stage 1 and 2 buildingLee Cannon
2021-06-13tools: Unbreak many toolsLemonBoy
Many tools were broken after the recent hash-table refactorings, fix them and ensure they won't silently break again.
2021-06-10zig fmtAndrew Kelley
2021-05-15Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgenAndrew Kelley
Conflicts: * build.zig * src/Compilation.zig * src/codegen/spirv/spec.zig * src/link/SpirV.zig * test/stage2/darwin.zig - this one might be problematic; start.zig looks for `main` in the root source file, not `_main`. Not sure why there is an underscore there in master branch.
2021-05-14SPIR-V: Don't parse/render in gen_spirv_spec.zig, just emit in the right formatRobin Voetter
2021-05-14SPIR-V: Split out registry from gen_spirv_spec.zigRobin Voetter
2021-05-14SPIR-V: Adapt spec generator to new render apiRobin Voetter
2021-05-14SPIR-V: Begin generating typesRobin Voetter
2021-01-19SPIR-V: Spec generatorRobin Voetter