diff --git a/libraries/graphics/src/graphics/Material.cpp b/libraries/graphics/src/graphics/Material.cpp index ccfae2a570..ab890cecca 100755 --- a/libraries/graphics/src/graphics/Material.cpp +++ b/libraries/graphics/src/graphics/Material.cpp @@ -24,7 +24,7 @@ Material::Material() : { // created from nothing: create the Buffer to store the properties Schema schema; - _schemaBuffer = gpu::BufferView(std::make_shared(sizeof(Schema), (const gpu::Byte*) &schema)); + _schemaBuffer = gpu::BufferView(std::make_shared(sizeof(Schema), (const gpu::Byte*) &schema, sizeof(Schema))); } Material::Material(const Material& material) : @@ -34,7 +34,7 @@ Material::Material(const Material& material) : { // copied: create the Buffer to store the properties, avoid holding a ref to the old Buffer Schema schema; - _schemaBuffer = gpu::BufferView(std::make_shared(sizeof(Schema), (const gpu::Byte*) &schema)); + _schemaBuffer = gpu::BufferView(std::make_shared(sizeof(Schema), (const gpu::Byte*) &schema, sizeof(Schema))); _schemaBuffer.edit() = material._schemaBuffer.get(); } @@ -49,7 +49,7 @@ Material& Material::operator= (const Material& material) { // copied: create the Buffer to store the properties, avoid holding a ref to the old Buffer Schema schema; - _schemaBuffer = gpu::BufferView(std::make_shared(sizeof(Schema), (const gpu::Byte*) &schema)); + _schemaBuffer = gpu::BufferView(std::make_shared(sizeof(Schema), (const gpu::Byte*) &schema, sizeof(Schema))); _schemaBuffer.edit() = material._schemaBuffer.get(); return (*this); diff --git a/libraries/render-utils/src/LightingModel.cpp b/libraries/render-utils/src/LightingModel.cpp index 3781d0e0b1..05002a5daf 100644 --- a/libraries/render-utils/src/LightingModel.cpp +++ b/libraries/render-utils/src/LightingModel.cpp @@ -12,7 +12,7 @@ LightingModel::LightingModel() { Parameters parameters; - _parametersBuffer = gpu::BufferView(std::make_shared(sizeof(Parameters), (const gpu::Byte*) ¶meters)); + _parametersBuffer = gpu::BufferView(std::make_shared(sizeof(Parameters), (const gpu::Byte*) ¶meters, sizeof(Parameters))); } void LightingModel::setUnlit(bool enable) { diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp index e36a7d58ff..c15f3bf2c1 100644 --- a/libraries/render-utils/src/Model.cpp +++ b/libraries/render-utils/src/Model.cpp @@ -1721,7 +1721,7 @@ void Model::initializeBlendshapes(const FBXMesh& mesh, int index) { // Mesh has blendshape, let s allocate the local buffer if not done yet if (_blendshapeBuffers.find(index) == _blendshapeBuffers.end()) { QVector blendshapeOffset; - blendshapeOffset.fill(BlendshapeOffset(), 3 * mesh.vertices.size()); + blendshapeOffset.fill(BlendshapeOffset(), mesh.vertices.size()); const auto blendshapeOffsetsSize = blendshapeOffset.size() * sizeof(BlendshapeOffset); _blendshapeBuffers[index] = std::make_shared(blendshapeOffsetsSize, (const gpu::Byte*) blendshapeOffset.constData(), blendshapeOffsetsSize); _blendshapeOffsets[index] = blendshapeOffset;