SPDX license update
This commit is contained in:
parent
a879c834c7
commit
42a479572d
181 changed files with 1328 additions and 1392 deletions
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// Custom UI compute shader. Demonstrates the Tier 1 dispatch path:
|
||||
// the user defines their own item struct, writes their own GLSL alongside
|
||||
// the standard shaders (sharing the same UIDispatchHeader contract via
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// DOM-mode port of inverse-circle.comp.glsl. Inverts RGB inside each
|
||||
// user-supplied circle; passes through every other pixel so the
|
||||
// ping-pong carries the prior dispatch's scene forward.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// Tier 1 demo: a user-authored compute shader dispatched alongside the
|
||||
// standard ones. The custom shader inverts RGB in the area covered by a
|
||||
// list of circles. The mouse-tracking circle moves; two static ones sit
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
import std;
|
||||
import Crafter.Build;
|
||||
namespace fs = std::filesystem;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// End-to-end demo of GPU asset decompression via VK_EXT_memory_decompression.
|
||||
//
|
||||
// Walks the full compressed-asset pipeline:
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
import std;
|
||||
import Crafter.Build;
|
||||
namespace fs = std::filesystem;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// HDRBloom blur pass (PlainComputeShader). Box-blurs the thresholded bloom
|
||||
// mip into a second rgba16float target — demonstrating an N-target float
|
||||
// chain: this pass SAMPLES the texture the threshold pass wrote (storage
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// HDRBloom closest-hit (runs in SHADE). Half the cubes are "emitters" that
|
||||
// accumulate a strongly super-1.0 radiance (the HDR signal a bloom pass
|
||||
// extracts); the rest are dim Lambert-shaded fillers near/below 1.0 that the
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// HDRBloom composite (UI custom shader, dispatched via UIRenderer). Runs
|
||||
// inside the per-frame UI compute pass, so it owns the ping-pong `out`
|
||||
// texture that gets blitted to the canvas — the app's composite→swapchain
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// HDRBloom — cross-backend-shaped HDR post-process on the WebGPU/DOM
|
||||
// backend, exercising the primitives added for issue #27:
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// HDRBloom miss (runs in SHADE). Dark, sub-threshold background so the
|
||||
// bloom pass only picks up the bright cubes, not the sky.
|
||||
fn miss_main(ray: RayDesc, payload: ptr<function, Payload>) {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
import std;
|
||||
import Crafter.Build;
|
||||
namespace fs = std::filesystem;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// HDRBloom raygen (runs in GENERATE). Host-driven pinhole camera at
|
||||
// @group(3) (groups 0..2 are reserved by the wavefront pipeline:
|
||||
// 0 = WfParams, 1 = data heaps, 2 = indirect args). Primary rays only —
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// HDRBloom threshold pass (PlainComputeShader). Reads the linear HDR scene
|
||||
// (rgba16float, written by the RT RESOLVE stage), keeps only the radiance
|
||||
// above 1.0, and writes it into the bloom mip (also rgba16float). This is
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
/*
|
||||
HelloDom — exercises every public surface of the DOM partition that
|
||||
absorbed Crafter.CppDOM:
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
/*
|
||||
HelloDom — the minimum DOM-mode example. Build with:
|
||||
crafter-build --local --target=wasm32-wasip1
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// Smoke test for the Tier 1+2+3 UI architecture. Opens a window, draws a
|
||||
// background, a button (Tier 3 component), a slider (Tier 3 component), a
|
||||
// progress bar (Tier 3 component), and a circle that follows the mouse
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
import std;
|
||||
import Crafter.Build;
|
||||
namespace fs = std::filesystem;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
import Crafter.Graphics;
|
||||
import std;
|
||||
using namespace Crafter;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
import std;
|
||||
import Crafter.Build;
|
||||
namespace fs = std::filesystem;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// =====================================================================
|
||||
// InputSystem — guided tour of Crafter::Input
|
||||
// =====================================================================
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
import std;
|
||||
import Crafter.Build;
|
||||
namespace fs = std::filesystem;
|
||||
|
|
|
|||
21
examples/LICENSE
Normal file
21
examples/LICENSE
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (C) 2026 Catcrafts®
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// RTMultiShadow closest-hit (runs in SHADE). The multi-light counterpart
|
||||
// of RTStress: EVERY light emits its own shadow ray from this single
|
||||
// invocation, so several rays for the same pixel resolve in the next SHADE
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// RTMultiShadow — multi-light shadowing through the wavefront RT pipeline
|
||||
// (issue #30). Five pillars on a checkered ground, lit by four colored
|
||||
// point lights; the closest-hit emits one shadow ray PER LIGHT from the
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// RTMultiShadow miss (runs in SHADE). Shadow miss → that light is visible
|
||||
// from the surface, so add its pending contribution; up to LIGHT_COUNT of
|
||||
// these resolve for the same pixel in one pass (atomic rtAccumulate, #30).
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
import std;
|
||||
import Crafter.Build;
|
||||
namespace fs = std::filesystem;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// RTMultiShadow raygen (runs in GENERATE). Host-driven pinhole camera at
|
||||
// @group(3) (groups 0..2 are reserved by the wavefront pipeline:
|
||||
// 0 = WfParams, 1 = data heaps, 2 = indirect args).
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// RTMultiShadow RESOLVE-stage tonemap: Reinhard + gamma 2.2 over the
|
||||
// linear accumulator. Registered as a WebGPURTStage::Resolve shader.
|
||||
fn resolve_main(coord: vec2<u32>, hdr: vec4<f32>) -> vec4<f32> {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// RTStress closest-hit (runs in SHADE). Computes flat-shaded Lambert from
|
||||
// the hit triangle's geometric normal, accumulates ambient, and — if the
|
||||
// surface faces the sun — emits a shadow ray toward the sun. The shadow
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// RTStress — the standing many-instance wavefront RT benchmark. An
|
||||
// N×N×N grid of a small cube mesh (one BLAS, many TLAS instances), shaded
|
||||
// with primary + shadow rays through the wavefront pipeline. The grid edge
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// RTStress miss (runs in SHADE). Primary miss → sky gradient. Shadow miss
|
||||
// → the sun is unoccluded, so add the pending direct contribution.
|
||||
fn miss_main(ray: RayDesc, payload: ptr<function, Payload>) {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
import std;
|
||||
import Crafter.Build;
|
||||
namespace fs = std::filesystem;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// RTStress raygen (runs in GENERATE). Host-driven pinhole camera at
|
||||
// @group(3) (groups 0..2 are reserved by the wavefront pipeline:
|
||||
// 0 = WfParams, 1 = data heaps, 2 = indirect args).
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// RTStress RESOLVE-stage tonemap: Reinhard + gamma 2.2 over the linear
|
||||
// accumulator. Registered as a WebGPURTStage::Resolve shader.
|
||||
fn resolve_main(coord: vec2<u32>, hdr: vec4<f32>) -> vec4<f32> {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
#version 460
|
||||
#extension GL_EXT_buffer_reference : enable
|
||||
#extension GL_EXT_scalar_block_layout : enable
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// Issue #37: GPU producer (WebGPU) for the procedural AABB build input.
|
||||
// Writes the per-box bounding boxes straight into a device storage buffer
|
||||
// that Mesh::BuildProcedural / RefitProcedural then consume by handle, with
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
#version 460
|
||||
#extension GL_EXT_ray_tracing : enable
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// RTVolume any-hit shader (runs in TRACE on every candidate sphere hit,
|
||||
// because the geometry is registered non-opaque). Punches a spherical
|
||||
// checkerboard of holes: for half the cells it returns RT_ANYHIT_IGNORE,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
#version 460
|
||||
#extension GL_EXT_ray_tracing : enable
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// RTVolume closest-hit (runs in SHADE). Shades the procedural sphere by
|
||||
// its surface normal with a fixed sun + ambient, tinted per instance.
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
#version 460
|
||||
#extension GL_EXT_ray_tracing : enable
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// RTVolume intersection shader (runs in TRACE, per AABB the ray enters).
|
||||
// Analytic ray-sphere test: the unit box [-1,1]^3 is treated as the
|
||||
// bounding volume of a sphere of radius 1 centred at the box centre. The
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// RTVolume — procedural (AABB) ray tracing on both backends. Demonstrates
|
||||
// the two features this example was written to exercise:
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
#version 460
|
||||
#extension GL_EXT_ray_tracing : enable
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// RTVolume miss (runs in SHADE). Vertical sky gradient — also what shows
|
||||
// through the any-hit cut-out cells.
|
||||
fn miss_main(ray: RayDesc, payload: ptr<function, Payload>) {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
import std;
|
||||
import Crafter.Build;
|
||||
namespace fs = std::filesystem;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
#version 460
|
||||
#extension GL_EXT_ray_tracing : enable
|
||||
#extension GL_EXT_shader_image_load_formatted : enable
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// RTVolume raygen (runs in GENERATE). Host-driven pinhole camera at
|
||||
// @group(3) (groups 0..2 are reserved by the wavefront pipeline:
|
||||
// 0 = WfParams, 1 = data heaps, 2 = indirect args).
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// RTVolume RESOLVE-stage tonemap: Reinhard + gamma 2.2 over the linear
|
||||
// accumulator.
|
||||
fn resolve_main(coord: vec2<u32>, hdr: vec4<f32>) -> vec4<f32> {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// RTStress closest-hit (runs in SHADE). Computes flat-shaded Lambert from
|
||||
// the hit triangle's geometric normal, accumulates ambient, and — if the
|
||||
// surface faces the sun — emits a shadow ray toward the sun. The shadow
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// RayQueryPick — regression test for the WebGPU software ray-query shim.
|
||||
//
|
||||
// Builds an 8³ = 512-instance TLAS (well below the 8193 threshold where a
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// RTStress miss (runs in SHADE). Primary miss → sky gradient. Shadow miss
|
||||
// → the sun is unoccluded, so add the pending direct contribution.
|
||||
fn miss_main(ray: RayDesc, payload: ptr<function, Payload>) {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
import std;
|
||||
import Crafter.Build;
|
||||
namespace fs = std::filesystem;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// RTStress raygen (runs in GENERATE). Host-driven pinhole camera at
|
||||
// @group(3) (groups 0..2 are reserved by the wavefront pipeline:
|
||||
// 0 = WfParams, 1 = data heaps, 2 = indirect args).
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// rayQuery picking smoke test (WebGPU/DOM software ray-query path).
|
||||
//
|
||||
// Shoots a single, fully-determined ray at a known TLAS instance through
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// RTStress RESOLVE-stage tonemap: Reinhard + gamma 2.2 over the linear
|
||||
// accumulator. Registered as a WebGPURTStage::Resolve shader.
|
||||
fn resolve_main(coord: vec2<u32>, hdr: vec4<f32>) -> vec4<f32> {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
#version 460
|
||||
#extension GL_EXT_ray_tracing : enable
|
||||
#extension GL_EXT_shader_image_load_formatted : enable
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// Sponza closest-hit (runs in SHADE). In the wavefront model the lighting
|
||||
// + shadow trace that used to live in raygen happens here: gather surface
|
||||
// data, accumulate ambient, and emit a shadow ray toward the sun carrying
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// Sponza on Vulkan + WebGPU. Same example source, two backends — picked
|
||||
// by CRAFTER_GRAPHICS_WINDOW_DOM. Both paths:
|
||||
// 1. Load a Sponza .cmesh (positions + indices, optional per-vertex
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
#version 460
|
||||
#extension GL_EXT_ray_tracing : enable
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// Sponza miss (runs in SHADE). Primary miss → two-stop sky gradient.
|
||||
// Shadow miss → the sun is unoccluded, so add the pending direct term.
|
||||
fn miss_main(ray: RayDesc, payload: ptr<function, Payload>) {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
import std;
|
||||
import Crafter.Build;
|
||||
namespace fs = std::filesystem;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
#version 460
|
||||
#extension GL_EXT_ray_tracing : enable
|
||||
#extension GL_EXT_shader_image_load_formatted : enable
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// Sponza raygen (runs in GENERATE). Emits the pixel's primary ray; all
|
||||
// shading + the shadow trace now happen in SHADE (closesthit/miss). Camera
|
||||
// state comes from the host each frame via a storage buffer at
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// Sponza RESOLVE-stage tonemap: Reinhard + gamma 2.2 over the linear
|
||||
// accumulator — matches the tonemap the megakernel raygen applied inline.
|
||||
fn resolve_main(coord: vec2<u32>, hdr: vec4<f32>) -> vec4<f32> {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
#version 460
|
||||
#extension GL_EXT_ray_tracing : enable
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// SponzaBench — headless benchmark around the native Sponza RT scene.
|
||||
//
|
||||
// Identical setup to examples/Sponza (native branch): load the Sponza
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
#version 460
|
||||
#extension GL_EXT_ray_tracing : enable
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
import std;
|
||||
import Crafter.Build;
|
||||
namespace fs = std::filesystem;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
#version 460
|
||||
#extension GL_EXT_ray_tracing : enable
|
||||
#extension GL_EXT_shader_image_load_formatted : enable
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
#SPDX-License-Identifier: MIT
|
||||
#SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
# Repeated-measurement harness for SponzaBench. Runs the binary in $BINDIR
|
||||
# REPS times for a given mesh cap and reports the median (and min/max) of
|
||||
# each BENCH metric. Validation is force-disabled via the loader (it adds
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
#version 460
|
||||
#extension GL_EXT_ray_tracing : enable
|
||||
#extension GL_EXT_nonuniform_qualifier : enable
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// Payload declared here so the WGSL assembler sees it before the wfPayload
|
||||
// binding, the SHADE dispatch, and the raygen source.
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
#ifndef CRAFTER_GRAPHICS_WINDOW_DOM
|
||||
#include "vulkan/vulkan.h"
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
#version 460
|
||||
#extension GL_EXT_ray_tracing : enable
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// Wavefront miss: runs in SHADE for rays that hit nothing. Accumulate the
|
||||
// white background directly.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
import std;
|
||||
import Crafter.Build;
|
||||
namespace fs = std::filesystem;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
#version 460
|
||||
#extension GL_EXT_ray_tracing : enable
|
||||
#extension GL_EXT_shader_image_load_formatted : enable
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//SPDX-License-Identifier: MIT
|
||||
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
// WebGPU wavefront raygen. Runs in GENERATE: compute the pinhole camera
|
||||
// ray and emit it as the pixel's primary ray. Shading happens later in
|
||||
// SHADE (closesthit/miss). The Payload type is declared in closesthit.wgsl.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue