From f45e5deec9729cf2fcd5edb8a23b76e91334984d Mon Sep 17 00:00:00 2001 From: "petersont@google.com" Date: Wed, 30 Sep 2009 19:57:56 +0000 Subject: Added 32-bit float textures to command buffers, also changed the texture::Format enum to be more like Texture::Format in o3d. Review URL: http://codereview.chromium.org/227011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27644 0039d316-1c4b-4281-b951-d872f2087c98 --- o3d/core/cross/command_buffer/texture_cb.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'o3d/core') diff --git a/o3d/core/cross/command_buffer/texture_cb.cc b/o3d/core/cross/command_buffer/texture_cb.cc index 91791df..3b6b32d 100644 --- a/o3d/core/cross/command_buffer/texture_cb.cc +++ b/o3d/core/cross/command_buffer/texture_cb.cc @@ -65,6 +65,10 @@ texture::Format CBFormatFromO3DFormat(Texture::Format format) { return texture::kARGB8; case Texture::ABGR16F: return texture::kABGR16F; + case Texture::R32F: + return texture::kR32F; + case Texture::ABGR32F: + return texture::kABGR32F; case Texture::DXT1: return texture::kDXT1; // TODO: DXT3/5. It's not yet supported by the command buffer @@ -74,7 +78,7 @@ texture::Format CBFormatFromO3DFormat(Texture::Format format) { } // failed to find a matching format LOG(ERROR) << "Unrecognized Texture format type."; - return texture::kNumFormats; + return texture::kUnknown; } // Checks that enums match in value, so that they can be directly used in @@ -267,7 +271,7 @@ Texture2DCB* Texture2DCB::Create(ServiceLocator* service_locator, RendererCB *renderer = static_cast( service_locator->GetService()); texture::Format cb_format = CBFormatFromO3DFormat(format); - if (cb_format == texture::kNumFormats) { + if (cb_format == texture::kUnknown) { O3D_ERROR(service_locator) << "Unsupported format in Texture2DCB::Create."; return NULL; @@ -482,7 +486,7 @@ TextureCUBECB* TextureCUBECB::Create(ServiceLocator* service_locator, RendererCB *renderer = static_cast( service_locator->GetService()); texture::Format cb_format = CBFormatFromO3DFormat(format); - if (cb_format == texture::kNumFormats) { + if (cb_format == texture::kUnknown) { O3D_ERROR(service_locator) << "Unsupported format in Texture2DCB::Create."; return NULL; -- cgit v1.1