djeedai / bevy_hanabi

🎆 Hanabi — a GPU particle system plugin for the Bevy game engine.
Apache License 2.0
906 stars 72 forks source link

UNASSIGNED-CoreValidation-Shader-OutputNotConsumed warning #20

Open marshauf opened 2 years ago

marshauf commented 2 years ago

Hello,

when running 2D or 3D examples (0e1df4d9f712907e1c1ae10f77478221247f7f72), bevy warns about a performance problem:


2022-04-11T18:17:01.846362Z  WARN wgpu_hal::vulkan::instance: PERFORMANCE [UNASSIGNED-CoreValidation-Shader-OutputNotConsumed (0x609a13b)]
        Validation Performance Warning: [ UNASSIGNED-CoreValidation-Shader-OutputNotConsumed ] Object 0: handle = 0x984b920000000104, type = VK_OBJECT_TYPE_SHADER_MODULE; | MessageID = 0x609a13b | Vertex attribute at location 1 not consumed by vertex shader    
2022-04-11T18:17:01.846425Z  WARN wgpu_hal::vulkan::instance:   objects: (type: SHADER_MODULE, hndl: 0x984b920000000104, name: ?) 
``
djeedai commented 2 years ago

I'm not sure what's that (I don't have it locally, probably I need to install something to get the validation layers). I suspect it's because currently we always output a mesh with UVs, but if there no image/texture we don't use those attributes. We should definitely optimize this though, even if that's not related to the current warning.

djeedai commented 2 years ago

Ah yes I remember, this is commented out currently because we use a fixed ParticleVertex layout for convenience, but would otherwise need to dynamically populate a buffer either with or without those UVs, which makes the vertex buffer a bit less convenient to manipulate (the type of vertices is not known at compile time anymore).

djeedai commented 1 year ago

Note: found how to enable validation layers, and confirming I can repro. However I'm less sure why this happens now that I've looked quickly at it. But with a repro it should be easier to fix.

djeedai commented 1 year ago

Ok this is actually a limitation of the current design, notes for self: