Closed Adevald closed 1 year ago
You First need to add the resources and then the plugin. I don’t know why, but it should solve the problem.
Can this be changed or described somewhere?
You First need to add the resources and then the plugin. I don’t know why, but it should solve the problem.
Can this be changed or described somewhere?
I know this and i tell about it here
that error doesnt appear if DefaultPlugins will placed after .add_resource(WindowDescriptor{})
Yup the issue is that we initialize the RenderGraph in the RenderPlugin using the Msaa resource settings. We then separately configure shader pipeline specialization using the Msaa resource setting.
If you register Msaa before DefaultPlugins (which includes RenderPlugin), the graph gets initialized with the custom value AND the shader pipelines get specialized with the custom value.
If you register Msaa after, the RenderGraph gets initialized with the default Msaa value, but the shader pipelines get specialized with the custom value.
I believe the fix should be to allow the RenderGraph to dynamically adapt to Msaa resource settings. But that will require some design work.
Another fix might be to defer Plugin initialization until app start, which would ensure that resources are always registered before plugins (but im not yet convinced that behavior is desirable).
I would expect of builder pattern to gather the settings before starting the actual process of "building".
this no longer crashes:
WindowDescriptor
is not a resource anymore and is configured by plugin settingsMsaa
resource
Bevy version
bevy = { version = "0.4.0" }
Operating system & version
Windows 10 x64.
What you did
Using this tutorial for creating an chess prototype, i insert
.add_plugins(DefaultPlugins)
right afterApp::build()
(tutorial tell it should be after.add_resource(WindowDescriptor{})
).What you expected to happen
App just should works.
What actually happened
App crashed with error:
thread 'main' panicked at 'render pipeline output formats and sample counts do not match render pass attachment formats
Additional information
That error doesnt appear if DefaultPlugins will placed after
.add_resource(WindowDescriptor{})
.Also,
WindowDescriptor{}
doesnt appies to App if it added after DefaultPlugins.Code: