Files
wgpu/naga/tests/out/ir/const_assert.compact.ron
Jamie Nicol 7df6e477cf [naga wgsl-in] Do not eagerly concretize local const declarations of abstract types
Instead allow the const to be converted each time it is const
evaluated as part of another expression. This allows an abstract const
to be used as a different type depending on the context.

As a result, abstract types may now find their way in to the IR, which
we don't want. This occurs because the compact pass treats named
expressions as used, mostly so that our snapshot tests are more
useful, and therefore does not remove them. To prevent this, we avoid
adding abstract-typed local consts to the named expressions list. This
will have no functional effect on any shaders produced by the
backends, but some unused local const declarations will no longer be
present.
2025-03-05 20:39:48 -08:00

32 lines
721 B
Plaintext

(
types: [],
special_types: (
ray_desc: None,
ray_intersection: None,
ray_vertex_return: None,
predeclared_types: {},
),
constants: [],
overrides: [],
global_variables: [],
global_expressions: [],
functions: [
(
name: Some("foo"),
arguments: [],
result: None,
local_variables: [],
expressions: [],
named_expressions: {},
body: [
Return(
value: None,
),
],
diagnostic_filter_leaf: None,
),
],
entry_points: [],
diagnostic_filters: [],
diagnostic_filter_leaf: None,
)