File tree Expand file tree Collapse file tree 7 files changed +36
-0
lines changed Expand file tree Collapse file tree 7 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,11 @@ import commonWGSL from './common.wgsl';
5
5
* Common holds the shared WGSL between the shaders, including the common uniform buffer.
6
6
*/
7
7
export default class Common {
8
+ static sourceInfo = {
9
+ name : __filename . substring ( __dirname . length + 1 ) ,
10
+ contents : __SOURCE__ ,
11
+ } ;
12
+
8
13
/** The WGSL of the common shader */
9
14
readonly wgsl = commonWGSL ;
10
15
/** The common uniform buffer bind group and layout */
Original file line number Diff line number Diff line change @@ -126,6 +126,12 @@ const CornellBox: () => JSX.Element = () =>
126
126
name : __filename . substring ( __dirname . length + 1 ) ,
127
127
contents : __SOURCE__ ,
128
128
} ,
129
+ Common . sourceInfo ,
130
+ Scene . sourceInfo ,
131
+ Radiosity . sourceInfo ,
132
+ Rasterizer . sourceInfo ,
133
+ Raytracer . sourceInfo ,
134
+ Tonemapper . sourceInfo ,
129
135
{
130
136
name : './radiosity.wgsl' ,
131
137
contents : radiosityWGSL ,
Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ import Scene from './scene';
7
7
* the scene.
8
8
*/
9
9
export default class Radiosity {
10
+ static sourceInfo = {
11
+ name : __filename . substring ( __dirname . length + 1 ) ,
12
+ contents : __SOURCE__ ,
13
+ } ;
14
+
10
15
// The output lightmap format and dimensions
11
16
static readonly lightmapFormat = 'rgba16float' ;
12
17
static readonly lightmapWidth = 256 ;
Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ import Scene from './scene';
8
8
* Rasterizer renders the scene using a regular raserization graphics pipeline.
9
9
*/
10
10
export default class Rasterizer {
11
+ static sourceInfo = {
12
+ name : __filename . substring ( __dirname . length + 1 ) ,
13
+ contents : __SOURCE__ ,
14
+ } ;
15
+
11
16
private readonly common : Common ;
12
17
private readonly scene : Scene ;
13
18
private readonly renderPassDescriptor : GPURenderPassDescriptor ;
Original file line number Diff line number Diff line change @@ -7,6 +7,11 @@ import Radiosity from './radiosity';
7
7
* Raytracer renders the scene using a software ray-tracing compute pipeline.
8
8
*/
9
9
export default class Raytracer {
10
+ static sourceInfo = {
11
+ name : __filename . substring ( __dirname . length + 1 ) ,
12
+ contents : __SOURCE__ ,
13
+ } ;
14
+
10
15
private readonly common : Common ;
11
16
private readonly framebuffer : GPUTexture ;
12
17
private readonly pipeline : GPUComputePipeline ;
Original file line number Diff line number Diff line change @@ -144,6 +144,11 @@ const light: Quad = {
144
144
* Scene holds the cornell-box scene information.
145
145
*/
146
146
export default class Scene {
147
+ static sourceInfo = {
148
+ name : __filename . substring ( __dirname . length + 1 ) ,
149
+ contents : __SOURCE__ ,
150
+ } ;
151
+
147
152
readonly vertexCount : number ;
148
153
readonly indexCount : number ;
149
154
readonly vertices : GPUBuffer ;
Original file line number Diff line number Diff line change @@ -6,6 +6,11 @@ import tonemapperWGSL from './tonemapper.wgsl';
6
6
* a gamma-correct, tonemapped framebuffer used for presentation.
7
7
*/
8
8
export default class Tonemapper {
9
+ static sourceInfo = {
10
+ name : __filename . substring ( __dirname . length + 1 ) ,
11
+ contents : __SOURCE__ ,
12
+ } ;
13
+
9
14
private readonly bindGroup : GPUBindGroup ;
10
15
private readonly pipeline : GPUComputePipeline ;
11
16
private readonly width : number ;
You can’t perform that action at this time.
0 commit comments