mirror of
https://github.com/overte-org/overte.git
synced 2025-07-22 21:28:54 +02:00
avoid assertion on mac
This commit is contained in:
parent
3108360094
commit
e8cdee71ed
6 changed files with 13 additions and 11 deletions
|
@ -116,7 +116,7 @@ void CauterizedModel::updateClusterMatrices() {
|
||||||
for (int j = 0; j < mesh.clusters.size(); j++) {
|
for (int j = 0; j < mesh.clusters.size(); j++) {
|
||||||
const FBXCluster& cluster = mesh.clusters.at(j);
|
const FBXCluster& cluster = mesh.clusters.at(j);
|
||||||
auto jointMatrix = _rig->getJointTransform(cluster.jointIndex);
|
auto jointMatrix = _rig->getJointTransform(cluster.jointIndex);
|
||||||
#if GLM_ARCH & GLM_ARCH_SSE2
|
#if (GLM_ARCH & GLM_ARCH_SSE2) && !(defined Q_OS_MACOS)
|
||||||
glm::mat4 out, inverseBindMatrix = cluster.inverseBindMatrix;
|
glm::mat4 out, inverseBindMatrix = cluster.inverseBindMatrix;
|
||||||
glm_mat4_mul((glm_vec4*)&jointMatrix, (glm_vec4*)&inverseBindMatrix, (glm_vec4*)&out);
|
glm_mat4_mul((glm_vec4*)&jointMatrix, (glm_vec4*)&inverseBindMatrix, (glm_vec4*)&out);
|
||||||
state.clusterMatrices[j] = out;
|
state.clusterMatrices[j] = out;
|
||||||
|
@ -155,7 +155,7 @@ void CauterizedModel::updateClusterMatrices() {
|
||||||
if (_cauterizeBoneSet.find(cluster.jointIndex) != _cauterizeBoneSet.end()) {
|
if (_cauterizeBoneSet.find(cluster.jointIndex) != _cauterizeBoneSet.end()) {
|
||||||
jointMatrix = cauterizeMatrix;
|
jointMatrix = cauterizeMatrix;
|
||||||
}
|
}
|
||||||
#if GLM_ARCH & GLM_ARCH_SSE2
|
#if (GLM_ARCH & GLM_ARCH_SSE2) && !(defined Q_OS_MACOS)
|
||||||
glm::mat4 out, inverseBindMatrix = cluster.inverseBindMatrix;
|
glm::mat4 out, inverseBindMatrix = cluster.inverseBindMatrix;
|
||||||
glm_mat4_mul((glm_vec4*)&jointMatrix, (glm_vec4*)&inverseBindMatrix, (glm_vec4*)&out);
|
glm_mat4_mul((glm_vec4*)&jointMatrix, (glm_vec4*)&inverseBindMatrix, (glm_vec4*)&out);
|
||||||
state.clusterMatrices[j] = out;
|
state.clusterMatrices[j] = out;
|
||||||
|
|
|
@ -62,7 +62,9 @@ template<class T> QVariant readBinaryArray(QDataStream& in, int& position) {
|
||||||
position += sizeof(T) * arrayLength;
|
position += sizeof(T) * arrayLength;
|
||||||
in.readRawData(arrayData.data(), arrayData.size());
|
in.readRawData(arrayData.data(), arrayData.size());
|
||||||
}
|
}
|
||||||
memcpy(&values[0], arrayData.constData(), arrayData.size());
|
if (!arrayData.isEmpty()) {
|
||||||
|
memcpy(&values[0], arrayData.constData(), arrayData.size());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
values.reserve(arrayLength);
|
values.reserve(arrayLength);
|
||||||
const unsigned int DEFLATE_ENCODING = 1;
|
const unsigned int DEFLATE_ENCODING = 1;
|
||||||
|
|
|
@ -27,7 +27,7 @@ template <> void uncompress(const CB_BC1& src, PB_RGB32& dst) {
|
||||||
auto c0 = bc1.color0.val;
|
auto c0 = bc1.color0.val;
|
||||||
auto c1 = bc1.color1.val;
|
auto c1 = bc1.color1.val;
|
||||||
|
|
||||||
for (int i = 0; i < PB_RGB32::SIZE; ++i) {
|
for (int i = 0; i < PB_RGB32::LENGTH; ++i) {
|
||||||
//dst.pixels[i] = ;
|
//dst.pixels[i] = ;
|
||||||
auto r = pixel::mix(
|
auto r = pixel::mix(
|
||||||
c0,
|
c0,
|
||||||
|
@ -44,4 +44,4 @@ template <> void uncompress(const CB_BC4& src, PB_RGBA32& dst) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,8 +99,8 @@ namespace image {
|
||||||
using Format = typename P::Format;
|
using Format = typename P::Format;
|
||||||
using Storage = typename P::Storage;
|
using Storage = typename P::Storage;
|
||||||
|
|
||||||
constexpr uint16_t getLength() const { return length; }
|
static const uint32_t LENGTH { length };
|
||||||
uint32_t getSize() const { return length * sizeof(P); }
|
static const uint32_t SIZE { length * sizeof(P) };
|
||||||
|
|
||||||
P pixels[length];
|
P pixels[length];
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ namespace image {
|
||||||
}
|
}
|
||||||
|
|
||||||
void setPixels(const P* srcPixels) {
|
void setPixels(const P* srcPixels) {
|
||||||
memcpy(pixels, srcPixels, getSize());
|
memcpy(pixels, srcPixels, SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
const Storage* getStorage() const { return static_cast<const Storage*> (&pixels->raw); }
|
const Storage* getStorage() const { return static_cast<const Storage*> (&pixels->raw); }
|
||||||
|
|
|
@ -255,7 +255,7 @@ gpu::Texture* TextureUsage::process2DTextureColorFromImage(const QImage& srcImag
|
||||||
|
|
||||||
theTexture->assignStoredMip(0, formatMip, image.byteCount(), image.constBits());
|
theTexture->assignStoredMip(0, formatMip, image.byteCount(), image.constBits());
|
||||||
|
|
||||||
image::PixRGB32 pix0;
|
/* image::PixRGB32 pix0;
|
||||||
|
|
||||||
image::PixRGBA32 pix1;
|
image::PixRGBA32 pix1;
|
||||||
|
|
||||||
|
@ -280,7 +280,7 @@ gpu::Texture* TextureUsage::process2DTextureColorFromImage(const QImage& srcImag
|
||||||
image::uncompress(cb, pb1);
|
image::uncompress(cb, pb1);
|
||||||
|
|
||||||
image::Grid grid;
|
image::Grid grid;
|
||||||
grid.
|
grid.*/
|
||||||
|
|
||||||
if (generateMips) {
|
if (generateMips) {
|
||||||
::generateMips(theTexture, image, formatMip);
|
::generateMips(theTexture, image, formatMip);
|
||||||
|
|
|
@ -1183,7 +1183,7 @@ void Model::updateClusterMatrices() {
|
||||||
for (int j = 0; j < mesh.clusters.size(); j++) {
|
for (int j = 0; j < mesh.clusters.size(); j++) {
|
||||||
const FBXCluster& cluster = mesh.clusters.at(j);
|
const FBXCluster& cluster = mesh.clusters.at(j);
|
||||||
auto jointMatrix = _rig->getJointTransform(cluster.jointIndex);
|
auto jointMatrix = _rig->getJointTransform(cluster.jointIndex);
|
||||||
#if GLM_ARCH & GLM_ARCH_SSE2
|
#if (GLM_ARCH & GLM_ARCH_SSE2) && !(defined Q_OS_MACOS)
|
||||||
glm::mat4 out, inverseBindMatrix = cluster.inverseBindMatrix;
|
glm::mat4 out, inverseBindMatrix = cluster.inverseBindMatrix;
|
||||||
glm_mat4_mul((glm_vec4*)&jointMatrix, (glm_vec4*)&inverseBindMatrix, (glm_vec4*)&out);
|
glm_mat4_mul((glm_vec4*)&jointMatrix, (glm_vec4*)&inverseBindMatrix, (glm_vec4*)&out);
|
||||||
state.clusterMatrices[j] = out;
|
state.clusterMatrices[j] = out;
|
||||||
|
|
Loading…
Reference in a new issue