Search across packages, versions, files, declarations, and comments. Use multiple terms to narrow results (AND), and add @vertex, @fragment, or @compute to filter by shader stage.

Constants

SMAA_THRESHOLD

#
const SMAA_THRESHOLD: f32 = 0.15
const SMAA_THRESHOLD: f32 = 0.1
const SMAA_THRESHOLD: f32 = 0.1
const SMAA_THRESHOLD: f32 = 0.05
const SMAA_THRESHOLD: f32 = 0.1

SMAA_MAX_SEARCH_STEPS

#
const SMAA_MAX_SEARCH_STEPS: u32 = 4u
const SMAA_MAX_SEARCH_STEPS: u32 = 8u
const SMAA_MAX_SEARCH_STEPS: u32 = 16u
const SMAA_MAX_SEARCH_STEPS: u32 = 32u
const SMAA_MAX_SEARCH_STEPS: u32 = 16u

SMAA_MAX_SEARCH_STEPS_DIAG

#
const SMAA_MAX_SEARCH_STEPS_DIAG: u32 = 8u
const SMAA_MAX_SEARCH_STEPS_DIAG: u32 = 16u
const SMAA_MAX_SEARCH_STEPS_DIAG: u32 = 8u

SMAA_CORNER_ROUNDING

#
const SMAA_CORNER_ROUNDING: u32 = 25u
const SMAA_CORNER_ROUNDING: u32 = 25u
const SMAA_CORNER_ROUNDING: u32 = 25u

SMAA_LOCAL_CONTRAST_ADAPTATION_FACTOR

#
const SMAA_LOCAL_CONTRAST_ADAPTATION_FACTOR: f32 = 2.0

SMAA_AREATEX_MAX_DISTANCE

#
const SMAA_AREATEX_MAX_DISTANCE: f32 = 16.0

SMAA_AREATEX_MAX_DISTANCE_DIAG

#
const SMAA_AREATEX_MAX_DISTANCE_DIAG: f32 = 20.0

SMAA_AREATEX_PIXEL_SIZE

#
const SMAA_AREATEX_PIXEL_SIZE: vec2<f32> = (1.0 / vec2<f32>(160.0, 560.0))

SMAA_AREATEX_SUBTEX_SIZE

#
const SMAA_AREATEX_SUBTEX_SIZE: f32 = (1.0 / 7.0)

SMAA_SEARCHTEX_SIZE

#
const SMAA_SEARCHTEX_SIZE: vec2<f32> = vec2(66.0, 33.0)

SMAA_SEARCHTEX_PACKED_SIZE

#
const SMAA_SEARCHTEX_PACKED_SIZE: vec2<f32> = vec2(64.0, 16.0)

SMAA_CORNER_ROUNDING_NORM

#
const SMAA_CORNER_ROUNDING_NORM: f32 = f32(SMAA_CORNER_ROUNDING) / 100.0

Bindings

color_texture

#
@group(0)
@binding(0)
var color_texture: texture_2d<f32>

smaa_info

#
@group(0)
@binding(1)
var<uniform> smaa_info: SmaaInfo

color_sampler

#
@if(SMAA_EDGE_DETECTION)
@group(1)
@binding(0)
var color_sampler: sampler

edges_texture

#
@group(1)
@binding(0)
var edges_texture: texture_2d<f32>

edges_sampler

#
@group(1)
@binding(1)
var edges_sampler: sampler

search_texture

#
@group(1)
@binding(2)
var search_texture: texture_2d<f32>

area_texture

#
@group(1)
@binding(3)
var area_texture: texture_2d<f32>

blend_texture

#
@group(1)
@binding(0)
var blend_texture: texture_2d<f32>

blend_sampler

#
@group(1)
@binding(1)
var blend_sampler: sampler

Structures

SmaaInfo

#
struct SmaaInfo {
rt_metrics: vec4<f32> ,
}

VertexVaryings

#
struct VertexVaryings {
clip_coord: vec2<f32> ,
tex_coord: vec2<f32> ,
}

EdgeDetectionVaryings

#
struct EdgeDetectionVaryings {
@builtin(position)
position: vec4<f32> ,
@location(0)
offset_0: vec4<f32> ,
@location(1)
offset_1: vec4<f32> ,
@location(2)
offset_2: vec4<f32> ,
@location(3)
tex_coord: vec2<f32> ,
}

BlendingWeightCalculationVaryings

#
struct BlendingWeightCalculationVaryings {
@builtin(position)
position: vec4<f32> ,
@location(0)
offset_0: vec4<f32> ,
@location(1)
offset_1: vec4<f32> ,
@location(2)
offset_2: vec4<f32> ,
@location(3)
tex_coord: vec2<f32> ,
}

NeighborhoodBlendingVaryings

#
struct NeighborhoodBlendingVaryings {
@builtin(position)
position: vec4<f32> ,
@location(0)
offset: vec4<f32> ,
@location(1)
tex_coord: vec2<f32> ,
}

Functions

calculate_vertex_varyings

#

The top-left has UV 0,0, the bottom-left has 0,2, and the top-right has 2,0. This means that the UV gets interpolated to 1,1 at the bottom-right corner of the clip-space rectangle that is at 1,-1 in clip space.

fn calculate_vertex_varyings (
vertex_index: u32
) -> VertexVaryings

edge_detection_vertex_main

#
@vertex
Processes each 3D point in a model before it's drawn
fn edge_detection_vertex_main (
@builtin(vertex_index)
vertex_index: u32
) -> EdgeDetectionVaryings

blending_weight_calculation_vertex_main

#
@vertex
Processes each 3D point in a model before it's drawn
fn blending_weight_calculation_vertex_main (
@builtin(vertex_index)
vertex_index: u32
) -> BlendingWeightCalculationVaryings

neighborhood_blending_vertex_main

#
@vertex
Processes each 3D point in a model before it's drawn
fn neighborhood_blending_vertex_main (
@builtin(vertex_index)
vertex_index: u32
) -> NeighborhoodBlendingVaryings

luma_edge_detection_fragment_main

#
@fragment
Calculates the final color of each pixel on the screen
fn luma_edge_detection_fragment_main ( ) ->
@location(0)
vec4<f32>

decode_diag_bilinear_access_2

#

Allows to decode two binary values from a bilinear-filtered access.

fn decode_diag_bilinear_access_2 (
in_e: vec2<f32>
) -> vec2<f32>

decode_diag_bilinear_access_4

#
fn decode_diag_bilinear_access_4 (
e: vec4<f32>
) -> vec4<f32>

search_diag_1

#
fn search_diag_1 (
tex_coord: vec2<f32>
, 
dir: vec2<f32>
, 
e: ptr<function, vec2<f32>>
) -> vec2<f32>

search_diag_2

#
fn search_diag_2 (
tex_coord: vec2<f32>
, 
dir: vec2<f32>
, 
e: ptr<function, vec2<f32>>
) -> vec2<f32>

area_diag

#
fn area_diag (
dist: vec2<f32>
, 
e: vec2<f32>
, 
offset: f32
) -> vec2<f32>

calculate_diag_weights

#
fn calculate_diag_weights (
tex_coord: vec2<f32>
, 
e: vec2<f32>
, 
subsample_indices: vec4<f32>
) -> vec2<f32>

search_length

#
fn search_length (
e: vec2<f32>
, 
offset: f32
) -> f32

search_x_left

#
fn search_x_left (
in_tex_coord: vec2<f32>
, 
end: f32
) -> f32

search_x_right

#
fn search_x_right (
in_tex_coord: vec2<f32>
, 
end: f32
) -> f32

search_y_up

#
fn search_y_up (
in_tex_coord: vec2<f32>
, 
end: f32
) -> f32

search_y_down

#
fn search_y_down (
in_tex_coord: vec2<f32>
, 
end: f32
) -> f32

area

#
fn area (
dist: vec2<f32>
, 
e1: f32
, 
e2: f32
, 
offset: f32
) -> vec2<f32>

detect_horizontal_corner_pattern

#
fn detect_horizontal_corner_pattern (
weights: vec2<f32>
, 
tex_coord: vec4<f32>
, 
d: vec2<f32>
) -> vec2<f32>

detect_vertical_corner_pattern

#
fn detect_vertical_corner_pattern (
weights: vec2<f32>
, 
tex_coord: vec4<f32>
, 
d: vec2<f32>
) -> vec2<f32>

blending_weight_calculation_fragment_main

#
@fragment
Calculates the final color of each pixel on the screen
fn blending_weight_calculation_fragment_main ( ) ->
@location(0)
vec4<f32>

neighborhood_blending_fragment_main

#
@fragment
Calculates the final color of each pixel on the screen
fn neighborhood_blending_fragment_main ( ) ->
@location(0)
vec4<f32>
Contents