[Impeller] Remove CommandT. (flutter/engine#34732)

This commit is contained in:
Chinmay Garde 2022-07-18 17:02:05 -07:00 committed by GitHub
parent e4ca9ee66c
commit 0a37df0f6c

View File

@ -176,41 +176,4 @@ struct Command {
constexpr operator bool() const { return pipeline && pipeline->IsValid(); }
};
template <class VertexShader_, class FragmentShader_>
struct CommandT {
using VertexShader = VertexShader_;
using FragmentShader = FragmentShader_;
using VertexBufferBuilder =
VertexBufferBuilder<typename VertexShader_::PerVertexData>;
using Pipeline = PipelineT<VertexShader_, FragmentShader_>;
CommandT(PipelineT<VertexShader, FragmentShader>& pipeline) {
command_.label = VertexShader::kLabel;
// This could be moved to the accessor to delay the wait.
command_.pipeline = pipeline.WaitAndGet();
}
static VertexBufferBuilder CreateVertexBuilder() {
VertexBufferBuilder builder;
builder.SetLabel(std::string{VertexShader::kLabel});
return builder;
}
Command& Get() { return command_; }
operator Command&() { return Get(); }
bool BindVertices(VertexBufferBuilder builder, HostBuffer& buffer) {
return command_.BindVertices(builder.CreateVertexBuffer(buffer));
}
bool BindVerticesDynamic(const VertexBuffer& buffer) {
return command_.BindVertices(buffer);
}
private:
Command command_;
};
} // namespace impeller