-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add shaders and shaders cargo alias, github workflow
- Loading branch information
Showing
52 changed files
with
7,325 additions
and
2 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
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.
65 changes: 65 additions & 0 deletions
65
crates/renderling/shaders/bloom-bloom_downsample_fragment.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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
struct type_8 { | ||
member: array<u32>, | ||
} | ||
|
||
@group(0) @binding(0) | ||
var<storage> global: type_8; | ||
var<private> global_1: vec2<f32>; | ||
var<private> global_2: u32; | ||
@group(0) @binding(2) | ||
var global_3: sampler; | ||
@group(0) @binding(1) | ||
var global_4: texture_2d<f32>; | ||
var<private> global_5: vec4<f32>; | ||
|
||
fn function() { | ||
var phi_329_: bool; | ||
var phi_80_: vec2<f32>; | ||
|
||
let _e20 = arrayLength((&global.member)); | ||
let _e21 = global_1; | ||
let _e22 = global_2; | ||
if (_e20 >= 2u) { | ||
phi_329_ = (_e22 <= (_e20 - 2u)); | ||
} else { | ||
phi_329_ = false; | ||
} | ||
let _e27 = phi_329_; | ||
if _e27 { | ||
let _e30 = global.member[_e22]; | ||
let _e35 = global.member[(_e22 + 1u)]; | ||
phi_80_ = vec2<f32>(bitcast<f32>(_e30), bitcast<f32>(_e35)); | ||
} else { | ||
phi_80_ = vec2<f32>(0f, 0f); | ||
} | ||
let _e39 = phi_80_; | ||
let _e44 = fma(-2f, _e39.x, _e21.x); | ||
let _e47 = fma(2f, _e39.y, _e21.y); | ||
let _e49 = textureSample(global_4, global_3, vec2<f32>(_e44, _e47)); | ||
let _e51 = textureSample(global_4, global_3, vec2<f32>(_e21.x, _e47)); | ||
let _e52 = vec2<f32>((2f * _e39.x), (2f * _e39.y)); | ||
let _e54 = textureSample(global_4, global_3, (_e21 + _e52)); | ||
let _e56 = textureSample(global_4, global_3, vec2<f32>(_e44, _e21.y)); | ||
let _e57 = textureSample(global_4, global_3, _e21); | ||
let _e58 = fma(2f, _e39.x, _e21.x); | ||
let _e60 = textureSample(global_4, global_3, vec2<f32>(_e58, _e21.y)); | ||
let _e62 = textureSample(global_4, global_3, (_e21 - _e52)); | ||
let _e63 = fma(-2f, _e39.y, _e21.y); | ||
let _e65 = textureSample(global_4, global_3, vec2<f32>(_e21.x, _e63)); | ||
let _e67 = textureSample(global_4, global_3, vec2<f32>(_e58, _e63)); | ||
let _e71 = textureSample(global_4, global_3, vec2<f32>((_e21.x - _e39.x), (_e21.y + _e39.y))); | ||
let _e73 = textureSample(global_4, global_3, (_e21 + _e39)); | ||
let _e75 = textureSample(global_4, global_3, (_e21 - _e39)); | ||
let _e79 = textureSample(global_4, global_3, vec2<f32>((_e21.x + _e39.x), (_e21.y - _e39.y))); | ||
global_5 = vec4<f32>(max(fma((((_e49.x + _e54.x) + _e62.x) + _e67.x), 0.03125f, fma(0.125f, (_e57.x + (((_e71.x + _e73.x) + _e75.x) + _e79.x)), ((((_e51.x + _e56.x) + _e65.x) + _e60.x) * 0.0625f))), 0.00000011920929f), max(fma((((_e49.y + _e54.y) + _e62.y) + _e67.y), 0.03125f, fma(0.125f, (_e57.y + (((_e71.y + _e73.y) + _e75.y) + _e79.y)), ((((_e51.y + _e56.y) + _e65.y) + _e60.y) * 0.0625f))), 0.00000011920929f), max(fma((((_e49.z + _e54.z) + _e62.z) + _e67.z), 0.03125f, fma(0.125f, (_e57.z + (((_e71.z + _e73.z) + _e75.z) + _e79.z)), ((((_e51.z + _e56.z) + _e65.z) + _e60.z) * 0.0625f))), 0.00000011920929f), max(fma((((_e49.w + _e54.w) + _e62.w) + _e67.w), 0.03125f, fma(0.125f, (_e57.w + (((_e71.w + _e73.w) + _e75.w) + _e79.w)), ((((_e51.w + _e56.w) + _e65.w) + _e60.w) * 0.0625f))), 1f)); | ||
return; | ||
} | ||
|
||
@fragment | ||
fn bloombloom_downsample_fragment(@location(0) param: vec2<f32>, @location(1) @interpolate(flat) param_1: u32) -> @location(0) vec4<f32> { | ||
global_1 = param; | ||
global_2 = param_1; | ||
function(); | ||
let _e5 = global_5; | ||
return _e5; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
struct type_8 { | ||
member: array<u32>, | ||
} | ||
|
||
@group(0) @binding(0) | ||
var<storage> global: type_8; | ||
var<private> global_1: vec2<f32>; | ||
var<private> global_2: u32; | ||
@group(0) @binding(2) | ||
var global_3: sampler; | ||
@group(0) @binding(1) | ||
var global_4: texture_2d<f32>; | ||
@group(0) @binding(4) | ||
var global_5: sampler; | ||
@group(0) @binding(3) | ||
var global_6: texture_2d<f32>; | ||
var<private> global_7: vec4<f32>; | ||
|
||
fn function() { | ||
var phi_131_: bool; | ||
var phi_80_: f32; | ||
|
||
let _e14 = arrayLength((&global.member)); | ||
let _e15 = global_1; | ||
let _e16 = global_2; | ||
if (_e14 >= 1u) { | ||
phi_131_ = (_e16 <= (_e14 - 1u)); | ||
} else { | ||
phi_131_ = false; | ||
} | ||
let _e21 = phi_131_; | ||
if _e21 { | ||
let _e24 = global.member[_e16]; | ||
phi_80_ = bitcast<f32>(_e24); | ||
} else { | ||
phi_80_ = 0f; | ||
} | ||
let _e27 = phi_80_; | ||
let _e28 = textureSample(global_4, global_3, _e15); | ||
let _e32 = textureSample(global_6, global_5, _e15); | ||
global_7 = vec4<f32>(fma((_e32.x - _e28.x), _e27, _e28.x), fma((_e32.y - _e28.y), _e27, _e28.y), fma((_e32.z - _e28.z), _e27, _e28.z), 1f); | ||
return; | ||
} | ||
|
||
@fragment | ||
fn bloombloom_mix_fragment(@location(0) param: vec2<f32>, @location(1) @interpolate(flat) param_1: u32) -> @location(0) vec4<f32> { | ||
global_1 = param; | ||
global_2 = param_1; | ||
function(); | ||
let _e5 = global_7; | ||
return _e5; | ||
} |
Binary file not shown.
60 changes: 60 additions & 0 deletions
60
crates/renderling/shaders/bloom-bloom_upsample_fragment.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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
struct type_8 { | ||
member: array<u32>, | ||
} | ||
|
||
@group(0) @binding(0) | ||
var<storage> global: type_8; | ||
var<private> global_1: vec2<f32>; | ||
@group(0) @binding(2) | ||
var global_2: sampler; | ||
@group(0) @binding(1) | ||
var global_3: texture_2d<f32>; | ||
var<private> global_4: u32; | ||
var<private> global_5: vec4<f32>; | ||
|
||
fn function() { | ||
var phi_235_: bool; | ||
var phi_108_: vec2<f32>; | ||
|
||
let _e17 = arrayLength((&global.member)); | ||
let _e18 = global_1; | ||
let _e19 = global_4; | ||
if (_e17 >= 2u) { | ||
phi_235_ = (_e19 <= (_e17 - 2u)); | ||
} else { | ||
phi_235_ = false; | ||
} | ||
let _e24 = phi_235_; | ||
if _e24 { | ||
let _e27 = global.member[_e19]; | ||
let _e32 = global.member[(_e19 + 1u)]; | ||
phi_108_ = vec2<f32>(bitcast<f32>(_e27), bitcast<f32>(_e32)); | ||
} else { | ||
phi_108_ = vec2<f32>(0f, 0f); | ||
} | ||
let _e36 = phi_108_; | ||
let _e40 = (_e18.x - _e36.x); | ||
let _e42 = (_e18.y + _e36.y); | ||
let _e44 = textureSample(global_3, global_2, vec2<f32>(_e40, _e42)); | ||
let _e49 = textureSample(global_3, global_2, vec2<f32>(_e18.x, _e42)); | ||
let _e54 = textureSample(global_3, global_2, (_e18 + _e36)); | ||
let _e59 = textureSample(global_3, global_2, vec2<f32>(_e40, _e18.y)); | ||
let _e63 = textureSample(global_3, global_2, _e18); | ||
let _e67 = (_e18.x + _e36.x); | ||
let _e69 = textureSample(global_3, global_2, vec2<f32>(_e67, _e18.y)); | ||
let _e74 = textureSample(global_3, global_2, (_e18 - _e36)); | ||
let _e78 = (_e18.y - _e36.y); | ||
let _e80 = textureSample(global_3, global_2, vec2<f32>(_e18.x, _e78)); | ||
let _e85 = textureSample(global_3, global_2, vec2<f32>(_e67, _e78)); | ||
global_5 = vec4<f32>(((fma(_e63.x, 4f, ((((_e49.x + _e59.x) + _e69.x) + _e80.x) * 2f)) + (((_e44.x + _e54.x) + _e74.x) + _e85.x)) * 0.0625f), ((fma(_e63.y, 4f, ((((_e49.y + _e59.y) + _e69.y) + _e80.y) * 2f)) + (((_e44.y + _e54.y) + _e74.y) + _e85.y)) * 0.0625f), ((fma(_e63.z, 4f, ((((_e49.z + _e59.z) + _e69.z) + _e80.z) * 2f)) + (((_e44.z + _e54.z) + _e74.z) + _e85.z)) * 0.0625f), 0.5f); | ||
return; | ||
} | ||
|
||
@fragment | ||
fn bloombloom_upsample_fragment(@location(0) param: vec2<f32>, @location(1) @interpolate(flat) param_1: u32) -> @location(0) vec4<f32> { | ||
global_1 = param; | ||
global_4 = param_1; | ||
function(); | ||
let _e5 = global_5; | ||
return _e5; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
struct VertexOutput { | ||
@location(0) member: vec2<f32>, | ||
@location(1) @interpolate(flat) member_1: u32, | ||
@builtin(position) member_2: vec4<f32>, | ||
} | ||
|
||
var<private> global: u32; | ||
var<private> global_1: u32; | ||
var<private> global_2: vec2<f32>; | ||
var<private> global_3: vec4<f32> = vec4<f32>(0f, 0f, 0f, 1f); | ||
var<private> global_4: u32; | ||
|
||
fn function() { | ||
var local: array<vec2<f32>, 6>; | ||
var local_1: array<vec4<f32>, 6>; | ||
|
||
let _e22 = global; | ||
let _e23 = global_1; | ||
let _e24 = (_e22 % 6u); | ||
local = array<vec2<f32>, 6>(vec2<f32>(0f, 1f), vec2<f32>(1f, 1f), vec2<f32>(1f, 0f), vec2<f32>(1f, 0f), vec2<f32>(0f, 0f), vec2<f32>(0f, 1f)); | ||
let _e25 = (_e24 < 6u); | ||
if _e25 { | ||
let _e27 = local[_e24]; | ||
global_2 = _e27; | ||
local_1 = array<vec4<f32>, 6>(vec4<f32>(-1f, -1f, 0.5f, 1f), vec4<f32>(1f, -1f, 0.5f, 1f), vec4<f32>(1f, 1f, 0.5f, 1f), vec4<f32>(1f, 1f, 0.5f, 1f), vec4<f32>(-1f, 1f, 0.5f, 1f), vec4<f32>(-1f, -1f, 0.5f, 1f)); | ||
if _e25 { | ||
let _e29 = local_1[_e24]; | ||
global_3 = _e29; | ||
global_4 = _e23; | ||
} | ||
} | ||
return; | ||
} | ||
|
||
@vertex | ||
fn bloombloom_vertex(@builtin(vertex_index) param: u32, @builtin(instance_index) param_1: u32) -> VertexOutput { | ||
global = param; | ||
global_1 = param_1; | ||
function(); | ||
let _e8 = global_3.y; | ||
global_3.y = -(_e8); | ||
let _e10 = global_2; | ||
let _e11 = global_4; | ||
let _e12 = global_3; | ||
return VertexOutput(_e10, _e11, _e12); | ||
} |
Binary file added
BIN
+5.09 KB
crates/renderling/shaders/convolution-brdf_lut_convolution_fragment.spv
Binary file not shown.
Oops, something went wrong.