mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
shader_prepass example: disable MSAA for maximum compatibility (#8504)
# Objective
Since #8446, example `shader_prepass` logs the following error on my mac
m1:
```
ERROR bevy_render::render_resource::pipeline_cache: failed to process shader:
error: Entry point fragment at Fragment is invalid
= Argument 1 varying error
= Capability MULTISAMPLED_SHADING is not supported
```
The example display the 3d scene but doesn't change with the preps
selected
Maybe related to this update in naga:
cc3a8ac737
## Solution
- Disable MSAA in the example, and check if it's enabled in the shader
This commit is contained in:
parent
85a918a8dd
commit
27e1cf92ad
2 changed files with 7 additions and 0 deletions
|
@ -15,9 +15,14 @@ var<uniform> settings: ShowPrepassSettings;
|
|||
@fragment
|
||||
fn fragment(
|
||||
@builtin(position) frag_coord: vec4<f32>,
|
||||
#ifdef MULTISAMPLED
|
||||
@builtin(sample_index) sample_index: u32,
|
||||
#endif
|
||||
#import bevy_pbr::mesh_vertex_output
|
||||
) -> @location(0) vec4<f32> {
|
||||
#ifndef MULTISAMPLED
|
||||
let sample_index = 0u;
|
||||
#endif
|
||||
if settings.show_depth == 1u {
|
||||
let depth = prepass_depth(frag_coord, sample_index);
|
||||
return vec4(depth, depth, depth, 1.0);
|
||||
|
|
|
@ -28,6 +28,8 @@ fn main() {
|
|||
})
|
||||
.add_systems(Startup, setup)
|
||||
.add_systems(Update, (rotate, toggle_prepass_view))
|
||||
// Disabling MSAA for maximum compatibility. Shader prepass with MSAA needs GPU capability MULTISAMPLED_SHADING
|
||||
.insert_resource(Msaa::Off)
|
||||
.run();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue