mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 16:14:35 +02:00
Attempt to fix linker error with Android and draco in BuildDracoMeshTask.cpp
This commit is contained in:
parent
e4cafced2a
commit
e6487332e8
2 changed files with 11 additions and 0 deletions
|
@ -164,6 +164,8 @@ namespace baker {
|
||||||
// Build Draco meshes
|
// Build Draco meshes
|
||||||
// NOTE: This task is disabled by default and must be enabled through configuration
|
// NOTE: This task is disabled by default and must be enabled through configuration
|
||||||
// TODO: Tangent support (Needs changes to FBXSerializer_Mesh as well)
|
// TODO: Tangent support (Needs changes to FBXSerializer_Mesh as well)
|
||||||
|
// NOTE: Due to an unresolved linker error, BuildDracoMeshTask is not functional on Android
|
||||||
|
// TODO: Figure out why BuildDracoMeshTask.cpp won't link with draco on Android
|
||||||
const auto buildDracoMeshInputs = BuildDracoMeshTask::Input(meshesIn, normalsPerMesh, tangentsPerMesh).asVarying();
|
const auto buildDracoMeshInputs = BuildDracoMeshTask::Input(meshesIn, normalsPerMesh, tangentsPerMesh).asVarying();
|
||||||
const auto buildDracoMeshOutputs = model.addJob<BuildDracoMeshTask>("BuildDracoMesh", buildDracoMeshInputs);
|
const auto buildDracoMeshOutputs = model.addJob<BuildDracoMeshTask>("BuildDracoMesh", buildDracoMeshInputs);
|
||||||
const auto dracoMeshes = buildDracoMeshOutputs.getN<BuildDracoMeshTask::Output>(0);
|
const auto dracoMeshes = buildDracoMeshOutputs.getN<BuildDracoMeshTask::Output>(0);
|
||||||
|
|
|
@ -22,8 +22,11 @@
|
||||||
#pragma GCC diagnostic ignored "-Wsign-compare"
|
#pragma GCC diagnostic ignored "-Wsign-compare"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef Q_OS_ANDROID
|
||||||
#include <draco/compression/encode.h>
|
#include <draco/compression/encode.h>
|
||||||
#include <draco/mesh/triangle_soup_mesh_builder.h>
|
#include <draco/mesh/triangle_soup_mesh_builder.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#pragma warning( pop )
|
#pragma warning( pop )
|
||||||
|
@ -35,6 +38,7 @@
|
||||||
#include "ModelBakerLogging.h"
|
#include "ModelBakerLogging.h"
|
||||||
#include "ModelMath.h"
|
#include "ModelMath.h"
|
||||||
|
|
||||||
|
#ifndef Q_OS_ANDROID
|
||||||
std::vector<hifi::ByteArray> createMaterialList(const hfm::Mesh& mesh) {
|
std::vector<hifi::ByteArray> createMaterialList(const hfm::Mesh& mesh) {
|
||||||
std::vector<hifi::ByteArray> materialList;
|
std::vector<hifi::ByteArray> materialList;
|
||||||
for (const auto& meshPart : mesh.parts) {
|
for (const auto& meshPart : mesh.parts) {
|
||||||
|
@ -199,6 +203,7 @@ std::unique_ptr<draco::Mesh> createDracoMesh(const hfm::Mesh& mesh, const std::v
|
||||||
|
|
||||||
return dracoMesh;
|
return dracoMesh;
|
||||||
}
|
}
|
||||||
|
#endif // not Q_OS_ANDROID
|
||||||
|
|
||||||
void BuildDracoMeshTask::configure(const Config& config) {
|
void BuildDracoMeshTask::configure(const Config& config) {
|
||||||
_encodeSpeed = config.encodeSpeed;
|
_encodeSpeed = config.encodeSpeed;
|
||||||
|
@ -206,6 +211,9 @@ void BuildDracoMeshTask::configure(const Config& config) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildDracoMeshTask::run(const baker::BakeContextPointer& context, const Input& input, Output& output) {
|
void BuildDracoMeshTask::run(const baker::BakeContextPointer& context, const Input& input, Output& output) {
|
||||||
|
#ifdef Q_OS_ANDROID
|
||||||
|
qCWarning(model_baker) << "BuildDracoMesh is disabled on Android. Output meshes will be empty.";
|
||||||
|
#else
|
||||||
const auto& meshes = input.get0();
|
const auto& meshes = input.get0();
|
||||||
const auto& normalsPerMesh = input.get1();
|
const auto& normalsPerMesh = input.get1();
|
||||||
const auto& tangentsPerMesh = input.get2();
|
const auto& tangentsPerMesh = input.get2();
|
||||||
|
@ -239,4 +247,5 @@ void BuildDracoMeshTask::run(const baker::BakeContextPointer& context, const Inp
|
||||||
dracoBytes = hifi::ByteArray(buffer.data(), (int)buffer.size());
|
dracoBytes = hifi::ByteArray(buffer.data(), (int)buffer.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // not Q_OS_ANDROID
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue