From 1b8c4e00296ba9e71cacc176b8bc892751372448 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 22 Dec 2020 23:14:59 +0100 Subject: [PATCH 01/10] dtoolutil: Fix compile warning in ExecutionEnvironment --- dtool/src/dtoolutil/executionEnvironment.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dtool/src/dtoolutil/executionEnvironment.cxx b/dtool/src/dtoolutil/executionEnvironment.cxx index 96ae7fd147..603d3ea4f1 100644 --- a/dtool/src/dtoolutil/executionEnvironment.cxx +++ b/dtool/src/dtoolutil/executionEnvironment.cxx @@ -223,6 +223,8 @@ ns_has_environment_variable(const string &var) const { #ifndef PREREAD_ENVIRONMENT return getenv(var.c_str()) != nullptr; +#else + return false; #endif } From 05876317cf98a7f6960793fb0bf951afb406d67a Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 23 Dec 2020 17:33:59 +0100 Subject: [PATCH 02/10] Add TextureStage::M_emission mode This is similar to M_glow, except that the emission factor is in the RGB channels. --- panda/src/egg/eggTexture.cxx | 7 ++++++ panda/src/egg/eggTexture.h | 1 + panda/src/egg2pg/eggLoader.cxx | 4 ++++ panda/src/egg2pg/eggSaver.cxx | 3 +++ panda/src/gobj/textureStage.cxx | 3 +++ panda/src/gobj/textureStage.h | 2 ++ panda/src/pgraphnodes/shaderGenerator.cxx | 27 ++++++++++++++--------- panda/src/pgraphnodes/shaderGenerator.h | 1 + 8 files changed, 38 insertions(+), 10 deletions(-) diff --git a/panda/src/egg/eggTexture.cxx b/panda/src/egg/eggTexture.cxx index a4fb06b62e..899438276e 100644 --- a/panda/src/egg/eggTexture.cxx +++ b/panda/src/egg/eggTexture.cxx @@ -558,6 +558,7 @@ affects_polygon_alpha() const { case ET_gloss: case ET_height: case ET_normal_gloss: + case ET_emission: return false; case ET_selector: @@ -882,6 +883,9 @@ string_env_type(const string &string) { } else if (cmp_nocase_uh(string, "normal_gloss") == 0) { return ET_normal_gloss; + } else if (cmp_nocase_uh(string, "emission") == 0) { + return ET_emission; + } else { return ET_unspecified; } @@ -1312,6 +1316,9 @@ ostream &operator << (ostream &out, EggTexture::EnvType type) { case EggTexture::ET_normal_gloss: return out << "normal_gloss"; + + case EggTexture::ET_emission: + return out << "emission"; } nassertr(false, out); diff --git a/panda/src/egg/eggTexture.h b/panda/src/egg/eggTexture.h index ac15293140..5d602e26f8 100644 --- a/panda/src/egg/eggTexture.h +++ b/panda/src/egg/eggTexture.h @@ -107,6 +107,7 @@ PUBLISHED: ET_height, ET_selector, ET_normal_gloss, + ET_emission, }; enum CombineMode { CM_unspecified, diff --git a/panda/src/egg2pg/eggLoader.cxx b/panda/src/egg2pg/eggLoader.cxx index d456dd5b16..ac69a976a2 100644 --- a/panda/src/egg2pg/eggLoader.cxx +++ b/panda/src/egg2pg/eggLoader.cxx @@ -1540,6 +1540,10 @@ make_texture_stage(const EggTexture *egg_tex) { stage->set_mode(TextureStage::M_normal_gloss); break; + case EggTexture::ET_emission: + stage->set_mode(TextureStage::M_emission); + break; + case EggTexture::ET_unspecified: break; } diff --git a/panda/src/egg2pg/eggSaver.cxx b/panda/src/egg2pg/eggSaver.cxx index da4273d3a3..c9a38c3b7b 100644 --- a/panda/src/egg2pg/eggSaver.cxx +++ b/panda/src/egg2pg/eggSaver.cxx @@ -864,6 +864,9 @@ convert_primitive(const GeomVertexData *vertex_data, case TextureStage::M_normal_gloss: egg_tex->set_env_type(EggTexture::ET_normal_gloss); break; + case TextureStage::M_emission: + egg_tex->set_env_type(EggTexture::ET_emission); + break; default: break; } diff --git a/panda/src/gobj/textureStage.cxx b/panda/src/gobj/textureStage.cxx index 0d6202d949..26a00fc6c7 100644 --- a/panda/src/gobj/textureStage.cxx +++ b/panda/src/gobj/textureStage.cxx @@ -517,6 +517,9 @@ operator << (ostream &out, TextureStage::Mode mode) { case TextureStage::M_normal_gloss: return out << "normal_gloss"; + + case TextureStage::M_emission: + return out << "emission"; } return out << "**invalid Mode(" << (int)mode << ")**"; diff --git a/panda/src/gobj/textureStage.h b/panda/src/gobj/textureStage.h index 5635f1e65a..a1a9ccb6dd 100644 --- a/panda/src/gobj/textureStage.h +++ b/panda/src/gobj/textureStage.h @@ -63,6 +63,8 @@ PUBLISHED: M_height, // Rarely used: normal_height is more efficient. M_selector, M_normal_gloss, + + M_emission, }; enum CombineMode { diff --git a/panda/src/pgraphnodes/shaderGenerator.cxx b/panda/src/pgraphnodes/shaderGenerator.cxx index bfb466409e..21fdb106ec 100644 --- a/panda/src/pgraphnodes/shaderGenerator.cxx +++ b/panda/src/pgraphnodes/shaderGenerator.cxx @@ -467,6 +467,9 @@ analyze_renderstate(ShaderKey &key, const RenderState *rs) { skip = true; } break; + case TextureStage::M_emission: + info._flags = ShaderKey::TF_map_emission; + break; default: break; } @@ -743,6 +746,7 @@ synthesize_shader(const RenderState *rs, const GeomVertexAnimationSpec &anim) { int map_index_glow = -1; int map_index_gloss = -1; + int map_index_emission = -1; // Figure out whether we need to calculate any of these variables. bool need_world_position = (key._num_clip_planes > 0); @@ -833,6 +837,9 @@ synthesize_shader(const RenderState *rs, const GeomVertexAnimationSpec &anim) { if (tex._flags & ShaderKey::TF_map_gloss) { map_index_gloss = i; } + if (tex._flags & ShaderKey::TF_map_emission) { + map_index_emission = i; + } } if (need_tangents) { tangent_freg = alloc_freg(); @@ -1446,17 +1453,17 @@ synthesize_shader(const RenderState *rs, const GeomVertexAnimationSpec &anim) { } text << "\t // Begin view-space light summation\n"; if (key._material_flags & Material::F_emission) { - if (key._texture_flags & ShaderKey::TF_map_glow) { - text << "\t result = attr_material[2] * saturate(2 * (tex" << map_index_glow << ".a - 0.5));\n"; - } else { - text << "\t result = attr_material[2];\n"; - } + text << "\t result = attr_material[2];\n"; + } else if (key._texture_flags & (ShaderKey::TF_map_glow | ShaderKey::TF_map_emission)) { + text << "\t result = float4(1,1,1,0);\n"; } else { - if (key._texture_flags & ShaderKey::TF_map_glow) { - text << "\t result = saturate(2 * (tex" << map_index_glow << ".a - 0.5));\n"; - } else { - text << "\t result = float4(0,0,0,0);\n"; - } + text << "\t result = float4(0,0,0,0);\n"; + } + if (key._texture_flags & ShaderKey::TF_map_emission) { + text << "\t result.rgb *= tex" << map_index_emission << ".rgb;\n"; + } + if (key._texture_flags & ShaderKey::TF_map_glow) { + text << "\t result *= saturate(2 * (tex" << map_index_glow << ".a - 0.5));\n"; } if (key._have_separate_ambient) { if (key._material_flags & Material::F_ambient) { diff --git a/panda/src/pgraphnodes/shaderGenerator.h b/panda/src/pgraphnodes/shaderGenerator.h index 7ef11d148d..dd5b3456c5 100644 --- a/panda/src/pgraphnodes/shaderGenerator.h +++ b/panda/src/pgraphnodes/shaderGenerator.h @@ -107,6 +107,7 @@ protected: TF_map_height = 0x040, TF_map_glow = 0x080, TF_map_gloss = 0x100, + TF_map_emission = 0x001000000, TF_uses_color = 0x200, TF_uses_primary_color = 0x400, TF_uses_last_saved_result = 0x800, From 35b7ef0dcbab1ed02003162f8b8b7ac984dcb06d Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 23 Dec 2020 17:51:23 +0100 Subject: [PATCH 03/10] shader: Add additional mode-based texture inputs to GLSL shaders This adds the following inputs: p3d_Texture[] (as alternative to p3d_Texture0, etc.) p3d_TextureFF[] p3d_TextureModulate[] p3d_TextureAdd[] p3d_TextureNormal[] p3d_TextureHeight[] p3d_TextureSelector[] p3d_TextureGloss[] p3d_TextureEmission[] --- panda/src/display/graphicsStateGuardian.cxx | 197 ++++++++++++++++++++ panda/src/glstuff/glShaderContext_src.cxx | 62 ++++-- panda/src/gobj/shader.h | 9 + 3 files changed, 256 insertions(+), 12 deletions(-) diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index 43074a2234..9ea3ab1f90 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -1798,6 +1798,10 @@ fetch_specified_member(const NodePath &np, CPT_InternalName attrib, LMatrix4 &t) PT(Texture) GraphicsStateGuardian:: fetch_specified_texture(Shader::ShaderTexSpec &spec, SamplerState &sampler, int &view) { + + static PT(Texture) default_add_tex; + static PT(Texture) default_normal_height_tex; + switch (spec._part) { case Shader::STO_named_input: // Named texture input. @@ -1895,6 +1899,199 @@ fetch_specified_texture(Shader::ShaderTexSpec &spec, SamplerState &sampler, } break; + case Shader::STO_ff_stage_i: + { + // We get the TextureAttrib directly from the _target_rs, not the + // filtered TextureAttrib in _target_texture. + const TextureAttrib *texattrib; + _target_rs->get_attrib_def(texattrib); + + if (spec._stage < texattrib->get_num_on_ff_stages()) { + TextureStage *stage = texattrib->get_on_ff_stage(spec._stage); + sampler = texattrib->get_on_sampler(stage); + view += stage->get_tex_view_offset(); + return texattrib->get_on_texture(stage); + } + } + break; + + case Shader::STO_stage_modulate_i: + { + const TextureAttrib *texattrib; + if (_target_rs->get_attrib(texattrib)) { + size_t si = 0; + for (int i = 0; i < texattrib->get_num_on_stages(); ++i) { + TextureStage *stage = texattrib->get_on_stage(i); + TextureStage::Mode mode = stage->get_mode(); + + if (mode == TextureStage::M_modulate || + mode == TextureStage::M_modulate_glow || + mode == TextureStage::M_modulate_gloss) { + if (si++ == spec._stage) { + sampler = texattrib->get_on_sampler(stage); + view += stage->get_tex_view_offset(); + return texattrib->get_on_texture(stage); + } + } + } + } + } + break; + + case Shader::STO_stage_add_i: + { + const TextureAttrib *texattrib; + if (_target_rs->get_attrib(texattrib)) { + size_t si = 0; + for (int i = 0; i < texattrib->get_num_on_stages(); ++i) { + TextureStage *stage = texattrib->get_on_stage(i); + TextureStage::Mode mode = stage->get_mode(); + + if (mode == TextureStage::M_add) { + if (si++ == spec._stage) { + sampler = texattrib->get_on_sampler(stage); + view += stage->get_tex_view_offset(); + return texattrib->get_on_texture(stage); + } + } + } + } + + if (default_add_tex == nullptr) { + PT(Texture) tex = new Texture("default-add"); + tex->setup_2d_texture(1, 1, Texture::T_unsigned_byte, Texture::F_luminance); + tex->set_clear_color(LColor(0, 0, 0, 1)); + default_add_tex = std::move(tex); + } + return default_add_tex; + } + break; + + case Shader::STO_stage_normal_i: + { + const TextureAttrib *texattrib; + if (_target_rs->get_attrib(texattrib)) { + size_t si = 0; + for (int i = 0; i < texattrib->get_num_on_stages(); ++i) { + TextureStage *stage = texattrib->get_on_stage(i); + TextureStage::Mode mode = stage->get_mode(); + + if (mode == TextureStage::M_normal || + mode == TextureStage::M_normal_height) { + if (si++ == spec._stage) { + sampler = texattrib->get_on_sampler(stage); + view += stage->get_tex_view_offset(); + return texattrib->get_on_texture(stage); + } + } + } + } + + if (default_normal_height_tex == nullptr) { + PT(Texture) tex = new Texture("default-normal-height"); + tex->setup_2d_texture(1, 1, Texture::T_unsigned_byte, Texture::F_rgba); + tex->set_clear_color(LColor(0.5, 0.5, 1, 0)); + default_normal_height_tex = std::move(tex); + } + return default_normal_height_tex; + } + break; + + case Shader::STO_stage_gloss_i: + { + const TextureAttrib *texattrib; + if (_target_rs->get_attrib(texattrib)) { + size_t si = 0; + for (int i = 0; i < texattrib->get_num_on_stages(); ++i) { + TextureStage *stage = texattrib->get_on_stage(i); + TextureStage::Mode mode = stage->get_mode(); + + if (mode == TextureStage::M_gloss || + mode == TextureStage::M_modulate_gloss || + mode == TextureStage::M_normal_gloss) { + if (si++ == spec._stage) { + sampler = texattrib->get_on_sampler(stage); + view += stage->get_tex_view_offset(); + return texattrib->get_on_texture(stage); + } + } + } + } + } + break; + + case Shader::STO_stage_height_i: + { + const TextureAttrib *texattrib; + if (_target_rs->get_attrib(texattrib)) { + size_t si = 0; + for (int i = 0; i < texattrib->get_num_on_stages(); ++i) { + TextureStage *stage = texattrib->get_on_stage(i); + TextureStage::Mode mode = stage->get_mode(); + + if (mode == TextureStage::M_height || + mode == TextureStage::M_normal_height) { + if (si++ == spec._stage) { + sampler = texattrib->get_on_sampler(stage); + view += stage->get_tex_view_offset(); + return texattrib->get_on_texture(stage); + } + } + } + } + + if (default_normal_height_tex == nullptr) { + PT(Texture) tex = new Texture("default-normal-height"); + tex->setup_2d_texture(1, 1, Texture::T_unsigned_byte, Texture::F_rgba); + tex->set_clear_color(LColor(0.5, 0.5, 1, 0)); + default_normal_height_tex = std::move(tex); + } + return default_normal_height_tex; + } + break; + + case Shader::STO_stage_selector_i: + { + const TextureAttrib *texattrib; + if (_target_rs->get_attrib(texattrib)) { + size_t si = 0; + for (int i = 0; i < texattrib->get_num_on_stages(); ++i) { + TextureStage *stage = texattrib->get_on_stage(i); + TextureStage::Mode mode = stage->get_mode(); + + if (mode == TextureStage::M_selector) { + if (si++ == spec._stage) { + sampler = texattrib->get_on_sampler(stage); + view += stage->get_tex_view_offset(); + return texattrib->get_on_texture(stage); + } + } + } + } + } + break; + + case Shader::STO_stage_emission_i: + { + const TextureAttrib *texattrib; + if (_target_rs->get_attrib(texattrib)) { + size_t si = 0; + for (int i = 0; i < texattrib->get_num_on_stages(); ++i) { + TextureStage *stage = texattrib->get_on_stage(i); + TextureStage::Mode mode = stage->get_mode(); + + if (mode == TextureStage::M_emission) { + if (si++ == spec._stage) { + sampler = texattrib->get_on_sampler(stage); + view += stage->get_tex_view_offset(); + return texattrib->get_on_texture(stage); + } + } + } + } + } + break; + default: nassertr(false, nullptr); break; diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 28429941c4..b0dfd4531b 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -953,27 +953,65 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) { _shader->_mat_deps |= bind._dep[0] | bind._dep[1]; return; } - if (size > 7 && noprefix.substr(0, 7) == "Texture") { + if (noprefix.compare(0, 7, "Texture") == 0) { Shader::ShaderTexSpec bind; bind._id = arg_id; - bind._part = Shader::STO_stage_i; - bind._name = 0; - string tail; - bind._stage = string_to_int(noprefix.substr(7), tail); - if (!tail.empty()) { + if (!get_sampler_texture_type(bind._desired_type, param_type)) { GLCAT.error() - << "Error parsing shader input name: unexpected '" - << tail << "' in '" << param_name << "'\n"; + << "Could not bind texture input " << param_name << "\n"; return; } - if (get_sampler_texture_type(bind._desired_type, param_type)) { + if (size > 7 && isdigit(noprefix[7])) { + // p3d_Texture0, p3d_Texture1, etc. + bind._part = Shader::STO_stage_i; + + string tail; + bind._stage = string_to_int(noprefix.substr(7), tail); + if (!tail.empty()) { + GLCAT.error() + << "Error parsing shader input name: unexpected '" + << tail << "' in '" << param_name << "'\n"; + return; + } _glgsg->_glUniform1i(p, _shader->_tex_spec.size()); _shader->_tex_spec.push_back(bind); - } else { - GLCAT.error() - << "Could not bind texture input " << param_name << "\n"; + } + else { + // p3d_Texture[] or p3d_TextureModulate[], etc. + if (size == 7) { + bind._part = Shader::STO_stage_i; + } + else if (noprefix.compare(7, string::npos, "FF") == 0) { + bind._part = Shader::STO_ff_stage_i; + } + else if (noprefix.compare(7, string::npos, "Modulate") == 0) { + bind._part = Shader::STO_stage_modulate_i; + } + else if (noprefix.compare(7, string::npos, "Add") == 0) { + bind._part = Shader::STO_stage_add_i; + } + else if (noprefix.compare(7, string::npos, "Normal") == 0) { + bind._part = Shader::STO_stage_normal_i; + } + else if (noprefix.compare(7, string::npos, "Height") == 0) { + bind._part = Shader::STO_stage_height_i; + } + else if (noprefix.compare(7, string::npos, "Selector") == 0) { + bind._part = Shader::STO_stage_selector_i; + } + else if (noprefix.compare(7, string::npos, "Gloss") == 0) { + bind._part = Shader::STO_stage_gloss_i; + } + else if (noprefix.compare(7, string::npos, "Emission") == 0) { + bind._part = Shader::STO_stage_emission_i; + } + + for (bind._stage = 0; bind._stage < param_size; ++bind._stage) { + _glgsg->_glUniform1i(p + bind._stage, _shader->_tex_spec.size()); + _shader->_tex_spec.push_back(bind); + } } return; } diff --git a/panda/src/gobj/shader.h b/panda/src/gobj/shader.h index 940e2d0ccf..d2035a26ea 100644 --- a/panda/src/gobj/shader.h +++ b/panda/src/gobj/shader.h @@ -225,6 +225,15 @@ public: STO_stage_i, STO_light_i_shadow_map, + + STO_ff_stage_i, + STO_stage_modulate_i, + STO_stage_add_i, + STO_stage_normal_i, + STO_stage_height_i, + STO_stage_selector_i, + STO_stage_gloss_i, + STO_stage_emission_i, }; enum ShaderArgClass { From 5c98c6fb71b0cc752b7c5baa457cdc73a3eaa585 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 24 Dec 2020 13:21:35 +0100 Subject: [PATCH 04/10] makepanda: accept arm64 as alias for aarch64 when building for Android --- makepanda/makepandacore.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index de8fd0a991..61a1bdf9bc 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -393,6 +393,9 @@ def SetTarget(target, arch=None): else: arch = 'armv7a' + if arch == 'arm64': + arch = 'aarch64' + # Did we specify an API level? global ANDROID_API target, _, api = target.partition('-') From 4a62cc13bea8ababab5feb5ff4a86ed6870a4cd5 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 24 Dec 2020 13:22:00 +0100 Subject: [PATCH 05/10] makewheel: Set --force-rpath when calling patchelf This is necessary to avoid the creation of a DT_RUNPATH instead of DT_RPATH. DT_RUNPATH does not have the desired behaviour. --- makepanda/makewheel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makepanda/makewheel.py b/makepanda/makewheel.py index dbd559172c..adf691a559 100644 --- a/makepanda/makewheel.py +++ b/makepanda/makewheel.py @@ -455,7 +455,7 @@ class WheelFile(object): self.consider_add_dependency(target_dep, dep) subprocess.call(["strip", "-s", temp.name]) - subprocess.call(["patchelf", "--set-rpath", "$ORIGIN", temp.name]) + subprocess.call(["patchelf", "--force-rpath", "--set-rpath", "$ORIGIN", temp.name]) source_path = temp.name From 012661e1ba21aec014cf2906c5771fb26c1cedd6 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 24 Dec 2020 13:23:58 +0100 Subject: [PATCH 06/10] dist: Add more ignore libraries for macOS This is the full list of libraries that occur both in the 10.6 SDK and the 11.1 SDK. --- direct/src/dist/commands.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/direct/src/dist/commands.py b/direct/src/dist/commands.py index c5f14ae489..22ea67da63 100644 --- a/direct/src/dist/commands.py +++ b/direct/src/dist/commands.py @@ -281,6 +281,42 @@ class build_apps(setuptools.Command): '/usr/lib/libSystem.*.dylib', '/usr/lib/libbz2.*.dylib', '/usr/lib/libedit.*.dylib', + '/usr/lib/libffi.dylib', + '/usr/lib/libauditd.0.dylib', + '/usr/lib/libgermantok.dylib', + '/usr/lib/liblangid.dylib', + '/usr/lib/libarchive.2.dylib', + '/usr/lib/libipsec.A.dylib', + '/usr/lib/libpanel.5.4.dylib', + '/usr/lib/libiodbc.2.1.18.dylib', + '/usr/lib/libhunspell-1.2.0.0.0.dylib', + '/usr/lib/libsqlite3.dylib', + '/usr/lib/libpam.1.dylib', + '/usr/lib/libtidy.A.dylib', + '/usr/lib/libDHCPServer.A.dylib', + '/usr/lib/libpam.2.dylib', + '/usr/lib/libXplugin.1.dylib', + '/usr/lib/libxslt.1.dylib', + '/usr/lib/libiodbcinst.2.1.18.dylib', + '/usr/lib/libBSDPClient.A.dylib', + '/usr/lib/libsandbox.1.dylib', + '/usr/lib/libform.5.4.dylib', + '/usr/lib/libbsm.0.dylib', + '/usr/lib/libMatch.1.dylib', + '/usr/lib/libresolv.9.dylib', + '/usr/lib/libcharset.1.dylib', + '/usr/lib/libxml2.2.dylib', + '/usr/lib/libiconv.2.dylib', + '/usr/lib/libScreenReader.dylib', + '/usr/lib/libdtrace.dylib', + '/usr/lib/libicucore.A.dylib', + '/usr/lib/libsasl2.2.dylib', + '/usr/lib/libpcap.A.dylib', + '/usr/lib/libexslt.0.dylib', + '/usr/lib/libcurl.4.dylib', + '/usr/lib/libncurses.5.4.dylib', + '/usr/lib/libxar.1.dylib', + '/usr/lib/libmenu.5.4.dylib', '/System/Library/**', ] From 8bb0de52b7236757c46a19f4126dfa417632cd81 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 24 Dec 2020 14:15:58 +0100 Subject: [PATCH 07/10] dist: Add additional ignored system libraries for Windows --- direct/src/dist/commands.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/direct/src/dist/commands.py b/direct/src/dist/commands.py index 22ea67da63..d46d320e29 100644 --- a/direct/src/dist/commands.py +++ b/direct/src/dist/commands.py @@ -265,7 +265,8 @@ class build_apps(setuptools.Command): 'dciman32.dll', 'comdlg32.dll', 'comctl32.dll', 'ole32.dll', 'oleaut32.dll', 'gdiplus.dll', 'winmm.dll', 'iphlpapi.dll', 'msvcrt.dll', 'kernelbase.dll', 'msimg32.dll', 'msacm32.dll', - 'setupapi.dll', 'version.dll', + 'setupapi.dll', 'version.dll', 'userenv.dll', 'netapi32.dll', + 'crypt32.dll', # manylinux1/linux 'libdl.so.*', 'libstdc++.so.*', 'libm.so.*', 'libgcc_s.so.*', From adbeea33fb1fd3e720687b34b989c1cd9668225c Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 24 Dec 2020 14:16:40 +0100 Subject: [PATCH 08/10] dist: Warn if picking up binary dependency from outside a wheel --- direct/src/dist/commands.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/direct/src/dist/commands.py b/direct/src/dist/commands.py index d46d320e29..c84d453bfd 100644 --- a/direct/src/dist/commands.py +++ b/direct/src/dist/commands.py @@ -579,6 +579,7 @@ class build_apps(setuptools.Command): path = sys.path[:] p3dwhl = None + wheelpaths = [] if use_wheels: wheelpaths = self.download_wheels(platform) @@ -853,6 +854,7 @@ class build_apps(setuptools.Command): for module, source_path in freezer_extras: if source_path is not None: # Rename panda3d/core.pyd to panda3d.core.pyd + source_path = os.path.normpath(source_path) basename = os.path.basename(source_path) if '.' in module: basename = module.rsplit('.', 1)[0] + '.' + basename @@ -863,6 +865,20 @@ class build_apps(setuptools.Command): if len(parts) >= 3 and '-' in parts[-2]: parts = parts[:-2] + parts[-1:] basename = '.'.join(parts) + + # Was this not found in a wheel? Then we may have a problem, + # since it may be for the current platform instead of the target + # platform. + if use_wheels: + found_in_wheel = False + for whl in wheelpaths: + whl = os.path.normpath(whl) + if source_path.lower().startswith(os.path.join(whl, '').lower()): + found_in_wheel = True + break + + if not found_in_wheel: + self.warn('{} was not found in any downloaded wheel, is a dependency missing from requirements.txt?'.format(basename)) else: # Builtin module, but might not be builtin in wheel libs, so double check if module in whl_modules: From 86937c7bb952589472e2a579583f06f07545a7af Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 24 Dec 2020 14:17:20 +0100 Subject: [PATCH 09/10] dist: Check if entire directory should be skipped This is functionally equivalent, but reduces the message spam in verbose mode, and perhaps is a little faster --- direct/src/dist/commands.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/direct/src/dist/commands.py b/direct/src/dist/commands.py index c84d453bfd..26f33a3e07 100644 --- a/direct/src/dist/commands.py +++ b/direct/src/dist/commands.py @@ -983,6 +983,26 @@ class build_apps(setuptools.Command): return check_pattern(fname, include_copy_list) and \ not check_pattern(fname, ignore_copy_list) + def skip_directory(src): + # Provides a quick-out for directory checks. NOT recursive. + fn = p3d.Filename.from_os_specific(os.path.normpath(src)) + path = fn.get_fullpath() + fn.make_absolute() + abspath = fn.get_fullpath() + + for pattern in ignore_copy_list: + if not pattern.pattern.endswith('/*') and \ + not pattern.pattern.endswith('/**'): + continue + + if abspath.startswith(pattern_dir + '/'): + return True + + if path.startswith(pattern_dir + '/'): + return True + + return False + def copy_file(src, dst): src = os.path.normpath(src) dst = os.path.normpath(dst) @@ -1023,6 +1043,10 @@ class build_apps(setuptools.Command): rootdir = os.getcwd() for dirname, subdirlist, filelist in os.walk(rootdir): dirpath = os.path.relpath(dirname, rootdir) + if skip_directory(dirpath): + self.announce('skipping directory {}'.format(dirpath)) + continue + for fname in filelist: src = os.path.join(dirpath, fname) dst = os.path.join(builddir, update_path(src)) From 4cf32bece353b422807a2a8c34d3bbf952f220c4 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 24 Dec 2020 15:30:17 +0100 Subject: [PATCH 10/10] doc: Update release notes for 1.10.8 [skip ci] --- doc/ReleaseNotes | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index c7da05ad7a..0c5428e652 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -16,6 +16,9 @@ Recommended maintenance release. * Fix compilation error with Bullet 2.90+ * Assimp library was updated in Windows thirdparty packages (#1020) * libCg is now shipped as library instead of framework on macOS (#1079) +* Add warnings to build_apps when forgetting dependencies in requirements.txt +* Add experimental TextureStage::M_emission mode +* Add experimental p3d_TextureNormal, p3d_TextureEmission, etc. GLSL inputs * Fix ability to use deployment system when compiling without OpenSSL (#1073) * Fix assorted issues with rgbPanel * Fix comparison operator of RenderEffects object