Skip to content

Commit

Permalink
Fix pbr shader compiliation error, #version has to be in the first …
Browse files Browse the repository at this point in the history
…line (#1884)

I've had problems with compiling and running the pbr example:

```
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Compilation("glslang_shader_preprocess:\nInfo log:\nERROR: 0:40: \'#version\' : must occur first in shader \nERROR: 0:40: \'#version\' : bad profile name; use es, core, or compatibility \nERROR: 0:40: \'#version\' : bad tokens following profile -- expected newline \nERROR: 3 compilation errors.  No code generated.\n\n\nDebug log:\n\n")', crates/bevy_render/src/pipeline/pipeline_compiler.rs:161:22
```

I've checked each shader, and only one shader hasn't had `#version` in the first line.

This change fixed my issue.
  • Loading branch information
Philipp-M committed Apr 14, 2021
1 parent 57e3d4f commit ad546a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_pbr/src/render_graph/pbr_pipeline/pbr.frag
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#version 450

// From the Filament design doc
// https://google.github.io/filament/Filament.html#table_symbols
// Symbol Definition
Expand Down Expand Up @@ -32,8 +34,6 @@
//
// The above integration needs to be approximated.

#version 450

const int MAX_LIGHTS = 10;

struct PointLight {
Expand Down

0 comments on commit ad546a9

Please sign in to comment.