Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions _release-content/migration-guides/shader_octahedral_moved.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: "Shader `bevy_pbr::utils::{octahedral_encode, octahedral_decode, octahedral_decode_signed}` are moved"
pull_requests: [21926]
---

Shader functions `bevy_pbr::utils::{octahedral_encode, octahedral_decode, octahedral_decode_signed}` are moved to `bevy_render::utils::{octahedral_encode, octahedral_decode, octahedral_decode_signed}`

```wgsl
// BEFORE
#import bevy_pbr::utils::{octahedral_encode, octahedral_decode, octahedral_decode_signed}

// AFTER
#import bevy_render::utils::{octahedral_encode, octahedral_decode, octahedral_decode_signed}
```
2 changes: 1 addition & 1 deletion crates/bevy_pbr/src/deferred/pbr_deferred_functions.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
pbr_functions,
rgb9e5,
mesh_view_bindings::view,
utils::{octahedral_encode, octahedral_decode},
prepass_io::FragmentOutput,
view_transformations::{position_ndc_to_world, frag_coord_to_ndc},
}
#import bevy_render::utils::{octahedral_encode, octahedral_decode}

#ifdef MESHLET_MESH_MATERIAL_PASS
#import bevy_pbr::meshlet_visibility_buffer_resolve::VertexOutput
Expand Down
4 changes: 4 additions & 0 deletions crates/bevy_pbr/src/render/forward_io.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ struct Vertex {
#endif
};

#ifndef MESHLET_MESH_MATERIAL_PASS

// The instance_index parameter must match vertex_in.instance_index. This is a work around for a wgpu dx12 bug.
// See https://github.com/gfx-rs/naga/issues/2416
fn decompress_vertex(vertex_in: Vertex, instance_index: u32) -> UncompressedVertex {
Expand Down Expand Up @@ -134,6 +136,8 @@ fn decompress_vertex(vertex_in: Vertex, instance_index: u32) -> UncompressedVert
return uncompressed_vertex;
}

#endif

struct VertexOutput {
// This is `clip position` when the struct is used as a vertex stage output
// and `frag coord` when used as a fragment stage input
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_solari/src/realtime/presample_light_tiles.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ enable wgpu_ray_query;
#define_import_path bevy_solari::presample_light_tiles

#import bevy_pbr::rgb9e5::{vec3_to_rgb9e5_, rgb9e5_to_vec3_}
#import bevy_pbr::utils::{octahedral_encode, octahedral_decode}
#import bevy_render::utils::{octahedral_encode, octahedral_decode}
#import bevy_render::view::View
#import bevy_solari::sampling::{generate_random_light_sample, LightSample, ResolvedLightSample}
#import bevy_solari::realtime_bindings::{light_tile_samples, light_tile_resolved_samples, view, constants, ResolvedLightSamplePacked}
Expand Down
Loading