Merge branch 'release/1.9.x'

This commit is contained in:
rdb 2016-07-09 15:39:07 +02:00
commit 85386049f0
4 changed files with 49 additions and 16 deletions

View File

@ -17,6 +17,10 @@ This issue fixes several bugs that were still found in 1.9.2.
* Improve performance of texture load and store operations * Improve performance of texture load and store operations
* Fix crashes with pbuffers on Intel cards on Windows * Fix crashes with pbuffers on Intel cards on Windows
* Support for Autodesk Maya 2016.5 * Support for Autodesk Maya 2016.5
* Add shadow-depth-bits config var to control shadow map depth
* Fix cull issue when rendering cube map (or any multi-lens setup)
* Fix crash rendering with the same camera to different contexts
* Fix compile error when making static build with DX9 renderer
------------------------ RELEASE 1.9.2 ------------------------ ------------------------ RELEASE 1.9.2 ------------------------

View File

@ -118,6 +118,23 @@ PStatCollector GraphicsEngine::_occlusion_passed_pcollector("Occlusion results:V
PStatCollector GraphicsEngine::_occlusion_failed_pcollector("Occlusion results:Occluded"); PStatCollector GraphicsEngine::_occlusion_failed_pcollector("Occlusion results:Occluded");
PStatCollector GraphicsEngine::_occlusion_tests_pcollector("Occlusion tests"); PStatCollector GraphicsEngine::_occlusion_tests_pcollector("Occlusion tests");
// This is used to keep track of which scenes we have already culled.
struct CullKey {
GraphicsStateGuardian *_gsg;
NodePath _camera;
int _lens_index;
};
INLINE static bool operator < (const CullKey &a, const CullKey &b) {
if (a._gsg != b._gsg) {
return a._gsg < b._gsg;
}
if (a._camera != b._camera) {
return a._camera < b._camera;
}
return a._lens_index < b._lens_index;
}
/** /**
* Creates a new GraphicsEngine object. The Pipeline is normally left to * Creates a new GraphicsEngine object. The Pipeline is normally left to
* default to NULL, which indicates the global render pipeline, but it may be * default to NULL, which indicates the global render pipeline, but it may be
@ -1375,7 +1392,6 @@ cull_to_bins(const GraphicsEngine::Windows &wlist, Thread *current_thread) {
// Keep track of the cameras we have already used in this thread to render // Keep track of the cameras we have already used in this thread to render
// DisplayRegions. // DisplayRegions.
typedef pair<NodePath, int> CullKey;
typedef pmap<CullKey, DisplayRegion *> AlreadyCulled; typedef pmap<CullKey, DisplayRegion *> AlreadyCulled;
AlreadyCulled already_culled; AlreadyCulled already_culled;
@ -1390,10 +1406,13 @@ cull_to_bins(const GraphicsEngine::Windows &wlist, Thread *current_thread) {
if (dr != (DisplayRegion *)NULL) { if (dr != (DisplayRegion *)NULL) {
DisplayRegionPipelineReader *dr_reader = DisplayRegionPipelineReader *dr_reader =
new DisplayRegionPipelineReader(dr, current_thread); new DisplayRegionPipelineReader(dr, current_thread);
NodePath camera = dr_reader->get_camera();
int lens_index = dr_reader->get_lens_index();
AlreadyCulled::iterator aci = already_culled.insert(AlreadyCulled::value_type(CullKey(camera, lens_index), (DisplayRegion *)NULL)).first; CullKey key;
key._gsg = win->get_gsg();
key._camera = dr_reader->get_camera();
key._lens_index = dr_reader->get_lens_index();
AlreadyCulled::iterator aci = already_culled.insert(AlreadyCulled::value_type(key, (DisplayRegion *)NULL)).first;
if ((*aci).second == NULL) { if ((*aci).second == NULL) {
// We have not used this camera already in this thread. Perform // We have not used this camera already in this thread. Perform
// the cull operation. // the cull operation.

View File

@ -188,6 +188,19 @@ get_upon_death() {
*/ */
void PythonTask:: void PythonTask::
set_owner(PyObject *owner) { set_owner(PyObject *owner) {
#ifndef NDEBUG
if (owner != Py_None) {
PyObject *add = PyObject_GetAttrString(owner, "_addTask");
PyObject *clear = PyObject_GetAttrString(owner, "_clearTask");
if (add == NULL || !PyCallable_Check(add) ||
clear == NULL || !PyCallable_Check(clear)) {
Dtool_Raise_TypeError("owner object should have _addTask and _clearTask methods");
return;
}
}
#endif
if (_owner != NULL && _owner != Py_None && _state != S_inactive) { if (_owner != NULL && _owner != Py_None && _state != S_inactive) {
unregister_from_owner(); unregister_from_owner();
} }
@ -494,10 +507,16 @@ do_python_task() {
ostringstream strm; ostringstream strm;
#if PY_MAJOR_VERSION >= 3 #if PY_MAJOR_VERSION >= 3
PyObject *str = PyObject_ASCII(result); PyObject *str = PyObject_ASCII(result);
if (str == NULL) {
str = PyUnicode_FromString("<repr error>");
}
strm strm
<< *this << " returned " << PyUnicode_AsUTF8(str); << *this << " returned " << PyUnicode_AsUTF8(str);
#else #else
PyObject *str = PyObject_Repr(result); PyObject *str = PyObject_Repr(result);
if (str == NULL) {
str = PyString_FromString("<repr error>");
}
strm strm
<< *this << " returned " << PyString_AsString(str); << *this << " returned " << PyString_AsString(str);
#endif #endif
@ -606,18 +625,9 @@ call_owner_method(const char *method_name) {
if (_owner != Py_None) { if (_owner != Py_None) {
PyObject *func = PyObject_GetAttrString(_owner, (char *)method_name); PyObject *func = PyObject_GetAttrString(_owner, (char *)method_name);
if (func == (PyObject *)NULL) { if (func == (PyObject *)NULL) {
#if PY_MAJOR_VERSION >= 3
PyObject *str = PyObject_ASCII(_owner);
task_cat.error() task_cat.error()
<< "Owner object " << PyUnicode_AsUTF8(str) << " added to " << "Owner object added to " << *this << " has no method "
<< *this << " has no method " << method_name << "().\n"; << method_name << "().\n";
#else
PyObject *str = PyObject_Repr(_owner);
task_cat.error()
<< "Owner object " << PyString_AsString(str) << " added to "
<< *this << " has no method " << method_name << "().\n";
#endif
Py_DECREF(str);
} else { } else {
call_function(func); call_function(func);

View File

@ -94,7 +94,7 @@ open_framework(int &argc, char **&argv) {
extern EXPCL_PANDAGL void init_libpandagl(); extern EXPCL_PANDAGL void init_libpandagl();
init_libpandagl(); init_libpandagl();
#elif defined(HAVE_DX9) #elif defined(HAVE_DX9)
extern EXPCL_PANDADX9 void init_libpandadx9(); extern EXPCL_PANDADX void init_libpandadx9();
init_libpandadx9(); init_libpandadx9();
#elif defined(HAVE_TINYDISPLAY) #elif defined(HAVE_TINYDISPLAY)
extern EXPCL_TINYDISPLAY void init_libtinydisplay(); extern EXPCL_TINYDISPLAY void init_libtinydisplay();