From 5518abb0924ae407fbe470644d17ebee61fcb082 Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 1 Jun 2007 00:03:43 +0000 Subject: [PATCH] temp uniquify-transforms etc. --- panda/src/pgraph/renderAttrib.cxx | 4 ++++ panda/src/pgraph/renderState.cxx | 4 ++++ panda/src/pgraph/transformState.cxx | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/panda/src/pgraph/renderAttrib.cxx b/panda/src/pgraph/renderAttrib.cxx index f2dbc713b3..67b8e21518 100644 --- a/panda/src/pgraph/renderAttrib.cxx +++ b/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. diff --git a/panda/src/pgraph/renderState.cxx b/panda/src/pgraph/renderState.cxx index 0c5cd48f7c..e3a80e05a1 100644 --- a/panda/src/pgraph/renderState.cxx +++ b/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) { diff --git a/panda/src/pgraph/transformState.cxx b/panda/src/pgraph/transformState.cxx index fc6c4b00af..7e15fd027a 100644 --- a/panda/src/pgraph/transformState.cxx +++ b/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) {