From ce42ccee72841c8a9ad975712c39e6ede84feb61 Mon Sep 17 00:00:00 2001 From: "rlp@google.com" Date: Thu, 25 Jun 2009 18:42:32 +0000 Subject: Fixing unit_test bugs. One of hte fixes is for the texture param. This quiets the unit test, but has a todo under the actual code. To make all examples run, this should be completed, but if we're going ot eliminate the texture path in favor of the sampler path, then it doesn't make sense to fill this in if we'll delete it shortly. Review URL: http://codereview.chromium.org/146133 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19268 0039d316-1c4b-4281-b951-d872f2087c98 --- o3d/core/cross/buffer.cc | 7 +++++-- o3d/core/cross/command_buffer/effect_cb.cc | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'o3d/core') diff --git a/o3d/core/cross/buffer.cc b/o3d/core/cross/buffer.cc index acb6b31..d467d987 100644 --- a/o3d/core/cross/buffer.cc +++ b/o3d/core/cross/buffer.cc @@ -199,7 +199,6 @@ bool Buffer::ReshuffleBuffer(unsigned int new_stride, Field* field_to_remove) { } } } - // Copy the reorganized data into a new buffer. { ConcreteFree(); @@ -210,7 +209,11 @@ bool Buffer::ReshuffleBuffer(unsigned int new_stride, Field* field_to_remove) { << " for Buffer '" << name() << "'"; return false; } - + // stride_ must be set before GetData is called so that the proper size + // buffer is allocated. We also need to set it after this function is + // is completed (see CreateField, RemoveField) for when we create a new + // buffer with no fields yet. + stride_ = new_stride; BufferLockHelper helper(this); void* destination = helper.GetData(Buffer::WRITE_ONLY); if (!destination) { diff --git a/o3d/core/cross/command_buffer/effect_cb.cc b/o3d/core/cross/command_buffer/effect_cb.cc index 7a5d11b..afa9e0f 100644 --- a/o3d/core/cross/command_buffer/effect_cb.cc +++ b/o3d/core/cross/command_buffer/effect_cb.cc @@ -166,6 +166,8 @@ static const ObjectBase::Class* CBTypeToParamType( return ParamMatrix4::GetApparentClass(); case effect_param::SAMPLER: return ParamSampler::GetApparentClass(); + case effect_param::TEXTURE: + return ParamTexture::GetApparentClass(); default : { DLOG(ERROR) << "Cannot convert command buffer type " << type @@ -199,7 +201,7 @@ void EffectCB::GetParameterInfo(EffectParameterInfoArray *array) { } void EffectCB::GetStreamInfo(EffectStreamInfoArray *array) { - // To be filled in + // TODO(rlp) } } // namespace o3d -- cgit v1.1