-
-
Couldn't load subscription status.
- Fork 4.2k
Closed
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behavior
Description
Bevy version
Main @ e954b8573
What you did
I did this in a shader:
#import bevy_pbr::mesh_view_typesBecause I wanted the definition of the Globals struct to re-use in my own shader.
What went wrong
error: expected constant, found '#'
┌─ wgsl:59:49
│
59 │ directional_lights: array<DirectionalLight, #{MAX_DIRECTIONAL_LIGHTS}u>,
│ ^ expected constant
Additional information
theories about what might be going wrong
Importing bevy_pbr::mesh_view_types implies that this value is defined.
workarounds that you used
- I could redefine the
Globalsstruct, but I would like to not repeat that. - I currently add
shader_defs: vec![ShaderDefVal::Int("MAX_DIRECTIONAL_LIGHTS".to_string(), 1)],to my code and that works. But this feels like something I should not have to do.
Metadata
Metadata
Assignees
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behavior