summaryrefslogtreecommitdiffstats
path: root/o3d
diff options
context:
space:
mode:
authorrlp@google.com <rlp@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-25 18:42:32 +0000
committerrlp@google.com <rlp@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-25 18:42:32 +0000
commitce42ccee72841c8a9ad975712c39e6ede84feb61 (patch)
treedbee7b83a94e092b101e964f975564fb9473e155 /o3d
parente06984d41804a00d62c0ea1f61f56733d9a095ab (diff)
downloadchromium_src-ce42ccee72841c8a9ad975712c39e6ede84feb61.zip
chromium_src-ce42ccee72841c8a9ad975712c39e6ede84feb61.tar.gz
chromium_src-ce42ccee72841c8a9ad975712c39e6ede84feb61.tar.bz2
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
Diffstat (limited to 'o3d')
-rw-r--r--o3d/command_buffer/common/cross/resource.cc2
-rw-r--r--o3d/command_buffer/common/cross/resource.h1
-rw-r--r--o3d/command_buffer/service/win/d3d9/effect_d3d9.cc14
-rw-r--r--o3d/core/cross/buffer.cc7
-rw-r--r--o3d/core/cross/command_buffer/effect_cb.cc4
5 files changed, 25 insertions, 3 deletions
diff --git a/o3d/command_buffer/common/cross/resource.cc b/o3d/command_buffer/common/cross/resource.cc
index 7619ba0..cf7082f 100644
--- a/o3d/command_buffer/common/cross/resource.cc
+++ b/o3d/command_buffer/common/cross/resource.cc
@@ -101,6 +101,8 @@ unsigned int GetDataSize(DataType type) {
return sizeof(bool); // NOLINT
case SAMPLER:
return sizeof(ResourceID); // NOLINT
+ case TEXTURE:
+ return sizeof(ResourceID); // NOLINT
default:
LOG(FATAL) << "Invalid type.";
return 0;
diff --git a/o3d/command_buffer/common/cross/resource.h b/o3d/command_buffer/common/cross/resource.h
index cbdff26..8e86723 100644
--- a/o3d/command_buffer/common/cross/resource.h
+++ b/o3d/command_buffer/common/cross/resource.h
@@ -101,6 +101,7 @@ enum DataType {
INT,
BOOL,
SAMPLER,
+ TEXTURE,
NUM_TYPES,
MAKE_32_BIT = 0x7fffffff,
};
diff --git a/o3d/command_buffer/service/win/d3d9/effect_d3d9.cc b/o3d/command_buffer/service/win/d3d9/effect_d3d9.cc
index a472e79..7cfee14 100644
--- a/o3d/command_buffer/service/win/d3d9/effect_d3d9.cc
+++ b/o3d/command_buffer/service/win/d3d9/effect_d3d9.cc
@@ -227,6 +227,16 @@ static effect_param::DataType GetDataTypeFromD3D(
} else {
return effect_param::UNKNOWN;
}
+ case D3DXPT_TEXTURE:
+ case D3DXPT_TEXTURE1D:
+ case D3DXPT_TEXTURE2D:
+ case D3DXPT_TEXTURE3D:
+ case D3DXPT_TEXTURECUBE:
+ if (desc.Class == D3DXPC_OBJECT) {
+ return effect_param::TEXTURE;
+ } else {
+ return effect_param::UNKNOWN;
+ }
default:
return effect_param::UNKNOWN;
}
@@ -425,6 +435,10 @@ bool EffectParamD3D9::SetData(GAPID3D9 *gapi,
}
break;
}
+ case effect_param::TEXTURE: {
+ // TODO(rlp): finish
+ break;
+ }
default:
DLOG(ERROR) << "Invalid parameter type.";
return false;
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