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

Side by Side Diff: command_buffer/service/win/d3d9/geometry_d3d9.cc

Issue 200127: Made gyp file for command buffer libraries.... (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 unsigned int max_vertices = UINT_MAX; 199 unsigned int max_vertices = UINT_MAX;
200 for (unsigned int i = 0; i < streams_.size(); ++i) { 200 for (unsigned int i = 0; i < streams_.size(); ++i) {
201 const StreamPair &pair = streams_[i]; 201 const StreamPair &pair = streams_[i];
202 VertexBufferD3D9 *vertex_buffer = gapi->GetVertexBuffer(pair.first); 202 VertexBufferD3D9 *vertex_buffer = gapi->GetVertexBuffer(pair.first);
203 if (!vertex_buffer) { 203 if (!vertex_buffer) {
204 max_vertices = 0; 204 max_vertices = 0;
205 continue; 205 continue;
206 } 206 }
207 HR(d3d_device->SetStreamSource(i, vertex_buffer->d3d_vertex_buffer(), 0, 207 HR(d3d_device->SetStreamSource(i, vertex_buffer->d3d_vertex_buffer(), 0,
208 pair.second)); 208 pair.second));
209 max_vertices = std::min(max_vertices, vertex_buffer->size()/pair.second); 209
210 // TODO(apatrick): A zero size stride is valid. It means the first element
211 // in the vertex buffer will be used for every vertex. There doesn't seem
212 // to be enough information here to determine whether a zero stride
213 // vertex buffer is big enough to contain a single element.
214 if (pair.second != 0) {
215 max_vertices = std::min(max_vertices,
216 vertex_buffer->size() / pair.second);
217 }
210 } 218 }
211 return max_vertices; 219 return max_vertices;
212 } 220 }
213 221
214 // Converts a vertex_struct::Type to a D3DDECLTYPE. 222 // Converts a vertex_struct::Type to a D3DDECLTYPE.
215 static D3DDECLTYPE D3DType(vertex_struct::Type type) { 223 static D3DDECLTYPE D3DType(vertex_struct::Type type) {
216 switch (type) { 224 switch (type) {
217 case vertex_struct::FLOAT1: 225 case vertex_struct::FLOAT1:
218 return D3DDECLTYPE_FLOAT1; 226 return D3DDECLTYPE_FLOAT1;
219 case vertex_struct::FLOAT2: 227 case vertex_struct::FLOAT2:
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 VertexStructD3D9 *vertex_struct = vertex_structs_.Get(vertex_struct_id); 427 VertexStructD3D9 *vertex_struct = vertex_structs_.Get(vertex_struct_id);
420 if (!vertex_struct || input_index >= vertex_struct->count()) 428 if (!vertex_struct || input_index >= vertex_struct->count())
421 return BufferSyncInterface::PARSE_INVALID_ARGUMENTS; 429 return BufferSyncInterface::PARSE_INVALID_ARGUMENTS;
422 vertex_struct->SetInput(input_index, vertex_buffer_id, offset, stride, type, 430 vertex_struct->SetInput(input_index, vertex_buffer_id, offset, stride, type,
423 semantic, semantic_index); 431 semantic, semantic_index);
424 return BufferSyncInterface::PARSE_NO_ERROR; 432 return BufferSyncInterface::PARSE_NO_ERROR;
425 } 433 }
426 434
427 } // namespace command_buffer 435 } // namespace command_buffer
428 } // namespace o3d 436 } // namespace o3d
OLDNEW
« no previous file with comments | « command_buffer/service/cross/texture_utils.h ('k') | command_buffer/service/win/d3d9/sampler_d3d9.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698