-
Notifications
You must be signed in to change notification settings - Fork 388
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chroma subsampling converter now passes all the relevant data now to …
…the converting shader
- Loading branch information
Showing
5 changed files
with
144 additions
and
35 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
crates/viewer/re_renderer/shader/conversions/chroma_subsampling_converter.wgsl
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 |
---|---|---|
@@ -1,7 +1,40 @@ | ||
#import <../types.wgsl> | ||
#import <../screen_triangle_vertex.wgsl> | ||
|
||
struct UniformBuffer { | ||
format: u32, | ||
primaries: u32, | ||
}; | ||
|
||
@group(0) @binding(0) | ||
var<uniform> uniform_buffer: UniformBuffer; | ||
|
||
@group(1) @binding(1) | ||
var input_texture: texture_2d<u32>; | ||
|
||
|
||
const FORMAT_Y_UV = 0u; | ||
const FORMAT_YUYV16 = 1u; | ||
|
||
const PRIMARIES_BT601 = 0u; | ||
const PRIMARIES_BT709 = 1u; | ||
|
||
|
||
@fragment | ||
fn fs_main(in: FragmentInput) -> @location(0) vec4f { | ||
|
||
switch (uniform_buffer.format) { | ||
case FORMAT_Y_UV: { | ||
return vec4f(0.0, 0.0, 1.0, 1.0); | ||
} | ||
case FORMAT_YUYV16: { | ||
return vec4f(1.0, 0.0, 1.0, 1.0); | ||
} | ||
default: { | ||
// Something went wrong! | ||
return vec4f(0.0, 0.0, 0.0, 0.0); | ||
} | ||
} | ||
|
||
return vec4f(1.0, 0.0, 1.0, 1.0); | ||
} |
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