temp uniquify-transforms etc.

This commit is contained in:
David Rose 2007-06-01 00:03:43 +00:00
parent 4eee3a23e9
commit 5518abb092
3 changed files with 12 additions and 0 deletions

View File

@ -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.

View File

@ -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) {

View File

@ -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) {