avoid assertion on mac

This commit is contained in:
samcake 2017-02-03 22:49:41 -08:00
parent 3108360094
commit e8cdee71ed
6 changed files with 13 additions and 11 deletions

View file

@ -116,7 +116,7 @@ void CauterizedModel::updateClusterMatrices() {
for (int j = 0; j < mesh.clusters.size(); j++) {
const FBXCluster& cluster = mesh.clusters.at(j);
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_mul((glm_vec4*)&jointMatrix, (glm_vec4*)&inverseBindMatrix, (glm_vec4*)&out);
state.clusterMatrices[j] = out;
@ -155,7 +155,7 @@ void CauterizedModel::updateClusterMatrices() {
if (_cauterizeBoneSet.find(cluster.jointIndex) != _cauterizeBoneSet.end()) {
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_mul((glm_vec4*)&jointMatrix, (glm_vec4*)&inverseBindMatrix, (glm_vec4*)&out);
state.clusterMatrices[j] = out;

View file

@ -62,7 +62,9 @@ template<class T> QVariant readBinaryArray(QDataStream& in, int& position) {
position += sizeof(T) * arrayLength;
in.readRawData(arrayData.data(), arrayData.size());
}
memcpy(&values[0], arrayData.constData(), arrayData.size());
if (!arrayData.isEmpty()) {
memcpy(&values[0], arrayData.constData(), arrayData.size());
}
} else {
values.reserve(arrayLength);
const unsigned int DEFLATE_ENCODING = 1;

View file

@ -27,7 +27,7 @@ template <> void uncompress(const CB_BC1& src, PB_RGB32& dst) {
auto c0 = bc1.color0.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] = ;
auto r = pixel::mix(
c0,
@ -44,4 +44,4 @@ template <> void uncompress(const CB_BC4& src, PB_RGBA32& dst) {
}
}
}

View file

@ -99,8 +99,8 @@ namespace image {
using Format = typename P::Format;
using Storage = typename P::Storage;
constexpr uint16_t getLength() const { return length; }
uint32_t getSize() const { return length * sizeof(P); }
static const uint32_t LENGTH { length };
static const uint32_t SIZE { length * sizeof(P) };
P pixels[length];
@ -112,7 +112,7 @@ namespace image {
}
void setPixels(const P* srcPixels) {
memcpy(pixels, srcPixels, getSize());
memcpy(pixels, srcPixels, SIZE);
}
const Storage* getStorage() const { return static_cast<const Storage*> (&pixels->raw); }

View file

@ -255,7 +255,7 @@ gpu::Texture* TextureUsage::process2DTextureColorFromImage(const QImage& srcImag
theTexture->assignStoredMip(0, formatMip, image.byteCount(), image.constBits());
image::PixRGB32 pix0;
/* image::PixRGB32 pix0;
image::PixRGBA32 pix1;
@ -280,7 +280,7 @@ gpu::Texture* TextureUsage::process2DTextureColorFromImage(const QImage& srcImag
image::uncompress(cb, pb1);
image::Grid grid;
grid.
grid.*/
if (generateMips) {
::generateMips(theTexture, image, formatMip);

View file

@ -1183,7 +1183,7 @@ void Model::updateClusterMatrices() {
for (int j = 0; j < mesh.clusters.size(); j++) {
const FBXCluster& cluster = mesh.clusters.at(j);
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_mul((glm_vec4*)&jointMatrix, (glm_vec4*)&inverseBindMatrix, (glm_vec4*)&out);
state.clusterMatrices[j] = out;