mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-18 06:09:30 -07:00
Binding syntax changes
This commit is contained in:
@@ -116,7 +116,7 @@ const getTypeData = (type, attributes, otherStructLayouts) => {
|
|||||||
const parseAttributes = (str) => {
|
const parseAttributes = (str) => {
|
||||||
const attributes = {};
|
const attributes = {};
|
||||||
for (const attr of str.split(",").filter((attr) => attr.length > 0)) {
|
for (const attr of str.split(",").filter((attr) => attr.length > 0)) {
|
||||||
const match = attr.match(/(\w+)(\((.*)\))?/); // foo(bar)
|
const match = attr.match(/@(\w+)(\((.*)\))?/); // @foo(bar)
|
||||||
const [_, identifier, __, value] = match;
|
const [_, identifier, __, value] = match;
|
||||||
attributes[identifier] = value;
|
attributes[identifier] = value;
|
||||||
}
|
}
|
||||||
@@ -131,7 +131,8 @@ const parseStructLayout = (identifier, body, structLayouts) => {
|
|||||||
.split(";")
|
.split(";")
|
||||||
.filter((s) => s.length > 0);
|
.filter((s) => s.length > 0);
|
||||||
for (const line of lines) {
|
for (const line of lines) {
|
||||||
const fieldMatch = line.match(/(\[\[(.*?)\]\])? ?(\w+) ?: ?(\[\[(.*?)\]\])? ?(.*)/); // [[...]] foo : [[...]] bar;
|
console.log(line);
|
||||||
|
const fieldMatch = line.match(/(\[\[(.*?)\]\])? ?(\w+) ?: ?(\[\[(.*?)\]\])? ?(.*)/); // @a(...) @b(...) foo : @c(...) @d(...) bar;
|
||||||
const [_, __, leftAttributes, identifier, ___, rightAttributes, type] = fieldMatch;
|
const [_, __, leftAttributes, identifier, ___, rightAttributes, type] = fieldMatch;
|
||||||
|
|
||||||
const typeData = getTypeData(type, parseAttributes(rightAttributes ?? ""), structLayouts);
|
const typeData = getTypeData(type, parseAttributes(rightAttributes ?? ""), structLayouts);
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ struct Config {
|
|||||||
direction : vec2<f32>;
|
direction : vec2<f32>;
|
||||||
};
|
};
|
||||||
|
|
||||||
[[group(0), binding(0)]] var<uniform> config : Config;
|
@group(0) @binding(0) var<uniform> config : Config;
|
||||||
[[group(0), binding(1)]] var linearSampler : sampler;
|
@group(0) @binding(1) var linearSampler : sampler;
|
||||||
[[group(0), binding(2)]] var tex : texture_2d<f32>;
|
@group(0) @binding(2) var tex : texture_2d<f32>;
|
||||||
[[group(0), binding(3)]] var outputTex : texture_storage_2d<rgba8unorm, write>;
|
@group(0) @binding(3) var outputTex : texture_storage_2d<rgba8unorm, write>;
|
||||||
|
|
||||||
struct ComputeInput {
|
struct ComputeInput {
|
||||||
[[builtin(global_invocation_id)]] id : vec3<u32>;
|
@builtin(global_invocation_id) id : vec3<u32>;
|
||||||
};
|
};
|
||||||
|
|
||||||
fn gaussianPDF(x : f32) -> f32 {
|
fn gaussianPDF(x : f32) -> f32 {
|
||||||
@@ -20,7 +20,7 @@ fn gaussianPDF(x : f32) -> f32 {
|
|||||||
) / config.bloomRadius;
|
) / config.bloomRadius;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[stage(compute), workgroup_size(32, 1, 1)]] fn computeMain(input : ComputeInput) {
|
@stage(compute) @workgroup_size(32, 1, 1) fn computeMain(input : ComputeInput) {
|
||||||
|
|
||||||
var coord = vec2<i32>(input.id.xy);
|
var coord = vec2<i32>(input.id.xy);
|
||||||
var outputSize = textureDimensions(outputTex);
|
var outputSize = textureDimensions(outputTex);
|
||||||
|
|||||||
@@ -2,24 +2,24 @@ struct Config {
|
|||||||
pyramidHeight : f32;
|
pyramidHeight : f32;
|
||||||
};
|
};
|
||||||
|
|
||||||
[[group(0), binding(0)]] var<uniform> config : Config;
|
@group(0) @binding(0) var<uniform> config : Config;
|
||||||
[[group(0), binding(1)]] var linearSampler : sampler;
|
@group(0) @binding(1) var linearSampler : sampler;
|
||||||
|
|
||||||
// Currently mipmap textures aren't working as expected in Firefox Nightly
|
// Currently mipmap textures aren't working as expected in Firefox Nightly
|
||||||
// [[group(0), binding(2)]] var tex : texture_2d<f32>;
|
// @group(0) @binding(2) var tex : texture_2d<f32>;
|
||||||
// [[group(0), binding(3)]] var outputTex : texture_storage_2d<rgba8unorm, write>;
|
// @group(0) @binding(3) var outputTex : texture_storage_2d<rgba8unorm, write>;
|
||||||
|
|
||||||
[[group(0), binding(2)]] var tex1 : texture_2d<f32>;
|
@group(0) @binding(2) var tex1 : texture_2d<f32>;
|
||||||
[[group(0), binding(3)]] var tex2 : texture_2d<f32>;
|
@group(0) @binding(3) var tex2 : texture_2d<f32>;
|
||||||
[[group(0), binding(4)]] var tex3 : texture_2d<f32>;
|
@group(0) @binding(4) var tex3 : texture_2d<f32>;
|
||||||
[[group(0), binding(5)]] var tex4 : texture_2d<f32>;
|
@group(0) @binding(5) var tex4 : texture_2d<f32>;
|
||||||
[[group(0), binding(6)]] var outputTex : texture_storage_2d<rgba8unorm, write>;
|
@group(0) @binding(6) var outputTex : texture_storage_2d<rgba8unorm, write>;
|
||||||
|
|
||||||
struct ComputeInput {
|
struct ComputeInput {
|
||||||
[[builtin(global_invocation_id)]] id : vec3<u32>;
|
@builtin(global_invocation_id) id : vec3<u32>;
|
||||||
};
|
};
|
||||||
|
|
||||||
[[stage(compute), workgroup_size(32, 1, 1)]] fn computeMain(input : ComputeInput) {
|
@stage(compute) @workgroup_size(32, 1, 1) fn computeMain(input : ComputeInput) {
|
||||||
|
|
||||||
var coord = vec2<i32>(input.id.xy);
|
var coord = vec2<i32>(input.id.xy);
|
||||||
var outputSize = textureDimensions(outputTex);
|
var outputSize = textureDimensions(outputTex);
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
[[group(0), binding(0)]] var nearestSampler : sampler;
|
@group(0) @binding(0) var nearestSampler : sampler;
|
||||||
[[group(0), binding(1)]] var tex : texture_2d<f32>;
|
@group(0) @binding(1) var tex : texture_2d<f32>;
|
||||||
|
|
||||||
struct VertOutput {
|
struct VertOutput {
|
||||||
[[builtin(position)]] Position : vec4<f32>;
|
@builtin(position) Position : vec4<f32>;
|
||||||
[[location(0)]] uv : vec2<f32>;
|
@location(0) uv : vec2<f32>;
|
||||||
};
|
};
|
||||||
|
|
||||||
[[stage(vertex)]] fn vertMain([[builtin(vertex_index)]] index : u32) -> VertOutput {
|
@stage(vertex) fn vertMain(@builtin(vertex_index) index : u32) -> VertOutput {
|
||||||
var uv = vec2<f32>(f32(index % 2u), f32((index + 1u) % 6u / 3u));
|
var uv = vec2<f32>(f32(index % 2u), f32((index + 1u) % 6u / 3u));
|
||||||
var position = vec4<f32>(uv * 2.0 - 1.0, 1.0, 1.0);
|
var position = vec4<f32>(uv * 2.0 - 1.0, 1.0, 1.0);
|
||||||
return VertOutput(position, uv);
|
return VertOutput(position, uv);
|
||||||
}
|
}
|
||||||
|
|
||||||
[[stage(fragment)]] fn fragMain(input : VertOutput) -> [[location(0)]] vec4<f32> {
|
@stage(fragment) fn fragMain(input : VertOutput) -> @location(0) vec4<f32> {
|
||||||
var uv = input.uv;
|
var uv = input.uv;
|
||||||
uv.y = 1.0 - uv.y;
|
uv.y = 1.0 - uv.y;
|
||||||
return textureSample( tex, nearestSampler, uv );
|
return textureSample( tex, nearestSampler, uv );
|
||||||
|
|||||||
@@ -2,15 +2,15 @@ struct Config {
|
|||||||
bloomStrength : f32;
|
bloomStrength : f32;
|
||||||
};
|
};
|
||||||
|
|
||||||
[[group(0), binding(0)]] var<uniform> config : Config;
|
@group(0) @binding(0) var<uniform> config : Config;
|
||||||
[[group(0), binding(1)]] var linearSampler : sampler;
|
@group(0) @binding(1) var linearSampler : sampler;
|
||||||
[[group(0), binding(2)]] var tex : texture_2d<f32>;
|
@group(0) @binding(2) var tex : texture_2d<f32>;
|
||||||
[[group(0), binding(3)]] var bloomTex : texture_2d<f32>;
|
@group(0) @binding(3) var bloomTex : texture_2d<f32>;
|
||||||
[[group(0), binding(4)]] var backgroundTex : texture_2d<f32>;
|
@group(0) @binding(4) var backgroundTex : texture_2d<f32>;
|
||||||
[[group(0), binding(5)]] var outputTex : texture_storage_2d<rgba8unorm, write>;
|
@group(0) @binding(5) var outputTex : texture_storage_2d<rgba8unorm, write>;
|
||||||
|
|
||||||
struct ComputeInput {
|
struct ComputeInput {
|
||||||
[[builtin(global_invocation_id)]] id : vec3<u32>;
|
@builtin(global_invocation_id) id : vec3<u32>;
|
||||||
};
|
};
|
||||||
|
|
||||||
fn getBrightness(uv : vec2<f32>) -> vec4<f32> {
|
fn getBrightness(uv : vec2<f32>) -> vec4<f32> {
|
||||||
@@ -19,7 +19,7 @@ fn getBrightness(uv : vec2<f32>) -> vec4<f32> {
|
|||||||
return min((primary + bloom) * (2.0 - config.bloomStrength), vec4<f32>(1.0));
|
return min((primary + bloom) * (2.0 - config.bloomStrength), vec4<f32>(1.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
[[stage(compute), workgroup_size(32, 1, 1)]] fn computeMain(input : ComputeInput) {
|
@stage(compute) @workgroup_size(32, 1, 1) fn computeMain(input : ComputeInput) {
|
||||||
|
|
||||||
// Resolve the invocation ID to a texel coordinate
|
// Resolve the invocation ID to a texel coordinate
|
||||||
var coord = vec2<i32>(input.id.xy);
|
var coord = vec2<i32>(input.id.xy);
|
||||||
|
|||||||
@@ -13,16 +13,16 @@ struct Time {
|
|||||||
frames : i32;
|
frames : i32;
|
||||||
};
|
};
|
||||||
|
|
||||||
[[group(0), binding(0)]] var<uniform> config : Config;
|
@group(0) @binding(0) var<uniform> config : Config;
|
||||||
[[group(0), binding(1)]] var<uniform> palette : Palette;
|
@group(0) @binding(1) var<uniform> palette : Palette;
|
||||||
[[group(0), binding(2)]] var<uniform> time : Time;
|
@group(0) @binding(2) var<uniform> time : Time;
|
||||||
[[group(0), binding(3)]] var linearSampler : sampler;
|
@group(0) @binding(3) var linearSampler : sampler;
|
||||||
[[group(0), binding(4)]] var tex : texture_2d<f32>;
|
@group(0) @binding(4) var tex : texture_2d<f32>;
|
||||||
[[group(0), binding(5)]] var bloomTex : texture_2d<f32>;
|
@group(0) @binding(5) var bloomTex : texture_2d<f32>;
|
||||||
[[group(0), binding(6)]] var outputTex : texture_storage_2d<rgba8unorm, write>;
|
@group(0) @binding(6) var outputTex : texture_storage_2d<rgba8unorm, write>;
|
||||||
|
|
||||||
struct ComputeInput {
|
struct ComputeInput {
|
||||||
[[builtin(global_invocation_id)]] id : vec3<u32>;
|
@builtin(global_invocation_id) id : vec3<u32>;
|
||||||
};
|
};
|
||||||
|
|
||||||
let PI : f32 = 3.14159265359;
|
let PI : f32 = 3.14159265359;
|
||||||
@@ -42,7 +42,7 @@ fn getBrightness(uv : vec2<f32>) -> vec4<f32> {
|
|||||||
return min((primary + bloom) * (2.0 - config.bloomStrength), vec4<f32>(1.0));
|
return min((primary + bloom) * (2.0 - config.bloomStrength), vec4<f32>(1.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
[[stage(compute), workgroup_size(32, 1, 1)]] fn computeMain(input : ComputeInput) {
|
@stage(compute) @workgroup_size(32, 1, 1) fn computeMain(input : ComputeInput) {
|
||||||
|
|
||||||
// Resolve the invocation ID to a texel coordinate
|
// Resolve the invocation ID to a texel coordinate
|
||||||
var coord = vec2<i32>(input.id.xy);
|
var coord = vec2<i32>(input.id.xy);
|
||||||
|
|||||||
@@ -60,38 +60,38 @@ struct CellData {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Shared bindings
|
// Shared bindings
|
||||||
[[group(0), binding(0)]] var<uniform> config : Config;
|
@group(0) @binding(0) var<uniform> config : Config;
|
||||||
[[group(0), binding(1)]] var<uniform> time : Time;
|
@group(0) @binding(1) var<uniform> time : Time;
|
||||||
|
|
||||||
// Compute-specific bindings
|
// Compute-specific bindings
|
||||||
[[group(0), binding(2)]] var<storage, read_write> cells_RW : CellData;
|
@group(0) @binding(2) var<storage, read_write> cells_RW : CellData;
|
||||||
|
|
||||||
// Render-specific bindings
|
// Render-specific bindings
|
||||||
[[group(0), binding(2)]] var<uniform> scene : Scene;
|
@group(0) @binding(2) var<uniform> scene : Scene;
|
||||||
[[group(0), binding(3)]] var linearSampler : sampler;
|
@group(0) @binding(3) var linearSampler : sampler;
|
||||||
[[group(0), binding(4)]] var msdfTexture : texture_2d<f32>;
|
@group(0) @binding(4) var msdfTexture : texture_2d<f32>;
|
||||||
[[group(0), binding(5)]] var<storage, read> cells_RO : CellData;
|
@group(0) @binding(5) var<storage, read> cells_RO : CellData;
|
||||||
|
|
||||||
// Shader params
|
// Shader params
|
||||||
|
|
||||||
struct ComputeInput {
|
struct ComputeInput {
|
||||||
[[builtin(global_invocation_id)]] id : vec3<u32>;
|
@builtin(global_invocation_id) id : vec3<u32>;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct VertInput {
|
struct VertInput {
|
||||||
[[builtin(vertex_index)]] index : u32;
|
@builtin(vertex_index) index : u32;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct VertOutput {
|
struct VertOutput {
|
||||||
[[builtin(position)]] Position : vec4<f32>;
|
@builtin(position) Position : vec4<f32>;
|
||||||
[[location(0)]] uv : vec2<f32>;
|
@location(0) uv : vec2<f32>;
|
||||||
[[location(1)]] channel : vec3<f32>;
|
@location(1) channel : vec3<f32>;
|
||||||
[[location(2)]] glyph : vec4<f32>;
|
@location(2) glyph : vec4<f32>;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FragOutput {
|
struct FragOutput {
|
||||||
[[location(0)]] color : vec4<f32>;
|
@location(0) color : vec4<f32>;
|
||||||
[[location(1)]] highPassColor : vec4<f32>;
|
@location(1) highPassColor : vec4<f32>;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
@@ -147,7 +147,7 @@ fn getCycleSpeed(rainTime : f32, brightness : f32) -> f32 {
|
|||||||
var localCycleSpeed = 0.0;
|
var localCycleSpeed = 0.0;
|
||||||
if (config.cycleStyle == 0 && brightness > 0.0) {
|
if (config.cycleStyle == 0 && brightness > 0.0) {
|
||||||
localCycleSpeed = pow(1.0 - brightness, 4.0);
|
localCycleSpeed = pow(1.0 - brightness, 4.0);
|
||||||
} elseif (config.cycleStyle == 1) {
|
} else if (config.cycleStyle == 1) {
|
||||||
localCycleSpeed = fract(rainTime);
|
localCycleSpeed = fract(rainTime);
|
||||||
}
|
}
|
||||||
return config.animationSpeed * config.cycleSpeed * localCycleSpeed;
|
return config.animationSpeed * config.cycleSpeed * localCycleSpeed;
|
||||||
@@ -194,7 +194,7 @@ fn applyRippleEffect(effect : f32, simTime : f32, screenPos : vec2<f32>) -> f32
|
|||||||
if (config.rippleType == 0) {
|
if (config.rippleType == 0) {
|
||||||
var boxDistance = abs(ripplePos) * vec2<f32>(1.0, config.glyphHeightToWidth);
|
var boxDistance = abs(ripplePos) * vec2<f32>(1.0, config.glyphHeightToWidth);
|
||||||
rippleDistance = max(boxDistance.x, boxDistance.y);
|
rippleDistance = max(boxDistance.x, boxDistance.y);
|
||||||
} elseif (config.rippleType == 1) {
|
} else if (config.rippleType == 1) {
|
||||||
rippleDistance = length(ripplePos);
|
rippleDistance = length(ripplePos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -277,7 +277,7 @@ fn computeResult (isFirstFrame : bool, previousResult : vec4<f32>, glyphPos : ve
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[stage(compute), workgroup_size(32, 1, 1)]] fn computeMain(input : ComputeInput) {
|
@stage(compute) @workgroup_size(32, 1, 1) fn computeMain(input : ComputeInput) {
|
||||||
|
|
||||||
// Resolve the invocation ID to a cell coordinate
|
// Resolve the invocation ID to a cell coordinate
|
||||||
var row = i32(input.id.y);
|
var row = i32(input.id.y);
|
||||||
@@ -305,7 +305,7 @@ fn computeResult (isFirstFrame : bool, previousResult : vec4<f32>, glyphPos : ve
|
|||||||
// vec2<f32>(1.0, 1.0), vec2<f32>(0.0, 1.0), vec2<f32>(1.0, 0.0)
|
// vec2<f32>(1.0, 1.0), vec2<f32>(0.0, 1.0), vec2<f32>(1.0, 0.0)
|
||||||
// );
|
// );
|
||||||
|
|
||||||
[[stage(vertex)]] fn vertMain(input : VertInput) -> VertOutput {
|
@stage(vertex) fn vertMain(input : VertInput) -> VertOutput {
|
||||||
|
|
||||||
var volumetric = bool(config.volumetric);
|
var volumetric = bool(config.volumetric);
|
||||||
|
|
||||||
@@ -383,7 +383,7 @@ fn getSymbolUV(glyphCycle : f32) -> vec2<f32> {
|
|||||||
|
|
||||||
// Fragment shader
|
// Fragment shader
|
||||||
|
|
||||||
[[stage(fragment)]] fn fragMain(input : VertOutput) -> FragOutput {
|
@stage(fragment) fn fragMain(input : VertOutput) -> FragOutput {
|
||||||
|
|
||||||
var volumetric = bool(config.volumetric);
|
var volumetric = bool(config.volumetric);
|
||||||
var uv = input.uv;
|
var uv = input.uv;
|
||||||
|
|||||||
@@ -9,15 +9,15 @@ struct Time {
|
|||||||
frames : i32;
|
frames : i32;
|
||||||
};
|
};
|
||||||
|
|
||||||
[[group(0), binding(0)]] var<uniform> config : Config;
|
@group(0) @binding(0) var<uniform> config : Config;
|
||||||
[[group(0), binding(1)]] var<uniform> time : Time;
|
@group(0) @binding(1) var<uniform> time : Time;
|
||||||
[[group(0), binding(2)]] var linearSampler : sampler;
|
@group(0) @binding(2) var linearSampler : sampler;
|
||||||
[[group(0), binding(3)]] var tex : texture_2d<f32>;
|
@group(0) @binding(3) var tex : texture_2d<f32>;
|
||||||
[[group(0), binding(4)]] var bloomTex : texture_2d<f32>;
|
@group(0) @binding(4) var bloomTex : texture_2d<f32>;
|
||||||
[[group(0), binding(5)]] var outputTex : texture_storage_2d<rgba8unorm, write>;
|
@group(0) @binding(5) var outputTex : texture_storage_2d<rgba8unorm, write>;
|
||||||
|
|
||||||
struct ComputeInput {
|
struct ComputeInput {
|
||||||
[[builtin(global_invocation_id)]] id : vec3<u32>;
|
@builtin(global_invocation_id) id : vec3<u32>;
|
||||||
};
|
};
|
||||||
|
|
||||||
let PI : f32 = 3.14159265359;
|
let PI : f32 = 3.14159265359;
|
||||||
@@ -56,7 +56,7 @@ fn hslToRgb(h : f32, s : f32, l : f32) -> vec3<f32> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
[[stage(compute), workgroup_size(32, 1, 1)]] fn computeMain(input : ComputeInput) {
|
@stage(compute) @workgroup_size(32, 1, 1) fn computeMain(input : ComputeInput) {
|
||||||
|
|
||||||
// Resolve the invocation ID to a texel coordinate
|
// Resolve the invocation ID to a texel coordinate
|
||||||
var coord = vec2<i32>(input.id.xy);
|
var coord = vec2<i32>(input.id.xy);
|
||||||
|
|||||||
@@ -9,16 +9,16 @@ struct Time {
|
|||||||
frames : i32;
|
frames : i32;
|
||||||
};
|
};
|
||||||
|
|
||||||
[[group(0), binding(0)]] var<uniform> config : Config;
|
@group(0) @binding(0) var<uniform> config : Config;
|
||||||
[[group(0), binding(1)]] var<uniform> time : Time;
|
@group(0) @binding(1) var<uniform> time : Time;
|
||||||
[[group(0), binding(2)]] var linearSampler : sampler;
|
@group(0) @binding(2) var linearSampler : sampler;
|
||||||
[[group(0), binding(3)]] var tex : texture_2d<f32>;
|
@group(0) @binding(3) var tex : texture_2d<f32>;
|
||||||
[[group(0), binding(4)]] var bloomTex : texture_2d<f32>;
|
@group(0) @binding(4) var bloomTex : texture_2d<f32>;
|
||||||
[[group(0), binding(5)]] var stripeTexture : texture_2d<f32>;
|
@group(0) @binding(5) var stripeTexture : texture_2d<f32>;
|
||||||
[[group(0), binding(6)]] var outputTex : texture_storage_2d<rgba8unorm, write>;
|
@group(0) @binding(6) var outputTex : texture_storage_2d<rgba8unorm, write>;
|
||||||
|
|
||||||
struct ComputeInput {
|
struct ComputeInput {
|
||||||
[[builtin(global_invocation_id)]] id : vec3<u32>;
|
@builtin(global_invocation_id) id : vec3<u32>;
|
||||||
};
|
};
|
||||||
|
|
||||||
let PI : f32 = 3.14159265359;
|
let PI : f32 = 3.14159265359;
|
||||||
@@ -38,7 +38,7 @@ fn getBrightness(uv : vec2<f32>) -> vec4<f32> {
|
|||||||
return min((primary + bloom) * (2.0 - config.bloomStrength), vec4<f32>(1.0));
|
return min((primary + bloom) * (2.0 - config.bloomStrength), vec4<f32>(1.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
[[stage(compute), workgroup_size(32, 1, 1)]] fn computeMain(input : ComputeInput) {
|
@stage(compute) @workgroup_size(32, 1, 1) fn computeMain(input : ComputeInput) {
|
||||||
|
|
||||||
// Resolve the invocation ID to a texel coordinate
|
// Resolve the invocation ID to a texel coordinate
|
||||||
var coord = vec2<i32>(input.id.xy);
|
var coord = vec2<i32>(input.id.xy);
|
||||||
|
|||||||
Reference in New Issue
Block a user