-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into thread-local
- Loading branch information
Showing
626 changed files
with
33,514 additions
and
10,796 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -244,7 +244,7 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Check for typos | ||
uses: crate-ci/[email protected].5 | ||
uses: crate-ci/[email protected].7 | ||
- name: Typos info | ||
if: failure() | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#import bevy_pbr::{ | ||
mesh_functions, | ||
view_transformations::position_world_to_clip | ||
} | ||
|
||
@group(2) @binding(0) var texture: texture_2d<f32>; | ||
@group(2) @binding(1) var texture_sampler: sampler; | ||
|
||
struct Vertex { | ||
@builtin(instance_index) instance_index: u32, | ||
@location(0) position: vec3<f32>, | ||
}; | ||
|
||
struct VertexOutput { | ||
@builtin(position) clip_position: vec4<f32>, | ||
@location(0) world_position: vec4<f32>, | ||
@location(1) color: vec4<f32>, | ||
}; | ||
|
||
@vertex | ||
fn vertex(vertex: Vertex) -> VertexOutput { | ||
var out: VertexOutput; | ||
|
||
// Lookup the tag for the given mesh | ||
let tag = mesh_functions::get_tag(vertex.instance_index); | ||
var world_from_local = mesh_functions::get_world_from_local(vertex.instance_index); | ||
out.world_position = mesh_functions::mesh_position_local_to_world(world_from_local, vec4(vertex.position, 1.0)); | ||
out.clip_position = position_world_to_clip(out.world_position.xyz); | ||
|
||
let tex_dim = textureDimensions(texture); | ||
// Find the texel coordinate as derived from the tag | ||
let texel_coord = vec2<u32>(tag % tex_dim.x, tag / tex_dim.x); | ||
|
||
out.color = textureLoad(texture, texel_coord, 0); | ||
return out; | ||
} | ||
|
||
@fragment | ||
fn fragment( | ||
mesh: VertexOutput, | ||
) -> @location(0) vec4<f32> { | ||
return mesh.color; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.