فهرست منبع

temp uniquify-transforms etc.

David Rose 18 سال پیش
والد
کامیت
5518abb092
3فایلهای تغییر یافته به همراه12 افزوده شده و 0 حذف شده
  1. 4 0
      panda/src/pgraph/renderAttrib.cxx
  2. 4 0
      panda/src/pgraph/renderState.cxx
  3. 4 0
      panda/src/pgraph/transformState.cxx

+ 4 - 0
panda/src/pgraph/renderAttrib.cxx

@@ -258,6 +258,10 @@ validate_attribs() {
 CPT(RenderAttrib) RenderAttrib::
 return_new(RenderAttrib *attrib) {
   nassertr(attrib != (RenderAttrib *)NULL, attrib);
+  static ConfigVariableBool uniquify_attribs("uniquify-attribs", true);
+  if (!uniquify_attribs) {
+    return attrib;
+  }
 
   // This should be a newly allocated pointer, not one that was used
   // for anything else.

+ 4 - 0
panda/src/pgraph/renderState.cxx

@@ -1130,6 +1130,10 @@ bin_removed(int bin_index) {
 CPT(RenderState) RenderState::
 return_new(RenderState *state) {
   nassertr(state != (RenderState *)NULL, state);
+  static ConfigVariableBool uniquify_states("uniquify-states", true);
+  if (!uniquify_states && !state->is_empty()) {
+    return state;
+  }
 
 #ifndef NDEBUG
   if (!state_cache) {

+ 4 - 0
panda/src/pgraph/transformState.cxx

@@ -1272,6 +1272,10 @@ init_states() {
 CPT(TransformState) TransformState::
 return_new(TransformState *state) {
   nassertr(state != (TransformState *)NULL, state);
+  static ConfigVariableBool uniquify_transforms("uniquify-transforms", true);
+  if (!uniquify_transforms && !state->is_identity()) {
+    return state;
+  }
 
 #ifndef NDEBUG
   if (!transform_cache) {