-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* can't read depth formats * and all the other weird things, see gfx-rs/wgpu#3644
- Loading branch information
Showing
6 changed files
with
281 additions
and
24 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Reads the content of a texture and writes it out as is. | ||
// | ||
// This is needed e.g. on WebGL to convert from a depth format to a regular color format that can be read back to the CPU. | ||
|
||
#import <./types.wgsl> | ||
#import <./global_bindings.wgsl> | ||
#import <./screen_triangle_vertex.wgsl> | ||
|
||
@group(1) @binding(0) | ||
var tex: texture_2d<f32>; | ||
|
||
@fragment | ||
fn main(in: FragmentInput) -> @location(0) Vec4 { | ||
return textureSample(tex, nearest_sampler, in.texcoord); | ||
} |
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.