diff --git a/src/dawn_native/ProgrammablePassEncoder.cpp b/src/dawn_native/ProgrammablePassEncoder.cpp index 7a16f31098..143144b332 100644 --- a/src/dawn_native/ProgrammablePassEncoder.cpp +++ b/src/dawn_native/ProgrammablePassEncoder.cpp @@ -39,6 +39,10 @@ namespace dawn_native { } void ProgrammablePassEncoder::InsertDebugMarker(const char* groupLabel) { + if (mTopLevelEncoder->ConsumedError(ValidateCanRecordCommands())) { + return; + } + InsertDebugMarkerCmd* cmd = mAllocator->Allocate(Command::InsertDebugMarker); new (cmd) InsertDebugMarkerCmd; @@ -49,11 +53,19 @@ namespace dawn_native { } void ProgrammablePassEncoder::PopDebugGroup() { + if (mTopLevelEncoder->ConsumedError(ValidateCanRecordCommands())) { + return; + } + PopDebugGroupCmd* cmd = mAllocator->Allocate(Command::PopDebugGroup); new (cmd) PopDebugGroupCmd; } void ProgrammablePassEncoder::PushDebugGroup(const char* groupLabel) { + if (mTopLevelEncoder->ConsumedError(ValidateCanRecordCommands())) { + return; + } + PushDebugGroupCmd* cmd = mAllocator->Allocate(Command::PushDebugGroup); new (cmd) PushDebugGroupCmd; cmd->length = strlen(groupLabel);