WGSL backend should probably emit override
declarations, rather than replacing override expressions with constants
#6481
Labels
area: naga back-end
Outputs of naga shader conversion
lang: WGSL
WebGPU Shading Language
naga
Shader Translator
The Naga WGSL backend should probably write
Module::overrides
as WGSL override declarations, rather than requiring the override table to be empty, as the other backends do, under the assumption that they've been rewritten as constants.Users who do want overrides rewritten in WGSL output can certainly apply
process_overrides
themselves.In #6310, this was attempted, but it ran into trouble because of the backend's distinction between
write_constant_expression
,write_possibly_const_expression
, and the otherwrite_expression
variants. The only reason these are separated is because we wanted to not recognize expressions we didn't expect to find in the global expression arena, but now that overrides mean that we can legitimately find a wide variety of expressions in the global expression arena, keeping those functions separate may not make much sense any more. It would be simpler for the backendwrite_expression
functions to simply always pass around the appropriate arena.The text was updated successfully, but these errors were encountered: