Releases: gfx-rs/naga
Releases Β· gfx-rs/naga
v0.14.0
This is the last naga release where naga is part of its own repo. Future releases will be renumbered and hosted as part of the wgpu repo. Please see gfx-rs/wgpu#4231 for more information!
GENERAL
- Add support for const-expressions. (#2309) @teoxoy, @jimblandy
- Add support for the
rgb10a2uint
storage format. (#2525) @teoxoy - Implement module compaction for snapshot testing and the CLI. (#2472) @jimblandy
- Fix validation and GLSL parsing of
ldexp
. (#2449) @fornwall - Add support for dual source blending. (#2427) @freqmod
- Bump
indexmap
to v2. (#2426) @daxpedda - Bump MSRV to 1.65. (#2420) @jimblandy
API
- Split
UnaryOperator::Not
intoUnaryOperator::LogicalNot
&UnaryOperator::BitwiseNot
. (#2554) @teoxoy - Remove
IsFinite
&IsNormal
relational functions. (#2532) @teoxoy - Derive
PartialEq
onExpression
. (#2417) @robtfm - Use
FastIndexMap
forSpecialTypes::predeclared_types
. (#2495) @jimblandy
CLI
- Change
--generate-debug-symbols
from anoption
to aswitch
. (#2472) @jimblandy - Add support for
.{vert,frag,comp}.glsl
files. (#2462) @eliemichel
VALIDATOR
- Require
Capabilities::FLOAT64
for 64-bit floating-point literals. (#2567) @jimblandy - Add
Capabilities::CUBE_ARRAY_TEXTURES
. (#2530) @teoxoy - Disallow passing pointers to variables in the workgroup address space to functions. (#2507) @teoxoy
- Avoid OOM with large sparse resource bindings. (#2561) @teoxoy
- Require that
Function
andPrivate
variables beCONSTRUCTIBLE
. (#2545) @jimblandy - Disallow floating-point NaNs and infinities. (#2508) @teoxoy
- Temporarily disable uniformity analysis for the fragment stage. (#2515) @teoxoy
- Validate that
textureSampleBias
is only used in the fragment stage. (#2515) @teoxoy - Validate variable initializer for address spaces. (#2513) @teoxoy
- Prevent using multiple push constant variables in one entry point. (#2484) @andriyDev
- Validate
binding_array
variable address space. (#2422) @teoxoy - Validate storage buffer access. (#2415) @teoxoy
WGSL-IN
- Fix expected min arg count of
textureLoad
. (#2584) @teoxoy - Turn
Error::Other
intoError::Internal
, to help devs. (#2574) @jimblandy - Fix OOB typifier indexing. (#2570) @teoxoy
- Add support for the
bgra8unorm
storage format. (#2542 & #2550) @nical - Remove the
outerProduct
built-in function. (#2535) @teoxoy - Add support for
i32
overload of thesign
built-in function. (#2463) @fornwall - Properly implement
modf
andfrexp
. (#2454) @fornwall - Add support for scalar overloads of
all
&any
built-in functions. (#2445) @fornwall - Don't splat the left hand operand of a binary operation if it's not a scalar. (#2444) @fornwall
- Avoid splatting all binary operator expressions. (#2440) @fornwall
- Error on repeated or missing
@workgroup_size()
. (#2435) @fornwall - Error on repeated attributes. (#2428) @fornwall
- Fix error message for invalid
texture{Load,Store}()
on arrayed textures. (#2432) @fornwall
SPV-IN
- Disable
Modf
&Frexp
and translateModfStruct
&FrexpStruct
to their IR equivalents. (#2527) @teoxoy - Don't advertise support for
Capability::ImageMSArray
&Capability::InterpolationFunction
. (#2529) @teoxoy - Fix
OpImageQueries
to allow Uints. (#2404) @evahop
GLSL-IN
SPV-OUT
- Require
ClipDistance
&CullDistance
capabilities if necessary. (#2528) @teoxoy - Change
naga::back::spv::DebugInfo::file_name
to a&Path
. (#2501) @jimblandy - Always give structs with runtime arrays a
Block
decoration. (#2455) @TheoDulka - Decorate the result of the
OpLoad
withNonUniform
(not the access chain) when loading images/samplers (resources in the Handle address space). (#2422) @teoxoy - Cache
OpConstantNull
. (#2414) @evahop
MSL-OUT
- Add and fix minimum Metal version checks for optional functionality. (#2486) @teoxoy
- Make varyings' struct members unique. (#2521) @evahop
GLSL-OUT
- Cull functions that should not be available for a given stage. (#2531) @teoxoy
- Rename identifiers containing double underscores. (#2510) @evahop
- Polyfill
frexp
. (#2504) @evahop - Add built-in functions to keywords. (#2410) @fornwall
WGSL-OUT
- Generate correct code for bit complement on integers. (#2548) @jimblandy
- Don't include type parameter in splat expressions. (#2469) @jimblandy
v0.13.0
GENERAL
- Move from
make
tocargo xtask
workflows. (#2297) @ErichDonGubler - Omit non referenced expressions from output. (#2378) @teoxoy
- Bump
bitflags
to v2. (#2358) @daxpedda - Implement
workgroupUniformLoad
. (#2201) @DJMcNab
API
- Expose early depth test field. (#2393) @Joeoc2001
- Split image bounds check policy. (#2265) @teoxoy
- Change type of constant sized arrays to
NonZeroU32
. (#2337) @teoxoy - Introduce
GlobalCtx
. (#2335) @teoxoy - Introduce
Expression::Literal
. (#2333) @teoxoy - Introduce
Expression::ZeroValue
. (#2332) @teoxoy - Add support for const-expressions (only at the API level, functionality is still WIP). (#2266) @teoxoy, @jimblandy
DOCS
- Document which expressions are in scope for a
break_if
expression. (#2326) @jimblandy
VALIDATOR
- Don't
use std::opsIndex
, used only when"validate"
is on. (#2383) @jimblandy - Remove unneeded
ConstantError::Unresolved{Component,Size}
. (#2330) @ErichDonGubler - Remove
TypeError::UnresolvedBase
. (#2308) @ErichDonGubler
WGSL-IN
- Error on param redefinition. (#2342) @SparkyPotato
SPV-IN
- Improve documentation for SPIR-V control flow parsing. (#2324) @jimblandy
- Obey the
is_depth
field ofOpTypeImage
. (#2341) @expenses - Convert conditional backedges to
break if
. (#2290) @eddyb
GLSL-IN
SPV-OUT
- Add debug info. (#2379) @wicast
- Use
IndexSet
instead ofHashSet
for iterated sets (capabilities/extensions). (#2389) @eddyb - Support array bindings of buffers. (#2282) @kvark
MSL-OUT
- Rename
allow_point_size
toallow_and_force_point_size
. (#2280) @teoxoy - Initialize arrays inline. (#2331) @teoxoy
HLSL-OUT
- Implement Pack/Unpack for HLSL. (#2353) @Elabajaba
- Complete HLSL reserved symbols. (#2367) @teoxoy
- Handle case insensitive FXC keywords. (#2347) @PJB3005
- Fix return type for firstbitlow/high. (#2315) @evahop
GLSL-OUT
textureSize
level must be a signed integer. (#2397) @nical- Fix functions with array return type. (#2382) @Gordon-F
WGSL-OUT
v0.12.0
GENERAL
- Allow
array_index
to be unsigned. (#2298) @daxpedda - Add ray query support. (#2256) @kvark
- Add partial derivative builtins. (#2277) @evahop
- Skip
gl_PerVertex
unused builtins in the SPIR-V frontend. (#2272) @teoxoy - Differentiate between
i32
andu32
in switch statement cases. (#2269) @evahop - Fix zero initialization of workgroup memory. (#2259) @teoxoy
- Add
countTrailingZeros
. (#2243) @gents83 - Fix texture built-ins where u32 was expected. (#2245) @evahop
- Add
countLeadingZeros
. (#2226) @evahop - [glsl/hlsl-out] Write sizes of arrays behind pointers in function arguments. (#2250) @pluiedev
VALIDATOR
- Validate vertex stage returns the position built-in. (#2264) @teoxoy
- Enforce discard is only used in the fragment stage. (#2262) @Uriopass
- Add
Capabilities::MULTISAMPLED_SHADING
. (#2255) @teoxoy - Add
Capabilities::EARLY_DEPTH_TEST
. (#2255) @teoxoy - Add
Capabilities::MULTIVIEW
. (#2255) @teoxoy - Improve forward declaration validation. (#2232) @JCapucho
WGSL-IN
- Use
alias
instead oftype
for type aliases. (#2299) @FL33TW00D - Add predeclared vector and matrix type aliases. (#2251) @evahop
- Improve invalid assignment diagnostic. (#2233) @SparkyPotato
- Expect semicolons wherever required. (#2233) @SparkyPotato
- Fix panic on invalid zero array size. (#2233) @SparkyPotato
- Check for leading
{
while parsing a block. (#2233) @SparkyPotato
SPV-IN
GLSL-IN
- Add switch implicit type conversion. (#2273) @evahop
- Document some fields of
naga::front::glsl::context::Context
. (#2244) @jimblandy - Perform output parameters implicit casts. (#2063) @JCapucho
- Add
not
vector relational builtin. (#2227) @JCapucho - Add double overloads for relational vector builtins. (#2227) @JCapucho
- Add bool overloads for relational vector builtins. (#2227) @JCapucho
SPV-OUT
- Fix invalid spirv being generated from integer dot products. (#2291) @PyryM
- Fix adding illegal decorators on fragment outputs. (#2286) @Wumpf
- Fix
countLeadingZeros
impl. (#2258) @teoxoy - Cache constant composites. (#2257) @evahop
- Support SPIR-V version 1.4. (#2230) @kvark
MSL-OUT
- Replace
per_stage_map
withper_entry_point_map
(#2237) @armansito - Update
firstLeadingBit
for signed integers (#2235) @evahop
HLSL-OUT
- Use
Interlocked<op>
intrinsic for atomic integers (#2294) (#2294) @ErichDonGubler - Document storage access generation. (#2295) @jimblandy
- Emit constructor functions for arrays. (#2281) @ErichDonGubler
- Clear
named_expressions
inserted by duplicated blocks. (#2116) @teoxoy
GLSL-OUT
v0.11.0
- Move to the Rust 2021 edition (#2085) @ErichDonGubler
- Bump MSRV to 1.63 (#2129) @teoxoy
API
- Add handle validation pass to
Validator
(#2090) @ErichDonGubler - Add
Range::new_from_bounds
(#2148) @robtfm
DOCS
- Fix docs for
Emit
statements (#2208) @jimblandy - Fix invalid
<...>
URLs with code spans (#2176) @ErichDonGubler - Explain how case clauses with multiple selectors are supported (#2126) @teoxoy
- Document
EarlyDepthTest
andConservativeDepth
syntax (#2132) @coreh
VALIDATOR
- Allow
u32
coordinates fortextureStore
/textureLoad
(#2172) @PENGUINLIONG - Fix array being flagged as constructible when its base isn't (#2111) @teoxoy
- Add
type_flags
toModuleInfo
(#2111) @teoxoy - Remove overly restrictive array stride check (#2215) @fintelia
- Let the uniformity analysis trust the handle validation pass (#2200) @jimblandy
- Fix warnings when building tests without validation (#2177) @jimblandy
- Add
ValidationFlags::BINDINGS
(#2156) @kvark - Fix
textureGather
ontexture_2d<u32/i32>
(#2138) @JMS55
ALL (FRONTENDS/BACKENDS)
- Support 16-bit unorm/snorm formats (#2210) @fintelia
- Support
gl_PointCoord
(#2180) @Neo-Zhixing
ALL BACKENDS
WGSL-IN
- Implement module-level scoping (#2075) @SparkyPotato
- Remove
isFinite
andisNormal
(#2218) @evahop - Update inverse hyperbolic built-ins (#2218) @evahop
- Add
refract
built-in (#2218) @evahop - Update reserved keywords (#2130) @teoxoy
- Remove non-32bit integers (#2146) @teoxoy
- Remove
workgroup_size
builtin (#2147) @teoxoy - Remove fallthrough statement (#2126) @teoxoy
SPV-IN
GLSL-IN
- Fix position propagation in lowering (#2079) @JCapucho
- Update initializer list type when parsing (#2066) @JCapucho
- Parenthesize unary negations to avoid
--
(#2087) @ErichDonGubler
SPV-OUT
- Add support for
atomicCompareExchangeWeak
(#2165) @aweinstock314 - Omit extra switch case blocks where possible (#2126) @teoxoy
- Fix switch cases after default not being output (#2126) @teoxoy
MSL-OUT
- Don't panic on missing bindings (#2175) @kvark
- Omit extra switch case blocks where possible (#2126) @teoxoy
- Fix
textureGather
compatibility on macOS 10.13 (#2104) @xiaopengli89 - Fix incorrect atomic bounds check on metal back-end (#2099) @raphlinus
- Parenthesize unary negations to avoid
--
(#2087) @ErichDonGubler
HLSL-OUT
- Simplify
write_default_init
(#2111) @teoxoy - Omit extra switch case blocks where possible (#2126) @teoxoy
- Properly implement bitcast (#2097) @cwfitzgerald
- Fix storage access chain through a matrix (#2097) @cwfitzgerald
- Workaround FXC Bug in Matrix Indexing (#2096) @cwfitzgerald
- Parenthesize unary negations to avoid
--
(#2087) @ErichDonGubler
GLSL-OUT
- Introduce a flag to include unused items (#2205) @robtfm
- Use
fma
polyfill for versions below gles 320 (#2197) @teoxoy - Emit reflection info for non-struct uniforms (#2189) @Rainb0wCodes
- Introduce a new block for switch cases (#2126) @teoxoy
WGSL-OUT
v0.10.0
- Make termcolor dependency optional by @AldaronLau in #2014
- Fix clippy lints for 1.63 by @JCapucho in #2026
- Saturate by @evahop in #2025
- Use
Option::as_deref
as appropriate. by @jimblandy in #2040 - Explicitely enable std for indexmap by @maxammann in #2062
- Fix compiler warning by @Gordon-F in #2074
API
- Implement
Clone
forModule
by @daxpedda in #2013 - Remove the glsl-validate feature by @JCapucho in #2045
DOCS
- Document arithmetic binary operation type rules. by @jimblandy in #2051
VALIDATOR
- Add
emit_to_{stderr,string}
helpers to validation error by @nolanderc in #2012 - Check regular functions don't have bindings by @JCapucho in #2050
WGSL-IN
- Update reserved WGSL keywords by @norepimorphism in #2009
- Implement lexical scopes by @JCapucho in #2024
- Rename
Scope
toRule
, since we now have lexical scope. by @jimblandy in #2042 - Splat on compound assignments by @JCapucho in #2049
- Fix bad span in assignment lhs error by @JCapucho in #2054
- Fix inclusion of trivia in spans by @SparkyPotato in #2055
- Improve assignment diagnostics by @SparkyPotato in #2056
- Break up long string, reformat rest of file. by @jimblandy in #2057
- Fix line endings on wgsl reserved words list. by @jimblandy in #2059
GLSL-IN
- Add support for .length() by @SpaceCat-Chan in #2017
- Fix missing stores for local declarations by @adeline-sparks in #2029
- Migrate to
SymbolTable
by @JCapucho in #2044 - Update initializer list type when parsing by @JCapucho in #2066
SPV-OUT
- Don't decorate varyings with interpolation modes at pipeline start/end by @nical in #2038
- Decorate integer builtins as Flat in the spirv writer by @nical in #2035
- Properly combine the fixes for #2035 and #2038. by @jimblandy in #2041
- Don't emit no-op
OpBitCast
instructions. by @jimblandy in #2043
HLSL-OUT
- Use the namer to sanitise entrypoint input/output struct names by @expenses in #2001
- Handle Unpack2x16float in hlsl by @expenses in #2002
- Add support for push constants by @JCapucho in #2005
DOT-OUT
v0.9.0
API
- Rename
TypeFlags
INTERFACE
/HOST_SHARED
toIO_SHARED
/HOST_SHAREABLE
(#1872) @jimblandy - Expose more error information (#1827, #1937) @jakobhellermann @nical @jimblandy
- Do not unconditionally make error output colorful (#1707) @rhysd
- Rename
StorageClass
toAddressSpace
(#1699) @kvark - Add a way to emit errors to a path (#1640) @laptou
CLI
- Add
bincode
representation (#1729) @kvark - Include file path in WGSL parse error (#1708) @rhysd
- Add
--version
flag (#1706) @rhysd - Support reading input from stdin via
--stdin-file-path
(#1701) @rhysd - Use
panic = "abort"
(#1597) @jrmuizel
DOCS
- Standardize some docs (#1660) @NoelTautges
- Document
TypeInner::BindingArray
(#1859) @jimblandy - Clarify accepted types for
Expression::AccessIndex
(#1862) @NoelTautges - Document
proc::layouter
(#1693) @jimblandy - Document Naga's promises around validation and panics (#1828) @jimblandy
FunctionInfo
doc fixes (#1726) @jimblandy
VALIDATOR
- Forbid returning pointers and atomics from functions (#911) @jimblandy
- Let validation check for more unsupported builtins (#1962) @jimblandy
- Fix
Capabilities::SAMPLER_NON_UNIFORM_INDEXING
bitflag (#1915) @cwfitzgerald - Properly check that user-defined IO uses IO-shareable types (#912) @jimblandy
- Validate
ValuePointer
exactly like aPointer
to aScalar
(#1875) @jimblandy - Reject empty structs (#1826) @jimblandy
- Validate uniform address space layout constraints (#1812) @teoxoy
- Improve
AddressSpace
related error messages (#1710) @kvark
WGSL-IN
Main breaking changes
- Commas to separate struct members (comma after last member is optional)
struct S { a: f32; b: i32; }
->struct S { a: f32, b: i32 }
- Attribute syntax
[[binding(0), group(0)]]
->@binding(0) @group(0)
- Entry point stage attributes
@stage(vertex)
->@vertex
@stage(fragment)
->@fragment
@stage(compute)
->@compute
- Function renames
smoothStep
->smoothstep
findLsb
->firstTrailingBit
findMsb
->firstLeadingBit
Specification Changes (relavant changes have also been applied to the WGSL backend)
- Add support for
break if
(#1993) @JCapucho - Update number literal format (#1863) @teoxoy
- Allow non-ascii characters in identifiers (#1849) @teoxoy
- Update reserved keywords (#1847, #1870, #1905) @teoxoy @Gordon-F
- Update entry point stage attributes (#1833) @Gordon-F
- Make colon in case optional (#1801) @Gordon-F
- Rename
smoothStep
tosmoothstep
(#1800) @Gordon-F - Make semicolon after struct declaration optional (#1791) @stshine
- Use commas to separate struct members instead of semicolons (#1773) @Gordon-F
- Rename
findLsb
/findMsb
tofirstTrailingBit
/firstLeadingBit
(#1735) @kvark - Make parenthesis optional for
if
andswitch
statements (#1725) @Gordon-F - Declare attribtues with
@attrib
instead of[[attrib]]
(#1676) @kvark - Allow non-structure buffer types (#1682) @kvark
- Remove
stride
attribute (#1681) @kvark
Improvements
- Implement complete validation for size and align attributes (#1979) @teoxoy
- Implement
firstTrailingBit
/firstLeadingBit
u32 overloads (#1865) @teoxoy - Add error for non-floating-point matrix (#1917) @grovesNL
- Implement partial vector & matrix identity constructors (#1916) @teoxoy
- Implement phony assignment (#1866, #1869) @teoxoy
- Fix being able to match
~=
as LogicalOperation (#1849) @teoxoy - Implement Binding Arrays (#1845) @cwfitzgerald
- Implement unary vector operators (#1820) @teoxoy
- Implement zero value constructors and constructors that infer their type from their parameters (#1790) @teoxoy
- Implement invariant attribute (#1789, #1822) @teoxoy @jimblandy
- Implement increment and decrement statements (#1788, #1912) @teoxoy
- Implement
while
loop (#1787) @teoxoy - Fix array size on globals (#1717) @jimblandy
- Implement integer vector overloads for
dot
function (#1689) @francesco-cattoglio - Implement block comments (#1675) @kocsis1david
- Implement assignment binary operators (#1662) @kvark
- Implement
radians
/degrees
builtin functions (#1627) @encounter - Implement
findLsb
/findMsb
builtin functions (#1473) @fintelia - Implement
textureGather
/textureGatherCompare
builtin functions (#1596) @kvark
SPV-IN
- Implement
OpBitReverse
andOpBitCount
(#1954) @JCapucho - Add
MultiView
toSUPPORTED_CAPABILITIES
(#1934) @expenses - Translate
OpSMod
andOpFMod
correctly (#1867, #1995) @teoxoy @JCapucho - Error on unsupported
MatrixStride
(#1805) @teoxoy - Align array stride for undecorated arrays (#1724) @JCapucho
GLSL-IN
- Don't allow empty last case in switch (#1981) @JCapucho
- Fix last case falltrough and empty switch (#1981) @JCapucho
- Splat inputs for smoothstep if needed (#1976) @JCapucho
- Fix parameter not changing to depth (#1967) @JCapucho
- Fix matrix multiplication check (#1953) @JCapucho
- Fix panic (stop emitter in conditional) (#1952) @JCapucho
- Translate
mod
fn correctly (#1867) @teoxoy - Make the ternary operator behave as an if (#1877) @JCapucho
- Add support for
clamp
function (#1502) @sjinno - Better errors for bad constant expression (#1501) @sjinno
- Error on a
matCx2
used with thestd140
layout (#1806) @teoxoy - Allow nested accesses in lhs positions (#1794) @JCapucho
- Use forced conversions for vector/matrix constructors (#1796) @JCapucho
- Add support for
barrier
function (#1793) @fintelia - Fix panic (resume expression emit after
imageStore
) (#1795) @JCapucho - Allow multiple array specifiers (#1780) @JCapucho
- Fix memory qualifiers being inverted ([#1779](...