OLD | NEW |
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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 | 440 |
441 /// Round up to an 8-byte boundary.· | 441 /// Round up to an 8-byte boundary.· |
442 /// FIXME -- do we want to round up to 16-byte boundaries for· | 442 /// FIXME -- do we want to round up to 16-byte boundaries for· |
443 /// hardware SIMD reasons? | 443 /// hardware SIMD reasons? |
444 size_t align (size_t x, size_t alignment = 8) { | 444 size_t align (size_t x, size_t alignment = 8) { |
445 return x + align_padding (x, alignment); | 445 return x + align_padding (x, alignment); |
446 } | 446 } |
447 | 447 |
448 bool allow_rebind () const { return m_rebind; } | 448 bool allow_rebind () const { return m_rebind; } |
449 | 449 |
| 450 bool debug_nan () const { return m_debugnan; } |
| 451 |
450 ustring commonspace_synonym () const { return m_commonspace_synonym; } | 452 ustring commonspace_synonym () const { return m_commonspace_synonym; } |
451 | 453 |
452 private: | 454 private: |
453 void printstats () const; | 455 void printstats () const; |
454 void init_global_heap_offsets (); | 456 void init_global_heap_offsets (); |
455 | 457 |
456 /// Find the index of the named layer in the current shader group. | 458 /// Find the index of the named layer in the current shader group. |
457 /// If found, return the index >= 0 and put a pointer to the instance | 459 /// If found, return the index >= 0 and put a pointer to the instance |
458 /// in inst; if not found, return -1 and set inst to NULL. | 460 /// in inst; if not found, return -1 and set inst to NULL. |
459 /// (This is a helper for ConnectShaders.) | 461 /// (This is a helper for ConnectShaders.) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 | 496 |
495 typedef std::map<ustring,ShaderMaster::ref> ShaderNameMap; | 497 typedef std::map<ustring,ShaderMaster::ref> ShaderNameMap; |
496 ShaderNameMap m_shader_masters; ///< name -> shader masters map | 498 ShaderNameMap m_shader_masters; ///< name -> shader masters map |
497 | 499 |
498 // Options | 500 // Options |
499 int m_statslevel; ///< Statistics level | 501 int m_statslevel; ///< Statistics level |
500 bool m_debug; ///< Debugging output | 502 bool m_debug; ///< Debugging output |
501 bool m_lazylayers; ///< Evaluate layers on demand? | 503 bool m_lazylayers; ///< Evaluate layers on demand? |
502 bool m_clearmemory; ///< Zero mem before running shader? | 504 bool m_clearmemory; ///< Zero mem before running shader? |
503 bool m_rebind; ///< Allow rebinding? | 505 bool m_rebind; ///< Allow rebinding? |
| 506 bool m_debugnan; ///< Root out NaN's? |
504 std::string m_searchpath; ///< Shader search path | 507 std::string m_searchpath; ///< Shader search path |
505 std::vector<std::string> m_searchpath_dirs; ///< All searchpath dirs | 508 std::vector<std::string> m_searchpath_dirs; ///< All searchpath dirs |
506 ustring m_commonspace_synonym; ///< Synonym for "common" space | 509 ustring m_commonspace_synonym; ///< Synonym for "common" space |
507 | 510 |
508 bool m_in_group; ///< Are we specifying a group? | 511 bool m_in_group; ///< Are we specifying a group? |
509 ShaderUse m_group_use; ///< Use of group | 512 ShaderUse m_group_use; ///< Use of group |
510 ParamValueList m_pending_params; ///< Pending Parameter() values | 513 ParamValueList m_pending_params; ///< Pending Parameter() values |
511 ShadingAttribStateRef m_curattrib; ///< Current shading attribute state | 514 ShadingAttribStateRef m_curattrib; ///< Current shading attribute state |
512 std::map<ustring,int> m_global_heap_offsets; ///< Heap offsets of globals | 515 std::map<ustring,int> m_global_heap_offsets; ///< Heap offsets of globals |
513 size_t m_global_heap_total; ///< Heap size for globals | 516 size_t m_global_heap_total; ///< Heap size for globals |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 void bind_connections (); | 883 void bind_connections (); |
881 | 884 |
882 /// Helper for bind(): establish a connections to an earlier layer. | 885 /// Helper for bind(): establish a connections to an earlier layer. |
883 /// | 886 /// |
884 void bind_connection (const Connection &con); | 887 void bind_connection (const Connection &con); |
885 | 888 |
886 /// Helper for bind(): marks all parameters which correspond to | 889 /// Helper for bind(): marks all parameters which correspond to |
887 /// geometric user-data | 890 /// geometric user-data |
888 void bind_mark_geom_variables (ShaderInstance *inst); | 891 void bind_mark_geom_variables (ShaderInstance *inst); |
889 | 892 |
| 893 /// Helper for run: check all the writable arguments of an op to see |
| 894 /// if any NaN or Inf values have snuck in. |
| 895 void check_nan (Opcode &op); |
| 896 |
890 ShaderUse m_use; ///< Our shader use | 897 ShaderUse m_use; ///< Our shader use |
891 ShadingContext *m_context; ///< Ptr to our shading context | 898 ShadingContext *m_context; ///< Ptr to our shading context |
892 ShaderInstance *m_instance; ///< Ptr to the shader instance | 899 ShaderInstance *m_instance; ///< Ptr to the shader instance |
893 ShaderMaster *m_master; ///< Ptr to the instance's master | 900 ShaderMaster *m_master; ///< Ptr to the instance's master |
894 ShadingSystemImpl *m_shadingsys; ///< Ptr to shading system | 901 ShadingSystemImpl *m_shadingsys; ///< Ptr to shading system |
895 RendererServices *m_renderer; ///< Ptr to renderer services | 902 RendererServices *m_renderer; ///< Ptr to renderer services |
896 int m_npoints; ///< How many points are we running? | 903 int m_npoints; ///< How many points are we running? |
897 int m_npoints_bound; ///< How many points bound with addresses? | 904 int m_npoints_bound; ///< How many points bound with addresses? |
898 bool m_bound; ///< Have we been bound? | 905 bool m_bound; ///< Have we been bound? |
899 bool m_executed; ///< Have we been executed? | 906 bool m_executed; ///< Have we been executed? |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 | 1002 |
996 | 1003 |
997 }; // namespace OSL | 1004 }; // namespace OSL |
998 | 1005 |
999 #ifdef OSL_NAMESPACE | 1006 #ifdef OSL_NAMESPACE |
1000 }; // end namespace OSL_NAMESPACE | 1007 }; // end namespace OSL_NAMESPACE |
1001 using namespace OSL_NAMESPACE; | 1008 using namespace OSL_NAMESPACE; |
1002 #endif | 1009 #endif |
1003 | 1010 |
1004 #endif /* OSLEXEC_PVT_H */ | 1011 #endif /* OSLEXEC_PVT_H */ |
OLD | NEW |