mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[Impeller] Remove CommandT. (flutter/engine#34732)
This commit is contained in:
parent
e4ca9ee66c
commit
0a37df0f6c
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user