@@ -97,7 +97,7 @@ class CommandRecorder
97
97
98
98
Result CommandRecorder::record (CommandBufferImpl* commandBuffer)
99
99
{
100
- auto existingError = m_device->getAndClearLastError ();
100
+ auto existingError = m_device->getAndClearLastUncapturedError ();
101
101
if (existingError != WGPUErrorType_NoError)
102
102
m_device->warning (" Web GPU device had reported error before command record." );
103
103
@@ -138,7 +138,7 @@ Result CommandRecorder::record(CommandBufferImpl* commandBuffer)
138
138
return SLANG_FAIL;
139
139
}
140
140
141
- auto lastError = m_device->getAndClearLastError ();
141
+ auto lastError = m_device->getAndClearLastUncapturedError ();
142
142
if (lastError != WGPUErrorType_NoError)
143
143
{
144
144
return SLANG_FAIL;
@@ -237,13 +237,13 @@ void CommandRecorder::cmdCopyTexture(const commands::CopyTexture& cmd)
237
237
uint32_t srcZ = cmd.srcOffset .z + cmd.srcSubresource .layer + layer;
238
238
uint32_t dstZ = cmd.dstOffset .z + cmd.dstSubresource .layer + layer;
239
239
240
- WGPUImageCopyTexture source = {};
240
+ WGPUTexelCopyTextureInfo source = {};
241
241
source.texture = src->m_texture ;
242
242
source.origin = {cmd.srcOffset .x , cmd.srcOffset .y , srcZ};
243
243
source.mipLevel = srcMip;
244
244
source.aspect = WGPUTextureAspect_All;
245
245
246
- WGPUImageCopyTexture destination = {};
246
+ WGPUTexelCopyTextureInfo destination = {};
247
247
destination.texture = dst->m_texture ;
248
248
destination.origin = {cmd.dstOffset .x , cmd.dstOffset .y , dstZ};
249
249
destination.mipLevel = dstMip;
@@ -307,13 +307,13 @@ void CommandRecorder::cmdCopyTextureToBuffer(const commands::CopyTextureToBuffer
307
307
SLANG_RHI_ASSERT (srcLayer == 0 || srcOffset.z == 0 );
308
308
uint32_t z = srcOffset.z + srcLayer;
309
309
310
- WGPUImageCopyTexture source = {};
310
+ WGPUTexelCopyTextureInfo source = {};
311
311
source.texture = src->m_texture ;
312
312
source.origin = {srcOffset.x , srcOffset.y , z};
313
313
source.mipLevel = srcMip;
314
314
source.aspect = WGPUTextureAspect_All;
315
315
316
- WGPUImageCopyBuffer destination = {};
316
+ WGPUTexelCopyBufferInfo destination = {};
317
317
destination.buffer = dst->m_buffer ;
318
318
destination.layout .offset = dstOffset;
319
319
destination.layout .bytesPerRow = dstRowPitch;
@@ -365,7 +365,7 @@ void CommandRecorder::cmdUploadTextureData(const commands::UploadTextureData& cm
365
365
{
366
366
uint32_t mip = subresourceRange.mip + mipOffset;
367
367
368
- WGPUImageCopyBuffer srcRegion;
368
+ WGPUTexelCopyBufferInfo srcRegion;
369
369
srcRegion.buffer = buffer->m_buffer ;
370
370
srcRegion.layout .bytesPerRow = srLayout->rowPitch ;
371
371
srcRegion.layout .rowsPerImage = srLayout->rowCount ;
@@ -376,7 +376,7 @@ void CommandRecorder::cmdUploadTextureData(const commands::UploadTextureData& cm
376
376
SLANG_RHI_ASSERT (layer == 0 || cmd.offset .z == 0 );
377
377
uint32_t z = cmd.offset .z + layer;
378
378
379
- WGPUImageCopyTexture dstRegion;
379
+ WGPUTexelCopyTextureInfo dstRegion;
380
380
dstRegion.aspect = WGPUTextureAspect_All;
381
381
dstRegion.mipLevel = mip;
382
382
dstRegion.origin = {(uint32_t )cmd.offset .x , (uint32_t )cmd.offset .y , z};
@@ -784,11 +784,11 @@ void CommandRecorder::cmdSetTextureState(const commands::SetTextureState& cmd)
784
784
void CommandRecorder::cmdPushDebugGroup (const commands::PushDebugGroup& cmd)
785
785
{
786
786
if (m_renderPassEncoder)
787
- m_ctx.api .wgpuRenderPassEncoderPushDebugGroup (m_renderPassEncoder, cmd.name );
787
+ m_ctx.api .wgpuRenderPassEncoderPushDebugGroup (m_renderPassEncoder, translateString ( cmd.name ) );
788
788
else if (m_computePassEncoder)
789
- m_ctx.api .wgpuComputePassEncoderPushDebugGroup (m_computePassEncoder, cmd.name );
789
+ m_ctx.api .wgpuComputePassEncoderPushDebugGroup (m_computePassEncoder, translateString ( cmd.name ) );
790
790
else
791
- m_ctx.api .wgpuCommandEncoderPushDebugGroup (m_commandEncoder, cmd.name );
791
+ m_ctx.api .wgpuCommandEncoderPushDebugGroup (m_commandEncoder, translateString ( cmd.name ) );
792
792
}
793
793
794
794
void CommandRecorder::cmdPopDebugGroup (const commands::PopDebugGroup& cmd)
@@ -804,11 +804,11 @@ void CommandRecorder::cmdPopDebugGroup(const commands::PopDebugGroup& cmd)
804
804
void CommandRecorder::cmdInsertDebugMarker (const commands::InsertDebugMarker& cmd)
805
805
{
806
806
if (m_renderPassEncoder)
807
- m_ctx.api .wgpuRenderPassEncoderInsertDebugMarker (m_renderPassEncoder, cmd.name );
807
+ m_ctx.api .wgpuRenderPassEncoderInsertDebugMarker (m_renderPassEncoder, translateString ( cmd.name ) );
808
808
else if (m_computePassEncoder)
809
- m_ctx.api .wgpuComputePassEncoderInsertDebugMarker (m_computePassEncoder, cmd.name );
809
+ m_ctx.api .wgpuComputePassEncoderInsertDebugMarker (m_computePassEncoder, translateString ( cmd.name ) );
810
810
else
811
- m_ctx.api .wgpuCommandEncoderInsertDebugMarker (m_commandEncoder, cmd.name );
811
+ m_ctx.api .wgpuCommandEncoderInsertDebugMarker (m_commandEncoder, translateString ( cmd.name ) );
812
812
}
813
813
814
814
void CommandRecorder::cmdWriteTimestamp (const commands::WriteTimestamp& cmd)
@@ -911,13 +911,13 @@ Result CommandQueueImpl::waitOnHost()
911
911
912
912
// Wait for the command buffer to finish executing
913
913
{
914
- WGPUQueueWorkDoneStatus status = WGPUQueueWorkDoneStatus_Unknown ;
915
- WGPUQueueWorkDoneCallbackInfo2 callbackInfo = {};
914
+ WGPUQueueWorkDoneStatus status = WGPUQueueWorkDoneStatus ( 0 ) ;
915
+ WGPUQueueWorkDoneCallbackInfo callbackInfo = {};
916
916
callbackInfo.mode = WGPUCallbackMode_WaitAnyOnly;
917
917
callbackInfo.callback = [](WGPUQueueWorkDoneStatus status_, void * userdata1, void * userdata2)
918
918
{ *(WGPUQueueWorkDoneStatus*)userdata1 = status_; };
919
919
callbackInfo.userdata1 = &status;
920
- WGPUFuture future = device->m_ctx .api .wgpuQueueOnSubmittedWorkDone2 (m_queue, callbackInfo);
920
+ WGPUFuture future = device->m_ctx .api .wgpuQueueOnSubmittedWorkDone (m_queue, callbackInfo);
921
921
constexpr size_t futureCount = 1 ;
922
922
WGPUFutureWaitInfo futures[futureCount] = {{future}};
923
923
uint64_t timeoutNS = UINT64_MAX;
0 commit comments