From 5980b0b9abb77c7a2a5b4709de0255fb6db03a48 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 5 Jan 2018 13:37:00 +0100 Subject: [PATCH 01/11] openal: fix warning spam every frame in newer AL implementations This fixes error messages being generated of the form: AL lib: (WW) alSetError: Error generated on context 0x801cf8800, code 0xa003 This is caused by alSourceUnqueueBuffers being called without first checking whether processed buffers are available using alGetSourcei. Fixes #180 --- panda/src/audiotraits/openalAudioSound.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/panda/src/audiotraits/openalAudioSound.cxx b/panda/src/audiotraits/openalAudioSound.cxx index da379bfd5c..9abaf24036 100644 --- a/panda/src/audiotraits/openalAudioSound.cxx +++ b/panda/src/audiotraits/openalAudioSound.cxx @@ -435,7 +435,11 @@ pull_used_buffers() { ReMutexHolder holder(OpenALAudioManager::_lock); while (_stream_queued.size()) { ALuint buffer = 0; - alGetError(); + ALint num_buffers = 0; + alGetSourcei(_source, AL_BUFFERS_PROCESSED, &num_buffers); + if (num_buffers <= 0) { + break; + } alSourceUnqueueBuffers(_source, 1, &buffer); int err = alGetError(); if (err == AL_NO_ERROR) { From 47c7ff42cc768ef0df108fae9d24298b9107095a Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 5 Jan 2018 14:15:22 +0100 Subject: [PATCH 02/11] CommonFilters: better handle failure condition when shaders not supported --- direct/src/filter/CommonFilters.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/direct/src/filter/CommonFilters.py b/direct/src/filter/CommonFilters.py index 493f2d9794..894b57c321 100644 --- a/direct/src/filter/CommonFilters.py +++ b/direct/src/filter/CommonFilters.py @@ -131,6 +131,9 @@ class CommonFilters: if (len(configuration) == 0): return + if not self.manager.win.gsg.getSupportsBasicShaders(): + return False + auxbits = 0 needtex = set(["color"]) needtexcoord = set(["color"]) @@ -338,7 +341,10 @@ class CommonFilters: text += " o_color = float4(1, 1, 1, 1) - o_color;\n" text += "}\n" - self.finalQuad.setShader(Shader.make(text, Shader.SL_Cg)) + shader = Shader.make(text, Shader.SL_Cg) + if not shader: + return False + self.finalQuad.setShader(shader) for tex in self.textures: self.finalQuad.setShaderInput("tx"+tex, self.textures[tex]) From 428c5cbbf3d4dab1a2aec69bfaa9594a237f6450 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 5 Jan 2018 14:34:03 +0100 Subject: [PATCH 03/11] gles2gsg: fix compilation error with OpenGL ES 2 --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index ec9d1d603f..af84e2bafd 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -7585,7 +7585,7 @@ make_shadow_buffer(LightLensNode *light, Texture *tex, GraphicsOutput *host) { flags |= GraphicsPipe::BF_size_square; } - CLP(GraphicsBuffer) *sbuffer = new GLGraphicsBuffer(get_engine(), get_pipe(), light->get_name(), fbp, props, flags, this, host); + CLP(GraphicsBuffer) *sbuffer = new CLP(GraphicsBuffer)(get_engine(), get_pipe(), light->get_name(), fbp, props, flags, this, host); sbuffer->add_render_texture(tex, GraphicsOutput::RTM_bind_or_copy, GraphicsOutput::RTP_depth); get_engine()->add_window(sbuffer, light->get_shadow_buffer_sort()); return sbuffer; From c1679472cd338b147ed2c11043be08e7cffafb19 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 5 Jan 2018 14:39:39 +0100 Subject: [PATCH 04/11] actor: change parent of exposed joint to character This prevents exposed joints from not being affected by a transform directly on the Character node. See panda3d/panda3d#221 for more details. Fixes #221 --- direct/src/actor/Actor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/direct/src/actor/Actor.py b/direct/src/actor/Actor.py index 8a7ef093b0..b9ba299aaa 100644 --- a/direct/src/actor/Actor.py +++ b/direct/src/actor/Actor.py @@ -1103,8 +1103,8 @@ class Actor(DirectObject, NodePath): # Get a handle to the joint. joint = bundle.findChild(jointName) - if node == None: - node = self.attachNewNode(jointName) + if node is None: + node = partDef.partBundleNP.attachNewNode(jointName) if (joint): if localTransform: From 27fb1a4a9e5a0b7e216c037cebed5aa6b3a3afef Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 5 Jan 2018 15:00:21 +0100 Subject: [PATCH 05/11] showbase: fix aspect ratio calculation backs out part of 7a46b2ca60aacc1b8f1c87a7a101546bd6214120, from PR #204 --- direct/src/showbase/ShowBase.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/direct/src/showbase/ShowBase.py b/direct/src/showbase/ShowBase.py index af14d94de6..26685a0693 100644 --- a/direct/src/showbase/ShowBase.py +++ b/direct/src/showbase/ShowBase.py @@ -1267,8 +1267,7 @@ class ShowBase(DirectObject.DirectObject): if win == None: win = self.win - if win != None and win.getSideBySideStereo() and \ - win.hasSize() and win.getSbsLeftYSize() != 0: + if win != None and win.hasSize() and win.getSbsLeftYSize() != 0: aspectRatio = float(win.getSbsLeftXSize()) / float(win.getSbsLeftYSize()) else: if win == None or not hasattr(win, "getRequestedProperties"): From 42f8978236147d8743a6a75190e465fa6b1f862c Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 3 Jan 2018 14:29:03 +0100 Subject: [PATCH 06/11] pgraph: sort "off" texture stages when loading from .bam This fixes an issue where states loaded from .bam file containing more than one "off" texture stage would not compose properly. Fixes #179 --- panda/src/pgraph/textureAttrib.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/panda/src/pgraph/textureAttrib.cxx b/panda/src/pgraph/textureAttrib.cxx index bb7a4808e5..8bc4ed3604 100644 --- a/panda/src/pgraph/textureAttrib.cxx +++ b/panda/src/pgraph/textureAttrib.cxx @@ -911,6 +911,7 @@ complete_pointers(TypedWritable **p_list, BamReader *manager) { } } _on_stages.sort(); + _off_stages.sort(); _sort_seq = UpdateSeq::old(); _filtered_seq = UpdateSeq::old(); From a1b5c6faa2f0183679275ba4ff3acc3926aeb47a Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 26 Nov 2017 23:36:50 +0100 Subject: [PATCH 07/11] makepanda: look for vorbis library without _static suffix Fixes: #202 --- makepanda/makepanda.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 291bfc2cb4..d37daf7068 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -651,9 +651,11 @@ if (COMPILER == "MSVC"): DefSymbol("WX", "_UNICODE", "") DefSymbol("WX", "UNICODE", "") if (PkgSkip("VORBIS")==0): - LibName("VORBIS", GetThirdpartyDir() + "vorbis/lib/libogg_static.lib") - LibName("VORBIS", GetThirdpartyDir() + "vorbis/lib/libvorbis_static.lib") - LibName("VORBIS", GetThirdpartyDir() + "vorbis/lib/libvorbisfile_static.lib") + for lib in ('ogg', 'vorbis', 'vorbisfile'): + path = GetThirdpartyDir() + "vorbis/lib/lib{0}_static.lib".format(lib) + if not os.path.isfile(path): + path = GetThirdpartyDir() + "vorbis/lib/{0}.lib".format(lib) + LibName("VORBIS", path) for pkg in MAYAVERSIONS: if (PkgSkip(pkg)==0): LibName(pkg, '"' + SDK[pkg] + '/lib/Foundation.lib"') From eaf3983c0641c7cace9e941abe12f5142478971d Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 5 Jan 2018 15:40:59 +0100 Subject: [PATCH 08/11] ode: fix trimeshes in double-precision ODE builds Fixes #174 --- panda/src/ode/odeTriMeshData.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/panda/src/ode/odeTriMeshData.cxx b/panda/src/ode/odeTriMeshData.cxx index c78d09fc6d..104ba6daf2 100644 --- a/panda/src/ode/odeTriMeshData.cxx +++ b/panda/src/ode/odeTriMeshData.cxx @@ -103,6 +103,7 @@ OdeTriMeshData(const NodePath& model, bool use_normals) : write_faces(odetrimeshdata_cat.debug()); +#ifdef dSINGLE if (!use_normals) { build_single(_vertices, sizeof(StridedVertex), _num_vertices, _faces, _num_faces * 3, sizeof(StridedTri)); @@ -111,6 +112,16 @@ OdeTriMeshData(const NodePath& model, bool use_normals) : _faces, _num_faces * 3, sizeof(StridedTri), _normals); } +#else + if (!use_normals) { + build_double(_vertices, sizeof(StridedVertex), _num_vertices, + _faces, _num_faces * 3, sizeof(StridedTri)); + } else { + build_double1(_vertices, sizeof(StridedVertex), _num_vertices, + _faces, _num_faces * 3, sizeof(StridedTri), + _normals); + } +#endif preprocess(); } From 5d9a5dbde18ac563d7da8e9b71f0925fcb83db96 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 5 Jan 2018 16:11:35 +0100 Subject: [PATCH 09/11] travis: add fakeroot package --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index c8ca00ff11..ba9f3d059a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,4 +26,5 @@ addons: - python-dev - python3-dev - zlib1g-dev + - fakeroot script: $PYTHONV makepanda/makepanda.py --everything --git-commit $TRAVIS_COMMIT --installer --threads 4 From bdb53b8cb56b7251d61cfa19dbe3814dce412c72 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 5 Jan 2018 19:49:02 +0100 Subject: [PATCH 10/11] showbase: fixes for aspect-ratio adjustment of pixel2d(p) --- direct/src/showbase/ShowBase.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/direct/src/showbase/ShowBase.py b/direct/src/showbase/ShowBase.py index 26685a0693..580f2b6ce7 100644 --- a/direct/src/showbase/ShowBase.py +++ b/direct/src/showbase/ShowBase.py @@ -2732,9 +2732,10 @@ class ShowBase(DirectObject.DirectObject): # changed and update the camera lenses and aspect2d parameters self.adjustWindowAspectRatio(self.getAspectRatio()) - if win.getSideBySideStereo() and win.hasSize() and win.getSbsLeftYSize() != 0: + if win.hasSize() and win.getSbsLeftYSize() != 0: self.pixel2d.setScale(2.0 / win.getSbsLeftXSize(), 1.0, 2.0 / win.getSbsLeftYSize()) - self.pixel2dp.setScale(2.0 / win.getSbsLeftXSize(), 1.0, 2.0 / win.getSbsLeftYSize()) + if self.wantRender2dp: + self.pixel2dp.setScale(2.0 / win.getSbsLeftXSize(), 1.0, 2.0 / win.getSbsLeftYSize()) else: xsize, ysize = self.getSize() if xsize > 0 and ysize > 0: From b5e9f23e3b4cc73e953e91bf36976c9e1cc69fa8 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 7 Jan 2018 12:07:49 +0100 Subject: [PATCH 11/11] glesgsg: fix compile error on Arch Linux [skip ci] --- panda/src/glesgsg/glesgsg.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/panda/src/glesgsg/glesgsg.h b/panda/src/glesgsg/glesgsg.h index c0afb58b56..64d64db216 100644 --- a/panda/src/glesgsg/glesgsg.h +++ b/panda/src/glesgsg/glesgsg.h @@ -62,6 +62,9 @@ // #include #endif +// Some implementations (Arch Linux) set this in glext.h +typedef char GLchar; + #include "panda_esglext.h" // This helps to keep the source clean of hundreds of ifdefs.