Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 826 vs 827 for /trunk/Source Code/Geometry/Animations/AnimationEvaluator.cpp

Diff revisions: vs.
  @@ -64,15 +64,15 @@
64 64 }
65 65
66 66 bool AnimEvaluator::initBuffers(GFXDevice& context) {
67 + const bool useUnboundBuffer = true;
68 +
67 69 DIVIDE_ASSERT(_boneTransformBuffer == nullptr && !_transforms.empty(),
68 70 "AnimEvaluator error: can't create bone buffer at current stage!");
69 71
70 - _boneTransformBuffer = context.newSB(1, true, false, BufferUpdateFrequency::ONCE);
71 -
72 72 DIVIDE_ASSERT(_transforms.size() <= Config::MAX_BONE_COUNT_PER_NODE,
73 73 "AnimEvaluator error: Too many bones for current node! "
74 74 "Increase MAX_BONE_COUNT_PER_NODE in Config!");
75 - size_t paddingFactor = _boneTransformBuffer->getAlignmentRequirement();
75 + size_t paddingFactor = ShaderBuffer::alignmentRequirement(useUnboundBuffer);
76 76
77 77 U32 bonePadding = 0;
78 78 size_t boneCount = _transforms.front().size();
  @@ -82,8 +82,6 @@
82 82 bonePadding++;
83 83 }
84 84
85 - _boneTransformBuffer->create(frameCount(), bufferSize);
86 -
87 85 vectorImplAligned<mat4<F32>> animationData;
88 86 animationData.reserve((boneCount + bonePadding) * frameCount());
89 87
  @@ -96,7 +94,16 @@
96 94
97 95 vectorAlg::shrinkToFit(animationData);
98 96
99 - _boneTransformBuffer->setData((const bufferPtr)animationData.data());
97 +
98 + ShaderBufferParams params;
99 + params._primitiveCount = frameCount();
100 + params._primitiveSizeInBytes = bufferSize;
101 + params._ringBufferLength = 1;
102 + params._unbound = useUnboundBuffer;
103 + params._initialData = animationData.data();
104 + params._updateFrequency = BufferUpdateFrequency::ONCE;
105 +
106 + _boneTransformBuffer = context.newSB(params);
100 107
101 108 return !animationData.empty();
102 109 }