summaryrefslogtreecommitdiff
path: root/chromium/third_party/dawn/src/dawn_native/CommandValidation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/dawn/src/dawn_native/CommandValidation.cpp')
-rw-r--r--chromium/third_party/dawn/src/dawn_native/CommandValidation.cpp73
1 files changed, 48 insertions, 25 deletions
diff --git a/chromium/third_party/dawn/src/dawn_native/CommandValidation.cpp b/chromium/third_party/dawn/src/dawn_native/CommandValidation.cpp
index dc7a3ccec54..e56d0e34fa9 100644
--- a/chromium/third_party/dawn/src/dawn_native/CommandValidation.cpp
+++ b/chromium/third_party/dawn/src/dawn_native/CommandValidation.cpp
@@ -37,39 +37,46 @@ namespace dawn_native {
case Command::Draw: {
commands->NextCommand<DrawCmd>();
DAWN_TRY(commandBufferState->ValidateCanDraw());
- } break;
+ break;
+ }
case Command::DrawIndexed: {
commands->NextCommand<DrawIndexedCmd>();
DAWN_TRY(commandBufferState->ValidateCanDrawIndexed());
- } break;
+ break;
+ }
case Command::DrawIndirect: {
commands->NextCommand<DrawIndirectCmd>();
DAWN_TRY(commandBufferState->ValidateCanDraw());
- } break;
+ break;
+ }
case Command::DrawIndexedIndirect: {
commands->NextCommand<DrawIndexedIndirectCmd>();
DAWN_TRY(commandBufferState->ValidateCanDrawIndexed());
- } break;
+ break;
+ }
case Command::InsertDebugMarker: {
InsertDebugMarkerCmd* cmd = commands->NextCommand<InsertDebugMarkerCmd>();
commands->NextData<char>(cmd->length + 1);
- } break;
+ break;
+ }
case Command::PopDebugGroup: {
commands->NextCommand<PopDebugGroupCmd>();
DAWN_TRY(ValidateCanPopDebugGroup(*debugGroupStackSize));
*debugGroupStackSize -= 1;
- } break;
+ break;
+ }
case Command::PushDebugGroup: {
PushDebugGroupCmd* cmd = commands->NextCommand<PushDebugGroupCmd>();
commands->NextData<char>(cmd->length + 1);
*debugGroupStackSize += 1;
- } break;
+ break;
+ }
case Command::SetRenderPipeline: {
SetRenderPipelineCmd* cmd = commands->NextCommand<SetRenderPipelineCmd>();
@@ -79,7 +86,8 @@ namespace dawn_native {
return DAWN_VALIDATION_ERROR("Pipeline attachment state is not compatible");
}
commandBufferState->SetRenderPipeline(pipeline);
- } break;
+ break;
+ }
case Command::SetBindGroup: {
SetBindGroupCmd* cmd = commands->NextCommand<SetBindGroupCmd>();
@@ -88,17 +96,20 @@ namespace dawn_native {
}
commandBufferState->SetBindGroup(cmd->index, cmd->group.Get());
- } break;
+ break;
+ }
case Command::SetIndexBuffer: {
commands->NextCommand<SetIndexBufferCmd>();
commandBufferState->SetIndexBuffer();
- } break;
+ break;
+ }
case Command::SetVertexBuffer: {
SetVertexBufferCmd* cmd = commands->NextCommand<SetVertexBufferCmd>();
commandBufferState->SetVertexBuffer(cmd->slot);
- } break;
+ break;
+ }
default:
return DAWN_VALIDATION_ERROR(disallowedMessage);
@@ -150,7 +161,7 @@ namespace dawn_native {
commands->NextCommand<EndRenderPassCmd>();
DAWN_TRY(ValidateFinalDebugGroupStackSize(debugGroupStackSize));
return {};
- } break;
+ }
case Command::ExecuteBundles: {
ExecuteBundlesCmd* cmd = commands->NextCommand<ExecuteBundlesCmd>();
@@ -168,23 +179,28 @@ namespace dawn_native {
commandBufferState = CommandBufferStateTracker{};
}
- } break;
+ break;
+ }
case Command::SetStencilReference: {
commands->NextCommand<SetStencilReferenceCmd>();
- } break;
+ break;
+ }
case Command::SetBlendColor: {
commands->NextCommand<SetBlendColorCmd>();
- } break;
+ break;
+ }
case Command::SetViewport: {
commands->NextCommand<SetViewportCmd>();
- } break;
+ break;
+ }
case Command::SetScissorRect: {
commands->NextCommand<SetScissorRectCmd>();
- } break;
+ break;
+ }
default:
DAWN_TRY(ValidateRenderBundleCommand(
@@ -208,40 +224,46 @@ namespace dawn_native {
commands->NextCommand<EndComputePassCmd>();
DAWN_TRY(ValidateFinalDebugGroupStackSize(debugGroupStackSize));
return {};
- } break;
+ }
case Command::Dispatch: {
commands->NextCommand<DispatchCmd>();
DAWN_TRY(commandBufferState.ValidateCanDispatch());
- } break;
+ break;
+ }
case Command::DispatchIndirect: {
commands->NextCommand<DispatchIndirectCmd>();
DAWN_TRY(commandBufferState.ValidateCanDispatch());
- } break;
+ break;
+ }
case Command::InsertDebugMarker: {
InsertDebugMarkerCmd* cmd = commands->NextCommand<InsertDebugMarkerCmd>();
commands->NextData<char>(cmd->length + 1);
- } break;
+ break;
+ }
case Command::PopDebugGroup: {
commands->NextCommand<PopDebugGroupCmd>();
DAWN_TRY(ValidateCanPopDebugGroup(debugGroupStackSize));
debugGroupStackSize--;
- } break;
+ break;
+ }
case Command::PushDebugGroup: {
PushDebugGroupCmd* cmd = commands->NextCommand<PushDebugGroupCmd>();
commands->NextData<char>(cmd->length + 1);
debugGroupStackSize++;
- } break;
+ break;
+ }
case Command::SetComputePipeline: {
SetComputePipelineCmd* cmd = commands->NextCommand<SetComputePipelineCmd>();
ComputePipelineBase* pipeline = cmd->pipeline.Get();
commandBufferState.SetComputePipeline(pipeline);
- } break;
+ break;
+ }
case Command::SetBindGroup: {
SetBindGroupCmd* cmd = commands->NextCommand<SetBindGroupCmd>();
@@ -249,7 +271,8 @@ namespace dawn_native {
commands->NextData<uint32_t>(cmd->dynamicOffsetCount);
}
commandBufferState.SetBindGroup(cmd->index, cmd->group.Get());
- } break;
+ break;
+ }
default:
return DAWN_VALIDATION_ERROR("Command disallowed inside a compute pass");