OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 // StreamBank. | 82 // StreamBank. |
83 bool StreamBank::SetVertexStream(Stream::Semantic stream_semantic, | 83 bool StreamBank::SetVertexStream(Stream::Semantic stream_semantic, |
84 int semantic_index, | 84 int semantic_index, |
85 Field* field, | 85 Field* field, |
86 unsigned int start_index) { | 86 unsigned int start_index) { |
87 Buffer* buffer = field->buffer(); | 87 Buffer* buffer = field->buffer(); |
88 if (!buffer) { | 88 if (!buffer) { |
89 O3D_ERROR(service_locator()) << "No buffer on field"; | 89 O3D_ERROR(service_locator()) << "No buffer on field"; |
90 return false; | 90 return false; |
91 } | 91 } |
92 | |
93 // Check that this buffer is renderable. StreamBanks are used to submit | |
94 // data to GPU so we can only allow GPU accessable buffers through here. | |
apatrick
2009/07/07 00:58:25
accessable -> accessible
| |
92 if (!buffer->IsA(VertexBuffer::GetApparentClass())) { | 95 if (!buffer->IsA(VertexBuffer::GetApparentClass())) { |
93 O3D_ERROR(service_locator()) << "Buffer is not a VertexBuffer"; | 96 O3D_ERROR(service_locator()) << "Buffer is not a VertexBuffer"; |
94 return false; | 97 return false; |
95 } | 98 } |
96 | 99 |
97 ++change_count_; | 100 ++change_count_; |
98 | 101 |
99 Stream::Ref stream(new Stream(service_locator(), | 102 Stream::Ref stream(new Stream(service_locator(), |
100 field, | 103 field, |
101 start_index, | 104 start_index, |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
195 vertex_stream_params_[ii]->UpdateStream(); // Triggers updating. | 198 vertex_stream_params_[ii]->UpdateStream(); // Triggers updating. |
196 } | 199 } |
197 } | 200 } |
198 } | 201 } |
199 | 202 |
200 ObjectBase::Ref ParamStreamBank::Create(ServiceLocator* service_locator) { | 203 ObjectBase::Ref ParamStreamBank::Create(ServiceLocator* service_locator) { |
201 return ObjectBase::Ref(new ParamStreamBank(service_locator, false, false)); | 204 return ObjectBase::Ref(new ParamStreamBank(service_locator, false, false)); |
202 } | 205 } |
203 | 206 |
204 } // namespace o3d | 207 } // namespace o3d |
OLD | NEW |