adjusting page size but still seeing a perf drop

This commit is contained in:
sam gateau 2018-09-27 17:18:43 -07:00
parent 85b3b883f9
commit 215818e313
3 changed files with 5 additions and 5 deletions

View file

@ -24,7 +24,7 @@ Material::Material() :
{
// created from nothing: create the Buffer to store the properties
Schema schema;
_schemaBuffer = gpu::BufferView(std::make_shared<gpu::Buffer>(sizeof(Schema), (const gpu::Byte*) &schema));
_schemaBuffer = gpu::BufferView(std::make_shared<gpu::Buffer>(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<gpu::Buffer>(sizeof(Schema), (const gpu::Byte*) &schema));
_schemaBuffer = gpu::BufferView(std::make_shared<gpu::Buffer>(sizeof(Schema), (const gpu::Byte*) &schema, sizeof(Schema)));
_schemaBuffer.edit<Schema>() = material._schemaBuffer.get<Schema>();
}
@ -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<gpu::Buffer>(sizeof(Schema), (const gpu::Byte*) &schema));
_schemaBuffer = gpu::BufferView(std::make_shared<gpu::Buffer>(sizeof(Schema), (const gpu::Byte*) &schema, sizeof(Schema)));
_schemaBuffer.edit<Schema>() = material._schemaBuffer.get<Schema>();
return (*this);

View file

@ -12,7 +12,7 @@
LightingModel::LightingModel() {
Parameters parameters;
_parametersBuffer = gpu::BufferView(std::make_shared<gpu::Buffer>(sizeof(Parameters), (const gpu::Byte*) &parameters));
_parametersBuffer = gpu::BufferView(std::make_shared<gpu::Buffer>(sizeof(Parameters), (const gpu::Byte*) &parameters, sizeof(Parameters)));
}
void LightingModel::setUnlit(bool enable) {

View file

@ -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;
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<gpu::Buffer>(blendshapeOffsetsSize, (const gpu::Byte*) blendshapeOffset.constData(), blendshapeOffsetsSize);
_blendshapeOffsets[index] = blendshapeOffset;