/
ChangeLog
825 lines (743 loc) · 33.1 KB
/
ChangeLog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
2022-01-12 Elliott Williams <emw@apple.com>
[Xcode] Configure each project for the legacy build system
https://bugs.webkit.org/show_bug.cgi?id=235091
Reviewed by Darin Adler.
* WebGPU.xcodeproj/project.pbxproj:
2022-01-10 Alex Christensen <achristensen@webkit.org>
Start using C++20
https://bugs.webkit.org/show_bug.cgi?id=233963
Reviewed by Yusuke Suzuki.
* Configurations/Base.xcconfig:
2022-01-07 Alex Christensen <achristensen@webkit.org>
Unreviewed, reverting r287698.
Broke an internal build
Reverted changeset:
"Start using C++20"
https://bugs.webkit.org/show_bug.cgi?id=233963
https://commits.webkit.org/r287698
2022-01-06 Alex Christensen <achristensen@webkit.org>
Start using C++20
https://bugs.webkit.org/show_bug.cgi?id=233963
Reviewed by Yusuke Suzuki.
* Configurations/Base.xcconfig:
2022-01-01 Jeff Miller <jeffm@apple.com>
Update user-visible copyright strings to include 2022
https://bugs.webkit.org/show_bug.cgi?id=234263
Reviewed by Anders Carlsson.
* Info.plist:
2021-12-21 Michael Saboff <msaboff@apple.com>
Fix symlinks for alternate root framework locations
https://bugs.webkit.org/show_bug.cgi?id=234567
Reviewed by Filip Pizlo.
Moved OUTPUT_ALTERNATE_ROOT_PATH in create symlink script from outputFileListPaths to outputPaths.
* WebGPU.xcodeproj/project.pbxproj:
2021-12-16 Michael Saboff <msaboff@apple.com>
https://bugs.webkit.org/show_bug.cgi?id=234173
Update Install Paths for build system changes
Reviewed by Filip Pizlo.
Added build variables and build step to create symlinks pointing to the alternate
build locations from the current framework install location.
* Configurations/WebGPU.xcconfig:
* Scripts: Added.
* Scripts/create-symlink-to-altroot.sh: Added.
* WebGPU.xcodeproj/project.pbxproj:
2021-12-13 Elliott Williams <emw@apple.com>
Deployment target for macOS 11+ does not follow minor version bumps
https://bugs.webkit.org/show_bug.cgi?id=233906
Reviewed by Alexey Proskuryakov.
* Configurations/DebugRelease.xcconfig:
2021-12-10 Michael Saboff <msaboff@apple.com>
https://bugs.webkit.org/show_bug.cgi?id=234173
Update Install Paths for build system changes
Reviewed by Yusuke Suzuki.
Updated install paths for changes in the build system that use a system path prefix.
* Configurations/WebGPU.xcconfig:
2021-12-07 Myles C. Maxfield <mmaxfield@apple.com>
[WebGPU] Fix MacCatalyst build
https://bugs.webkit.org/show_bug.cgi?id=233920
Unreviewed.
Taken from JavaScriptCore.xcodeproj.
* Configurations/WebGPU.xcconfig:
2021-12-02 Myles C. Maxfield <mmaxfield@apple.com>
[WebGPU] Hook up navigator.gpu.requestAdapter()
https://bugs.webkit.org/show_bug.cgi?id=233619
Just hook up enough for Instance::requestAdapter() to not fail.
Reviewed by Dean Jackson.
* WebGPU/Adapter.mm:
(WebGPU::Adapter::getLimits):
* WebGPU/Instance.mm:
(WebGPU::Instance::requestAdapter):
(wgpuCreateInstance):
(wgpuInstanceRequestAdapter):
2021-11-29 Myles C. Maxfield <mmaxfield@apple.com>
[WebGPU] Make WebGPU.framework's classes reference counted
https://bugs.webkit.org/show_bug.cgi?id=233547
Reviewed by Dean Jackson.
This is a fairly mechanical change of replacing constructors with calls to create(), and
changing instances to Ref<...>, and using -> instead of .
There's one somewhat interesting design choice here. The header has things like:
typedef struct WGPUAdapterImpl* WGPUAdapter;
But we're using C++ so we want to have something like
namespace WebGPU {
class Adapter : public RefCounted<Adapter> {
...
};
}
So we need to have some way of connecting these two things. This patch opts to do this like so:
struct WGPUAdapterImpl {
Ref<Adapter> adapter;
};
This isn't perfect, because it means that all method calls require a double dereference: one to
dereference the WGPUAdapter to get the WGPUAdapterImpl, and one to dereference the Ref<Adapter>
to get the Adapter. This is the most elegant solution for now, because it doesn't require any
reinterpret_cast<>()'ing. This patch chooses this elegant solution, because premature optimization
is the root of all evil.
* WebGPU/Adapter.h:
(WebGPU::Adapter::create):
* WebGPU/Adapter.mm:
(WebGPU::Adapter::requestDevice):
(wgpuAdapterGetLimits):
(wgpuAdapterGetProperties):
(wgpuAdapterHasFeature):
(wgpuAdapterGetFeatureAtIndex):
(wgpuAdapterRequestDevice):
* WebGPU/BindGroup.h:
(WebGPU::BindGroup::create):
* WebGPU/BindGroup.mm:
(wgpuBindGroupSetLabel):
* WebGPU/BindGroupLayout.h:
(WebGPU::BindGroupLayout::create):
* WebGPU/BindGroupLayout.mm:
(wgpuBindGroupLayoutSetLabel):
* WebGPU/Buffer.h:
(WebGPU::Buffer::create):
* WebGPU/Buffer.mm:
(WebGPU::Buffer::mapAsync):
(wgpuBufferDestroy):
(wgpuBufferGetConstMappedRange):
(wgpuBufferGetMappedRange):
(wgpuBufferMapAsync):
(wgpuBufferUnmap):
(wgpuBufferSetLabel):
* WebGPU/CommandBuffer.h:
(WebGPU::CommandBuffer::create):
* WebGPU/CommandBuffer.mm:
(wgpuCommandBufferSetLabel):
* WebGPU/CommandEncoder.h:
(WebGPU::CommandEncoder::create):
* WebGPU/CommandEncoder.mm:
(WebGPU::CommandEncoder::beginComputePass):
(WebGPU::CommandEncoder::beginRenderPass):
(WebGPU::CommandEncoder::finish):
(wgpuCommandEncoderBeginComputePass):
(wgpuCommandEncoderBeginRenderPass):
(wgpuCommandEncoderCopyBufferToBuffer):
(wgpuCommandEncoderCopyBufferToTexture):
(wgpuCommandEncoderCopyTextureToBuffer):
(wgpuCommandEncoderCopyTextureToTexture):
(wgpuCommandEncoderFillBuffer):
(wgpuCommandEncoderFinish):
(wgpuCommandEncoderInsertDebugMarker):
(wgpuCommandEncoderPopDebugGroup):
(wgpuCommandEncoderPushDebugGroup):
(wgpuCommandEncoderResolveQuerySet):
(wgpuCommandEncoderWriteTimestamp):
(wgpuCommandEncoderSetLabel):
* WebGPU/ComputePassEncoder.h:
(WebGPU::ComputePassEncoder::create):
* WebGPU/ComputePassEncoder.mm:
(wgpuComputePassEncoderBeginPipelineStatisticsQuery):
(wgpuComputePassEncoderDispatch):
(wgpuComputePassEncoderDispatchIndirect):
(wgpuComputePassEncoderEndPass):
(wgpuComputePassEncoderEndPipelineStatisticsQuery):
(wgpuComputePassEncoderInsertDebugMarker):
(wgpuComputePassEncoderPopDebugGroup):
(wgpuComputePassEncoderPushDebugGroup):
(wgpuComputePassEncoderSetBindGroup):
(wgpuComputePassEncoderSetPipeline):
(wgpuComputePassEncoderWriteTimestamp):
(wgpuComputePassEncoderSetLabel):
* WebGPU/ComputePipeline.h:
(WebGPU::ComputePipeline::create):
* WebGPU/ComputePipeline.mm:
(WebGPU::ComputePipeline::getBindGroupLayout):
(wgpuComputePipelineGetBindGroupLayout):
(wgpuComputePipelineSetLabel):
* WebGPU/Device.h:
(WebGPU::Device::create):
* WebGPU/Device.mm:
(WebGPU::Device::createBindGroup):
(WebGPU::Device::createBindGroupLayout):
(WebGPU::Device::createBuffer):
(WebGPU::Device::createCommandEncoder):
(WebGPU::Device::createComputePipeline):
(WebGPU::Device::createComputePipelineAsync):
(WebGPU::Device::createPipelineLayout):
(WebGPU::Device::createQuerySet):
(WebGPU::Device::createRenderBundleEncoder):
(WebGPU::Device::createRenderPipeline):
(WebGPU::Device::createRenderPipelineAsync):
(WebGPU::Device::createSampler):
(WebGPU::Device::createShaderModule):
(WebGPU::Device::createSwapChain):
(WebGPU::Device::createTexture):
(WebGPU::Device::getQueue):
(WebGPU::Device::popErrorScope):
(WebGPU::Device::setDeviceLostCallback):
(WebGPU::Device::setUncapturedErrorCallback):
(wgpuDeviceCreateBindGroup):
(wgpuDeviceCreateBindGroupLayout):
(wgpuDeviceCreateBuffer):
(wgpuDeviceCreateCommandEncoder):
(wgpuDeviceCreateComputePipeline):
(wgpuDeviceCreateComputePipelineAsync):
(wgpuDeviceCreatePipelineLayout):
(wgpuDeviceCreateQuerySet):
(wgpuDeviceCreateRenderBundleEncoder):
(wgpuDeviceCreateRenderPipeline):
(wgpuDeviceCreateRenderPipelineAsync):
(wgpuDeviceCreateSampler):
(wgpuDeviceCreateShaderModule):
(wgpuDeviceCreateSwapChain):
(wgpuDeviceCreateTexture):
(wgpuDeviceDestroy):
(wgpuDeviceGetLimits):
(wgpuDeviceGetQueue):
(wgpuDevicePopErrorScope):
(wgpuDevicePushErrorScope):
(wgpuDeviceSetDeviceLostCallback):
(wgpuDeviceSetUncapturedErrorCallback):
(wgpuDeviceSetLabel):
* WebGPU/Instance.h:
(WebGPU::Instance::create):
* WebGPU/Instance.mm:
(WebGPU::Instance::createSurface):
(WebGPU::Instance::requestAdapter):
(wgpuInstanceCreateSurface):
(wgpuInstanceProcessEvents):
(wgpuInstanceRequestAdapter):
* WebGPU/PipelineLayout.h:
(WebGPU::PipelineLayout::create):
* WebGPU/PipelineLayout.mm:
(wgpuPipelineLayoutSetLabel):
* WebGPU/QuerySet.h:
(WebGPU::QuerySet::create):
* WebGPU/QuerySet.mm:
(wgpuQuerySetDestroy):
(wgpuQuerySetSetLabel):
* WebGPU/Queue.h:
(WebGPU::Queue::create):
* WebGPU/Queue.mm:
(WebGPU::Queue::onSubmittedWorkDone):
(wgpuQueueOnSubmittedWorkDone):
(wgpuQueueSubmit):
(wgpuQueueWriteBuffer):
(wgpuQueueWriteTexture):
(wgpuQueueSetLabel):
* WebGPU/RenderBundle.h:
(WebGPU::RenderBundle::create):
* WebGPU/RenderBundle.mm:
(wgpuRenderBundleSetLabel):
* WebGPU/RenderBundleEncoder.h:
(WebGPU::RenderBundleEncoder::create):
* WebGPU/RenderBundleEncoder.mm:
(WebGPU::RenderBundleEncoder::finish):
(wgpuRenderBundleEncoderDraw):
(wgpuRenderBundleEncoderDrawIndexed):
(wgpuRenderBundleEncoderDrawIndexedIndirect):
(wgpuRenderBundleEncoderDrawIndirect):
(wgpuRenderBundleEncoderFinish):
(wgpuRenderBundleEncoderInsertDebugMarker):
(wgpuRenderBundleEncoderPopDebugGroup):
(wgpuRenderBundleEncoderPushDebugGroup):
(wgpuRenderBundleEncoderSetBindGroup):
(wgpuRenderBundleEncoderSetIndexBuffer):
(wgpuRenderBundleEncoderSetPipeline):
(wgpuRenderBundleEncoderSetVertexBuffer):
(wgpuRenderBundleEncoderSetLabel):
* WebGPU/RenderPassEncoder.h:
(WebGPU::RenderPassEncoder::create):
* WebGPU/RenderPassEncoder.mm:
(wgpuRenderPassEncoderBeginOcclusionQuery):
(wgpuRenderPassEncoderBeginPipelineStatisticsQuery):
(wgpuRenderPassEncoderDraw):
(wgpuRenderPassEncoderDrawIndexed):
(wgpuRenderPassEncoderDrawIndexedIndirect):
(wgpuRenderPassEncoderDrawIndirect):
(wgpuRenderPassEncoderEndOcclusionQuery):
(wgpuRenderPassEncoderEndPass):
(wgpuRenderPassEncoderEndPipelineStatisticsQuery):
(wgpuRenderPassEncoderExecuteBundles):
(wgpuRenderPassEncoderInsertDebugMarker):
(wgpuRenderPassEncoderPopDebugGroup):
(wgpuRenderPassEncoderPushDebugGroup):
(wgpuRenderPassEncoderSetBindGroup):
(wgpuRenderPassEncoderSetBlendConstant):
(wgpuRenderPassEncoderSetIndexBuffer):
(wgpuRenderPassEncoderSetPipeline):
(wgpuRenderPassEncoderSetScissorRect):
(wgpuRenderPassEncoderSetStencilReference):
(wgpuRenderPassEncoderSetVertexBuffer):
(wgpuRenderPassEncoderSetViewport):
(wgpuRenderPassEncoderWriteTimestamp):
(wgpuRenderPassEncoderSetLabel):
* WebGPU/RenderPipeline.h:
(WebGPU::RenderPipeline::create):
* WebGPU/RenderPipeline.mm:
(WebGPU::RenderPipeline::getBindGroupLayout):
(wgpuRenderPipelineGetBindGroupLayout):
(wgpuRenderPipelineSetLabel):
* WebGPU/Sampler.h:
(WebGPU::Sampler::create):
* WebGPU/Sampler.mm:
(wgpuSamplerSetLabel):
* WebGPU/ShaderModule.h:
(WebGPU::ShaderModule::create):
* WebGPU/ShaderModule.mm:
(wgpuShaderModuleSetLabel):
* WebGPU/Surface.h:
(WebGPU::Surface::create):
* WebGPU/Surface.mm:
(wgpuSurfaceGetPreferredFormat):
* WebGPU/SwapChain.h:
(WebGPU::SwapChain::create):
* WebGPU/SwapChain.mm:
(WebGPU::SwapChain::getCurrentTextureView):
(wgpuSwapChainGetCurrentTextureView):
(wgpuSwapChainPresent):
* WebGPU/Texture.h:
(WebGPU::Texture::create):
* WebGPU/Texture.mm:
(WebGPU::Texture::createView):
(wgpuTextureCreateView):
(wgpuTextureDestroy):
(wgpuTextureSetLabel):
* WebGPU/TextureView.h:
(WebGPU::TextureView::create):
* WebGPU/TextureView.mm:
(wgpuTextureViewSetLabel):
2021-11-16 Myles C. Maxfield <mmaxfield@apple.com>
[WebGPU] Add WGSLUnitTests XCTest target for WebGPU
https://bugs.webkit.org/show_bug.cgi?id=233227
Reviewed by Robin Morisset.
For now, this new target isn't hooked up to any automated testing - it's just a local target which developers can run.
* Configurations/WGSLUnitTests.xcconfig: Added.
* WGSLUnitTests/WGSLUnitTests.mm: Added.
(-[WGSLUnitTests testExample]):
* WebGPU.xcodeproj/project.pbxproj:
* WebGPU.xcodeproj/xcshareddata/xcschemes/WGSL.xcscheme:
* WebGPU.xcodeproj/xcshareddata/xcschemes/WGSLUnitTests.xcscheme: Copied from Source/WebGPU/WebGPU.xcodeproj/xcshareddata/xcschemes/WGSL.xcscheme.
2021-11-14 Myles C. Maxfield <mmaxfield@apple.com>
[WebGPU] Add necessary additions to WebGPU.framework
https://bugs.webkit.org/show_bug.cgi?id=233091
Reviewed by Dean Jackson.
WebGPU.framework's header file is lagging a bit behind the official WebGPU API.
This updates a companion header, WebGPUExt.h, with the necessary additions.
I don't want to modify the primary header, WebGPU.h, because it's shared among
multiple projects, so coordination is necessary to modify it.
* WebGPU/Adapter.h:
* WebGPU/Adapter.mm:
(WebGPU::Adapter::getFeatureAtIndex):
(wgpuAdapterGetFeatureAtIndex):
* WebGPU/BindGroup.h:
* WebGPU/BindGroup.mm:
(WebGPU::BindGroup::setLabel):
(wgpuBindGroupSetLabel):
* WebGPU/BindGroupLayout.h:
* WebGPU/BindGroupLayout.mm:
(WebGPU::BindGroupLayout::setLabel):
(wgpuBindGroupLayoutSetLabel):
* WebGPU/Buffer.h:
* WebGPU/Buffer.mm:
(WebGPU::Buffer::setLabel):
(wgpuBufferSetLabel):
* WebGPU/CommandBuffer.h:
* WebGPU/CommandBuffer.mm:
(WebGPU::CommandBuffer::setLabel):
(wgpuCommandBufferSetLabel):
* WebGPU/CommandEncoder.h:
* WebGPU/CommandEncoder.mm:
(WebGPU::CommandEncoder::fillBuffer):
(WebGPU::CommandEncoder::setLabel):
(wgpuCommandEncoderFillBuffer):
(wgpuCommandEncoderSetLabel):
* WebGPU/ComputePassEncoder.h:
* WebGPU/ComputePassEncoder.mm:
(WebGPU::ComputePassEncoder::setLabel):
(wgpuComputePassEncoderSetLabel):
* WebGPU/Device.h:
* WebGPU/Device.mm:
(WebGPU::Device::setLabel):
(wgpuDeviceSetLabel):
* WebGPU/Instance.mm:
(wgpuGetProcAddress):
* WebGPU/PipelineLayout.h:
* WebGPU/PipelineLayout.mm:
(WebGPU::PipelineLayout::setLabel):
(wgpuPipelineLayoutSetLabel):
* WebGPU/QuerySet.h:
* WebGPU/QuerySet.mm:
(WebGPU::QuerySet::setLabel):
(wgpuQuerySetSetLabel):
* WebGPU/Queue.h:
* WebGPU/Queue.mm:
(WebGPU::Queue::setLabel):
(wgpuQueueSetLabel):
* WebGPU/RenderBundle.h:
* WebGPU/RenderBundle.mm:
(WebGPU::RenderBundle::setLabel):
(wgpuRenderBundleSetLabel):
* WebGPU/RenderBundleEncoder.h:
* WebGPU/RenderBundleEncoder.mm:
(WebGPU::RenderBundleEncoder::setLabel):
(wgpuRenderBundleEncoderSetLabel):
* WebGPU/RenderPassEncoder.h:
* WebGPU/RenderPassEncoder.mm:
(WebGPU::RenderPassEncoder::setLabel):
(wgpuRenderPassEncoderSetLabel):
* WebGPU/Sampler.h:
* WebGPU/Sampler.mm:
(WebGPU::Sampler::setLabel):
(wgpuSamplerSetLabel):
* WebGPU/Texture.h:
* WebGPU/Texture.mm:
(WebGPU::Texture::setLabel):
(wgpuTextureSetLabel):
* WebGPU/TextureView.h:
* WebGPU/TextureView.mm:
(WebGPU::TextureView::setLabel):
(wgpuTextureViewSetLabel):
* WebGPU/WebGPUExt.h:
2021-11-09 Myles C. Maxfield <mmaxfield@apple.com>
[WebGPU] Stub out methods in WebGPU.framework
https://bugs.webkit.org/show_bug.cgi?id=232872
Reviewed by Dean Jackson.
This creates empty implementations for all the methods in WebGPU.framework.
This means that there are now implementations for every API call, so PAL
can successfully call into WebGPU.framework and link with it.
* Configurations/Version.xcconfig: Added.
* Configurations/WebGPU.xcconfig:
* WebGPU.xcodeproj/project.pbxproj:
* WebGPU/Adapter.h: Copied from Source/WebGPU/WebGPU/ShaderModule.h.
* WebGPU/Adapter.mm: Added.
(WebGPU::Adapter::getLimits):
(WebGPU::Adapter::getProperties):
(WebGPU::Adapter::hasFeature):
(WebGPU::Adapter::requestDevice):
(wgpuAdapterRelease):
(wgpuAdapterGetLimits):
(wgpuAdapterGetProperties):
(wgpuAdapterHasFeature):
(wgpuAdapterRequestDevice):
* WebGPU/BindGroup.h: Copied from Source/WebGPU/WebGPU/ShaderModule.h.
* WebGPU/BindGroup.mm: Copied from Source/WebGPU/WebGPU/WebGPUObjC.mm.
(wgpuBindGroupRelease):
* WebGPU/BindGroupLayout.h: Copied from Source/WebGPU/WebGPU/ShaderModule.h.
* WebGPU/BindGroupLayout.mm: Renamed from Source/WebGPU/WebGPU/WebGPU.cpp.
(wgpuBindGroupLayoutRelease):
* WebGPU/Buffer.h: Copied from Source/WebGPU/WebGPU/ShaderModule.h.
* WebGPU/Buffer.mm: Added.
(WebGPU::Buffer::destroy):
(WebGPU::Buffer::getConstMappedRange):
(WebGPU::Buffer::getMappedRange):
(WebGPU::Buffer::mapAsync):
(WebGPU::Buffer::unmap):
(wgpuBufferRelease):
(wgpuBufferDestroy):
(wgpuBufferGetConstMappedRange):
(wgpuBufferGetMappedRange):
(wgpuBufferMapAsync):
(wgpuBufferUnmap):
* WebGPU/CommandBuffer.h: Copied from Source/WebGPU/WebGPU/ShaderModule.h.
* WebGPU/CommandBuffer.mm: Copied from Source/WebGPU/WebGPU/WebGPUObjC.mm.
(wgpuCommandBufferRelease):
* WebGPU/CommandEncoder.h: Added.
* WebGPU/CommandEncoder.mm: Added.
(WebGPU::CommandEncoder::beginComputePass):
(WebGPU::CommandEncoder::beginRenderPass):
(WebGPU::CommandEncoder::copyBufferToBuffer):
(WebGPU::CommandEncoder::copyBufferToTexture):
(WebGPU::CommandEncoder::copyTextureToBuffer):
(WebGPU::CommandEncoder::copyTextureToTexture):
(WebGPU::CommandEncoder::finish):
(WebGPU::CommandEncoder::insertDebugMarker):
(WebGPU::CommandEncoder::popDebugGroup):
(WebGPU::CommandEncoder::pushDebugGroup):
(WebGPU::CommandEncoder::resolveQuerySet):
(WebGPU::CommandEncoder::writeTimestamp):
(wgpuCommandEncoderRelease):
(wgpuCommandEncoderBeginComputePass):
(wgpuCommandEncoderBeginRenderPass):
(wgpuCommandEncoderCopyBufferToBuffer):
(wgpuCommandEncoderCopyBufferToTexture):
(wgpuCommandEncoderCopyTextureToBuffer):
(wgpuCommandEncoderCopyTextureToTexture):
(wgpuCommandEncoderFinish):
(wgpuCommandEncoderInsertDebugMarker):
(wgpuCommandEncoderPopDebugGroup):
(wgpuCommandEncoderPushDebugGroup):
(wgpuCommandEncoderResolveQuerySet):
(wgpuCommandEncoderWriteTimestamp):
* WebGPU/ComputePassEncoder.h: Copied from Source/WebGPU/WebGPU/ShaderModule.h.
* WebGPU/ComputePassEncoder.mm: Added.
(WebGPU::ComputePassEncoder::beginPipelineStatisticsQuery):
(WebGPU::ComputePassEncoder::dispatch):
(WebGPU::ComputePassEncoder::dispatchIndirect):
(WebGPU::ComputePassEncoder::endPass):
(WebGPU::ComputePassEncoder::endPipelineStatisticsQuery):
(WebGPU::ComputePassEncoder::insertDebugMarker):
(WebGPU::ComputePassEncoder::popDebugGroup):
(WebGPU::ComputePassEncoder::pushDebugGroup):
(WebGPU::ComputePassEncoder::setBindGroup):
(WebGPU::ComputePassEncoder::setPipeline):
(WebGPU::ComputePassEncoder::writeTimestamp):
(wgpuComputePassEncoderRelease):
(wgpuComputePassEncoderBeginPipelineStatisticsQuery):
(wgpuComputePassEncoderDispatch):
(wgpuComputePassEncoderDispatchIndirect):
(wgpuComputePassEncoderEndPass):
(wgpuComputePassEncoderEndPipelineStatisticsQuery):
(wgpuComputePassEncoderInsertDebugMarker):
(wgpuComputePassEncoderPopDebugGroup):
(wgpuComputePassEncoderPushDebugGroup):
(wgpuComputePassEncoderSetBindGroup):
(wgpuComputePassEncoderSetPipeline):
(wgpuComputePassEncoderWriteTimestamp):
* WebGPU/ComputePipeline.h: Copied from Source/WebGPU/WebGPU/ShaderModule.h.
* WebGPU/ComputePipeline.mm: Copied from Source/WebGPU/WebGPU/WebGPUObjC.mm.
(WebGPU::ComputePipeline::getBindGroupLayout):
(WebGPU::ComputePipeline::setLabel):
(wgpuComputePipelineRelease):
(wgpuComputePipelineGetBindGroupLayout):
(wgpuComputePipelineSetLabel):
* WebGPU/Device.h: Added.
* WebGPU/Device.mm: Added.
(WebGPU::Device::createBindGroup):
(WebGPU::Device::createBindGroupLayout):
(WebGPU::Device::createBuffer):
(WebGPU::Device::createCommandEncoder):
(WebGPU::Device::createComputePipeline):
(WebGPU::Device::createComputePipelineAsync):
(WebGPU::Device::createPipelineLayout):
(WebGPU::Device::createQuerySet):
(WebGPU::Device::createRenderBundleEncoder):
(WebGPU::Device::createRenderPipeline):
(WebGPU::Device::createRenderPipelineAsync):
(WebGPU::Device::createSampler):
(WebGPU::Device::createShaderModule):
(WebGPU::Device::createSwapChain):
(WebGPU::Device::createTexture):
(WebGPU::Device::destroy):
(WebGPU::Device::getLimits):
(WebGPU::Device::getQueue):
(WebGPU::Device::popErrorScope):
(WebGPU::Device::pushErrorScope):
(WebGPU::Device::setDeviceLostCallback):
(WebGPU::Device::setUncapturedErrorCallback):
(wgpuDeviceRelease):
(wgpuDeviceCreateBindGroup):
(wgpuDeviceCreateBindGroupLayout):
(wgpuDeviceCreateBuffer):
(wgpuDeviceCreateCommandEncoder):
(wgpuDeviceCreateComputePipeline):
(wgpuDeviceCreateComputePipelineAsync):
(wgpuDeviceCreatePipelineLayout):
(wgpuDeviceCreateQuerySet):
(wgpuDeviceCreateRenderBundleEncoder):
(wgpuDeviceCreateRenderPipeline):
(wgpuDeviceCreateRenderPipelineAsync):
(wgpuDeviceCreateSampler):
(wgpuDeviceCreateShaderModule):
(wgpuDeviceCreateSwapChain):
(wgpuDeviceCreateTexture):
(wgpuDeviceDestroy):
(wgpuDeviceGetLimits):
(wgpuDeviceGetQueue):
(wgpuDevicePopErrorScope):
(wgpuDevicePushErrorScope):
(wgpuDeviceSetDeviceLostCallback):
(wgpuDeviceSetUncapturedErrorCallback):
* WebGPU/ExportMacros.h:
* WebGPU/Instance.h: Copied from Source/WebGPU/WebGPU/ShaderModule.h.
* WebGPU/Instance.mm: Added.
(WebGPU::Instance::createSurface):
(WebGPU::Instance::processEvents):
(WebGPU::Instance::requestAdapter):
(wgpuInstanceRelease):
(wgpuCreateInstance):
(wgpuGetProcAddress):
(wgpuInstanceCreateSurface):
(wgpuInstanceProcessEvents):
(wgpuInstanceRequestAdapter):
* WebGPU/PipelineLayout.h: Copied from Source/WebGPU/WebGPU/ShaderModule.h.
* WebGPU/PipelineLayout.mm: Copied from Source/WebGPU/WebGPU/WebGPUObjC.mm.
(wgpuPipelineLayoutRelease):
* WebGPU/QuerySet.h: Copied from Source/WebGPU/WebGPU/ShaderModule.h.
* WebGPU/QuerySet.mm: Copied from Source/WebGPU/WebGPU/WebGPUObjC.mm.
(WebGPU::QuerySet::destroy):
(wgpuQuerySetRelease):
(wgpuQuerySetDestroy):
* WebGPU/Queue.h: Copied from Source/WebGPU/WebGPU/ShaderModule.h.
* WebGPU/Queue.mm: Added.
(WebGPU::Queue::onSubmittedWorkDone):
(WebGPU::Queue::submit):
(WebGPU::Queue::writeBuffer):
(WebGPU::Queue::writeTexture):
(wgpuQueueRelease):
(wgpuQueueOnSubmittedWorkDone):
(wgpuQueueSubmit):
(wgpuQueueWriteBuffer):
(wgpuQueueWriteTexture):
* WebGPU/RenderBundle.h: Copied from Source/WebGPU/WebGPU/ShaderModule.h.
* WebGPU/RenderBundle.mm: Copied from Source/WebGPU/WebGPU/WebGPUObjC.mm.
(wgpuRenderBundleRelease):
* WebGPU/RenderBundleEncoder.h: Copied from Source/WebGPU/WebGPU/ShaderModule.h.
* WebGPU/RenderBundleEncoder.mm: Added.
(WebGPU::RenderBundleEncoder::draw):
(WebGPU::RenderBundleEncoder::drawIndexed):
(WebGPU::RenderBundleEncoder::drawIndexedIndirect):
(WebGPU::RenderBundleEncoder::drawIndirect):
(WebGPU::RenderBundleEncoder::finish):
(WebGPU::RenderBundleEncoder::insertDebugMarker):
(WebGPU::RenderBundleEncoder::popDebugGroup):
(WebGPU::RenderBundleEncoder::pushDebugGroup):
(WebGPU::RenderBundleEncoder::setBindGroup):
(WebGPU::RenderBundleEncoder::setIndexBuffer):
(WebGPU::RenderBundleEncoder::setPipeline):
(WebGPU::RenderBundleEncoder::setVertexBuffer):
(wgpuRenderBundleEncoderRelease):
(wgpuRenderBundleEncoderDraw):
(wgpuRenderBundleEncoderDrawIndexed):
(wgpuRenderBundleEncoderDrawIndexedIndirect):
(wgpuRenderBundleEncoderDrawIndirect):
(wgpuRenderBundleEncoderFinish):
(wgpuRenderBundleEncoderInsertDebugMarker):
(wgpuRenderBundleEncoderPopDebugGroup):
(wgpuRenderBundleEncoderPushDebugGroup):
(wgpuRenderBundleEncoderSetBindGroup):
(wgpuRenderBundleEncoderSetIndexBuffer):
(wgpuRenderBundleEncoderSetPipeline):
(wgpuRenderBundleEncoderSetVertexBuffer):
* WebGPU/RenderPassEncoder.h: Added.
* WebGPU/RenderPassEncoder.mm: Added.
(WebGPU::RenderPassEncoder::beginOcclusionQuery):
(WebGPU::RenderPassEncoder::beginPipelineStatisticsQuery):
(WebGPU::RenderPassEncoder::draw):
(WebGPU::RenderPassEncoder::drawIndexed):
(WebGPU::RenderPassEncoder::drawIndexedIndirect):
(WebGPU::RenderPassEncoder::drawIndirect):
(WebGPU::RenderPassEncoder::endOcclusionQuery):
(WebGPU::RenderPassEncoder::endPass):
(WebGPU::RenderPassEncoder::endPipelineStatisticsQuery):
(WebGPU::RenderPassEncoder::executeBundles):
(WebGPU::RenderPassEncoder::insertDebugMarker):
(WebGPU::RenderPassEncoder::popDebugGroup):
(WebGPU::RenderPassEncoder::pushDebugGroup):
(WebGPU::RenderPassEncoder::setBindGroup):
(WebGPU::RenderPassEncoder::setBlendConstant):
(WebGPU::RenderPassEncoder::setIndexBuffer):
(WebGPU::RenderPassEncoder::setPipeline):
(WebGPU::RenderPassEncoder::setScissorRect):
(WebGPU::RenderPassEncoder::setStencilReference):
(WebGPU::RenderPassEncoder::setVertexBuffer):
(WebGPU::RenderPassEncoder::setViewport):
(WebGPU::RenderPassEncoder::writeTimestamp):
(wgpuRenderPassEncoderRelease):
(wgpuRenderPassEncoderBeginOcclusionQuery):
(wgpuRenderPassEncoderBeginPipelineStatisticsQuery):
(wgpuRenderPassEncoderDraw):
(wgpuRenderPassEncoderDrawIndexed):
(wgpuRenderPassEncoderDrawIndexedIndirect):
(wgpuRenderPassEncoderDrawIndirect):
(wgpuRenderPassEncoderEndOcclusionQuery):
(wgpuRenderPassEncoderEndPass):
(wgpuRenderPassEncoderEndPipelineStatisticsQuery):
(wgpuRenderPassEncoderExecuteBundles):
(wgpuRenderPassEncoderInsertDebugMarker):
(wgpuRenderPassEncoderPopDebugGroup):
(wgpuRenderPassEncoderPushDebugGroup):
(wgpuRenderPassEncoderSetBindGroup):
(wgpuRenderPassEncoderSetBlendConstant):
(wgpuRenderPassEncoderSetIndexBuffer):
(wgpuRenderPassEncoderSetPipeline):
(wgpuRenderPassEncoderSetScissorRect):
(wgpuRenderPassEncoderSetStencilReference):
(wgpuRenderPassEncoderSetVertexBuffer):
(wgpuRenderPassEncoderSetViewport):
(wgpuRenderPassEncoderWriteTimestamp):
* WebGPU/RenderPipeline.h: Copied from Source/WebGPU/WebGPU/ShaderModule.h.
* WebGPU/RenderPipeline.mm: Copied from Source/WebGPU/WebGPU/WebGPUObjC.mm.
(WebGPU::RenderPipeline::getBindGroupLayout):
(WebGPU::RenderPipeline::setLabel):
(wgpuRenderPipelineRelease):
(wgpuRenderPipelineGetBindGroupLayout):
(wgpuRenderPipelineSetLabel):
* WebGPU/Sampler.h: Renamed from Source/WebGPU/WebGPU/WebGPUObjC.h.
* WebGPU/Sampler.mm: Copied from Source/WebGPU/WebGPU/WebGPUObjC.mm.
(wgpuSamplerRelease):
* WebGPU/ShaderModule.h:
* WebGPU/ShaderModule.mm: Copied from Source/WebGPU/WebGPU/WebGPUObjC.mm.
(WebGPU::ShaderModule::setLabel):
(wgpuShaderModuleRelease):
(wgpuShaderModuleSetLabel):
* WebGPU/Surface.h: Copied from Source/WebGPU/WebGPU/ShaderModule.h.
* WebGPU/Surface.mm: Copied from Source/WebGPU/WebGPU/WebGPUObjC.mm.
(WebGPU::Surface::getPreferredFormat):
(wgpuSurfaceRelease):
(wgpuSurfaceGetPreferredFormat):
* WebGPU/SwapChain.h: Copied from Source/WebGPU/WebGPU/ShaderModule.h.
* WebGPU/SwapChain.mm: Copied from Source/WebGPU/WebGPU/WebGPUObjC.mm.
(WebGPU::SwapChain::getCurrentTextureView):
(WebGPU::SwapChain::present):
(wgpuSwapChainRelease):
(wgpuSwapChainGetCurrentTextureView):
(wgpuSwapChainPresent):
* WebGPU/Texture.h: Copied from Source/WebGPU/WebGPU/ShaderModule.h.
* WebGPU/Texture.mm: Copied from Source/WebGPU/WebGPU/WebGPUObjC.mm.
(WebGPU::Texture::createView):
(WebGPU::Texture::destroy):
(wgpuTextureRelease):
(wgpuTextureCreateView):
(wgpuTextureDestroy):
* WebGPU/TextureView.h: Copied from Source/WebGPU/WebGPU/ShaderModule.h.
* WebGPU/TextureView.mm: Renamed from Source/WebGPU/WebGPU/WebGPUObjC.mm.
(wgpuTextureViewRelease):
* WebGPU/WebGPU.modulemap: Added.
* WebGPU/WebGPUExt.h: Added.
2021-10-19 Myles C. Maxfield <mmaxfield@apple.com>
Make WebGPU.xcodeproj and WebGPU.framework
https://bugs.webkit.org/show_bug.cgi?id=231661
Reviewed by Dean Jackson and Robin Morisset.
We've gotten some requests to be able to use WebGPU from native code,
without requiring all of WebKit. This patch creates a new Xcode project
that creates a new framework for WebGPU, so these internal users can
build it / include it in their own projects.
This project has two targets: One for WGSL and one for WebGPU. WGSL
creates a static library, and WebGPU links with it, and produces a
framework. This patch implements one dummy function from each of them.
* Configurations/Base.xcconfig: Added.
* Configurations/DebugRelease.xcconfig: Added.
* Configurations/SDKVariant.xcconfig: Added.
* Configurations/WGSL.xcconfig: Added.
* Configurations/WebGPU.xcconfig: Added.
* Info.plist: Added.
* Makefile: Added.
* WGSL/AST.h: Added.
* WGSL/WGSL.cpp: Added.
(WGSL::check):
(WGSL::SuccessfulCheck::~SuccessfulCheck):
* WGSL/WGSL.h: Added.
* WGSL/config.h: Added.
* WebGPU.xcodeproj/project.pbxproj: Added.
* WebGPU.xcodeproj/xcshareddata/xcschemes/WGSL.xcscheme: Added.
* WebGPU.xcodeproj/xcshareddata/xcschemes/WebGPU.xcscheme: Added.
* WebGPU/ExportMacros.h: Added.
* WebGPU/ShaderModule.h: Added.
* WebGPU/WebGPU.cpp: Added.
(wgpuDeviceCreateShaderModule):
* WebGPU/WebGPU.h: Added.
* WebGPU/WebGPUObjC.h: Added.
* WebGPU/WebGPUObjC.mm: Added.
(objcFunction):
* WebGPU/config.h: Added.