Browse Source

minor performance enhancements

David Rose 20 years ago
parent
commit
9b560c9370

+ 2 - 4
panda/src/distort/projectionScreen.cxx

@@ -609,15 +609,13 @@ recompute_geom(Geom *geom, const LMatrix4f &rel_mat) {
     if (!vdata->has_column(_texcoord_name)) {
     if (!vdata->has_column(_texcoord_name)) {
       // We need to add a new column for the new texcoords.
       // We need to add a new column for the new texcoords.
       vdata = vdata->replace_column
       vdata = vdata->replace_column
-        (_texcoord_name, 2, qpGeom::NT_float32,
-         qpGeom::C_texcoord, qpGeom::UH_dynamic, true);
+        (_texcoord_name, 2, qpGeom::NT_float32, qpGeom::C_texcoord);
       qpgeom->set_vertex_data(vdata);
       qpgeom->set_vertex_data(vdata);
     }
     }
     if (_vignette_on && !vdata->has_column(InternalName::get_color())) {
     if (_vignette_on && !vdata->has_column(InternalName::get_color())) {
       // We need to add a column for color.
       // We need to add a column for color.
       vdata = vdata->replace_column
       vdata = vdata->replace_column
-        (InternalName::get_color(), 1, qpGeom::NT_packed_dabc,
-         qpGeom::C_color, qpGeom::UH_dynamic, true);
+        (InternalName::get_color(), 1, qpGeom::NT_packed_dabc, qpGeom::C_color);
       qpgeom->set_vertex_data(vdata);
       qpgeom->set_vertex_data(vdata);
     }
     }
 
 

+ 47 - 29
panda/src/gobj/qpgeomVertexData.cxx

@@ -91,6 +91,39 @@ qpGeomVertexData(const qpGeomVertexData &copy) :
   _cull_char_pcollector(copy._cull_char_pcollector)
   _cull_char_pcollector(copy._cull_char_pcollector)
 {
 {
 }
 }
+
+////////////////////////////////////////////////////////////////////
+//     Function: qpGeomVertexData::Constructor
+//       Access: Published
+//  Description: This constructor copies all of the basic properties
+//               of the source VertexData, like usage_hint and
+//               animation tables, but does not copy the actual data,
+//               and it allows you to specify a different format.
+////////////////////////////////////////////////////////////////////
+qpGeomVertexData::
+qpGeomVertexData(const qpGeomVertexData &copy, 
+                 const qpGeomVertexFormat *format) :
+  TypedWritableReferenceCount(copy),
+  _name(copy._name),
+  _format(format),
+  _cycler(copy._cycler),
+  _app_char_pcollector(copy._app_char_pcollector),
+  _cull_char_pcollector(copy._cull_char_pcollector)
+{
+  nassertv(_format->is_registered());
+
+  // Create some empty arrays as required by the format.
+  CDWriter cdata(_cycler);
+
+  UsageHint usage_hint = cdata->_usage_hint;
+  cdata->_arrays.clear();
+  int num_arrays = _format->get_num_arrays();
+  for (int i = 0; i < num_arrays; i++) {
+    PT(qpGeomVertexArrayData) array = new qpGeomVertexArrayData
+      (_format->get_array(i), usage_hint);
+    cdata->_arrays.push_back(array);
+  }
+}
   
   
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: qpGeomVertexData::Copy Assignment Operator
 //     Function: qpGeomVertexData::Copy Assignment Operator
@@ -723,8 +756,7 @@ scale_color(const LVecBase4f &color_scale, int num_components,
   PStatTimer timer(_scale_color_pcollector);
   PStatTimer timer(_scale_color_pcollector);
 
 
   PT(qpGeomVertexData) new_data = replace_column
   PT(qpGeomVertexData) new_data = replace_column
-    (InternalName::get_color(), num_components, numeric_type,
-     contents, get_usage_hint(), true);
+    (InternalName::get_color(), num_components, numeric_type, contents);
 
 
   // Now go through and apply the scale, copying it to the new data.
   // Now go through and apply the scale, copying it to the new data.
   qpGeomVertexWriter to(new_data, InternalName::get_color());
   qpGeomVertexWriter to(new_data, InternalName::get_color());
@@ -789,8 +821,7 @@ set_color(const Colorf &color, int num_components,
   PStatTimer timer(_set_color_pcollector);
   PStatTimer timer(_set_color_pcollector);
 
 
   PT(qpGeomVertexData) new_data = replace_column
   PT(qpGeomVertexData) new_data = replace_column
-    (InternalName::get_color(), num_components, numeric_type,
-     contents, get_usage_hint(), true);
+    (InternalName::get_color(), num_components, numeric_type, contents);
 
 
   // Now go through and set the new color value.
   // Now go through and set the new color value.
   qpGeomVertexWriter to(new_data, InternalName::get_color());
   qpGeomVertexWriter to(new_data, InternalName::get_color());
@@ -818,9 +849,7 @@ set_color(const Colorf &color, int num_components,
 PT(qpGeomVertexData) qpGeomVertexData::
 PT(qpGeomVertexData) qpGeomVertexData::
 replace_column(const InternalName *name, int num_components,
 replace_column(const InternalName *name, int num_components,
                qpGeomVertexData::NumericType numeric_type,
                qpGeomVertexData::NumericType numeric_type,
-               qpGeomVertexData::Contents contents,
-               qpGeomVertexData::UsageHint usage_hint,
-               bool keep_animation) const {
+               qpGeomVertexData::Contents contents) const {
   PT(qpGeomVertexFormat) new_format = new qpGeomVertexFormat(*_format);
   PT(qpGeomVertexFormat) new_format = new qpGeomVertexFormat(*_format);
 
 
   // Remove the old description of the type from the format.
   // Remove the old description of the type from the format.
@@ -859,12 +888,7 @@ replace_column(const InternalName *name, int num_components,
       << *_format << " to " << *format << "\n";
       << *_format << " to " << *format << "\n";
   }
   }
   
   
-  PT(qpGeomVertexData) new_data = 
-    new qpGeomVertexData(get_name(), format, usage_hint);
-  if (keep_animation) {
-    new_data->set_transform_blend_table(get_transform_blend_table());
-    new_data->set_slider_table(get_slider_table());
-  }
+  PT(qpGeomVertexData) new_data = new qpGeomVertexData(*this, format);
 
 
   int j = 0;
   int j = 0;
   int num_arrays = get_num_arrays();
   int num_arrays = get_num_arrays();
@@ -1370,17 +1394,18 @@ update_animated_vertices(qpGeomVertexData::CDWriter &cdata, bool from_app) {
     }
     }
 
 
     // Now go through and apply the transforms.
     // Now go through and apply the transforms.
+    qpGeomVertexReader blendi(this, InternalName::get_transform_blend());
+    if (!blendi.has_column()) {
+      gobj_cat.warning()
+        << "Vertex data " << get_name()
+        << " has a transform_blend_table, but no transform_blend data.\n";
+      return;
+    }
+
     int ci;
     int ci;
     for (ci = 0; ci < _format->get_num_points(); ci++) {
     for (ci = 0; ci < _format->get_num_points(); ci++) {
       qpGeomVertexRewriter data(new_data, _format->get_point(ci));
       qpGeomVertexRewriter data(new_data, _format->get_point(ci));
-      qpGeomVertexReader blendi(this, InternalName::get_transform_blend());
-
-      if (!blendi.has_column()) {
-        gobj_cat.warning()
-          << "Vertex data " << get_name()
-          << " has a transform_blend_table, but no transform_blend data.\n";
-        return;
-      }
+      blendi.set_row(0);
       
       
       if (data.get_column()->get_num_values() == 4) {
       if (data.get_column()->get_num_values() == 4) {
         for (int i = 0; i < num_rows; i++) {
         for (int i = 0; i < num_rows; i++) {
@@ -1400,14 +1425,7 @@ update_animated_vertices(qpGeomVertexData::CDWriter &cdata, bool from_app) {
     }
     }
     for (ci = 0; ci < _format->get_num_vectors(); ci++) {
     for (ci = 0; ci < _format->get_num_vectors(); ci++) {
       qpGeomVertexRewriter data(new_data, _format->get_vector(ci));
       qpGeomVertexRewriter data(new_data, _format->get_vector(ci));
-      qpGeomVertexReader blendi(this, InternalName::get_transform_blend());
-
-      if (!blendi.has_column()) {
-        gobj_cat.warning()
-          << "Vertex data " << get_name()
-          << " has a transform_blend_table, but no transform_blend data.\n";
-        return;
-      }
+      blendi.set_row(0);
       
       
       for (int i = 0; i < num_rows; i++) {
       for (int i = 0; i < num_rows; i++) {
         LVector3f vertex = data.get_data3f();
         LVector3f vertex = data.get_data3f();

+ 3 - 2
panda/src/gobj/qpgeomVertexData.h

@@ -81,6 +81,8 @@ PUBLISHED:
                    const qpGeomVertexFormat *format, 
                    const qpGeomVertexFormat *format, 
                    UsageHint usage_hint);
                    UsageHint usage_hint);
   qpGeomVertexData(const qpGeomVertexData &copy);
   qpGeomVertexData(const qpGeomVertexData &copy);
+  qpGeomVertexData(const qpGeomVertexData &copy,
+                   const qpGeomVertexFormat *format);
   void operator = (const qpGeomVertexData &copy);
   void operator = (const qpGeomVertexData &copy);
   virtual ~qpGeomVertexData();
   virtual ~qpGeomVertexData();
 
 
@@ -137,8 +139,7 @@ PUBLISHED:
 
 
   PT(qpGeomVertexData) 
   PT(qpGeomVertexData) 
     replace_column(const InternalName *name, int num_components,
     replace_column(const InternalName *name, int num_components,
-                   NumericType numeric_type, Contents contents,
-                   UsageHint usage_hint, bool keep_animation) const;
+                   NumericType numeric_type, Contents contents) const;
 
 
   void output(ostream &out) const;
   void output(ostream &out) const;
   void write(ostream &out, int indent_level = 0) const;
   void write(ostream &out, int indent_level = 0) const;

+ 44 - 11
panda/src/gobj/qpgeomVertexReader.I

@@ -239,7 +239,7 @@ INLINE void qpGeomVertexReader::
 set_row(int row) {
 set_row(int row) {
   _start_row = row;
   _start_row = row;
   if (has_column()) {
   if (has_column()) {
-    set_pointer(_start_row);
+    quick_set_pointer(_start_row);
   }
   }
 }
 }
 
 
@@ -255,6 +255,17 @@ get_start_row() const {
   return _start_row;
   return _start_row;
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: qpGeomVertexReader::get_read_row
+//       Access: Published
+//  Description: Returns the row index from which the data will be
+//               retrieved by the next call to get_data*().
+////////////////////////////////////////////////////////////////////
+INLINE int qpGeomVertexReader::
+get_read_row() const {
+  return (int)(_pointer - _pointer_begin) / _stride;
+}
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: qpGeomVertexReader::is_at_end
 //     Function: qpGeomVertexReader::is_at_end
 //       Access: Published
 //       Access: Published
@@ -375,23 +386,45 @@ get_data4i() {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: qpGeomVertexReader::set_pointer
 //     Function: qpGeomVertexReader::set_pointer
 //       Access: Private
 //       Access: Private
-//  Description: Sets up the internal read pointer, etc. to read from
-//               the indicated row.
+//  Description: Sets up the array pointers freshly from the source
+//               object (in case they have been reallocated recently),
+//               and sets the internal pointer to the indicated row.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void qpGeomVertexReader::
 INLINE void qpGeomVertexReader::
 set_pointer(int row) {
 set_pointer(int row) {
-  nassertv(has_column());
   if (_vertex_data != (const qpGeomVertexData *)NULL) {
   if (_vertex_data != (const qpGeomVertexData *)NULL) {
     const qpGeomVertexArrayData *array_data = _vertex_data->get_array(_array);
     const qpGeomVertexArrayData *array_data = _vertex_data->get_array(_array);
-    _pointer = array_data->get_data();
-    _pointer_end = _pointer + array_data->get_data_size_bytes();
-    _pointer += _packer->_column->get_start() + _stride * row;
+    _pointer_begin = array_data->get_data();
+    _pointer_end = _pointer_begin + array_data->get_data_size_bytes();
 
 
   } else {
   } else {
-    _pointer = _array_data->get_data();
-    _pointer_end = _pointer + _array_data->get_data_size_bytes();
-    _pointer += _packer->_column->get_start() + _stride * row;
+    _pointer_begin = _array_data->get_data();
+    _pointer_end = _pointer_begin + _array_data->get_data_size_bytes();
   }
   }
+  quick_set_pointer(row);
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: qpGeomVertexReader::quick_set_pointer
+//       Access: Private
+//  Description: Sets up the internal pointer to the indicated row,
+//               without first verifying that arrays haven't been
+//               reallocated.
+////////////////////////////////////////////////////////////////////
+INLINE void qpGeomVertexReader::
+quick_set_pointer(int row) {
+  nassertv(has_column());
+
+#ifdef _DEBUG
+  if (_vertex_data != (const qpGeomVertexData *)NULL) {
+    const qpGeomVertexArrayData *array_data = _vertex_data->get_array(_array);
+    nassertv(_pointer_begin == array_data->get_data());
+  } else {
+    nassertv(_pointer_begin == _array_data->get_data());
+  }
+#endif
+
+  _pointer = _pointer_begin + _packer->_column->get_start() + _stride * row;
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -402,7 +435,7 @@ set_pointer(int row) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE const unsigned char *qpGeomVertexReader::
 INLINE const unsigned char *qpGeomVertexReader::
 inc_pointer() {
 inc_pointer() {
-#ifndef NDEBUG
+#ifdef _DEBUG
   nassertr(_pointer < _pointer_end, empty_buffer);
   nassertr(_pointer < _pointer_end, empty_buffer);
   if (_vertex_data != (const qpGeomVertexData *)NULL){ 
   if (_vertex_data != (const qpGeomVertexData *)NULL){ 
     const qpGeomVertexArrayData *array_data = _vertex_data->get_array(_array);
     const qpGeomVertexArrayData *array_data = _vertex_data->get_array(_array);

+ 2 - 1
panda/src/gobj/qpgeomVertexReader.cxx

@@ -86,7 +86,8 @@ void qpGeomVertexReader::
 initialize() {
 initialize() {
   _array = 0;
   _array = 0;
   _packer = NULL;
   _packer = NULL;
-  _pointer = NULL;
+  _pointer_begin = NULL;
   _pointer_end = NULL;
   _pointer_end = NULL;
+  _pointer = NULL;
   _start_row = 0;
   _start_row = 0;
 }
 }

+ 4 - 1
panda/src/gobj/qpgeomVertexReader.h

@@ -86,6 +86,7 @@ PUBLISHED:
   INLINE void set_row(int row);
   INLINE void set_row(int row);
 
 
   INLINE int get_start_row() const;
   INLINE int get_start_row() const;
+  INLINE int get_read_row() const;
   INLINE bool is_at_end() const;
   INLINE bool is_at_end() const;
 
 
   INLINE float get_data1f();
   INLINE float get_data1f();
@@ -102,6 +103,7 @@ private:
   void initialize();
   void initialize();
 
 
   INLINE void set_pointer(int row);
   INLINE void set_pointer(int row);
+  INLINE void quick_set_pointer(int row);
   INLINE const unsigned char *inc_pointer();
   INLINE const unsigned char *inc_pointer();
 
 
   // It is important that we only store *one* of the following two
   // It is important that we only store *one* of the following two
@@ -116,8 +118,9 @@ private:
   qpGeomVertexColumn::Packer *_packer;
   qpGeomVertexColumn::Packer *_packer;
   int _stride;
   int _stride;
 
 
-  const unsigned char *_pointer;
+  const unsigned char *_pointer_begin;
   const unsigned char *_pointer_end;
   const unsigned char *_pointer_end;
+  const unsigned char *_pointer;
 
 
   int _start_row;
   int _start_row;
 
 

+ 50 - 17
panda/src/gobj/qpgeomVertexWriter.I

@@ -238,7 +238,7 @@ INLINE void qpGeomVertexWriter::
 set_row(int row) {
 set_row(int row) {
   _start_row = row;
   _start_row = row;
   if (has_column()) {
   if (has_column()) {
-    set_pointer(_start_row);
+    quick_set_pointer(_start_row);
   }
   }
 }
 }
 
 
@@ -254,6 +254,18 @@ get_start_row() const {
   return _start_row;
   return _start_row;
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: qpGeomVertexWriter::get_write_row
+//       Access: Published
+//  Description: Returns the row index to which the data will be
+//               written at the next call to set_data*() or
+//               add_data*().
+////////////////////////////////////////////////////////////////////
+INLINE int qpGeomVertexWriter::
+get_write_row() const {
+  return (int)(_pointer - _pointer_begin) / _stride;
+}
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: qpGeomVertexWriter::is_at_end
 //     Function: qpGeomVertexWriter::is_at_end
 //       Access: Published
 //       Access: Published
@@ -679,24 +691,45 @@ add_data4i(const int data[4]) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: qpGeomVertexWriter::set_pointer
 //     Function: qpGeomVertexWriter::set_pointer
 //       Access: Private
 //       Access: Private
-//  Description: Sets up the internal write pointer, etc. to use the
-//               indicated row.
+//  Description: Sets up the array pointers freshly from the source
+//               object (in case they have been reallocated recently),
+//               and sets the internal pointer to the indicated row.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE void qpGeomVertexWriter::
 INLINE void qpGeomVertexWriter::
 set_pointer(int row) {
 set_pointer(int row) {
-  nassertv(has_column());
-  if (_vertex_data != (qpGeomVertexData *)NULL) {
+  if (_vertex_data != (const qpGeomVertexData *)NULL) {
     qpGeomVertexArrayData *array_data = _vertex_data->modify_array(_array);
     qpGeomVertexArrayData *array_data = _vertex_data->modify_array(_array);
-    _pointer = array_data->modify_data();
-    _pointer_end = _pointer + array_data->get_data_size_bytes();
-    _pointer += _packer->_column->get_start() + _stride * row;
+    _pointer_begin = array_data->modify_data();
+    _pointer_end = _pointer_begin + array_data->get_data_size_bytes();
 
 
   } else {
   } else {
-    _pointer = _array_data->modify_data();
-    _pointer_end = _pointer + _array_data->get_data_size_bytes();
-    _pointer += _packer->_column->get_start() + _stride * row;
+    _pointer_begin = _array_data->modify_data();
+    _pointer_end = _pointer_begin + _array_data->get_data_size_bytes();
   }
   }
-  _write_row = row;
+  quick_set_pointer(row);
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: qpGeomVertexWriter::quick_set_pointer
+//       Access: Private
+//  Description: Sets up the internal pointer to the indicated row,
+//               without first verifying that arrays haven't been
+//               reallocated.
+////////////////////////////////////////////////////////////////////
+INLINE void qpGeomVertexWriter::
+quick_set_pointer(int row) {
+  nassertv(has_column());
+
+#ifdef _DEBUG
+  if (_vertex_data != (const qpGeomVertexData *)NULL) {
+    const qpGeomVertexArrayData *array_data = _vertex_data->get_array(_array);
+    nassertv(_pointer_begin == array_data->get_data());
+  } else {
+    nassertv(_pointer_begin == _array_data->get_data());
+  }
+#endif
+
+  _pointer = _pointer_begin + _packer->_column->get_start() + _stride * row;
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -707,7 +740,7 @@ set_pointer(int row) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE unsigned char *qpGeomVertexWriter::
 INLINE unsigned char *qpGeomVertexWriter::
 inc_pointer() {
 inc_pointer() {
-#ifndef NDEBUG
+#ifdef _DEBUG
   nassertr(_pointer < _pointer_end, empty_buffer);
   nassertr(_pointer < _pointer_end, empty_buffer);
   if (_vertex_data != (qpGeomVertexData *)NULL){ 
   if (_vertex_data != (qpGeomVertexData *)NULL){ 
     const qpGeomVertexArrayData *array_data = _vertex_data->get_array(_array);
     const qpGeomVertexArrayData *array_data = _vertex_data->get_array(_array);
@@ -719,7 +752,6 @@ inc_pointer() {
 
 
   unsigned char *orig_pointer = _pointer;
   unsigned char *orig_pointer = _pointer;
   _pointer += _stride;
   _pointer += _stride;
-  ++_write_row;
   return orig_pointer;
   return orig_pointer;
 }
 }
 
 
@@ -735,12 +767,13 @@ INLINE unsigned char *qpGeomVertexWriter::
 inc_add_pointer() {
 inc_add_pointer() {
   if (_pointer >= _pointer_end) {
   if (_pointer >= _pointer_end) {
     // Reset the data pointer.
     // Reset the data pointer.
+    int write_row = get_write_row();
     if (_vertex_data != (qpGeomVertexData *)NULL) {
     if (_vertex_data != (qpGeomVertexData *)NULL) {
-      _vertex_data->set_num_rows(max(_write_row + 1, _vertex_data->get_num_rows()));
+      _vertex_data->set_num_rows(max(write_row + 1, _vertex_data->get_num_rows()));
     } else {
     } else {
-      _array_data->set_num_rows(max(_write_row + 1, _array_data->get_num_rows()));
+      _array_data->set_num_rows(max(write_row + 1, _array_data->get_num_rows()));
     }
     }
-    set_pointer(_write_row);
+    set_pointer(write_row);
   }
   }
   return inc_pointer();
   return inc_pointer();
 }
 }

+ 2 - 2
panda/src/gobj/qpgeomVertexWriter.cxx

@@ -86,8 +86,8 @@ void qpGeomVertexWriter::
 initialize() {
 initialize() {
   _array = 0;
   _array = 0;
   _packer = NULL;
   _packer = NULL;
-  _pointer = NULL;
+  _pointer_begin = NULL;
   _pointer_end = NULL;
   _pointer_end = NULL;
+  _pointer = NULL;
   _start_row = 0;
   _start_row = 0;
-  _write_row = 0;
 }
 }

+ 4 - 2
panda/src/gobj/qpgeomVertexWriter.h

@@ -99,6 +99,7 @@ PUBLISHED:
   INLINE void set_row(int row);
   INLINE void set_row(int row);
 
 
   INLINE int get_start_row() const;
   INLINE int get_start_row() const;
+  INLINE int get_write_row() const;
   INLINE bool is_at_end() const;
   INLINE bool is_at_end() const;
 
 
   INLINE void set_data1f(float data);
   INLINE void set_data1f(float data);
@@ -139,6 +140,7 @@ private:
   void initialize();
   void initialize();
 
 
   INLINE void set_pointer(int row);
   INLINE void set_pointer(int row);
+  INLINE void quick_set_pointer(int row);
   INLINE unsigned char *inc_pointer();
   INLINE unsigned char *inc_pointer();
   INLINE unsigned char *inc_add_pointer();
   INLINE unsigned char *inc_add_pointer();
 
 
@@ -154,11 +156,11 @@ private:
   qpGeomVertexColumn::Packer *_packer;
   qpGeomVertexColumn::Packer *_packer;
   int _stride;
   int _stride;
 
 
-  unsigned char *_pointer;
+  unsigned char *_pointer_begin;
   unsigned char *_pointer_end;
   unsigned char *_pointer_end;
+  unsigned char *_pointer;
 
 
   int _start_row;
   int _start_row;
-  int _write_row;
 
 
 #ifndef NDEBUG
 #ifndef NDEBUG
   // This is defined just for the benefit of having something non-NULL
   // This is defined just for the benefit of having something non-NULL

+ 2 - 2
panda/src/grutil/multitexReducer.cxx

@@ -812,6 +812,7 @@ transfer_geom(GeomNode *geom_node, const InternalName *texcoord_name,
     if (orig_geom->is_of_type(qpGeom::get_class_type())) {
     if (orig_geom->is_of_type(qpGeom::get_class_type())) {
       PT(qpGeom) geom = new qpGeom(*DCAST(qpGeom, orig_geom));
       PT(qpGeom) geom = new qpGeom(*DCAST(qpGeom, orig_geom));
       PT(qpGeomVertexData) vdata = geom->modify_vertex_data();
       PT(qpGeomVertexData) vdata = geom->modify_vertex_data();
+      vdata->set_usage_hint(qpGeom::UH_stream);
 
 
       if (vdata->has_column(_target_stage->get_texcoord_name())) {
       if (vdata->has_column(_target_stage->get_texcoord_name())) {
         qpGeomVertexWriter vertex(vdata, InternalName::get_vertex());
         qpGeomVertexWriter vertex(vdata, InternalName::get_vertex());
@@ -831,8 +832,7 @@ transfer_geom(GeomNode *geom_node, const InternalName *texcoord_name,
           vdata->get_format()->get_column(texcoord_name);
           vdata->get_format()->get_column(texcoord_name);
         vdata = vdata->replace_column
         vdata = vdata->replace_column
           (InternalName::get_texcoord(), column->get_num_components(),
           (InternalName::get_texcoord(), column->get_num_components(),
-           column->get_numeric_type(), column->get_contents(),
-           qpGeom::UH_stream, true);
+           column->get_numeric_type(), column->get_contents());
         geom->set_vertex_data(vdata);
         geom->set_vertex_data(vdata);
 
 
         qpGeomVertexReader from(vdata, texcoord_name);
         qpGeomVertexReader from(vdata, texcoord_name);

+ 0 - 26
panda/src/pgraph/geomTransformer.I

@@ -17,32 +17,6 @@
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 
 
 
 
-////////////////////////////////////////////////////////////////////
-//     Function: GeomTransformer::set_usage_hint
-//       Access: Published
-//  Description: Specifies the ceiling UsageHint that will be applied
-//               to transformed geometry.  If the source geometry's
-//               usage hint is greater (more static) than this, it
-//               will be reduced to this level.  If the source
-//               geometry's usage hit is less (more dynamic) than
-//               this, it will be preserved at its current level.
-////////////////////////////////////////////////////////////////////
-INLINE void GeomTransformer::
-set_usage_hint(qpGeom::UsageHint usage_hint) {
-  _usage_hint = usage_hint;
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: GeomTransformer::get_usage_hint
-//       Access: Published
-//  Description: Returns the UsageHint that will be applied to
-//               generated geometry.  See set_usage_hint().
-////////////////////////////////////////////////////////////////////
-INLINE qpGeom::UsageHint GeomTransformer::
-get_usage_hint() const {
-  return _usage_hint;
-}
-
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: GeomTransformer::get_max_collect_vertices
 //     Function: GeomTransformer::get_max_collect_vertices
 //       Access: Public
 //       Access: Public

+ 1 - 5
panda/src/pgraph/geomTransformer.cxx

@@ -33,7 +33,6 @@
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 GeomTransformer::
 GeomTransformer::
 GeomTransformer() :
 GeomTransformer() :
-  _usage_hint(qpGeom::UH_static),
   // The default value here comes from the Config file.
   // The default value here comes from the Config file.
   _max_collect_vertices(max_collect_vertices)
   _max_collect_vertices(max_collect_vertices)
 {
 {
@@ -46,7 +45,6 @@ GeomTransformer() :
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 GeomTransformer::
 GeomTransformer::
 GeomTransformer(const GeomTransformer &copy) :
 GeomTransformer(const GeomTransformer &copy) :
-  _usage_hint(copy._usage_hint),
   _max_collect_vertices(copy._max_collect_vertices)
   _max_collect_vertices(copy._max_collect_vertices)
 {
 {
 }
 }
@@ -239,9 +237,7 @@ transform_texcoords(Geom *geom, const InternalName *from_name,
         new_data = st._vertex_data->replace_column
         new_data = st._vertex_data->replace_column
           (to_name, old_column->get_num_components(),
           (to_name, old_column->get_num_components(),
            old_column->get_numeric_type(),
            old_column->get_numeric_type(),
-           old_column->get_contents(), 
-           min(_usage_hint, st._vertex_data->get_usage_hint()),
-           false);
+           old_column->get_contents());
       }
       }
 
 
       CPT(qpGeomVertexFormat) format = new_data->get_format();
       CPT(qpGeomVertexFormat) format = new_data->get_format();

+ 0 - 4
panda/src/pgraph/geomTransformer.h

@@ -51,9 +51,6 @@ public:
   GeomTransformer(const GeomTransformer &copy);
   GeomTransformer(const GeomTransformer &copy);
   ~GeomTransformer();
   ~GeomTransformer();
 
 
-  INLINE void set_usage_hint(qpGeom::UsageHint usage_hint);
-  INLINE qpGeom::UsageHint get_usage_hint() const;
-
   INLINE int get_max_collect_vertices() const;
   INLINE int get_max_collect_vertices() const;
   INLINE void set_max_collect_vertices(int max_collect_vertices);
   INLINE void set_max_collect_vertices(int max_collect_vertices);
 
 
@@ -79,7 +76,6 @@ public:
   int collect_vertex_data(GeomNode *node, int collect_bits);
   int collect_vertex_data(GeomNode *node, int collect_bits);
 
 
 private:
 private:
-  qpGeom::UsageHint _usage_hint;
   int _max_collect_vertices;
   int _max_collect_vertices;
 
 
   class qpSourceVertices {
   class qpSourceVertices {

+ 0 - 26
panda/src/pgraph/sceneGraphReducer.I

@@ -37,32 +37,6 @@ INLINE SceneGraphReducer::
 ~SceneGraphReducer() {
 ~SceneGraphReducer() {
 }
 }
 
 
-////////////////////////////////////////////////////////////////////
-//     Function: SceneGraphReducer::set_usage_hint
-//       Access: Published
-//  Description: Specifies the ceiling UsageHint that will be applied
-//               to transformed geometry.  If the source geometry's
-//               usage hint is greater (more static) than this, it
-//               will be reduced to this level.  If the source
-//               geometry's usage hit is less (more dynamic) than
-//               this, it will be preserved at its current level.
-////////////////////////////////////////////////////////////////////
-INLINE void SceneGraphReducer::
-set_usage_hint(qpGeom::UsageHint usage_hint) {
-  _transformer.set_usage_hint(usage_hint);
-}
-
-////////////////////////////////////////////////////////////////////
-//     Function: SceneGraphReducer::get_usage_hint
-//       Access: Published
-//  Description: Returns the UsageHint that will be applied to
-//               generated geometry.  See set_usage_hint().
-////////////////////////////////////////////////////////////////////
-INLINE qpGeom::UsageHint SceneGraphReducer::
-get_usage_hint() const {
-  return _transformer.get_usage_hint();
-}
-
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: SceneGraphReducer::set_combine_radius
 //     Function: SceneGraphReducer::set_combine_radius
 //       Access: Published
 //       Access: Published

+ 0 - 3
panda/src/pgraph/sceneGraphReducer.h

@@ -104,9 +104,6 @@ PUBLISHED:
     MN_avoid_dynamic   = 0x004,
     MN_avoid_dynamic   = 0x004,
   };
   };
 
 
-  INLINE void set_usage_hint(qpGeom::UsageHint usage_hint);
-  INLINE qpGeom::UsageHint get_usage_hint() const;
-
   INLINE void set_combine_radius(float combine_radius);
   INLINE void set_combine_radius(float combine_radius);
   INLINE float get_combine_radius() const;
   INLINE float get_combine_radius() const;