// Copyright 2018 The Amber Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "src/command.h" namespace amber { Command::Command(Type type) : command_type_(type) {} Command::~Command() = default; ClearCommand* Command::AsClear() { return static_cast(this); } ClearColorCommand* Command::AsClearColor() { return static_cast(this); } ClearDepthCommand* Command::AsClearDepth() { return static_cast(this); } ClearStencilCommand* Command::AsClearStencil() { return static_cast(this); } ComputeCommand* Command::AsCompute() { return static_cast(this); } DrawArraysCommand* Command::AsDrawArrays() { return static_cast(this); } DrawRectCommand* Command::AsDrawRect() { return static_cast(this); } EntryPointCommand* Command::AsEntryPoint() { return static_cast(this); } PatchParameterVerticesCommand* Command::AsPatchParameterVertices() { return static_cast(this); } ProbeCommand* Command::AsProbe() { return static_cast(this); } BufferCommand* Command::AsBuffer() { return static_cast(this); } ProbeSSBOCommand* Command::AsProbeSSBO() { return static_cast(this); } ToleranceCommand* Command::AsTolerance() { return static_cast(this); } DrawRectCommand::DrawRectCommand(PipelineData data) : Command(Type::kDrawRect), data_(data) {} DrawRectCommand::~DrawRectCommand() = default; DrawArraysCommand::DrawArraysCommand(PipelineData data) : Command(Type::kDrawArrays), data_(data) {} DrawArraysCommand::~DrawArraysCommand() = default; ComputeCommand::ComputeCommand(PipelineData data) : Command(Type::kCompute), data_(data) {} ComputeCommand::~ComputeCommand() = default; ProbeCommand::ProbeCommand() : Command(Type::kProbe) {} ProbeCommand::~ProbeCommand() = default; BufferCommand::BufferCommand(BufferType type) : Command(Type::kBuffer), buffer_type_(type) {} BufferCommand::~BufferCommand() = default; ProbeSSBOCommand::ProbeSSBOCommand() : Command(Type::kProbeSSBO) {} ProbeSSBOCommand::~ProbeSSBOCommand() = default; ToleranceCommand::ToleranceCommand() : Command(Type::kTolerance) {} ToleranceCommand::~ToleranceCommand() = default; ClearCommand::ClearCommand() : Command(Type::kClear) {} ClearCommand::~ClearCommand() = default; ClearColorCommand::ClearColorCommand() : Command(Type::kClearColor) {} ClearColorCommand::~ClearColorCommand() = default; ClearDepthCommand::ClearDepthCommand() : Command(Type::kClearDepth) {} ClearDepthCommand::~ClearDepthCommand() = default; ClearStencilCommand::ClearStencilCommand() : Command(Type::kClearStencil) {} ClearStencilCommand::~ClearStencilCommand() = default; PatchParameterVerticesCommand::PatchParameterVerticesCommand() : Command(Type::kPatchParameterVertices) {} PatchParameterVerticesCommand::~PatchParameterVerticesCommand() = default; EntryPointCommand::EntryPointCommand() : Command(Type::kEntryPoint) {} EntryPointCommand::~EntryPointCommand() = default; } // namespace amber