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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 | 344 |
345 // Fills the Desc structure, appending name and semantic if any, and if enough | 345 // Fills the Desc structure, appending name and semantic if any, and if enough |
346 // room is available in the buffer. | 346 // room is available in the buffer. |
347 bool EffectD3D9::GetStreamDesc(unsigned int index, | 347 bool EffectD3D9::GetStreamDesc(unsigned int index, |
348 unsigned int size, | 348 unsigned int size, |
349 void *data) { | 349 void *data) { |
350 using effect_stream::Desc; | 350 using effect_stream::Desc; |
351 if (size < sizeof(Desc)) // NOLINT | 351 if (size < sizeof(Desc)) // NOLINT |
352 return false; | 352 return false; |
353 | 353 |
354 Desc stream = streams_[index]; | |
355 Desc *desc = static_cast<Desc *>(data); | 354 Desc *desc = static_cast<Desc *>(data); |
356 memset(desc, 0, sizeof(*desc)); | 355 *desc = streams_[index]; |
357 desc->semantic = stream.semantic; | |
358 desc->semantic_index = stream.semantic_index; | |
359 return true; | 356 return true; |
360 } | 357 } |
361 | 358 |
362 EffectParamD3D9::EffectParamD3D9(effect_param::DataType data_type, | 359 EffectParamD3D9::EffectParamD3D9(effect_param::DataType data_type, |
363 EffectD3D9 *effect, | 360 EffectD3D9 *effect, |
364 D3DXHANDLE handle) | 361 D3DXHANDLE handle) |
365 : EffectParam(data_type), | 362 : EffectParam(data_type), |
366 effect_(effect), | 363 effect_(effect), |
367 handle_(handle), | 364 handle_(handle), |
368 sampler_units_(NULL), | 365 sampler_units_(NULL), |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 DCHECK(validate_effect_); | 665 DCHECK(validate_effect_); |
669 DCHECK(!current_effect_); | 666 DCHECK(!current_effect_); |
670 current_effect_ = effects_.Get(current_effect_id_); | 667 current_effect_ = effects_.Get(current_effect_id_); |
671 if (!current_effect_) return false; | 668 if (!current_effect_) return false; |
672 validate_effect_ = false; | 669 validate_effect_ = false; |
673 return current_effect_->Begin(this); | 670 return current_effect_->Begin(this); |
674 } | 671 } |
675 | 672 |
676 } // namespace command_buffer | 673 } // namespace command_buffer |
677 } // namespace o3d | 674 } // namespace o3d |
OLD | NEW |