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 28 matching lines...) Expand all Loading... |
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 #include "command_buffer/service/win/d3d9/effect_d3d9.h" | 41 #include "command_buffer/service/win/d3d9/effect_d3d9.h" |
42 #include "command_buffer/service/win/d3d9/sampler_d3d9.h" | 42 #include "command_buffer/service/win/d3d9/sampler_d3d9.h" |
43 #include "command_buffer/service/cross/effect_utils.h" | 43 #include "command_buffer/service/cross/effect_utils.h" |
44 | 44 |
45 // TODO: remove link-dependency on D3DX. | 45 // TODO: remove link-dependency on D3DX. |
46 | 46 |
47 namespace o3d { | 47 namespace o3d { |
48 namespace command_buffer { | 48 namespace command_buffer { |
| 49 namespace o3d { |
49 | 50 |
50 // Logs the D3D effect error, from either the buffer, or GetLastError(). | 51 // Logs the D3D effect error, from either the buffer, or GetLastError(). |
51 static void LogFXError(LPD3DXBUFFER error_buffer) { | 52 static void LogFXError(LPD3DXBUFFER error_buffer) { |
52 if (error_buffer) { | 53 if (error_buffer) { |
53 LPVOID compile_errors = error_buffer->GetBufferPointer(); | 54 LPVOID compile_errors = error_buffer->GetBufferPointer(); |
54 LOG(ERROR) << "Failed to compile effect: " | 55 LOG(ERROR) << "Failed to compile effect: " |
55 << static_cast<char *>(compile_errors); | 56 << static_cast<char *>(compile_errors); |
56 } else { | 57 } else { |
57 HLOCAL hLocal = NULL; | 58 HLOCAL hLocal = NULL; |
58 FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_ALLOCATE_BUFFER, | 59 FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_ALLOCATE_BUFFER, |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 // Should only be called if the current effect is not valid. | 667 // Should only be called if the current effect is not valid. |
667 bool GAPID3D9::ValidateEffect() { | 668 bool GAPID3D9::ValidateEffect() { |
668 DCHECK(validate_effect_); | 669 DCHECK(validate_effect_); |
669 DCHECK(!current_effect_); | 670 DCHECK(!current_effect_); |
670 current_effect_ = effects_.Get(current_effect_id_); | 671 current_effect_ = effects_.Get(current_effect_id_); |
671 if (!current_effect_) return false; | 672 if (!current_effect_) return false; |
672 validate_effect_ = false; | 673 validate_effect_ = false; |
673 return current_effect_->Begin(); | 674 return current_effect_->Begin(); |
674 } | 675 } |
675 | 676 |
| 677 } // namespace o3d |
676 } // namespace command_buffer | 678 } // namespace command_buffer |
677 } // namespace o3d | 679 } // namespace o3d |
OLD | NEW |