LEFT | RIGHT |
1 /* | 1 /* |
2 Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. | 2 Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. |
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 * Redistributions of source code must retain the above copyright | 8 * Redistributions of source code must retain the above copyright |
9 notice, this list of conditions and the following disclaimer. | 9 notice, this list of conditions and the following disclaimer. |
10 * Redistributions in binary form must reproduce the above copyright | 10 * Redistributions in binary form must reproduce the above copyright |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 } else if (sym.typespec().simpletype().basetype != TypeDesc::UNKNOWN
) { | 290 } else if (sym.typespec().simpletype().basetype != TypeDesc::UNKNOWN
) { |
291 size_t addr = context->heap_allot (sym.derivsize() * m_npoints); | 291 size_t addr = context->heap_allot (sym.derivsize() * m_npoints); |
292 sym.data (m_context->heapaddr (addr)); | 292 sym.data (m_context->heapaddr (addr)); |
293 sym.step (0); // FIXME | 293 sym.step (0); // FIXME |
294 // Copy the parameter value | 294 // Copy the parameter value |
295 // FIXME -- if the parameter is not being overridden and is | 295 // FIXME -- if the parameter is not being overridden and is |
296 // not writeable, I think we should just point to the parameter | 296 // not writeable, I think we should just point to the parameter |
297 // data, not copy it? Or does it matter? | 297 // data, not copy it? Or does it matter? |
298 if (sym.typespec().simpletype().basetype == TypeDesc::FLOAT) | 298 if (sym.typespec().simpletype().basetype == TypeDesc::FLOAT) |
299 memcpy (sym.data(), &instance->m_fparams[sym.dataoffset()], | 299 memcpy (sym.data(), &instance->m_fparams[sym.dataoffset()], |
300 sym.derivsize()); | 300 sym.typespec().simpletype().size()); |
301 else if (sym.typespec().simpletype().basetype == TypeDesc::INT) | 301 else if (sym.typespec().simpletype().basetype == TypeDesc::INT) |
302 memcpy (sym.data(), &instance->m_iparams[sym.dataoffset()], | 302 memcpy (sym.data(), &instance->m_iparams[sym.dataoffset()], |
303 sym.derivsize()); | 303 sym.typespec().simpletype().size()); |
304 else if (sym.typespec().simpletype().basetype == TypeDesc::STRIN
G) | 304 else if (sym.typespec().simpletype().basetype == TypeDesc::STRIN
G) |
305 memcpy (sym.data(), &instance->m_sparams[sym.dataoffset()], | 305 memcpy (sym.data(), &instance->m_sparams[sym.dataoffset()], |
306 sym.derivsize()); | 306 sym.typespec().simpletype().size()); |
307 else { | 307 else { |
308 ASSERT (0 && "unrecognized type -- no default value"); | 308 ASSERT (0 && "unrecognized type -- no default value"); |
309 } | 309 } |
310 if (sym.has_derivs ()) | 310 if (sym.has_derivs ()) |
311 zero_derivs (sym); | 311 zero_derivs (sym); |
312 } else { | 312 } else { |
313 sym.data ((void*) 0); // reset data ptr -- this symbol should nev
er be used | 313 sym.data ((void*) 0); // reset data ptr -- this symbol should nev
er be used |
314 sym.step (0); | 314 sym.step (0); |
315 } | 315 } |
316 } else if (sym.symtype() == SymTypeLocal || | 316 } else if (sym.symtype() == SymTypeLocal || |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1026 get_matrix (Mfrom, from, whichpoint); | 1026 get_matrix (Mfrom, from, whichpoint); |
1027 get_inverse_matrix (Mto, to, whichpoint); | 1027 get_inverse_matrix (Mto, to, whichpoint); |
1028 result = Mfrom * Mto; | 1028 result = Mfrom * Mto; |
1029 } | 1029 } |
1030 | 1030 |
1031 | 1031 |
1032 | 1032 |
1033 | 1033 |
1034 }; // namespace pvt | 1034 }; // namespace pvt |
1035 }; // namespace OSL | 1035 }; // namespace OSL |
LEFT | RIGHT |