mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
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.
32 lines
721 B
Plaintext
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,
|
|
) |