Skip to content

make glsl and spirv support optional#8491

Merged
cart merged 3 commits intobevyengine:mainfrom
mockersf:optional-shader-formats
Apr 25, 2023
Merged

make glsl and spirv support optional#8491
cart merged 3 commits intobevyengine:mainfrom
mockersf:optional-shader-formats

Conversation

@mockersf
Copy link
Copy Markdown
Member

@mockersf mockersf commented Apr 25, 2023

Objective

  • Reduce compilation time

Solution

  • Make spirv and glsl shader format support optional. They are not needed for Bevy shaders.
  • on my mac (where shaders are compiled to msl), this reduces the total build time by 2 to 5 seconds, improvement should be even better with less cores

There is a big reduction in compile time for naga, and small improvements on wgpu and bevy_render

This PR with optional shader formats enabled timings:
current main

This PR:
this pr


Migration Guide

  • If you want to use shaders in spirv, enable the shader_format_spirv feature
  • If you want to use shaders in glsl, enable the shader_format_glsl feature

@mockersf mockersf added A-Rendering Drawing game state to the screen M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide labels Apr 25, 2023
@alice-i-cecile alice-i-cecile added the C-Performance A change motivated by improving speed, memory usage or compile times label Apr 25, 2023
@alice-i-cecile alice-i-cecile added this to the 0.11 milestone Apr 25, 2023
@github-actions
Copy link
Copy Markdown
Contributor

You added a new feature but didn't add a description for it. Please update the root Cargo.toml file.

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Apr 25, 2023
Copy link
Copy Markdown
Member

@cart cart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats a big enough win that its hard to ignore. Good call!

@cart cart added this pull request to the merge queue Apr 25, 2023
Merged via the queue into bevyengine:main with commit 949487d Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Performance A change motivated by improving speed, memory usage or compile times M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants