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 23 matching lines...) Expand all Loading... |
34 // VertexBuffer, IndexBuffer and VertexStruct resources. | 34 // VertexBuffer, IndexBuffer and VertexStruct resources. |
35 // This file also contains the related GAPID3D9 function implementations. | 35 // This file also contains the related GAPID3D9 function implementations. |
36 | 36 |
37 #include <algorithm> | 37 #include <algorithm> |
38 #include "command_buffer/service/win/d3d9/d3d9_utils.h" | 38 #include "command_buffer/service/win/d3d9/d3d9_utils.h" |
39 #include "command_buffer/service/win/d3d9/geometry_d3d9.h" | 39 #include "command_buffer/service/win/d3d9/geometry_d3d9.h" |
40 #include "command_buffer/service/win/d3d9/gapi_d3d9.h" | 40 #include "command_buffer/service/win/d3d9/gapi_d3d9.h" |
41 | 41 |
42 namespace o3d { | 42 namespace o3d { |
43 namespace command_buffer { | 43 namespace command_buffer { |
| 44 namespace o3d { |
44 | 45 |
45 // Destroys the D3D9 vertex buffer. | 46 // Destroys the D3D9 vertex buffer. |
46 VertexBufferD3D9::~VertexBufferD3D9() { | 47 VertexBufferD3D9::~VertexBufferD3D9() { |
47 DCHECK(d3d_vertex_buffer_ != NULL); | 48 DCHECK(d3d_vertex_buffer_ != NULL); |
48 if (d3d_vertex_buffer_) { | 49 if (d3d_vertex_buffer_) { |
49 d3d_vertex_buffer_->Release(); | 50 d3d_vertex_buffer_->Release(); |
50 d3d_vertex_buffer_ = NULL; | 51 d3d_vertex_buffer_ = NULL; |
51 } | 52 } |
52 } | 53 } |
53 | 54 |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 unsigned int semantic_index) { | 426 unsigned int semantic_index) { |
426 if (vertex_buffer_id == current_vertex_struct_) validate_streams_ = true; | 427 if (vertex_buffer_id == current_vertex_struct_) validate_streams_ = true; |
427 VertexStructD3D9 *vertex_struct = vertex_structs_.Get(vertex_struct_id); | 428 VertexStructD3D9 *vertex_struct = vertex_structs_.Get(vertex_struct_id); |
428 if (!vertex_struct || input_index >= vertex_struct->count()) | 429 if (!vertex_struct || input_index >= vertex_struct->count()) |
429 return parse_error::kParseInvalidArguments; | 430 return parse_error::kParseInvalidArguments; |
430 vertex_struct->SetInput(input_index, vertex_buffer_id, offset, stride, type, | 431 vertex_struct->SetInput(input_index, vertex_buffer_id, offset, stride, type, |
431 semantic, semantic_index); | 432 semantic, semantic_index); |
432 return parse_error::kParseNoError; | 433 return parse_error::kParseNoError; |
433 } | 434 } |
434 | 435 |
| 436 } // namespace o3d |
435 } // namespace command_buffer | 437 } // namespace command_buffer |
436 } // namespace o3d | 438 } // namespace o3d |
OLD | NEW |