@@ -530,7 +530,6 @@ struct Context {
530
530
// Default constructor
531
531
Context () = default ;
532
532
533
- // Move constructor: steals GPU handles so the source destructor won't free them.
534
533
Context (Context&& other) noexcept
535
534
: instance(other.instance),
536
535
adapter (other.adapter),
@@ -542,6 +541,7 @@ struct Context {
542
541
adapterStatus(other.adapterStatus),
543
542
deviceStatus(other.deviceStatus)
544
543
{
544
+ LOG (kDefLog , kTrace , " Moving Context ownership" );
545
545
// Move over the resources in the pools:
546
546
pool.data = std::move (other.pool .data );
547
547
kernelPool.data = std::move (other.kernelPool .data );
@@ -555,7 +555,6 @@ struct Context {
555
555
// other.deviceStatus = 0;
556
556
}
557
557
558
- // Optional move‐assignment operator, similarly stealing resources:
559
558
Context& operator =(Context&& other) noexcept {
560
559
if (this != &other) {
561
560
// Free any existing resources. In most cases, this should be a no-op
@@ -573,26 +572,26 @@ struct Context {
573
572
if (queue) {
574
573
wgpuQueueRelease (queue);
575
574
} else {
576
- LOG (kDefLog , kWarn , " Queue is null" );
575
+ LOG (kDefLog , kTrace , " Queue is null" );
577
576
}
578
577
if (device) {
579
578
wgpuDeviceRelease (device);
580
579
processEvents (instance);
581
580
} else {
582
- LOG (kDefLog , kWarn , " Device is null" );
581
+ LOG (kDefLog , kTrace , " Device is null" );
583
582
}
584
583
if (adapter) {
585
584
wgpuAdapterRelease (adapter);
586
585
processEvents (instance);
587
586
} else {
588
- LOG (kDefLog , kWarn , " Adapter is null" );
587
+ LOG (kDefLog , kTrace , " Adapter is null" );
589
588
}
590
589
if (instance) {
591
590
wgpuInstanceRelease (instance);
592
591
} else {
593
- LOG (kDefLog , kWarn , " Instance is null" );
592
+ LOG (kDefLog , kTrace , " Instance is null" );
594
593
}
595
- LOG (kDefLog , kInfo , " Context destroyed" );
594
+ LOG (kDefLog , kTrace , " Context destroyed" );
596
595
}
597
596
};
598
597
@@ -827,7 +826,7 @@ inline Context createContext(
827
826
#endif
828
827
check (ctx.instance , " Initialize WebGPU" , __FILE__, __LINE__);
829
828
830
- LOG (kDefLog , kInfo , " Requesting adapter" );
829
+ LOG (kDefLog , kTrace , " Requesting adapter" );
831
830
{
832
831
struct AdapterData {
833
832
WGPUAdapter adapter = nullptr ;
@@ -869,7 +868,7 @@ inline Context createContext(
869
868
ctx.adapterStatus = adapterData.status ;
870
869
}
871
870
872
- LOG (kDefLog , kInfo , " Requesting device" );
871
+ LOG (kDefLog , kTrace , " Requesting device" );
873
872
{
874
873
struct DeviceData {
875
874
WGPUDevice device = nullptr ;
@@ -900,11 +899,11 @@ inline Context createContext(
900
899
};
901
900
wgpuAdapterRequestDevice (ctx.adapter , &devDescriptor, deviceCallbackInfo);
902
901
903
- LOG (kDefLog , kInfo , " Waiting for device request to end" );
902
+ LOG (kDefLog , kTrace , " Waiting for device request to end" );
904
903
while (!devData.requestEnded ) {
905
904
processEvents (ctx.instance );
906
905
}
907
- LOG (kDefLog , kInfo , " Device request ended" );
906
+ LOG (kDefLog , kTrace , " Device request ended" );
908
907
909
908
ctx.device = devData.device ;
910
909
ctx.deviceStatus = devData.status ;
0 commit comments