Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(831)

Unified Diff: core/cross/command_buffer/stream_bank_cb.cc

Issue 212018: Change command buffer client code to use structures.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/cross/command_buffer/states_cb.cc ('k') | core/cross/command_buffer/texture_cb.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/cross/command_buffer/stream_bank_cb.cc
===================================================================
--- core/cross/command_buffer/stream_bank_cb.cc (revision 26638)
+++ core/cross/command_buffer/stream_bank_cb.cc (working copy)
@@ -147,10 +147,7 @@
DCHECK_EQ(kInvalidResource, vertex_struct_id_);
vertex_struct_id_ = renderer_->vertex_structs_ids().AllocateID();
CommandBufferHelper *helper = renderer_->helper();
- CommandBufferEntry args[5];
- args[0].value_uint32 = vertex_struct_id_;
- args[1].value_uint32 = vertex_stream_params_.size();
- helper->AddCommand(command_buffer::CREATE_VERTEX_STRUCT, 2, args);
+ helper->CreateVertexStruct(vertex_struct_id_, vertex_stream_params_.size());
for (unsigned int i = 0; i < vertex_stream_params_.size(); ++i) {
const Stream &stream = vertex_stream_params_[i]->stream();
vertex_struct::Semantic cb_semantic;
@@ -168,19 +165,16 @@
continue;
}
- namespace cmd = command_buffer::set_vertex_input_cmd;
VertexBufferCB *vertex_buffer =
static_cast<VertexBufferCB *>(stream.field().buffer());
- args[0].value_uint32 = vertex_struct_id_;
- args[1].value_uint32 = i;
- args[2].value_uint32 = vertex_buffer->resource_id();
- args[3].value_uint32 = stream.field().offset();
- args[4].value_uint32 =
- cmd::SemanticIndex::MakeValue(cb_semantic_index) |
- cmd::Semantic::MakeValue(cb_semantic) |
- cmd::Type::MakeValue(cb_type) |
- cmd::Stride::MakeValue(vertex_buffer->stride());
- helper->AddCommand(command_buffer::SET_VERTEX_INPUT, 5, args);
+ helper->SetVertexInput(
+ vertex_struct_id_, i,
+ vertex_buffer->resource_id(),
+ stream.field().offset(),
+ cb_semantic,
+ cb_semantic_index,
+ cb_type,
+ vertex_buffer->stride());
}
}
@@ -188,9 +182,7 @@
void StreamBankCB::DestroyVertexStruct() {
if (vertex_struct_id_ != kInvalidResource) {
CommandBufferHelper *helper = renderer_->helper();
- CommandBufferEntry args[1];
- args[0].value_uint32 = vertex_struct_id_;
- helper->AddCommand(command_buffer::DESTROY_VERTEX_STRUCT, 1, args);
+ helper->DestroyVertexStruct(vertex_struct_id_);
renderer_->vertex_structs_ids().FreeID(vertex_struct_id_);
vertex_struct_id_ = kInvalidResource;
}
@@ -200,10 +192,7 @@
if (vertex_struct_id_ == kInvalidResource)
CreateVertexStruct();
CommandBufferHelper *helper = renderer_->helper();
- CommandBufferEntry args[6];
- // Sets current vertex struct.
- args[0].value_uint32 = vertex_struct_id_;
- helper->AddCommand(command_buffer::SET_VERTEX_STRUCT, 1, args);
+ helper->SetVertexStruct(vertex_struct_id_);
}
} // namespace o3d
« no previous file with comments | « core/cross/command_buffer/states_cb.cc ('k') | core/cross/command_buffer/texture_cb.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698